@machinemetrics/mm-react-components 0.2.3-3 → 0.2.3-31
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 +90 -31
- package/agent-docs/agent-documentation-reference.md +401 -0
- package/agent-docs/ai-agent-guide.md +558 -0
- package/agent-docs/ai-agent-init-guide.md +465 -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 +90 -31
- package/dist/components/shadcn/accordion.d.ts +8 -0
- package/dist/components/shadcn/accordion.d.ts.map +1 -0
- package/dist/components/shadcn/alert-dialog.d.ts +15 -0
- package/dist/components/shadcn/alert-dialog.d.ts.map +1 -0
- package/dist/components/shadcn/alert.d.ts +10 -0
- package/dist/components/shadcn/alert.d.ts.map +1 -0
- package/dist/components/shadcn/avatar.d.ts +7 -0
- package/dist/components/shadcn/avatar.d.ts.map +1 -0
- package/dist/components/shadcn/badge.d.ts +10 -0
- package/dist/components/shadcn/badge.d.ts.map +1 -0
- package/dist/components/shadcn/breadcrumb.d.ts +12 -0
- package/dist/components/shadcn/breadcrumb.d.ts.map +1 -0
- package/dist/components/shadcn/button.d.ts +11 -0
- package/dist/components/shadcn/button.d.ts.map +1 -0
- package/dist/components/shadcn/calendar.d.ts +9 -0
- package/dist/components/shadcn/calendar.d.ts.map +1 -0
- package/dist/components/shadcn/card.d.ts +10 -0
- package/dist/components/shadcn/card.d.ts.map +1 -0
- package/dist/components/shadcn/chart.d.ts +41 -0
- package/dist/components/shadcn/chart.d.ts.map +1 -0
- package/dist/components/shadcn/checkbox.d.ts +5 -0
- package/dist/components/shadcn/checkbox.d.ts.map +1 -0
- package/dist/components/shadcn/collapsible.d.ts +7 -0
- package/dist/components/shadcn/collapsible.d.ts.map +1 -0
- package/dist/components/shadcn/command.d.ts +19 -0
- package/dist/components/shadcn/command.d.ts.map +1 -0
- package/dist/components/shadcn/dialog.d.ts +16 -0
- package/dist/components/shadcn/dialog.d.ts.map +1 -0
- package/dist/components/shadcn/drawer.d.ts +14 -0
- package/dist/components/shadcn/drawer.d.ts.map +1 -0
- package/dist/components/shadcn/dropdown-menu.d.ts +26 -0
- package/dist/components/shadcn/dropdown-menu.d.ts.map +1 -0
- package/dist/components/shadcn/form.d.ts +25 -0
- package/dist/components/shadcn/form.d.ts.map +1 -0
- package/dist/components/shadcn/input.d.ts +4 -0
- package/dist/components/shadcn/input.d.ts.map +1 -0
- package/dist/components/shadcn/label.d.ts +5 -0
- package/dist/components/shadcn/label.d.ts.map +1 -0
- package/dist/components/shadcn/pagination.d.ts +14 -0
- package/dist/components/shadcn/pagination.d.ts.map +1 -0
- package/dist/components/shadcn/popover.d.ts +8 -0
- package/dist/components/shadcn/popover.d.ts.map +1 -0
- package/dist/components/shadcn/progress.d.ts +5 -0
- package/dist/components/shadcn/progress.d.ts.map +1 -0
- package/dist/components/shadcn/radio-group.d.ts +6 -0
- package/dist/components/shadcn/radio-group.d.ts.map +1 -0
- package/dist/components/shadcn/select.d.ts +16 -0
- package/dist/components/shadcn/select.d.ts.map +1 -0
- package/dist/components/shadcn/separator.d.ts +5 -0
- package/dist/components/shadcn/separator.d.ts.map +1 -0
- package/dist/components/shadcn/sheet.d.ts +14 -0
- package/dist/components/shadcn/sheet.d.ts.map +1 -0
- package/dist/components/shadcn/skeleton.d.ts +4 -0
- package/dist/components/shadcn/skeleton.d.ts.map +1 -0
- package/dist/components/shadcn/slider.d.ts +5 -0
- package/dist/components/shadcn/slider.d.ts.map +1 -0
- package/dist/components/shadcn/sonner.d.ts +4 -0
- package/dist/components/shadcn/sonner.d.ts.map +1 -0
- package/dist/components/shadcn/spinner.d.ts +4 -0
- package/dist/components/shadcn/spinner.d.ts.map +1 -0
- package/dist/components/shadcn/switch.d.ts +5 -0
- package/dist/components/shadcn/switch.d.ts.map +1 -0
- package/dist/components/shadcn/table.d.ts +11 -0
- package/dist/components/shadcn/table.d.ts.map +1 -0
- package/dist/components/shadcn/tabs.d.ts +8 -0
- package/dist/components/shadcn/tabs.d.ts.map +1 -0
- package/dist/components/shadcn/textarea.d.ts +4 -0
- package/dist/components/shadcn/textarea.d.ts.map +1 -0
- package/dist/components/shadcn/toggle.d.ts +10 -0
- package/dist/components/shadcn/toggle.d.ts.map +1 -0
- package/dist/components/shadcn/tooltip.d.ts +8 -0
- package/dist/components/shadcn/tooltip.d.ts.map +1 -0
- package/dist/components/ui/accordion.d.ts +5 -6
- package/dist/components/ui/accordion.d.ts.map +1 -1
- package/dist/components/ui/alert-dialog.d.ts +7 -11
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/alert.d.ts +8 -5
- package/dist/components/ui/alert.d.ts.map +1 -1
- package/dist/components/ui/avatar.d.ts +1 -6
- package/dist/components/ui/avatar.d.ts.map +1 -1
- package/dist/components/ui/badge.d.ts +4 -3
- package/dist/components/ui/badge.d.ts.map +1 -1
- package/dist/components/ui/breadcrumb.d.ts +1 -11
- package/dist/components/ui/breadcrumb.d.ts.map +1 -1
- package/dist/components/ui/button.d.ts +6 -6
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/calendar.d.ts +1 -1
- package/dist/components/ui/calendar.d.ts.map +1 -1
- package/dist/components/ui/card.d.ts +1 -9
- package/dist/components/ui/card.d.ts.map +1 -1
- package/dist/components/ui/checkbox.d.ts +1 -1
- package/dist/components/ui/checkbox.d.ts.map +1 -1
- package/dist/components/ui/collapsible.d.ts +1 -6
- package/dist/components/ui/collapsible.d.ts.map +1 -1
- package/dist/components/ui/command.d.ts +19 -0
- package/dist/components/ui/command.d.ts.map +1 -0
- package/dist/components/ui/data-table/TableView.d.ts +2 -1
- package/dist/components/ui/data-table/TableView.d.ts.map +1 -1
- package/dist/components/ui/data-table/cards/ResponsiveTable.d.ts +1 -1
- package/dist/components/ui/data-table/cards/ResponsiveTable.d.ts.map +1 -1
- package/dist/components/ui/data-table/cards/RowCard.d.ts +2 -1
- package/dist/components/ui/data-table/cards/RowCard.d.ts.map +1 -1
- package/dist/components/ui/data-table/index.d.ts +3 -1
- package/dist/components/ui/data-table/index.d.ts.map +1 -1
- package/dist/components/ui/data-table/pagination.d.ts +14 -1
- package/dist/components/ui/data-table/pagination.d.ts.map +1 -1
- package/dist/components/ui/data-table/parts/BatchActionsToolbar.d.ts +7 -0
- package/dist/components/ui/data-table/parts/BatchActionsToolbar.d.ts.map +1 -0
- package/dist/components/ui/data-table/parts/CellContent.d.ts +7 -0
- package/dist/components/ui/data-table/parts/CellContent.d.ts.map +1 -0
- package/dist/components/ui/data-table/parts/ColGroup.d.ts +7 -0
- package/dist/components/ui/data-table/parts/ColGroup.d.ts.map +1 -0
- package/dist/components/ui/data-table/parts/SortableHeader.d.ts +13 -0
- package/dist/components/ui/data-table/parts/SortableHeader.d.ts.map +1 -0
- package/dist/components/ui/data-table/parts/TableBody.d.ts +22 -0
- package/dist/components/ui/data-table/parts/TableBody.d.ts.map +1 -0
- package/dist/components/ui/data-table/parts/TableHeader.d.ts +15 -0
- package/dist/components/ui/data-table/parts/TableHeader.d.ts.map +1 -0
- package/dist/components/ui/data-table/toolbar/DataTableToolbar.d.ts +2 -1
- package/dist/components/ui/data-table/toolbar/DataTableToolbar.d.ts.map +1 -1
- package/dist/components/ui/data-table/types.d.ts +61 -11
- package/dist/components/ui/data-table/types.d.ts.map +1 -1
- package/dist/components/ui/data-table/useDragAndDrop.d.ts +23 -0
- package/dist/components/ui/data-table/useDragAndDrop.d.ts.map +1 -0
- package/dist/components/ui/data-table/useTableController.d.ts +24 -1
- package/dist/components/ui/data-table/useTableController.d.ts.map +1 -1
- package/dist/components/ui/data-table/utils.d.ts +2 -0
- package/dist/components/ui/data-table/utils.d.ts.map +1 -1
- package/dist/components/ui/date-picker.d.ts +36 -0
- package/dist/components/ui/date-picker.d.ts.map +1 -0
- package/dist/components/ui/dialog.d.ts +6 -10
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/drawer.d.ts +3 -11
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/dropdown-menu.d.ts +15 -23
- package/dist/components/ui/dropdown-menu.d.ts.map +1 -1
- package/dist/components/ui/hero-metric-card/HeroMetricCard.d.ts +4 -0
- package/dist/components/ui/hero-metric-card/HeroMetricCard.d.ts.map +1 -0
- package/dist/components/ui/hero-metric-card/HeroMetricCardItem.d.ts +4 -0
- package/dist/components/ui/hero-metric-card/HeroMetricCardItem.d.ts.map +1 -0
- package/dist/components/ui/hero-metric-card/constants.d.ts +13 -0
- package/dist/components/ui/hero-metric-card/constants.d.ts.map +1 -0
- package/dist/components/ui/hero-metric-card/grid.d.ts +4 -0
- package/dist/components/ui/hero-metric-card/grid.d.ts.map +1 -0
- package/dist/components/ui/hero-metric-card/hooks.d.ts +6 -0
- package/dist/components/ui/hero-metric-card/hooks.d.ts.map +1 -0
- package/dist/components/ui/hero-metric-card/index.d.ts +5 -0
- package/dist/components/ui/hero-metric-card/index.d.ts.map +1 -0
- package/dist/components/ui/hero-metric-card/parsing.d.ts +11 -0
- package/dist/components/ui/hero-metric-card/parsing.d.ts.map +1 -0
- package/dist/components/ui/hero-metric-card/refs.d.ts +3 -0
- package/dist/components/ui/hero-metric-card/refs.d.ts.map +1 -0
- package/dist/components/ui/hero-metric-card/trend.d.ts +4 -0
- package/dist/components/ui/hero-metric-card/trend.d.ts.map +1 -0
- package/dist/components/ui/hero-metric-card/types.d.ts +60 -0
- package/dist/components/ui/hero-metric-card/types.d.ts.map +1 -0
- package/dist/components/ui/hero-metric-card/utils.d.ts +10 -0
- package/dist/components/ui/hero-metric-card/utils.d.ts.map +1 -0
- package/dist/components/ui/input.d.ts +3 -2
- package/dist/components/ui/input.d.ts.map +1 -1
- package/dist/components/ui/label.d.ts +1 -4
- package/dist/components/ui/label.d.ts.map +1 -1
- package/dist/components/ui/pagination.d.ts +14 -0
- package/dist/components/ui/pagination.d.ts.map +1 -0
- package/dist/components/ui/popover.d.ts +3 -5
- package/dist/components/ui/popover.d.ts.map +1 -1
- package/dist/components/ui/progress.d.ts +2 -1
- package/dist/components/ui/progress.d.ts.map +1 -1
- package/dist/components/ui/radio-group.d.ts +3 -3
- package/dist/components/ui/radio-group.d.ts.map +1 -1
- package/dist/components/ui/select.d.ts +6 -13
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/separator.d.ts +1 -4
- package/dist/components/ui/separator.d.ts.map +1 -1
- package/dist/components/ui/sheet-banner.d.ts +10 -0
- package/dist/components/ui/sheet-banner.d.ts.map +1 -0
- package/dist/components/ui/sheet.d.ts +18 -9
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/simple-pagination.d.ts +8 -0
- package/dist/components/ui/simple-pagination.d.ts.map +1 -0
- package/dist/components/ui/skeleton.d.ts +1 -3
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/components/ui/sonner.d.ts +2 -1
- package/dist/components/ui/sonner.d.ts.map +1 -1
- package/dist/components/ui/spinner-carbide.d.ts +5 -0
- package/dist/components/ui/spinner-carbide.d.ts.map +1 -0
- package/dist/components/ui/spinner.d.ts +2 -0
- package/dist/components/ui/spinner.d.ts.map +1 -0
- package/dist/components/ui/switch.d.ts +1 -1
- package/dist/components/ui/switch.d.ts.map +1 -1
- package/dist/components/ui/table/Table.d.ts.map +1 -1
- package/dist/components/ui/table.d.ts +4 -9
- package/dist/components/ui/table.d.ts.map +1 -1
- package/dist/components/ui/tabs.d.ts +16 -2
- package/dist/components/ui/tabs.d.ts.map +1 -1
- package/dist/components/ui/textarea.d.ts +1 -3
- package/dist/components/ui/textarea.d.ts.map +1 -1
- package/dist/components/ui/toggle.d.ts +1 -9
- package/dist/components/ui/toggle.d.ts.map +1 -1
- package/dist/components/ui/tooltip.d.ts +1 -7
- package/dist/components/ui/tooltip.d.ts.map +1 -1
- package/dist/docs/GETTING_STARTED.md +14 -6
- package/dist/docs/TAILWIND_SETUP.md +5 -1
- package/dist/index.d.ts +16 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/lib/fonts/inconsolata-latin-400-normal.7bb81ff1.woff +0 -0
- package/dist/lib/fonts/inconsolata-latin-400-normal.eb50e0cc.woff2 +0 -0
- package/dist/lib/fonts/inconsolata-latin-ext-400-normal.8c9bd94c.woff +0 -0
- package/dist/lib/fonts/inconsolata-latin-ext-400-normal.e91396bf.woff2 +0 -0
- package/dist/lib/fonts/inconsolata-vietnamese-400-normal.0fdec2a6.woff +0 -0
- package/dist/lib/fonts/inconsolata-vietnamese-400-normal.788ea873.woff2 +0 -0
- package/dist/lib/fonts/noto-sans-cyrillic-ext-wght-normal.ced7f40b.woff2 +0 -0
- package/dist/lib/fonts/noto-sans-cyrillic-wght-normal.56471747.woff2 +0 -0
- package/dist/lib/fonts/noto-sans-devanagari-wght-normal.90412b4c.woff2 +0 -0
- package/dist/lib/fonts/noto-sans-greek-ext-wght-normal.6a0bbd3e.woff2 +0 -0
- package/dist/lib/fonts/noto-sans-greek-wght-normal.dc06dc3b.woff2 +0 -0
- package/dist/lib/fonts/noto-sans-latin-ext-wght-normal.15bcee04.woff2 +0 -0
- package/dist/lib/fonts/noto-sans-latin-wght-normal.20625185.woff2 +0 -0
- package/dist/lib/fonts/noto-sans-vietnamese-wght-normal.d0a8e686.woff2 +0 -0
- package/dist/lib/mm-react-components.css +1 -0
- package/dist/main.d.ts +1 -2
- package/dist/main.d.ts.map +1 -1
- package/dist/mm-react-components.es.js +8015 -5939
- package/dist/mm-react-components.es.js.map +1 -1
- package/dist/mm-react-components.umd.js +13 -13
- package/dist/mm-react-components.umd.js.map +1 -1
- package/dist/preview/ColorsPreview.d.ts +7 -0
- package/dist/preview/ColorsPreview.d.ts.map +1 -0
- package/dist/preview/CommandPreview.d.ts +2 -0
- package/dist/preview/CommandPreview.d.ts.map +1 -0
- package/dist/preview/DataTablePreview.d.ts +1 -1
- package/dist/preview/DataTablePreview.d.ts.map +1 -1
- package/dist/preview/DatePickerPreview.d.ts +2 -0
- package/dist/preview/DatePickerPreview.d.ts.map +1 -0
- package/dist/preview/DateRangePickerPreview.d.ts.map +1 -1
- package/dist/preview/HeroMetricCardPreview.d.ts +2 -0
- package/dist/preview/HeroMetricCardPreview.d.ts.map +1 -0
- package/dist/preview/PaginationPreview.d.ts +2 -0
- package/dist/preview/PaginationPreview.d.ts.map +1 -0
- package/dist/preview/SheetBannerPreview.d.ts +2 -0
- package/dist/preview/SheetBannerPreview.d.ts.map +1 -0
- package/dist/preview/SheetPreview.d.ts.map +1 -1
- package/dist/preview/SpinnerPreview.d.ts +2 -0
- package/dist/preview/SpinnerPreview.d.ts.map +1 -0
- package/dist/preview/TabsPreview.d.ts.map +1 -1
- package/dist/scripts/chakra-to-shadcn-migrator/chakra-to-shadcn.config.json +577 -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 +216 -0
- package/dist/scripts/npx-init.cjs +418 -0
- package/dist/tailwind.base.config.js +89 -0
- package/dist/themes/carbide.css +464 -90
- package/docs/TAILWIND_SETUP.md +5 -1
- package/package.json +39 -12
- package/src/index.css +111 -489
- package/dist/index.css +0 -527
- package/dist/themes/base.css +0 -536
- package/dist/themes/complete.css +0 -8
- package/scripts/README.md +0 -171
- package/scripts/chakra-to-shadcn-migrator/README.md +0 -107
- package/src/themes/base.css +0 -536
- package/src/themes/carbide.css +0 -1257
- package/src/themes/complete.css +0 -8
- /package/{scripts → dist/scripts}/chakra-to-shadcn-migrator/bin/chakra-to-shadcn.js +0 -0
|
@@ -0,0 +1,577 @@
|
|
|
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
|
+
"lucide-react": "^0.263.1"
|
|
12
|
+
},
|
|
13
|
+
"devDependenciesToAdd": {},
|
|
14
|
+
"providerInstructions": [
|
|
15
|
+
"Remove <ChakraProvider> wrapper from your app root (usually in src/index.tsx or src/main.tsx).",
|
|
16
|
+
"Import the pre-compiled CSS: import '@machinemetrics/mm-react-components/styles' in your main CSS file (e.g., src/index.css).",
|
|
17
|
+
"Add the Carbide theme class to your app root element: document.documentElement.classList.add('carbide')",
|
|
18
|
+
"For dark mode support, add both classes: document.documentElement.classList.add('carbide', 'dark')",
|
|
19
|
+
"Remove Chakra-specific theme files and configurations.",
|
|
20
|
+
"No build tools (Tailwind/PostCSS) required - everything is pre-compiled!",
|
|
21
|
+
"Install lucide-react for icons: npm install lucide-react",
|
|
22
|
+
"Replace Chakra <Icon> components with lucide-react icons directly (e.g., import { Search } from 'lucide-react')",
|
|
23
|
+
"Replace useDisclosure hook with useState: const [isOpen, setIsOpen] = useState(false)"
|
|
24
|
+
],
|
|
25
|
+
"manualMigrationComponents": {
|
|
26
|
+
"layoutComponents": [
|
|
27
|
+
"Box → Replace with <div> element and add appropriate Tailwind classes",
|
|
28
|
+
"Flex → Replace with <div className='flex'> and add flex-related Tailwind classes",
|
|
29
|
+
"VStack → Replace with <div className='flex flex-col gap-4'> and adjust spacing as needed",
|
|
30
|
+
"HStack → Replace with <div className='flex flex-row gap-4'> and adjust spacing as needed",
|
|
31
|
+
"Stack → Replace with <div className='flex flex-col gap-4'> and adjust direction/spacing as needed",
|
|
32
|
+
"Container → Replace with <div className='container mx-auto px-4'> and adjust max-width as needed",
|
|
33
|
+
"Center → Replace with <div className='flex items-center justify-center'>",
|
|
34
|
+
"SimpleGrid → Replace with <div className='grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4'> and adjust columns as needed"
|
|
35
|
+
],
|
|
36
|
+
"typographyComponents": [
|
|
37
|
+
"Heading → Replace with semantic heading elements (h1, h2, h3, etc.) and add Tailwind typography classes",
|
|
38
|
+
"Text → Replace with semantic text elements (p, span, etc.) and add Tailwind typography classes"
|
|
39
|
+
],
|
|
40
|
+
"formComponents": [
|
|
41
|
+
"Field → Replace with <div> wrapper and use shadcn/ui form components for inputs",
|
|
42
|
+
"NumberInput → Replace with <input type='number'> and add Tailwind classes, or use shadcn/ui Input component",
|
|
43
|
+
"Slider → Replace with <input type='range'> and add Tailwind classes, or use shadcn/ui Slider component",
|
|
44
|
+
"NativeSelect → Replace with <select> and add Tailwind classes, or use shadcn/ui Select component"
|
|
45
|
+
],
|
|
46
|
+
"uiComponents": [
|
|
47
|
+
"IconButton → Replace with Button component (size='icon' variant) or <button> with icon + Tailwind classes",
|
|
48
|
+
"Portal → Replace with <div> and use React Portal (React.createPortal)",
|
|
49
|
+
"Icon → Replace with Lucide React icons directly (no wrapper needed)"
|
|
50
|
+
],
|
|
51
|
+
"note": "Most UI components are now available in mm-react-components: Alert, Avatar, Breadcrumb, Calendar, Card, DateRangePicker, Form, Textarea, Toaster, AlertDialog, Chart, Dropzone, SearchInput, Separator, Progress - these will be automatically mapped by the migration script"
|
|
52
|
+
},
|
|
53
|
+
"migrationInstructions": {
|
|
54
|
+
"layoutComponents": [
|
|
55
|
+
"Layout components (Box, Flex, VStack, HStack, Stack, Container, Center, SimpleGrid) are replaced with generic JSX elements and Tailwind CSS classes.",
|
|
56
|
+
"Box → <div> with appropriate Tailwind classes",
|
|
57
|
+
"Flex → <div className='flex'> with flex-related Tailwind classes",
|
|
58
|
+
"VStack → <div className='flex flex-col gap-4'> (adjust spacing as needed)",
|
|
59
|
+
"HStack → <div className='flex flex-row gap-4'> (adjust spacing as needed)",
|
|
60
|
+
"Stack → <div className='flex flex-col gap-4'> (adjust direction/spacing as needed)",
|
|
61
|
+
"Container → <div className='container mx-auto px-4'> (adjust max-width as needed)",
|
|
62
|
+
"Center → <div className='flex items-center justify-center'>",
|
|
63
|
+
"SimpleGrid → <div className='grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4'> (adjust columns as needed)"
|
|
64
|
+
],
|
|
65
|
+
"typographyComponents": [
|
|
66
|
+
"Typography components (Heading, Text) are replaced with semantic HTML elements and Tailwind typography classes.",
|
|
67
|
+
"Heading → <h1>, <h2>, <h3>, etc. with appropriate Tailwind typography classes",
|
|
68
|
+
"Text → <p>, <span>, etc. with appropriate Tailwind typography classes",
|
|
69
|
+
"Use Tailwind's typography scale (text-sm, text-base, text-lg, etc.) for sizing"
|
|
70
|
+
],
|
|
71
|
+
"formComponents": [
|
|
72
|
+
"Form components (Field, NumberInput, NativeSelect) have simple replacements:",
|
|
73
|
+
"Field → <div> wrapper with space-y-2, or use FormItem from mm-react-components",
|
|
74
|
+
"NumberInput → <input type='number'> with styling, or use Input component",
|
|
75
|
+
"NativeSelect → <select> with styling, or use Select component from mm-react-components"
|
|
76
|
+
],
|
|
77
|
+
"uiComponents": [
|
|
78
|
+
"Most UI components are now available in mm-react-components and will be automatically mapped:",
|
|
79
|
+
"✅ Alert, Avatar, Breadcrumb, Calendar, Card, DateRangePicker, Form, Textarea, Toaster, AlertDialog",
|
|
80
|
+
"✅ Chart, Dropzone, SearchInput, Separator, Progress, Slider, Accordion, Popover",
|
|
81
|
+
"Only these require manual handling:",
|
|
82
|
+
"IconButton → Use Button component with size='icon' variant",
|
|
83
|
+
"Portal → Use React.createPortal",
|
|
84
|
+
"Icon → Use lucide-react icons directly (no wrapper needed)",
|
|
85
|
+
"Spinner → Use Loader2 from lucide-react or div with animate-spin"
|
|
86
|
+
]
|
|
87
|
+
},
|
|
88
|
+
"moduleMappings": {
|
|
89
|
+
"@chakra-ui/react": {
|
|
90
|
+
"jsxSpecifiers": {
|
|
91
|
+
"Box": { "tag": "div", "class": "" },
|
|
92
|
+
"Flex": { "tag": "div", "class": "flex" },
|
|
93
|
+
"VStack": { "tag": "div", "class": "flex flex-col gap-4" },
|
|
94
|
+
"HStack": { "tag": "div", "class": "flex flex-row gap-4" },
|
|
95
|
+
"Stack": { "tag": "div", "class": "flex flex-col gap-4" },
|
|
96
|
+
"Container": { "tag": "div", "class": "container mx-auto px-4" },
|
|
97
|
+
"Center": { "tag": "div", "class": "flex items-center justify-center" },
|
|
98
|
+
"SimpleGrid": { "tag": "div", "class": "grid gap-4" },
|
|
99
|
+
"Heading": { "tag": "h2", "class": "font-semibold" },
|
|
100
|
+
"Text": { "tag": "p", "class": "" },
|
|
101
|
+
"Portal": { "tag": "div", "class": "" },
|
|
102
|
+
"Separator": { "tag": "hr", "class": "border-t" },
|
|
103
|
+
"IconButton": {
|
|
104
|
+
"tag": "button",
|
|
105
|
+
"class": "inline-flex items-center justify-center"
|
|
106
|
+
},
|
|
107
|
+
"Spinner": {
|
|
108
|
+
"tag": "div",
|
|
109
|
+
"class": "animate-spin rounded-full h-6 w-6 border-2 border-current border-t-transparent",
|
|
110
|
+
"note": "Replace with Loader2 from lucide-react for better icon"
|
|
111
|
+
},
|
|
112
|
+
"NumberInput": {
|
|
113
|
+
"tag": "input",
|
|
114
|
+
"class": "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
115
|
+
"attributes": { "type": "number" }
|
|
116
|
+
},
|
|
117
|
+
"NativeSelect": {
|
|
118
|
+
"tag": "select",
|
|
119
|
+
"class": "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm"
|
|
120
|
+
},
|
|
121
|
+
"Field": {
|
|
122
|
+
"tag": "div",
|
|
123
|
+
"class": "space-y-2"
|
|
124
|
+
}
|
|
125
|
+
},
|
|
126
|
+
"specifiers": {
|
|
127
|
+
"Badge": {
|
|
128
|
+
"module": "@machinemetrics/mm-react-components",
|
|
129
|
+
"import": "Badge"
|
|
130
|
+
},
|
|
131
|
+
"Button": {
|
|
132
|
+
"module": "@machinemetrics/mm-react-components",
|
|
133
|
+
"import": "Button"
|
|
134
|
+
},
|
|
135
|
+
"Modal": {
|
|
136
|
+
"module": "@machinemetrics/mm-react-components",
|
|
137
|
+
"import": "Dialog"
|
|
138
|
+
},
|
|
139
|
+
"Input": {
|
|
140
|
+
"module": "@machinemetrics/mm-react-components",
|
|
141
|
+
"import": "Input"
|
|
142
|
+
},
|
|
143
|
+
"Menu": {
|
|
144
|
+
"module": "@machinemetrics/mm-react-components",
|
|
145
|
+
"import": "DropdownMenu"
|
|
146
|
+
},
|
|
147
|
+
"Select": {
|
|
148
|
+
"module": "@machinemetrics/mm-react-components",
|
|
149
|
+
"import": "Select"
|
|
150
|
+
},
|
|
151
|
+
"Table": {
|
|
152
|
+
"module": "@machinemetrics/mm-react-components",
|
|
153
|
+
"import": "Table"
|
|
154
|
+
},
|
|
155
|
+
"Tabs": {
|
|
156
|
+
"module": "@machinemetrics/mm-react-components",
|
|
157
|
+
"import": "Tabs"
|
|
158
|
+
},
|
|
159
|
+
"Tooltip": {
|
|
160
|
+
"module": "@machinemetrics/mm-react-components",
|
|
161
|
+
"import": "Tooltip"
|
|
162
|
+
},
|
|
163
|
+
"Drawer": {
|
|
164
|
+
"module": "@machinemetrics/mm-react-components",
|
|
165
|
+
"import": "Drawer"
|
|
166
|
+
},
|
|
167
|
+
"Switch": {
|
|
168
|
+
"module": "@machinemetrics/mm-react-components",
|
|
169
|
+
"import": "Switch"
|
|
170
|
+
},
|
|
171
|
+
"Checkbox": {
|
|
172
|
+
"module": "@machinemetrics/mm-react-components",
|
|
173
|
+
"import": "Checkbox"
|
|
174
|
+
},
|
|
175
|
+
"Radio": {
|
|
176
|
+
"module": "@machinemetrics/mm-react-components",
|
|
177
|
+
"import": "RadioGroupItem"
|
|
178
|
+
},
|
|
179
|
+
"RadioGroup": {
|
|
180
|
+
"module": "@machinemetrics/mm-react-components",
|
|
181
|
+
"import": "RadioGroup"
|
|
182
|
+
},
|
|
183
|
+
"Label": {
|
|
184
|
+
"module": "@machinemetrics/mm-react-components",
|
|
185
|
+
"import": "Label"
|
|
186
|
+
},
|
|
187
|
+
"FormLabel": {
|
|
188
|
+
"module": "@machinemetrics/mm-react-components",
|
|
189
|
+
"import": "Label"
|
|
190
|
+
},
|
|
191
|
+
"Sheet": {
|
|
192
|
+
"module": "@machinemetrics/mm-react-components",
|
|
193
|
+
"import": "Sheet"
|
|
194
|
+
},
|
|
195
|
+
"Skeleton": {
|
|
196
|
+
"module": "@machinemetrics/mm-react-components",
|
|
197
|
+
"import": "Skeleton"
|
|
198
|
+
},
|
|
199
|
+
"Collapse": {
|
|
200
|
+
"module": "@machinemetrics/mm-react-components",
|
|
201
|
+
"import": "Collapsible"
|
|
202
|
+
},
|
|
203
|
+
"Collapsible": {
|
|
204
|
+
"module": "@machinemetrics/mm-react-components",
|
|
205
|
+
"import": "Collapsible"
|
|
206
|
+
},
|
|
207
|
+
"Accordion": {
|
|
208
|
+
"module": "@machinemetrics/mm-react-components",
|
|
209
|
+
"import": "Accordion"
|
|
210
|
+
},
|
|
211
|
+
"DataTable": {
|
|
212
|
+
"module": "@machinemetrics/mm-react-components",
|
|
213
|
+
"import": "DataTable"
|
|
214
|
+
},
|
|
215
|
+
"Progress": {
|
|
216
|
+
"module": "@machinemetrics/mm-react-components",
|
|
217
|
+
"import": "Progress"
|
|
218
|
+
},
|
|
219
|
+
"Slider": {
|
|
220
|
+
"module": "@machinemetrics/mm-react-components",
|
|
221
|
+
"import": "Slider"
|
|
222
|
+
},
|
|
223
|
+
"Popover": {
|
|
224
|
+
"module": "@machinemetrics/mm-react-components",
|
|
225
|
+
"import": "Popover"
|
|
226
|
+
},
|
|
227
|
+
"PopoverTrigger": {
|
|
228
|
+
"module": "@machinemetrics/mm-react-components",
|
|
229
|
+
"import": "PopoverTrigger"
|
|
230
|
+
},
|
|
231
|
+
"PopoverContent": {
|
|
232
|
+
"module": "@machinemetrics/mm-react-components",
|
|
233
|
+
"import": "PopoverContent"
|
|
234
|
+
},
|
|
235
|
+
"PopoverAnchor": {
|
|
236
|
+
"module": "@machinemetrics/mm-react-components",
|
|
237
|
+
"import": "PopoverAnchor"
|
|
238
|
+
},
|
|
239
|
+
"ModalOverlay": {
|
|
240
|
+
"module": "@machinemetrics/mm-react-components",
|
|
241
|
+
"import": "DialogOverlay"
|
|
242
|
+
},
|
|
243
|
+
"ModalContent": {
|
|
244
|
+
"module": "@machinemetrics/mm-react-components",
|
|
245
|
+
"import": "DialogContent"
|
|
246
|
+
},
|
|
247
|
+
"ModalHeader": {
|
|
248
|
+
"module": "@machinemetrics/mm-react-components",
|
|
249
|
+
"import": "DialogHeader"
|
|
250
|
+
},
|
|
251
|
+
"ModalFooter": {
|
|
252
|
+
"module": "@machinemetrics/mm-react-components",
|
|
253
|
+
"import": "DialogFooter"
|
|
254
|
+
},
|
|
255
|
+
"ModalBody": {
|
|
256
|
+
"module": "@machinemetrics/mm-react-components",
|
|
257
|
+
"import": "DialogContent"
|
|
258
|
+
},
|
|
259
|
+
"DrawerOverlay": {
|
|
260
|
+
"module": "@machinemetrics/mm-react-components",
|
|
261
|
+
"import": "DrawerOverlay"
|
|
262
|
+
},
|
|
263
|
+
"DrawerContent": {
|
|
264
|
+
"module": "@machinemetrics/mm-react-components",
|
|
265
|
+
"import": "DrawerContent"
|
|
266
|
+
},
|
|
267
|
+
"DrawerHeader": {
|
|
268
|
+
"module": "@machinemetrics/mm-react-components",
|
|
269
|
+
"import": "DrawerHeader"
|
|
270
|
+
},
|
|
271
|
+
"DrawerFooter": {
|
|
272
|
+
"module": "@machinemetrics/mm-react-components",
|
|
273
|
+
"import": "DrawerFooter"
|
|
274
|
+
},
|
|
275
|
+
"DrawerCloseButton": {
|
|
276
|
+
"module": "@machinemetrics/mm-react-components",
|
|
277
|
+
"import": "DrawerClose"
|
|
278
|
+
},
|
|
279
|
+
"AccordionItem": {
|
|
280
|
+
"module": "@machinemetrics/mm-react-components",
|
|
281
|
+
"import": "AccordionItem"
|
|
282
|
+
},
|
|
283
|
+
"AccordionButton": {
|
|
284
|
+
"module": "@machinemetrics/mm-react-components",
|
|
285
|
+
"import": "AccordionTrigger"
|
|
286
|
+
},
|
|
287
|
+
"AccordionPanel": {
|
|
288
|
+
"module": "@machinemetrics/mm-react-components",
|
|
289
|
+
"import": "AccordionContent"
|
|
290
|
+
},
|
|
291
|
+
"Alert": {
|
|
292
|
+
"module": "@machinemetrics/mm-react-components",
|
|
293
|
+
"import": "Alert"
|
|
294
|
+
},
|
|
295
|
+
"AlertTitle": {
|
|
296
|
+
"module": "@machinemetrics/mm-react-components",
|
|
297
|
+
"import": "AlertTitle"
|
|
298
|
+
},
|
|
299
|
+
"AlertDescription": {
|
|
300
|
+
"module": "@machinemetrics/mm-react-components",
|
|
301
|
+
"import": "AlertDescription"
|
|
302
|
+
},
|
|
303
|
+
"AlertDialog": {
|
|
304
|
+
"module": "@machinemetrics/mm-react-components",
|
|
305
|
+
"import": "AlertDialog"
|
|
306
|
+
},
|
|
307
|
+
"AlertDialogOverlay": {
|
|
308
|
+
"module": "@machinemetrics/mm-react-components",
|
|
309
|
+
"import": "AlertDialogOverlay"
|
|
310
|
+
},
|
|
311
|
+
"AlertDialogContent": {
|
|
312
|
+
"module": "@machinemetrics/mm-react-components",
|
|
313
|
+
"import": "AlertDialogContent"
|
|
314
|
+
},
|
|
315
|
+
"AlertDialogHeader": {
|
|
316
|
+
"module": "@machinemetrics/mm-react-components",
|
|
317
|
+
"import": "AlertDialogHeader"
|
|
318
|
+
},
|
|
319
|
+
"AlertDialogFooter": {
|
|
320
|
+
"module": "@machinemetrics/mm-react-components",
|
|
321
|
+
"import": "AlertDialogFooter"
|
|
322
|
+
},
|
|
323
|
+
"AlertDialogBody": {
|
|
324
|
+
"module": "@machinemetrics/mm-react-components",
|
|
325
|
+
"import": "AlertDialogContent"
|
|
326
|
+
},
|
|
327
|
+
"Avatar": {
|
|
328
|
+
"module": "@machinemetrics/mm-react-components",
|
|
329
|
+
"import": "Avatar"
|
|
330
|
+
},
|
|
331
|
+
"AvatarImage": {
|
|
332
|
+
"module": "@machinemetrics/mm-react-components",
|
|
333
|
+
"import": "AvatarImage"
|
|
334
|
+
},
|
|
335
|
+
"AvatarFallback": {
|
|
336
|
+
"module": "@machinemetrics/mm-react-components",
|
|
337
|
+
"import": "AvatarFallback"
|
|
338
|
+
},
|
|
339
|
+
"Breadcrumb": {
|
|
340
|
+
"module": "@machinemetrics/mm-react-components",
|
|
341
|
+
"import": "Breadcrumb"
|
|
342
|
+
},
|
|
343
|
+
"BreadcrumbItem": {
|
|
344
|
+
"module": "@machinemetrics/mm-react-components",
|
|
345
|
+
"import": "BreadcrumbItem"
|
|
346
|
+
},
|
|
347
|
+
"BreadcrumbLink": {
|
|
348
|
+
"module": "@machinemetrics/mm-react-components",
|
|
349
|
+
"import": "BreadcrumbLink"
|
|
350
|
+
},
|
|
351
|
+
"Calendar": {
|
|
352
|
+
"module": "@machinemetrics/mm-react-components",
|
|
353
|
+
"import": "Calendar"
|
|
354
|
+
},
|
|
355
|
+
"Card": {
|
|
356
|
+
"module": "@machinemetrics/mm-react-components",
|
|
357
|
+
"import": "Card"
|
|
358
|
+
},
|
|
359
|
+
"CardHeader": {
|
|
360
|
+
"module": "@machinemetrics/mm-react-components",
|
|
361
|
+
"import": "CardHeader"
|
|
362
|
+
},
|
|
363
|
+
"CardBody": {
|
|
364
|
+
"module": "@machinemetrics/mm-react-components",
|
|
365
|
+
"import": "CardContent"
|
|
366
|
+
},
|
|
367
|
+
"CardFooter": {
|
|
368
|
+
"module": "@machinemetrics/mm-react-components",
|
|
369
|
+
"import": "CardFooter"
|
|
370
|
+
},
|
|
371
|
+
"Separator": {
|
|
372
|
+
"module": "@machinemetrics/mm-react-components",
|
|
373
|
+
"import": "Separator"
|
|
374
|
+
},
|
|
375
|
+
"Divider": {
|
|
376
|
+
"module": "@machinemetrics/mm-react-components",
|
|
377
|
+
"import": "Separator"
|
|
378
|
+
},
|
|
379
|
+
"Textarea": {
|
|
380
|
+
"module": "@machinemetrics/mm-react-components",
|
|
381
|
+
"import": "Textarea"
|
|
382
|
+
},
|
|
383
|
+
"Toast": {
|
|
384
|
+
"module": "@machinemetrics/mm-react-components",
|
|
385
|
+
"import": "Toaster"
|
|
386
|
+
},
|
|
387
|
+
"DateRangePicker": {
|
|
388
|
+
"module": "@machinemetrics/mm-react-components",
|
|
389
|
+
"import": "DateRangePicker"
|
|
390
|
+
},
|
|
391
|
+
"Form": {
|
|
392
|
+
"module": "@machinemetrics/mm-react-components",
|
|
393
|
+
"import": "Form"
|
|
394
|
+
},
|
|
395
|
+
"FormField": {
|
|
396
|
+
"module": "@machinemetrics/mm-react-components",
|
|
397
|
+
"import": "FormField"
|
|
398
|
+
},
|
|
399
|
+
"FormItem": {
|
|
400
|
+
"module": "@machinemetrics/mm-react-components",
|
|
401
|
+
"import": "FormItem"
|
|
402
|
+
},
|
|
403
|
+
"FormControl": {
|
|
404
|
+
"module": "@machinemetrics/mm-react-components",
|
|
405
|
+
"import": "FormControl"
|
|
406
|
+
},
|
|
407
|
+
"FormDescription": {
|
|
408
|
+
"module": "@machinemetrics/mm-react-components",
|
|
409
|
+
"import": "FormDescription"
|
|
410
|
+
},
|
|
411
|
+
"FormMessage": {
|
|
412
|
+
"module": "@machinemetrics/mm-react-components",
|
|
413
|
+
"import": "FormMessage"
|
|
414
|
+
},
|
|
415
|
+
"ChartContainer": {
|
|
416
|
+
"module": "@machinemetrics/mm-react-components",
|
|
417
|
+
"import": "ChartContainer"
|
|
418
|
+
},
|
|
419
|
+
"ChartTooltip": {
|
|
420
|
+
"module": "@machinemetrics/mm-react-components",
|
|
421
|
+
"import": "ChartTooltip"
|
|
422
|
+
},
|
|
423
|
+
"ChartTooltipContent": {
|
|
424
|
+
"module": "@machinemetrics/mm-react-components",
|
|
425
|
+
"import": "ChartTooltipContent"
|
|
426
|
+
},
|
|
427
|
+
"ChartLegend": {
|
|
428
|
+
"module": "@machinemetrics/mm-react-components",
|
|
429
|
+
"import": "ChartLegend"
|
|
430
|
+
},
|
|
431
|
+
"ChartLegendContent": {
|
|
432
|
+
"module": "@machinemetrics/mm-react-components",
|
|
433
|
+
"import": "ChartLegendContent"
|
|
434
|
+
},
|
|
435
|
+
"ChartStyle": {
|
|
436
|
+
"module": "@machinemetrics/mm-react-components",
|
|
437
|
+
"import": "ChartStyle"
|
|
438
|
+
},
|
|
439
|
+
"Dropzone": {
|
|
440
|
+
"module": "@machinemetrics/mm-react-components",
|
|
441
|
+
"import": "Dropzone"
|
|
442
|
+
},
|
|
443
|
+
"DropzoneContent": {
|
|
444
|
+
"module": "@machinemetrics/mm-react-components",
|
|
445
|
+
"import": "DropzoneContent"
|
|
446
|
+
},
|
|
447
|
+
"DropzoneEmptyState": {
|
|
448
|
+
"module": "@machinemetrics/mm-react-components",
|
|
449
|
+
"import": "DropzoneEmptyState"
|
|
450
|
+
},
|
|
451
|
+
"SearchInput": {
|
|
452
|
+
"module": "@machinemetrics/mm-react-components",
|
|
453
|
+
"import": "SearchInput"
|
|
454
|
+
},
|
|
455
|
+
"LabeledSlider": {
|
|
456
|
+
"module": "@machinemetrics/mm-react-components",
|
|
457
|
+
"import": "LabeledSlider"
|
|
458
|
+
}
|
|
459
|
+
},
|
|
460
|
+
"compoundComponents": {
|
|
461
|
+
"Alert.Root": { "tag": "div", "class": "rounded-md border p-4" },
|
|
462
|
+
"Alert.Indicator": { "remove": true },
|
|
463
|
+
"Alert.Content": { "tag": "div", "class": "flex-1" },
|
|
464
|
+
"Alert.Title": { "tag": "h5", "class": "font-medium mb-1" },
|
|
465
|
+
"Alert.Description": { "tag": "div", "class": "text-sm" },
|
|
466
|
+
"Modal": { "component": "Dialog" },
|
|
467
|
+
"Dialog.Root": { "component": "Dialog" },
|
|
468
|
+
"Dialog.Backdrop": { "remove": true },
|
|
469
|
+
"Dialog.Positioner": { "unwrap": true },
|
|
470
|
+
"Dialog.Content": { "component": "DialogContent" },
|
|
471
|
+
"Dialog.Header": { "component": "DialogHeader" },
|
|
472
|
+
"Dialog.Title": { "component": "DialogTitle" },
|
|
473
|
+
"Dialog.Description": { "component": "DialogDescription" },
|
|
474
|
+
"Dialog.Body": { "unwrap": true },
|
|
475
|
+
"Dialog.Footer": { "component": "DialogFooter" },
|
|
476
|
+
"Dialog.CloseTrigger": { "component": "DialogClose" },
|
|
477
|
+
"Drawer.Root": { "component": "Drawer" },
|
|
478
|
+
"Drawer.Trigger": { "component": "DrawerTrigger" },
|
|
479
|
+
"Drawer.CloseTrigger": { "component": "DrawerClose" },
|
|
480
|
+
"Drawer.Portal": { "component": "DrawerPortal" },
|
|
481
|
+
"Drawer.Overlay": { "component": "DrawerOverlay" },
|
|
482
|
+
"Drawer.Content": { "component": "DrawerContent" },
|
|
483
|
+
"Drawer.Header": { "component": "DrawerHeader" },
|
|
484
|
+
"Drawer.Footer": { "component": "DrawerFooter" },
|
|
485
|
+
"Drawer.Title": { "component": "DrawerTitle" },
|
|
486
|
+
"Drawer.Description": { "component": "DrawerDescription" },
|
|
487
|
+
"Drawer.Handle": { "component": "DrawerHandle" },
|
|
488
|
+
"Collapse": { "component": "Collapsible" },
|
|
489
|
+
"Accordion.Root": { "component": "Accordion" },
|
|
490
|
+
"Accordion.Item": { "component": "AccordionItem" },
|
|
491
|
+
"Accordion.Trigger": { "component": "AccordionTrigger" },
|
|
492
|
+
"Accordion.Content": { "component": "AccordionContent" },
|
|
493
|
+
"Tabs.Root": { "component": "Tabs" },
|
|
494
|
+
"Tabs.List": { "component": "TabsList" },
|
|
495
|
+
"Tabs.Trigger": { "component": "TabsTrigger" },
|
|
496
|
+
"Tabs.Content": { "component": "TabsContent" },
|
|
497
|
+
"Tabs.Indicator": { "remove": true },
|
|
498
|
+
"Table.Root": { "component": "Table" },
|
|
499
|
+
"Table.Header": { "component": "TableHeader" },
|
|
500
|
+
"Table.Body": { "component": "TableBody" },
|
|
501
|
+
"Table.Row": { "component": "TableRow" },
|
|
502
|
+
"Table.ColumnHeader": { "component": "TableHead" },
|
|
503
|
+
"Table.Cell": { "component": "TableCell" },
|
|
504
|
+
"Table.Footer": { "component": "TableFooter" },
|
|
505
|
+
"Menu.Root": { "component": "DropdownMenu" },
|
|
506
|
+
"Menu.Trigger": { "component": "DropdownMenuTrigger" },
|
|
507
|
+
"Menu.Content": { "component": "DropdownMenuContent" },
|
|
508
|
+
"Menu.Item": { "component": "DropdownMenuItem" },
|
|
509
|
+
"Menu.Separator": { "component": "DropdownMenuSeparator" },
|
|
510
|
+
"Menu.ItemGroup": { "unwrap": true },
|
|
511
|
+
"Menu.ItemGroupLabel": { "component": "DropdownMenuLabel" },
|
|
512
|
+
"Popover.Root": { "component": "Popover" },
|
|
513
|
+
"Popover.Trigger": { "component": "PopoverTrigger" },
|
|
514
|
+
"Popover.Content": { "component": "PopoverContent" },
|
|
515
|
+
"Popover.Anchor": { "component": "PopoverAnchor" },
|
|
516
|
+
"AlertDialog.Root": { "component": "AlertDialog" },
|
|
517
|
+
"AlertDialog.Trigger": { "component": "AlertDialogTrigger" },
|
|
518
|
+
"AlertDialog.Content": { "component": "AlertDialogContent" },
|
|
519
|
+
"AlertDialog.Header": { "component": "AlertDialogHeader" },
|
|
520
|
+
"AlertDialog.Footer": { "component": "AlertDialogFooter" },
|
|
521
|
+
"AlertDialog.Title": { "component": "AlertDialogTitle" },
|
|
522
|
+
"AlertDialog.Description": { "component": "AlertDialogDescription" },
|
|
523
|
+
"AlertDialog.Action": { "component": "AlertDialogAction" },
|
|
524
|
+
"AlertDialog.Cancel": { "component": "AlertDialogCancel" },
|
|
525
|
+
"AlertDialog.Overlay": { "component": "AlertDialogOverlay" },
|
|
526
|
+
"AlertDialog.Portal": { "component": "AlertDialogPortal" },
|
|
527
|
+
"Avatar.Root": { "component": "Avatar" },
|
|
528
|
+
"Avatar.Image": { "component": "AvatarImage" },
|
|
529
|
+
"Avatar.Fallback": { "component": "AvatarFallback" },
|
|
530
|
+
"Breadcrumb.Root": { "component": "Breadcrumb" },
|
|
531
|
+
"Breadcrumb.List": { "component": "BreadcrumbList" },
|
|
532
|
+
"Breadcrumb.Item": { "component": "BreadcrumbItem" },
|
|
533
|
+
"Breadcrumb.Link": { "component": "BreadcrumbLink" },
|
|
534
|
+
"Breadcrumb.Page": { "component": "BreadcrumbPage" },
|
|
535
|
+
"Breadcrumb.Separator": { "component": "BreadcrumbSeparator" },
|
|
536
|
+
"Breadcrumb.Ellipsis": { "component": "BreadcrumbEllipsis" },
|
|
537
|
+
"Card.Root": { "component": "Card" },
|
|
538
|
+
"Card.Header": { "component": "CardHeader" },
|
|
539
|
+
"Card.Title": { "component": "CardTitle" },
|
|
540
|
+
"Card.Description": { "component": "CardDescription" },
|
|
541
|
+
"Card.Content": { "component": "CardContent" },
|
|
542
|
+
"Card.Footer": { "component": "CardFooter" },
|
|
543
|
+
"Form.Root": { "component": "Form" },
|
|
544
|
+
"Form.Field": { "component": "FormField" },
|
|
545
|
+
"Form.Item": { "component": "FormItem" },
|
|
546
|
+
"Form.Label": { "component": "FormLabel" },
|
|
547
|
+
"Form.Control": { "component": "FormControl" },
|
|
548
|
+
"Form.Description": { "component": "FormDescription" },
|
|
549
|
+
"Form.Message": { "component": "FormMessage" }
|
|
550
|
+
}
|
|
551
|
+
},
|
|
552
|
+
"@chakra-ui/icons": {
|
|
553
|
+
"default": {
|
|
554
|
+
"module": "lucide-react"
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
},
|
|
558
|
+
"postSteps": [
|
|
559
|
+
"Run npm install to install @machinemetrics/mm-react-components and lucide-react.",
|
|
560
|
+
"MIGRATION NOTES:",
|
|
561
|
+
" - ChakraProvider has been removed - no provider needed with mm-react-components",
|
|
562
|
+
" - Chakra Icon components replaced with lucide-react icons",
|
|
563
|
+
" - useDisclosure hook replaced with useState(false)",
|
|
564
|
+
" - Spinner → div with animation or lucide-react Loader2 icon",
|
|
565
|
+
" - NumberInput → input type='number'",
|
|
566
|
+
" - NativeSelect → select element",
|
|
567
|
+
" - Field → div wrapper (or use FormItem from mm-react-components)",
|
|
568
|
+
"MANUAL MIGRATION REQUIRED for layout/typography components:",
|
|
569
|
+
" - Layout: Box, Flex, VStack, HStack, Stack, Container, Center, SimpleGrid → use div with Tailwind classes",
|
|
570
|
+
" - Typography: Heading, Text → use semantic HTML (h1-h6, p, span) with Tailwind classes",
|
|
571
|
+
" - IconButton → Button component with icon variant or button element",
|
|
572
|
+
"See the manualMigrationComponents section in the config for specific replacement instructions.",
|
|
573
|
+
"Test all migrated components to ensure proper styling and functionality.",
|
|
574
|
+
"Run npm run lint && npm run test to verify the migration.",
|
|
575
|
+
"💡 Zero-config reminder: No Tailwind setup needed - everything is pre-compiled!"
|
|
576
|
+
]
|
|
577
|
+
}
|
|
@@ -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
|
+
}
|