@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,329 +0,0 @@
1
- import * as React from "react";
2
- import { cva, type VariantProps } from "class-variance-authority";
3
-
4
- import { cn } from "../../lib/utils";
5
-
6
- export type SortDirection = "asc" | "desc" | null;
7
-
8
- const MoonUItableVariantsPro = cva(
9
- "w-full caption-bottom text-sm",
10
- {
11
- variants: {
12
- variant: {
13
- default: "dark:text-gray-200",
14
- bordered: "border border-border dark:border-gray-700",
15
- striped: "dark:text-gray-200",
16
- card: "border border-border dark:border-gray-700 rounded-md shadow-sm dark:shadow-gray-900/20",
17
- minimal: "border-none dark:text-gray-200",
18
- },
19
- size: {
20
- sm: "text-xs",
21
- default: "text-sm",
22
- lg: "text-base",
23
- },
24
- },
25
- defaultVariants: {
26
- variant: "default",
27
- size: "default",
28
- },
29
- }
30
- );
31
-
32
- export interface ColumnDefinition<T> {
33
- id: string;
34
- header: React.ReactNode;
35
- accessorKey?: keyof T;
36
- cell?: (row: T) => React.ReactNode;
37
- sortable?: boolean;
38
- }
39
-
40
- interface TableProps<T>
41
- extends React.HTMLAttributes<HTMLTableElement>,
42
- VariantProps<typeof MoonUItableVariantsPro> {
43
- /** Veri yükleniyor durumunu gösterir */
44
- loading?: boolean;
45
- /** Sıralama için kullanılan sütun */
46
- sortColumn?: string;
47
- /** Sıralama yönü */
48
- sortDirection?: SortDirection;
49
- /** Sıralama değiştiğinde çağrılacak fonksiyon */
50
- onSortChange?: (column: string, direction: SortDirection) => void;
51
- /** Boş durum için özel içerik */
52
- emptyContent?: React.ReactNode;
53
- /** Seçili satır id'leri */
54
- selectedRowIds?: string[];
55
- /** Satır seçim değiştiğinde çağrılacak fonksiyon */
56
- onRowSelectionChange?: (selectedRowIds: string[]) => void;
57
- /** Satır seçim devre dışı */
58
- disableRowSelection?: boolean;
59
- /** Her satır için benzersiz id çıkarma fonksiyonu */
60
- getRowId?: (row: T) => string;
61
- }
62
-
63
- // Tip parametresiz Table bileşeni için varsayılan tip, herhangi bir veri tipini kabul edebilmesi için
64
- const MoonUITablePro = React.forwardRef<
65
- HTMLTableElement,
66
- TableProps<unknown>
67
- >(({
68
- className,
69
- variant,
70
- size,
71
- loading,
72
- emptyContent,
73
- // Kullanılmayan özellikleri yoruma alarak lint uyarılarını önlüyoruz
74
- // sortColumn,
75
- // sortDirection,
76
- // onSortChange,
77
- // selectedRowIds,
78
- // onRowSelectionChange,
79
- // disableRowSelection,
80
- // getRowId,
81
- ...props
82
- }, ref) => {
83
- // Apply striped styles to the tbody via a class name
84
- const MoonUIstripedPro = variant === "striped";
85
-
86
- // Çocukları güvenli bir şekilde işle ve tip kontrollerini doğru yap
87
- const MoonUIchildrenWithPropsPro = React.Children.map(props.children, (child) => {
88
- if (React.isValidElement(child)) {
89
- if (child.type === "tbody") {
90
- // Tip güvenliği için props'ları düzgün şekilde ele alıyoruz
91
- const MoonUItbodyPropsPro = child.props as Record<string, unknown>;
92
- return React.cloneElement(child as React.ReactElement<React.HTMLAttributes<HTMLTableSectionElement>>, {
93
- className: cn(MoonUItbodyPropsPro.className as string | undefined, MoonUIstripedPro && "even:[&>tr]:bg-muted/50")
94
- });
95
- }
96
- }
97
- return child;
98
- });
99
-
100
- return (
101
- <div className="relative w-full overflow-auto">
102
- {/* Yükleniyor durumu için overlay */}
103
- {loading && (
104
- <div className="absolute inset-0 bg-background/60 flex items-center justify-center z-10">
105
- <div className="h-8 w-8 animate-spin rounded-full border-2 border-primary border-t-transparent"></div>
106
- </div>
107
- )}
108
-
109
- <table
110
- ref={ref}
111
- className={cn(
112
- MoonUItableVariantsPro({ variant, size }),
113
- loading && "opacity-70",
114
- className
115
- )}
116
- {...props}
117
- >
118
- {MoonUIchildrenWithPropsPro}
119
- </table>
120
-
121
- </div>
122
- );
123
- });
124
- MoonUITablePro.displayName = "TablePro";
125
-
126
- const MoonUITableHeaderPro = React.forwardRef<
127
- HTMLTableSectionElement,
128
- React.HTMLAttributes<HTMLTableSectionElement>
129
- >(({ className, ...props }, ref) => (
130
- <thead ref={ref} className={cn("[&_tr]:border-b", className)} {...props} />
131
- ));
132
- MoonUITableHeaderPro.displayName = "TableHeaderPro";
133
-
134
- interface TableBodyProps extends React.HTMLAttributes<HTMLTableSectionElement> {
135
- /** Veri yoksa gösterilecek boş durum içeriği */
136
- emptyContent?: React.ReactNode;
137
- /** Varsayılan boş durum mesajı */
138
- emptyMessage?: string;
139
- }
140
-
141
- const MoonUITableBodyPro = React.forwardRef<
142
- HTMLTableSectionElement,
143
- TableBodyProps
144
- >(({ className, emptyContent, emptyMessage = "No data available", children, ...props }, ref) => {
145
- // Çocuk elementlerin varlığını kontrol et
146
- const MoonUIhasChildrenPro = React.Children.count(children) > 0;
147
-
148
- return (
149
- <tbody
150
- ref={ref}
151
- className={cn("[&_tr:last-child]:border-0", className)}
152
- {...props}
153
- >
154
- {MoonUIhasChildrenPro ? (
155
- children
156
- ) : (
157
- <tr>
158
- <td colSpan={100} className="h-24 text-center">
159
- {emptyContent || (
160
- <div className="py-6 text-muted-foreground">
161
- <div className="text-sm">
162
- {emptyMessage}
163
- </div>
164
- </div>
165
- )}
166
- </td>
167
- </tr>
168
- )}
169
- </tbody>
170
- )
171
- });
172
- MoonUITableBodyPro.displayName = "TableBodyPro";
173
-
174
- const MoonUITableFooterPro = React.forwardRef<
175
- HTMLTableSectionElement,
176
- React.HTMLAttributes<HTMLTableSectionElement>
177
- >(({ className, ...props }, ref) => (
178
- <tfoot
179
- ref={ref}
180
- className={cn("bg-primary text-primary-foreground font-medium", className)}
181
- {...props}
182
- />
183
- ));
184
- MoonUITableFooterPro.displayName = "TableFooterPro";
185
-
186
- const MoonUITableRowPro = React.forwardRef<
187
- HTMLTableRowElement,
188
- React.HTMLAttributes<HTMLTableRowElement>
189
- >(({ className, ...props }, ref) => (
190
- <tr
191
- ref={ref}
192
- className={cn(
193
- "border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",
194
- className
195
- )}
196
- {...props}
197
- />
198
- ));
199
- MoonUITableRowPro.displayName = "TableRowPro";
200
-
201
- interface TableHeadProps extends React.ThHTMLAttributes<HTMLTableCellElement> {
202
- /** Bu sütun için sıralama durumu */
203
- sortable?: boolean;
204
- /** Bu sütunun sıralanma durumu */
205
- sorted?: SortDirection;
206
- /** Sıralama değiştiğinde çağrılacak fonksiyon */
207
- onSort?: () => void;
208
- }
209
-
210
- const MoonUITableHeadPro = React.forwardRef<HTMLTableCellElement, TableHeadProps>(
211
- ({ className, sortable, sorted, onSort, children, ...props }, ref) => {
212
- // Sıralama için simgeler
213
- const MoonUIrenderSortIconPro = () => {
214
- if (!sortable) return null;
215
-
216
- if (sorted === "asc") {
217
- return (
218
- <svg
219
- xmlns="http://www.w3.org/2000/svg"
220
- className="ml-1 h-4 w-4 inline-block"
221
- viewBox="0 0 20 20"
222
- fill="currentColor"
223
- >
224
- <path
225
- fillRule="evenodd"
226
- 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"
227
- clipRule="evenodd"
228
- />
229
- </svg>
230
- );
231
- }
232
-
233
- if (sorted === "desc") {
234
- return (
235
- <svg
236
- xmlns="http://www.w3.org/2000/svg"
237
- className="ml-1 h-4 w-4 inline-block"
238
- viewBox="0 0 20 20"
239
- fill="currentColor"
240
- >
241
- <path
242
- fillRule="evenodd"
243
- 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"
244
- clipRule="evenodd"
245
- />
246
- </svg>
247
- );
248
- }
249
-
250
- return (
251
- <svg
252
- xmlns="http://www.w3.org/2000/svg"
253
- className="ml-1 h-4 w-4 inline-block opacity-30"
254
- viewBox="0 0 20 20"
255
- fill="currentColor"
256
- >
257
- <path
258
- fillRule="evenodd"
259
- 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"
260
- clipRule="evenodd"
261
- />
262
- </svg>
263
- );
264
- };
265
-
266
- return (
267
- <th
268
- ref={ref}
269
- className={cn(
270
- "h-10 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0",
271
- sortable && "cursor-pointer hover:text-foreground select-none",
272
- className
273
- )}
274
- onClick={sortable ? onSort : undefined}
275
- {...props}
276
- >
277
- <div className="flex items-center">
278
- {children}
279
- {sortable && MoonUIrenderSortIconPro()}
280
- </div>
281
- </th>
282
- );
283
- }
284
- );
285
- MoonUITableHeadPro.displayName = "TableHeadPro";
286
-
287
- const MoonUITableCellPro = React.forwardRef<
288
- HTMLTableCellElement,
289
- React.TdHTMLAttributes<HTMLTableCellElement>
290
- >(({ className, ...props }, ref) => (
291
- <td
292
- ref={ref}
293
- className={cn("p-4 align-middle [&:has([role=checkbox])]:pr-0", className)}
294
- {...props}
295
- />
296
- ));
297
- MoonUITableCellPro.displayName = "TableCellPro";
298
-
299
- const MoonUITableCaptionPro = React.forwardRef<
300
- HTMLTableCaptionElement,
301
- React.HTMLAttributes<HTMLTableCaptionElement>
302
- >(({ className, ...props }, ref) => (
303
- <caption
304
- ref={ref}
305
- className={cn("mt-4 text-sm text-muted-foreground", className)}
306
- {...props}
307
- />
308
- ));
309
- MoonUITableCaptionPro.displayName = "TableCaptionPro";
310
-
311
-
312
- // Internal aliases for Pro component usage
313
- export const tableVariantsInternal = MoonUItableVariantsPro
314
- export const TableInternal = MoonUITablePro
315
- export const TableHeaderInternal = MoonUITableHeaderPro
316
- export const TableBodyInternal = MoonUITableBodyPro
317
- export const TableFooterInternal = MoonUITableFooterPro
318
- export const TableRowInternal = MoonUITableRowPro
319
- export const TableHeadInternal = MoonUITableHeadPro
320
- export const TableCellInternal = MoonUITableCellPro
321
- export const TableCaptionInternal = MoonUITableCaptionPro
322
-
323
- // Pro exports
324
- export { MoonUItableVariantsPro, MoonUITablePro, MoonUITableHeaderPro, MoonUITableBodyPro, MoonUITableFooterPro, MoonUITableRowPro, MoonUITableHeadPro, MoonUITableCellPro, MoonUITableCaptionPro }
325
-
326
- // Clean exports (without MoonUI prefix for easier usage)
327
- 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 };
328
-
329
- export type { TableBodyProps };
@@ -1,198 +0,0 @@
1
- import * as React from "react";
2
- import * as TabsPrimitive from "@radix-ui/react-tabs";
3
- import { cva, type VariantProps } from "class-variance-authority";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- /* -------------------------------------------------------------------------------------------------
8
- * Tabs Root
9
- * -----------------------------------------------------------------------------------------------*/
10
- interface MoonUITabsProProps extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Root> {
11
- /** Mobil görünümde dikey düzen için */
12
- vertical?: boolean;
13
- }
14
-
15
- const MoonUITabsPro = React.forwardRef<
16
- React.ElementRef<typeof TabsPrimitive.Root>,
17
- MoonUITabsProProps
18
- >(({ vertical = false, ...props }, ref) => (
19
- <TabsPrimitive.Root
20
- ref={ref}
21
- orientation={vertical ? "vertical" : "horizontal"}
22
- {...props}
23
- />
24
- ));
25
-
26
- MoonUITabsPro.displayName = TabsPrimitive.Root.displayName;
27
-
28
- /* -------------------------------------------------------------------------------------------------
29
- * TabsList
30
- * -----------------------------------------------------------------------------------------------*/
31
- const tabsListVariants = cva(
32
- "flex items-center justify-start transition-all duration-200",
33
- {
34
- variants: {
35
- variant: {
36
- default: "bg-muted rounded-md p-1 text-muted-foreground dark:bg-gray-800/80 dark:text-gray-400",
37
- pills: "bg-transparent gap-2 p-0 dark:text-gray-400",
38
- underline: "bg-transparent border-b border-border dark:border-gray-700 gap-4 dark:text-gray-400",
39
- cards: "bg-transparent gap-2 p-0 dark:text-gray-400",
40
- minimal: "bg-transparent gap-1 p-0 dark:text-gray-400",
41
- },
42
- orientation: {
43
- horizontal: "flex-row",
44
- vertical: "flex-col items-start gap-1"
45
- },
46
- fullWidth: {
47
- true: "w-full"
48
- }
49
- },
50
- defaultVariants: {
51
- variant: "default",
52
- orientation: "horizontal",
53
- fullWidth: false
54
- }
55
- }
56
- );
57
-
58
- interface MoonUITabsListProProps
59
- extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>,
60
- VariantProps<typeof tabsListVariants> {
61
- /** Dikey düzende göster */
62
- orientation?: "horizontal" | "vertical";
63
- }
64
-
65
- const MoonUITabsListPro = React.forwardRef<
66
- React.ElementRef<typeof TabsPrimitive.List>,
67
- MoonUITabsListProProps
68
- >(({ className, variant, orientation, fullWidth, ...props }, ref) => (
69
- <TabsPrimitive.List
70
- ref={ref}
71
- className={cn(tabsListVariants({ variant, orientation, fullWidth, className }))}
72
- {...props}
73
- />
74
- ));
75
-
76
- MoonUITabsListPro.displayName = TabsPrimitive.List.displayName;
77
-
78
- /* -------------------------------------------------------------------------------------------------
79
- * TabsTrigger
80
- * -----------------------------------------------------------------------------------------------*/
81
- const tabsTriggerVariants = cva(
82
- "inline-flex items-center justify-center whitespace-nowrap font-medium ring-offset-background transition-all duration-200 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",
83
- {
84
- variants: {
85
- variant: {
86
- default: "rounded-md data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-sm dark:data-[state=active]:bg-gray-900 dark:data-[state=active]:text-gray-100 dark:data-[state=active]:shadow-gray-950/10",
87
- underline: "rounded-none border-b-2 border-transparent pb-2 data-[state=active]:border-primary data-[state=active]:bg-transparent data-[state=active]:text-foreground dark:data-[state=active]:border-primary/80 dark:data-[state=active]:text-gray-100",
88
- pills: "rounded-full bg-muted hover:bg-muted/80 data-[state=active]:bg-primary data-[state=active]:text-primary-foreground dark:bg-gray-800 dark:hover:bg-gray-700 dark:data-[state=active]:bg-primary/90 dark:data-[state=active]:text-white",
89
- cards: "rounded-md bg-muted/50 hover:bg-muted data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow-md dark:bg-gray-800/50 dark:hover:bg-gray-700/50 dark:data-[state=active]:bg-gray-900 dark:data-[state=active]:text-gray-100 dark:data-[state=active]:shadow-gray-950/20",
90
- minimal: "rounded-sm bg-transparent hover:bg-muted/30 data-[state=active]:bg-transparent data-[state=active]:text-foreground data-[state=active]:underline data-[state=active]:underline-offset-4 dark:hover:bg-gray-800/30 dark:data-[state=active]:text-gray-200",
91
- },
92
- size: {
93
- sm: "h-7 px-2 text-xs",
94
- md: "h-9 px-3 py-1.5 text-sm",
95
- lg: "h-10 px-4 py-2 text-base",
96
- },
97
- orientation: {
98
- horizontal: "",
99
- vertical: "justify-start w-full text-left"
100
- },
101
- fullWidth: {
102
- true: "w-full"
103
- }
104
- },
105
- defaultVariants: {
106
- variant: "default",
107
- size: "md",
108
- orientation: "horizontal",
109
- fullWidth: false
110
- }
111
- }
112
- );
113
-
114
- interface MoonUITabsTriggerProProps
115
- extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>,
116
- VariantProps<typeof tabsTriggerVariants> {
117
- /** İkon konumu */
118
- iconPosition?: "left" | "right" | "none";
119
- /** İkon */
120
- icon?: React.ReactNode;
121
- /** Badge içeriği */
122
- badge?: React.ReactNode;
123
- /** Aktif olmayan durumda yarı saydam */
124
- fadeTabs?: boolean;
125
- /** Dikey düzende göster */
126
- orientation?: "horizontal" | "vertical";
127
- }
128
-
129
- const MoonUITabsTriggerPro = React.forwardRef<
130
- React.ElementRef<typeof TabsPrimitive.Trigger>,
131
- MoonUITabsTriggerProProps
132
- >(({
133
- className,
134
- variant,
135
- size,
136
- icon,
137
- iconPosition = "left",
138
- badge,
139
- fadeTabs = false,
140
- orientation,
141
- fullWidth,
142
- children,
143
- ...props
144
- }, ref) => (
145
- <TabsPrimitive.Trigger
146
- ref={ref}
147
- className={cn(
148
- tabsTriggerVariants({ variant, size, orientation, fullWidth }),
149
- fadeTabs && "data-[state=inactive]:opacity-60",
150
- className
151
- )}
152
- {...props}
153
- >
154
- {icon && iconPosition === "left" && (
155
- <span className="mr-2">{icon}</span>
156
- )}
157
- {children}
158
- {icon && iconPosition === "right" && (
159
- <span className="ml-2">{icon}</span>
160
- )}
161
- {badge && (
162
- <span className="ml-2">{badge}</span>
163
- )}
164
- </TabsPrimitive.Trigger>
165
- ));
166
-
167
- MoonUITabsTriggerPro.displayName = TabsPrimitive.Trigger.displayName;
168
-
169
- /* -------------------------------------------------------------------------------------------------
170
- * TabsContent
171
- * -----------------------------------------------------------------------------------------------*/
172
- interface MoonUITabsContentProProps
173
- extends React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content> {
174
- /** İçerik animasyonu */
175
- animated?: boolean;
176
- }
177
-
178
- const MoonUITabsContentPro = React.forwardRef<
179
- React.ElementRef<typeof TabsPrimitive.Content>,
180
- MoonUITabsContentProProps
181
- >(({ className, animated = false, ...props }, ref) => (
182
- <TabsPrimitive.Content
183
- ref={ref}
184
- className={cn(
185
- "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
186
- animated && "data-[state=active]:animate-fadeIn data-[state=inactive]:animate-fadeOut",
187
- className
188
- )}
189
- {...props}
190
- />
191
- ));
192
-
193
- MoonUITabsContentPro.displayName = TabsPrimitive.Content.displayName;
194
-
195
- export { MoonUITabsPro, MoonUITabsListPro, MoonUITabsTriggerPro, MoonUITabsContentPro };
196
-
197
- // Backward compatibility exports
198
- export { MoonUITabsPro as Tabs, MoonUITabsListPro as TabsList, MoonUITabsTriggerPro as TabsTrigger, MoonUITabsContentPro as TabsContent };
@@ -1,28 +0,0 @@
1
- "use client"
2
-
3
- import React from "react"
4
- import { cn } from "../../lib/utils"
5
-
6
- export interface MoonUITextareaProProps
7
- extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {}
8
-
9
- const MoonUITextareaPro = React.forwardRef<HTMLTextAreaElement, MoonUITextareaProProps>(
10
- ({ className, ...props }, ref) => {
11
- return (
12
- <textarea
13
- className={cn(
14
- "flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",
15
- className
16
- )}
17
- ref={ref}
18
- {...props}
19
- />
20
- )
21
- }
22
- )
23
- MoonUITextareaPro.displayName = "MoonUITextareaPro"
24
-
25
- export { MoonUITextareaPro };
26
-
27
- // Backward compatibility exports
28
- export { MoonUITextareaPro as Textarea }