@moontra/moonui-pro 2.20.1 → 2.20.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.d.ts +691 -261
- package/dist/index.mjs +7418 -4934
- package/package.json +11 -5
- package/plugin/index.d.ts +86 -0
- package/plugin/index.js +308 -0
- package/scripts/postbuild.js +27 -0
- package/scripts/postinstall.js +176 -23
- package/src/__tests__/use-intersection-observer.test.tsx +0 -216
- package/src/__tests__/use-local-storage.test.tsx +0 -174
- package/src/__tests__/use-pro-access.test.tsx +0 -183
- package/src/components/advanced-chart/advanced-chart.test.tsx +0 -281
- package/src/components/advanced-chart/index.tsx +0 -1242
- package/src/components/advanced-forms/index.tsx +0 -426
- package/src/components/animated-button/index.tsx +0 -385
- package/src/components/calendar/event-dialog.tsx +0 -372
- package/src/components/calendar/index.tsx +0 -1073
- package/src/components/calendar-pro/index.tsx +0 -1697
- package/src/components/color-picker/index.tsx +0 -432
- package/src/components/credit-card-input/index.tsx +0 -406
- package/src/components/dashboard/dashboard-grid.tsx +0 -462
- package/src/components/dashboard/demo.tsx +0 -425
- package/src/components/dashboard/index.tsx +0 -1046
- package/src/components/dashboard/time-range-picker.tsx +0 -336
- package/src/components/dashboard/types.ts +0 -222
- package/src/components/dashboard/widgets/activity-feed.tsx +0 -344
- package/src/components/dashboard/widgets/chart-widget.tsx +0 -418
- package/src/components/dashboard/widgets/metric-card.tsx +0 -343
- package/src/components/data-table/data-table-bulk-actions.tsx +0 -204
- package/src/components/data-table/data-table-column-toggle.tsx +0 -169
- package/src/components/data-table/data-table-export.ts +0 -156
- package/src/components/data-table/data-table-filter-drawer.tsx +0 -448
- package/src/components/data-table/data-table.test.tsx +0 -187
- package/src/components/data-table/index.tsx +0 -845
- package/src/components/draggable-list/index.tsx +0 -100
- package/src/components/enhanced/badge.tsx +0 -191
- package/src/components/enhanced/button.tsx +0 -362
- package/src/components/enhanced/card.tsx +0 -266
- package/src/components/enhanced/dialog.tsx +0 -246
- package/src/components/enhanced/index.ts +0 -4
- package/src/components/error-boundary/index.tsx +0 -109
- package/src/components/file-upload/file-upload.test.tsx +0 -243
- package/src/components/file-upload/index.tsx +0 -1660
- package/src/components/floating-action-button/index.tsx +0 -206
- package/src/components/form-wizard/form-wizard-context.tsx +0 -307
- package/src/components/form-wizard/form-wizard-navigation.tsx +0 -118
- package/src/components/form-wizard/form-wizard-progress.tsx +0 -298
- package/src/components/form-wizard/form-wizard-step.tsx +0 -111
- package/src/components/form-wizard/index.tsx +0 -102
- package/src/components/form-wizard/types.ts +0 -76
- package/src/components/gesture-drawer/index.tsx +0 -551
- package/src/components/github-stars/github-api.ts +0 -426
- package/src/components/github-stars/hooks.ts +0 -516
- package/src/components/github-stars/index.tsx +0 -375
- package/src/components/github-stars/types.ts +0 -148
- package/src/components/github-stars/variants.tsx +0 -513
- package/src/components/health-check/index.tsx +0 -439
- package/src/components/hover-card-3d/index.tsx +0 -530
- package/src/components/index.ts +0 -128
- package/src/components/internal/index.ts +0 -78
- package/src/components/kanban/add-card-modal.tsx +0 -502
- package/src/components/kanban/card-detail-modal.tsx +0 -761
- package/src/components/kanban/index.ts +0 -13
- package/src/components/kanban/kanban.tsx +0 -1684
- package/src/components/kanban/types.ts +0 -168
- package/src/components/lazy-component/index.tsx +0 -823
- package/src/components/license-error/index.tsx +0 -29
- package/src/components/magnetic-button/index.tsx +0 -167
- package/src/components/memory-efficient-data/index.tsx +0 -1016
- package/src/components/moonui-quiz-form/index.tsx +0 -817
- package/src/components/optimized-image/index.tsx +0 -425
- package/src/components/performance-debugger/index.tsx +0 -589
- package/src/components/performance-monitor/index.tsx +0 -794
- package/src/components/phone-number-input/index.tsx +0 -338
- package/src/components/pinch-zoom/index.tsx +0 -566
- package/src/components/quiz-form/index.tsx +0 -479
- package/src/components/rich-text-editor/index-old-backup.tsx +0 -437
- package/src/components/rich-text-editor/index.tsx +0 -2324
- package/src/components/rich-text-editor/slash-commands-extension.ts +0 -220
- package/src/components/rich-text-editor/slash-commands.css +0 -35
- package/src/components/rich-text-editor/table-styles.css +0 -65
- package/src/components/sidebar/index.tsx +0 -865
- package/src/components/spotlight-card/index.tsx +0 -191
- package/src/components/swipeable-card/index.tsx +0 -100
- package/src/components/timeline/index.tsx +0 -1148
- package/src/components/ui/accordion.tsx +0 -73
- package/src/components/ui/alert-dialog.tsx +0 -141
- package/src/components/ui/alert.tsx +0 -141
- package/src/components/ui/aspect-ratio.tsx +0 -245
- package/src/components/ui/avatar.tsx +0 -153
- package/src/components/ui/badge.tsx +0 -228
- package/src/components/ui/breadcrumb.tsx +0 -214
- package/src/components/ui/button.tsx +0 -222
- package/src/components/ui/calendar.tsx +0 -387
- package/src/components/ui/card.tsx +0 -214
- package/src/components/ui/checkbox.tsx +0 -259
- package/src/components/ui/collapsible.tsx +0 -135
- package/src/components/ui/color-picker.tsx +0 -97
- package/src/components/ui/command.tsx +0 -225
- package/src/components/ui/dialog.tsx +0 -334
- package/src/components/ui/dropdown-menu.tsx +0 -218
- package/src/components/ui/gesture-drawer.tsx +0 -11
- package/src/components/ui/hover-card.tsx +0 -29
- package/src/components/ui/index.ts +0 -190
- package/src/components/ui/input.tsx +0 -222
- package/src/components/ui/label.tsx +0 -29
- package/src/components/ui/lightbox.tsx +0 -606
- package/src/components/ui/magnetic-button.tsx +0 -129
- package/src/components/ui/media-gallery.tsx +0 -612
- package/src/components/ui/pagination.tsx +0 -123
- package/src/components/ui/popover.tsx +0 -185
- package/src/components/ui/progress.tsx +0 -30
- package/src/components/ui/radio-group.tsx +0 -257
- package/src/components/ui/scroll-area.tsx +0 -47
- package/src/components/ui/select.tsx +0 -374
- package/src/components/ui/separator.tsx +0 -145
- package/src/components/ui/sheet.tsx +0 -139
- package/src/components/ui/skeleton.tsx +0 -20
- package/src/components/ui/slider.tsx +0 -354
- package/src/components/ui/spotlight-card.tsx +0 -119
- package/src/components/ui/switch.tsx +0 -86
- package/src/components/ui/table.tsx +0 -329
- package/src/components/ui/tabs.tsx +0 -198
- package/src/components/ui/textarea.tsx +0 -28
- package/src/components/ui/toast.tsx +0 -317
- package/src/components/ui/toggle.tsx +0 -119
- package/src/components/ui/tooltip.tsx +0 -151
- package/src/components/virtual-list/index.tsx +0 -668
- package/src/hooks/use-chart.ts +0 -205
- package/src/hooks/use-data-table.ts +0 -182
- package/src/hooks/use-docs-pro-access.ts +0 -13
- package/src/hooks/use-license-check.ts +0 -65
- package/src/hooks/use-subscription.ts +0 -19
- package/src/hooks/use-toast.ts +0 -15
- package/src/index.ts +0 -14
- package/src/lib/ai-providers.ts +0 -377
- package/src/lib/component-metadata.ts +0 -18
- package/src/lib/micro-interactions.ts +0 -255
- package/src/lib/paddle.ts +0 -17
- package/src/lib/utils.ts +0 -6
- package/src/patterns/login-form/index.tsx +0 -276
- package/src/patterns/login-form/types.ts +0 -67
- package/src/setupTests.ts +0 -41
- package/src/styles/advanced-chart.css +0 -239
- package/src/styles/calendar.css +0 -35
- package/src/styles/design-system.css +0 -363
- package/src/styles/index.css +0 -85
- package/src/styles/tailwind.css +0 -7
- package/src/styles/tokens.css +0 -455
- package/src/types/moonui.d.ts +0 -22
- package/src/types/next-auth.d.ts +0 -21
- package/src/use-intersection-observer.tsx +0 -154
- package/src/use-local-storage.tsx +0 -71
- package/src/use-paddle.ts +0 -138
- package/src/use-performance-optimizer.ts +0 -389
- package/src/use-pro-access.ts +0 -141
- package/src/use-scroll-animation.ts +0 -219
- package/src/use-subscription.ts +0 -37
- package/src/use-toast.ts +0 -32
- package/src/utils/chart-helpers.ts +0 -357
- package/src/utils/cn.ts +0 -6
- package/src/utils/data-processing.ts +0 -151
- package/src/utils/license-validator.tsx +0 -183
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as AccordionPrimitive from "@radix-ui/react-accordion"
|
|
5
|
-
import { ChevronDown } from "lucide-react"
|
|
6
|
-
|
|
7
|
-
import { cn } from "../../lib/utils"
|
|
8
|
-
|
|
9
|
-
const MoonUIAccordionPro = AccordionPrimitive.Root
|
|
10
|
-
|
|
11
|
-
const MoonUIAccordionItemPro = React.forwardRef<
|
|
12
|
-
React.ElementRef<typeof AccordionPrimitive.Item>,
|
|
13
|
-
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>
|
|
14
|
-
>(({ className, ...props }, ref) => (
|
|
15
|
-
<AccordionPrimitive.Item
|
|
16
|
-
ref={ref}
|
|
17
|
-
className={cn("border-b border-gray-200 dark:border-gray-800", className)}
|
|
18
|
-
{...props}
|
|
19
|
-
/>
|
|
20
|
-
))
|
|
21
|
-
MoonUIAccordionItemPro.displayName = "MoonUIAccordionItemPro"
|
|
22
|
-
|
|
23
|
-
const MoonUIAccordionTriggerPro = React.forwardRef<
|
|
24
|
-
React.ElementRef<typeof AccordionPrimitive.Trigger>,
|
|
25
|
-
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Trigger>
|
|
26
|
-
>(({ className, children, ...props }, ref) => (
|
|
27
|
-
<AccordionPrimitive.Header className="flex">
|
|
28
|
-
<AccordionPrimitive.Trigger
|
|
29
|
-
ref={ref}
|
|
30
|
-
className={cn(
|
|
31
|
-
"flex flex-1 items-center justify-between py-4 font-medium transition-all dark:text-gray-100",
|
|
32
|
-
"hover:underline hover:text-primary dark:hover:text-primary-400",
|
|
33
|
-
"[&[data-state=open]>svg]:rotate-180",
|
|
34
|
-
className
|
|
35
|
-
)}
|
|
36
|
-
{...props}
|
|
37
|
-
>
|
|
38
|
-
{children}
|
|
39
|
-
<ChevronDown className="h-4 w-4 shrink-0 transition-transform duration-200 opacity-70 group-hover:opacity-100" />
|
|
40
|
-
</AccordionPrimitive.Trigger>
|
|
41
|
-
</AccordionPrimitive.Header>
|
|
42
|
-
))
|
|
43
|
-
MoonUIAccordionTriggerPro.displayName = "MoonUIAccordionTriggerPro"
|
|
44
|
-
|
|
45
|
-
const MoonUIAccordionContentPro = React.forwardRef<
|
|
46
|
-
React.ElementRef<typeof AccordionPrimitive.Content>,
|
|
47
|
-
React.ComponentPropsWithoutRef<typeof AccordionPrimitive.Content>
|
|
48
|
-
>(({ className, children, ...props }, ref) => (
|
|
49
|
-
<AccordionPrimitive.Content
|
|
50
|
-
ref={ref}
|
|
51
|
-
className={cn(
|
|
52
|
-
"overflow-hidden text-sm text-gray-700 dark:text-gray-300 transition-all",
|
|
53
|
-
"data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",
|
|
54
|
-
className
|
|
55
|
-
)}
|
|
56
|
-
{...props}
|
|
57
|
-
>
|
|
58
|
-
<div className="pb-4 pt-0">{children}</div>
|
|
59
|
-
</AccordionPrimitive.Content>
|
|
60
|
-
))
|
|
61
|
-
MoonUIAccordionContentPro.displayName = "MoonUIAccordionContentPro"
|
|
62
|
-
|
|
63
|
-
// Internal aliases for Pro component usage
|
|
64
|
-
export const AccordionInternal = MoonUIAccordionPro
|
|
65
|
-
export const AccordionItemInternal = MoonUIAccordionItemPro
|
|
66
|
-
export const AccordionTriggerInternal = MoonUIAccordionTriggerPro
|
|
67
|
-
export const AccordionContentInternal = MoonUIAccordionContentPro
|
|
68
|
-
|
|
69
|
-
// Pro exports
|
|
70
|
-
export { MoonUIAccordionPro, MoonUIAccordionItemPro, MoonUIAccordionTriggerPro, MoonUIAccordionContentPro }
|
|
71
|
-
|
|
72
|
-
// Clean exports (without MoonUI prefix for easier usage)
|
|
73
|
-
export { MoonUIAccordionPro as Accordion, MoonUIAccordionItemPro as AccordionItem, MoonUIAccordionTriggerPro as AccordionTrigger, MoonUIAccordionContentPro as AccordionContent }
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import * as AlertDialogPrimitive from "@radix-ui/react-alert-dialog"
|
|
5
|
-
|
|
6
|
-
import { cn } from "../../lib/utils"
|
|
7
|
-
import { buttonVariants } from "./button"
|
|
8
|
-
|
|
9
|
-
const AlertDialog = AlertDialogPrimitive.Root
|
|
10
|
-
|
|
11
|
-
const AlertDialogTrigger = AlertDialogPrimitive.Trigger
|
|
12
|
-
|
|
13
|
-
const AlertDialogPortal = AlertDialogPrimitive.Portal
|
|
14
|
-
|
|
15
|
-
const AlertDialogOverlay = React.forwardRef<
|
|
16
|
-
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
|
|
17
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
|
|
18
|
-
>(({ className, ...props }, ref) => (
|
|
19
|
-
<AlertDialogPrimitive.Overlay
|
|
20
|
-
className={cn(
|
|
21
|
-
"fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",
|
|
22
|
-
className
|
|
23
|
-
)}
|
|
24
|
-
{...props}
|
|
25
|
-
ref={ref}
|
|
26
|
-
/>
|
|
27
|
-
))
|
|
28
|
-
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName
|
|
29
|
-
|
|
30
|
-
const AlertDialogContent = React.forwardRef<
|
|
31
|
-
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
32
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
|
|
33
|
-
>(({ className, ...props }, ref) => (
|
|
34
|
-
<AlertDialogPortal>
|
|
35
|
-
<AlertDialogOverlay />
|
|
36
|
-
<AlertDialogPrimitive.Content
|
|
37
|
-
ref={ref}
|
|
38
|
-
className={cn(
|
|
39
|
-
"fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",
|
|
40
|
-
className
|
|
41
|
-
)}
|
|
42
|
-
{...props}
|
|
43
|
-
/>
|
|
44
|
-
</AlertDialogPortal>
|
|
45
|
-
))
|
|
46
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName
|
|
47
|
-
|
|
48
|
-
const AlertDialogHeader = ({
|
|
49
|
-
className,
|
|
50
|
-
...props
|
|
51
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
52
|
-
<div
|
|
53
|
-
className={cn(
|
|
54
|
-
"flex flex-col space-y-2 text-center sm:text-left",
|
|
55
|
-
className
|
|
56
|
-
)}
|
|
57
|
-
{...props}
|
|
58
|
-
/>
|
|
59
|
-
)
|
|
60
|
-
AlertDialogHeader.displayName = "AlertDialogHeader"
|
|
61
|
-
|
|
62
|
-
const AlertDialogFooter = ({
|
|
63
|
-
className,
|
|
64
|
-
...props
|
|
65
|
-
}: React.HTMLAttributes<HTMLDivElement>) => (
|
|
66
|
-
<div
|
|
67
|
-
className={cn(
|
|
68
|
-
"flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",
|
|
69
|
-
className
|
|
70
|
-
)}
|
|
71
|
-
{...props}
|
|
72
|
-
/>
|
|
73
|
-
)
|
|
74
|
-
AlertDialogFooter.displayName = "AlertDialogFooter"
|
|
75
|
-
|
|
76
|
-
const AlertDialogTitle = React.forwardRef<
|
|
77
|
-
React.ElementRef<typeof AlertDialogPrimitive.Title>,
|
|
78
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
|
|
79
|
-
>(({ className, ...props }, ref) => (
|
|
80
|
-
<AlertDialogPrimitive.Title
|
|
81
|
-
ref={ref}
|
|
82
|
-
className={cn("text-lg font-semibold", className)}
|
|
83
|
-
{...props}
|
|
84
|
-
/>
|
|
85
|
-
))
|
|
86
|
-
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName
|
|
87
|
-
|
|
88
|
-
const AlertDialogDescription = React.forwardRef<
|
|
89
|
-
React.ElementRef<typeof AlertDialogPrimitive.Description>,
|
|
90
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
|
|
91
|
-
>(({ className, ...props }, ref) => (
|
|
92
|
-
<AlertDialogPrimitive.Description
|
|
93
|
-
ref={ref}
|
|
94
|
-
className={cn("text-sm text-muted-foreground", className)}
|
|
95
|
-
{...props}
|
|
96
|
-
/>
|
|
97
|
-
))
|
|
98
|
-
AlertDialogDescription.displayName =
|
|
99
|
-
AlertDialogPrimitive.Description.displayName
|
|
100
|
-
|
|
101
|
-
const AlertDialogAction = React.forwardRef<
|
|
102
|
-
React.ElementRef<typeof AlertDialogPrimitive.Action>,
|
|
103
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
|
|
104
|
-
>(({ className, ...props }, ref) => (
|
|
105
|
-
<AlertDialogPrimitive.Action
|
|
106
|
-
ref={ref}
|
|
107
|
-
className={cn(buttonVariants(), className)}
|
|
108
|
-
{...props}
|
|
109
|
-
/>
|
|
110
|
-
))
|
|
111
|
-
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName
|
|
112
|
-
|
|
113
|
-
const AlertDialogCancel = React.forwardRef<
|
|
114
|
-
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
|
|
115
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
|
|
116
|
-
>(({ className, ...props }, ref) => (
|
|
117
|
-
<AlertDialogPrimitive.Cancel
|
|
118
|
-
ref={ref}
|
|
119
|
-
className={cn(
|
|
120
|
-
buttonVariants({ variant: "outline" }),
|
|
121
|
-
"mt-2 sm:mt-0",
|
|
122
|
-
className
|
|
123
|
-
)}
|
|
124
|
-
{...props}
|
|
125
|
-
/>
|
|
126
|
-
))
|
|
127
|
-
AlertDialogCancel.displayName = AlertDialogPrimitive.Cancel.displayName
|
|
128
|
-
|
|
129
|
-
export {
|
|
130
|
-
AlertDialog,
|
|
131
|
-
AlertDialogPortal,
|
|
132
|
-
AlertDialogOverlay,
|
|
133
|
-
AlertDialogTrigger,
|
|
134
|
-
AlertDialogContent,
|
|
135
|
-
AlertDialogHeader,
|
|
136
|
-
AlertDialogFooter,
|
|
137
|
-
AlertDialogTitle,
|
|
138
|
-
AlertDialogDescription,
|
|
139
|
-
AlertDialogAction,
|
|
140
|
-
AlertDialogCancel,
|
|
141
|
-
}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
|
|
3
|
-
import * as React from "react";
|
|
4
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
5
|
-
import { AlertCircle, AlertTriangle, Info, Check, X } from "lucide-react";
|
|
6
|
-
|
|
7
|
-
import { cn } from "../../lib/utils";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Alert Component
|
|
11
|
-
*
|
|
12
|
-
* Yüksek kaliteli, özelleştirilebilir ve erişilebilir alert bileşeni.
|
|
13
|
-
* Bildirim, uyarı ve dikkat çekmek gereken içerikler için kullanılır.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
const MoonUIalertVariantsPro = cva(
|
|
17
|
-
"relative w-full flex items-center gap-3 p-4 border text-foreground [&>svg]:shrink-0",
|
|
18
|
-
{
|
|
19
|
-
variants: {
|
|
20
|
-
variant: {
|
|
21
|
-
default: "bg-background text-foreground border-border",
|
|
22
|
-
primary: "bg-primary/10 text-primary border-primary/30",
|
|
23
|
-
success: "bg-success/10 text-success border-success/30",
|
|
24
|
-
warning: "bg-warning/10 text-warning border-warning/30",
|
|
25
|
-
error: "bg-destructive/10 text-destructive border-destructive/30",
|
|
26
|
-
info: "bg-blue-500/10 text-blue-500 border-blue-500/30",
|
|
27
|
-
},
|
|
28
|
-
size: {
|
|
29
|
-
sm: "py-2 text-xs",
|
|
30
|
-
default: "py-3 text-sm",
|
|
31
|
-
lg: "py-4 text-base",
|
|
32
|
-
},
|
|
33
|
-
radius: {
|
|
34
|
-
none: "rounded-none",
|
|
35
|
-
sm: "rounded-sm",
|
|
36
|
-
default: "rounded-md",
|
|
37
|
-
lg: "rounded-lg",
|
|
38
|
-
full: "rounded-full",
|
|
39
|
-
},
|
|
40
|
-
withClose: {
|
|
41
|
-
true: "pr-10",
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
defaultVariants: {
|
|
45
|
-
variant: "default",
|
|
46
|
-
size: "default",
|
|
47
|
-
radius: "default",
|
|
48
|
-
withClose: false,
|
|
49
|
-
},
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
export interface AlertProps
|
|
54
|
-
extends React.HTMLAttributes<HTMLDivElement>,
|
|
55
|
-
VariantProps<typeof MoonUIalertVariantsPro> {
|
|
56
|
-
/** Alert ikonunu gizler */
|
|
57
|
-
hideIcon?: boolean;
|
|
58
|
-
/** Kapatma butonu ekler */
|
|
59
|
-
closable?: boolean;
|
|
60
|
-
/** Kapatma butonu tıklandığında çalışacak fonksiyon */
|
|
61
|
-
onClose?: () => void;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
const MoonUIAlertPro = React.forwardRef<HTMLDivElement, AlertProps>(
|
|
65
|
-
({ className, variant = "default", size, radius, hideIcon = false, closable = false, onClose, children, ...props }, ref) => {
|
|
66
|
-
// Alert türüne göre ikon belirleme
|
|
67
|
-
const MoonUIIconPro = React.useMemo(() => {
|
|
68
|
-
switch (variant) {
|
|
69
|
-
case "success":
|
|
70
|
-
return Check;
|
|
71
|
-
case "warning":
|
|
72
|
-
return AlertTriangle;
|
|
73
|
-
case "error":
|
|
74
|
-
return AlertCircle;
|
|
75
|
-
case "info":
|
|
76
|
-
return Info;
|
|
77
|
-
default:
|
|
78
|
-
return Info;
|
|
79
|
-
}
|
|
80
|
-
}, [variant]);
|
|
81
|
-
|
|
82
|
-
return (
|
|
83
|
-
<div
|
|
84
|
-
ref={ref}
|
|
85
|
-
role="alert"
|
|
86
|
-
className={cn(MoonUIalertVariantsPro({ variant, size, radius, withClose: closable }), className)}
|
|
87
|
-
{...props}
|
|
88
|
-
>
|
|
89
|
-
{!hideIcon && <MoonUIIconPro className="h-5 w-5" />}
|
|
90
|
-
<div className="flex-1">{children}</div>
|
|
91
|
-
{closable && onClose && (
|
|
92
|
-
<button
|
|
93
|
-
onClick={onClose}
|
|
94
|
-
className="absolute right-3 top-3 inline-flex h-6 w-6 items-center justify-center rounded-full opacity-70 transition-opacity hover:opacity-100"
|
|
95
|
-
aria-label="Kapat"
|
|
96
|
-
>
|
|
97
|
-
<X className="h-4 w-4" />
|
|
98
|
-
</button>
|
|
99
|
-
)}
|
|
100
|
-
</div>
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
);
|
|
104
|
-
MoonUIAlertPro.displayName = "AlertPro";
|
|
105
|
-
|
|
106
|
-
const MoonUIAlertTitlePro = React.forwardRef<
|
|
107
|
-
HTMLParagraphElement,
|
|
108
|
-
React.HTMLAttributes<HTMLHeadingElement>
|
|
109
|
-
>(({ className, ...props }, ref) => (
|
|
110
|
-
<h5
|
|
111
|
-
ref={ref}
|
|
112
|
-
className={cn("font-semibold leading-tight tracking-tight mb-1", className)}
|
|
113
|
-
{...props}
|
|
114
|
-
/>
|
|
115
|
-
));
|
|
116
|
-
MoonUIAlertTitlePro.displayName = "AlertTitlePro";
|
|
117
|
-
|
|
118
|
-
const MoonUIAlertDescriptionPro = React.forwardRef<
|
|
119
|
-
HTMLParagraphElement,
|
|
120
|
-
React.HTMLAttributes<HTMLParagraphElement>
|
|
121
|
-
>(({ className, ...props }, ref) => (
|
|
122
|
-
<div
|
|
123
|
-
ref={ref}
|
|
124
|
-
className={cn("text-sm leading-5 text-muted-foreground", className)}
|
|
125
|
-
{...props}
|
|
126
|
-
/>
|
|
127
|
-
));
|
|
128
|
-
MoonUIAlertDescriptionPro.displayName = "AlertDescriptionPro";
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
// Internal aliases for Pro component usage
|
|
132
|
-
export const alertVariantsInternal = MoonUIalertVariantsPro
|
|
133
|
-
export const AlertInternal = MoonUIAlertPro
|
|
134
|
-
export const AlertTitleInternal = MoonUIAlertTitlePro
|
|
135
|
-
export const AlertDescriptionInternal = MoonUIAlertDescriptionPro
|
|
136
|
-
|
|
137
|
-
// Pro exports
|
|
138
|
-
export { MoonUIalertVariantsPro, MoonUIAlertPro, MoonUIAlertTitlePro, MoonUIAlertDescriptionPro }
|
|
139
|
-
|
|
140
|
-
// Clean exports (without MoonUI prefix for easier usage)
|
|
141
|
-
export { MoonUIalertVariantsPro as alertVariants, MoonUIAlertPro as Alert, MoonUIAlertTitlePro as AlertTitle, MoonUIAlertDescriptionPro as AlertDescription };
|
|
@@ -1,245 +0,0 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { cva, type VariantProps } from "class-variance-authority"
|
|
5
|
-
|
|
6
|
-
import { cn } from "../../lib/utils"
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* Premium Aspect Ratio Component
|
|
10
|
-
*
|
|
11
|
-
* Advanced component that maintains specific aspect ratios with preset support,
|
|
12
|
-
* responsive behavior, animations, and enhanced styling options.
|
|
13
|
-
* Perfect for images, videos, and media content in modern applications.
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
// Preset ratios
|
|
17
|
-
const PRESET_RATIOS = {
|
|
18
|
-
square: 1,
|
|
19
|
-
video: 16 / 9,
|
|
20
|
-
portrait: 3 / 4,
|
|
21
|
-
landscape: 4 / 3,
|
|
22
|
-
golden: 1.618,
|
|
23
|
-
ultrawide: 21 / 9,
|
|
24
|
-
cinema: 2.39,
|
|
25
|
-
instagram: 4 / 5,
|
|
26
|
-
story: 9 / 16,
|
|
27
|
-
banner: 3 / 1,
|
|
28
|
-
} as const
|
|
29
|
-
|
|
30
|
-
type PresetRatio = keyof typeof PRESET_RATIOS
|
|
31
|
-
|
|
32
|
-
// Responsive ratio configuration
|
|
33
|
-
interface ResponsiveRatio {
|
|
34
|
-
sm?: number | PresetRatio
|
|
35
|
-
md?: number | PresetRatio
|
|
36
|
-
lg?: number | PresetRatio
|
|
37
|
-
xl?: number | PresetRatio
|
|
38
|
-
"2xl"?: number | PresetRatio
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
const MoonUIaspectRatioVariantsPro = cva(
|
|
42
|
-
"relative overflow-hidden",
|
|
43
|
-
{
|
|
44
|
-
variants: {
|
|
45
|
-
variant: {
|
|
46
|
-
default: "bg-muted/10",
|
|
47
|
-
ghost: "bg-transparent",
|
|
48
|
-
outline: "border border-border",
|
|
49
|
-
card: "bg-card shadow-sm",
|
|
50
|
-
glass: "bg-white/10 backdrop-blur-md border border-white/20",
|
|
51
|
-
gradient: "bg-gradient-to-br from-primary/10 to-secondary/10",
|
|
52
|
-
},
|
|
53
|
-
radius: {
|
|
54
|
-
none: "rounded-none",
|
|
55
|
-
sm: "rounded-sm",
|
|
56
|
-
md: "rounded-md",
|
|
57
|
-
lg: "rounded-lg",
|
|
58
|
-
xl: "rounded-xl",
|
|
59
|
-
"2xl": "rounded-2xl",
|
|
60
|
-
full: "rounded-full",
|
|
61
|
-
},
|
|
62
|
-
animate: {
|
|
63
|
-
true: "transition-all duration-300 ease-in-out",
|
|
64
|
-
false: "",
|
|
65
|
-
},
|
|
66
|
-
hover: {
|
|
67
|
-
true: "hover:scale-105 hover:shadow-lg cursor-pointer",
|
|
68
|
-
false: "",
|
|
69
|
-
},
|
|
70
|
-
loading: {
|
|
71
|
-
true: "animate-pulse",
|
|
72
|
-
false: "",
|
|
73
|
-
},
|
|
74
|
-
},
|
|
75
|
-
defaultVariants: {
|
|
76
|
-
variant: "default",
|
|
77
|
-
radius: "md",
|
|
78
|
-
animate: false,
|
|
79
|
-
hover: false,
|
|
80
|
-
loading: false,
|
|
81
|
-
},
|
|
82
|
-
}
|
|
83
|
-
)
|
|
84
|
-
|
|
85
|
-
interface AspectRatioProps
|
|
86
|
-
extends React.HTMLAttributes<HTMLDivElement>,
|
|
87
|
-
VariantProps<typeof MoonUIaspectRatioVariantsPro> {
|
|
88
|
-
/**
|
|
89
|
-
* Aspect ratio (width/height). For example 16/9, 4/3, 1/1 etc.
|
|
90
|
-
* @default 16/9
|
|
91
|
-
*/
|
|
92
|
-
ratio?: number
|
|
93
|
-
/**
|
|
94
|
-
* Preset aspect ratio for quick usage
|
|
95
|
-
*/
|
|
96
|
-
preset?: PresetRatio
|
|
97
|
-
/**
|
|
98
|
-
* Responsive aspect ratios for different breakpoints
|
|
99
|
-
*/
|
|
100
|
-
responsive?: ResponsiveRatio
|
|
101
|
-
/**
|
|
102
|
-
* Enable smooth aspect ratio changes
|
|
103
|
-
*/
|
|
104
|
-
smoothTransition?: boolean
|
|
105
|
-
/**
|
|
106
|
-
* Add overlay content
|
|
107
|
-
*/
|
|
108
|
-
overlay?: React.ReactNode
|
|
109
|
-
/**
|
|
110
|
-
* Overlay position
|
|
111
|
-
*/
|
|
112
|
-
overlayPosition?: "center" | "top-left" | "top-right" | "bottom-left" | "bottom-right"
|
|
113
|
-
/**
|
|
114
|
-
* Show loading skeleton
|
|
115
|
-
*/
|
|
116
|
-
skeleton?: boolean
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
const MoonUIAspectRatioPro = React.forwardRef<
|
|
120
|
-
HTMLDivElement,
|
|
121
|
-
AspectRatioProps
|
|
122
|
-
>(({
|
|
123
|
-
className,
|
|
124
|
-
variant,
|
|
125
|
-
radius,
|
|
126
|
-
animate,
|
|
127
|
-
hover,
|
|
128
|
-
loading,
|
|
129
|
-
ratio = 16 / 9,
|
|
130
|
-
preset,
|
|
131
|
-
responsive,
|
|
132
|
-
smoothTransition = false,
|
|
133
|
-
overlay,
|
|
134
|
-
overlayPosition = "center",
|
|
135
|
-
skeleton = false,
|
|
136
|
-
style,
|
|
137
|
-
children,
|
|
138
|
-
...props
|
|
139
|
-
}, ref) => {
|
|
140
|
-
const [currentRatio, setCurrentRatio] = React.useState(() => {
|
|
141
|
-
if (preset) return PRESET_RATIOS[preset]
|
|
142
|
-
return ratio
|
|
143
|
-
})
|
|
144
|
-
|
|
145
|
-
// Update ratio when props change
|
|
146
|
-
React.useEffect(() => {
|
|
147
|
-
const newRatio = preset ? PRESET_RATIOS[preset] : ratio
|
|
148
|
-
if (smoothTransition) {
|
|
149
|
-
setCurrentRatio(newRatio)
|
|
150
|
-
} else {
|
|
151
|
-
setCurrentRatio(newRatio)
|
|
152
|
-
}
|
|
153
|
-
}, [preset, ratio, smoothTransition])
|
|
154
|
-
|
|
155
|
-
// Handle responsive ratios
|
|
156
|
-
React.useEffect(() => {
|
|
157
|
-
if (!responsive) return
|
|
158
|
-
|
|
159
|
-
const handleResize = () => {
|
|
160
|
-
const width = window.innerWidth
|
|
161
|
-
let newRatio = currentRatio
|
|
162
|
-
|
|
163
|
-
if (width >= 1536 && responsive["2xl"]) {
|
|
164
|
-
newRatio = typeof responsive["2xl"] === "string"
|
|
165
|
-
? PRESET_RATIOS[responsive["2xl"]]
|
|
166
|
-
: responsive["2xl"]
|
|
167
|
-
} else if (width >= 1280 && responsive.xl) {
|
|
168
|
-
newRatio = typeof responsive.xl === "string"
|
|
169
|
-
? PRESET_RATIOS[responsive.xl]
|
|
170
|
-
: responsive.xl
|
|
171
|
-
} else if (width >= 1024 && responsive.lg) {
|
|
172
|
-
newRatio = typeof responsive.lg === "string"
|
|
173
|
-
? PRESET_RATIOS[responsive.lg]
|
|
174
|
-
: responsive.lg
|
|
175
|
-
} else if (width >= 768 && responsive.md) {
|
|
176
|
-
newRatio = typeof responsive.md === "string"
|
|
177
|
-
? PRESET_RATIOS[responsive.md]
|
|
178
|
-
: responsive.md
|
|
179
|
-
} else if (width >= 640 && responsive.sm) {
|
|
180
|
-
newRatio = typeof responsive.sm === "string"
|
|
181
|
-
? PRESET_RATIOS[responsive.sm]
|
|
182
|
-
: responsive.sm
|
|
183
|
-
}
|
|
184
|
-
|
|
185
|
-
setCurrentRatio(newRatio)
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
handleResize()
|
|
189
|
-
window.addEventListener("resize", handleResize)
|
|
190
|
-
return () => window.removeEventListener("resize", handleResize)
|
|
191
|
-
}, [responsive, currentRatio])
|
|
192
|
-
|
|
193
|
-
const overlayPositionClasses = {
|
|
194
|
-
center: "items-center justify-center",
|
|
195
|
-
"top-left": "items-start justify-start p-4",
|
|
196
|
-
"top-right": "items-start justify-end p-4",
|
|
197
|
-
"bottom-left": "items-end justify-start p-4",
|
|
198
|
-
"bottom-right": "items-end justify-end p-4",
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return (
|
|
202
|
-
<div
|
|
203
|
-
ref={ref}
|
|
204
|
-
className={cn(
|
|
205
|
-
MoonUIaspectRatioVariantsPro({ variant, radius, animate: animate || smoothTransition, hover, loading: loading || skeleton }),
|
|
206
|
-
className
|
|
207
|
-
)}
|
|
208
|
-
style={{
|
|
209
|
-
position: "relative",
|
|
210
|
-
paddingBottom: `${(1 / currentRatio) * 100}%`,
|
|
211
|
-
...style
|
|
212
|
-
}}
|
|
213
|
-
{...props}
|
|
214
|
-
>
|
|
215
|
-
<div className="absolute inset-0">
|
|
216
|
-
{skeleton ? (
|
|
217
|
-
<div className="w-full h-full bg-muted animate-pulse" />
|
|
218
|
-
) : (
|
|
219
|
-
children
|
|
220
|
-
)}
|
|
221
|
-
{overlay && (
|
|
222
|
-
<div className={cn(
|
|
223
|
-
"absolute inset-0 flex",
|
|
224
|
-
overlayPositionClasses[overlayPosition]
|
|
225
|
-
)}>
|
|
226
|
-
{overlay}
|
|
227
|
-
</div>
|
|
228
|
-
)}
|
|
229
|
-
</div>
|
|
230
|
-
</div>
|
|
231
|
-
)
|
|
232
|
-
})
|
|
233
|
-
MoonUIAspectRatioPro.displayName = "AspectRatioPro"
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
// Internal aliases for Pro component usage
|
|
237
|
-
export const aspectRatioVariantsInternal = MoonUIaspectRatioVariantsPro
|
|
238
|
-
export const AspectRatioInternal = MoonUIAspectRatioPro
|
|
239
|
-
|
|
240
|
-
// Pro exports
|
|
241
|
-
export { MoonUIaspectRatioVariantsPro, MoonUIAspectRatioPro }
|
|
242
|
-
|
|
243
|
-
// Clean exports (without MoonUI prefix for easier usage)
|
|
244
|
-
export { MoonUIaspectRatioVariantsPro as aspectRatioVariants, MoonUIAspectRatioPro as AspectRatio }
|
|
245
|
-
export type { AspectRatioProps }
|