@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,554 @@
1
+ # AI Agent Guide: Chakra UI to MachineMetrics React Components Migration
2
+
3
+ ## Overview
4
+
5
+ This guide provides AI agents with comprehensive instructions for migrating Chakra UI components to the MachineMetrics React Components library. It includes automated script usage, manual conversion procedures, and troubleshooting guidance.
6
+
7
+ ## Quick Start
8
+
9
+ ### 1. Automated Migration (Preferred)
10
+
11
+ ```bash
12
+ # Run the migration script
13
+ node scripts/chakra-to-shadcn-migrator/chakra-to-shadcn.js --apply
14
+ ```
15
+
16
+ ### 2. Manual Migration (When Script Fails)
17
+
18
+ If the automated script fails, follow the manual conversion guide below.
19
+
20
+ ## Configuration File Reference
21
+
22
+ The migration configuration is located at `scripts/chakra-to-shadcn-migrator/chakra-to-shadcn.config.json` and contains:
23
+
24
+ - **Dependencies to Remove**: Chakra UI packages to uninstall
25
+ - **Dependencies to Add**: New packages required for MachineMetrics components
26
+ - **Component Mappings**: Direct component replacements
27
+ - **Compound Components**: Complex component structure mappings
28
+ - **Manual Migration Instructions**: Fallback conversion steps
29
+
30
+ ## Component Migration Mappings
31
+
32
+ ### Layout Components (Manual Replacement Required)
33
+
34
+ | Chakra Component | Replacement | Notes |
35
+ | ---------------- | ------------------------------------------------------------------------ | ---------------------------------- |
36
+ | `Box` | `<div>` | Add appropriate Tailwind classes |
37
+ | `Flex` | `<div className="flex">` | Add flex-related Tailwind classes |
38
+ | `VStack` | `<div className="flex flex-col gap-4">` | Adjust spacing as needed |
39
+ | `HStack` | `<div className="flex flex-row gap-4">` | Adjust spacing as needed |
40
+ | `Stack` | `<div className="flex flex-col gap-4">` | Adjust direction/spacing as needed |
41
+ | `Container` | `<div className="container mx-auto px-4">` | Adjust max-width as needed |
42
+ | `Center` | `<div className="flex items-center justify-center">` | - |
43
+ | `SimpleGrid` | `<div className="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">` | Adjust columns as needed |
44
+
45
+ ### Typography Components (Manual Replacement Required)
46
+
47
+ | Chakra Component | Replacement | Notes |
48
+ | ---------------- | ---------------------------- | -------------------------------------------------- |
49
+ | `Heading` | `<h1>`, `<h2>`, `<h3>`, etc. | Use semantic HTML with Tailwind typography classes |
50
+ | `Text` | `<p>`, `<span>`, etc. | Use semantic HTML with Tailwind typography classes |
51
+
52
+ ### Form Components (Manual Replacement Required)
53
+
54
+ | Chakra Component | Replacement | Notes |
55
+ | ---------------- | ----------------------- | --------------------------------------------- |
56
+ | `Field` | `<div>` wrapper | Use shadcn/ui form components for inputs |
57
+ | `NumberInput` | `<input type="number">` | Add Tailwind classes, or use shadcn/ui Input |
58
+ | `Slider` | `<input type="range">` | Add Tailwind classes, or use shadcn/ui Slider |
59
+ | `NativeSelect` | `<select>` | Add Tailwind classes, or use shadcn/ui Select |
60
+
61
+ ### UI Components (Direct Mappings Available)
62
+
63
+ | Chakra Component | MachineMetrics Component | Import Path |
64
+ | ---------------- | ------------------------ | ------------------------------------- |
65
+ | `Badge` | `Badge` | `@machinemetrics/mm-react-components` |
66
+ | `Button` | `Button` | `@machinemetrics/mm-react-components` |
67
+ | `Modal` | `Dialog` | `@machinemetrics/mm-react-components` |
68
+ | `Input` | `Input` | `@machinemetrics/mm-react-components` |
69
+ | `Menu` | `DropdownMenu` | `@machinemetrics/mm-react-components` |
70
+ | `Select` | `Select` | `@machinemetrics/mm-react-components` |
71
+ | `Table` | `Table` | `@machinemetrics/mm-react-components` |
72
+ | `Tabs` | `Tabs` | `@machinemetrics/mm-react-components` |
73
+ | `Tooltip` | `Tooltip` | `@machinemetrics/mm-react-components` |
74
+ | `Drawer` | `Drawer` | `@machinemetrics/mm-react-components` |
75
+ | `Switch` | `Switch` | `@machinemetrics/mm-react-components` |
76
+ | `Checkbox` | `Checkbox` | `@machinemetrics/mm-react-components` |
77
+ | `Radio` | `RadioGroupItem` | `@machinemetrics/mm-react-components` |
78
+ | `RadioGroup` | `RadioGroup` | `@machinemetrics/mm-react-components` |
79
+ | `Label` | `Label` | `@machinemetrics/mm-react-components` |
80
+ | `FormLabel` | `Label` | `@machinemetrics/mm-react-components` |
81
+ | `Sheet` | `Sheet` | `@machinemetrics/mm-react-components` |
82
+ | `Skeleton` | `Skeleton` | `@machinemetrics/mm-react-components` |
83
+ | `Collapse` | `Collapsible` | `@machinemetrics/mm-react-components` |
84
+ | `Accordion` | `Accordion` | `@machinemetrics/mm-react-components` |
85
+ | `Progress` | `Progress` | `@machinemetrics/mm-react-components` |
86
+ | `Slider` | `Slider` | `@machinemetrics/mm-react-components` |
87
+ | `Popover` | `Popover` | `@machinemetrics/mm-react-components` |
88
+
89
+ ### New Components (Recently Added)
90
+
91
+ | Chakra Component | MachineMetrics Component | Import Path |
92
+ | ----------------- | -------------------------------------- | ------------------------------------- |
93
+ | `Alert` | `Alert` | `@machinemetrics/mm-react-components` |
94
+ | `AlertDialog` | `AlertDialog` | `@machinemetrics/mm-react-components` |
95
+ | `Avatar` | `Avatar` | `@machinemetrics/mm-react-components` |
96
+ | `Breadcrumb` | `Breadcrumb` | `@machinemetrics/mm-react-components` |
97
+ | `Calendar` | `Calendar` | `@machinemetrics/mm-react-components` |
98
+ | `DateRangePicker` | `DateRangePicker` | `@machinemetrics/mm-react-components` |
99
+ | `Form` | `Form` | `@machinemetrics/mm-react-components` |
100
+ | `Separator` | `Separator` | `@machinemetrics/mm-react-components` |
101
+ | `Textarea` | `Textarea` | `@machinemetrics/mm-react-components` |
102
+ | `Toaster` | `Toaster` | `@machinemetrics/mm-react-components` |
103
+ | `Chart` | `ChartContainer`, `ChartTooltip`, etc. | `@machinemetrics/mm-react-components` |
104
+ | `Dropzone` | `Dropzone` | `@machinemetrics/mm-react-components` |
105
+ | `SearchInput` | `SearchInput` | `@machinemetrics/mm-react-components` |
106
+
107
+ ## Compound Component Mappings
108
+
109
+ ### Modal/Dialog Components
110
+
111
+ ```tsx
112
+ // Chakra UI
113
+ <Modal>
114
+ <ModalOverlay />
115
+ <ModalContent>
116
+ <ModalHeader>Title</ModalHeader>
117
+ <ModalBody>Content</ModalBody>
118
+ <ModalFooter>Footer</ModalFooter>
119
+ </ModalContent>
120
+ </Modal>
121
+
122
+ // MachineMetrics Components
123
+ <Dialog>
124
+ <DialogTrigger>Open</DialogTrigger>
125
+ <DialogContent>
126
+ <DialogHeader>
127
+ <DialogTitle>Title</DialogTitle>
128
+ </DialogHeader>
129
+ Content
130
+ <DialogFooter>Footer</DialogFooter>
131
+ </DialogContent>
132
+ </Dialog>
133
+ ```
134
+
135
+ ### Drawer Components
136
+
137
+ ```tsx
138
+ // Chakra UI
139
+ <Drawer>
140
+ <DrawerOverlay />
141
+ <DrawerContent>
142
+ <DrawerHeader>Title</DrawerHeader>
143
+ <DrawerBody>Content</DrawerBody>
144
+ <DrawerFooter>Footer</DrawerFooter>
145
+ </DrawerContent>
146
+ </Drawer>
147
+
148
+ // MachineMetrics Components
149
+ <Drawer>
150
+ <DrawerTrigger>Open</DrawerTrigger>
151
+ <DrawerContent>
152
+ <DrawerHeader>
153
+ <DrawerTitle>Title</DrawerTitle>
154
+ </DrawerHeader>
155
+ Content
156
+ <DrawerFooter>Footer</DrawerFooter>
157
+ </DrawerContent>
158
+ </Drawer>
159
+ ```
160
+
161
+ ### Accordion Components
162
+
163
+ ```tsx
164
+ // Chakra UI
165
+ <Accordion>
166
+ <AccordionItem>
167
+ <AccordionButton>Header</AccordionButton>
168
+ <AccordionPanel>Content</AccordionPanel>
169
+ </AccordionItem>
170
+ </Accordion>
171
+
172
+ // MachineMetrics Components
173
+ <Accordion>
174
+ <AccordionItem>
175
+ <AccordionTrigger>Header</AccordionTrigger>
176
+ <AccordionContent>Content</AccordionContent>
177
+ </AccordionItem>
178
+ </Accordion>
179
+ ```
180
+
181
+ ### Card Components
182
+
183
+ ```tsx
184
+ // Chakra UI
185
+ <Card>
186
+ <CardHeader>Header</CardHeader>
187
+ <CardBody>Content</CardBody>
188
+ <CardFooter>Footer</CardFooter>
189
+ </Card>
190
+
191
+ // MachineMetrics Components
192
+ <Card>
193
+ <CardHeader>
194
+ <CardTitle>Title</CardTitle>
195
+ <CardDescription>Description</CardDescription>
196
+ </CardHeader>
197
+ <CardContent>Content</CardContent>
198
+ <CardFooter>Footer</CardFooter>
199
+ </Card>
200
+ ```
201
+
202
+ ## Manual Conversion Process
203
+
204
+ ### Step 1: Update Dependencies
205
+
206
+ ```bash
207
+ # Remove Chakra UI packages
208
+ npm uninstall @chakra-ui/react @chakra-ui/icons @chakra-ui/system @emotion/react @emotion/styled
209
+
210
+ # Install MachineMetrics components
211
+ npm install @machinemetrics/mm-react-components
212
+
213
+ # Install additional dependencies
214
+ npm install class-variance-authority tailwind-merge lucide-react
215
+ npm install react-day-picker date-fns recharts react-dropzone sonner vaul
216
+ npm install @radix-ui/react-avatar @radix-ui/react-breadcrumb @radix-ui/react-calendar
217
+ npm install @radix-ui/react-alert-dialog @radix-ui/react-separator @radix-ui/react-form
218
+ npm install @radix-ui/react-textarea @radix-ui/react-toast
219
+
220
+ # Install dev dependencies
221
+ npm install -D tailwindcss postcss autoprefixer
222
+ ```
223
+
224
+ ### Step 2: Update Theme Configuration
225
+
226
+ ```tsx
227
+ // Remove ChakraProvider from your app root
228
+ // Before
229
+ import { ChakraProvider } from '@chakra-ui/react';
230
+
231
+ function App() {
232
+ return (
233
+ <ChakraProvider>
234
+ <YourApp />
235
+ </ChakraProvider>
236
+ );
237
+ }
238
+
239
+ // After
240
+ import '@machinemetrics/mm-react-components/themes/carbide';
241
+
242
+ function App() {
243
+ return (
244
+ <div className="carbide">
245
+ <YourApp />
246
+ </div>
247
+ );
248
+ }
249
+ ```
250
+
251
+ ### Step 3: Update Component Imports
252
+
253
+ ```tsx
254
+ // Before
255
+ import { Button, Input, Modal, Box, Flex } from '@chakra-ui/react';
256
+
257
+ // After
258
+ import { Button, Input, Dialog } from '@machinemetrics/mm-react-components';
259
+ // Layout components become generic HTML elements with Tailwind classes
260
+ ```
261
+
262
+ ### Step 4: Convert Layout Components
263
+
264
+ ```tsx
265
+ // Before
266
+ <Box p={4} bg="gray.100">
267
+ <Flex direction="column" gap={4}>
268
+ <VStack spacing={4}>
269
+ <HStack spacing={2}>
270
+ Content
271
+ </HStack>
272
+ </VStack>
273
+ </Flex>
274
+ </Box>
275
+
276
+ // After
277
+ <div className="p-4 bg-gray-100">
278
+ <div className="flex flex-col gap-4">
279
+ <div className="flex flex-col gap-4">
280
+ <div className="flex flex-row gap-2">
281
+ Content
282
+ </div>
283
+ </div>
284
+ </div>
285
+ </div>
286
+ ```
287
+
288
+ ### Step 5: Convert Typography Components
289
+
290
+ ```tsx
291
+ // Before
292
+ <Heading size="lg" color="blue.500">
293
+ Title
294
+ </Heading>
295
+ <Text fontSize="sm" color="gray.600">
296
+ Description
297
+ </Text>
298
+
299
+ // After
300
+ <h2 className="text-lg font-semibold text-blue-500">
301
+ Title
302
+ </h2>
303
+ <p className="text-sm text-gray-600">
304
+ Description
305
+ </p>
306
+ ```
307
+
308
+ ### Step 6: Convert Form Components
309
+
310
+ ```tsx
311
+ // Before
312
+ <Field>
313
+ <FormLabel>Name</FormLabel>
314
+ <Input placeholder="Enter name" />
315
+ </Field>
316
+
317
+ // After
318
+ <div>
319
+ <Label>Name</Label>
320
+ <Input placeholder="Enter name" />
321
+ </div>
322
+ ```
323
+
324
+ ### Step 7: Convert UI Components
325
+
326
+ ```tsx
327
+ // Before
328
+ <Modal isOpen={isOpen} onClose={onClose}>
329
+ <ModalOverlay />
330
+ <ModalContent>
331
+ <ModalHeader>Title</ModalHeader>
332
+ <ModalBody>Content</ModalBody>
333
+ <ModalFooter>
334
+ <Button onClick={onClose}>Close</Button>
335
+ </ModalFooter>
336
+ </ModalContent>
337
+ </Modal>
338
+
339
+ // After
340
+ <Dialog open={isOpen} onOpenChange={setIsOpen}>
341
+ <DialogTrigger>Open</DialogTrigger>
342
+ <DialogContent>
343
+ <DialogHeader>
344
+ <DialogTitle>Title</DialogTitle>
345
+ </DialogHeader>
346
+ Content
347
+ <DialogFooter>
348
+ <Button onClick={() => setIsOpen(false)}>Close</Button>
349
+ </DialogFooter>
350
+ </DialogContent>
351
+ </Dialog>
352
+ ```
353
+
354
+ ## Icon Migration
355
+
356
+ ### Replace Chakra Icons with Lucide React
357
+
358
+ ```tsx
359
+ // Before
360
+ import { AddIcon, DeleteIcon } from '@chakra-ui/icons'
361
+
362
+ // After
363
+ import { Plus, Trash2 } from 'lucide-react'
364
+
365
+ // Usage remains the same
366
+ <Button>
367
+ <AddIcon />
368
+ Add Item
369
+ </Button>
370
+
371
+ <Button>
372
+ <Plus />
373
+ Add Item
374
+ </Button>
375
+ ```
376
+
377
+ ## Common Migration Patterns
378
+
379
+ ### 1. Spacing and Layout
380
+
381
+ ```tsx
382
+ // Chakra UI spacing
383
+ <Box p={4} m={2} gap={4}>
384
+
385
+ // Tailwind CSS spacing
386
+ <div className="p-4 m-2 gap-4">
387
+ ```
388
+
389
+ ### 2. Colors
390
+
391
+ ```tsx
392
+ // Chakra UI colors
393
+ <Box bg="blue.500" color="white">
394
+
395
+ // Tailwind CSS colors
396
+ <div className="bg-blue-500 text-white">
397
+ ```
398
+
399
+ ### 3. Responsive Design
400
+
401
+ ```tsx
402
+ // Chakra UI responsive
403
+ <Box display={{ base: 'block', md: 'flex' }}>
404
+
405
+ // Tailwind CSS responsive
406
+ <div className="block md:flex">
407
+ ```
408
+
409
+ ### 4. State Management
410
+
411
+ ```tsx
412
+ // Chakra UI state
413
+ const [isOpen, setIsOpen] = useState(false);
414
+
415
+ // MachineMetrics state (same pattern)
416
+ const [isOpen, setIsOpen] = useState(false);
417
+ ```
418
+
419
+ ## Troubleshooting Common Issues
420
+
421
+ ### 1. Missing Dependencies
422
+
423
+ **Error**: `Module not found: Can't resolve '@machinemetrics/mm-react-components'`
424
+
425
+ **Solution**: Install the package
426
+
427
+ ```bash
428
+ npm install @machinemetrics/mm-react-components
429
+ ```
430
+
431
+ ### 2. Theme Not Applied
432
+
433
+ **Error**: Components don't have the expected styling
434
+
435
+ **Solution**: Ensure theme is imported and applied
436
+
437
+ ```tsx
438
+ import '@machinemetrics/mm-react-components/themes/carbide';
439
+
440
+ // Add to your app root
441
+ <div className="carbide">
442
+ <YourApp />
443
+ </div>;
444
+ ```
445
+
446
+ ### 3. Layout Components Not Working
447
+
448
+ **Error**: Layout components like `Box`, `Flex` not found
449
+
450
+ **Solution**: Replace with generic HTML elements and Tailwind classes
451
+
452
+ ```tsx
453
+ // Instead of <Box>, use <div>
454
+ // Instead of <Flex>, use <div className="flex">
455
+ ```
456
+
457
+ ### 4. Icons Not Displaying
458
+
459
+ **Error**: Icons not showing after migration
460
+
461
+ **Solution**: Update icon imports to Lucide React
462
+
463
+ ```tsx
464
+ // Before
465
+ import { AddIcon } from '@chakra-ui/icons';
466
+
467
+ // After
468
+ import { Plus } from 'lucide-react';
469
+ ```
470
+
471
+ ### 5. Form Components Not Working
472
+
473
+ **Error**: Form components not functioning properly
474
+
475
+ **Solution**: Use the new Form components from MachineMetrics
476
+
477
+ ```tsx
478
+ import {
479
+ Form,
480
+ FormField,
481
+ FormItem,
482
+ FormLabel,
483
+ FormControl,
484
+ } from '@machinemetrics/mm-react-components';
485
+ ```
486
+
487
+ ## Validation Checklist
488
+
489
+ After migration, verify:
490
+
491
+ - [ ] All Chakra UI imports removed
492
+ - [ ] MachineMetrics components imported correctly
493
+ - [ ] Theme applied with `carbide` class
494
+ - [ ] Layout components converted to HTML + Tailwind
495
+ - [ ] Icons updated to Lucide React
496
+ - [ ] Form components working correctly
497
+ - [ ] Modal/Dialog components functioning
498
+ - [ ] Styling matches original design
499
+ - [ ] No console errors
500
+ - [ ] All functionality preserved
501
+
502
+ ## Advanced Migration Scenarios
503
+
504
+ ### Custom Chakra Components
505
+
506
+ If you have custom components built on Chakra UI:
507
+
508
+ 1. Identify the base Chakra component used
509
+ 2. Replace with equivalent MachineMetrics component
510
+ 3. Update styling to use Tailwind classes
511
+ 4. Test functionality thoroughly
512
+
513
+ ### Complex Layout Migrations
514
+
515
+ For complex layouts:
516
+
517
+ 1. Break down into smaller components
518
+ 2. Convert each part individually
519
+ 3. Use Tailwind's flexbox and grid utilities
520
+ 4. Test responsive behavior
521
+
522
+ ### Animation Migrations
523
+
524
+ For animations:
525
+
526
+ 1. Replace Chakra's `Fade`, `Slide` with CSS transitions
527
+ 2. Use Tailwind's animation utilities
528
+ 3. Consider Framer Motion for complex animations
529
+
530
+ ## Support and Resources
531
+
532
+ - **Documentation**: [MachineMetrics Components Docs](https://components.machinemetrics.com)
533
+ - **GitHub**: [Component Library Repository](https://github.com/machinemetrics/mm-react-components)
534
+ - **Issues**: Report migration issues on GitHub
535
+ - **Community**: Join the MachineMetrics developer community
536
+
537
+ ## Migration Script Usage
538
+
539
+ The automated migration script can be run with:
540
+
541
+ ```bash
542
+ # Preview changes (dry run)
543
+ node scripts/chakra-to-shadcn-migrator/chakra-to-shadcn.js
544
+
545
+ # Apply changes
546
+ node scripts/chakra-to-shadcn-migrator/chakra-to-shadcn.js --apply
547
+
548
+ # With verbose output
549
+ node scripts/chakra-to-shadcn-migrator/chakra-to-shadcn.js --apply --verbose
550
+ ```
551
+
552
+ ## Conclusion
553
+
554
+ This guide provides comprehensive instructions for migrating from Chakra UI to MachineMetrics React Components. The automated script handles most cases, but manual conversion may be necessary for complex scenarios. Always test thoroughly after migration to ensure functionality is preserved.