@machinemetrics/mm-react-components 0.2.3-1 → 0.2.3-10

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 (98) hide show
  1. package/README.md +96 -30
  2. package/agent-docs/agent-documentation-reference.md +247 -0
  3. package/agent-docs/ai-agent-guide.md +554 -0
  4. package/agent-docs/ai-agent-init-guide.md +461 -0
  5. package/agent-docs/chakra-migration-readme.md +265 -0
  6. package/agent-docs/chakra-migration-troubleshooting.md +649 -0
  7. package/agent-docs/component-mapping-reference.md +466 -0
  8. package/agent-docs/init-readme.md +283 -0
  9. package/agent-docs/init-troubleshooting.md +550 -0
  10. package/agent-docs/setup-reference.md +365 -0
  11. package/dist/App.d.ts.map +1 -1
  12. package/dist/README.md +96 -30
  13. package/dist/components/ui/alert-dialog.d.ts +15 -0
  14. package/dist/components/ui/alert-dialog.d.ts.map +1 -0
  15. package/dist/components/ui/alert.d.ts +10 -0
  16. package/dist/components/ui/alert.d.ts.map +1 -0
  17. package/dist/components/ui/avatar.d.ts +7 -0
  18. package/dist/components/ui/avatar.d.ts.map +1 -0
  19. package/dist/components/ui/breadcrumb.d.ts +12 -0
  20. package/dist/components/ui/breadcrumb.d.ts.map +1 -0
  21. package/dist/components/ui/button.d.ts +1 -1
  22. package/dist/components/ui/button.d.ts.map +1 -1
  23. package/dist/components/ui/card.d.ts +10 -0
  24. package/dist/components/ui/card.d.ts.map +1 -0
  25. package/dist/components/ui/chart.d.ts +41 -0
  26. package/dist/components/ui/chart.d.ts.map +1 -0
  27. package/dist/components/ui/form.d.ts +25 -0
  28. package/dist/components/ui/form.d.ts.map +1 -0
  29. package/dist/components/ui/progress.d.ts +1 -0
  30. package/dist/components/ui/progress.d.ts.map +1 -1
  31. package/dist/components/ui/separator.d.ts +5 -0
  32. package/dist/components/ui/separator.d.ts.map +1 -0
  33. package/dist/components/ui/sonner.d.ts +4 -0
  34. package/dist/components/ui/sonner.d.ts.map +1 -0
  35. package/dist/components/ui/textarea.d.ts +4 -0
  36. package/dist/components/ui/textarea.d.ts.map +1 -0
  37. package/dist/docs/GETTING_STARTED.md +293 -0
  38. package/dist/index.d.ts +14 -2
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/lib/mm-react-components.css +1 -0
  41. package/dist/main.d.ts +0 -1
  42. package/dist/main.d.ts.map +1 -1
  43. package/dist/mm-react-components.es.js +10964 -927
  44. package/dist/mm-react-components.es.js.map +1 -1
  45. package/dist/mm-react-components.umd.js +27 -9
  46. package/dist/mm-react-components.umd.js.map +1 -1
  47. package/dist/preview/AlertDialogPreview.d.ts +2 -0
  48. package/dist/preview/AlertDialogPreview.d.ts.map +1 -0
  49. package/dist/preview/AlertPreview.d.ts +2 -0
  50. package/dist/preview/AlertPreview.d.ts.map +1 -0
  51. package/dist/preview/AvatarPreview.d.ts +2 -0
  52. package/dist/preview/AvatarPreview.d.ts.map +1 -0
  53. package/dist/preview/BreadcrumbPreview.d.ts +2 -0
  54. package/dist/preview/BreadcrumbPreview.d.ts.map +1 -0
  55. package/dist/preview/CardPreview.d.ts +2 -0
  56. package/dist/preview/CardPreview.d.ts.map +1 -0
  57. package/dist/preview/ChartPreview.d.ts +2 -0
  58. package/dist/preview/ChartPreview.d.ts.map +1 -0
  59. package/dist/preview/CheckboxPreview.d.ts.map +1 -1
  60. package/dist/preview/DataTablePreview.d.ts.map +1 -1
  61. package/dist/preview/FormPreview.d.ts +2 -0
  62. package/dist/preview/FormPreview.d.ts.map +1 -0
  63. package/dist/preview/InputPreview.d.ts.map +1 -1
  64. package/dist/preview/LabelPreview.d.ts.map +1 -1
  65. package/dist/preview/RadioGroupPreview.d.ts.map +1 -1
  66. package/dist/preview/SeparatorPreview.d.ts +2 -0
  67. package/dist/preview/SeparatorPreview.d.ts.map +1 -0
  68. package/dist/preview/SonnerPreview.d.ts +2 -0
  69. package/dist/preview/SonnerPreview.d.ts.map +1 -0
  70. package/dist/preview/TabsPreview.d.ts.map +1 -1
  71. package/dist/preview/TextareaPreview.d.ts +2 -0
  72. package/dist/preview/TextareaPreview.d.ts.map +1 -0
  73. package/dist/preview/data-table/data-table-preview_column-content.d.ts +1 -1
  74. package/dist/preview/data-table/data-table-preview_column-content.d.ts.map +1 -1
  75. package/dist/preview/page-header/PageHeaderPreview.d.ts.map +1 -1
  76. package/dist/scripts/chakra-to-shadcn-migrator/chakra-to-shadcn.config.json +512 -0
  77. package/dist/scripts/chakra-to-shadcn-migrator/lib/args.js +63 -0
  78. package/dist/scripts/chakra-to-shadcn-migrator/lib/colors.js +14 -0
  79. package/dist/scripts/chakra-to-shadcn-migrator/lib/config.js +15 -0
  80. package/dist/scripts/chakra-to-shadcn-migrator/lib/deps.js +125 -0
  81. package/dist/scripts/chakra-to-shadcn-migrator/lib/file-io.js +44 -0
  82. package/dist/scripts/chakra-to-shadcn-migrator/lib/render.js +89 -0
  83. package/dist/scripts/chakra-to-shadcn-migrator/lib/transform.js +550 -0
  84. package/dist/scripts/chakra-to-shadcn-migrator/package.json +11 -0
  85. package/dist/scripts/init.cjs +207 -0
  86. package/dist/tailwind.base.config.js +88 -0
  87. package/dist/themes/carbide.css +187 -32
  88. package/package.json +58 -10
  89. package/src/index.css +99 -498
  90. package/dist/index.css +0 -536
  91. package/dist/tailwind.config.export.js +0 -153
  92. package/dist/themes/complete.css +0 -8
  93. package/scripts/README.md +0 -171
  94. package/scripts/chakra-to-shadcn-migrator/README.md +0 -107
  95. package/src/themes/carbide.css +0 -1257
  96. package/src/themes/complete.css +0 -8
  97. package/tailwind.config.export.js +0 -153
  98. /package/{scripts → dist/scripts}/chakra-to-shadcn-migrator/bin/chakra-to-shadcn.js +0 -0
@@ -0,0 +1,550 @@
1
+ # Troubleshooting Guide: MachineMetrics React Components Initialization
2
+
3
+ ## Common Issues and Solutions
4
+
5
+ ### 1. Script Execution Issues
6
+
7
+ #### Error: `npx: command not found`
8
+
9
+ **Cause**: NPX not installed or not in PATH.
10
+
11
+ **Solution**:
12
+
13
+ ```bash
14
+ # Install NPX globally
15
+ npm install -g npx
16
+
17
+ # Or use npm directly
18
+ npm init @machinemetrics/mm-react-components
19
+
20
+ # Alternative: Use the package directly
21
+ npx @machinemetrics/mm-react-components init
22
+ ```
23
+
24
+ #### Error: `Permission denied`
25
+
26
+ **Cause**: Insufficient permissions to execute the script.
27
+
28
+ **Solution**:
29
+
30
+ ```bash
31
+ # Fix npm permissions
32
+ sudo chown -R $(whoami) ~/.npm
33
+
34
+ # Or use a Node version manager
35
+ nvm install node
36
+ nvm use node
37
+ ```
38
+
39
+ #### Error: `Network timeout` or `ECONNRESET`
40
+
41
+ **Cause**: Network connectivity issues or npm registry problems.
42
+
43
+ **Solution**:
44
+
45
+ ```bash
46
+ # Clear npm cache
47
+ npm cache clean --force
48
+
49
+ # Use different registry
50
+ npm config set registry https://registry.npmjs.org/
51
+
52
+ # Retry with verbose output
53
+ npx @machinemetrics/mm-react-components init --verbose
54
+ ```
55
+
56
+ ### 2. Dependency Installation Issues
57
+
58
+ #### Error: `Cannot find module '@machinemetrics/mm-react-components'`
59
+
60
+ **Cause**: Package installation failed or incomplete.
61
+
62
+ **Solution**:
63
+
64
+ ```bash
65
+ # Clear cache and reinstall
66
+ npm cache clean --force
67
+ rm -rf node_modules package-lock.json
68
+ npm install
69
+
70
+ # Install the package specifically
71
+ npm install @machinemetrics/mm-react-components@latest
72
+
73
+ # Verify installation
74
+ npm list @machinemetrics/mm-react-components
75
+ ```
76
+
77
+ #### Error: `Peer dependency warnings`
78
+
79
+ **Cause**: Missing or incompatible peer dependencies.
80
+
81
+ **Solution**:
82
+
83
+ ```bash
84
+ # Install all peer dependencies
85
+ npm install class-variance-authority clsx tailwind-merge @radix-ui/react-slot lucide-react
86
+
87
+ # Install build dependencies
88
+ npm install -D tailwindcss autoprefixer postcss
89
+
90
+ # Check for version conflicts
91
+ npm ls
92
+ ```
93
+
94
+ #### Error: `EACCES: permission denied`
95
+
96
+ **Cause**: File system permission issues.
97
+
98
+ **Solution**:
99
+
100
+ ```bash
101
+ # Fix npm permissions
102
+ sudo chown -R $(whoami) ~/.npm
103
+ sudo chown -R $(whoami) /usr/local/lib/node_modules
104
+
105
+ # Or use a Node version manager
106
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
107
+ nvm install node
108
+ nvm use node
109
+ ```
110
+
111
+ ### 3. Configuration Issues
112
+
113
+ #### Error: `Cannot find module 'tailwindcss'`
114
+
115
+ **Cause**: Tailwind CSS not installed or not configured.
116
+
117
+ **Solution**:
118
+
119
+ ```bash
120
+ # Install Tailwind CSS
121
+ npm install -D tailwindcss
122
+
123
+ # Initialize Tailwind
124
+ npx tailwindcss init -p
125
+
126
+ # Update tailwind.config.js
127
+ module.exports = {
128
+ content: [
129
+ "./src/**/*.{js,ts,jsx,tsx}",
130
+ "./node_modules/@machinemetrics/mm-react-components/dist/**/*.{js,ts,jsx,tsx}",
131
+ ],
132
+ theme: {
133
+ extend: {},
134
+ },
135
+ plugins: [],
136
+ }
137
+ ```
138
+
139
+ #### Error: `PostCSS plugin tailwindcss requires Tailwind CSS`
140
+
141
+ **Cause**: PostCSS configuration missing or incorrect.
142
+
143
+ **Solution**:
144
+
145
+ ```bash
146
+ # Install PostCSS dependencies
147
+ npm install -D postcss autoprefixer
148
+
149
+ # Create postcss.config.js
150
+ echo "module.exports = {
151
+ plugins: {
152
+ tailwindcss: {},
153
+ autoprefixer: {},
154
+ },
155
+ }" > postcss.config.js
156
+ ```
157
+
158
+ #### Error: `Cannot resolve dependency 'lucide-react'`
159
+
160
+ **Cause**: Icon library not installed.
161
+
162
+ **Solution**:
163
+
164
+ ```bash
165
+ # Install Lucide React
166
+ npm install lucide-react
167
+
168
+ # Verify installation
169
+ npm list lucide-react
170
+ ```
171
+
172
+ ### 4. Build and Runtime Issues
173
+
174
+ #### Error: `Module not found: Can't resolve 'clsx'`
175
+
176
+ **Cause**: Utility library not installed.
177
+
178
+ **Solution**:
179
+
180
+ ```bash
181
+ # Install required utilities
182
+ npm install clsx tailwind-merge class-variance-authority
183
+
184
+ # Verify installation
185
+ npm list clsx tailwind-merge class-variance-authority
186
+ ```
187
+
188
+ #### Error: `Cannot find module '@radix-ui/react-slot'`
189
+
190
+ **Cause**: Radix UI primitives not installed.
191
+
192
+ **Solution**:
193
+
194
+ ```bash
195
+ # Install Radix UI dependencies
196
+ npm install @radix-ui/react-slot
197
+
198
+ # Install additional Radix UI packages if needed
199
+ npm install @radix-ui/react-dialog @radix-ui/react-dropdown-menu
200
+ ```
201
+
202
+ #### Error: `Components not styling correctly`
203
+
204
+ **Cause**: CSS not imported or theme not applied.
205
+
206
+ **Solution**:
207
+
208
+ ```tsx
209
+ // Ensure CSS is imported in your main file
210
+ import '@machinemetrics/mm-react-components/themes/carbide';
211
+
212
+ // Ensure carbide class is applied to root element
213
+ function App() {
214
+ return (
215
+ <div className="carbide">
216
+ <YourApp />
217
+ </div>
218
+ );
219
+ }
220
+ ```
221
+
222
+ ### 5. Framework-Specific Issues
223
+
224
+ #### Next.js Issues
225
+
226
+ **Error**: `Module not found: Can't resolve '@machinemetrics/mm-react-components'`
227
+
228
+ **Solution**:
229
+
230
+ ```javascript
231
+ // next.config.js
232
+ /** @type {import('next').NextConfig} */
233
+ const nextConfig = {
234
+ transpilePackages: ['@machinemetrics/mm-react-components'],
235
+ };
236
+
237
+ module.exports = nextConfig;
238
+ ```
239
+
240
+ **Error**: `CSS not loading in production`
241
+
242
+ **Solution**:
243
+
244
+ ```tsx
245
+ // pages/_app.tsx
246
+ import '@machinemetrics/mm-react-components/themes/carbide';
247
+ import '../styles/globals.css';
248
+ ```
249
+
250
+ #### Vite Issues
251
+
252
+ **Error**: `Build fails with CSS errors`
253
+
254
+ **Solution**:
255
+
256
+ ```javascript
257
+ // vite.config.ts
258
+ import { defineConfig } from 'vite';
259
+ import react from '@vitejs/plugin-react';
260
+
261
+ export default defineConfig({
262
+ plugins: [react()],
263
+ css: {
264
+ postcss: {
265
+ plugins: [require('tailwindcss'), require('autoprefixer')],
266
+ },
267
+ },
268
+ });
269
+ ```
270
+
271
+ #### Create React App Issues
272
+
273
+ **Error**: `Tailwind CSS not working`
274
+
275
+ **Solution**:
276
+
277
+ ```bash
278
+ # Install CRACO for Tailwind support
279
+ npm install -D @craco/craco
280
+
281
+ # Create craco.config.js
282
+ module.exports = {
283
+ style: {
284
+ postcss: {
285
+ plugins: [
286
+ require('tailwindcss'),
287
+ require('autoprefixer'),
288
+ ],
289
+ },
290
+ },
291
+ }
292
+ ```
293
+
294
+ ### 6. TypeScript Issues
295
+
296
+ #### Error: `Cannot find module '@machinemetrics/mm-react-components' or its corresponding type declarations`
297
+
298
+ **Cause**: TypeScript types not found.
299
+
300
+ **Solution**:
301
+
302
+ ```bash
303
+ # Install TypeScript dependencies
304
+ npm install -D @types/react @types/react-dom typescript
305
+
306
+ # Update tsconfig.json
307
+ {
308
+ "compilerOptions": {
309
+ "types": ["@machinemetrics/mm-react-components"]
310
+ }
311
+ }
312
+ ```
313
+
314
+ #### Error: `Property 'className' does not exist on type`
315
+
316
+ **Cause**: TypeScript configuration issues.
317
+
318
+ **Solution**:
319
+
320
+ ```tsx
321
+ // Ensure proper imports
322
+ import { Button } from '@machinemetrics/mm-react-components';
323
+ import { cn } from '@machinemetrics/mm-react-components';
324
+
325
+ // Use proper typing
326
+ interface ButtonProps {
327
+ className?: string;
328
+ children: React.ReactNode;
329
+ }
330
+ ```
331
+
332
+ ### 7. Performance Issues
333
+
334
+ #### Issue: `Bundle size too large`
335
+
336
+ **Cause**: Importing entire library instead of specific components.
337
+
338
+ **Solution**:
339
+
340
+ ```tsx
341
+ // Import only needed components
342
+ import { Button, Input } from '@machinemetrics/mm-react-components';
343
+
344
+ // Instead of
345
+ import * as Components from '@machinemetrics/mm-react-components';
346
+ ```
347
+
348
+ #### Issue: `Slow build times`
349
+
350
+ **Cause**: Inefficient build configuration.
351
+
352
+ **Solution**:
353
+
354
+ ```javascript
355
+ // webpack.config.js
356
+ module.exports = {
357
+ optimization: {
358
+ usedExports: true,
359
+ sideEffects: false,
360
+ },
361
+ resolve: {
362
+ alias: {
363
+ '@machinemetrics/mm-react-components': path.resolve(
364
+ __dirname,
365
+ 'node_modules/@machinemetrics/mm-react-components',
366
+ ),
367
+ },
368
+ },
369
+ };
370
+ ```
371
+
372
+ ### 8. Development Server Issues
373
+
374
+ #### Issue: `Hot reload not working`
375
+
376
+ **Cause**: File watching issues or configuration problems.
377
+
378
+ **Solution**:
379
+
380
+ ```bash
381
+ # Clear cache and restart
382
+ npm run dev -- --force
383
+
384
+ # Check file permissions
385
+ ls -la src/
386
+
387
+ # Verify file structure
388
+ tree src/
389
+ ```
390
+
391
+ #### Issue: `CSS not updating`
392
+
393
+ **Cause**: CSS processing issues.
394
+
395
+ **Solution**:
396
+
397
+ ```bash
398
+ # Restart development server
399
+ npm run dev
400
+
401
+ # Clear build cache
402
+ rm -rf .next dist build
403
+
404
+ # Verify PostCSS configuration
405
+ cat postcss.config.js
406
+ ```
407
+
408
+ ### 9. Production Build Issues
409
+
410
+ #### Error: `Build fails in production`
411
+
412
+ **Cause**: Production-specific configuration issues.
413
+
414
+ **Solution**:
415
+
416
+ ```bash
417
+ # Check build logs
418
+ npm run build 2>&1 | tee build.log
419
+
420
+ # Verify environment variables
421
+ echo $NODE_ENV
422
+
423
+ # Test production build locally
424
+ npm run build && npm run preview
425
+ ```
426
+
427
+ #### Error: `CSS not loading in production`
428
+
429
+ **Cause**: CSS processing or import issues.
430
+
431
+ **Solution**:
432
+
433
+ ```tsx
434
+ // Ensure CSS is imported in production
435
+ import '@machinemetrics/mm-react-components/themes/carbide';
436
+
437
+ // Check build output
438
+ ls -la dist/
439
+ ```
440
+
441
+ ### 10. Debugging Tools
442
+
443
+ #### Enable Verbose Logging
444
+
445
+ ```bash
446
+ # Run with verbose output
447
+ npx @machinemetrics/mm-react-components init --verbose
448
+
449
+ # Check npm logs
450
+ npm config get loglevel
451
+ npm config set loglevel verbose
452
+ ```
453
+
454
+ #### Check Dependencies
455
+
456
+ ```bash
457
+ # List all dependencies
458
+ npm list --depth=0
459
+
460
+ # Check for conflicts
461
+ npm ls --depth=0
462
+
463
+ # Verify package integrity
464
+ npm audit
465
+ ```
466
+
467
+ #### Debug Build Process
468
+
469
+ ```bash
470
+ # Build with debug info
471
+ npm run build -- --debug
472
+
473
+ # Check webpack stats
474
+ npm run build -- --analyze
475
+ ```
476
+
477
+ ## Prevention Strategies
478
+
479
+ ### 1. Environment Setup
480
+
481
+ ```bash
482
+ # Use Node version manager
483
+ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
484
+ nvm install --lts
485
+ nvm use --lts
486
+
487
+ # Verify Node and npm versions
488
+ node --version
489
+ npm --version
490
+ ```
491
+
492
+ ### 2. Project Structure
493
+
494
+ ```
495
+ my-project/
496
+ ├── src/
497
+ │ ├── index.css
498
+ │ ├── App.tsx
499
+ │ └── main.tsx
500
+ ├── tailwind.config.js
501
+ ├── postcss.config.js
502
+ ├── package.json
503
+ └── node_modules/
504
+ ```
505
+
506
+ ### 3. Dependency Management
507
+
508
+ ```bash
509
+ # Use exact versions for critical dependencies
510
+ npm install @machinemetrics/mm-react-components@latest
511
+
512
+ # Lock dependency versions
513
+ npm shrinkwrap
514
+ ```
515
+
516
+ ### 4. Configuration Validation
517
+
518
+ ```bash
519
+ # Validate configuration files
520
+ npx tailwindcss --help
521
+ npx postcss --help
522
+
523
+ # Check for syntax errors
524
+ node -c tailwind.config.js
525
+ node -c postcss.config.js
526
+ ```
527
+
528
+ ## Getting Help
529
+
530
+ ### Documentation
531
+
532
+ - [Component Library Docs](https://components.machinemetrics.com)
533
+ - [Setup Guide](https://components.machinemetrics.com/setup)
534
+ - [Troubleshooting](https://components.machinemetrics.com/troubleshooting)
535
+
536
+ ### Community Support
537
+
538
+ - [GitHub Issues](https://github.com/machinemetrics/mm-react-components/issues)
539
+ - [Discord Community](https://discord.gg/machinemetrics)
540
+ - [Stack Overflow](https://stackoverflow.com/questions/tagged/machinemetrics)
541
+
542
+ ### Professional Support
543
+
544
+ - [MachineMetrics Support](https://support.machinemetrics.com)
545
+ - [Enterprise Support](https://enterprise.machinemetrics.com)
546
+ - [Consulting Services](https://consulting.machinemetrics.com)
547
+
548
+ ## Conclusion
549
+
550
+ This troubleshooting guide covers the most common issues encountered during MachineMetrics React Components initialization. Follow the solutions provided and use the debugging tools to resolve any issues. For additional help, refer to the documentation or contact support.