@moontra/moonui-pro 2.0.23 → 2.1.1

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 (46) hide show
  1. package/dist/index.d.ts +790 -0
  2. package/dist/index.mjs +554 -121
  3. package/package.json +1 -1
  4. package/scripts/postinstall.js +144 -66
  5. package/src/components/advanced-chart/index.tsx +3 -3
  6. package/src/components/advanced-forms/index.tsx +4 -9
  7. package/src/components/animated-button/index.tsx +4 -8
  8. package/src/components/calendar/index.tsx +1 -1
  9. package/src/components/color-picker/index.tsx +2 -4
  10. package/src/components/dashboard/index.tsx +3 -3
  11. package/src/components/data-table/index.tsx +5 -8
  12. package/src/components/enhanced/badge.tsx +191 -0
  13. package/src/components/enhanced/button.tsx +7 -5
  14. package/src/components/enhanced/card.tsx +11 -17
  15. package/src/components/enhanced/dialog.tsx +26 -28
  16. package/src/components/enhanced/index.ts +2 -1
  17. package/src/components/error-boundary/index.tsx +2 -4
  18. package/src/components/file-upload/index.tsx +3 -5
  19. package/src/components/floating-action-button/index.tsx +1 -4
  20. package/src/components/github-stars/index.tsx +4 -6
  21. package/src/components/health-check/index.tsx +5 -7
  22. package/src/components/hover-card-3d/index.tsx +3 -6
  23. package/src/components/kanban/index.tsx +4 -6
  24. package/src/components/lazy-component/index.tsx +4 -7
  25. package/src/components/magnetic-button/index.tsx +3 -6
  26. package/src/components/memory-efficient-data/index.tsx +6 -6
  27. package/src/components/optimized-image/index.tsx +4 -6
  28. package/src/components/performance-debugger/index.tsx +8 -10
  29. package/src/components/performance-monitor/index.tsx +37 -18
  30. package/src/components/pinch-zoom/index.tsx +2 -4
  31. package/src/components/rich-text-editor/index-old-backup.tsx +3 -9
  32. package/src/components/rich-text-editor/index.tsx +75 -10
  33. package/src/components/rich-text-editor/slash-commands-extension.ts +1 -1
  34. package/src/components/spotlight-card/index.tsx +1 -4
  35. package/src/components/swipeable-card/index.tsx +1 -1
  36. package/src/components/timeline/index.tsx +2 -2
  37. package/src/components/ui/color-picker.tsx +1 -1
  38. package/src/components/ui/index.ts +2 -0
  39. package/src/components/ui/progress.tsx +27 -0
  40. package/src/components/ui/skeleton.tsx +17 -0
  41. package/src/components/ui/tooltip.tsx +1 -1
  42. package/src/components/virtual-list/index.tsx +3 -4
  43. package/src/hooks/use-chart.ts +2 -2
  44. package/src/patterns/login-form/types.ts +6 -6
  45. package/src/use-pro-access.ts +2 -2
  46. package/src/utils/chart-helpers.ts +1 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@moontra/moonui-pro",
3
- "version": "2.0.23",
3
+ "version": "2.1.1",
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",
@@ -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 getLicenseConfig = () => {
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 configPath = path.join(os.homedir(), '.moonui', 'license.json');
47
+ const authPath = path.join(os.homedir(), '.moonui', 'auth.encrypted');
31
48
 
32
- if (fs.existsSync(configPath)) {
33
- const configData = fs.readFileSync(configPath, 'utf-8');
34
- return JSON.parse(configData);
49
+ if (!fs.existsSync(authPath)) {
50
+ return null;
35
51
  }
36
52
 
37
- return null;
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 validateLicense = async (licenseKey) => {
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/license/validate',
58
- method: 'POST',
115
+ path: '/api/auth/validate',
116
+ method: 'GET',
59
117
  headers: {
60
- 'Content-Type': 'application/json',
61
- 'Content-Length': Buffer.byteLength(postData),
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
- const result = JSON.parse(data);
77
- resolve(result);
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 license server' });
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: 'License validation timeout' });
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 checkEnvironmentLicense = () => {
98
- // Check for license in environment variables
99
- const envLicense = process.env.MOONUI_PRO_LICENSE || process.env.MOONUI_LICENSE_KEY;
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 (envLicense) {
102
- log('🔑 Found license in environment variables', colors.blue);
103
- return envLicense;
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 envLicense = checkEnvironmentLicense();
121
- if (!envLicense) {
122
- log('⚠️ No license found in CI environment', colors.yellow);
123
- log(' Set MOONUI_PRO_LICENSE environment variable for CI builds', colors.gray);
124
- log(' Example: MOONUI_PRO_LICENSE=moonui_your_license_key_here', colors.gray);
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 license
129
- log('🔍 Validating CI license...', colors.blue);
130
- const validation = await validateLicense(envLicense);
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 License validation successful!', colors.green);
134
- log(` Plan: ${validation.planType}`, colors.blue);
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 License validation failed!', colors.red);
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 license
144
- const licenseConfig = getLicenseConfig();
203
+ // Regular installation - check for existing auth
204
+ const authConfig = getAuthConfig();
145
205
 
146
- if (!licenseConfig || !licenseConfig.licenseKey) {
147
- log('🔐 MoonUI Pro License Required', colors.yellow + colors.bright);
206
+ if (!authConfig || !authConfig.accessToken) {
207
+ log('🔐 MoonUI Pro Authentication Required', colors.yellow + colors.bright);
148
208
  log('', '');
149
- log('This package requires a valid MoonUI Pro license.', colors.yellow);
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. Get a license: https://moonui.dev/pricing', colors.blue);
153
- log(' 2. Configure license: moonui license set <your-license-key>', colors.blue);
154
- log(' 3. Or set environment variable: MOONUI_PRO_LICENSE=<your-key>', colors.blue);
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('📖 Documentation: https://moonui.dev/docs/license', colors.gray);
157
- log('🔧 CLI Help: moonui license --help', colors.gray);
234
+ log('📋 Upgrade your account:', colors.blue + colors.bright);
235
+ log(' Visit: https://moonui.dev/pricing', colors.blue);
158
236
  log('', '');
159
- return;
237
+ process.exit(1);
160
238
  }
161
239
 
162
- // Validate existing license
163
- log('🔍 Validating license...', colors.blue);
240
+ // Validate existing auth
241
+ log('🔍 Validating authentication...', colors.blue);
164
242
 
165
- const validation = await validateLicense(licenseConfig.licenseKey);
243
+ const validation = await validateAuth(authConfig.accessToken);
166
244
 
167
245
  if (validation.valid) {
168
- log('✅ License validation successful!', colors.green + colors.bright);
169
- log(` Plan: ${validation.planType}`, colors.blue);
170
- log(` Licensed to: ${licenseConfig.email || 'N/A'}`, colors.blue);
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('❌ License validation failed!', colors.red + colors.bright);
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 === 'INVALID_LICENSE') {
279
+ if (validation.error === 'INVALID_TOKEN') {
202
280
  log('🔧 Troubleshooting:', colors.yellow + colors.bright);
203
- log(' • Check your license key is correct', colors.yellow);
204
- log(' • Ensure your subscription is active', colors.yellow);
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(' • License validation requires internet connection', colors.yellow);
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('📖 License Guide: https://moonui.dev/docs/license', colors.gray);
292
+ log('📖 Auth Guide: https://moonui.dev/docs/authentication', colors.gray);
215
293
 
216
- // Don't fail installation for network issues, only for invalid licenses
217
- if (validation.error === 'INVALID_LICENSE') {
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
- export interface ChartDataPoint {
43
+ interface ChartDataPoint {
44
44
  [key: string]: string | number | null
45
45
  }
46
46
 
47
- export interface ChartSeries {
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
- export interface AdvancedChartProps {
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
- export interface AdvancedFormField {
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
- export interface AdvancedFormsProps {
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
- // In docs mode, always show the component
399
- const canShowComponent = docsProAccess.isDocsMode || hasProAccess
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
- export interface AnimatedButtonProps
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
- // Check if we're in docs mode or have pro access
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
- // In docs mode, always show the component
166
- const canShowComponent = docsProAccess.isDocsMode || hasProAccess
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">
@@ -33,7 +33,7 @@ export interface CalendarEvent {
33
33
  type?: 'meeting' | 'task' | 'reminder' | 'event'
34
34
  }
35
35
 
36
- export interface CalendarProps {
36
+ interface CalendarProps {
37
37
  events?: CalendarEvent[]
38
38
  onEventClick?: (event: CalendarEvent) => void
39
39
  onEventAdd?: (eventData: Omit<CalendarEvent, 'id'> & { id?: string }) => void
@@ -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
- export interface ColorPickerProps {
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 (!docsProAccess.isDocsMode && !isLoading && !hasProAccess) {
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
- export interface DashboardMetric {
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
- export interface DashboardWidget {
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
- export interface DashboardProps {
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 './button'
17
- import { Input } from './input'
18
- import { Card, CardContent } from './card'
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
- export interface DataTableProps<TData, TValue> {
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 (!docsProAccess.isDocsMode && !isLoading && !hasProAccess) {
102
+ if (!isLoading && !hasProAccess) {
106
103
  return (
107
104
  <Card className={cn("w-full", className)}>
108
105
  <CardContent className="py-12 text-center">