@machinemetrics/mm-react-components 0.2.3-0 → 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.
- package/README.md +119 -33
- package/agent-docs/agent-documentation-reference.md +247 -0
- package/agent-docs/ai-agent-guide.md +554 -0
- package/agent-docs/ai-agent-init-guide.md +461 -0
- package/agent-docs/chakra-migration-readme.md +265 -0
- package/agent-docs/chakra-migration-troubleshooting.md +649 -0
- package/agent-docs/component-mapping-reference.md +466 -0
- package/agent-docs/init-readme.md +283 -0
- package/agent-docs/init-troubleshooting.md +550 -0
- package/agent-docs/setup-reference.md +365 -0
- package/dist/App.d.ts.map +1 -1
- package/dist/README.md +332 -0
- package/dist/components/ui/alert-dialog.d.ts +15 -0
- package/dist/components/ui/alert-dialog.d.ts.map +1 -0
- package/dist/components/ui/alert.d.ts +10 -0
- package/dist/components/ui/alert.d.ts.map +1 -0
- package/dist/components/ui/avatar.d.ts +7 -0
- package/dist/components/ui/avatar.d.ts.map +1 -0
- package/dist/components/ui/breadcrumb.d.ts +12 -0
- package/dist/components/ui/breadcrumb.d.ts.map +1 -0
- package/dist/components/ui/button.d.ts +1 -1
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/card.d.ts +10 -0
- package/dist/components/ui/card.d.ts.map +1 -0
- package/dist/components/ui/chart.d.ts +41 -0
- package/dist/components/ui/chart.d.ts.map +1 -0
- package/dist/components/ui/form.d.ts +25 -0
- package/dist/components/ui/form.d.ts.map +1 -0
- package/dist/components/ui/progress.d.ts +1 -0
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/separator.d.ts +5 -0
- package/dist/components/ui/separator.d.ts.map +1 -0
- package/dist/components/ui/sonner.d.ts +4 -0
- package/dist/components/ui/sonner.d.ts.map +1 -0
- package/dist/components/ui/textarea.d.ts +4 -0
- package/dist/components/ui/textarea.d.ts.map +1 -0
- package/dist/docs/GETTING_STARTED.md +293 -0
- package/dist/docs/TAILWIND_SETUP.md +8 -1
- package/dist/index.d.ts +18 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/mm-react-components.css +1 -0
- package/dist/main.d.ts +0 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/mm-react-components.es.js +11015 -926
- package/dist/mm-react-components.es.js.map +1 -1
- package/dist/mm-react-components.umd.js +27 -9
- package/dist/mm-react-components.umd.js.map +1 -1
- package/dist/preview/AlertDialogPreview.d.ts +2 -0
- package/dist/preview/AlertDialogPreview.d.ts.map +1 -0
- package/dist/preview/AlertPreview.d.ts +2 -0
- package/dist/preview/AlertPreview.d.ts.map +1 -0
- package/dist/preview/AvatarPreview.d.ts +2 -0
- package/dist/preview/AvatarPreview.d.ts.map +1 -0
- package/dist/preview/BreadcrumbPreview.d.ts +2 -0
- package/dist/preview/BreadcrumbPreview.d.ts.map +1 -0
- package/dist/preview/CardPreview.d.ts +2 -0
- package/dist/preview/CardPreview.d.ts.map +1 -0
- package/dist/preview/ChartPreview.d.ts +2 -0
- package/dist/preview/ChartPreview.d.ts.map +1 -0
- package/dist/preview/CheckboxPreview.d.ts.map +1 -1
- package/dist/preview/DataTablePreview.d.ts.map +1 -1
- package/dist/preview/FormPreview.d.ts +2 -0
- package/dist/preview/FormPreview.d.ts.map +1 -0
- package/dist/preview/InputPreview.d.ts.map +1 -1
- package/dist/preview/LabelPreview.d.ts.map +1 -1
- package/dist/preview/RadioGroupPreview.d.ts.map +1 -1
- package/dist/preview/SeparatorPreview.d.ts +2 -0
- package/dist/preview/SeparatorPreview.d.ts.map +1 -0
- package/dist/preview/SonnerPreview.d.ts +2 -0
- package/dist/preview/SonnerPreview.d.ts.map +1 -0
- package/dist/preview/TabsPreview.d.ts.map +1 -1
- package/dist/preview/TextareaPreview.d.ts +2 -0
- package/dist/preview/TextareaPreview.d.ts.map +1 -0
- package/dist/preview/data-table/data-table-preview_column-content.d.ts +1 -1
- package/dist/preview/data-table/data-table-preview_column-content.d.ts.map +1 -1
- package/dist/preview/page-header/PageHeaderPreview.d.ts.map +1 -1
- package/dist/scripts/chakra-to-shadcn-migrator/chakra-to-shadcn.config.json +512 -0
- package/dist/scripts/chakra-to-shadcn-migrator/lib/args.js +63 -0
- package/dist/scripts/chakra-to-shadcn-migrator/lib/colors.js +14 -0
- package/dist/scripts/chakra-to-shadcn-migrator/lib/config.js +15 -0
- package/dist/scripts/chakra-to-shadcn-migrator/lib/deps.js +125 -0
- package/dist/scripts/chakra-to-shadcn-migrator/lib/file-io.js +44 -0
- package/dist/scripts/chakra-to-shadcn-migrator/lib/render.js +89 -0
- package/dist/scripts/chakra-to-shadcn-migrator/lib/transform.js +550 -0
- package/dist/scripts/chakra-to-shadcn-migrator/package.json +11 -0
- package/dist/scripts/init.cjs +207 -0
- package/dist/tailwind.base.config.js +88 -0
- package/dist/themes/carbide.css +187 -32
- package/docs/TAILWIND_SETUP.md +8 -1
- package/package.json +59 -9
- package/src/index.css +99 -498
- package/dist/index.css +0 -536
- package/dist/tailwind.config.export.js +0 -153
- package/scripts/README.md +0 -171
- package/scripts/chakra-to-shadcn-migrator/README.md +0 -107
- package/src/themes/carbide.css +0 -1257
- package/tailwind.config.export.js +0 -153
- /package/{scripts → dist/scripts}/chakra-to-shadcn-migrator/bin/chakra-to-shadcn.js +0 -0
|
@@ -0,0 +1,512 @@
|
|
|
1
|
+
{
|
|
2
|
+
"dependenciesToRemove": [
|
|
3
|
+
"@chakra-ui/react",
|
|
4
|
+
"@chakra-ui/icons",
|
|
5
|
+
"@chakra-ui/system",
|
|
6
|
+
"@emotion/react",
|
|
7
|
+
"@emotion/styled"
|
|
8
|
+
],
|
|
9
|
+
"dependenciesToAdd": {
|
|
10
|
+
"@machinemetrics/mm-react-components": "*"
|
|
11
|
+
},
|
|
12
|
+
"devDependenciesToAdd": {},
|
|
13
|
+
"providerInstructions": [
|
|
14
|
+
"Remove <ChakraProvider> wrapper from your app root (usually in src/index.tsx or src/main.tsx).",
|
|
15
|
+
"Import the pre-compiled CSS: import '@machinemetrics/mm-react-components/styles' in your main CSS file (e.g., src/index.css).",
|
|
16
|
+
"Add the Carbide theme class to your app root element: document.documentElement.classList.add('carbide')",
|
|
17
|
+
"For dark mode support, add both classes: document.documentElement.classList.add('carbide', 'dark')",
|
|
18
|
+
"Remove Chakra-specific theme files and configurations.",
|
|
19
|
+
"No build tools (Tailwind/PostCSS) required - everything is pre-compiled!"
|
|
20
|
+
],
|
|
21
|
+
"manualMigrationComponents": {
|
|
22
|
+
"layoutComponents": [
|
|
23
|
+
"Box → Replace with <div> element and add appropriate Tailwind classes",
|
|
24
|
+
"Flex → Replace with <div className='flex'> and add flex-related Tailwind classes",
|
|
25
|
+
"VStack → Replace with <div className='flex flex-col gap-4'> and adjust spacing as needed",
|
|
26
|
+
"HStack → Replace with <div className='flex flex-row gap-4'> and adjust spacing as needed",
|
|
27
|
+
"Stack → Replace with <div className='flex flex-col gap-4'> and adjust direction/spacing as needed",
|
|
28
|
+
"Container → Replace with <div className='container mx-auto px-4'> and adjust max-width as needed",
|
|
29
|
+
"Center → Replace with <div className='flex items-center justify-center'>",
|
|
30
|
+
"SimpleGrid → Replace with <div className='grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4'> and adjust columns as needed"
|
|
31
|
+
],
|
|
32
|
+
"typographyComponents": [
|
|
33
|
+
"Heading → Replace with semantic heading elements (h1, h2, h3, etc.) and add Tailwind typography classes",
|
|
34
|
+
"Text → Replace with semantic text elements (p, span, etc.) and add Tailwind typography classes"
|
|
35
|
+
],
|
|
36
|
+
"formComponents": [
|
|
37
|
+
"Field → Replace with <div> wrapper and use shadcn/ui form components for inputs",
|
|
38
|
+
"NumberInput → Replace with <input type='number'> and add Tailwind classes, or use shadcn/ui Input component",
|
|
39
|
+
"Slider → Replace with <input type='range'> and add Tailwind classes, or use shadcn/ui Slider component",
|
|
40
|
+
"NativeSelect → Replace with <select> and add Tailwind classes, or use shadcn/ui Select component"
|
|
41
|
+
],
|
|
42
|
+
"uiComponents": [
|
|
43
|
+
"IconButton → Replace with <button> and add icon + Tailwind classes, or use shadcn/ui Button with icon variant",
|
|
44
|
+
"Card → Replace with <div className='rounded-lg border bg-card p-6'> and add shadcn/ui Card component",
|
|
45
|
+
"Alert → Replace with <div className='rounded-md border p-4'> and add shadcn/ui Alert component",
|
|
46
|
+
"Portal → Replace with <div> and use React Portal or shadcn/ui Portal component",
|
|
47
|
+
"Separator → Replace with <hr className='border-t'> and add shadcn/ui Separator component",
|
|
48
|
+
"Progress → Replace with <div className='w-full bg-gray-200 rounded-full h-2'> and add shadcn/ui Progress component",
|
|
49
|
+
"Spinner → Replace with <div className='animate-spin rounded-full h-4 w-4 border-b-2 border-gray-900'> and add shadcn/ui Spinner component",
|
|
50
|
+
"Icon → Replace with Lucide React icons and add appropriate Tailwind classes",
|
|
51
|
+
"Avatar → Replace with shadcn/ui Avatar component",
|
|
52
|
+
"Breadcrumb → Replace with shadcn/ui Breadcrumb component",
|
|
53
|
+
"Calendar → Replace with shadcn/ui Calendar component",
|
|
54
|
+
"DateRangePicker → Replace with shadcn/ui DateRangePicker component",
|
|
55
|
+
"Form → Replace with shadcn/ui Form components (Form, FormField, FormItem, etc.)",
|
|
56
|
+
"Textarea → Replace with shadcn/ui Textarea component",
|
|
57
|
+
"Toaster → Replace with shadcn/ui Toaster component",
|
|
58
|
+
"AlertDialog → Replace with shadcn/ui AlertDialog component",
|
|
59
|
+
"Chart → Replace with shadcn/ui Chart components (ChartContainer, ChartTooltip, etc.)",
|
|
60
|
+
"Dropzone → Replace with shadcn/ui Dropzone component",
|
|
61
|
+
"SearchInput → Replace with shadcn/ui SearchInput component"
|
|
62
|
+
]
|
|
63
|
+
},
|
|
64
|
+
"migrationInstructions": {
|
|
65
|
+
"layoutComponents": [
|
|
66
|
+
"Layout components (Box, Flex, VStack, HStack, Stack, Container, Center, SimpleGrid) are replaced with generic JSX elements and Tailwind CSS classes.",
|
|
67
|
+
"Box → <div> with appropriate Tailwind classes",
|
|
68
|
+
"Flex → <div className='flex'> with flex-related Tailwind classes",
|
|
69
|
+
"VStack → <div className='flex flex-col gap-4'> (adjust spacing as needed)",
|
|
70
|
+
"HStack → <div className='flex flex-row gap-4'> (adjust spacing as needed)",
|
|
71
|
+
"Stack → <div className='flex flex-col gap-4'> (adjust direction/spacing as needed)",
|
|
72
|
+
"Container → <div className='container mx-auto px-4'> (adjust max-width as needed)",
|
|
73
|
+
"Center → <div className='flex items-center justify-center'>",
|
|
74
|
+
"SimpleGrid → <div className='grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4'> (adjust columns as needed)"
|
|
75
|
+
],
|
|
76
|
+
"typographyComponents": [
|
|
77
|
+
"Typography components (Heading, Text) are replaced with semantic HTML elements and Tailwind typography classes.",
|
|
78
|
+
"Heading → <h1>, <h2>, <h3>, etc. with appropriate Tailwind typography classes",
|
|
79
|
+
"Text → <p>, <span>, etc. with appropriate Tailwind typography classes",
|
|
80
|
+
"Use Tailwind's typography scale (text-sm, text-base, text-lg, etc.) for sizing"
|
|
81
|
+
],
|
|
82
|
+
"formComponents": [
|
|
83
|
+
"Form components (Field, NumberInput, Slider, NativeSelect) are replaced with native HTML elements and Tailwind classes.",
|
|
84
|
+
"Field → <div> wrapper with shadcn/ui form components for inputs",
|
|
85
|
+
"NumberInput → <input type='number'> with Tailwind classes, or use shadcn/ui Input",
|
|
86
|
+
"Slider → <input type='range'> with Tailwind classes, or use shadcn/ui Slider",
|
|
87
|
+
"NativeSelect → <select> with Tailwind classes, or use shadcn/ui Select"
|
|
88
|
+
],
|
|
89
|
+
"uiComponents": [
|
|
90
|
+
"UI components (IconButton, Card, Alert, Portal, Separator, Progress, Spinner, Icon, Avatar, Breadcrumb, Calendar, DateRangePicker, Form, Textarea, Toaster, AlertDialog, Chart, Dropzone, SearchInput) are replaced with shadcn/ui components or generic JSX elements and Tailwind classes.",
|
|
91
|
+
"IconButton → <button> with icon + Tailwind classes, or use shadcn/ui Button with icon variant",
|
|
92
|
+
"Card → <div className='rounded-lg border bg-card p-6'> and add shadcn/ui Card component",
|
|
93
|
+
"Alert → <div className='rounded-md border p-4'> and add shadcn/ui Alert component",
|
|
94
|
+
"Portal → <div> and use React Portal or shadcn/ui Portal component",
|
|
95
|
+
"Separator → <hr className='border-t'> and add shadcn/ui Separator component",
|
|
96
|
+
"Progress → <div className='w-full bg-gray-200 rounded-full h-2'> and add shadcn/ui Progress component",
|
|
97
|
+
"Spinner → <div className='animate-spin rounded-full h-4 w-4 border-b-2 border-gray-900'> and add shadcn/ui Spinner component",
|
|
98
|
+
"Icon → Lucide React icons with appropriate Tailwind classes",
|
|
99
|
+
"Avatar → shadcn/ui Avatar component",
|
|
100
|
+
"Breadcrumb → shadcn/ui Breadcrumb component",
|
|
101
|
+
"Calendar → shadcn/ui Calendar component",
|
|
102
|
+
"DateRangePicker → shadcn/ui DateRangePicker component",
|
|
103
|
+
"Form → shadcn/ui Form components (Form, FormField, FormItem, FormLabel, FormControl, FormDescription, FormMessage)",
|
|
104
|
+
"Textarea → shadcn/ui Textarea component",
|
|
105
|
+
"Toaster → shadcn/ui Toaster component",
|
|
106
|
+
"AlertDialog → shadcn/ui AlertDialog component",
|
|
107
|
+
"Chart → shadcn/ui Chart components (ChartContainer, ChartTooltip, ChartTooltipContent, ChartLegend, ChartLegendContent, ChartStyle)",
|
|
108
|
+
"Dropzone → shadcn/ui Dropzone component",
|
|
109
|
+
"SearchInput → shadcn/ui SearchInput component"
|
|
110
|
+
]
|
|
111
|
+
},
|
|
112
|
+
"moduleMappings": {
|
|
113
|
+
"@chakra-ui/react": {
|
|
114
|
+
"jsxSpecifiers": {
|
|
115
|
+
"Box": { "tag": "div", "class": "" },
|
|
116
|
+
"Flex": { "tag": "div", "class": "flex" },
|
|
117
|
+
"VStack": { "tag": "div", "class": "flex flex-col gap-4" },
|
|
118
|
+
"HStack": { "tag": "div", "class": "flex flex-row gap-4" },
|
|
119
|
+
"Stack": { "tag": "div", "class": "flex flex-col gap-4" },
|
|
120
|
+
"Container": { "tag": "div", "class": "container mx-auto px-4" },
|
|
121
|
+
"Center": { "tag": "div", "class": "flex items-center justify-center" },
|
|
122
|
+
"SimpleGrid": { "tag": "div", "class": "grid gap-4" },
|
|
123
|
+
"Heading": { "tag": "h2", "class": "font-semibold" },
|
|
124
|
+
"Text": { "tag": "p", "class": "" },
|
|
125
|
+
"Portal": { "tag": "div", "class": "" },
|
|
126
|
+
"Separator": { "tag": "hr", "class": "border-t" },
|
|
127
|
+
"IconButton": {
|
|
128
|
+
"tag": "button",
|
|
129
|
+
"class": "inline-flex items-center justify-center"
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
"specifiers": {
|
|
133
|
+
"Badge": {
|
|
134
|
+
"module": "@machinemetrics/mm-react-components",
|
|
135
|
+
"import": "Badge"
|
|
136
|
+
},
|
|
137
|
+
"Button": {
|
|
138
|
+
"module": "@machinemetrics/mm-react-components",
|
|
139
|
+
"import": "Button"
|
|
140
|
+
},
|
|
141
|
+
"Modal": {
|
|
142
|
+
"module": "@machinemetrics/mm-react-components",
|
|
143
|
+
"import": "Dialog"
|
|
144
|
+
},
|
|
145
|
+
"Input": {
|
|
146
|
+
"module": "@machinemetrics/mm-react-components",
|
|
147
|
+
"import": "Input"
|
|
148
|
+
},
|
|
149
|
+
"Menu": {
|
|
150
|
+
"module": "@machinemetrics/mm-react-components",
|
|
151
|
+
"import": "DropdownMenu"
|
|
152
|
+
},
|
|
153
|
+
"Select": {
|
|
154
|
+
"module": "@machinemetrics/mm-react-components",
|
|
155
|
+
"import": "Select"
|
|
156
|
+
},
|
|
157
|
+
"Table": {
|
|
158
|
+
"module": "@machinemetrics/mm-react-components",
|
|
159
|
+
"import": "Table"
|
|
160
|
+
},
|
|
161
|
+
"Tabs": {
|
|
162
|
+
"module": "@machinemetrics/mm-react-components",
|
|
163
|
+
"import": "Tabs"
|
|
164
|
+
},
|
|
165
|
+
"Tooltip": {
|
|
166
|
+
"module": "@machinemetrics/mm-react-components",
|
|
167
|
+
"import": "Tooltip"
|
|
168
|
+
},
|
|
169
|
+
"Drawer": {
|
|
170
|
+
"module": "@machinemetrics/mm-react-components",
|
|
171
|
+
"import": "Drawer"
|
|
172
|
+
},
|
|
173
|
+
"Switch": {
|
|
174
|
+
"module": "@machinemetrics/mm-react-components",
|
|
175
|
+
"import": "Switch"
|
|
176
|
+
},
|
|
177
|
+
"Checkbox": {
|
|
178
|
+
"module": "@machinemetrics/mm-react-components",
|
|
179
|
+
"import": "Checkbox"
|
|
180
|
+
},
|
|
181
|
+
"Radio": {
|
|
182
|
+
"module": "@machinemetrics/mm-react-components",
|
|
183
|
+
"import": "RadioGroupItem"
|
|
184
|
+
},
|
|
185
|
+
"RadioGroup": {
|
|
186
|
+
"module": "@machinemetrics/mm-react-components",
|
|
187
|
+
"import": "RadioGroup"
|
|
188
|
+
},
|
|
189
|
+
"Label": {
|
|
190
|
+
"module": "@machinemetrics/mm-react-components",
|
|
191
|
+
"import": "Label"
|
|
192
|
+
},
|
|
193
|
+
"FormLabel": {
|
|
194
|
+
"module": "@machinemetrics/mm-react-components",
|
|
195
|
+
"import": "Label"
|
|
196
|
+
},
|
|
197
|
+
"Sheet": {
|
|
198
|
+
"module": "@machinemetrics/mm-react-components",
|
|
199
|
+
"import": "Sheet"
|
|
200
|
+
},
|
|
201
|
+
"Skeleton": {
|
|
202
|
+
"module": "@machinemetrics/mm-react-components",
|
|
203
|
+
"import": "Skeleton"
|
|
204
|
+
},
|
|
205
|
+
"Collapse": {
|
|
206
|
+
"module": "@machinemetrics/mm-react-components",
|
|
207
|
+
"import": "Collapsible"
|
|
208
|
+
},
|
|
209
|
+
"Collapsible": {
|
|
210
|
+
"module": "@machinemetrics/mm-react-components",
|
|
211
|
+
"import": "Collapsible"
|
|
212
|
+
},
|
|
213
|
+
"Accordion": {
|
|
214
|
+
"module": "@machinemetrics/mm-react-components",
|
|
215
|
+
"import": "Accordion"
|
|
216
|
+
},
|
|
217
|
+
"DataTable": {
|
|
218
|
+
"module": "@machinemetrics/mm-react-components",
|
|
219
|
+
"import": "DataTable"
|
|
220
|
+
},
|
|
221
|
+
"Progress": {
|
|
222
|
+
"module": "@machinemetrics/mm-react-components",
|
|
223
|
+
"import": "Progress"
|
|
224
|
+
},
|
|
225
|
+
"Slider": {
|
|
226
|
+
"module": "@machinemetrics/mm-react-components",
|
|
227
|
+
"import": "Slider"
|
|
228
|
+
},
|
|
229
|
+
"Popover": {
|
|
230
|
+
"module": "@machinemetrics/mm-react-components",
|
|
231
|
+
"import": "Popover"
|
|
232
|
+
},
|
|
233
|
+
"PopoverTrigger": {
|
|
234
|
+
"module": "@machinemetrics/mm-react-components",
|
|
235
|
+
"import": "PopoverTrigger"
|
|
236
|
+
},
|
|
237
|
+
"PopoverContent": {
|
|
238
|
+
"module": "@machinemetrics/mm-react-components",
|
|
239
|
+
"import": "PopoverContent"
|
|
240
|
+
},
|
|
241
|
+
"PopoverAnchor": {
|
|
242
|
+
"module": "@machinemetrics/mm-react-components",
|
|
243
|
+
"import": "PopoverAnchor"
|
|
244
|
+
},
|
|
245
|
+
"ModalOverlay": {
|
|
246
|
+
"module": "@machinemetrics/mm-react-components",
|
|
247
|
+
"import": "DialogOverlay"
|
|
248
|
+
},
|
|
249
|
+
"ModalContent": {
|
|
250
|
+
"module": "@machinemetrics/mm-react-components",
|
|
251
|
+
"import": "DialogContent"
|
|
252
|
+
},
|
|
253
|
+
"ModalHeader": {
|
|
254
|
+
"module": "@machinemetrics/mm-react-components",
|
|
255
|
+
"import": "DialogHeader"
|
|
256
|
+
},
|
|
257
|
+
"ModalFooter": {
|
|
258
|
+
"module": "@machinemetrics/mm-react-components",
|
|
259
|
+
"import": "DialogFooter"
|
|
260
|
+
},
|
|
261
|
+
"ModalBody": {
|
|
262
|
+
"module": "@machinemetrics/mm-react-components",
|
|
263
|
+
"import": "DialogContent"
|
|
264
|
+
},
|
|
265
|
+
"DrawerOverlay": {
|
|
266
|
+
"module": "@machinemetrics/mm-react-components",
|
|
267
|
+
"import": "DrawerOverlay"
|
|
268
|
+
},
|
|
269
|
+
"DrawerContent": {
|
|
270
|
+
"module": "@machinemetrics/mm-react-components",
|
|
271
|
+
"import": "DrawerContent"
|
|
272
|
+
},
|
|
273
|
+
"DrawerHeader": {
|
|
274
|
+
"module": "@machinemetrics/mm-react-components",
|
|
275
|
+
"import": "DrawerHeader"
|
|
276
|
+
},
|
|
277
|
+
"DrawerFooter": {
|
|
278
|
+
"module": "@machinemetrics/mm-react-components",
|
|
279
|
+
"import": "DrawerFooter"
|
|
280
|
+
},
|
|
281
|
+
"DrawerCloseButton": {
|
|
282
|
+
"module": "@machinemetrics/mm-react-components",
|
|
283
|
+
"import": "DrawerClose"
|
|
284
|
+
},
|
|
285
|
+
"AccordionItem": {
|
|
286
|
+
"module": "@machinemetrics/mm-react-components",
|
|
287
|
+
"import": "AccordionItem"
|
|
288
|
+
},
|
|
289
|
+
"AccordionButton": {
|
|
290
|
+
"module": "@machinemetrics/mm-react-components",
|
|
291
|
+
"import": "AccordionTrigger"
|
|
292
|
+
},
|
|
293
|
+
"AccordionPanel": {
|
|
294
|
+
"module": "@machinemetrics/mm-react-components",
|
|
295
|
+
"import": "AccordionContent"
|
|
296
|
+
},
|
|
297
|
+
"Alert": {
|
|
298
|
+
"module": "@machinemetrics/mm-react-components",
|
|
299
|
+
"import": "Alert"
|
|
300
|
+
},
|
|
301
|
+
"AlertDialog": {
|
|
302
|
+
"module": "@machinemetrics/mm-react-components",
|
|
303
|
+
"import": "AlertDialog"
|
|
304
|
+
},
|
|
305
|
+
"Avatar": {
|
|
306
|
+
"module": "@machinemetrics/mm-react-components",
|
|
307
|
+
"import": "Avatar"
|
|
308
|
+
},
|
|
309
|
+
"Breadcrumb": {
|
|
310
|
+
"module": "@machinemetrics/mm-react-components",
|
|
311
|
+
"import": "Breadcrumb"
|
|
312
|
+
},
|
|
313
|
+
"Calendar": {
|
|
314
|
+
"module": "@machinemetrics/mm-react-components",
|
|
315
|
+
"import": "Calendar"
|
|
316
|
+
},
|
|
317
|
+
"DateRangePicker": {
|
|
318
|
+
"module": "@machinemetrics/mm-react-components",
|
|
319
|
+
"import": "DateRangePicker"
|
|
320
|
+
},
|
|
321
|
+
"Form": {
|
|
322
|
+
"module": "@machinemetrics/mm-react-components",
|
|
323
|
+
"import": "Form"
|
|
324
|
+
},
|
|
325
|
+
"FormField": {
|
|
326
|
+
"module": "@machinemetrics/mm-react-components",
|
|
327
|
+
"import": "FormField"
|
|
328
|
+
},
|
|
329
|
+
"FormItem": {
|
|
330
|
+
"module": "@machinemetrics/mm-react-components",
|
|
331
|
+
"import": "FormItem"
|
|
332
|
+
},
|
|
333
|
+
"FormControl": {
|
|
334
|
+
"module": "@machinemetrics/mm-react-components",
|
|
335
|
+
"import": "FormControl"
|
|
336
|
+
},
|
|
337
|
+
"FormDescription": {
|
|
338
|
+
"module": "@machinemetrics/mm-react-components",
|
|
339
|
+
"import": "FormDescription"
|
|
340
|
+
},
|
|
341
|
+
"FormMessage": {
|
|
342
|
+
"module": "@machinemetrics/mm-react-components",
|
|
343
|
+
"import": "FormMessage"
|
|
344
|
+
},
|
|
345
|
+
"Separator": {
|
|
346
|
+
"module": "@machinemetrics/mm-react-components",
|
|
347
|
+
"import": "Separator"
|
|
348
|
+
},
|
|
349
|
+
"Textarea": {
|
|
350
|
+
"module": "@machinemetrics/mm-react-components",
|
|
351
|
+
"import": "Textarea"
|
|
352
|
+
},
|
|
353
|
+
"Toaster": {
|
|
354
|
+
"module": "@machinemetrics/mm-react-components",
|
|
355
|
+
"import": "Toaster"
|
|
356
|
+
},
|
|
357
|
+
"ChartContainer": {
|
|
358
|
+
"module": "@machinemetrics/mm-react-components",
|
|
359
|
+
"import": "ChartContainer"
|
|
360
|
+
},
|
|
361
|
+
"ChartTooltip": {
|
|
362
|
+
"module": "@machinemetrics/mm-react-components",
|
|
363
|
+
"import": "ChartTooltip"
|
|
364
|
+
},
|
|
365
|
+
"ChartTooltipContent": {
|
|
366
|
+
"module": "@machinemetrics/mm-react-components",
|
|
367
|
+
"import": "ChartTooltipContent"
|
|
368
|
+
},
|
|
369
|
+
"ChartLegend": {
|
|
370
|
+
"module": "@machinemetrics/mm-react-components",
|
|
371
|
+
"import": "ChartLegend"
|
|
372
|
+
},
|
|
373
|
+
"ChartLegendContent": {
|
|
374
|
+
"module": "@machinemetrics/mm-react-components",
|
|
375
|
+
"import": "ChartLegendContent"
|
|
376
|
+
},
|
|
377
|
+
"ChartStyle": {
|
|
378
|
+
"module": "@machinemetrics/mm-react-components",
|
|
379
|
+
"import": "ChartStyle"
|
|
380
|
+
},
|
|
381
|
+
"Dropzone": {
|
|
382
|
+
"module": "@machinemetrics/mm-react-components",
|
|
383
|
+
"import": "Dropzone"
|
|
384
|
+
},
|
|
385
|
+
"DropzoneContent": {
|
|
386
|
+
"module": "@machinemetrics/mm-react-components",
|
|
387
|
+
"import": "DropzoneContent"
|
|
388
|
+
},
|
|
389
|
+
"DropzoneEmptyState": {
|
|
390
|
+
"module": "@machinemetrics/mm-react-components",
|
|
391
|
+
"import": "DropzoneEmptyState"
|
|
392
|
+
},
|
|
393
|
+
"SearchInput": {
|
|
394
|
+
"module": "@machinemetrics/mm-react-components",
|
|
395
|
+
"import": "SearchInput"
|
|
396
|
+
},
|
|
397
|
+
"LabeledSlider": {
|
|
398
|
+
"module": "@machinemetrics/mm-react-components",
|
|
399
|
+
"import": "LabeledSlider"
|
|
400
|
+
}
|
|
401
|
+
},
|
|
402
|
+
"compoundComponents": {
|
|
403
|
+
"Alert.Root": { "tag": "div", "class": "rounded-md border p-4" },
|
|
404
|
+
"Alert.Indicator": { "remove": true },
|
|
405
|
+
"Alert.Content": { "tag": "div", "class": "flex-1" },
|
|
406
|
+
"Alert.Title": { "tag": "h5", "class": "font-medium mb-1" },
|
|
407
|
+
"Alert.Description": { "tag": "div", "class": "text-sm" },
|
|
408
|
+
"Modal": { "component": "Dialog" },
|
|
409
|
+
"Dialog.Root": { "component": "Dialog" },
|
|
410
|
+
"Dialog.Backdrop": { "remove": true },
|
|
411
|
+
"Dialog.Positioner": { "unwrap": true },
|
|
412
|
+
"Dialog.Content": { "component": "DialogContent" },
|
|
413
|
+
"Dialog.Header": { "component": "DialogHeader" },
|
|
414
|
+
"Dialog.Title": { "component": "DialogTitle" },
|
|
415
|
+
"Dialog.Description": { "component": "DialogDescription" },
|
|
416
|
+
"Dialog.Body": { "unwrap": true },
|
|
417
|
+
"Dialog.Footer": { "component": "DialogFooter" },
|
|
418
|
+
"Dialog.CloseTrigger": { "component": "DialogClose" },
|
|
419
|
+
"Drawer.Root": { "component": "Drawer" },
|
|
420
|
+
"Drawer.Trigger": { "component": "DrawerTrigger" },
|
|
421
|
+
"Drawer.CloseTrigger": { "component": "DrawerClose" },
|
|
422
|
+
"Drawer.Portal": { "component": "DrawerPortal" },
|
|
423
|
+
"Drawer.Overlay": { "component": "DrawerOverlay" },
|
|
424
|
+
"Drawer.Content": { "component": "DrawerContent" },
|
|
425
|
+
"Drawer.Header": { "component": "DrawerHeader" },
|
|
426
|
+
"Drawer.Footer": { "component": "DrawerFooter" },
|
|
427
|
+
"Drawer.Title": { "component": "DrawerTitle" },
|
|
428
|
+
"Drawer.Description": { "component": "DrawerDescription" },
|
|
429
|
+
"Drawer.Handle": { "component": "DrawerHandle" },
|
|
430
|
+
"Collapse": { "component": "Collapsible" },
|
|
431
|
+
"Accordion.Root": { "component": "Accordion" },
|
|
432
|
+
"Accordion.Item": { "component": "AccordionItem" },
|
|
433
|
+
"Accordion.Trigger": { "component": "AccordionTrigger" },
|
|
434
|
+
"Accordion.Content": { "component": "AccordionContent" },
|
|
435
|
+
"Tabs.Root": { "component": "Tabs" },
|
|
436
|
+
"Tabs.List": { "component": "TabsList" },
|
|
437
|
+
"Tabs.Trigger": { "component": "TabsTrigger" },
|
|
438
|
+
"Tabs.Content": { "component": "TabsContent" },
|
|
439
|
+
"Tabs.Indicator": { "remove": true },
|
|
440
|
+
"Table.Root": { "component": "Table" },
|
|
441
|
+
"Table.Header": { "component": "TableHeader" },
|
|
442
|
+
"Table.Body": { "component": "TableBody" },
|
|
443
|
+
"Table.Row": { "component": "TableRow" },
|
|
444
|
+
"Table.ColumnHeader": { "component": "TableHead" },
|
|
445
|
+
"Table.Cell": { "component": "TableCell" },
|
|
446
|
+
"Table.Footer": { "component": "TableFooter" },
|
|
447
|
+
"Menu.Root": { "component": "DropdownMenu" },
|
|
448
|
+
"Menu.Trigger": { "component": "DropdownMenuTrigger" },
|
|
449
|
+
"Menu.Content": { "component": "DropdownMenuContent" },
|
|
450
|
+
"Menu.Item": { "component": "DropdownMenuItem" },
|
|
451
|
+
"Menu.Separator": { "component": "DropdownMenuSeparator" },
|
|
452
|
+
"Menu.ItemGroup": { "unwrap": true },
|
|
453
|
+
"Menu.ItemGroupLabel": { "component": "DropdownMenuLabel" },
|
|
454
|
+
"Popover.Root": { "component": "Popover" },
|
|
455
|
+
"Popover.Trigger": { "component": "PopoverTrigger" },
|
|
456
|
+
"Popover.Content": { "component": "PopoverContent" },
|
|
457
|
+
"Popover.Anchor": { "component": "PopoverAnchor" },
|
|
458
|
+
"AlertDialog.Root": { "component": "AlertDialog" },
|
|
459
|
+
"AlertDialog.Trigger": { "component": "AlertDialogTrigger" },
|
|
460
|
+
"AlertDialog.Content": { "component": "AlertDialogContent" },
|
|
461
|
+
"AlertDialog.Header": { "component": "AlertDialogHeader" },
|
|
462
|
+
"AlertDialog.Footer": { "component": "AlertDialogFooter" },
|
|
463
|
+
"AlertDialog.Title": { "component": "AlertDialogTitle" },
|
|
464
|
+
"AlertDialog.Description": { "component": "AlertDialogDescription" },
|
|
465
|
+
"AlertDialog.Action": { "component": "AlertDialogAction" },
|
|
466
|
+
"AlertDialog.Cancel": { "component": "AlertDialogCancel" },
|
|
467
|
+
"AlertDialog.Overlay": { "component": "AlertDialogOverlay" },
|
|
468
|
+
"AlertDialog.Portal": { "component": "AlertDialogPortal" },
|
|
469
|
+
"Avatar.Root": { "component": "Avatar" },
|
|
470
|
+
"Avatar.Image": { "component": "AvatarImage" },
|
|
471
|
+
"Avatar.Fallback": { "component": "AvatarFallback" },
|
|
472
|
+
"Breadcrumb.Root": { "component": "Breadcrumb" },
|
|
473
|
+
"Breadcrumb.List": { "component": "BreadcrumbList" },
|
|
474
|
+
"Breadcrumb.Item": { "component": "BreadcrumbItem" },
|
|
475
|
+
"Breadcrumb.Link": { "component": "BreadcrumbLink" },
|
|
476
|
+
"Breadcrumb.Page": { "component": "BreadcrumbPage" },
|
|
477
|
+
"Breadcrumb.Separator": { "component": "BreadcrumbSeparator" },
|
|
478
|
+
"Breadcrumb.Ellipsis": { "component": "BreadcrumbEllipsis" },
|
|
479
|
+
"Card.Root": { "component": "Card" },
|
|
480
|
+
"Card.Header": { "component": "CardHeader" },
|
|
481
|
+
"Card.Title": { "component": "CardTitle" },
|
|
482
|
+
"Card.Description": { "component": "CardDescription" },
|
|
483
|
+
"Card.Content": { "component": "CardContent" },
|
|
484
|
+
"Card.Footer": { "component": "CardFooter" },
|
|
485
|
+
"Form.Root": { "component": "Form" },
|
|
486
|
+
"Form.Field": { "component": "FormField" },
|
|
487
|
+
"Form.Item": { "component": "FormItem" },
|
|
488
|
+
"Form.Label": { "component": "FormLabel" },
|
|
489
|
+
"Form.Control": { "component": "FormControl" },
|
|
490
|
+
"Form.Description": { "component": "FormDescription" },
|
|
491
|
+
"Form.Message": { "component": "FormMessage" }
|
|
492
|
+
}
|
|
493
|
+
},
|
|
494
|
+
"@chakra-ui/icons": {
|
|
495
|
+
"default": {
|
|
496
|
+
"module": "lucide-react"
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
},
|
|
500
|
+
"postSteps": [
|
|
501
|
+
"Run npm install to install @machinemetrics/mm-react-components.",
|
|
502
|
+
"MANUAL MIGRATION REQUIRED: Replace the following Chakra components with generic JSX elements + Tailwind classes:",
|
|
503
|
+
" - Layout: Box, Flex, VStack, HStack, Stack, Container, Center, SimpleGrid",
|
|
504
|
+
" - Typography: Heading, Text",
|
|
505
|
+
" - Form: Field, NumberInput, Slider, NativeSelect",
|
|
506
|
+
" - UI: IconButton, Card, Alert, Portal, Separator, Progress, Spinner, Icon, Avatar, Breadcrumb, Calendar, DateRangePicker, Form, Textarea, Toaster, AlertDialog, Chart, Dropzone, SearchInput",
|
|
507
|
+
"See the manualMigrationComponents section in the config for specific replacement instructions.",
|
|
508
|
+
"Test all migrated components to ensure proper styling and functionality.",
|
|
509
|
+
"Run npm run lint && npm run test to verify the migration.",
|
|
510
|
+
"💡 Zero-config reminder: No Tailwind setup needed - everything is pre-compiled!"
|
|
511
|
+
]
|
|
512
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import process from 'process';
|
|
2
|
+
import { colorize } from './colors.js';
|
|
3
|
+
|
|
4
|
+
export function parseArgs(argv) {
|
|
5
|
+
const args = { project: '.', apply: false, includeTests: false, source: [] };
|
|
6
|
+
const tokens = [...argv];
|
|
7
|
+
while (tokens.length) {
|
|
8
|
+
const token = tokens.shift();
|
|
9
|
+
switch (token) {
|
|
10
|
+
case '--project':
|
|
11
|
+
case '-p':
|
|
12
|
+
args.project = tokens.shift() ?? args.project;
|
|
13
|
+
break;
|
|
14
|
+
case '--config':
|
|
15
|
+
case '-c':
|
|
16
|
+
args.config = tokens.shift();
|
|
17
|
+
break;
|
|
18
|
+
case '--apply':
|
|
19
|
+
args.apply = true;
|
|
20
|
+
break;
|
|
21
|
+
case '--include-tests':
|
|
22
|
+
args.includeTests = true;
|
|
23
|
+
break;
|
|
24
|
+
case '--source': {
|
|
25
|
+
const next = tokens.shift();
|
|
26
|
+
if (!next) {
|
|
27
|
+
throw new Error(
|
|
28
|
+
'--source requires a comma separated list of directories or glob patterns.',
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
args.source = next
|
|
32
|
+
.split(',')
|
|
33
|
+
.map((segment) => segment.trim())
|
|
34
|
+
.filter(Boolean);
|
|
35
|
+
break;
|
|
36
|
+
}
|
|
37
|
+
case '--help':
|
|
38
|
+
case '-h':
|
|
39
|
+
printHelp();
|
|
40
|
+
process.exit(0);
|
|
41
|
+
break;
|
|
42
|
+
default:
|
|
43
|
+
if (token.startsWith('--')) {
|
|
44
|
+
console.warn(colorize(`Warning: unknown option ${token}`, 'yellow'));
|
|
45
|
+
}
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return args;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export function printHelp() {
|
|
53
|
+
console.log(
|
|
54
|
+
`chakra-to-shadcn [options]\n\n` +
|
|
55
|
+
`Options:\n` +
|
|
56
|
+
` -p, --project <path> Project root (defaults to current directory)\n` +
|
|
57
|
+
` -c, --config <path> Path to chakra-to-shadcn.config.json\n` +
|
|
58
|
+
` --apply Apply safe automated edits\n` +
|
|
59
|
+
` --include-tests Include __tests__/ and *.test.* files while scanning\n` +
|
|
60
|
+
` --source <globs> Comma separated list of folders/globs to scan\n` +
|
|
61
|
+
` -h, --help Show this message\n`,
|
|
62
|
+
);
|
|
63
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export const colors = {
|
|
2
|
+
reset: '\u001b[0m',
|
|
3
|
+
cyan: '\u001b[36m',
|
|
4
|
+
green: '\u001b[32m',
|
|
5
|
+
yellow: '\u001b[33m',
|
|
6
|
+
red: '\u001b[31m',
|
|
7
|
+
bold: '\u001b[1m',
|
|
8
|
+
gray: '\u001b[90m',
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export const colorize = (value, color) =>
|
|
12
|
+
`${colors[color] ?? ''}${value}${colors.reset}`;
|
|
13
|
+
|
|
14
|
+
export const bold = (value) => `${colors.bold}${value}${colors.reset}`;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
|
|
4
|
+
export function resolveConfig(projectRoot, override) {
|
|
5
|
+
if (override) {
|
|
6
|
+
const explicit = path.resolve(process.cwd(), override);
|
|
7
|
+
return fs.existsSync(explicit) ? explicit : undefined;
|
|
8
|
+
}
|
|
9
|
+
const defaultPath = path.join(projectRoot, 'chakra-to-shadcn.config.json');
|
|
10
|
+
return fs.existsSync(defaultPath) ? defaultPath : undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function loadJson(file) {
|
|
14
|
+
return JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
15
|
+
}
|