@moontra/moonui 2.1.5 → 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 +8251 -2872
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8100 -2653
- 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 +18 -21
- package/src/components/ui/badge.tsx +5 -8
- 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 +12 -15
- package/src/components/ui/collapsible.tsx +12 -14
- package/src/components/ui/color-picker.tsx +2 -2
- package/src/components/ui/command.tsx +33 -35
- 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 +29 -31
- package/src/components/ui/draggable-list.tsx +81 -0
- package/src/components/ui/dropdown-menu.tsx +42 -44
- 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 +5 -8
- package/src/components/ui/moon-logo.tsx +1 -1
- package/src/components/ui/pagination.tsx +17 -19
- package/src/components/ui/popover.tsx +16 -18
- package/src/components/ui/progress.tsx +6 -9
- package/src/components/ui/radio-group.tsx +11 -14
- package/src/components/ui/rich-text-editor/index.tsx +71 -0
- package/src/components/ui/select.tsx +30 -32
- package/src/components/ui/separator.tsx +6 -9
- package/src/components/ui/simple-editor.tsx +4 -4
- package/src/components/ui/skeleton.tsx +13 -16
- package/src/components/ui/slider.tsx +5 -8
- package/src/components/ui/swipeable-card.tsx +69 -0
- package/src/components/ui/switch.tsx +4 -7
- package/src/components/ui/table.tsx +29 -31
- package/src/components/ui/tabs.tsx +13 -16
- package/src/components/ui/textarea.tsx +4 -7
- package/src/components/ui/toast.tsx +18 -20
- package/src/components/ui/toggle.tsx +5 -8
- package/src/components/ui/tooltip.tsx +16 -18
- 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,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) => (
|
|
@@ -77,10 +77,7 @@ const MoonUISwitch = React.forwardRef<
|
|
|
77
77
|
{description && <span className="text-sm text-muted-foreground">{description}</span>}
|
|
78
78
|
</div>
|
|
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) => (
|
|
@@ -23,7 +23,7 @@ const MoonUITabs = React.forwardRef<
|
|
|
23
23
|
/>
|
|
24
24
|
));
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
Tabs.displayName = TabsPrimitive.Root.displayName;
|
|
27
27
|
|
|
28
28
|
/* -------------------------------------------------------------------------------------------------
|
|
29
29
|
* TabsList
|
|
@@ -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) => (
|
|
@@ -73,7 +73,7 @@ const MoonUITabsList = React.forwardRef<
|
|
|
73
73
|
/>
|
|
74
74
|
));
|
|
75
75
|
|
|
76
|
-
|
|
76
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
77
77
|
|
|
78
78
|
/* -------------------------------------------------------------------------------------------------
|
|
79
79
|
* TabsTrigger
|
|
@@ -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
|
>(({
|
|
@@ -164,18 +164,18 @@ const MoonUITabsTrigger = React.forwardRef<
|
|
|
164
164
|
</TabsPrimitive.Trigger>
|
|
165
165
|
));
|
|
166
166
|
|
|
167
|
-
|
|
167
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
168
168
|
|
|
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) => (
|
|
@@ -190,9 +190,6 @@ const MoonUITabsContent = React.forwardRef<
|
|
|
190
190
|
/>
|
|
191
191
|
));
|
|
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 };
|
|
@@ -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 TextareaProps
|
|
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 MoonUITextareaProps
|
|
|
15
15
|
characterCount?: boolean
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
19
19
|
({
|
|
20
20
|
className,
|
|
21
21
|
// Extract enhanced props to prevent them from being passed to DOM
|
|
@@ -41,9 +41,6 @@ const MoonUITextarea = React.forwardRef<HTMLTextAreaElement, MoonUITextareaProps
|
|
|
41
41
|
)
|
|
42
42
|
}
|
|
43
43
|
)
|
|
44
|
-
|
|
44
|
+
Textarea.displayName = "Textarea"
|
|
45
45
|
|
|
46
|
-
export {
|
|
47
|
-
|
|
48
|
-
// Backward compatibility exports
|
|
49
|
-
export { MoonUITextarea as Textarea }
|
|
46
|
+
export { Textarea }
|
|
@@ -8,7 +8,7 @@ import { cn } from "../../lib/utils";
|
|
|
8
8
|
|
|
9
9
|
const ToastProvider = ToastPrimitives.Provider;
|
|
10
10
|
|
|
11
|
-
const
|
|
11
|
+
const ToastViewport = React.forwardRef<
|
|
12
12
|
React.ElementRef<typeof ToastPrimitives.Viewport>,
|
|
13
13
|
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Viewport>
|
|
14
14
|
>(({ className, ...props }, ref) => (
|
|
@@ -21,9 +21,9 @@ const MoonUIToastViewport = React.forwardRef<
|
|
|
21
21
|
{...props}
|
|
22
22
|
/>
|
|
23
23
|
));
|
|
24
|
-
|
|
24
|
+
ToastViewport.displayName = ToastPrimitives.Viewport.displayName;
|
|
25
25
|
|
|
26
|
-
const
|
|
26
|
+
const toastVariants = 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 moonUIToastVariants = cva(
|
|
|
46
46
|
);
|
|
47
47
|
|
|
48
48
|
type ToastProps = React.ComponentPropsWithoutRef<typeof ToastPrimitives.Root> &
|
|
49
|
-
VariantProps<typeof
|
|
49
|
+
VariantProps<typeof toastVariants>;
|
|
50
50
|
|
|
51
51
|
type ToastActionElement = React.ReactElement<typeof ToastAction>;
|
|
52
52
|
|
|
53
|
-
const
|
|
53
|
+
const Toast = React.forwardRef<
|
|
54
54
|
React.ElementRef<typeof ToastPrimitives.Root>,
|
|
55
55
|
ToastProps
|
|
56
56
|
>(({ className, variant, ...props }, ref) => {
|
|
@@ -62,9 +62,9 @@ const MoonUIToast = React.forwardRef<
|
|
|
62
62
|
/>
|
|
63
63
|
);
|
|
64
64
|
});
|
|
65
|
-
|
|
65
|
+
Toast.displayName = ToastPrimitives.Root.displayName;
|
|
66
66
|
|
|
67
|
-
const
|
|
67
|
+
const ToastAction = React.forwardRef<
|
|
68
68
|
React.ElementRef<typeof ToastPrimitives.Action>,
|
|
69
69
|
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Action>
|
|
70
70
|
>(({ className, ...props }, ref) => (
|
|
@@ -77,9 +77,9 @@ const MoonUIToastAction = React.forwardRef<
|
|
|
77
77
|
{...props}
|
|
78
78
|
/>
|
|
79
79
|
));
|
|
80
|
-
|
|
80
|
+
ToastAction.displayName = ToastPrimitives.Action.displayName;
|
|
81
81
|
|
|
82
|
-
const
|
|
82
|
+
const ToastClose = React.forwardRef<
|
|
83
83
|
React.ElementRef<typeof ToastPrimitives.Close>,
|
|
84
84
|
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Close>
|
|
85
85
|
>(({ className, ...props }, ref) => (
|
|
@@ -95,9 +95,9 @@ const MoonUIToastClose = React.forwardRef<
|
|
|
95
95
|
<X className="h-4 w-4" />
|
|
96
96
|
</ToastPrimitives.Close>
|
|
97
97
|
));
|
|
98
|
-
|
|
98
|
+
ToastClose.displayName = ToastPrimitives.Close.displayName;
|
|
99
99
|
|
|
100
|
-
const
|
|
100
|
+
const ToastTitle = React.forwardRef<
|
|
101
101
|
React.ElementRef<typeof ToastPrimitives.Title>,
|
|
102
102
|
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Title>
|
|
103
103
|
>(({ className, ...props }, ref) => (
|
|
@@ -107,9 +107,9 @@ const MoonUIToastTitle = React.forwardRef<
|
|
|
107
107
|
{...props}
|
|
108
108
|
/>
|
|
109
109
|
));
|
|
110
|
-
|
|
110
|
+
ToastTitle.displayName = ToastPrimitives.Title.displayName;
|
|
111
111
|
|
|
112
|
-
const
|
|
112
|
+
const ToastDescription = React.forwardRef<
|
|
113
113
|
React.ElementRef<typeof ToastPrimitives.Description>,
|
|
114
114
|
React.ComponentPropsWithoutRef<typeof ToastPrimitives.Description>
|
|
115
115
|
>(({ className, ...props }, ref) => (
|
|
@@ -119,7 +119,7 @@ const MoonUIToastDescription = React.forwardRef<
|
|
|
119
119
|
{...props}
|
|
120
120
|
/>
|
|
121
121
|
));
|
|
122
|
-
|
|
122
|
+
ToastDescription.displayName = ToastPrimitives.Description.displayName;
|
|
123
123
|
|
|
124
124
|
type ToastData = {
|
|
125
125
|
id: string;
|
|
@@ -297,11 +297,12 @@ function Toaster() {
|
|
|
297
297
|
);
|
|
298
298
|
}
|
|
299
299
|
|
|
300
|
-
export {
|
|
300
|
+
export {
|
|
301
|
+
type ToastProps,
|
|
301
302
|
type ToastActionElement,
|
|
302
303
|
ToastProvider,
|
|
303
304
|
ToastViewport,
|
|
304
|
-
|
|
305
|
+
Toast,
|
|
305
306
|
ToastTitle,
|
|
306
307
|
ToastDescription,
|
|
307
308
|
ToastAction,
|
|
@@ -309,7 +310,4 @@ export { type ToastProps,
|
|
|
309
310
|
Toaster,
|
|
310
311
|
toast,
|
|
311
312
|
useToast,
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
// Backward compatibility exports
|
|
315
|
-
export { MoonUIToast as Toast };
|
|
313
|
+
};
|
|
@@ -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 toggleVariants = cva(
|
|
10
10
|
"inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors hover:bg-muted hover:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=on]:bg-accent data-[state=on]:text-accent-foreground",
|
|
11
11
|
{
|
|
12
12
|
variants: {
|
|
@@ -28,9 +28,9 @@ const moonUIToggleVariants = cva(
|
|
|
28
28
|
}
|
|
29
29
|
)
|
|
30
30
|
|
|
31
|
-
export interface
|
|
31
|
+
export interface ToggleProps extends React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root>, VariantProps<typeof toggleVariants> {}
|
|
32
32
|
|
|
33
|
-
const
|
|
33
|
+
const Toggle = React.forwardRef<
|
|
34
34
|
React.ElementRef<typeof TogglePrimitive.Root>,
|
|
35
35
|
ToggleProps
|
|
36
36
|
>(({ className, variant, size, ...props }, ref) => (
|
|
@@ -41,10 +41,7 @@ const MoonUIToggle = React.forwardRef<
|
|
|
41
41
|
/>
|
|
42
42
|
))
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
Toggle.displayName = TogglePrimitive.Root.displayName
|
|
45
45
|
|
|
46
|
-
export {
|
|
47
|
-
|
|
48
|
-
// Backward compatibility exports
|
|
49
|
-
export { MoonUIToggle as Toggle, moonUIToggleVariants as toggleVariants }
|
|
46
|
+
export { Toggle, toggleVariants }
|
|
50
47
|
export type { ToggleProps }
|
|
@@ -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 TooltipProvider = TooltipPrimitive.Provider
|
|
10
10
|
|
|
11
11
|
const tooltipVariants = cva(
|
|
12
12
|
"z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",
|
|
@@ -33,11 +33,11 @@ const tooltipVariants = cva(
|
|
|
33
33
|
}
|
|
34
34
|
)
|
|
35
35
|
|
|
36
|
-
const
|
|
36
|
+
const Tooltip = TooltipPrimitive.Root
|
|
37
37
|
|
|
38
|
-
const
|
|
38
|
+
const TooltipTrigger = TooltipPrimitive.Trigger
|
|
39
39
|
|
|
40
|
-
const
|
|
40
|
+
const TooltipArrow = React.forwardRef<
|
|
41
41
|
React.ElementRef<typeof TooltipPrimitive.Arrow>,
|
|
42
42
|
React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Arrow>
|
|
43
43
|
>(({ className, ...props }, ref) => (
|
|
@@ -47,15 +47,15 @@ const MoonUITooltipArrow = React.forwardRef<
|
|
|
47
47
|
{...props}
|
|
48
48
|
/>
|
|
49
49
|
))
|
|
50
|
-
|
|
50
|
+
TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName
|
|
51
51
|
|
|
52
|
-
export interface
|
|
52
|
+
export interface TooltipContentProps
|
|
53
53
|
extends React.ComponentPropsWithoutRef<typeof TooltipPrimitive.Content>,
|
|
54
54
|
VariantProps<typeof tooltipVariants> {
|
|
55
55
|
showArrow?: boolean
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
const
|
|
58
|
+
const TooltipContent = React.forwardRef<
|
|
59
59
|
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
60
60
|
TooltipContentProps
|
|
61
61
|
>(({ className, variant, size, showArrow = false, sideOffset = 4, ...props }, ref) => (
|
|
@@ -69,7 +69,7 @@ const MoonUITooltipContent = React.forwardRef<
|
|
|
69
69
|
{showArrow && <TooltipArrow />}
|
|
70
70
|
</TooltipPrimitive.Content>
|
|
71
71
|
))
|
|
72
|
-
|
|
72
|
+
TooltipContent.displayName = TooltipPrimitive.Content.displayName
|
|
73
73
|
|
|
74
74
|
// Simplified Tooltip component for easy usage
|
|
75
75
|
export interface SimpleTooltipProps {
|
|
@@ -89,7 +89,7 @@ export interface SimpleTooltipProps {
|
|
|
89
89
|
onOpenChange?: (open: boolean) => void
|
|
90
90
|
}
|
|
91
91
|
|
|
92
|
-
const
|
|
92
|
+
const SimpleTooltip = React.forwardRef<
|
|
93
93
|
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
94
94
|
SimpleTooltipProps
|
|
95
95
|
>(
|
|
@@ -139,16 +139,14 @@ const MoonUISimpleTooltip = React.forwardRef<
|
|
|
139
139
|
)
|
|
140
140
|
}
|
|
141
141
|
)
|
|
142
|
-
|
|
142
|
+
SimpleTooltip.displayName = "SimpleTooltip"
|
|
143
143
|
|
|
144
|
-
export {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
144
|
+
export {
|
|
145
|
+
Tooltip,
|
|
146
|
+
TooltipProvider,
|
|
147
|
+
TooltipTrigger,
|
|
148
|
+
TooltipContent,
|
|
148
149
|
TooltipArrow,
|
|
149
150
|
SimpleTooltip,
|
|
150
151
|
tooltipVariants,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
// Backward compatibility exports
|
|
154
|
-
export { MoonUITooltip as Tooltip, MoonUITooltipTrigger as TooltipTrigger, MoonUITooltipContent as TooltipContent, MoonUITooltipProvider as TooltipProvider }
|
|
152
|
+
}
|
package/src/index.tsx
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
1
|
+
// Core UI Components Export
|
|
2
|
+
// Premium components with advanced features
|
|
3
3
|
|
|
4
|
-
// FREE UI Components Export - Source of Truth
|
|
5
4
|
export * from "./components/ui/accordion"
|
|
6
5
|
export * from "./components/ui/alert"
|
|
7
6
|
export * from "./components/ui/aspect-ratio"
|
|
@@ -13,27 +12,34 @@ export * from "./components/ui/calendar"
|
|
|
13
12
|
export * from "./components/ui/card"
|
|
14
13
|
export * from "./components/ui/checkbox"
|
|
15
14
|
export * from "./components/ui/collapsible"
|
|
15
|
+
export * from "./components/ui/color-picker"
|
|
16
16
|
export * from "./components/ui/command"
|
|
17
|
+
export * from "./components/ui/data-table"
|
|
17
18
|
export * from "./components/ui/date-picker"
|
|
18
19
|
export * from "./components/ui/dialog"
|
|
20
|
+
export * from "./components/ui/draggable-list"
|
|
19
21
|
export * from "./components/ui/dropdown-menu"
|
|
22
|
+
export * from "./components/ui/file-upload"
|
|
23
|
+
export * from "./components/ui/gesture-drawer"
|
|
24
|
+
export * from "./components/ui/github-stars"
|
|
20
25
|
export * from "./components/ui/input"
|
|
21
26
|
export * from "./components/ui/label"
|
|
27
|
+
export * from "./components/ui/moon-logo"
|
|
22
28
|
export * from "./components/ui/pagination"
|
|
23
29
|
export * from "./components/ui/popover"
|
|
24
30
|
export * from "./components/ui/progress"
|
|
25
31
|
export * from "./components/ui/radio-group"
|
|
32
|
+
export * from "./components/ui/rich-text-editor"
|
|
26
33
|
export * from "./components/ui/select"
|
|
27
34
|
export * from "./components/ui/separator"
|
|
35
|
+
export * from "./components/ui/simple-editor"
|
|
28
36
|
export * from "./components/ui/skeleton"
|
|
29
37
|
export * from "./components/ui/slider"
|
|
38
|
+
export * from "./components/ui/swipeable-card"
|
|
30
39
|
export * from "./components/ui/switch"
|
|
31
40
|
export * from "./components/ui/table"
|
|
32
41
|
export * from "./components/ui/tabs"
|
|
33
42
|
export * from "./components/ui/textarea"
|
|
34
43
|
export * from "./components/ui/toast"
|
|
35
44
|
export * from "./components/ui/toggle"
|
|
36
|
-
export * from "./components/ui/tooltip"
|
|
37
|
-
|
|
38
|
-
// Utility exports
|
|
39
|
-
export * from "./lib/utils"
|
|
45
|
+
export * from "./components/ui/tooltip"
|