@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.
Files changed (162) hide show
  1. package/dist/index.d.ts +691 -261
  2. package/dist/index.mjs +7418 -4934
  3. package/package.json +11 -5
  4. package/plugin/index.d.ts +86 -0
  5. package/plugin/index.js +308 -0
  6. package/scripts/postbuild.js +27 -0
  7. package/scripts/postinstall.js +176 -23
  8. package/src/__tests__/use-intersection-observer.test.tsx +0 -216
  9. package/src/__tests__/use-local-storage.test.tsx +0 -174
  10. package/src/__tests__/use-pro-access.test.tsx +0 -183
  11. package/src/components/advanced-chart/advanced-chart.test.tsx +0 -281
  12. package/src/components/advanced-chart/index.tsx +0 -1242
  13. package/src/components/advanced-forms/index.tsx +0 -426
  14. package/src/components/animated-button/index.tsx +0 -385
  15. package/src/components/calendar/event-dialog.tsx +0 -372
  16. package/src/components/calendar/index.tsx +0 -1073
  17. package/src/components/calendar-pro/index.tsx +0 -1697
  18. package/src/components/color-picker/index.tsx +0 -432
  19. package/src/components/credit-card-input/index.tsx +0 -406
  20. package/src/components/dashboard/dashboard-grid.tsx +0 -462
  21. package/src/components/dashboard/demo.tsx +0 -425
  22. package/src/components/dashboard/index.tsx +0 -1046
  23. package/src/components/dashboard/time-range-picker.tsx +0 -336
  24. package/src/components/dashboard/types.ts +0 -222
  25. package/src/components/dashboard/widgets/activity-feed.tsx +0 -344
  26. package/src/components/dashboard/widgets/chart-widget.tsx +0 -418
  27. package/src/components/dashboard/widgets/metric-card.tsx +0 -343
  28. package/src/components/data-table/data-table-bulk-actions.tsx +0 -204
  29. package/src/components/data-table/data-table-column-toggle.tsx +0 -169
  30. package/src/components/data-table/data-table-export.ts +0 -156
  31. package/src/components/data-table/data-table-filter-drawer.tsx +0 -448
  32. package/src/components/data-table/data-table.test.tsx +0 -187
  33. package/src/components/data-table/index.tsx +0 -845
  34. package/src/components/draggable-list/index.tsx +0 -100
  35. package/src/components/enhanced/badge.tsx +0 -191
  36. package/src/components/enhanced/button.tsx +0 -362
  37. package/src/components/enhanced/card.tsx +0 -266
  38. package/src/components/enhanced/dialog.tsx +0 -246
  39. package/src/components/enhanced/index.ts +0 -4
  40. package/src/components/error-boundary/index.tsx +0 -109
  41. package/src/components/file-upload/file-upload.test.tsx +0 -243
  42. package/src/components/file-upload/index.tsx +0 -1660
  43. package/src/components/floating-action-button/index.tsx +0 -206
  44. package/src/components/form-wizard/form-wizard-context.tsx +0 -307
  45. package/src/components/form-wizard/form-wizard-navigation.tsx +0 -118
  46. package/src/components/form-wizard/form-wizard-progress.tsx +0 -298
  47. package/src/components/form-wizard/form-wizard-step.tsx +0 -111
  48. package/src/components/form-wizard/index.tsx +0 -102
  49. package/src/components/form-wizard/types.ts +0 -76
  50. package/src/components/gesture-drawer/index.tsx +0 -551
  51. package/src/components/github-stars/github-api.ts +0 -426
  52. package/src/components/github-stars/hooks.ts +0 -516
  53. package/src/components/github-stars/index.tsx +0 -375
  54. package/src/components/github-stars/types.ts +0 -148
  55. package/src/components/github-stars/variants.tsx +0 -513
  56. package/src/components/health-check/index.tsx +0 -439
  57. package/src/components/hover-card-3d/index.tsx +0 -530
  58. package/src/components/index.ts +0 -128
  59. package/src/components/internal/index.ts +0 -78
  60. package/src/components/kanban/add-card-modal.tsx +0 -502
  61. package/src/components/kanban/card-detail-modal.tsx +0 -761
  62. package/src/components/kanban/index.ts +0 -13
  63. package/src/components/kanban/kanban.tsx +0 -1684
  64. package/src/components/kanban/types.ts +0 -168
  65. package/src/components/lazy-component/index.tsx +0 -823
  66. package/src/components/license-error/index.tsx +0 -29
  67. package/src/components/magnetic-button/index.tsx +0 -167
  68. package/src/components/memory-efficient-data/index.tsx +0 -1016
  69. package/src/components/moonui-quiz-form/index.tsx +0 -817
  70. package/src/components/optimized-image/index.tsx +0 -425
  71. package/src/components/performance-debugger/index.tsx +0 -589
  72. package/src/components/performance-monitor/index.tsx +0 -794
  73. package/src/components/phone-number-input/index.tsx +0 -338
  74. package/src/components/pinch-zoom/index.tsx +0 -566
  75. package/src/components/quiz-form/index.tsx +0 -479
  76. package/src/components/rich-text-editor/index-old-backup.tsx +0 -437
  77. package/src/components/rich-text-editor/index.tsx +0 -2324
  78. package/src/components/rich-text-editor/slash-commands-extension.ts +0 -220
  79. package/src/components/rich-text-editor/slash-commands.css +0 -35
  80. package/src/components/rich-text-editor/table-styles.css +0 -65
  81. package/src/components/sidebar/index.tsx +0 -865
  82. package/src/components/spotlight-card/index.tsx +0 -191
  83. package/src/components/swipeable-card/index.tsx +0 -100
  84. package/src/components/timeline/index.tsx +0 -1148
  85. package/src/components/ui/accordion.tsx +0 -73
  86. package/src/components/ui/alert-dialog.tsx +0 -141
  87. package/src/components/ui/alert.tsx +0 -141
  88. package/src/components/ui/aspect-ratio.tsx +0 -245
  89. package/src/components/ui/avatar.tsx +0 -153
  90. package/src/components/ui/badge.tsx +0 -228
  91. package/src/components/ui/breadcrumb.tsx +0 -214
  92. package/src/components/ui/button.tsx +0 -222
  93. package/src/components/ui/calendar.tsx +0 -387
  94. package/src/components/ui/card.tsx +0 -214
  95. package/src/components/ui/checkbox.tsx +0 -259
  96. package/src/components/ui/collapsible.tsx +0 -135
  97. package/src/components/ui/color-picker.tsx +0 -97
  98. package/src/components/ui/command.tsx +0 -225
  99. package/src/components/ui/dialog.tsx +0 -334
  100. package/src/components/ui/dropdown-menu.tsx +0 -218
  101. package/src/components/ui/gesture-drawer.tsx +0 -11
  102. package/src/components/ui/hover-card.tsx +0 -29
  103. package/src/components/ui/index.ts +0 -190
  104. package/src/components/ui/input.tsx +0 -222
  105. package/src/components/ui/label.tsx +0 -29
  106. package/src/components/ui/lightbox.tsx +0 -606
  107. package/src/components/ui/magnetic-button.tsx +0 -129
  108. package/src/components/ui/media-gallery.tsx +0 -612
  109. package/src/components/ui/pagination.tsx +0 -123
  110. package/src/components/ui/popover.tsx +0 -185
  111. package/src/components/ui/progress.tsx +0 -30
  112. package/src/components/ui/radio-group.tsx +0 -257
  113. package/src/components/ui/scroll-area.tsx +0 -47
  114. package/src/components/ui/select.tsx +0 -374
  115. package/src/components/ui/separator.tsx +0 -145
  116. package/src/components/ui/sheet.tsx +0 -139
  117. package/src/components/ui/skeleton.tsx +0 -20
  118. package/src/components/ui/slider.tsx +0 -354
  119. package/src/components/ui/spotlight-card.tsx +0 -119
  120. package/src/components/ui/switch.tsx +0 -86
  121. package/src/components/ui/table.tsx +0 -329
  122. package/src/components/ui/tabs.tsx +0 -198
  123. package/src/components/ui/textarea.tsx +0 -28
  124. package/src/components/ui/toast.tsx +0 -317
  125. package/src/components/ui/toggle.tsx +0 -119
  126. package/src/components/ui/tooltip.tsx +0 -151
  127. package/src/components/virtual-list/index.tsx +0 -668
  128. package/src/hooks/use-chart.ts +0 -205
  129. package/src/hooks/use-data-table.ts +0 -182
  130. package/src/hooks/use-docs-pro-access.ts +0 -13
  131. package/src/hooks/use-license-check.ts +0 -65
  132. package/src/hooks/use-subscription.ts +0 -19
  133. package/src/hooks/use-toast.ts +0 -15
  134. package/src/index.ts +0 -14
  135. package/src/lib/ai-providers.ts +0 -377
  136. package/src/lib/component-metadata.ts +0 -18
  137. package/src/lib/micro-interactions.ts +0 -255
  138. package/src/lib/paddle.ts +0 -17
  139. package/src/lib/utils.ts +0 -6
  140. package/src/patterns/login-form/index.tsx +0 -276
  141. package/src/patterns/login-form/types.ts +0 -67
  142. package/src/setupTests.ts +0 -41
  143. package/src/styles/advanced-chart.css +0 -239
  144. package/src/styles/calendar.css +0 -35
  145. package/src/styles/design-system.css +0 -363
  146. package/src/styles/index.css +0 -85
  147. package/src/styles/tailwind.css +0 -7
  148. package/src/styles/tokens.css +0 -455
  149. package/src/types/moonui.d.ts +0 -22
  150. package/src/types/next-auth.d.ts +0 -21
  151. package/src/use-intersection-observer.tsx +0 -154
  152. package/src/use-local-storage.tsx +0 -71
  153. package/src/use-paddle.ts +0 -138
  154. package/src/use-performance-optimizer.ts +0 -389
  155. package/src/use-pro-access.ts +0 -141
  156. package/src/use-scroll-animation.ts +0 -219
  157. package/src/use-subscription.ts +0 -37
  158. package/src/use-toast.ts +0 -32
  159. package/src/utils/chart-helpers.ts +0 -357
  160. package/src/utils/cn.ts +0 -6
  161. package/src/utils/data-processing.ts +0 -151
  162. package/src/utils/license-validator.tsx +0 -183
@@ -1,214 +0,0 @@
1
- import * as React from "react";
2
- import { cva, type VariantProps } from "class-variance-authority";
3
- import { motion } from "framer-motion";
4
- import { cn } from "../../lib/utils";
5
- import { microInteractionVariants, hoverAnimations, tapAnimations } from "../../lib/micro-interactions";
6
-
7
- const moonUICardVariantsPro = cva(
8
- "rounded-lg border bg-card text-card-foreground shadow-sm transition-all duration-200",
9
- {
10
- variants: {
11
- variant: {
12
- default: "border-border dark:border-border",
13
- outline: "border border-border shadow-none bg-transparent dark:border-border",
14
- filled: "border-none bg-secondary dark:bg-secondary shadow-inner",
15
- elevated: "border-none shadow-lg dark:shadow-xl dark:shadow-black/20",
16
- gradient: "border-none bg-gradient-to-br from-primary/5 to-primary/10 dark:from-primary/10 dark:to-primary/20",
17
- glass: "border border-white/20 bg-white/10 backdrop-blur-md dark:border-white/10 dark:bg-black/10",
18
- neon: "border-2 border-primary/50 shadow-[0_0_15px_rgba(var(--primary),0.5)] dark:shadow-[0_0_20px_rgba(var(--primary),0.7)]",
19
- glow: "border border-border shadow-[0_0_30px_rgba(var(--primary),0.15)] dark:shadow-[0_0_40px_rgba(var(--primary),0.25)]",
20
- },
21
- size: {
22
- default: "p-6",
23
- sm: "p-4",
24
- lg: "p-8",
25
- xl: "p-10",
26
- },
27
- radius: {
28
- default: "rounded-lg",
29
- sm: "rounded-md",
30
- lg: "rounded-xl",
31
- full: "rounded-3xl",
32
- none: "rounded-none",
33
- },
34
- interactive: {
35
- true: "cursor-pointer hover:shadow-lg hover:border-primary/20 dark:hover:border-primary/30 hover:-translate-y-0.5 active:translate-y-0 active:shadow-sm",
36
- false: "",
37
- },
38
- },
39
- defaultVariants: {
40
- variant: "default",
41
- size: "default",
42
- radius: "default",
43
- },
44
- }
45
- );
46
-
47
- export interface MoonUICardProProps
48
- extends React.HTMLAttributes<HTMLDivElement>,
49
- VariantProps<typeof moonUICardVariantsPro> {
50
- asChild?: boolean;
51
- microInteraction?: "lift" | "glow" | "scale" | "none";
52
- enableGlassmorphism?: boolean;
53
- enableParallax?: boolean;
54
- enableTilt?: boolean;
55
- tiltMaxAngle?: number;
56
- parallaxOffset?: number;
57
- }
58
-
59
- const MoonUICardPro = React.forwardRef<HTMLDivElement, MoonUICardProProps>(
60
- ({
61
- className,
62
- variant,
63
- size,
64
- radius,
65
- interactive,
66
- microInteraction = "lift",
67
- enableGlassmorphism,
68
- enableParallax = false,
69
- enableTilt = false,
70
- tiltMaxAngle = 15,
71
- parallaxOffset = 20,
72
- children,
73
- asChild,
74
- ...props
75
- }, ref) => {
76
- const [mousePos, setMousePos] = React.useState({ x: 0, y: 0 });
77
- const [isHovered, setIsHovered] = React.useState(false);
78
-
79
- const handleMouseMove = (e: React.MouseEvent<HTMLDivElement>) => {
80
- if (!enableTilt && !enableParallax) return;
81
-
82
- const rect = e.currentTarget.getBoundingClientRect();
83
- const centerX = rect.left + rect.width / 2;
84
- const centerY = rect.top + rect.height / 2;
85
-
86
- const x = (e.clientX - centerX) / (rect.width / 2);
87
- const y = (e.clientY - centerY) / (rect.height / 2);
88
-
89
- setMousePos({ x, y });
90
- };
91
-
92
- const handleMouseEnter = () => setIsHovered(true);
93
- const handleMouseLeave = () => {
94
- setIsHovered(false);
95
- setMousePos({ x: 0, y: 0 });
96
- };
97
-
98
- // Apply glassmorphism variant if enabled
99
- const finalVariant = enableGlassmorphism ? "glass" : variant;
100
-
101
- // Calculate tilt transforms
102
- const rotateX = enableTilt ? mousePos.y * -tiltMaxAngle : 0;
103
- const rotateY = enableTilt ? mousePos.x * tiltMaxAngle : 0;
104
-
105
- // Base interaction props
106
- const interactionProps = interactive && microInteraction !== "none" ? {
107
- whileHover: microInteraction === "scale" ? hoverAnimations.scale :
108
- microInteraction === "glow" ? hoverAnimations.glow :
109
- hoverAnimations.lift,
110
- whileTap: tapAnimations.scale,
111
- } : {};
112
-
113
- const { onDrag, onDragStart, onDragEnd, ...divProps } = props as any;
114
-
115
- return (
116
- <motion.div
117
- ref={ref}
118
- className={cn(moonUICardVariantsPro({ variant: finalVariant, size, radius, interactive, className }))}
119
- onMouseMove={handleMouseMove}
120
- onMouseEnter={handleMouseEnter}
121
- onMouseLeave={handleMouseLeave}
122
- style={{
123
- transformStyle: enableTilt || enableParallax ? "preserve-3d" : undefined,
124
- perspective: enableTilt || enableParallax ? "1000px" : undefined,
125
- }}
126
- animate={{
127
- rotateX,
128
- rotateY,
129
- }}
130
- transition={{ type: "spring", damping: 20, stiffness: 300 }}
131
- {...interactionProps}
132
- {...divProps}
133
- >
134
- {/* Parallax content wrapper */}
135
- {enableParallax ? (
136
- <motion.div
137
- style={{ transform: "translateZ(50px)" }}
138
- animate={{
139
- x: isHovered ? mousePos.x * parallaxOffset : 0,
140
- y: isHovered ? mousePos.y * parallaxOffset : 0,
141
- }}
142
- transition={{ type: "spring", damping: 20, stiffness: 300 }}
143
- >
144
- {children}
145
- </motion.div>
146
- ) : (
147
- children
148
- )}
149
- </motion.div>
150
- );
151
- }
152
- );
153
- MoonUICardPro.displayName = "MoonUICardPro";
154
-
155
- const MoonUICardHeaderPro = React.forwardRef<
156
- HTMLDivElement,
157
- React.HTMLAttributes<HTMLDivElement>
158
- >(({ className, ...props }, ref) => (
159
- <div
160
- ref={ref}
161
- className={cn("flex flex-col space-y-1.5", className)}
162
- {...props}
163
- />
164
- ));
165
- MoonUICardHeaderPro.displayName = "MoonUICardHeaderPro";
166
-
167
- const MoonUICardTitlePro = React.forwardRef<
168
- HTMLHeadingElement,
169
- React.HTMLAttributes<HTMLHeadingElement>
170
- >(({ className, ...props }, ref) => (
171
- <h3
172
- ref={ref}
173
- className={cn("text-lg font-semibold leading-none tracking-tight", className)}
174
- {...props}
175
- />
176
- ));
177
- MoonUICardTitlePro.displayName = "MoonUICardTitlePro";
178
-
179
- const MoonUICardDescriptionPro = React.forwardRef<
180
- HTMLParagraphElement,
181
- React.HTMLAttributes<HTMLParagraphElement>
182
- >(({ className, ...props }, ref) => (
183
- <p
184
- ref={ref}
185
- className={cn("text-sm text-muted-foreground", className)}
186
- {...props}
187
- />
188
- ));
189
- MoonUICardDescriptionPro.displayName = "MoonUICardDescriptionPro";
190
-
191
- const MoonUICardContentPro = React.forwardRef<
192
- HTMLDivElement,
193
- React.HTMLAttributes<HTMLDivElement>
194
- >(({ className, ...props }, ref) => (
195
- <div ref={ref} className={cn("pt-0", className)} {...props} />
196
- ));
197
- MoonUICardContentPro.displayName = "MoonUICardContentPro";
198
-
199
- const MoonUICardFooterPro = React.forwardRef<
200
- HTMLDivElement,
201
- React.HTMLAttributes<HTMLDivElement>
202
- >(({ className, ...props }, ref) => (
203
- <div
204
- ref={ref}
205
- className={cn("flex items-center pt-4", className)}
206
- {...props}
207
- />
208
- ));
209
- MoonUICardFooterPro.displayName = "MoonUICardFooterPro";
210
-
211
- export { MoonUICardPro, MoonUICardHeaderPro, MoonUICardFooterPro, MoonUICardTitlePro, MoonUICardDescriptionPro, MoonUICardContentPro };
212
-
213
- // Backward compatibility exports
214
- export { MoonUICardPro as Card, MoonUICardHeaderPro as CardHeader, MoonUICardFooterPro as CardFooter, MoonUICardTitlePro as CardTitle, MoonUICardDescriptionPro as CardDescription, MoonUICardContentPro as CardContent };
@@ -1,259 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import * as CheckboxPrimitive from "@radix-ui/react-checkbox";
5
- import { Check, Minus } from "lucide-react";
6
- import { cva, type VariantProps } from "class-variance-authority";
7
-
8
- import { cn } from "../../lib/utils";
9
-
10
- /**
11
- * Checkbox Bileşeni
12
- *
13
- * Erişilebilir, özelleştirilebilir ve tema sistemiyle tam entegre checkbox bileşeni.
14
- * Form elemanları ve seçim listeleri için kullanılır.
15
- */
16
-
17
- const moonUICheckboxVariantsPro = cva(
18
- "peer shrink-0 border focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:text-primary-foreground",
19
- {
20
- variants: {
21
- variant: {
22
- default: "border-border bg-background data-[state=checked]:bg-primary data-[state=checked]:border-primary",
23
- outline: "border-border bg-transparent data-[state=checked]:bg-primary data-[state=checked]:border-primary",
24
- muted: "border-border bg-accent data-[state=checked]:bg-primary data-[state=checked]:border-primary",
25
- ghost: "border-transparent bg-transparent hover:bg-accent data-[state=checked]:bg-primary data-[state=checked]:border-primary",
26
- },
27
- size: {
28
- sm: "h-3.5 w-3.5",
29
- default: "h-4 w-4",
30
- md: "h-5 w-5",
31
- lg: "h-6 w-6",
32
- },
33
- radius: {
34
- none: "rounded-none",
35
- sm: "rounded-sm",
36
- default: "rounded-sm",
37
- md: "rounded-md",
38
- full: "rounded-full",
39
- },
40
- animation: {
41
- none: "",
42
- subtle: "transition-all duration-200",
43
- default: "transition-all duration-200",
44
- bounce: "transition-all duration-200",
45
- },
46
- },
47
- defaultVariants: {
48
- variant: "default",
49
- size: "default",
50
- radius: "default",
51
- animation: "default",
52
- },
53
- }
54
- );
55
-
56
- export interface MoonUICheckboxProProps
57
- extends React.ComponentPropsWithoutRef<typeof CheckboxPrimitive.Root>,
58
- VariantProps<typeof moonUICheckboxVariantsPro> {
59
- /**
60
- * İndeterminate durumu - grup seçimlerinde bazı öğeler seçilmişse kullanılır
61
- */
62
- indeterminate?: boolean;
63
- /**
64
- * Özel ikon komponenti
65
- */
66
- icon?: React.ReactNode;
67
- }
68
-
69
- const MoonUICheckboxPro = React.forwardRef<
70
- React.ElementRef<typeof CheckboxPrimitive.Root>,
71
- MoonUICheckboxProProps
72
- >(({
73
- className,
74
- variant,
75
- size,
76
- radius,
77
- animation,
78
- indeterminate = false,
79
- icon,
80
- checked,
81
- ...props
82
- }, ref) => {
83
- // Indeterminate state yönetimi
84
- const [isIndeterminate, setIsIndeterminate] = React.useState(indeterminate);
85
-
86
- React.useEffect(() => {
87
- setIsIndeterminate(indeterminate);
88
- }, [indeterminate]);
89
-
90
- // Checked state override, indeterminate olduğunda
91
- const effectiveChecked = isIndeterminate ? false : checked;
92
-
93
- return (
94
- <CheckboxPrimitive.Root
95
- ref={ref}
96
- checked={effectiveChecked}
97
- className={cn(moonUICheckboxVariantsPro({ variant, size, radius, animation }), className)}
98
- {...props}
99
- >
100
- <CheckboxPrimitive.Indicator
101
- className={cn(
102
- "flex items-center justify-center text-current",
103
- animation === "bounce" && "data-[state=checked]:animate-bounce"
104
- )}
105
- >
106
- {isIndeterminate ? (
107
- <Minus className="h-[65%] w-[65%]" />
108
- ) : icon ? (
109
- icon
110
- ) : (
111
- <Check className="h-[65%] w-[65%]" />
112
- )}
113
- </CheckboxPrimitive.Indicator>
114
- </CheckboxPrimitive.Root>
115
- );
116
- });
117
- MoonUICheckboxPro.displayName = CheckboxPrimitive.Root.displayName;
118
-
119
- // CheckboxGroup bileşeni
120
- interface CheckboxGroupProps extends React.HTMLAttributes<HTMLDivElement> {
121
- /**
122
- * Grup içi yerleşim - dikey veya yatay
123
- */
124
- orientation?: "horizontal" | "vertical";
125
- /**
126
- * Öğeler arasındaki boşluk (piksel)
127
- */
128
- spacing?: number | string;
129
- /**
130
- * Alt bileşenler
131
- */
132
- children: React.ReactNode;
133
- }
134
-
135
- const MoonUICheckboxGroupPro = React.forwardRef<HTMLDivElement, CheckboxGroupProps>(
136
- ({ className, orientation = "vertical", spacing = "1rem", children, ...props }, ref) => {
137
- return (
138
- <div
139
- ref={ref}
140
- className={cn(
141
- "flex",
142
- orientation === "vertical" ? "flex-col" : "flex-row flex-wrap",
143
- className
144
- )}
145
- style={{ gap: spacing }}
146
- role="group"
147
- {...props}
148
- >
149
- {children}
150
- </div>
151
- );
152
- }
153
- );
154
- MoonUICheckboxGroupPro.displayName = "CheckboxGroup";
155
-
156
- // CheckboxLabel bileşeni
157
- interface CheckboxLabelProps extends React.HTMLAttributes<HTMLLabelElement> {
158
- /**
159
- * Checkbox bileşeni için HTML id
160
- */
161
- htmlFor?: string;
162
- /**
163
- * Label içeriği
164
- */
165
- children: React.ReactNode;
166
- /**
167
- * Checkbox öncesi veya sonrası
168
- */
169
- position?: "start" | "end";
170
- /**
171
- * Devre dışı durum stili
172
- */
173
- disabled?: boolean;
174
- }
175
-
176
- const MoonUICheckboxLabelPro = React.forwardRef<HTMLLabelElement, CheckboxLabelProps>(
177
- ({ className, htmlFor, children, position = "end", disabled = false, ...props }, ref) => {
178
- return (
179
- <label
180
- ref={ref}
181
- htmlFor={htmlFor}
182
- className={cn(
183
- "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
184
- position === "start" ? "mr-2" : "ml-2",
185
- disabled && "cursor-not-allowed opacity-70",
186
- className
187
- )}
188
- {...props}
189
- >
190
- {children}
191
- </label>
192
- );
193
- }
194
- );
195
- MoonUICheckboxLabelPro.displayName = "CheckboxLabel";
196
-
197
- // Checkbox ve Label içeren bileşen
198
- interface CheckboxWithLabelProps extends MoonUICheckboxProProps {
199
- /**
200
- * Label içeriği
201
- */
202
- label: React.ReactNode;
203
- /**
204
- * Label pozisyonu
205
- */
206
- labelPosition?: "start" | "end";
207
- /**
208
- * Label için HTML sınıfları
209
- */
210
- labelClassName?: string;
211
- }
212
-
213
- const MoonUICheckboxWithLabelPro = React.forwardRef<
214
- React.ElementRef<typeof CheckboxPrimitive.Root>,
215
- CheckboxWithLabelProps
216
- >(({
217
- id,
218
- label,
219
- labelPosition = "end",
220
- labelClassName,
221
- ...checkboxProps
222
- }, ref) => {
223
- const generatedId = React.useId();
224
- const checkboxId = id || generatedId;
225
-
226
- return (
227
- <div className="flex items-center">
228
- {labelPosition === "start" && (
229
- <MoonUICheckboxLabelPro
230
- htmlFor={checkboxId}
231
- position="start"
232
- disabled={checkboxProps.disabled}
233
- className={labelClassName}
234
- >
235
- {label}
236
- </MoonUICheckboxLabelPro>
237
- )}
238
-
239
- <MoonUICheckboxPro ref={ref} id={checkboxId} {...checkboxProps} />
240
-
241
- {labelPosition === "end" && (
242
- <MoonUICheckboxLabelPro
243
- htmlFor={checkboxId}
244
- position="end"
245
- disabled={checkboxProps.disabled}
246
- className={labelClassName}
247
- >
248
- {label}
249
- </MoonUICheckboxLabelPro>
250
- )}
251
- </div>
252
- );
253
- });
254
- MoonUICheckboxWithLabelPro.displayName = "CheckboxWithLabel";
255
-
256
- export { MoonUICheckboxPro, MoonUICheckboxGroupPro as CheckboxGroup, MoonUICheckboxLabelPro as CheckboxLabel, MoonUICheckboxWithLabelPro as CheckboxWithLabel };
257
-
258
- // Clean exports (only checkbox specific)
259
- export { MoonUICheckboxPro as Checkbox };
@@ -1,135 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as CollapsiblePrimitive from "@radix-ui/react-collapsible"
5
- import { cva, type VariantProps } from "class-variance-authority"
6
- import { ChevronDown } from "lucide-react"
7
-
8
- import { cn } from "../../lib/utils"
9
-
10
- /**
11
- * Collapsible (Daraltılabilir) Bileşeni
12
- *
13
- * İçeriği genişletilip daraltılabilen hafif bir bileşendir.
14
- * Tema sistemiyle tam entegre, erişilebilir ve özelleştirilebilir.
15
- */
16
-
17
- const MoonUICollapsiblePro = CollapsiblePrimitive.Root
18
-
19
- const MoonUIcollapsibleTriggerVariantsPro = cva(
20
- "flex w-full items-center justify-between transition-all",
21
- {
22
- variants: {
23
- variant: {
24
- default: "text-foreground hover:text-primary",
25
- ghost: "text-foreground hover:bg-accent/10 rounded",
26
- outline: "text-foreground border border-border rounded-t-md hover:bg-accent/5",
27
- },
28
- size: {
29
- sm: "text-xs py-2 px-3",
30
- default: "text-sm py-3 px-4",
31
- md: "text-base py-4 px-4",
32
- lg: "text-lg py-5 px-5",
33
- },
34
- },
35
- defaultVariants: {
36
- variant: "default",
37
- size: "default",
38
- },
39
- }
40
- )
41
-
42
- interface CollapsibleTriggerProps
43
- extends React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Trigger>,
44
- VariantProps<typeof MoonUIcollapsibleTriggerVariantsPro> {}
45
-
46
- const MoonUICollapsibleTriggerPro = React.forwardRef<
47
- React.ElementRef<typeof CollapsiblePrimitive.Trigger>,
48
- CollapsibleTriggerProps
49
- >(({ className, children, variant, size, asChild, ...props }, ref) => {
50
- // asChild kullanıldığında otomatik ikon eklemeyi atla
51
- if (asChild) {
52
- return (
53
- <CollapsiblePrimitive.Trigger
54
- ref={ref}
55
- className={cn(MoonUIcollapsibleTriggerVariantsPro({ variant, size }), className)}
56
- asChild={asChild}
57
- {...props}
58
- >
59
- {children}
60
- </CollapsiblePrimitive.Trigger>
61
- )
62
- }
63
-
64
- return (
65
- <CollapsiblePrimitive.Trigger
66
- ref={ref}
67
- className={cn(MoonUIcollapsibleTriggerVariantsPro({ variant, size }), className)}
68
- {...props}
69
- >
70
- {children}
71
- <ChevronDown className="h-4 w-4 shrink-0 ml-auto transition-transform duration-200 [&[data-state=open]]:rotate-180" />
72
- </CollapsiblePrimitive.Trigger>
73
- )
74
- })
75
- MoonUICollapsibleTriggerPro.displayName = CollapsiblePrimitive.Trigger.displayName
76
-
77
- const MoonUIcollapsibleContentVariantsPro = cva(
78
- "overflow-hidden transition-all data-[state=closed]:animate-collapse-up data-[state=open]:animate-collapse-down",
79
- {
80
- variants: {
81
- variant: {
82
- default: "text-muted-foreground",
83
- ghost: "text-muted-foreground rounded-b",
84
- outline: "text-muted-foreground border border-t-0 border-border rounded-b-md",
85
- },
86
- size: {
87
- sm: "text-xs",
88
- default: "text-sm",
89
- md: "text-base",
90
- lg: "text-lg",
91
- },
92
- },
93
- defaultVariants: {
94
- variant: "default",
95
- size: "default",
96
- },
97
- }
98
- )
99
-
100
- interface CollapsibleContentProps
101
- extends React.ComponentPropsWithoutRef<typeof CollapsiblePrimitive.Content>,
102
- VariantProps<typeof MoonUIcollapsibleContentVariantsPro> {}
103
-
104
- const MoonUICollapsibleContentPro = React.forwardRef<
105
- React.ElementRef<typeof CollapsiblePrimitive.Content>,
106
- CollapsibleContentProps
107
- >(({ className, children, variant, size, ...props }, ref) => (
108
- <CollapsiblePrimitive.Content
109
- ref={ref}
110
- className={cn(MoonUIcollapsibleContentVariantsPro({ variant, size }), className)}
111
- {...props}
112
- >
113
- <div className="p-4">{children}</div>
114
- </CollapsiblePrimitive.Content>
115
- ))
116
- MoonUICollapsibleContentPro.displayName = CollapsiblePrimitive.Content.displayName
117
-
118
-
119
- // Internal aliases for Pro component usage
120
- export const CollapsibleInternal = MoonUICollapsiblePro
121
- export const collapsibleTriggerVariantsInternal = MoonUIcollapsibleTriggerVariantsPro
122
- export const CollapsibleTriggerInternal = MoonUICollapsibleTriggerPro
123
- export const collapsibleContentVariantsInternal = MoonUIcollapsibleContentVariantsPro
124
- export const CollapsibleContentInternal = MoonUICollapsibleContentPro
125
-
126
- // Pro exports
127
- export { MoonUICollapsiblePro, MoonUIcollapsibleTriggerVariantsPro, MoonUICollapsibleTriggerPro, MoonUIcollapsibleContentVariantsPro, MoonUICollapsibleContentPro }
128
-
129
- // Clean exports (without MoonUI prefix for easier usage)
130
- export { MoonUICollapsiblePro as Collapsible, MoonUIcollapsibleTriggerVariantsPro as collapsibleTriggerVariants, MoonUICollapsibleTriggerPro as CollapsibleTrigger, MoonUIcollapsibleContentVariantsPro as collapsibleContentVariants, MoonUICollapsibleContentPro as CollapsibleContent }
131
-
132
- export type {
133
- CollapsibleTriggerProps,
134
- CollapsibleContentProps
135
- }
@@ -1,97 +0,0 @@
1
- "use client"
2
-
3
- import React, { useState } from "react"
4
- import { cn } from "../../lib/utils"
5
-
6
- interface MoonUIColorPickerProProps {
7
- value?: string
8
- onChange?: (color: string) => void
9
- className?: string
10
- showInput?: boolean
11
- showPresets?: boolean
12
- size?: string
13
- presets?: string[]
14
- }
15
-
16
- const defaultColors = [
17
- "#000000", "#374151", "#EF4444", "#F97316",
18
- "#F59E0B", "#EAB308", "#22C55E", "#10B981",
19
- "#06B6D4", "#3B82F6", "#6366F1", "#8B5CF6",
20
- "#A855F7", "#D946EF", "#EC4899", "#F43F5E"
21
- ]
22
-
23
- // React 19 compatible - removed forwardRef
24
- export const MoonUIColorPickerPro = ({
25
- value = "#000000",
26
- onChange,
27
- className,
28
- showInput = false,
29
- showPresets = true,
30
- size = "default",
31
- presets = defaultColors
32
- }: MoonUIColorPickerProProps) => {
33
- const [currentColor, setCurrentColor] = useState(value)
34
-
35
- const handleColorChange = (color: string) => {
36
- setCurrentColor(color)
37
- onChange?.(color)
38
- }
39
-
40
- const sizeClasses = {
41
- sm: "w-6 h-6",
42
- default: "w-8 h-8",
43
- lg: "w-10 h-10"
44
- }
45
-
46
- return (
47
- <div className={cn("flex flex-col gap-2", className)}>
48
- {showInput && (
49
- <div className="flex gap-2 items-center">
50
- <input
51
- type="color"
52
- value={currentColor}
53
- onChange={(e) => handleColorChange(e.target.value)}
54
- className={cn("rounded border cursor-pointer", sizeClasses[size as keyof typeof sizeClasses] || sizeClasses.default)}
55
- />
56
- <input
57
- type="text"
58
- value={currentColor}
59
- onChange={(e) => handleColorChange(e.target.value)}
60
- className="px-2 py-1 border rounded text-sm font-mono"
61
- placeholder="#000000"
62
- />
63
- </div>
64
- )}
65
-
66
- {!showInput && (
67
- <input
68
- type="color"
69
- value={currentColor}
70
- onChange={(e) => handleColorChange(e.target.value)}
71
- className={cn("rounded border cursor-pointer", sizeClasses[size as keyof typeof sizeClasses] || sizeClasses.default)}
72
- />
73
- )}
74
-
75
- {showPresets && presets && presets.length > 0 && (
76
- <div className="flex flex-wrap gap-1">
77
- {presets.map((color) => (
78
- <button
79
- key={color}
80
- type="button"
81
- onClick={() => handleColorChange(color)}
82
- className={cn(
83
- "w-6 h-6 rounded border-2 hover:scale-110 transition-transform",
84
- currentColor === color ? "border-gray-900 dark:border-gray-100" : "border-transparent"
85
- )}
86
- style={{ backgroundColor: color }}
87
- />
88
- ))}
89
- </div>
90
- )}
91
- </div>
92
- )
93
- }
94
-
95
- // Backward compatibility exports
96
- export { MoonUIColorPickerPro as ColorPicker }
97
- export default MoonUIColorPickerPro