@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,153 +0,0 @@
1
- import * as React from "react";
2
- import * as AvatarPrimitive from "@radix-ui/react-avatar";
3
- import { cva, type VariantProps } from "class-variance-authority";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- const moonUIAvatarVariantsPro = cva(
8
- "relative flex shrink-0 overflow-hidden",
9
- {
10
- variants: {
11
- size: {
12
- default: "h-10 w-10",
13
- xs: "h-6 w-6",
14
- sm: "h-8 w-8",
15
- md: "h-10 w-10",
16
- lg: "h-12 w-12",
17
- xl: "h-16 w-16",
18
- "2xl": "h-20 w-20",
19
- },
20
- radius: {
21
- default: "rounded-full",
22
- sm: "rounded-md",
23
- lg: "rounded-xl",
24
- full: "rounded-full",
25
- none: "rounded-none",
26
- },
27
- variant: {
28
- default: "",
29
- ring: "ring-2 ring-gray-300 dark:ring-gray-600",
30
- ringOffset: "ring-2 ring-gray-300 dark:ring-gray-600 ring-offset-2 ring-offset-background dark:ring-offset-gray-950",
31
- border: "border-2 border-gray-200 dark:border-gray-800"
32
- }
33
- },
34
- defaultVariants: {
35
- size: "default",
36
- radius: "default",
37
- variant: "default"
38
- },
39
- }
40
- );
41
-
42
- export interface MoonUIAvatarProProps
43
- extends React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>,
44
- VariantProps<typeof moonUIAvatarVariantsPro> {}
45
-
46
- const MoonUIAvatarPro = React.forwardRef<
47
- React.ElementRef<typeof AvatarPrimitive.Root>,
48
- MoonUIAvatarProProps
49
- >(({ className, size, radius, variant, ...props }, ref) => (
50
- <AvatarPrimitive.Root
51
- ref={ref}
52
- className={cn(moonUIAvatarVariantsPro({ size, radius, variant }), className)}
53
- {...props}
54
- />
55
- ));
56
- MoonUIAvatarPro.displayName = AvatarPrimitive.Root.displayName;
57
-
58
- const MoonUIAvatarImagePro = React.forwardRef<
59
- React.ElementRef<typeof AvatarPrimitive.Image>,
60
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Image>
61
- >(({ className, ...props }, ref) => (
62
- <AvatarPrimitive.Image
63
- ref={ref}
64
- className={cn("aspect-square h-full w-full", className)}
65
- {...props}
66
- />
67
- ));
68
- MoonUIAvatarImagePro.displayName = AvatarPrimitive.Image.displayName;
69
-
70
- const MoonUIAvatarFallbackPro = React.forwardRef<
71
- React.ElementRef<typeof AvatarPrimitive.Fallback>,
72
- React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
73
- >(({ className, ...props }, ref) => (
74
- <AvatarPrimitive.Fallback
75
- ref={ref}
76
- className={cn(
77
- "flex h-full w-full items-center justify-center bg-muted",
78
- className
79
- )}
80
- {...props}
81
- />
82
- ));
83
- MoonUIAvatarFallbackPro.displayName = AvatarPrimitive.Fallback.displayName;
84
-
85
- // Avatar Group Component for displaying multiple avatars
86
- interface MoonUIAvatarGroupProProps extends React.HTMLAttributes<HTMLDivElement> {
87
- max?: number;
88
- size?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl";
89
- children?: React.ReactNode;
90
- overlapOffset?: number;
91
- }
92
-
93
- const MoonUIAvatarGroupPro = React.forwardRef<HTMLDivElement, MoonUIAvatarGroupProProps>(
94
- ({ className, max = 3, size = "md", children, overlapOffset, ...props }, ref) => {
95
- const childrenArray = React.Children.toArray(children);
96
- const visibleChildren = max ? childrenArray.slice(0, max) : childrenArray;
97
- const remainingCount = max ? Math.max(0, childrenArray.length - max) : 0;
98
-
99
- // Calculate overlap offset based on size
100
- const defaultOffsets = {
101
- xs: -4,
102
- sm: -6,
103
- md: -8,
104
- lg: -10,
105
- xl: -12,
106
- "2xl": -16,
107
- };
108
- const finalOffset = overlapOffset ?? defaultOffsets[size as keyof typeof defaultOffsets] ?? -8;
109
-
110
- return (
111
- <div
112
- ref={ref}
113
- className={cn("flex items-center", className)}
114
- {...props}
115
- >
116
- <div className="flex">
117
- {visibleChildren.map((child, index) => (
118
- <div
119
- key={index}
120
- className="relative ring-2 ring-background rounded-full"
121
- style={{
122
- marginLeft: index === 0 ? 0 : `${finalOffset}px`,
123
- zIndex: visibleChildren.length - index
124
- }}
125
- >
126
- {React.isValidElement(child) && child.type === MoonUIAvatarPro
127
- ? React.cloneElement(child as React.ReactElement<any>, { size })
128
- : child}
129
- </div>
130
- ))}
131
- {remainingCount > 0 && (
132
- <div
133
- className="relative z-0 ring-2 ring-background rounded-full"
134
- style={{ marginLeft: `${finalOffset}px` }}
135
- >
136
- <MoonUIAvatarPro size={size} className="bg-muted">
137
- <MoonUIAvatarFallbackPro className="text-xs font-medium">
138
- +{remainingCount}
139
- </MoonUIAvatarFallbackPro>
140
- </MoonUIAvatarPro>
141
- </div>
142
- )}
143
- </div>
144
- </div>
145
- );
146
- }
147
- );
148
- MoonUIAvatarGroupPro.displayName = "MoonUIAvatarGroupPro";
149
-
150
- export { MoonUIAvatarPro, MoonUIAvatarImagePro, MoonUIAvatarFallbackPro, MoonUIAvatarGroupPro };
151
-
152
- // Backward compatibility exports
153
- export { MoonUIAvatarPro as Avatar, MoonUIAvatarImagePro as AvatarImage, MoonUIAvatarFallbackPro as AvatarFallback, MoonUIAvatarGroupPro as AvatarGroup };
@@ -1,228 +0,0 @@
1
- import * as React from "react";
2
- import { cva, type VariantProps } from "class-variance-authority";
3
- import { cn } from "../../lib/utils";
4
-
5
- /**
6
- * Premium Badge Component
7
- *
8
- * Durum, kategori ve etiketleme için yüksek kaliteli badge bileşeni.
9
- * Dark ve light modda uyumlu, erişilebilir ve çeşitli varyantlar sunar.
10
- */
11
-
12
- const moonUIBadgeVariantsPro = cva(
13
- ["inline-flex items-center gap-1.5",
14
- "font-medium transition-colors duration-200",
15
- "border focus:outline-none",
16
- "focus-visible:ring-2 focus-visible:ring-offset-1"],
17
- {
18
- variants: {
19
- variant: {
20
- primary: [
21
- "border-transparent bg-primary text-primary-foreground",
22
- "hover:bg-primary-hover dark:hover:bg-primary/90",
23
- "focus-visible:ring-primary/30 dark:focus-visible:ring-primary/40",
24
- "dark:bg-primary/90 dark:text-white dark:shadow-inner dark:shadow-primary/10",
25
- ],
26
- secondary: [
27
- "border-transparent bg-secondary text-secondary-foreground",
28
- "hover:bg-gray-200 dark:hover:bg-gray-700/90",
29
- "focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40",
30
- "dark:bg-gray-800 dark:text-gray-100 dark:shadow-inner dark:shadow-gray-950/10",
31
- ],
32
- outline: [
33
- "border-gray-200 dark:border-gray-700",
34
- "bg-transparent text-foreground",
35
- "hover:border-gray-300 dark:hover:border-gray-600",
36
- "focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40",
37
- "dark:text-gray-200 dark:bg-transparent dark:backdrop-blur-sm",
38
- ],
39
- destructive: [
40
- "border-transparent bg-error text-white",
41
- "hover:bg-error/90 dark:hover:bg-error/80",
42
- "focus-visible:ring-error/30 dark:focus-visible:ring-error/25",
43
- "dark:bg-error/90 dark:text-white dark:shadow-inner dark:shadow-error/10",
44
- ],
45
- success: [
46
- "border-transparent bg-success text-white",
47
- "hover:bg-success/90 dark:hover:bg-success/80",
48
- "focus-visible:ring-success/30 dark:focus-visible:ring-success/25",
49
- "dark:bg-success/90 dark:text-white dark:shadow-inner dark:shadow-success/10",
50
- ],
51
- warning: [
52
- "border-transparent bg-warning text-white",
53
- "hover:bg-warning/90 dark:hover:bg-warning/80",
54
- "focus-visible:ring-warning/30 dark:focus-visible:ring-warning/25",
55
- "dark:bg-warning/90 dark:text-gray-900 dark:shadow-inner dark:shadow-warning/10",
56
- ],
57
- ghost: [
58
- "border-transparent bg-transparent text-foreground",
59
- "hover:bg-gray-100 dark:hover:bg-gray-800/80",
60
- "focus-visible:ring-gray-400/30 dark:focus-visible:ring-gray-500/40",
61
- "dark:text-gray-200 dark:backdrop-blur-sm",
62
- "transition-colors duration-200",
63
- ],
64
- pro: [
65
- "border-transparent bg-gradient-to-r from-purple-600 to-pink-600 text-white",
66
- "hover:from-purple-700 hover:to-pink-700",
67
- "focus-visible:ring-purple-400/30 dark:focus-visible:ring-purple-500/40",
68
- "shadow-md dark:shadow-lg dark:shadow-purple-500/10",
69
- ],
70
- admin: [
71
- "border-transparent bg-gradient-to-r from-purple-600 to-pink-600 text-white",
72
- "hover:from-purple-700 hover:to-pink-700",
73
- "focus-visible:ring-purple-400/30 dark:focus-visible:ring-purple-500/40",
74
- "shadow-md dark:shadow-lg dark:shadow-purple-500/10",
75
- ],
76
- },
77
- size: {
78
- sm: "h-5 px-2 text-xs",
79
- md: "h-6 px-3 text-sm",
80
- lg: "h-8 px-4 text-base",
81
- },
82
- radius: {
83
- default: "rounded-full",
84
- sm: "rounded-md",
85
- lg: "rounded-xl",
86
- none: "rounded-none",
87
- }
88
- },
89
- defaultVariants: {
90
- variant: "primary",
91
- size: "md",
92
- radius: "default",
93
- },
94
- }
95
- );
96
-
97
- export interface MoonUIBadgeProProps
98
- extends React.HTMLAttributes<HTMLDivElement>,
99
- Omit<VariantProps<typeof moonUIBadgeVariantsPro>, 'variant'> {
100
- withDot?: boolean;
101
- dotColor?: string;
102
- removable?: boolean;
103
- onRemove?: () => void;
104
- leftIcon?: React.ReactNode;
105
- rightIcon?: React.ReactNode;
106
- variant?: 'primary' | 'secondary' | 'destructive' | 'outline' | 'success' | 'warning' | 'ghost' | 'pro' | 'admin';
107
- }
108
-
109
- /**
110
- * Premium Badge Component
111
- *
112
- * @param props - Badge bileşeni özellikleri
113
- * @param props.variant - Badgenin görsel varyantı
114
- * @param props.size - Badge boyutu
115
- * @param props.radius - Köşe yuvarlama stili
116
- * @param props.withDot - Başında nokta gösterimi
117
- * @param props.dotColor - Noktanın rengi (özel)
118
- * @param props.removable - Kaldırılabilir badge (X simgesi ile)
119
- * @param props.onRemove - Kaldırma işlevi
120
- * @param props.leftIcon - Badge'in solunda görüntülenecek ikon
121
- * @param props.rightIcon - Badge'in sağında görüntülenecek ikon
122
- */
123
- function MoonUIBadgePro({
124
- className,
125
- variant,
126
- size,
127
- radius,
128
- withDot,
129
- dotColor,
130
- removable,
131
- onRemove,
132
- leftIcon,
133
- rightIcon,
134
- children,
135
- ...props
136
- }: MoonUIBadgeProProps) {
137
- // Auto-assign icons and content for special variants
138
- let autoLeftIcon = leftIcon;
139
- let autoChildren = children;
140
-
141
- if (variant === 'pro') {
142
- // Auto Sparkles icon for pro
143
- autoLeftIcon = leftIcon || (
144
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" className="w-3 h-3">
145
- <path d="M12 0L13.09 8.26L22 9L13.09 9.74L12 18L10.91 9.74L2 9L10.91 8.26L12 0Z" fill="currentColor"/>
146
- <path d="M19 5L19.5 7L21 7.5L19.5 8L19 10L18.5 8L17 7.5L18.5 7L19 5Z" fill="currentColor"/>
147
- <path d="M19 15L19.5 17L21 17.5L19.5 18L19 20L18.5 18L17 17.5L18.5 17L19 15Z" fill="currentColor"/>
148
- </svg>
149
- );
150
- autoChildren = children || 'Pro';
151
- }
152
-
153
- if (variant === 'admin') {
154
- // Auto CheckCircle icon for admin
155
- autoLeftIcon = leftIcon || (
156
- <svg width="12" height="12" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" className="w-3 h-3">
157
- <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z" fill="currentColor"/>
158
- </svg>
159
- );
160
- autoChildren = children || 'Admin Pro';
161
- }
162
-
163
- return (
164
- <div
165
- className={cn(moonUIBadgeVariantsPro({ variant, size, radius }), className)}
166
- data-removable={removable ? "" : undefined}
167
- {...props}
168
- >
169
- {withDot && (
170
- <span
171
- className={cn(
172
- "h-2 w-2 rounded-full",
173
- dotColor ||
174
- (variant === "destructive" ? "bg-white" :
175
- variant === "success" ? "bg-white" :
176
- variant === "warning" ? "bg-white" :
177
- variant === "secondary" ? "bg-secondary-foreground" :
178
- variant === "outline" ? "bg-foreground" :
179
- variant === "ghost" ? "bg-foreground" :
180
- variant === "pro" ? "bg-white" :
181
- variant === "admin" ? "bg-white" :
182
- "bg-primary-foreground")
183
- )}
184
- aria-hidden="true"
185
- />
186
- )}
187
- {autoLeftIcon && (
188
- <span className="inline-flex shrink-0">
189
- {autoLeftIcon}
190
- </span>
191
- )}
192
- <span className="truncate">{autoChildren}</span>
193
- {rightIcon && (
194
- <span className="inline-flex shrink-0">
195
- {rightIcon}
196
- </span>
197
- )}
198
- {removable && onRemove && (
199
- <button
200
- type="button"
201
- className="ml-1 -mr-1 h-3.5 w-3.5 rounded-full inline-flex items-center justify-center hover:bg-black/10 dark:hover:bg-white/10"
202
- onClick={(e) => {
203
- e.stopPropagation();
204
- onRemove();
205
- }}
206
- aria-label="Remove badge"
207
- >
208
- <svg
209
- width="8"
210
- height="8"
211
- viewBox="0 0 8 8"
212
- fill="none"
213
- xmlns="http://www.w3.org/2000/svg"
214
- className="opacity-70"
215
- aria-hidden="true"
216
- >
217
- <path d="M0.799988 7.19999L7.19999 0.799988M0.799988 0.799988L7.19999 7.19999" stroke="currentColor" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"/>
218
- </svg>
219
- </button>
220
- )}
221
- </div>
222
- );
223
- }
224
-
225
- export { MoonUIBadgePro, moonUIBadgeVariantsPro };
226
-
227
- // Backward compatibility exports
228
- export { MoonUIBadgePro as Badge, moonUIBadgeVariantsPro as badgeVariants };
@@ -1,214 +0,0 @@
1
- import * as React from "react";
2
- import { ChevronRight, MoreHorizontal } from "lucide-react";
3
- import { cva, type VariantProps } from "class-variance-authority";
4
-
5
- import { cn } from "../../lib/utils";
6
-
7
- const MoonUIbreadcrumbVariantsPro = cva(
8
- "flex items-center gap-1.5 text-sm",
9
- {
10
- variants: {
11
- variant: {
12
- default: "dark:text-gray-100 transition-colors",
13
- muted: "text-muted-foreground dark:text-gray-400 transition-colors",
14
- ghost: "text-foreground/60 dark:text-gray-300/60 transition-colors",
15
- },
16
- size: {
17
- default: "text-sm",
18
- sm: "text-xs",
19
- lg: "text-base",
20
- },
21
- },
22
- defaultVariants: {
23
- variant: "default",
24
- size: "default",
25
- },
26
- }
27
- );
28
-
29
- interface BreadcrumbProps
30
- extends React.HTMLAttributes<HTMLElement>,
31
- VariantProps<typeof MoonUIbreadcrumbVariantsPro> {
32
- separator?: React.ReactNode;
33
- showHomeIcon?: boolean;
34
- }
35
-
36
- interface BreadcrumbListProps extends React.HTMLAttributes<HTMLOListElement> {
37
- collapsed?: boolean;
38
- collapsedWidth?: number;
39
- }
40
-
41
- interface BreadcrumbItemProps extends React.HTMLAttributes<HTMLLIElement> {
42
- isCurrent?: boolean;
43
- href?: string;
44
- asChild?: boolean;
45
- }
46
-
47
- interface BreadcrumbSeparatorProps extends React.HTMLAttributes<HTMLSpanElement> {
48
- /** Custom separator icon or text */
49
- icon?: React.ReactNode;
50
- }
51
-
52
- interface BreadcrumbEllipsisProps extends React.HTMLAttributes<HTMLSpanElement> {
53
- /** Custom ellipsis icon */
54
- icon?: React.ReactNode;
55
- }
56
-
57
- const MoonUIBreadcrumbPro = React.forwardRef<HTMLElement, BreadcrumbProps>(
58
- ({ className, variant, size, ...props }, ref) => (
59
- <nav
60
- ref={ref}
61
- className={cn(MoonUIbreadcrumbVariantsPro({ variant, size }), className)}
62
- aria-label="breadcrumb"
63
- {...props}
64
- />
65
- )
66
- );
67
- MoonUIBreadcrumbPro.displayName = "BreadcrumbPro";
68
-
69
- const MoonUIBreadcrumbListPro = React.forwardRef<HTMLOListElement, BreadcrumbListProps>(
70
- ({ className, collapsed, collapsedWidth = 3, ...props }, ref) => {
71
- const MoonUIchildrenArrayPro = React.Children.toArray(props.children).filter(Boolean);
72
- const MoonUIchildCountPro = MoonUIchildrenArrayPro.length;
73
-
74
- if (collapsed && MoonUIchildCountPro > collapsedWidth) {
75
- const MoonUIfirstItemPro = MoonUIchildrenArrayPro[0];
76
- // const MoonUImiddleItemsPro = childrenArray.slice(1, -2); // Uncomment when needed
77
- const MoonUIlastTwoItemsPro = MoonUIchildrenArrayPro.slice(-2);
78
-
79
- return (
80
- <ol
81
- ref={ref}
82
- className={cn(
83
- "flex flex-wrap items-center gap-1.5 sm:gap-2.5",
84
- className
85
- )}
86
- {...props}
87
- >
88
- {MoonUIfirstItemPro}
89
- <MoonUIBreadcrumbEllipsisPro />
90
- {MoonUIlastTwoItemsPro}
91
- </ol>
92
- );
93
- }
94
-
95
- return (
96
- <ol
97
- ref={ref}
98
- className={cn(
99
- "flex flex-wrap items-center gap-1.5 sm:gap-2.5",
100
- className
101
- )}
102
- {...props}
103
- />
104
- );
105
- }
106
- );
107
- MoonUIBreadcrumbListPro.displayName = "BreadcrumbListPro";
108
-
109
- const MoonUIBreadcrumbItemPro = React.forwardRef<HTMLLIElement, BreadcrumbItemProps>(
110
- ({ className, isCurrent, href, asChild = false, ...props }, ref) => {
111
- const MoonUICompPro = asChild ? React.Fragment : href ? "a" : "span";
112
- const MoonUIitemPropsPro = asChild ? {} : href ? { href } : {};
113
-
114
- return (
115
- <li
116
- ref={ref}
117
- className={cn("inline-flex items-center gap-1.5", className)}
118
- aria-current={isCurrent ? "page" : undefined}
119
- {...props}
120
- >
121
- <MoonUICompPro
122
- className={cn(
123
- "transition-colors duration-200 hover:text-foreground",
124
- isCurrent
125
- ? "font-medium text-foreground dark:text-white dark:text-opacity-95"
126
- : "text-muted-foreground hover:text-foreground dark:text-gray-400 dark:hover:text-gray-200 dark:hover:text-opacity-95 hover:underline hover:underline-offset-4 hover:decoration-gray-300/30"
127
- )}
128
- {...MoonUIitemPropsPro}
129
- >
130
- {props.children}
131
- </MoonUICompPro>
132
- </li>
133
- );
134
- }
135
- );
136
- MoonUIBreadcrumbItemPro.displayName = "BreadcrumbItemPro";
137
-
138
- const MoonUIBreadcrumbSeparatorPro = ({
139
- children,
140
- className,
141
- ...props
142
- }: BreadcrumbSeparatorProps) => (
143
- <span
144
- role="presentation"
145
- aria-hidden="true"
146
- className={cn("text-muted-foreground dark:text-gray-500 opacity-70", className)}
147
- {...props}
148
- >
149
- {children || <ChevronRight className="h-3.5 w-3.5" />}
150
- </span>
151
- );
152
- MoonUIBreadcrumbSeparatorPro.displayName = "BreadcrumbSeparatorPro";
153
-
154
- const MoonUIBreadcrumbEllipsisPro = ({
155
- className,
156
- ...props
157
- }: BreadcrumbEllipsisProps) => (
158
- <span
159
- role="presentation"
160
- aria-hidden="true"
161
- className={cn("flex items-center text-muted-foreground dark:text-gray-500 dark:hover:text-gray-400 transition-colors duration-200", className)}
162
- {...props}
163
- >
164
- <MoreHorizontal className="h-4 w-4" />
165
- <span className="sr-only">More pages</span>
166
- </span>
167
- );
168
- MoonUIBreadcrumbEllipsisPro.displayName = "BreadcrumbEllipsisPro";
169
-
170
- const MoonUIBreadcrumbLinkPro = React.forwardRef<HTMLAnchorElement, React.AnchorHTMLAttributes<HTMLAnchorElement>>(
171
- ({ className, href, ...props }, ref) => (
172
- <a
173
- ref={ref}
174
- href={href}
175
- className={cn(
176
- "transition-colors duration-200 hover:text-foreground text-muted-foreground hover:underline hover:underline-offset-4 hover:decoration-gray-300/30 dark:text-gray-400 dark:hover:text-gray-200",
177
- className
178
- )}
179
- {...props}
180
- />
181
- )
182
- );
183
- MoonUIBreadcrumbLinkPro.displayName = "BreadcrumbLinkPro";
184
-
185
- const MoonUIBreadcrumbPagePro = React.forwardRef<HTMLSpanElement, React.HTMLAttributes<HTMLSpanElement>>(
186
- ({ className, ...props }, ref) => (
187
- <span
188
- ref={ref}
189
- className={cn(
190
- "font-medium text-foreground dark:text-white dark:text-opacity-95",
191
- className
192
- )}
193
- {...props}
194
- />
195
- )
196
- );
197
- MoonUIBreadcrumbPagePro.displayName = "BreadcrumbPagePro";
198
-
199
-
200
- // Internal aliases for Pro component usage
201
- export const breadcrumbVariantsInternal = MoonUIbreadcrumbVariantsPro
202
- export const BreadcrumbInternal = MoonUIBreadcrumbPro
203
- export const BreadcrumbListInternal = MoonUIBreadcrumbListPro
204
- export const BreadcrumbItemInternal = MoonUIBreadcrumbItemPro
205
- export const BreadcrumbSeparatorInternal = MoonUIBreadcrumbSeparatorPro
206
- export const BreadcrumbEllipsisInternal = MoonUIBreadcrumbEllipsisPro
207
- export const BreadcrumbLinkInternal = MoonUIBreadcrumbLinkPro
208
- export const BreadcrumbPageInternal = MoonUIBreadcrumbPagePro
209
-
210
- // Pro exports
211
- export { MoonUIbreadcrumbVariantsPro, MoonUIBreadcrumbPro, MoonUIBreadcrumbListPro, MoonUIBreadcrumbItemPro, MoonUIBreadcrumbSeparatorPro, MoonUIBreadcrumbEllipsisPro, MoonUIBreadcrumbLinkPro, MoonUIBreadcrumbPagePro }
212
-
213
- // Clean exports (without MoonUI prefix for easier usage)
214
- export { MoonUIbreadcrumbVariantsPro as breadcrumbVariants, MoonUIBreadcrumbPro as Breadcrumb, MoonUIBreadcrumbListPro as BreadcrumbList, MoonUIBreadcrumbItemPro as BreadcrumbItem, MoonUIBreadcrumbSeparatorPro as BreadcrumbSeparator, MoonUIBreadcrumbEllipsisPro as BreadcrumbEllipsis, MoonUIBreadcrumbLinkPro as BreadcrumbLink, MoonUIBreadcrumbPagePro as BreadcrumbPage };