@machinemetrics/mm-react-components 0.2.3-1 → 0.2.3-10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +96 -30
- 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 +96 -30
- 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/index.d.ts +14 -2
- 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 +10964 -927
- 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/package.json +58 -10
- package/src/index.css +99 -498
- package/dist/index.css +0 -536
- package/dist/tailwind.config.export.js +0 -153
- 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/carbide.css +0 -1257
- package/src/themes/complete.css +0 -8
- 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,283 @@
|
|
|
1
|
+
# MachineMetrics React Components - Initialization Setup
|
|
2
|
+
|
|
3
|
+
## Overview
|
|
4
|
+
|
|
5
|
+
This directory contains comprehensive documentation and tools for setting up the MachineMetrics React Components library. It includes automated scripts, manual setup guides, and troubleshooting resources for AI agents and developers.
|
|
6
|
+
|
|
7
|
+
## Files in This Directory
|
|
8
|
+
|
|
9
|
+
### Documentation Files
|
|
10
|
+
|
|
11
|
+
- **`ai-agent-init-guide.md`** - Comprehensive guide for AI agents on how to set up and use the init script
|
|
12
|
+
- **`setup-reference.md`** - Detailed reference for dependencies, configuration files, and setup procedures
|
|
13
|
+
- **`init-troubleshooting.md`** - Common issues and solutions for init script problems
|
|
14
|
+
- **`README.md`** - This overview file
|
|
15
|
+
|
|
16
|
+
### Scripts and Tools
|
|
17
|
+
|
|
18
|
+
- **`init.cjs`** - Main initialization script (in `scripts/` directory)
|
|
19
|
+
- **`npx-init.cjs`** - NPX-specific initialization script (in `scripts/` directory)
|
|
20
|
+
|
|
21
|
+
## Quick Start
|
|
22
|
+
|
|
23
|
+
### 1. Automated Setup (Preferred)
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
# Run the main init script
|
|
27
|
+
npx @machinemetrics/mm-react-components init
|
|
28
|
+
|
|
29
|
+
# Or use the direct script
|
|
30
|
+
npx mm-init
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. Manual Setup (Complete Control)
|
|
34
|
+
|
|
35
|
+
Follow the detailed instructions in `ai-agent-init-guide.md` for step-by-step manual setup.
|
|
36
|
+
|
|
37
|
+
## What Gets Set Up
|
|
38
|
+
|
|
39
|
+
### Dependencies Installed
|
|
40
|
+
|
|
41
|
+
- **Core Library**: `@machinemetrics/mm-react-components`
|
|
42
|
+
- **Peer Dependencies**: `class-variance-authority`, `clsx`, `tailwind-merge`, `@radix-ui/react-slot`, `lucide-react`
|
|
43
|
+
- **Build Dependencies**: `tailwindcss`, `autoprefixer`, `postcss`
|
|
44
|
+
- **TypeScript Dependencies**: `@types/react`, `@types/react-dom`, `typescript` (if enabled)
|
|
45
|
+
|
|
46
|
+
### Configuration Files Created
|
|
47
|
+
|
|
48
|
+
- **`tailwind.config.js`** - Tailwind CSS configuration with component library paths
|
|
49
|
+
- **`postcss.config.js`** - PostCSS configuration for CSS processing
|
|
50
|
+
- **`src/index.css`** - CSS file with Carbide theme import
|
|
51
|
+
|
|
52
|
+
### Project Structure
|
|
53
|
+
|
|
54
|
+
```
|
|
55
|
+
your-project/
|
|
56
|
+
├── src/
|
|
57
|
+
│ ├── index.css (with Carbide theme import)
|
|
58
|
+
│ ├── App.tsx (with carbide class)
|
|
59
|
+
│ └── Example.tsx (example component)
|
|
60
|
+
├── tailwind.config.js
|
|
61
|
+
├── postcss.config.js
|
|
62
|
+
├── package.json
|
|
63
|
+
└── node_modules/
|
|
64
|
+
└── @machinemetrics/mm-react-components/
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## Framework Support
|
|
68
|
+
|
|
69
|
+
### Supported Frameworks
|
|
70
|
+
|
|
71
|
+
- **React** - Standard React applications
|
|
72
|
+
- **Next.js** - Next.js applications with TypeScript support
|
|
73
|
+
- **Vite** - Vite-based React applications
|
|
74
|
+
- **Create React App** - CRA applications with CRACO support
|
|
75
|
+
|
|
76
|
+
### Framework-Specific Setup
|
|
77
|
+
|
|
78
|
+
Each framework has specific configuration requirements:
|
|
79
|
+
|
|
80
|
+
- **Next.js**: Requires `transpilePackages` configuration
|
|
81
|
+
- **Vite**: Requires CSS processing configuration
|
|
82
|
+
- **CRA**: Requires CRACO for Tailwind support
|
|
83
|
+
|
|
84
|
+
## Usage Examples
|
|
85
|
+
|
|
86
|
+
### Basic Setup
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
# Create new React project
|
|
90
|
+
npx create-react-app my-app --template typescript
|
|
91
|
+
cd my-app
|
|
92
|
+
|
|
93
|
+
# Run init script
|
|
94
|
+
npx @machinemetrics/mm-react-components init
|
|
95
|
+
|
|
96
|
+
# Start development server
|
|
97
|
+
npm start
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Next.js Setup
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Create new Next.js project
|
|
104
|
+
npx create-next-app@latest my-app --typescript --tailwind --eslint
|
|
105
|
+
cd my-app
|
|
106
|
+
|
|
107
|
+
# Run init script
|
|
108
|
+
npx @machinemetrics/mm-react-components init
|
|
109
|
+
|
|
110
|
+
# Start development server
|
|
111
|
+
npm run dev
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
### Vite Setup
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
# Create new Vite project
|
|
118
|
+
npm create vite@latest my-app -- --template react-ts
|
|
119
|
+
cd my-app
|
|
120
|
+
|
|
121
|
+
# Run init script
|
|
122
|
+
npx @machinemetrics/mm-react-components init
|
|
123
|
+
|
|
124
|
+
# Start development server
|
|
125
|
+
npm run dev
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Troubleshooting
|
|
129
|
+
|
|
130
|
+
### Common Issues
|
|
131
|
+
|
|
132
|
+
1. **Script fails with "command not found"**
|
|
133
|
+
- Solution: Install NPX or use npm directly
|
|
134
|
+
|
|
135
|
+
2. **Dependencies not installed**
|
|
136
|
+
- Solution: Clear cache and reinstall
|
|
137
|
+
|
|
138
|
+
3. **CSS not loading**
|
|
139
|
+
- Solution: Ensure Carbide theme is imported and applied
|
|
140
|
+
|
|
141
|
+
4. **Build errors**
|
|
142
|
+
- Solution: Check configuration files and dependencies
|
|
143
|
+
|
|
144
|
+
### Debugging Steps
|
|
145
|
+
|
|
146
|
+
1. **Check dependencies**: `npm list @machinemetrics/mm-react-components`
|
|
147
|
+
2. **Verify configuration**: Check `tailwind.config.js` and `postcss.config.js`
|
|
148
|
+
3. **Test imports**: Try importing a component
|
|
149
|
+
4. **Check CSS**: Ensure theme is imported and applied
|
|
150
|
+
|
|
151
|
+
## AI Agent Usage
|
|
152
|
+
|
|
153
|
+
### For AI Agents
|
|
154
|
+
|
|
155
|
+
AI agents can use these files to:
|
|
156
|
+
|
|
157
|
+
1. **Automated Setup**: Use the main init script for standard setups
|
|
158
|
+
2. **Fallback Setup**: Use the fallback script when main script fails
|
|
159
|
+
3. **Manual Setup**: Follow the detailed guides for complex scenarios
|
|
160
|
+
4. **Troubleshooting**: Use the troubleshooting guide to resolve issues
|
|
161
|
+
|
|
162
|
+
### AI Agent Commands
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
# Automated setup
|
|
166
|
+
node scripts/init.cjs
|
|
167
|
+
|
|
168
|
+
# Or with npx
|
|
169
|
+
npx @machinemetrics/mm-react-components init
|
|
170
|
+
|
|
171
|
+
# Manual setup (follow ai-agent-init-guide.md)
|
|
172
|
+
# 1. Install dependencies
|
|
173
|
+
# 2. Import CSS in your app
|
|
174
|
+
# 3. Add 'carbide' class to root element
|
|
175
|
+
# 4. Test setup
|
|
176
|
+
```
|
|
177
|
+
|
|
178
|
+
## Validation
|
|
179
|
+
|
|
180
|
+
### Setup Validation
|
|
181
|
+
|
|
182
|
+
After setup, verify:
|
|
183
|
+
|
|
184
|
+
- [ ] `@machinemetrics/mm-react-components` is installed
|
|
185
|
+
- [ ] All peer dependencies are installed
|
|
186
|
+
- [ ] CSS file imports the Carbide theme
|
|
187
|
+
- [ ] Tailwind CSS is configured
|
|
188
|
+
- [ ] PostCSS is configured
|
|
189
|
+
- [ ] Root element has `carbide` class
|
|
190
|
+
- [ ] Components can be imported and used
|
|
191
|
+
- [ ] Build process works without errors
|
|
192
|
+
|
|
193
|
+
### Test Component
|
|
194
|
+
|
|
195
|
+
```tsx
|
|
196
|
+
import {
|
|
197
|
+
Button,
|
|
198
|
+
Card,
|
|
199
|
+
CardContent,
|
|
200
|
+
CardHeader,
|
|
201
|
+
CardTitle,
|
|
202
|
+
} from '@machinemetrics/mm-react-components';
|
|
203
|
+
|
|
204
|
+
function TestComponent() {
|
|
205
|
+
return (
|
|
206
|
+
<Card>
|
|
207
|
+
<CardHeader>
|
|
208
|
+
<CardTitle>Setup Test</CardTitle>
|
|
209
|
+
</CardHeader>
|
|
210
|
+
<CardContent>
|
|
211
|
+
<Button>Test Button</Button>
|
|
212
|
+
</CardContent>
|
|
213
|
+
</Card>
|
|
214
|
+
);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
export default TestComponent;
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
## Advanced Configuration
|
|
221
|
+
|
|
222
|
+
### Custom Tailwind Configuration
|
|
223
|
+
|
|
224
|
+
```javascript
|
|
225
|
+
// tailwind.config.js
|
|
226
|
+
module.exports = {
|
|
227
|
+
content: [
|
|
228
|
+
'./src/**/*.{js,ts,jsx,tsx}',
|
|
229
|
+
'./node_modules/@machinemetrics/mm-react-components/dist/**/*.{js,ts,jsx,tsx}',
|
|
230
|
+
],
|
|
231
|
+
theme: {
|
|
232
|
+
extend: {
|
|
233
|
+
// Your custom theme extensions
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
plugins: [
|
|
237
|
+
// Additional Tailwind plugins
|
|
238
|
+
],
|
|
239
|
+
};
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
### Custom CSS Setup
|
|
243
|
+
|
|
244
|
+
```css
|
|
245
|
+
/* src/index.css */
|
|
246
|
+
@import '@machinemetrics/mm-react-components/themes/carbide';
|
|
247
|
+
|
|
248
|
+
/* Custom CSS variables */
|
|
249
|
+
:root {
|
|
250
|
+
--custom-primary: #your-color;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/* Custom component styles */
|
|
254
|
+
.my-custom-component {
|
|
255
|
+
/* Your styles */
|
|
256
|
+
}
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## Support and Resources
|
|
260
|
+
|
|
261
|
+
### Documentation
|
|
262
|
+
|
|
263
|
+
- [Component Library Docs](https://components.machinemetrics.com)
|
|
264
|
+
- [Setup Guide](https://components.machinemetrics.com/setup)
|
|
265
|
+
- [API Reference](https://components.machinemetrics.com/api)
|
|
266
|
+
|
|
267
|
+
### Community Support
|
|
268
|
+
|
|
269
|
+
- [GitHub Issues](https://github.com/machinemetrics/mm-react-components/issues)
|
|
270
|
+
- [Discord Community](https://discord.gg/machinemetrics)
|
|
271
|
+
- [Stack Overflow](https://stackoverflow.com/questions/tagged/machinemetrics)
|
|
272
|
+
|
|
273
|
+
### Professional Support
|
|
274
|
+
|
|
275
|
+
- [MachineMetrics Support](https://support.machinemetrics.com)
|
|
276
|
+
- [Enterprise Support](https://enterprise.machinemetrics.com)
|
|
277
|
+
- [Consulting Services](https://consulting.machinemetrics.com)
|
|
278
|
+
|
|
279
|
+
## Conclusion
|
|
280
|
+
|
|
281
|
+
This initialization setup provides comprehensive tools and documentation for setting up the MachineMetrics React Components library. Whether using automated scripts or manual setup, the goal is to provide a smooth development experience with industrial-grade components.
|
|
282
|
+
|
|
283
|
+
For AI agents, these files provide everything needed to automate the setup process and handle edge cases when the main scripts fail. The fallback script ensures that setup can always be completed, even in complex scenarios.
|