@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,151 +0,0 @@
1
- export interface DataProcessor<T = any> {
2
- filter: (data: T[], predicate: (item: T) => boolean) => T[]
3
- sort: (data: T[], key: keyof T, direction?: 'asc' | 'desc') => T[]
4
- group: (data: T[], key: keyof T) => Record<string, T[]>
5
- aggregate: (data: T[], key: keyof T, operation: 'sum' | 'avg' | 'min' | 'max' | 'count') => number
6
- paginate: (data: T[], page: number, pageSize: number) => T[]
7
- search: (data: T[], query: string, searchKeys?: (keyof T)[]) => T[]
8
- transform: <U>(data: T[], transformer: (item: T) => U) => U[]
9
- }
10
-
11
- export function createDataProcessor<T = any>(): DataProcessor<T> {
12
- return {
13
- filter: (data: T[], predicate: (item: T) => boolean) => {
14
- return data.filter(predicate)
15
- },
16
-
17
- sort: (data: T[], key: keyof T, direction: 'asc' | 'desc' = 'asc') => {
18
- return [...data].sort((a, b) => {
19
- const aVal = a[key]
20
- const bVal = b[key]
21
-
22
- if (aVal === bVal) return 0
23
-
24
- const comparison = aVal < bVal ? -1 : 1
25
- return direction === 'asc' ? comparison : -comparison
26
- })
27
- },
28
-
29
- group: (data: T[], key: keyof T) => {
30
- return data.reduce((groups, item) => {
31
- const groupKey = String(item[key])
32
- if (!groups[groupKey]) {
33
- groups[groupKey] = []
34
- }
35
- groups[groupKey].push(item)
36
- return groups
37
- }, {} as Record<string, T[]>)
38
- },
39
-
40
- aggregate: (data: T[], key: keyof T, operation: 'sum' | 'avg' | 'min' | 'max' | 'count') => {
41
- const values = data.map(item => Number(item[key])).filter(val => !isNaN(val))
42
-
43
- if (values.length === 0) return 0
44
-
45
- switch (operation) {
46
- case 'sum':
47
- return values.reduce((sum, val) => sum + val, 0)
48
- case 'avg':
49
- return values.reduce((sum, val) => sum + val, 0) / values.length
50
- case 'min':
51
- return Math.min(...values)
52
- case 'max':
53
- return Math.max(...values)
54
- case 'count':
55
- return values.length
56
- default:
57
- return 0
58
- }
59
- },
60
-
61
- paginate: (data: T[], page: number, pageSize: number) => {
62
- const startIndex = (page - 1) * pageSize
63
- const endIndex = startIndex + pageSize
64
- return data.slice(startIndex, endIndex)
65
- },
66
-
67
- search: (data: T[], query: string, searchKeys?: (keyof T)[]) => {
68
- if (!query.trim()) return data
69
-
70
- const lowerQuery = query.toLowerCase()
71
-
72
- return data.filter(item => {
73
- const keysToSearch = searchKeys || Object.keys(item as Record<string, any>) as (keyof T)[]
74
-
75
- return keysToSearch.some(key => {
76
- const value = item[key]
77
- if (value == null) return false
78
- return String(value).toLowerCase().includes(lowerQuery)
79
- })
80
- })
81
- },
82
-
83
- transform: <U>(data: T[], transformer: (item: T) => U) => {
84
- return data.map(transformer)
85
- }
86
- }
87
- }
88
-
89
- // Utility functions for common data operations
90
- export function calculatePercentageChange(current: number, previous: number): number {
91
- if (previous === 0) return current > 0 ? 100 : 0
92
- return ((current - previous) / previous) * 100
93
- }
94
-
95
- export function formatNumber(value: number, options?: {
96
- decimals?: number
97
- currency?: string
98
- percentage?: boolean
99
- compact?: boolean
100
- }): string {
101
- const { decimals = 2, currency, percentage = false, compact = false } = options || {}
102
-
103
- if (percentage) {
104
- return `${value.toFixed(decimals)}%`
105
- }
106
-
107
- if (currency) {
108
- return new Intl.NumberFormat('en-US', {
109
- style: 'currency',
110
- currency,
111
- minimumFractionDigits: decimals,
112
- maximumFractionDigits: decimals,
113
- }).format(value)
114
- }
115
-
116
- if (compact && Math.abs(value) >= 1000) {
117
- return new Intl.NumberFormat('en-US', {
118
- notation: 'compact',
119
- minimumFractionDigits: 0,
120
- maximumFractionDigits: 1,
121
- }).format(value)
122
- }
123
-
124
- return value.toFixed(decimals)
125
- }
126
-
127
- export function generateDateRange(start: Date, end: Date, interval: 'day' | 'week' | 'month' = 'day'): Date[] {
128
- const dates: Date[] = []
129
- const current = new Date(start)
130
-
131
- while (current <= end) {
132
- dates.push(new Date(current))
133
-
134
- switch (interval) {
135
- case 'day':
136
- current.setDate(current.getDate() + 1)
137
- break
138
- case 'week':
139
- current.setDate(current.getDate() + 7)
140
- break
141
- case 'month':
142
- current.setMonth(current.getMonth() + 1)
143
- break
144
- }
145
- }
146
-
147
- return dates
148
- }
149
-
150
- // debounce function removed to avoid conflicts with @moontra/moonui
151
- // Use debounce from @moontra/moonui instead
@@ -1,183 +0,0 @@
1
- /**
2
- * License Validation System for MoonUI Pro
3
- * This ensures that only licensed users can access pro components
4
- */
5
-
6
- interface LicenseData {
7
- key: string;
8
- email: string;
9
- expiresAt?: string;
10
- features?: string[];
11
- }
12
-
13
- class LicenseValidator {
14
- private static instance: LicenseValidator;
15
- private licenseData: LicenseData | null = null;
16
- private validationCache: Map<string, boolean> = new Map();
17
- private readonly VALIDATION_ENDPOINT = 'https://api.moonui.dev/v1/license/validate';
18
-
19
- private constructor() {
20
- // Initialize license from environment or stored data
21
- this.initializeLicense();
22
- }
23
-
24
- static getInstance(): LicenseValidator {
25
- if (!LicenseValidator.instance) {
26
- LicenseValidator.instance = new LicenseValidator();
27
- }
28
- return LicenseValidator.instance;
29
- }
30
-
31
- private initializeLicense(): void {
32
- // Check environment variables
33
- const licenseKey = process.env.MOONUI_LICENSE_KEY;
34
- const licenseEmail = process.env.MOONUI_LICENSE_EMAIL;
35
-
36
- if (licenseKey && licenseEmail) {
37
- this.licenseData = {
38
- key: licenseKey,
39
- email: licenseEmail
40
- };
41
- }
42
-
43
- // Check for license file
44
- try {
45
- const fs = require('fs');
46
- const path = require('path');
47
- const licensePath = path.join(process.cwd(), '.moonui', 'license.json');
48
-
49
- if (fs.existsSync(licensePath)) {
50
- const fileData = fs.readFileSync(licensePath, 'utf-8');
51
- this.licenseData = JSON.parse(fileData);
52
- }
53
- } catch (error) {
54
- // Ignore file reading errors in browser environment
55
- }
56
- }
57
-
58
- async validateLicense(): Promise<boolean> {
59
- if (!this.licenseData) {
60
- console.warn('[MoonUI Pro] No license found. Please run "moonui add <pro-component>" to activate your license.');
61
- return false;
62
- }
63
-
64
- // Check cache first
65
- const cacheKey = `${this.licenseData.key}-${this.licenseData.email}`;
66
- if (this.validationCache.has(cacheKey)) {
67
- return this.validationCache.get(cacheKey)!;
68
- }
69
-
70
- // Check expiration date if available
71
- if (this.licenseData.expiresAt) {
72
- const expiryDate = new Date(this.licenseData.expiresAt);
73
- if (expiryDate < new Date()) {
74
- console.error('[MoonUI Pro] License has expired. Please renew your subscription.');
75
- this.validationCache.set(cacheKey, false);
76
- return false;
77
- }
78
- }
79
-
80
- // Validate with server (with fallback for offline mode)
81
- try {
82
- const response = await fetch(this.VALIDATION_ENDPOINT, {
83
- method: 'POST',
84
- headers: {
85
- 'Content-Type': 'application/json',
86
- },
87
- body: JSON.stringify({
88
- key: this.licenseData.key,
89
- email: this.licenseData.email,
90
- }),
91
- });
92
-
93
- if (response.ok) {
94
- const result = await response.json();
95
- const isValid = result.valid === true;
96
- this.validationCache.set(cacheKey, isValid);
97
-
98
- if (!isValid) {
99
- console.error('[MoonUI Pro] Invalid license. Please check your license key and email.');
100
- }
101
-
102
- return isValid;
103
- }
104
- } catch (error) {
105
- // Fallback for offline mode or network errors
106
- // Allow usage if license format is valid
107
- const isValidFormat = this.isValidLicenseFormat();
108
- this.validationCache.set(cacheKey, isValidFormat);
109
- return isValidFormat;
110
- }
111
-
112
- return false;
113
- }
114
-
115
- private isValidLicenseFormat(): boolean {
116
- if (!this.licenseData) return false;
117
-
118
- // Basic format validation
119
- const { key, email } = this.licenseData;
120
- return (
121
- typeof key === 'string' &&
122
- key.length >= 32 &&
123
- typeof email === 'string' &&
124
- email.includes('@')
125
- );
126
- }
127
-
128
- hasFeature(feature: string): boolean {
129
- if (!this.licenseData || !this.licenseData.features) {
130
- return false;
131
- }
132
- return this.licenseData.features.includes(feature);
133
- }
134
-
135
- getLicenseInfo(): Readonly<LicenseData> | null {
136
- return this.licenseData ? { ...this.licenseData } : null;
137
- }
138
- }
139
-
140
- // Export singleton instance
141
- export const licenseValidator = LicenseValidator.getInstance();
142
-
143
- // Higher-order component for license protection
144
- export function withLicenseProtection<P extends object>(
145
- Component: React.ComponentType<P>,
146
- componentName: string
147
- ): React.ComponentType<P> {
148
- return (props: P) => {
149
- const [isValid, setIsValid] = React.useState<boolean | null>(null);
150
-
151
- React.useEffect(() => {
152
- licenseValidator.validateLicense().then(setIsValid);
153
- }, []);
154
-
155
- if (isValid === null) {
156
- // Loading state
157
- return null;
158
- }
159
-
160
- if (!isValid) {
161
- if (process.env.NODE_ENV === 'development') {
162
- console.error(
163
- `[MoonUI Pro] Component "${componentName}" requires a valid Pro license.\n` +
164
- 'Get your license at: https://moonui.dev/pricing'
165
- );
166
- }
167
-
168
- // Return a placeholder in production
169
- return (
170
- <div className="rounded-lg border-2 border-dashed border-gray-300 p-4 text-center">
171
- <p className="text-sm text-gray-500">
172
- This component requires a MoonUI Pro license.
173
- </p>
174
- </div>
175
- );
176
- }
177
-
178
- return <Component {...props} />;
179
- };
180
- }
181
-
182
- // Export React for component usage
183
- import * as React from 'react';