@moontra/moonui-pro 2.20.2 → 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 (153) hide show
  1. package/package.json +8 -3
  2. package/plugin/index.d.ts +86 -0
  3. package/plugin/index.js +308 -0
  4. package/scripts/postinstall.js +176 -23
  5. package/src/components/advanced-chart/index.tsx +0 -1246
  6. package/src/components/advanced-forms/index.tsx +0 -585
  7. package/src/components/animated-button/index.tsx +0 -385
  8. package/src/components/calendar/event-dialog.tsx +0 -377
  9. package/src/components/calendar/index.tsx +0 -1220
  10. package/src/components/calendar-pro/index.tsx +0 -1697
  11. package/src/components/color-picker/index.tsx +0 -432
  12. package/src/components/credit-card-input/index.tsx +0 -406
  13. package/src/components/dashboard/dashboard-grid.tsx +0 -480
  14. package/src/components/dashboard/demo.tsx +0 -425
  15. package/src/components/dashboard/index.tsx +0 -1046
  16. package/src/components/dashboard/time-range-picker.tsx +0 -336
  17. package/src/components/dashboard/types.ts +0 -225
  18. package/src/components/dashboard/widgets/activity-feed.tsx +0 -349
  19. package/src/components/dashboard/widgets/chart-widget.tsx +0 -418
  20. package/src/components/dashboard/widgets/comparison-widget.tsx +0 -177
  21. package/src/components/dashboard/widgets/index.ts +0 -5
  22. package/src/components/dashboard/widgets/metric-card.tsx +0 -363
  23. package/src/components/dashboard/widgets/progress-widget.tsx +0 -113
  24. package/src/components/data-table/data-table-bulk-actions.tsx +0 -204
  25. package/src/components/data-table/data-table-column-toggle.tsx +0 -169
  26. package/src/components/data-table/data-table-export.ts +0 -156
  27. package/src/components/data-table/data-table-filter-drawer.tsx +0 -448
  28. package/src/components/data-table/index.tsx +0 -845
  29. package/src/components/draggable-list/index.tsx +0 -100
  30. package/src/components/error-boundary/index.tsx +0 -232
  31. package/src/components/file-upload/index.tsx +0 -1660
  32. package/src/components/floating-action-button/index.tsx +0 -206
  33. package/src/components/form-wizard/form-wizard-context.tsx +0 -335
  34. package/src/components/form-wizard/form-wizard-navigation.tsx +0 -118
  35. package/src/components/form-wizard/form-wizard-progress.tsx +0 -329
  36. package/src/components/form-wizard/form-wizard-step.tsx +0 -111
  37. package/src/components/form-wizard/index.tsx +0 -102
  38. package/src/components/form-wizard/types.ts +0 -77
  39. package/src/components/gesture-drawer/index.tsx +0 -551
  40. package/src/components/github-stars/github-api.ts +0 -426
  41. package/src/components/github-stars/hooks.ts +0 -517
  42. package/src/components/github-stars/index.tsx +0 -375
  43. package/src/components/github-stars/types.ts +0 -148
  44. package/src/components/github-stars/variants.tsx +0 -515
  45. package/src/components/health-check/index.tsx +0 -439
  46. package/src/components/hover-card-3d/index.tsx +0 -529
  47. package/src/components/index.ts +0 -130
  48. package/src/components/internal/index.ts +0 -78
  49. package/src/components/kanban/add-card-modal.tsx +0 -502
  50. package/src/components/kanban/card-detail-modal.tsx +0 -761
  51. package/src/components/kanban/index.ts +0 -13
  52. package/src/components/kanban/kanban.tsx +0 -1689
  53. package/src/components/kanban/types.ts +0 -168
  54. package/src/components/lazy-component/index.tsx +0 -823
  55. package/src/components/license-error/index.tsx +0 -31
  56. package/src/components/magnetic-button/index.tsx +0 -216
  57. package/src/components/memory-efficient-data/index.tsx +0 -1018
  58. package/src/components/moonui-quiz-form/index.tsx +0 -817
  59. package/src/components/navbar/index.tsx +0 -781
  60. package/src/components/optimized-image/index.tsx +0 -425
  61. package/src/components/performance-debugger/index.tsx +0 -613
  62. package/src/components/performance-monitor/index.tsx +0 -808
  63. package/src/components/phone-number-input/index.tsx +0 -343
  64. package/src/components/phone-number-input/phone-number-input-simple.tsx +0 -167
  65. package/src/components/pinch-zoom/index.tsx +0 -566
  66. package/src/components/quiz-form/index.tsx +0 -479
  67. package/src/components/rich-text-editor/index.tsx +0 -2322
  68. package/src/components/rich-text-editor/slash-commands-extension.ts +0 -230
  69. package/src/components/rich-text-editor/slash-commands.css +0 -35
  70. package/src/components/rich-text-editor/table-styles.css +0 -65
  71. package/src/components/sidebar/index.tsx +0 -884
  72. package/src/components/spotlight-card/index.tsx +0 -191
  73. package/src/components/swipeable-card/index.tsx +0 -100
  74. package/src/components/timeline/index.tsx +0 -1183
  75. package/src/components/ui/accordion.tsx +0 -581
  76. package/src/components/ui/alert-dialog.tsx +0 -141
  77. package/src/components/ui/alert.tsx +0 -141
  78. package/src/components/ui/aspect-ratio.tsx +0 -245
  79. package/src/components/ui/avatar.tsx +0 -155
  80. package/src/components/ui/badge.tsx +0 -230
  81. package/src/components/ui/breadcrumb.tsx +0 -216
  82. package/src/components/ui/button.tsx +0 -228
  83. package/src/components/ui/calendar.tsx +0 -387
  84. package/src/components/ui/card.tsx +0 -216
  85. package/src/components/ui/checkbox.tsx +0 -259
  86. package/src/components/ui/collapsible.tsx +0 -631
  87. package/src/components/ui/color-picker.tsx +0 -97
  88. package/src/components/ui/command.tsx +0 -948
  89. package/src/components/ui/dialog.tsx +0 -752
  90. package/src/components/ui/dropdown-menu.tsx +0 -706
  91. package/src/components/ui/gesture-drawer.tsx +0 -11
  92. package/src/components/ui/hover-card.tsx +0 -29
  93. package/src/components/ui/index.ts +0 -222
  94. package/src/components/ui/input.tsx +0 -224
  95. package/src/components/ui/label.tsx +0 -29
  96. package/src/components/ui/lightbox.tsx +0 -606
  97. package/src/components/ui/magnetic-button.tsx +0 -129
  98. package/src/components/ui/media-gallery.tsx +0 -611
  99. package/src/components/ui/navigation-menu.tsx +0 -130
  100. package/src/components/ui/pagination.tsx +0 -125
  101. package/src/components/ui/popover.tsx +0 -185
  102. package/src/components/ui/progress.tsx +0 -30
  103. package/src/components/ui/radio-group.tsx +0 -257
  104. package/src/components/ui/scroll-area.tsx +0 -47
  105. package/src/components/ui/select.tsx +0 -378
  106. package/src/components/ui/separator.tsx +0 -145
  107. package/src/components/ui/sheet.tsx +0 -139
  108. package/src/components/ui/skeleton.tsx +0 -20
  109. package/src/components/ui/slider.tsx +0 -354
  110. package/src/components/ui/spotlight-card.tsx +0 -119
  111. package/src/components/ui/switch.tsx +0 -86
  112. package/src/components/ui/table.tsx +0 -331
  113. package/src/components/ui/tabs-pro.tsx +0 -542
  114. package/src/components/ui/tabs.tsx +0 -54
  115. package/src/components/ui/textarea.tsx +0 -28
  116. package/src/components/ui/toast.tsx +0 -317
  117. package/src/components/ui/toggle.tsx +0 -119
  118. package/src/components/ui/tooltip.tsx +0 -151
  119. package/src/components/virtual-list/index.tsx +0 -668
  120. package/src/hooks/use-chart.ts +0 -205
  121. package/src/hooks/use-data-table.ts +0 -182
  122. package/src/hooks/use-docs-pro-access.ts +0 -13
  123. package/src/hooks/use-license-check.ts +0 -65
  124. package/src/hooks/use-subscription.ts +0 -19
  125. package/src/hooks/use-toast.ts +0 -15
  126. package/src/index.ts +0 -22
  127. package/src/lib/ai-providers.ts +0 -377
  128. package/src/lib/component-metadata.ts +0 -18
  129. package/src/lib/micro-interactions.ts +0 -255
  130. package/src/lib/paddle.ts +0 -17
  131. package/src/lib/utils.ts +0 -6
  132. package/src/patterns/login-form/index.tsx +0 -276
  133. package/src/patterns/login-form/types.ts +0 -67
  134. package/src/setupTests.ts +0 -41
  135. package/src/styles/advanced-chart.css +0 -239
  136. package/src/styles/calendar.css +0 -35
  137. package/src/styles/design-system.css +0 -363
  138. package/src/styles/index.css +0 -681
  139. package/src/styles/tailwind.css +0 -7
  140. package/src/styles/tokens.css +0 -455
  141. package/src/types/next-auth.d.ts +0 -21
  142. package/src/use-intersection-observer.tsx +0 -154
  143. package/src/use-local-storage.tsx +0 -71
  144. package/src/use-paddle.ts +0 -138
  145. package/src/use-performance-optimizer.ts +0 -389
  146. package/src/use-pro-access.ts +0 -141
  147. package/src/use-scroll-animation.ts +0 -219
  148. package/src/use-subscription.ts +0 -37
  149. package/src/use-toast.ts +0 -32
  150. package/src/utils/chart-helpers.ts +0 -357
  151. package/src/utils/cn.ts +0 -6
  152. package/src/utils/data-processing.ts +0 -151
  153. package/src/utils/license-validator.tsx +0 -183
@@ -1,119 +0,0 @@
1
- "use client";
2
-
3
- import * as React from "react";
4
- import { motion, useMotionValue, useSpring } from "framer-motion";
5
- import { cn } from "../../lib/utils";
6
-
7
- export interface SpotlightCardProps extends React.HTMLAttributes<HTMLDivElement> {
8
- children: React.ReactNode;
9
- spotlightColor?: string;
10
- spotlightSize?: number;
11
- spotlightIntensity?: number;
12
- borderRadius?: string;
13
- }
14
-
15
- const SpotlightCard = React.forwardRef<HTMLDivElement, SpotlightCardProps>(
16
- (
17
- {
18
- children,
19
- className,
20
- spotlightColor = "rgba(255, 255, 255, 0.15)",
21
- spotlightSize = 400,
22
- spotlightIntensity = 0.5,
23
- borderRadius = "0.5rem",
24
- style,
25
- ...props
26
- },
27
- ref
28
- ) => {
29
- const cardRef = React.useRef<HTMLDivElement>(null);
30
- const mouseX = useMotionValue(0);
31
- const mouseY = useMotionValue(0);
32
-
33
- const springConfig = { damping: 20, stiffness: 300 };
34
- const spotlightX = useSpring(mouseX, springConfig);
35
- const spotlightY = useSpring(mouseY, springConfig);
36
-
37
- const handleMouseMove = React.useCallback(
38
- (e: React.MouseEvent<HTMLDivElement>) => {
39
- if (!cardRef.current) return;
40
-
41
- const rect = cardRef.current.getBoundingClientRect();
42
- const x = e.clientX - rect.left;
43
- const y = e.clientY - rect.top;
44
-
45
- mouseX.set(x);
46
- mouseY.set(y);
47
- },
48
- [mouseX, mouseY]
49
- );
50
-
51
- const handleMouseLeave = React.useCallback(() => {
52
- // Optionally fade out the spotlight on mouse leave
53
- // For now, we'll keep it at the last position
54
- }, []);
55
-
56
- return (
57
- <motion.div
58
- ref={(el) => {
59
- cardRef.current = el;
60
- if (ref) {
61
- if (typeof ref === "function") ref(el);
62
- else ref.current = el;
63
- }
64
- }}
65
- className={cn(
66
- "relative overflow-hidden bg-card text-card-foreground",
67
- className
68
- )}
69
- style={{
70
- borderRadius,
71
- ...style,
72
- }}
73
- onMouseMove={handleMouseMove}
74
- onMouseLeave={handleMouseLeave}
75
- whileHover={{ scale: 1.02 }}
76
- transition={{ type: "spring", stiffness: 400, damping: 25 }}
77
- {...(props as any)}
78
- >
79
- {/* Spotlight overlay */}
80
- <motion.div
81
- className="pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 hover:opacity-100"
82
- style={{
83
- background: `radial-gradient(${spotlightSize}px circle at var(--x) var(--y), ${spotlightColor}, transparent ${spotlightIntensity * 100}%)`,
84
- "--x": spotlightX,
85
- "--y": spotlightY,
86
- } as React.CSSProperties}
87
- />
88
-
89
- {/* Border glow effect */}
90
- <motion.div
91
- className="pointer-events-none absolute inset-0 opacity-0 transition-opacity duration-300 hover:opacity-100"
92
- style={{
93
- background: `radial-gradient(${spotlightSize * 1.5}px circle at var(--x) var(--y), ${spotlightColor}, transparent 40%)`,
94
- "--x": spotlightX,
95
- "--y": spotlightY,
96
- filter: "blur(40px)",
97
- } as React.CSSProperties}
98
- />
99
-
100
- {/* Card border */}
101
- <div
102
- className="absolute inset-0 rounded-[inherit] border border-border/50"
103
- style={{
104
- background: `radial-gradient(${spotlightSize * 2}px circle at var(--x) var(--y), rgba(255,255,255,0.1), transparent 40%)`,
105
- "--x": spotlightX,
106
- "--y": spotlightY,
107
- } as React.CSSProperties}
108
- />
109
-
110
- {/* Content */}
111
- <div className="relative z-10">{children}</div>
112
- </motion.div>
113
- );
114
- }
115
- );
116
-
117
- SpotlightCard.displayName = "SpotlightCard";
118
-
119
- export { SpotlightCard };
@@ -1,86 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import * as SwitchPrimitives from "@radix-ui/react-switch"
5
-
6
- import { cn } from "../../lib/utils"
7
-
8
- type SwitchSize = "sm" | "md" | "lg";
9
- type SwitchVariant = "primary" | "success" | "warning" | "danger" | "secondary";
10
-
11
- export interface MoonUISwitchProProps extends React.ComponentPropsWithoutRef<typeof SwitchPrimitives.Root> {
12
- /** Switch boyutu */
13
- size?: SwitchSize;
14
- /** Switch renk varyantı */
15
- variant?: SwitchVariant;
16
- /** Yükleniyor durumunu gösterir */
17
- loading?: boolean;
18
- /** Sol tarafta gösterilecek ikon */
19
- leftIcon?: React.ReactNode;
20
- /** Sağ tarafta gösterilecek ikon */
21
- rightIcon?: React.ReactNode;
22
- /** Switch açıklaması */
23
- description?: string;
24
- }
25
-
26
- const MoonUISwitchPro = React.forwardRef<
27
- React.ElementRef<typeof SwitchPrimitives.Root>,
28
- MoonUISwitchProProps
29
- >(({ className, size = "md", variant = "primary", loading, leftIcon, rightIcon, description, ...props }, ref) => (
30
- <div className="inline-flex items-center gap-2">
31
- {leftIcon && <span className="text-muted-foreground">{leftIcon}</span>}
32
- <SwitchPrimitives.Root
33
- className={cn(
34
- "peer relative inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 dark:data-[state=unchecked]:bg-gray-700/70 dark:focus-visible:ring-primary/40 dark:focus-visible:ring-offset-gray-950",
35
-
36
- // Boyutlar
37
- size === "sm" && "h-4 w-8",
38
- size === "md" && "h-6 w-11",
39
- size === "lg" && "h-7 w-14",
40
-
41
- // Varyantlar (checked durumunda)
42
- variant === "primary" && "data-[state=checked]:bg-primary",
43
- variant === "success" && "data-[state=checked]:bg-success",
44
- variant === "warning" && "data-[state=checked]:bg-warning",
45
- variant === "danger" && "data-[state=checked]:bg-error",
46
- variant === "secondary" && "data-[state=checked]:bg-accent",
47
-
48
- // Unchecked durumu
49
- "data-[state=unchecked]:bg-input",
50
-
51
- // Loading durumu
52
- loading && "opacity-80 cursor-wait",
53
-
54
- className
55
- )}
56
- disabled={loading || props.disabled}
57
- {...props}
58
- ref={ref}
59
- >
60
- {loading ? (
61
- <div className="absolute inset-0 flex items-center justify-center">
62
- <div className="h-3 w-3 animate-spin rounded-full border-2 border-gray-300 border-t-primary"></div>
63
- </div>
64
- ) : null}
65
-
66
- <SwitchPrimitives.Thumb
67
- className={cn(
68
- "pointer-events-none block rounded-full bg-background shadow-lg ring-0 transition-transform",
69
- // Boyuta göre thumb boyutları
70
- size === "sm" && "h-3 w-3 data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0",
71
- size === "md" && "h-5 w-5 data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0",
72
- size === "lg" && "h-6 w-6 data-[state=checked]:translate-x-7 data-[state=unchecked]:translate-x-0",
73
- )}
74
- />
75
- </SwitchPrimitives.Root>
76
- {rightIcon && <span className="text-muted-foreground">{rightIcon}</span>}
77
- {description && <span className="text-sm text-muted-foreground">{description}</span>}
78
- </div>
79
- ))
80
- MoonUISwitchPro.displayName = SwitchPrimitives.Root.displayName
81
-
82
- export { MoonUISwitchPro };
83
-
84
- // Backward compatibility exports
85
- export { MoonUISwitchPro as Switch }
86
- export type { SwitchSize, SwitchVariant }
@@ -1,331 +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
- export type SortDirection = "asc" | "desc" | null;
9
-
10
- const MoonUItableVariantsPro = cva(
11
- "w-full caption-bottom text-sm",
12
- {
13
- variants: {
14
- variant: {
15
- default: "dark:text-gray-200",
16
- bordered: "border border-border dark:border-gray-700",
17
- striped: "dark:text-gray-200",
18
- card: "border border-border dark:border-gray-700 rounded-md shadow-sm dark:shadow-gray-900/20",
19
- minimal: "border-none dark:text-gray-200",
20
- },
21
- size: {
22
- sm: "text-xs",
23
- default: "text-sm",
24
- lg: "text-base",
25
- },
26
- },
27
- defaultVariants: {
28
- variant: "default",
29
- size: "default",
30
- },
31
- }
32
- );
33
-
34
- export interface ColumnDefinition<T> {
35
- id: string;
36
- header: React.ReactNode;
37
- accessorKey?: keyof T;
38
- cell?: (row: T) => React.ReactNode;
39
- sortable?: boolean;
40
- }
41
-
42
- interface TableProps<T>
43
- extends React.HTMLAttributes<HTMLTableElement>,
44
- VariantProps<typeof MoonUItableVariantsPro> {
45
- /** Veri yükleniyor durumunu gösterir */
46
- loading?: boolean;
47
- /** Sıralama için kullanılan sütun */
48
- sortColumn?: string;
49
- /** Sıralama yönü */
50
- sortDirection?: SortDirection;
51
- /** Sıralama değiştiğinde çağrılacak fonksiyon */
52
- onSortChange?: (column: string, direction: SortDirection) => void;
53
- /** Boş durum için özel içerik */
54
- emptyContent?: React.ReactNode;
55
- /** Seçili satır id'leri */
56
- selectedRowIds?: string[];
57
- /** Satır seçim değiştiğinde çağrılacak fonksiyon */
58
- onRowSelectionChange?: (selectedRowIds: string[]) => void;
59
- /** Satır seçim devre dışı */
60
- disableRowSelection?: boolean;
61
- /** Her satır için benzersiz id çıkarma fonksiyonu */
62
- getRowId?: (row: T) => string;
63
- }
64
-
65
- // Tip parametresiz Table bileşeni için varsayılan tip, herhangi bir veri tipini kabul edebilmesi için
66
- const MoonUITablePro = React.forwardRef<
67
- HTMLTableElement,
68
- TableProps<unknown>
69
- >(({
70
- className,
71
- variant,
72
- size,
73
- loading,
74
- emptyContent,
75
- // Kullanılmayan özellikleri yoruma alarak lint uyarılarını önlüyoruz
76
- // sortColumn,
77
- // sortDirection,
78
- // onSortChange,
79
- // selectedRowIds,
80
- // onRowSelectionChange,
81
- // disableRowSelection,
82
- // getRowId,
83
- ...props
84
- }, ref) => {
85
- // Apply striped styles to the tbody via a class name
86
- const MoonUIstripedPro = variant === "striped";
87
-
88
- // Çocukları güvenli bir şekilde işle ve tip kontrollerini doğru yap
89
- const MoonUIchildrenWithPropsPro = React.Children.map(props.children, (child) => {
90
- if (React.isValidElement(child)) {
91
- if (child.type === "tbody") {
92
- // Tip güvenliği için props'ları düzgün şekilde ele alıyoruz
93
- const MoonUItbodyPropsPro = child.props as Record<string, unknown>;
94
- return React.cloneElement(child as React.ReactElement<React.HTMLAttributes<HTMLTableSectionElement>>, {
95
- className: cn(MoonUItbodyPropsPro.className as string | undefined, MoonUIstripedPro && "even:[&>tr]:bg-muted/50")
96
- });
97
- }
98
- }
99
- return child;
100
- });
101
-
102
- return (
103
- <div className="relative w-full overflow-auto">
104
- {/* Yükleniyor durumu için overlay */}
105
- {loading && (
106
- <div className="absolute inset-0 bg-background/60 flex items-center justify-center z-10">
107
- <div className="h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"></div>
108
- </div>
109
- )}
110
-
111
- <table
112
- ref={ref}
113
- className={cn(
114
- MoonUItableVariantsPro({ variant, size }),
115
- loading && "opacity-70",
116
- className
117
- )}
118
- {...props}
119
- >
120
- {MoonUIchildrenWithPropsPro}
121
- </table>
122
-
123
- </div>
124
- );
125
- });
126
- MoonUITablePro.displayName = "TablePro";
127
-
128
- const MoonUITableHeaderPro = React.forwardRef<
129
- HTMLTableSectionElement,
130
- React.HTMLAttributes<HTMLTableSectionElement>
131
- >(({ className, ...props }, ref) => (
132
- <thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
133
- ));
134
- MoonUITableHeaderPro.displayName = "TableHeaderPro";
135
-
136
- interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {
137
- /** Veri yoksa gösterilecek boş durum içeriği */
138
- emptyContent?: React.ReactNode;
139
- /** Varsayılan boş durum mesajı */
140
- emptyMessage?: string;
141
- }
142
-
143
- const MoonUITableBodyPro = React.forwardRef<
144
- HTMLTableSectionElement,
145
- TableBodyProps
146
- >(({ className, emptyContent, emptyMessage = "No data available", children, ...props }, ref) => {
147
- // Çocuk elementlerin varlığını kontrol et
148
- const MoonUIhasChildrenPro = React.Children.count(children) > 0;
149
-
150
- return (
151
- <tbody
152
- ref={ref}
153
- className={cn("[&_tr:last-child]:border-0", className)}
154
- {...props}
155
- >
156
- {MoonUIhasChildrenPro ? (
157
- children
158
- ) : (
159
- <tr>
160
- <td colSpan={100} className="h-24 text-center">
161
- {emptyContent || (
162
- <div className="py-6 text-muted-foreground">
163
- <div className="text-sm">
164
- {emptyMessage}
165
- </div>
166
- </div>
167
- )}
168
- </td>
169
- </tr>
170
- )}
171
- </tbody>
172
- )
173
- });
174
- MoonUITableBodyPro.displayName = "TableBodyPro";
175
-
176
- const MoonUITableFooterPro = React.forwardRef<
177
- HTMLTableSectionElement,
178
- React.HTMLAttributes<HTMLTableSectionElement>
179
- >(({ className, ...props }, ref) => (
180
- <tfoot
181
- ref={ref}
182
- className={cn("bg-primary text-primary-foreground font-medium", className)}
183
- {...props}
184
- />
185
- ));
186
- MoonUITableFooterPro.displayName = "TableFooterPro";
187
-
188
- const MoonUITableRowPro = React.forwardRef<
189
- HTMLTableRowElement,
190
- React.HTMLAttributes<HTMLTableRowElement>
191
- >(({ className, ...props }, ref) => (
192
- <tr
193
- ref={ref}
194
- className={cn(
195
- "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
196
- className
197
- )}
198
- {...props}
199
- />
200
- ));
201
- MoonUITableRowPro.displayName = "TableRowPro";
202
-
203
- interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
204
- /** Bu sütun için sıralama durumu */
205
- sortable?: boolean;
206
- /** Bu sütunun sıralanma durumu */
207
- sorted?: SortDirection;
208
- /** Sıralama değiştiğinde çağrılacak fonksiyon */
209
- onSort?: () => void;
210
- }
211
-
212
- const MoonUITableHeadPro = React.forwardRef<HTMLTableCellElement, TableHeadProps>(
213
- ({ className, sortable, sorted, onSort, children, ...props }, ref) => {
214
- // Sıralama için simgeler
215
- const MoonUIrenderSortIconPro = () => {
216
- if (!sortable) return null;
217
-
218
- if (sorted === "asc") {
219
- return (
220
- <svg
221
- xmlns="http://www.w3.org/2000/svg"
222
- className="ml-1 h-4 w-4 inline-block"
223
- viewBox="0 0 20 20"
224
- fill="currentColor"
225
- >
226
- <path
227
- fillRule="evenodd"
228
- d="M14.707 10.293a1 1 0 010 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 111.414-1.414L9 12.586V5a1 1 0 012 0v7.586l2.293-2.293a1 1 0 011.414 0z"
229
- clipRule="evenodd"
230
- />
231
- </svg>
232
- );
233
- }
234
-
235
- if (sorted === "desc") {
236
- return (
237
- <svg
238
- xmlns="http://www.w3.org/2000/svg"
239
- className="ml-1 h-4 w-4 inline-block"
240
- viewBox="0 0 20 20"
241
- fill="currentColor"
242
- >
243
- <path
244
- fillRule="evenodd"
245
- d="M5.293 9.707a1 1 0 010-1.414l4-4a1 1 0 011.414 0l4 4a1 1 0 01-1.414 1.414L11 7.414V15a1 1 0 11-2 0V7.414L6.707 9.707a1 1 0 01-1.414 0z"
246
- clipRule="evenodd"
247
- />
248
- </svg>
249
- );
250
- }
251
-
252
- return (
253
- <svg
254
- xmlns="http://www.w3.org/2000/svg"
255
- className="ml-1 h-4 w-4 inline-block opacity-30"
256
- viewBox="0 0 20 20"
257
- fill="currentColor"
258
- >
259
- <path
260
- fillRule="evenodd"
261
- d="M10 3a1 1 0 01.707.293l3 3a1 1 0 01-1.414 1.414L10 5.414 7.707 7.707a1 1 0 01-1.414-1.414l3-3A1 1 0 0110 3zm-3.707 9.293a1 1 0 011.414 0L10 14.586l2.293-2.293a1 1 0 011.414 1.414l-3 3a1 1 0 01-1.414 0l-3-3a1 1 0 010-1.414z"
262
- clipRule="evenodd"
263
- />
264
- </svg>
265
- );
266
- };
267
-
268
- return (
269
- <th
270
- ref={ref}
271
- className={cn(
272
- "h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
273
- sortable && "cursor-pointer hover:text-foreground select-none",
274
- className
275
- )}
276
- onClick={sortable ? onSort : undefined}
277
- {...props}
278
- >
279
- <div className="flex items-center">
280
- {children}
281
- {sortable && MoonUIrenderSortIconPro()}
282
- </div>
283
- </th>
284
- );
285
- }
286
- );
287
- MoonUITableHeadPro.displayName = "TableHeadPro";
288
-
289
- const MoonUITableCellPro = React.forwardRef<
290
- HTMLTableCellElement,
291
- React.TdHTMLAttributes<HTMLTableCellElement>
292
- >(({ className, ...props }, ref) => (
293
- <td
294
- ref={ref}
295
- className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
296
- {...props}
297
- />
298
- ));
299
- MoonUITableCellPro.displayName = "TableCellPro";
300
-
301
- const MoonUITableCaptionPro = React.forwardRef<
302
- HTMLTableCaptionElement,
303
- React.HTMLAttributes<HTMLTableCaptionElement>
304
- >(({ className, ...props }, ref) => (
305
- <caption
306
- ref={ref}
307
- className={cn("mt-4 text-sm text-muted-foreground", className)}
308
- {...props}
309
- />
310
- ));
311
- MoonUITableCaptionPro.displayName = "TableCaptionPro";
312
-
313
-
314
- // Internal aliases for Pro component usage
315
- export const tableVariantsInternal = MoonUItableVariantsPro
316
- export const TableInternal = MoonUITablePro
317
- export const TableHeaderInternal = MoonUITableHeaderPro
318
- export const TableBodyInternal = MoonUITableBodyPro
319
- export const TableFooterInternal = MoonUITableFooterPro
320
- export const TableRowInternal = MoonUITableRowPro
321
- export const TableHeadInternal = MoonUITableHeadPro
322
- export const TableCellInternal = MoonUITableCellPro
323
- export const TableCaptionInternal = MoonUITableCaptionPro
324
-
325
- // Pro exports
326
- export { MoonUItableVariantsPro, MoonUITablePro, MoonUITableHeaderPro, MoonUITableBodyPro, MoonUITableFooterPro, MoonUITableRowPro, MoonUITableHeadPro, MoonUITableCellPro, MoonUITableCaptionPro }
327
-
328
- // Clean exports (without MoonUI prefix for easier usage)
329
- export { MoonUItableVariantsPro as tableVariants, MoonUITablePro as Table, MoonUITableHeaderPro as TableHeader, MoonUITableBodyPro as TableBody, MoonUITableFooterPro as TableFooter, MoonUITableRowPro as TableRow, MoonUITableHeadPro as TableHead, MoonUITableCellPro as TableCell, MoonUITableCaptionPro as TableCaption };
330
-
331
- export type { TableBodyProps };