@machinemetrics/mm-react-components 0.2.3-13 → 0.2.3-15

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 (39) hide show
  1. package/README.md +31 -1
  2. package/agent-docs/agent-documentation-reference.md +114 -0
  3. package/agent-docs/ai-agent-guide.md +5 -1
  4. package/agent-docs/ai-agent-init-guide.md +5 -1
  5. package/dist/README.md +31 -1
  6. package/dist/components/ui/hero-metric-card/HeroMetricCard.d.ts +4 -0
  7. package/dist/components/ui/hero-metric-card/HeroMetricCard.d.ts.map +1 -0
  8. package/dist/components/ui/hero-metric-card/HeroMetricCardItem.d.ts +4 -0
  9. package/dist/components/ui/hero-metric-card/HeroMetricCardItem.d.ts.map +1 -0
  10. package/dist/components/ui/hero-metric-card/constants.d.ts +13 -0
  11. package/dist/components/ui/hero-metric-card/constants.d.ts.map +1 -0
  12. package/dist/components/ui/hero-metric-card/grid.d.ts +4 -0
  13. package/dist/components/ui/hero-metric-card/grid.d.ts.map +1 -0
  14. package/dist/components/ui/hero-metric-card/hooks.d.ts +6 -0
  15. package/dist/components/ui/hero-metric-card/hooks.d.ts.map +1 -0
  16. package/dist/components/ui/hero-metric-card/index.d.ts +5 -0
  17. package/dist/components/ui/hero-metric-card/index.d.ts.map +1 -0
  18. package/dist/components/ui/hero-metric-card/parsing.d.ts +11 -0
  19. package/dist/components/ui/hero-metric-card/parsing.d.ts.map +1 -0
  20. package/dist/components/ui/hero-metric-card/refs.d.ts +3 -0
  21. package/dist/components/ui/hero-metric-card/refs.d.ts.map +1 -0
  22. package/dist/components/ui/hero-metric-card/trend.d.ts +4 -0
  23. package/dist/components/ui/hero-metric-card/trend.d.ts.map +1 -0
  24. package/dist/components/ui/hero-metric-card/types.d.ts +60 -0
  25. package/dist/components/ui/hero-metric-card/types.d.ts.map +1 -0
  26. package/dist/components/ui/hero-metric-card/utils.d.ts +10 -0
  27. package/dist/components/ui/hero-metric-card/utils.d.ts.map +1 -0
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/lib/mm-react-components.css +1 -1
  31. package/dist/mm-react-components.es.js +461 -2
  32. package/dist/mm-react-components.es.js.map +1 -1
  33. package/dist/mm-react-components.umd.js +10 -10
  34. package/dist/mm-react-components.umd.js.map +1 -1
  35. package/dist/preview/HeroMetricCardPreview.d.ts +2 -0
  36. package/dist/preview/HeroMetricCardPreview.d.ts.map +1 -0
  37. package/dist/scripts/chakra-to-shadcn-migrator/chakra-to-shadcn.config.json +130 -65
  38. package/dist/themes/carbide.css +23 -3
  39. package/package.json +1 -1
@@ -0,0 +1,2 @@
1
+ export default function HeroMetricCardPreview(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=HeroMetricCardPreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HeroMetricCardPreview.d.ts","sourceRoot":"","sources":["../../src/preview/HeroMetricCardPreview.tsx"],"names":[],"mappings":"AAUA,MAAM,CAAC,OAAO,UAAU,qBAAqB,4CAoP5C"}
@@ -7,7 +7,8 @@
7
7
  "@emotion/styled"
8
8
  ],
9
9
  "dependenciesToAdd": {
10
- "@machinemetrics/mm-react-components": "*"
10
+ "@machinemetrics/mm-react-components": "*",
11
+ "lucide-react": "^0.263.1"
11
12
  },
12
13
  "devDependenciesToAdd": {},
13
14
  "providerInstructions": [
@@ -16,7 +17,10 @@
16
17
  "Add the Carbide theme class to your app root element: document.documentElement.classList.add('carbide')",
17
18
  "For dark mode support, add both classes: document.documentElement.classList.add('carbide', 'dark')",
18
19
  "Remove Chakra-specific theme files and configurations.",
19
- "No build tools (Tailwind/PostCSS) required - everything is pre-compiled!"
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)"
20
24
  ],
21
25
  "manualMigrationComponents": {
22
26
  "layoutComponents": [
@@ -40,26 +44,11 @@
40
44
  "NativeSelect → Replace with <select> and add Tailwind classes, or use shadcn/ui Select component"
41
45
  ],
42
46
  "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
- ]
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"
63
52
  },
64
53
  "migrationInstructions": {
65
54
  "layoutComponents": [
@@ -80,33 +69,20 @@
80
69
  "Use Tailwind's typography scale (text-sm, text-base, text-lg, etc.) for sizing"
81
70
  ],
82
71
  "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"
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"
88
76
  ],
89
77
  "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"
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
+ "IconButtonUse Button component with size='icon' variant",
83
+ "PortalUse React.createPortal",
84
+ "IconUse lucide-react icons directly (no wrapper needed)",
85
+ "Spinner → Use Loader2 from lucide-react or div with animate-spin"
110
86
  ]
111
87
  },
112
88
  "moduleMappings": {
@@ -127,6 +103,24 @@
127
103
  "IconButton": {
128
104
  "tag": "button",
129
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"
130
124
  }
131
125
  },
132
126
  "specifiers": {
@@ -298,22 +292,98 @@
298
292
  "module": "@machinemetrics/mm-react-components",
299
293
  "import": "Alert"
300
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
+ },
301
303
  "AlertDialog": {
302
304
  "module": "@machinemetrics/mm-react-components",
303
305
  "import": "AlertDialog"
304
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
+ },
305
327
  "Avatar": {
306
328
  "module": "@machinemetrics/mm-react-components",
307
329
  "import": "Avatar"
308
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
+ },
309
339
  "Breadcrumb": {
310
340
  "module": "@machinemetrics/mm-react-components",
311
341
  "import": "Breadcrumb"
312
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
+ },
313
351
  "Calendar": {
314
352
  "module": "@machinemetrics/mm-react-components",
315
353
  "import": "Calendar"
316
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
+ },
317
387
  "DateRangePicker": {
318
388
  "module": "@machinemetrics/mm-react-components",
319
389
  "import": "DateRangePicker"
@@ -342,18 +412,6 @@
342
412
  "module": "@machinemetrics/mm-react-components",
343
413
  "import": "FormMessage"
344
414
  },
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
415
  "ChartContainer": {
358
416
  "module": "@machinemetrics/mm-react-components",
359
417
  "import": "ChartContainer"
@@ -498,12 +556,19 @@
498
556
  }
499
557
  },
500
558
  "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",
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",
507
572
  "See the manualMigrationComponents section in the config for specific replacement instructions.",
508
573
  "Test all migrated components to ensure proper styling and functionality.",
509
574
  "Run npm run lint && npm run test to verify the migration.",
@@ -801,16 +801,30 @@
801
801
  color: var(--muted-foreground);
802
802
  }
803
803
 
804
+ .carbide [data-slot='select-content'] {
805
+ background-color: var(--popover);
806
+ color: var(--popover-foreground);
807
+ border-color: var(--border);
808
+ box-shadow: 0 6px 24px rgba(15, 23, 42, 0.12);
809
+ }
810
+ .carbide.dark [data-slot='select-content'] {
811
+ background-color: var(--popover);
812
+ color: var(--popover-foreground);
813
+ border-color: var(--border);
814
+ }
815
+
804
816
  /* =============================
805
817
  DROPDOWN MENU
806
818
  ============================= */
807
- .carbide [data-slot='dropdown-menu-content'] {
819
+ .carbide [data-slot='dropdown-menu-content'],
820
+ .carbide [data-slot='dropdown-menu-sub-content'] {
808
821
  background-color: var(--popover);
809
822
  color: var(--popover-foreground);
810
823
  border-color: var(--border);
811
824
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.12);
812
825
  }
813
- .carbide.dark [data-slot='dropdown-menu-content'] {
826
+ .carbide.dark [data-slot='dropdown-menu-content'],
827
+ .carbide.dark [data-slot='dropdown-menu-sub-content'] {
814
828
  background-color: var(--popover);
815
829
  color: var(--popover-foreground);
816
830
  border-color: var(--border);
@@ -909,21 +923,24 @@
909
923
  }
910
924
 
911
925
  /* =============================
912
- OVERLAYS & DIALOG/SHEET/DRAWER
926
+ OVERLAYS & DIALOG/SHEET/DRAWER/ALERT-DIALOG
913
927
  ============================= */
914
928
  .carbide [data-slot='dialog-overlay'],
929
+ .carbide [data-slot='alert-dialog-overlay'],
915
930
  .carbide [data-slot='sheet-overlay'],
916
931
  .carbide [data-slot='drawer-overlay'] {
917
932
  background-color: color-mix(in srgb, var(--overlay-bg) 60%, transparent);
918
933
  backdrop-filter: blur(2px);
919
934
  }
920
935
  .carbide.dark [data-slot='dialog-overlay'],
936
+ .carbide.dark [data-slot='alert-dialog-overlay'],
921
937
  .carbide.dark [data-slot='sheet-overlay'],
922
938
  .carbide.dark [data-slot='drawer-overlay'] {
923
939
  background-color: color-mix(in srgb, var(--overlay-bg) 75%, transparent);
924
940
  }
925
941
 
926
942
  .carbide [data-slot='dialog-content'],
943
+ .carbide [data-slot='alert-dialog-content'],
927
944
  .carbide [data-slot='sheet-content'],
928
945
  .carbide [data-slot='drawer-content'] {
929
946
  background-color: var(--card);
@@ -932,6 +949,7 @@
932
949
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
933
950
  }
934
951
  .carbide.dark [data-slot='dialog-content'],
952
+ .carbide.dark [data-slot='alert-dialog-content'],
935
953
  .carbide.dark [data-slot='sheet-content'],
936
954
  .carbide.dark [data-slot='drawer-content'] {
937
955
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.55);
@@ -965,12 +983,14 @@
965
983
  }
966
984
 
967
985
  .carbide [data-slot='dialog-title'],
986
+ .carbide [data-slot='alert-dialog-title'],
968
987
  .carbide [data-slot='sheet-title'],
969
988
  .carbide [data-slot='drawer-title'] {
970
989
  color: var(--card-foreground);
971
990
  }
972
991
 
973
992
  .carbide [data-slot='dialog-description'],
993
+ .carbide [data-slot='alert-dialog-description'],
974
994
  .carbide [data-slot='sheet-description'],
975
995
  .carbide [data-slot='drawer-description'] {
976
996
  color: var(--muted-foreground);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@machinemetrics/mm-react-components",
3
- "version": "0.2.3-13",
3
+ "version": "0.2.3-15",
4
4
  "description": "Industrial-grade React components for manufacturing applications",
5
5
  "keywords": [
6
6
  "react",