@moontra/moonui-pro 2.1.0 → 2.1.2
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.
- package/dist/index.d.ts +790 -0
- package/dist/index.mjs +758 -326
- package/package.json +3 -4
- package/scripts/postinstall.js +144 -66
- package/src/components/advanced-chart/index.tsx +3 -3
- package/src/components/advanced-forms/index.tsx +4 -9
- package/src/components/animated-button/index.tsx +4 -8
- package/src/components/calendar/index.tsx +2 -28
- package/src/components/color-picker/index.tsx +2 -4
- package/src/components/dashboard/index.tsx +3 -3
- package/src/components/data-table/index.tsx +5 -8
- package/src/components/enhanced/badge.tsx +191 -0
- package/src/components/enhanced/button.tsx +7 -5
- package/src/components/enhanced/card.tsx +11 -17
- package/src/components/enhanced/dialog.tsx +26 -28
- package/src/components/enhanced/index.ts +2 -1
- package/src/components/error-boundary/index.tsx +2 -4
- package/src/components/file-upload/index.tsx +3 -5
- package/src/components/floating-action-button/index.tsx +1 -4
- package/src/components/github-stars/index.tsx +4 -6
- package/src/components/health-check/index.tsx +5 -7
- package/src/components/hover-card-3d/index.tsx +3 -6
- package/src/components/kanban/index.tsx +4 -6
- package/src/components/lazy-component/index.tsx +4 -7
- package/src/components/magnetic-button/index.tsx +3 -6
- package/src/components/memory-efficient-data/index.tsx +6 -6
- package/src/components/optimized-image/index.tsx +4 -6
- package/src/components/performance-debugger/index.tsx +8 -10
- package/src/components/performance-monitor/index.tsx +37 -18
- package/src/components/pinch-zoom/index.tsx +2 -4
- package/src/components/rich-text-editor/index-old-backup.tsx +3 -9
- package/src/components/rich-text-editor/index.tsx +75 -10
- package/src/components/rich-text-editor/slash-commands-extension.ts +1 -1
- package/src/components/spotlight-card/index.tsx +1 -4
- package/src/components/swipeable-card/index.tsx +1 -1
- package/src/components/timeline/index.tsx +2 -2
- package/src/components/ui/color-picker.tsx +1 -1
- package/src/components/ui/index.ts +2 -0
- package/src/components/ui/progress.tsx +27 -0
- package/src/components/ui/skeleton.tsx +17 -0
- package/src/components/ui/tooltip.tsx +1 -1
- package/src/components/virtual-list/index.tsx +3 -4
- package/src/hooks/use-chart.ts +2 -2
- package/src/index.ts +0 -3
- package/src/patterns/login-form/types.ts +6 -6
- package/src/use-pro-access.ts +2 -2
- package/src/utils/chart-helpers.ts +1 -1
- package/src/utils/license-guard.tsx +0 -177
- package/src/utils/package-guard.ts +0 -60
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@moontra/moonui-pro",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"description": "Premium React components for MoonUI - Advanced UI library with 50+ pro components including performance, interactive, and gesture components",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.mjs",
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
"sideEffects": [
|
|
17
17
|
"**/*.css",
|
|
18
18
|
"dist/**/*.css",
|
|
19
|
-
"src/**/*.css"
|
|
20
|
-
"src/utils/package-guard.ts"
|
|
19
|
+
"src/**/*.css"
|
|
21
20
|
],
|
|
22
21
|
"exports": {
|
|
23
22
|
".": {
|
|
@@ -68,7 +67,7 @@
|
|
|
68
67
|
"license": "Commercial",
|
|
69
68
|
"repository": {
|
|
70
69
|
"type": "git",
|
|
71
|
-
"url": "https://github.com/moontra/moonui-pro.git"
|
|
70
|
+
"url": "git+https://github.com/moontra/moonui-pro.git"
|
|
72
71
|
},
|
|
73
72
|
"homepage": "https://moonui.dev",
|
|
74
73
|
"peerDependencies": {
|
package/scripts/postinstall.js
CHANGED
|
@@ -4,6 +4,7 @@ import https from 'https';
|
|
|
4
4
|
import fs from 'fs';
|
|
5
5
|
import path from 'path';
|
|
6
6
|
import os from 'os';
|
|
7
|
+
import crypto from 'crypto';
|
|
7
8
|
import { fileURLToPath } from 'url';
|
|
8
9
|
|
|
9
10
|
const __filename = fileURLToPath(import.meta.url);
|
|
@@ -25,41 +26,97 @@ const log = (message, color = '') => {
|
|
|
25
26
|
console.log(`${color}${message}${colors.reset}`);
|
|
26
27
|
};
|
|
27
28
|
|
|
28
|
-
const
|
|
29
|
+
const getDeviceFingerprint = () => {
|
|
30
|
+
// Create a unique device fingerprint using multiple system attributes
|
|
31
|
+
const hostname = os.hostname();
|
|
32
|
+
const username = os.userInfo().username;
|
|
33
|
+
const platform = os.platform();
|
|
34
|
+
const arch = os.arch();
|
|
35
|
+
const cpus = os.cpus();
|
|
36
|
+
const cpuModel = cpus[0]?.model || 'unknown';
|
|
37
|
+
const cpuCount = cpus.length;
|
|
38
|
+
const homeDir = os.homedir();
|
|
39
|
+
|
|
40
|
+
// Combine all attributes for a unique device ID
|
|
41
|
+
const deviceString = `${hostname}|${username}|${platform}|${arch}|${cpuModel}|${cpuCount}|${homeDir}`;
|
|
42
|
+
return crypto.createHash('sha256').update(deviceString).digest('hex');
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const getAuthConfig = () => {
|
|
29
46
|
try {
|
|
30
|
-
const
|
|
47
|
+
const authPath = path.join(os.homedir(), '.moonui', 'auth.encrypted');
|
|
31
48
|
|
|
32
|
-
if (fs.existsSync(
|
|
33
|
-
|
|
34
|
-
return JSON.parse(configData);
|
|
49
|
+
if (!fs.existsSync(authPath)) {
|
|
50
|
+
return null;
|
|
35
51
|
}
|
|
36
52
|
|
|
37
|
-
|
|
53
|
+
// Read encrypted auth
|
|
54
|
+
const encryptedData = fs.readFileSync(authPath, 'utf-8');
|
|
55
|
+
const parts = encryptedData.split('.');
|
|
56
|
+
|
|
57
|
+
if (parts.length !== 3) {
|
|
58
|
+
// Encrypted format: iv.encrypted.signature
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const [ivHex, encrypted, signature] = parts;
|
|
63
|
+
const iv = Buffer.from(ivHex, 'hex');
|
|
64
|
+
|
|
65
|
+
// Get device-specific key using same fingerprint method
|
|
66
|
+
const deviceFingerprint = getDeviceFingerprint();
|
|
67
|
+
const key = crypto.createHash('sha256').update(deviceFingerprint).digest();
|
|
68
|
+
|
|
69
|
+
// Verify signature
|
|
70
|
+
const hmac = crypto.createHmac('sha256', key);
|
|
71
|
+
hmac.update(encrypted);
|
|
72
|
+
const computedSignature = hmac.digest('hex');
|
|
73
|
+
|
|
74
|
+
if (computedSignature !== signature) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
// Decrypt
|
|
79
|
+
const decipher = crypto.createDecipheriv('aes-256-cbc', key, iv);
|
|
80
|
+
let decrypted = decipher.update(encrypted, 'hex', 'utf8');
|
|
81
|
+
decrypted += decipher.final('utf8');
|
|
82
|
+
|
|
83
|
+
const cache = JSON.parse(decrypted);
|
|
84
|
+
|
|
85
|
+
// Verify device matches
|
|
86
|
+
if (cache.deviceId && cache.deviceId !== deviceFingerprint) {
|
|
87
|
+
log('❌ Device mismatch detected!', colors.red + colors.bright);
|
|
88
|
+
log(' This license is registered to a different device', colors.red);
|
|
89
|
+
log(' MoonUI Pro licenses are single-device only', colors.yellow);
|
|
90
|
+
return null;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
// Extract token from cache
|
|
94
|
+
const auth = cache.token || cache;
|
|
95
|
+
|
|
96
|
+
// Check if expired
|
|
97
|
+
if (new Date(auth.expiresAt) < new Date()) {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return auth;
|
|
38
102
|
} catch (error) {
|
|
103
|
+
// Silent fail - will show auth required message
|
|
39
104
|
return null;
|
|
40
105
|
}
|
|
41
106
|
};
|
|
42
107
|
|
|
43
|
-
const
|
|
108
|
+
const validateAuth = async (token) => {
|
|
44
109
|
return new Promise((resolve) => {
|
|
45
110
|
const API_BASE = process.env.MOONUI_API_BASE || 'moonui.dev';
|
|
46
111
|
|
|
47
|
-
const postData = JSON.stringify({
|
|
48
|
-
licenseKey,
|
|
49
|
-
packageName: '@moontra/moonui-pro',
|
|
50
|
-
version: '1.0.0',
|
|
51
|
-
userId: 'npm-install'
|
|
52
|
-
});
|
|
53
|
-
|
|
54
112
|
const options = {
|
|
55
113
|
hostname: API_BASE.replace('https://', '').replace('http://', ''),
|
|
56
114
|
port: 443,
|
|
57
|
-
path: '/api/
|
|
58
|
-
method: '
|
|
115
|
+
path: '/api/auth/validate',
|
|
116
|
+
method: 'GET',
|
|
59
117
|
headers: {
|
|
60
|
-
'
|
|
61
|
-
'
|
|
62
|
-
'User-Agent': 'moonui-pro-postinstall/1.0.0'
|
|
118
|
+
'Authorization': `Bearer ${token}`,
|
|
119
|
+
'User-Agent': 'moonui-pro-postinstall/2.0.0'
|
|
63
120
|
},
|
|
64
121
|
timeout: 10000
|
|
65
122
|
};
|
|
@@ -73,8 +130,12 @@ const validateLicense = async (licenseKey) => {
|
|
|
73
130
|
|
|
74
131
|
res.on('end', () => {
|
|
75
132
|
try {
|
|
76
|
-
|
|
77
|
-
|
|
133
|
+
if (res.statusCode === 200) {
|
|
134
|
+
const result = JSON.parse(data);
|
|
135
|
+
resolve({ valid: true, ...result });
|
|
136
|
+
} else {
|
|
137
|
+
resolve({ valid: false, error: 'INVALID_TOKEN', message: 'Authentication token is invalid' });
|
|
138
|
+
}
|
|
78
139
|
} catch (error) {
|
|
79
140
|
resolve({ valid: false, error: 'PARSE_ERROR', message: 'Invalid response from server' });
|
|
80
141
|
}
|
|
@@ -82,25 +143,24 @@ const validateLicense = async (licenseKey) => {
|
|
|
82
143
|
});
|
|
83
144
|
|
|
84
145
|
req.on('error', (error) => {
|
|
85
|
-
resolve({ valid: false, error: 'NETWORK_ERROR', message: 'Could not connect to
|
|
146
|
+
resolve({ valid: false, error: 'NETWORK_ERROR', message: 'Could not connect to auth server' });
|
|
86
147
|
});
|
|
87
148
|
|
|
88
149
|
req.on('timeout', () => {
|
|
89
|
-
resolve({ valid: false, error: 'TIMEOUT', message: '
|
|
150
|
+
resolve({ valid: false, error: 'TIMEOUT', message: 'Auth validation timeout' });
|
|
90
151
|
});
|
|
91
152
|
|
|
92
|
-
req.write(postData);
|
|
93
153
|
req.end();
|
|
94
154
|
});
|
|
95
155
|
};
|
|
96
156
|
|
|
97
|
-
const
|
|
98
|
-
// Check for
|
|
99
|
-
const
|
|
157
|
+
const checkEnvironmentAuth = () => {
|
|
158
|
+
// Check for auth token in environment variables
|
|
159
|
+
const envToken = process.env.MOONUI_AUTH_TOKEN || process.env.MOONUI_ACCESS_TOKEN;
|
|
100
160
|
|
|
101
|
-
if (
|
|
102
|
-
log('🔑 Found
|
|
103
|
-
return
|
|
161
|
+
if (envToken) {
|
|
162
|
+
log('🔑 Found auth token in environment variables', colors.blue);
|
|
163
|
+
return envToken;
|
|
104
164
|
}
|
|
105
165
|
|
|
106
166
|
return null;
|
|
@@ -117,57 +177,75 @@ const main = async () => {
|
|
|
117
177
|
if (isCI) {
|
|
118
178
|
log('🤖 CI Environment detected', colors.blue);
|
|
119
179
|
|
|
120
|
-
const
|
|
121
|
-
if (!
|
|
122
|
-
log('⚠️ No
|
|
123
|
-
log(' Set
|
|
124
|
-
log('
|
|
180
|
+
const envToken = checkEnvironmentAuth();
|
|
181
|
+
if (!envToken) {
|
|
182
|
+
log('⚠️ No auth token found in CI environment', colors.yellow);
|
|
183
|
+
log(' Set MOONUI_AUTH_TOKEN environment variable for CI builds', colors.gray);
|
|
184
|
+
log(' Get your token by running: moonui whoami --token', colors.gray);
|
|
125
185
|
return;
|
|
126
186
|
}
|
|
127
187
|
|
|
128
|
-
// Validate CI
|
|
129
|
-
log('🔍 Validating CI
|
|
130
|
-
const validation = await
|
|
188
|
+
// Validate CI auth
|
|
189
|
+
log('🔍 Validating CI authentication...', colors.blue);
|
|
190
|
+
const validation = await validateAuth(envToken);
|
|
131
191
|
|
|
132
192
|
if (validation.valid) {
|
|
133
|
-
log('✅ CI
|
|
134
|
-
log(` Plan: ${validation.
|
|
193
|
+
log('✅ CI Authentication successful!', colors.green);
|
|
194
|
+
log(` Plan: ${validation.user?.plan || 'N/A'}`, colors.blue);
|
|
135
195
|
return;
|
|
136
196
|
} else {
|
|
137
|
-
log('❌ CI
|
|
197
|
+
log('❌ CI Authentication failed!', colors.red);
|
|
138
198
|
log(` Error: ${validation.message}`, colors.red);
|
|
139
199
|
process.exit(1);
|
|
140
200
|
}
|
|
141
201
|
}
|
|
142
202
|
|
|
143
|
-
// Regular installation - check for existing
|
|
144
|
-
const
|
|
203
|
+
// Regular installation - check for existing auth
|
|
204
|
+
const authConfig = getAuthConfig();
|
|
145
205
|
|
|
146
|
-
if (!
|
|
147
|
-
log('🔐 MoonUI Pro
|
|
206
|
+
if (!authConfig || !authConfig.accessToken) {
|
|
207
|
+
log('🔐 MoonUI Pro Authentication Required', colors.yellow + colors.bright);
|
|
148
208
|
log('', '');
|
|
149
|
-
log('This package requires a
|
|
209
|
+
log('This package requires authentication with a MoonUI Pro account.', colors.yellow);
|
|
150
210
|
log('', '');
|
|
151
211
|
log('📋 Next Steps:', colors.blue + colors.bright);
|
|
152
|
-
log(' 1.
|
|
153
|
-
log(' 2.
|
|
154
|
-
log(' 3. Or set environment variable:
|
|
212
|
+
log(' 1. Install MoonUI CLI: npm install -g @moontra/moonui-cli', colors.blue);
|
|
213
|
+
log(' 2. Login to your account: moonui login', colors.blue);
|
|
214
|
+
log(' 3. Or set environment variable: MOONUI_AUTH_TOKEN=<your-token>', colors.blue);
|
|
215
|
+
log('', '');
|
|
216
|
+
log('📖 Documentation: https://moonui.dev/docs/authentication', colors.gray);
|
|
217
|
+
log('🔧 Get your account: https://moonui.dev/pricing', colors.gray);
|
|
218
|
+
log('', '');
|
|
219
|
+
process.exit(1);
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
// Check if Pro access
|
|
223
|
+
const hasPro = authConfig.user?.plan === 'pro_monthly' ||
|
|
224
|
+
authConfig.user?.plan === 'pro_annual' ||
|
|
225
|
+
authConfig.user?.plan === 'pro_lifetime' ||
|
|
226
|
+
authConfig.user?.features?.includes('pro_components');
|
|
227
|
+
|
|
228
|
+
if (!hasPro) {
|
|
229
|
+
log('❌ MoonUI Pro Access Required', colors.red + colors.bright);
|
|
230
|
+
log('', '');
|
|
231
|
+
log('Your account does not have access to Pro components.', colors.red);
|
|
232
|
+
log(`Current plan: ${authConfig.user?.plan || 'free'}`, colors.yellow);
|
|
155
233
|
log('', '');
|
|
156
|
-
log('
|
|
157
|
-
log('
|
|
234
|
+
log('📋 Upgrade your account:', colors.blue + colors.bright);
|
|
235
|
+
log(' Visit: https://moonui.dev/pricing', colors.blue);
|
|
158
236
|
log('', '');
|
|
159
|
-
|
|
237
|
+
process.exit(1);
|
|
160
238
|
}
|
|
161
239
|
|
|
162
|
-
// Validate existing
|
|
163
|
-
log('🔍 Validating
|
|
240
|
+
// Validate existing auth
|
|
241
|
+
log('🔍 Validating authentication...', colors.blue);
|
|
164
242
|
|
|
165
|
-
const validation = await
|
|
243
|
+
const validation = await validateAuth(authConfig.accessToken);
|
|
166
244
|
|
|
167
245
|
if (validation.valid) {
|
|
168
|
-
log('✅
|
|
169
|
-
log(` Plan: ${validation.
|
|
170
|
-
log(`
|
|
246
|
+
log('✅ Authentication successful!', colors.green + colors.bright);
|
|
247
|
+
log(` Plan: ${validation.user?.plan || authConfig.user?.plan}`, colors.blue);
|
|
248
|
+
log(` Account: ${authConfig.user?.email || 'N/A'}`, colors.blue);
|
|
171
249
|
|
|
172
250
|
if (validation.expiresAt) {
|
|
173
251
|
const expiryDate = new Date(validation.expiresAt);
|
|
@@ -194,27 +272,27 @@ const main = async () => {
|
|
|
194
272
|
log(' Documentation: https://moonui.dev/docs/components', colors.gray);
|
|
195
273
|
|
|
196
274
|
} else {
|
|
197
|
-
log('❌
|
|
275
|
+
log('❌ Authentication failed!', colors.red + colors.bright);
|
|
198
276
|
log(` Error: ${validation.message}`, colors.red);
|
|
199
277
|
log('', '');
|
|
200
278
|
|
|
201
|
-
if (validation.error === '
|
|
279
|
+
if (validation.error === 'INVALID_TOKEN') {
|
|
202
280
|
log('🔧 Troubleshooting:', colors.yellow + colors.bright);
|
|
203
|
-
log(' •
|
|
204
|
-
log(' •
|
|
281
|
+
log(' • Your session may have expired', colors.yellow);
|
|
282
|
+
log(' • Run: moonui login', colors.yellow);
|
|
205
283
|
log(' • Contact support: support@moonui.dev', colors.yellow);
|
|
206
284
|
} else if (validation.error === 'NETWORK_ERROR') {
|
|
207
285
|
log('🌐 Network Issue:', colors.yellow + colors.bright);
|
|
208
|
-
log(' •
|
|
286
|
+
log(' • Auth validation requires internet connection', colors.yellow);
|
|
209
287
|
log(' • Components will work offline after initial validation', colors.yellow);
|
|
210
288
|
log(' • Retry: npm install --force', colors.yellow);
|
|
211
289
|
}
|
|
212
290
|
|
|
213
291
|
log('', '');
|
|
214
|
-
log('📖
|
|
292
|
+
log('📖 Auth Guide: https://moonui.dev/docs/authentication', colors.gray);
|
|
215
293
|
|
|
216
|
-
// Don't fail installation for network issues, only for invalid
|
|
217
|
-
if (validation.error === '
|
|
294
|
+
// Don't fail installation for network issues, only for invalid auth
|
|
295
|
+
if (validation.error === 'INVALID_TOKEN') {
|
|
218
296
|
process.exit(1);
|
|
219
297
|
}
|
|
220
298
|
}
|
|
@@ -40,11 +40,11 @@ import { cn } from '@moontra/moonui'
|
|
|
40
40
|
|
|
41
41
|
export type ChartType = 'line' | 'bar' | 'area' | 'pie' | 'scatter'
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
interface ChartDataPoint {
|
|
44
44
|
[key: string]: string | number | null
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
interface ChartSeries {
|
|
48
48
|
dataKey: string
|
|
49
49
|
name: string
|
|
50
50
|
color: string
|
|
@@ -54,7 +54,7 @@ export interface ChartSeries {
|
|
|
54
54
|
hide?: boolean
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
interface AdvancedChartProps {
|
|
58
58
|
data: ChartDataPoint[]
|
|
59
59
|
type: ChartType
|
|
60
60
|
series: ChartSeries[]
|
|
@@ -16,7 +16,7 @@ import { cn } from "../../lib/utils"
|
|
|
16
16
|
import { Lock, Sparkles, CheckCircle, AlertCircle, Eye, EyeOff, Upload, X } from "lucide-react"
|
|
17
17
|
import { useSubscription } from "../../hooks/use-subscription"
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
interface AdvancedFormField {
|
|
20
20
|
name: string
|
|
21
21
|
label: string
|
|
22
22
|
type: "text" | "email" | "password" | "textarea" | "select" | "checkbox" | "switch" | "file" | "number" | "url" | "tel"
|
|
@@ -33,7 +33,7 @@ export interface AdvancedFormField {
|
|
|
33
33
|
defaultValue?: any
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
interface AdvancedFormsProps {
|
|
37
37
|
fields: AdvancedFormField[]
|
|
38
38
|
onSubmit: (data: any) => void | Promise<void>
|
|
39
39
|
title?: string
|
|
@@ -391,15 +391,10 @@ const AdvancedFormsInternal: React.FC<AdvancedFormsProps> = ({
|
|
|
391
391
|
}
|
|
392
392
|
|
|
393
393
|
export const AdvancedForms: React.FC<AdvancedFormsProps> = ({ className, ...props }) => {
|
|
394
|
-
// Check if we're in docs mode or have pro access
|
|
395
|
-
const docsProAccess = { hasAccess: true } // Pro access assumed in package
|
|
396
394
|
const { hasProAccess, isLoading } = useSubscription()
|
|
397
395
|
|
|
398
|
-
//
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
// If not in docs mode and no pro access, show upgrade prompt
|
|
402
|
-
if (!docsProAccess.isDocsMode && !isLoading && !hasProAccess) {
|
|
396
|
+
// If no pro access, show upgrade prompt
|
|
397
|
+
if (!isLoading && !hasProAccess) {
|
|
403
398
|
return (
|
|
404
399
|
<Card className={cn("w-fit", className)}>
|
|
405
400
|
<CardContent className="py-6 text-center">
|
|
@@ -34,7 +34,7 @@ const animatedButtonVariants = cva(
|
|
|
34
34
|
}
|
|
35
35
|
)
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
interface AnimatedButtonProps
|
|
38
38
|
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
39
39
|
VariantProps<typeof animatedButtonVariants> {
|
|
40
40
|
state?: "idle" | "loading" | "success" | "error"
|
|
@@ -158,15 +158,11 @@ AnimatedButtonInternal.displayName = "AnimatedButtonInternal"
|
|
|
158
158
|
|
|
159
159
|
export const AnimatedButton = React.forwardRef<HTMLButtonElement, AnimatedButtonProps>(
|
|
160
160
|
({ className, ...props }, ref) => {
|
|
161
|
-
//
|
|
162
|
-
const docsProAccess = { hasAccess: true } // Pro access assumed in package
|
|
161
|
+
// Pro package - always show component
|
|
163
162
|
const { hasProAccess, isLoading } = useSubscription()
|
|
164
163
|
|
|
165
|
-
//
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
// If not in docs mode and no pro access, show upgrade prompt
|
|
169
|
-
if (!docsProAccess.isDocsMode && !isLoading && !hasProAccess) {
|
|
164
|
+
// Show upgrade prompt if no pro access
|
|
165
|
+
if (!isLoading && !hasProAccess) {
|
|
170
166
|
return (
|
|
171
167
|
<Card className={cn("w-fit", className)}>
|
|
172
168
|
<CardContent className="py-6 text-center">
|
|
@@ -19,7 +19,6 @@ import {
|
|
|
19
19
|
} from 'lucide-react'
|
|
20
20
|
import { cn } from '../../lib/utils'
|
|
21
21
|
import { EventDialog } from './event-dialog'
|
|
22
|
-
import { withLicenseGuard } from '../../utils/license-guard'
|
|
23
22
|
|
|
24
23
|
export interface CalendarEvent {
|
|
25
24
|
id: string
|
|
@@ -34,7 +33,7 @@ export interface CalendarEvent {
|
|
|
34
33
|
type?: 'meeting' | 'task' | 'reminder' | 'event'
|
|
35
34
|
}
|
|
36
35
|
|
|
37
|
-
|
|
36
|
+
interface CalendarProps {
|
|
38
37
|
events?: CalendarEvent[]
|
|
39
38
|
onEventClick?: (event: CalendarEvent) => void
|
|
40
39
|
onEventAdd?: (eventData: Omit<CalendarEvent, 'id'> & { id?: string }) => void
|
|
@@ -529,29 +528,4 @@ export function Calendar({
|
|
|
529
528
|
)
|
|
530
529
|
}
|
|
531
530
|
|
|
532
|
-
|
|
533
|
-
const CalendarWithLicense = withLicenseGuard(Calendar, {
|
|
534
|
-
fallback: (
|
|
535
|
-
<Card className="w-full">
|
|
536
|
-
<CardHeader>
|
|
537
|
-
<CardTitle className="flex items-center gap-2">
|
|
538
|
-
<Lock className="h-5 w-5" />
|
|
539
|
-
Pro Component
|
|
540
|
-
</CardTitle>
|
|
541
|
-
<CardDescription>
|
|
542
|
-
This calendar component requires a MoonUI Pro license.
|
|
543
|
-
</CardDescription>
|
|
544
|
-
</CardHeader>
|
|
545
|
-
<CardContent className="text-center py-8">
|
|
546
|
-
<Button asChild>
|
|
547
|
-
<a href="https://moonui.dev/pricing">
|
|
548
|
-
Get Pro License
|
|
549
|
-
</a>
|
|
550
|
-
</Button>
|
|
551
|
-
</CardContent>
|
|
552
|
-
</Card>
|
|
553
|
-
)
|
|
554
|
-
});
|
|
555
|
-
|
|
556
|
-
export default CalendarWithLicense
|
|
557
|
-
export { Calendar as CalendarCore } // Export unguarded version for internal use
|
|
531
|
+
export default Calendar
|
|
@@ -12,7 +12,7 @@ import { cn } from "../../lib/utils"
|
|
|
12
12
|
import { Lock, Sparkles, Palette, Copy, Check, RotateCcw } from "lucide-react"
|
|
13
13
|
import { useSubscription } from "../../hooks/use-subscription"
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
interface ColorPickerProps {
|
|
16
16
|
value?: string
|
|
17
17
|
onChange?: (color: string) => void
|
|
18
18
|
disabled?: boolean
|
|
@@ -395,14 +395,12 @@ const ColorPickerInternal: React.FC<ColorPickerProps> = ({
|
|
|
395
395
|
|
|
396
396
|
export const ColorPicker: React.FC<ColorPickerProps> = ({ className, ...props }) => {
|
|
397
397
|
// Check if we're in docs mode or have pro access
|
|
398
|
-
const docsProAccess = { hasAccess: true } // Pro access assumed in package
|
|
399
398
|
const { hasProAccess, isLoading } = useSubscription()
|
|
400
399
|
|
|
401
400
|
// In docs mode, always show the component
|
|
402
|
-
const canShowComponent = docsProAccess.isDocsMode || hasProAccess
|
|
403
401
|
|
|
404
402
|
// If not in docs mode and no pro access, show upgrade prompt
|
|
405
|
-
if (!
|
|
403
|
+
if (!isLoading && !hasProAccess) {
|
|
406
404
|
return (
|
|
407
405
|
<Card className={cn("w-fit", className)}>
|
|
408
406
|
<CardContent className="py-6 text-center">
|
|
@@ -24,7 +24,7 @@ import {
|
|
|
24
24
|
} from 'lucide-react'
|
|
25
25
|
import { cn } from '@moontra/moonui'
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
interface DashboardMetric {
|
|
28
28
|
id: string
|
|
29
29
|
title: string
|
|
30
30
|
value: string | number
|
|
@@ -39,7 +39,7 @@ export interface DashboardMetric {
|
|
|
39
39
|
trend?: number[]
|
|
40
40
|
}
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
interface DashboardWidget {
|
|
43
43
|
id: string
|
|
44
44
|
title: string
|
|
45
45
|
description?: string
|
|
@@ -49,7 +49,7 @@ export interface DashboardWidget {
|
|
|
49
49
|
error?: string
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
interface DashboardProps {
|
|
53
53
|
metrics?: DashboardMetric[]
|
|
54
54
|
widgets?: DashboardWidget[]
|
|
55
55
|
onMetricClick?: (metric: DashboardMetric) => void
|
|
@@ -13,9 +13,9 @@ import {
|
|
|
13
13
|
ColumnFiltersState,
|
|
14
14
|
VisibilityState,
|
|
15
15
|
} from '@tanstack/react-table'
|
|
16
|
-
import { Button } from '
|
|
17
|
-
import { Input } from '
|
|
18
|
-
import { Card, CardContent } from '
|
|
16
|
+
import { Button } from '../ui/button'
|
|
17
|
+
import { Input } from '../ui/input'
|
|
18
|
+
import { Card, CardContent } from '../ui/card'
|
|
19
19
|
import {
|
|
20
20
|
ChevronLeft,
|
|
21
21
|
ChevronRight,
|
|
@@ -32,10 +32,9 @@ import {
|
|
|
32
32
|
Sparkles
|
|
33
33
|
} from 'lucide-react'
|
|
34
34
|
import { cn } from '../../lib/utils'
|
|
35
|
-
import { useDocsProAccess } from '@/components/docs/docs-pro-provider'
|
|
36
35
|
import { useSubscription } from '../../hooks/use-subscription'
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
interface DataTableProps<TData, TValue> {
|
|
39
38
|
columns: ColumnDef<TData, TValue>[]
|
|
40
39
|
data: TData[]
|
|
41
40
|
searchable?: boolean
|
|
@@ -95,14 +94,12 @@ export function DataTable<TData, TValue>({
|
|
|
95
94
|
texts = {},
|
|
96
95
|
}: DataTableProps<TData, TValue>) {
|
|
97
96
|
// Check if we're in docs mode or have pro access
|
|
98
|
-
const docsProAccess = useDocsProAccess()
|
|
99
97
|
const { hasProAccess, isLoading } = useSubscription()
|
|
100
98
|
|
|
101
99
|
// In docs mode, always show the component
|
|
102
|
-
const canShowComponent = docsProAccess.isDocsMode || hasProAccess
|
|
103
100
|
|
|
104
101
|
// If not in docs mode and no pro access, show upgrade prompt
|
|
105
|
-
if (!
|
|
102
|
+
if (!isLoading && !hasProAccess) {
|
|
106
103
|
return (
|
|
107
104
|
<Card className={cn("w-full", className)}>
|
|
108
105
|
<CardContent className="py-12 text-center">
|