@moontra/moonui 2.0.11 → 2.1.2
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 +438 -2028
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +201 -1899
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
- package/src/components/ui/accordion.tsx +9 -6
- 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/button.tsx +15 -11
- 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
|
@@ -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 };
|
|
@@ -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 moonUIToggleVariants = 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 toggleVariants = cva(
|
|
|
28
28
|
}
|
|
29
29
|
)
|
|
30
30
|
|
|
31
|
-
export interface
|
|
31
|
+
export interface MoonUIToggleProps extends React.ComponentPropsWithoutRef<typeof TogglePrimitive.Root>, VariantProps<typeof moonUIToggleVariants> {}
|
|
32
32
|
|
|
33
|
-
const
|
|
33
|
+
const MoonUIToggle = React.forwardRef<
|
|
34
34
|
React.ElementRef<typeof TogglePrimitive.Root>,
|
|
35
35
|
ToggleProps
|
|
36
36
|
>(({ className, variant, size, ...props }, ref) => (
|
|
@@ -43,5 +43,8 @@ const Toggle = React.forwardRef<
|
|
|
43
43
|
|
|
44
44
|
Toggle.displayName = TogglePrimitive.Root.displayName
|
|
45
45
|
|
|
46
|
-
export {
|
|
46
|
+
export { MoonUIToggle, moonUIToggleVariants };
|
|
47
|
+
|
|
48
|
+
// Backward compatibility exports
|
|
49
|
+
export { MoonUIToggle as Toggle, moonUIToggleVariants as toggleVariants }
|
|
47
50
|
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 MoonUITooltipProvider = 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,9 +33,9 @@ const tooltipVariants = cva(
|
|
|
33
33
|
}
|
|
34
34
|
)
|
|
35
35
|
|
|
36
|
-
const
|
|
36
|
+
const MoonUITooltip = TooltipPrimitive.Root
|
|
37
37
|
|
|
38
|
-
const
|
|
38
|
+
const MoonUITooltipTrigger = TooltipPrimitive.Trigger
|
|
39
39
|
|
|
40
40
|
const TooltipArrow = React.forwardRef<
|
|
41
41
|
React.ElementRef<typeof TooltipPrimitive.Arrow>,
|
|
@@ -49,13 +49,13 @@ const TooltipArrow = React.forwardRef<
|
|
|
49
49
|
))
|
|
50
50
|
TooltipArrow.displayName = TooltipPrimitive.Arrow.displayName
|
|
51
51
|
|
|
52
|
-
export interface
|
|
52
|
+
export interface MoonUITooltipContentProps
|
|
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 MoonUITooltipContent = React.forwardRef<
|
|
59
59
|
React.ElementRef<typeof TooltipPrimitive.Content>,
|
|
60
60
|
TooltipContentProps
|
|
61
61
|
>(({ className, variant, size, showArrow = false, sideOffset = 4, ...props }, ref) => (
|
|
@@ -141,12 +141,14 @@ const SimpleTooltip = React.forwardRef<
|
|
|
141
141
|
)
|
|
142
142
|
SimpleTooltip.displayName = "SimpleTooltip"
|
|
143
143
|
|
|
144
|
-
export {
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
TooltipContent,
|
|
144
|
+
export { MoonUITooltip,
|
|
145
|
+
MoonUITooltipProvider,
|
|
146
|
+
MoonUITooltipTrigger,
|
|
147
|
+
MoonUITooltipContent,
|
|
149
148
|
TooltipArrow,
|
|
150
149
|
SimpleTooltip,
|
|
151
150
|
tooltipVariants,
|
|
152
|
-
}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
// Backward compatibility exports
|
|
154
|
+
export { MoonUITooltip as Tooltip, MoonUITooltipTrigger as TooltipTrigger, MoonUITooltipContent as TooltipContent, MoonUITooltipProvider as TooltipProvider }
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import * as React from "react";
|
|
4
|
-
import { performanceProfiler } from "
|
|
4
|
+
import { performanceProfiler } from "./lib/performance-profiler";
|
|
5
5
|
|
|
6
6
|
// Performance optimization hooks
|
|
7
7
|
export function usePerformanceOptimizer() {
|