@moontra/moonui 2.1.9 → 2.2.1
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.d.mts +1656 -0
- package/dist/index.d.ts +1656 -0
- package/dist/index.js +1847 -469
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1679 -471
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/components/ui/accordion.tsx +1 -1
- package/src/components/ui/alert.tsx +123 -93
- package/src/components/ui/aspect-ratio.tsx +1 -1
- package/src/components/ui/avatar.tsx +8 -6
- package/src/components/ui/badge.tsx +20 -18
- package/src/components/ui/breadcrumb.tsx +12 -10
- package/src/components/ui/button.stories.tsx +4 -2
- package/src/components/ui/button.tsx +71 -68
- package/src/components/ui/calendar.tsx +2 -2
- package/src/components/ui/card-input.tsx +231 -0
- package/src/components/ui/card.stories.tsx +2 -0
- package/src/components/ui/card.tsx +9 -7
- package/src/components/ui/checkbox.tsx +1 -1
- package/src/components/ui/collapsible.tsx +3 -3
- package/src/components/ui/color-picker.tsx +2 -2
- package/src/components/ui/command.tsx +4 -4
- package/src/components/ui/data-table.stories.tsx +4 -2
- package/src/components/ui/data-table.tsx +8 -8
- package/src/components/ui/date-picker.stories.tsx +2 -0
- package/src/components/ui/date-picker.tsx +25 -15
- package/src/components/ui/dialog.tsx +2 -2
- package/src/components/ui/draggable-list.tsx +3 -1
- package/src/components/ui/dropdown-menu.tsx +2 -2
- package/src/components/ui/file-upload.tsx +2 -2
- package/src/components/ui/github-stars.tsx +1 -1
- package/src/components/ui/index.ts +357 -45
- package/src/components/ui/input.stories.tsx +2 -0
- package/src/components/ui/input.tsx +3 -1
- package/src/components/ui/locked-component.tsx +222 -0
- package/src/components/ui/moon-logo.tsx +1 -1
- package/src/components/ui/pagination.tsx +10 -8
- package/src/components/ui/phone-input.tsx +172 -0
- package/src/components/ui/popover-pro.tsx +424 -0
- package/src/components/ui/popover.tsx +3 -3
- package/src/components/ui/progress.tsx +1 -1
- package/src/components/ui/radio-group.tsx +1 -1
- package/src/components/ui/rich-text-editor/index.tsx +2 -1
- package/src/components/ui/scroll-area.tsx +48 -0
- package/src/components/ui/select.tsx +7 -3
- package/src/components/ui/separator.tsx +2 -2
- package/src/components/ui/skeleton.tsx +19 -7
- package/src/components/ui/slider.tsx +1 -1
- package/src/components/ui/swipeable-card.tsx +2 -0
- package/src/components/ui/switch.tsx +1 -1
- package/src/components/ui/table.tsx +7 -5
- package/src/components/ui/tabs.tsx +6 -1
- package/src/components/ui/tags-input.tsx +130 -0
- package/src/components/ui/textarea.tsx +3 -1
- package/src/components/ui/toast.tsx +5 -3
- package/src/components/ui/toggle.tsx +2 -3
- package/src/components/ui/tooltip.tsx +2 -5
- package/src/index.tsx +4 -46
- package/src/lib/micro-interactions.ts +2 -1
- package/src/lib/performance-profiler.ts +79 -0
- package/src/styles/index.css +315 -2
- package/src/use-performance-optimizer.ts +26 -26
- package/src/use-scroll-animation.ts +5 -7
|
@@ -292,7 +292,7 @@ export function DataTable<TData, TValue>({
|
|
|
292
292
|
const selectedRows = table.getFilteredSelectedRowModel().rows;
|
|
293
293
|
|
|
294
294
|
return (
|
|
295
|
-
<div className={cn("space-y-4", className)}>
|
|
295
|
+
<div className={cn("moonui-theme", "space-y-4", className)}>
|
|
296
296
|
{/* Header */}
|
|
297
297
|
{(title || description) && (
|
|
298
298
|
<div className="space-y-1">
|
|
@@ -302,13 +302,13 @@ export function DataTable<TData, TValue>({
|
|
|
302
302
|
)}
|
|
303
303
|
|
|
304
304
|
{/* Toolbar */}
|
|
305
|
-
<div className="flex
|
|
306
|
-
<div className="flex
|
|
305
|
+
<div className="flex items-center justify-between gap-4">
|
|
306
|
+
<div className="flex-1 max-w-sm">
|
|
307
307
|
{/* Search/Filter */}
|
|
308
308
|
{enableFiltering && (
|
|
309
309
|
<>
|
|
310
310
|
{customFilter || (
|
|
311
|
-
<div className="relative
|
|
311
|
+
<div className="relative">
|
|
312
312
|
<Search className="absolute left-2 top-2.5 h-4 w-4 text-muted-foreground" />
|
|
313
313
|
<Input
|
|
314
314
|
placeholder={filterPlaceholder}
|
|
@@ -348,17 +348,17 @@ export function DataTable<TData, TValue>({
|
|
|
348
348
|
)}
|
|
349
349
|
</>
|
|
350
350
|
)}
|
|
351
|
+
</div>
|
|
351
352
|
|
|
353
|
+
{/* Actions */}
|
|
354
|
+
<div className="flex items-center gap-2">
|
|
352
355
|
{/* Selection info */}
|
|
353
356
|
{enableRowSelection && selectedRows.length > 0 && (
|
|
354
357
|
<Badge variant="secondary" className="whitespace-nowrap">
|
|
355
358
|
{selectedRows.length} selected
|
|
356
359
|
</Badge>
|
|
357
360
|
)}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
{/* Actions */}
|
|
361
|
-
<div className="flex items-center gap-2">
|
|
361
|
+
|
|
362
362
|
{toolbarActions}
|
|
363
363
|
|
|
364
364
|
{/* Export */}
|
|
@@ -13,7 +13,12 @@ import {
|
|
|
13
13
|
} from "./popover";
|
|
14
14
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
15
15
|
import { motion, AnimatePresence } from "framer-motion";
|
|
16
|
-
|
|
16
|
+
// Define pageTransitions locally since micro-interactions might not exist
|
|
17
|
+
const pageTransitions = {
|
|
18
|
+
initial: { opacity: 0, x: 20 },
|
|
19
|
+
animate: { opacity: 1, x: 0 },
|
|
20
|
+
exit: { opacity: 0, x: -20 }
|
|
21
|
+
};
|
|
17
22
|
|
|
18
23
|
/**
|
|
19
24
|
* DatePicker Component
|
|
@@ -29,7 +34,6 @@ const datePickerVariants = cva(
|
|
|
29
34
|
default: "",
|
|
30
35
|
outline: "border-2",
|
|
31
36
|
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
32
|
-
minimal: "h-auto p-0 border-0 shadow-none",
|
|
33
37
|
},
|
|
34
38
|
size: {
|
|
35
39
|
default: "h-10 px-4 py-2",
|
|
@@ -147,10 +151,14 @@ export function DatePicker({
|
|
|
147
151
|
setInternalDate(value);
|
|
148
152
|
}, [value]);
|
|
149
153
|
|
|
150
|
-
const handleSelect = (date: Date | undefined) => {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
+
const handleSelect = (date: Date | Date[] | { from?: Date; to?: Date } | undefined) => {
|
|
155
|
+
// Handle single date selection for now
|
|
156
|
+
const singleDate = Array.isArray(date) ? date[0] :
|
|
157
|
+
(date && typeof date === 'object' && 'from' in date) ? date.from :
|
|
158
|
+
date as Date | undefined;
|
|
159
|
+
setInternalDate(singleDate);
|
|
160
|
+
onChange?.(singleDate);
|
|
161
|
+
if (singleDate) {
|
|
154
162
|
setOpen(false);
|
|
155
163
|
}
|
|
156
164
|
};
|
|
@@ -180,10 +188,11 @@ export function DatePicker({
|
|
|
180
188
|
const iconElement = icon || <CalendarIcon className="h-4 w-4" />;
|
|
181
189
|
|
|
182
190
|
return (
|
|
183
|
-
<
|
|
191
|
+
<div className="moonui-theme">
|
|
192
|
+
<Popover open={open} onOpenChange={setOpen}>
|
|
184
193
|
<PopoverTrigger asChild>
|
|
185
194
|
<Button
|
|
186
|
-
variant={variant === "
|
|
195
|
+
variant={variant === "ghost" ? "ghost" : "outline"}
|
|
187
196
|
className={cn(
|
|
188
197
|
datePickerVariants({ variant, size, state }),
|
|
189
198
|
!displayValue && "text-muted-foreground",
|
|
@@ -246,12 +255,12 @@ export function DatePicker({
|
|
|
246
255
|
</Button>
|
|
247
256
|
</PopoverTrigger>
|
|
248
257
|
<PopoverContent
|
|
249
|
-
className="w-[360px] p-0 shadow-
|
|
258
|
+
className="w-[360px] p-0 shadow-2xl rounded-2xl border border-gray-200 dark:border-gray-700 bg-background/95 backdrop-blur-sm z-[1000]"
|
|
250
259
|
align="start"
|
|
251
260
|
sideOffset={12}
|
|
252
261
|
>
|
|
253
262
|
<motion.div
|
|
254
|
-
{...
|
|
263
|
+
{...pageTransitions}
|
|
255
264
|
className="rounded-2xl bg-background overflow-hidden"
|
|
256
265
|
>
|
|
257
266
|
<Calendar
|
|
@@ -278,6 +287,7 @@ export function DatePicker({
|
|
|
278
287
|
</motion.div>
|
|
279
288
|
</PopoverContent>
|
|
280
289
|
</Popover>
|
|
290
|
+
</div>
|
|
281
291
|
);
|
|
282
292
|
}
|
|
283
293
|
|
|
@@ -342,7 +352,7 @@ export function DateRangePicker({
|
|
|
342
352
|
<Popover open={open} onOpenChange={setOpen}>
|
|
343
353
|
<PopoverTrigger asChild>
|
|
344
354
|
<Button
|
|
345
|
-
variant={props.variant === "
|
|
355
|
+
variant={props.variant === "ghost" ? "ghost" : "outline"}
|
|
346
356
|
className={cn(
|
|
347
357
|
datePickerVariants({
|
|
348
358
|
variant: props.variant,
|
|
@@ -360,7 +370,7 @@ export function DateRangePicker({
|
|
|
360
370
|
</span>
|
|
361
371
|
</Button>
|
|
362
372
|
</PopoverTrigger>
|
|
363
|
-
<PopoverContent className="w-auto p-0 shadow-
|
|
373
|
+
<PopoverContent className="w-auto p-0 shadow-2xl rounded-2xl border border-gray-200 dark:border-gray-700 bg-background/95 backdrop-blur-sm z-[1000]" align="start" sideOffset={12}>
|
|
364
374
|
<Calendar
|
|
365
375
|
mode="range"
|
|
366
376
|
defaultMonth={internalRange?.from}
|
|
@@ -540,7 +550,7 @@ export function MonthPicker({
|
|
|
540
550
|
<Popover open={open} onOpenChange={setOpen}>
|
|
541
551
|
<PopoverTrigger asChild>
|
|
542
552
|
<Button
|
|
543
|
-
variant={props.variant || "outline"}
|
|
553
|
+
variant={props.variant === "default" ? "outline" : (props.variant || "outline")}
|
|
544
554
|
className={cn(
|
|
545
555
|
datePickerVariants({
|
|
546
556
|
variant: props.variant,
|
|
@@ -556,7 +566,7 @@ export function MonthPicker({
|
|
|
556
566
|
{displayValue || placeholder}
|
|
557
567
|
</Button>
|
|
558
568
|
</PopoverTrigger>
|
|
559
|
-
<PopoverContent className="w-64 p-0" align="start">
|
|
569
|
+
<PopoverContent className="w-64 p-0 shadow-2xl border border-gray-200 dark:border-gray-700 bg-background z-[1000]" align="start">
|
|
560
570
|
<div className="p-3">
|
|
561
571
|
<div className="flex items-center justify-between mb-3">
|
|
562
572
|
<Button
|
|
@@ -581,7 +591,7 @@ export function MonthPicker({
|
|
|
581
591
|
{months.map((month, index) => (
|
|
582
592
|
<Button
|
|
583
593
|
key={month}
|
|
584
|
-
variant={value && value.getMonth() === index ? "
|
|
594
|
+
variant={value && value.getMonth() === index ? "primary" : "outline"}
|
|
585
595
|
size="sm"
|
|
586
596
|
onClick={() => handleMonthSelect(index)}
|
|
587
597
|
className="h-8 text-xs"
|
|
@@ -53,7 +53,7 @@ const DialogOverlay = React.forwardRef<
|
|
|
53
53
|
>(({ className, variant, animation, ...props }, ref) => (
|
|
54
54
|
<DialogPrimitive.Overlay
|
|
55
55
|
ref={ref}
|
|
56
|
-
className={cn(overlayVariants({ variant, animation }), className)}
|
|
56
|
+
className={cn("moonui-theme", overlayVariants({ variant, animation }), className)}
|
|
57
57
|
{...props}
|
|
58
58
|
/>
|
|
59
59
|
));
|
|
@@ -313,7 +313,7 @@ const DialogForm = React.forwardRef<
|
|
|
313
313
|
>(({ className, ...props }, ref) => (
|
|
314
314
|
<form
|
|
315
315
|
ref={ref}
|
|
316
|
-
className={cn("flex flex-col gap-4", className)}
|
|
316
|
+
className={cn("moonui-theme", "flex flex-col gap-4", className)}
|
|
317
317
|
{...props}
|
|
318
318
|
/>
|
|
319
319
|
));
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
// Basic Draggable List - Free Version
|
|
2
4
|
"use client"
|
|
3
5
|
|
|
@@ -57,7 +59,7 @@ export function DraggableList<T>({
|
|
|
57
59
|
}
|
|
58
60
|
|
|
59
61
|
return (
|
|
60
|
-
<div className={cn("space-y-2", className)}>
|
|
62
|
+
<div className={cn("moonui-theme", "space-y-2", className)}>
|
|
61
63
|
{items.map((item, index) => (
|
|
62
64
|
<div
|
|
63
65
|
key={keyExtractor(item)}
|
|
@@ -162,7 +162,7 @@ const DropdownMenuSeparator = React.forwardRef<
|
|
|
162
162
|
>(({ className, ...props }, ref) => (
|
|
163
163
|
<DropdownMenuPrimitive.Separator
|
|
164
164
|
ref={ref}
|
|
165
|
-
className={cn("-mx-1 my-1 h-px bg-muted", className)}
|
|
165
|
+
className={cn("moonui-theme", "-mx-1 my-1 h-px bg-muted", className)}
|
|
166
166
|
{...props}
|
|
167
167
|
/>
|
|
168
168
|
))
|
|
@@ -174,7 +174,7 @@ const DropdownMenuShortcut = ({
|
|
|
174
174
|
}: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
175
175
|
return (
|
|
176
176
|
<span
|
|
177
|
-
className={cn("ml-auto text-xs tracking-widest opacity-60", className)}
|
|
177
|
+
className={cn("moonui-theme", "ml-auto text-xs tracking-widest opacity-60", className)}
|
|
178
178
|
{...props}
|
|
179
179
|
/>
|
|
180
180
|
)
|
|
@@ -111,7 +111,7 @@ const FileItem = ({
|
|
|
111
111
|
</Badge>
|
|
112
112
|
)}
|
|
113
113
|
{status === 'success' && (
|
|
114
|
-
<Badge variant="
|
|
114
|
+
<Badge variant="success" className="h-5">
|
|
115
115
|
<CheckCircle className="h-3 w-3 mr-1" />
|
|
116
116
|
Done
|
|
117
117
|
</Badge>
|
|
@@ -302,7 +302,7 @@ export const FileUpload = React.forwardRef<HTMLDivElement, FileUploadProps>(
|
|
|
302
302
|
}, [onRemove])
|
|
303
303
|
|
|
304
304
|
return (
|
|
305
|
-
<div ref={ref} className={cn("space-y-4", className)} {...props}>
|
|
305
|
+
<div ref={ref} className={cn("moonui-theme", "space-y-4", className)} {...props}>
|
|
306
306
|
{/* Upload Area */}
|
|
307
307
|
<motion.div
|
|
308
308
|
className={cn(
|
|
@@ -1,45 +1,357 @@
|
|
|
1
|
-
//
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
export
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
export
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
export
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
// Free Components Export - Local Files
|
|
2
|
+
// This is the index for packages/moonui/src/components/ui/
|
|
3
|
+
// All exports use MoonUI prefix for consistency
|
|
4
|
+
|
|
5
|
+
// Accordion
|
|
6
|
+
export {
|
|
7
|
+
Accordion as MoonUIAccordion,
|
|
8
|
+
AccordionItem as MoonUIAccordionItem,
|
|
9
|
+
AccordionTrigger as MoonUIAccordionTrigger,
|
|
10
|
+
AccordionContent as MoonUIAccordionContent,
|
|
11
|
+
} from "./accordion";
|
|
12
|
+
|
|
13
|
+
// Alert
|
|
14
|
+
export {
|
|
15
|
+
Alert as MoonUIAlert,
|
|
16
|
+
AlertTitle as MoonUIAlertTitle,
|
|
17
|
+
AlertDescription as MoonUIAlertDescription,
|
|
18
|
+
} from "./alert";
|
|
19
|
+
|
|
20
|
+
// AspectRatio
|
|
21
|
+
export { AspectRatio as MoonUIAspectRatio } from "./aspect-ratio";
|
|
22
|
+
|
|
23
|
+
// Avatar
|
|
24
|
+
export {
|
|
25
|
+
Avatar as MoonUIAvatar,
|
|
26
|
+
AvatarImage as MoonUIAvatarImage,
|
|
27
|
+
AvatarFallback as MoonUIAvatarFallback,
|
|
28
|
+
AvatarGroup as MoonUIAvatarGroup,
|
|
29
|
+
} from "./avatar";
|
|
30
|
+
|
|
31
|
+
// Badge
|
|
32
|
+
export {
|
|
33
|
+
Badge as MoonUIBadge,
|
|
34
|
+
badgeVariants as moonUIBadgeVariants,
|
|
35
|
+
} from "./badge";
|
|
36
|
+
|
|
37
|
+
// Breadcrumb
|
|
38
|
+
export {
|
|
39
|
+
Breadcrumb as MoonUIBreadcrumb,
|
|
40
|
+
BreadcrumbList as MoonUIBreadcrumbList,
|
|
41
|
+
BreadcrumbItem as MoonUIBreadcrumbItem,
|
|
42
|
+
BreadcrumbLink as MoonUIBreadcrumbLink,
|
|
43
|
+
BreadcrumbPage as MoonUIBreadcrumbPage,
|
|
44
|
+
BreadcrumbSeparator as MoonUIBreadcrumbSeparator,
|
|
45
|
+
BreadcrumbEllipsis as MoonUIBreadcrumbEllipsis,
|
|
46
|
+
} from "./breadcrumb";
|
|
47
|
+
|
|
48
|
+
// Button
|
|
49
|
+
export {
|
|
50
|
+
Button as MoonUIButton,
|
|
51
|
+
buttonVariants as moonUIButtonVariants,
|
|
52
|
+
} from "./button";
|
|
53
|
+
|
|
54
|
+
// Card
|
|
55
|
+
export {
|
|
56
|
+
Card as MoonUICard,
|
|
57
|
+
CardHeader as MoonUICardHeader,
|
|
58
|
+
CardFooter as MoonUICardFooter,
|
|
59
|
+
CardTitle as MoonUICardTitle,
|
|
60
|
+
CardDescription as MoonUICardDescription,
|
|
61
|
+
CardContent as MoonUICardContent,
|
|
62
|
+
} from "./card";
|
|
63
|
+
|
|
64
|
+
// Card Input
|
|
65
|
+
export {
|
|
66
|
+
CardNumberInput as MoonUICardNumberInput,
|
|
67
|
+
CardExpiryInput as MoonUICardExpiryInput,
|
|
68
|
+
CardCVCInput as MoonUICardCVCInput,
|
|
69
|
+
CardZipInput as MoonUICardZipInput,
|
|
70
|
+
} from "./card-input";
|
|
71
|
+
|
|
72
|
+
// Checkbox
|
|
73
|
+
export {
|
|
74
|
+
Checkbox as MoonUICheckbox,
|
|
75
|
+
CheckboxWithLabel as MoonUICheckboxWithLabel,
|
|
76
|
+
CheckboxGroup as MoonUICheckboxGroup,
|
|
77
|
+
CheckboxLabel as MoonUICheckboxLabel,
|
|
78
|
+
} from "./checkbox";
|
|
79
|
+
|
|
80
|
+
// Collapsible
|
|
81
|
+
export {
|
|
82
|
+
Collapsible as MoonUICollapsible,
|
|
83
|
+
CollapsibleTrigger as MoonUICollapsibleTrigger,
|
|
84
|
+
CollapsibleContent as MoonUICollapsibleContent,
|
|
85
|
+
} from "./collapsible";
|
|
86
|
+
|
|
87
|
+
// ColorPicker
|
|
88
|
+
export {
|
|
89
|
+
ColorPicker as MoonUIColorPicker,
|
|
90
|
+
SimpleColorPicker as MoonUISimpleColorPicker,
|
|
91
|
+
GradientPicker as MoonUIGradientPicker,
|
|
92
|
+
} from "./color-picker";
|
|
93
|
+
|
|
94
|
+
// Command
|
|
95
|
+
export {
|
|
96
|
+
Command as MoonUICommand,
|
|
97
|
+
CommandDialog as MoonUICommandDialog,
|
|
98
|
+
CommandInput as MoonUICommandInput,
|
|
99
|
+
CommandList as MoonUICommandList,
|
|
100
|
+
CommandEmpty as MoonUICommandEmpty,
|
|
101
|
+
CommandGroup as MoonUICommandGroup,
|
|
102
|
+
CommandItem as MoonUICommandItem,
|
|
103
|
+
CommandShortcut as MoonUICommandShortcut,
|
|
104
|
+
CommandSeparator as MoonUICommandSeparator,
|
|
105
|
+
} from "./command";
|
|
106
|
+
|
|
107
|
+
// DataTable
|
|
108
|
+
export { DataTable as MoonUIDataTable } from "./data-table";
|
|
109
|
+
|
|
110
|
+
// DatePicker
|
|
111
|
+
export {
|
|
112
|
+
DatePicker as MoonUIDatePicker,
|
|
113
|
+
DateRangePicker as MoonUIDateRangePicker,
|
|
114
|
+
DateTimePicker as MoonUIDateTimePicker,
|
|
115
|
+
MonthPicker as MoonUIMonthPicker,
|
|
116
|
+
} from "./date-picker";
|
|
117
|
+
|
|
118
|
+
// Dialog
|
|
119
|
+
export {
|
|
120
|
+
Dialog as MoonUIDialog,
|
|
121
|
+
DialogClose as MoonUIDialogClose,
|
|
122
|
+
DialogTrigger as MoonUIDialogTrigger,
|
|
123
|
+
DialogContent as MoonUIDialogContent,
|
|
124
|
+
DialogHeader as MoonUIDialogHeader,
|
|
125
|
+
DialogFooter as MoonUIDialogFooter,
|
|
126
|
+
DialogTitle as MoonUIDialogTitle,
|
|
127
|
+
DialogDescription as MoonUIDialogDescription,
|
|
128
|
+
} from "./dialog";
|
|
129
|
+
|
|
130
|
+
// DraggableList
|
|
131
|
+
export { DraggableList as MoonUIDraggableList } from "./draggable-list";
|
|
132
|
+
|
|
133
|
+
// DropdownMenu
|
|
134
|
+
export {
|
|
135
|
+
DropdownMenu as MoonUIDropdownMenu,
|
|
136
|
+
DropdownMenuTrigger as MoonUIDropdownMenuTrigger,
|
|
137
|
+
DropdownMenuContent as MoonUIDropdownMenuContent,
|
|
138
|
+
DropdownMenuItem as MoonUIDropdownMenuItem,
|
|
139
|
+
DropdownMenuCheckboxItem as MoonUIDropdownMenuCheckboxItem,
|
|
140
|
+
DropdownMenuRadioItem as MoonUIDropdownMenuRadioItem,
|
|
141
|
+
DropdownMenuLabel as MoonUIDropdownMenuLabel,
|
|
142
|
+
DropdownMenuSeparator as MoonUIDropdownMenuSeparator,
|
|
143
|
+
DropdownMenuShortcut as MoonUIDropdownMenuShortcut,
|
|
144
|
+
DropdownMenuGroup as MoonUIDropdownMenuGroup,
|
|
145
|
+
DropdownMenuPortal as MoonUIDropdownMenuPortal,
|
|
146
|
+
DropdownMenuSub as MoonUIDropdownMenuSub,
|
|
147
|
+
DropdownMenuSubContent as MoonUIDropdownMenuSubContent,
|
|
148
|
+
DropdownMenuSubTrigger as MoonUIDropdownMenuSubTrigger,
|
|
149
|
+
DropdownMenuRadioGroup as MoonUIDropdownMenuRadioGroup,
|
|
150
|
+
} from "./dropdown-menu";
|
|
151
|
+
|
|
152
|
+
// FileUpload
|
|
153
|
+
export { FileUpload as MoonUIFileUpload } from "./file-upload";
|
|
154
|
+
|
|
155
|
+
// GestureDrawer
|
|
156
|
+
export { GestureDrawer as MoonUIGestureDrawer } from "./gesture-drawer";
|
|
157
|
+
|
|
158
|
+
// GitHubStars
|
|
159
|
+
export { GitHubStars as MoonUIGitHubStars } from "./github-stars";
|
|
160
|
+
|
|
161
|
+
// Input
|
|
162
|
+
export { Input as MoonUIInput } from "./input";
|
|
163
|
+
|
|
164
|
+
// Label
|
|
165
|
+
export { Label as MoonUILabel } from "./label";
|
|
166
|
+
|
|
167
|
+
// LockedComponent
|
|
168
|
+
export {
|
|
169
|
+
LockedComponent as MoonUILockedComponent,
|
|
170
|
+
ProComponentWrapper as MoonUIProComponentWrapper,
|
|
171
|
+
ProBadge as MoonUIProBadge,
|
|
172
|
+
FreeBadge as MoonUIFreeBadge,
|
|
173
|
+
} from "./locked-component";
|
|
174
|
+
|
|
175
|
+
// MoonLogo
|
|
176
|
+
export { MoonLogo as MoonUIMoonLogo } from "./moon-logo";
|
|
177
|
+
|
|
178
|
+
// Pagination
|
|
179
|
+
export {
|
|
180
|
+
Pagination as MoonUIPagination,
|
|
181
|
+
PaginationContent as MoonUIPaginationContent,
|
|
182
|
+
PaginationEllipsis as MoonUIPaginationEllipsis,
|
|
183
|
+
PaginationItem as MoonUIPaginationItem,
|
|
184
|
+
PaginationLink as MoonUIPaginationLink,
|
|
185
|
+
PaginationNext as MoonUIPaginationNext,
|
|
186
|
+
PaginationPrevious as MoonUIPaginationPrevious,
|
|
187
|
+
} from "./pagination";
|
|
188
|
+
|
|
189
|
+
// PhoneInput
|
|
190
|
+
export { PhoneInput as MoonUIPhoneInput } from "./phone-input";
|
|
191
|
+
|
|
192
|
+
// Popover
|
|
193
|
+
export {
|
|
194
|
+
Popover as MoonUIPopover,
|
|
195
|
+
PopoverTrigger as MoonUIPopoverTrigger,
|
|
196
|
+
PopoverContent as MoonUIPopoverContent,
|
|
197
|
+
} from "./popover";
|
|
198
|
+
|
|
199
|
+
// Progress
|
|
200
|
+
export { Progress as MoonUIProgress } from "./progress";
|
|
201
|
+
|
|
202
|
+
// RadioGroup
|
|
203
|
+
export {
|
|
204
|
+
RadioGroup as MoonUIRadioGroup,
|
|
205
|
+
RadioGroupItem as MoonUIRadioGroupItem,
|
|
206
|
+
RadioLabel as MoonUIRadioLabel,
|
|
207
|
+
RadioItemWithLabel as MoonUIRadioItemWithLabel,
|
|
208
|
+
} from "./radio-group";
|
|
209
|
+
|
|
210
|
+
// RichTextEditor
|
|
211
|
+
export { RichTextEditor as MoonUIRichTextEditor } from "./rich-text-editor";
|
|
212
|
+
|
|
213
|
+
// ScrollArea
|
|
214
|
+
export {
|
|
215
|
+
ScrollArea as MoonUIScrollArea,
|
|
216
|
+
ScrollBar as MoonUIScrollBar,
|
|
217
|
+
} from "./scroll-area";
|
|
218
|
+
|
|
219
|
+
// Select
|
|
220
|
+
export {
|
|
221
|
+
Select as MoonUISelect,
|
|
222
|
+
SelectGroup as MoonUISelectGroup,
|
|
223
|
+
SelectValue as MoonUISelectValue,
|
|
224
|
+
SelectTrigger as MoonUISelectTrigger,
|
|
225
|
+
SelectContent as MoonUISelectContent,
|
|
226
|
+
SelectLabel as MoonUISelectLabel,
|
|
227
|
+
SelectItem as MoonUISelectItem,
|
|
228
|
+
SelectSeparator as MoonUISelectSeparator,
|
|
229
|
+
SelectScrollUpButton as MoonUISelectScrollUpButton,
|
|
230
|
+
SelectScrollDownButton as MoonUISelectScrollDownButton,
|
|
231
|
+
} from "./select";
|
|
232
|
+
|
|
233
|
+
// Separator
|
|
234
|
+
export { Separator as MoonUISeparator } from "./separator";
|
|
235
|
+
|
|
236
|
+
// SimpleEditor
|
|
237
|
+
export { SimpleEditor as MoonUISimpleEditor } from "./simple-editor";
|
|
238
|
+
|
|
239
|
+
// Skeleton
|
|
240
|
+
export {
|
|
241
|
+
Skeleton as MoonUISkeleton,
|
|
242
|
+
SkeletonText as MoonUISkeletonText,
|
|
243
|
+
SkeletonAvatar as MoonUISkeletonAvatar,
|
|
244
|
+
SkeletonCard as MoonUISkeletonCard,
|
|
245
|
+
skeletonVariants as moonUISkeletonVariants,
|
|
246
|
+
} from "./skeleton";
|
|
247
|
+
|
|
248
|
+
// Slider
|
|
249
|
+
export { Slider as MoonUISlider } from "./slider";
|
|
250
|
+
|
|
251
|
+
// SwipeableCard
|
|
252
|
+
export { SwipeableCard as MoonUISwipeableCard } from "./swipeable-card";
|
|
253
|
+
|
|
254
|
+
// Switch
|
|
255
|
+
export { Switch as MoonUISwitch } from "./switch";
|
|
256
|
+
|
|
257
|
+
// Table
|
|
258
|
+
export {
|
|
259
|
+
Table as MoonUITable,
|
|
260
|
+
TableHeader as MoonUITableHeader,
|
|
261
|
+
TableBody as MoonUITableBody,
|
|
262
|
+
TableFooter as MoonUITableFooter,
|
|
263
|
+
TableHead as MoonUITableHead,
|
|
264
|
+
TableRow as MoonUITableRow,
|
|
265
|
+
TableCell as MoonUITableCell,
|
|
266
|
+
TableCaption as MoonUITableCaption,
|
|
267
|
+
} from "./table";
|
|
268
|
+
|
|
269
|
+
// Tabs
|
|
270
|
+
export {
|
|
271
|
+
Tabs as MoonUITabs,
|
|
272
|
+
TabsList as MoonUITabsList,
|
|
273
|
+
TabsTrigger as MoonUITabsTrigger,
|
|
274
|
+
TabsContent as MoonUITabsContent,
|
|
275
|
+
} from "./tabs";
|
|
276
|
+
|
|
277
|
+
// TagsInput
|
|
278
|
+
export { TagsInput as MoonUITagsInput } from "./tags-input";
|
|
279
|
+
|
|
280
|
+
// Textarea
|
|
281
|
+
export { Textarea as MoonUITextarea } from "./textarea";
|
|
282
|
+
|
|
283
|
+
// Toast
|
|
284
|
+
export {
|
|
285
|
+
Toast as MoonUIToast,
|
|
286
|
+
ToastAction as MoonUIToastAction,
|
|
287
|
+
ToastClose as MoonUIToastClose,
|
|
288
|
+
ToastDescription as MoonUIToastDescription,
|
|
289
|
+
ToastProvider as MoonUIToastProvider,
|
|
290
|
+
ToastTitle as MoonUIToastTitle,
|
|
291
|
+
ToastViewport as MoonUIToastViewport,
|
|
292
|
+
Toaster as MoonUIToaster,
|
|
293
|
+
toast,
|
|
294
|
+
useToast,
|
|
295
|
+
} from "./toast";
|
|
296
|
+
|
|
297
|
+
// Toggle
|
|
298
|
+
export {
|
|
299
|
+
Toggle as MoonUIToggle,
|
|
300
|
+
toggleVariants as moonUIToggleVariants,
|
|
301
|
+
} from "./toggle";
|
|
302
|
+
|
|
303
|
+
// Tooltip
|
|
304
|
+
export {
|
|
305
|
+
Tooltip as MoonUITooltip,
|
|
306
|
+
TooltipTrigger as MoonUITooltipTrigger,
|
|
307
|
+
TooltipContent as MoonUITooltipContent,
|
|
308
|
+
TooltipProvider as MoonUITooltipProvider,
|
|
309
|
+
} from "./tooltip";
|
|
310
|
+
|
|
311
|
+
// Also export without MoonUI prefix for backward compatibility
|
|
312
|
+
export * from "./accordion";
|
|
313
|
+
export * from "./alert";
|
|
314
|
+
export * from "./aspect-ratio";
|
|
315
|
+
export * from "./avatar";
|
|
316
|
+
export * from "./badge";
|
|
317
|
+
export * from "./breadcrumb";
|
|
318
|
+
export * from "./button";
|
|
319
|
+
export * from "./card";
|
|
320
|
+
export * from "./card-input";
|
|
321
|
+
export * from "./checkbox";
|
|
322
|
+
export * from "./collapsible";
|
|
323
|
+
export * from "./color-picker";
|
|
324
|
+
export * from "./command";
|
|
325
|
+
export * from "./data-table";
|
|
326
|
+
export * from "./date-picker";
|
|
327
|
+
export * from "./dialog";
|
|
328
|
+
export * from "./draggable-list";
|
|
329
|
+
export * from "./dropdown-menu";
|
|
330
|
+
export * from "./file-upload";
|
|
331
|
+
export * from "./gesture-drawer";
|
|
332
|
+
export * from "./github-stars";
|
|
333
|
+
export * from "./input";
|
|
334
|
+
export * from "./label";
|
|
335
|
+
export * from "./locked-component";
|
|
336
|
+
export * from "./moon-logo";
|
|
337
|
+
export * from "./pagination";
|
|
338
|
+
export * from "./phone-input";
|
|
339
|
+
export * from "./popover";
|
|
340
|
+
export * from "./progress";
|
|
341
|
+
export * from "./radio-group";
|
|
342
|
+
export * from "./rich-text-editor";
|
|
343
|
+
export * from "./scroll-area";
|
|
344
|
+
export * from "./select";
|
|
345
|
+
export * from "./separator";
|
|
346
|
+
export * from "./simple-editor";
|
|
347
|
+
export * from "./skeleton";
|
|
348
|
+
export * from "./slider";
|
|
349
|
+
export * from "./swipeable-card";
|
|
350
|
+
export * from "./switch";
|
|
351
|
+
export * from "./table";
|
|
352
|
+
export * from "./tabs";
|
|
353
|
+
export * from "./tags-input";
|
|
354
|
+
export * from "./textarea";
|
|
355
|
+
export * from "./toast";
|
|
356
|
+
export * from "./toggle";
|
|
357
|
+
export * from "./tooltip";
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
1
3
|
import * as React from "react";
|
|
2
4
|
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
5
|
import { cn } from "../../lib/utils";
|
|
@@ -146,7 +148,7 @@ const Input = React.forwardRef<HTMLInputElement, InputProps>(
|
|
|
146
148
|
|
|
147
149
|
return (
|
|
148
150
|
<div className="space-y-1.5 w-full">
|
|
149
|
-
<div className={cn(inputWrapperVariants({ size }), wrapperClassName)}>
|
|
151
|
+
<div className={cn("moonui-theme", inputWrapperVariants({ size }), wrapperClassName)}>
|
|
150
152
|
{leftIcon && (
|
|
151
153
|
<div className="absolute left-3 text-gray-500 flex items-center justify-center pointer-events-none">
|
|
152
154
|
{loading ? <Loader2 className="h-4 w-4 animate-spin" /> : leftIcon}
|