@machinemetrics/mm-react-components 1.0.0-rc.0 → 1.0.0-rc.1

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.
@@ -0,0 +1,24 @@
1
+ /**
2
+ * MM React Components - ASCII logo (single source of truth)
3
+ * Used by: npx-init.cjs, init.cjs, install-skill.cjs
4
+ */
5
+
6
+ const ASCII_LOGO = [
7
+ ' ######## #### ',
8
+ ' ########## #### ',
9
+ ' ###### #### # ',
10
+ ' ##### #### #### ',
11
+ ' #### #### #### #### ',
12
+ ' ### #### #### ### ',
13
+ '#### #### #### ####',
14
+ '#### #### #### ####',
15
+ '#### #### #### #### ####',
16
+ ' ####### #### #### ### ',
17
+ ' ###### #### #### #### ',
18
+ ' #### #### #### ##### ',
19
+ ' # #### #### ##### ',
20
+ ' #### ########## ',
21
+ ' ######## ',
22
+ ].join('\n');
23
+
24
+ module.exports = { ASCII_LOGO };
@@ -14,7 +14,10 @@ const fs = require('fs');
14
14
  const path = require('path');
15
15
  const readline = require('readline');
16
16
 
17
+ const { ASCII_LOGO } = require(path.join(__dirname, 'ascii-logo.cjs'));
18
+
17
19
  // Colors for console output
20
+
18
21
  const colors = {
19
22
  reset: '\x1b[0m',
20
23
  bright: '\x1b[1m',
@@ -24,6 +27,10 @@ const colors = {
24
27
  yellow: '\x1b[33m',
25
28
  };
26
29
 
30
+ function logLogo() {
31
+ console.log(`${colors.bright}${colors.green}${ASCII_LOGO}${colors.reset}\n`);
32
+ }
33
+
27
34
  function log(message, color = 'reset') {
28
35
  console.log(`${colors[color]}${message}${colors.reset}`);
29
36
  }
@@ -59,7 +66,8 @@ function askQuestion(question) {
59
66
  }
60
67
 
61
68
  async function main() {
62
- log('🚀 MM React Components - Zero-Config Setup', 'bright');
69
+ logLogo();
70
+ log('MM React Components - Zero-Config Setup', 'bright');
63
71
  log(
64
72
  'Installing MachineMetrics React Components with pre-compiled CSS...\n',
65
73
  'blue',
@@ -25,6 +25,8 @@ const fs = require('fs');
25
25
  const path = require('path');
26
26
  const os = require('os');
27
27
 
28
+ const { ASCII_LOGO } = require(path.join(__dirname, 'ascii-logo.cjs'));
29
+
28
30
  const colors = {
29
31
  reset: '\x1b[0m',
30
32
  bright: '\x1b[1m',
@@ -35,6 +37,10 @@ const colors = {
35
37
  red: '\x1b[31m',
36
38
  };
37
39
 
40
+ function logLogo() {
41
+ console.log(`${colors.bright}${colors.green}${ASCII_LOGO}${colors.reset}\n`);
42
+ }
43
+
38
44
  function log(message, color = 'reset') {
39
45
  console.log(`${colors[color]}${message}${colors.reset}`);
40
46
  }
@@ -70,6 +76,8 @@ function copyRecursive(src, dest) {
70
76
  }
71
77
 
72
78
  function main() {
79
+ logLogo();
80
+
73
81
  const force = process.argv.includes('--force');
74
82
  const target = parseArg('target') || 'cursor';
75
83
  const scope = parseArg('scope') || 'project';
@@ -21,6 +21,8 @@ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
21
21
  const version = packageJson.version;
22
22
 
23
23
  // Colors for console output
24
+ const { ASCII_LOGO } = require(path.join(__dirname, 'ascii-logo.cjs'));
25
+
24
26
  const colors = {
25
27
  reset: '\x1b[0m',
26
28
  bright: '\x1b[1m',
@@ -31,6 +33,10 @@ const colors = {
31
33
  red: '\x1b[31m',
32
34
  };
33
35
 
36
+ function logLogo() {
37
+ console.log(`${colors.bright}${colors.green}${ASCII_LOGO}${colors.reset}\n`);
38
+ }
39
+
34
40
  function log(message, color = 'reset') {
35
41
  console.log(`${colors[color]}${message}${colors.reset}`);
36
42
  }
@@ -94,7 +100,8 @@ function checkReactProject() {
94
100
  }
95
101
 
96
102
  async function main() {
97
- log('🚀 MM React Components - NPX Setup', 'bright');
103
+ logLogo();
104
+ log('MM React Components - NPX Setup', 'bright');
98
105
  log(
99
106
  'Setting up MachineMetrics React Components in your project...\n',
100
107
  'blue',
@@ -346,6 +353,52 @@ document.documentElement.classList.add('carbide');
346
353
  log(' • Dependencies: docs/DEPENDENCIES.md');
347
354
  log(' • GitHub: https://github.com/machinemetrics/mm-react-components');
348
355
 
356
+ // Offer Carbide AI skill installation
357
+ log('\n🤖 Carbide AI skill', 'bright');
358
+ log(
359
+ ' Install the mm-carbide skill so your AI assistant can generate Carbide-styled UIs.\n',
360
+ 'cyan',
361
+ );
362
+ const installSkillAnswer = await askQuestion(
363
+ ' Install the Carbide skill for your AI editor? (y/N): ',
364
+ );
365
+ if (
366
+ installSkillAnswer.toLowerCase() === 'y' ||
367
+ installSkillAnswer.toLowerCase() === 'yes'
368
+ ) {
369
+ const aiPrompt =
370
+ ' Which AI do you use? (1) Cursor (2) VS Code / GitHub Copilot (3) Claude Code (4) Gemini CLI: ';
371
+ const aiAnswer = (await askQuestion(aiPrompt)).trim().toLowerCase();
372
+ const targetMap = {
373
+ '1': 'cursor',
374
+ cursor: 'cursor',
375
+ '2': 'copilot',
376
+ copilot: 'copilot',
377
+ '3': 'claude',
378
+ claude: 'claude',
379
+ '4': 'gemini',
380
+ gemini: 'gemini',
381
+ };
382
+ const target = targetMap[aiAnswer] || 'cursor';
383
+ const installSkillPath = path.join(__dirname, 'install-skill.cjs');
384
+ if (fs.existsSync(installSkillPath)) {
385
+ try {
386
+ execSync(
387
+ `node "${installSkillPath}" --target=${target} --scope=project`,
388
+ { stdio: 'inherit' },
389
+ );
390
+ } catch (err) {
391
+ log(' Could not run skill installer.', 'yellow');
392
+ log(
393
+ ' You can install later: npx @machinemetrics/mm-react-components mm-install-skill --target=<cursor|copilot|claude|gemini>',
394
+ 'cyan',
395
+ );
396
+ }
397
+ } else {
398
+ log(' Skill installer not found; install later with mm-install-skill.', 'yellow');
399
+ }
400
+ }
401
+
349
402
  // Offer Chakra migration if detected
350
403
  if (hasChakra) {
351
404
  log('\n🔄 Chakra UI Detected!', 'yellow');
@@ -1214,6 +1214,28 @@ tr
1214
1214
  [data-slot='tabs-trigger'][data-state='active'] {
1215
1215
  color: var(--foreground);
1216
1216
  }
1217
+ /* =============================
1218
+ DEFAULT BORDER COLOR (border = theme border; no need for border-border)
1219
+ ============================= */
1220
+ .carbide .border,
1221
+ .carbide .border-t,
1222
+ .carbide .border-b,
1223
+ .carbide .border-l,
1224
+ .carbide .border-r,
1225
+ .carbide .border-x,
1226
+ .carbide .border-y,
1227
+ .carbide .border-s,
1228
+ .carbide .border-e {
1229
+ border-color: var(--border);
1230
+ }
1231
+ /* border-2, border-4, etc. when used without a color */
1232
+ .carbide .border-2,
1233
+ .carbide .border-4,
1234
+ .carbide .border-8,
1235
+ .carbide .border-dashed {
1236
+ border-color: var(--border);
1237
+ }
1238
+
1217
1239
  /* =============================
1218
1240
  UTILITY OVERRIDES
1219
1241
  ============================= */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@machinemetrics/mm-react-components",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.0-rc.1",
4
4
  "description": "Industrial-grade React components for manufacturing applications",
5
5
  "keywords": [
6
6
  "react",
@@ -31,8 +31,6 @@
31
31
  },
32
32
  "./styles": "./dist/lib/mm-react-components.css",
33
33
  "./themes/carbide": "./dist/themes/carbide.css",
34
- "./tailwind.config": "./dist/tailwind.base.config.js",
35
- "./docs/tailwind-setup": "./docs/TAILWIND_SETUP.md",
36
34
  "./docs/getting-started": "./dist/docs/GETTING_STARTED.md",
37
35
  "./README": "./dist/README.md",
38
36
  "./migration/config": "./dist/scripts/chakra-to-shadcn-migrator/chakra-to-shadcn.config.json",
@@ -204,8 +202,6 @@
204
202
  "dist",
205
203
  "agent-docs",
206
204
  "src/index.css",
207
- "tailwind.config.export.js",
208
- "docs/TAILWIND_SETUP.md",
209
205
  "README.md",
210
206
  "CHANGELOG.md",
211
207
  "LICENSE"
@@ -1,343 +0,0 @@
1
- # Tailwind CSS Setup for MM React Components
2
-
3
- This guide shows how to configure Tailwind CSS in your consuming application to get the same styling as the component preview interface.
4
-
5
- ## Quick Setup
6
-
7
- ### 1. Install Dependencies
8
-
9
- ```bash
10
- npm install @machinemetrics/mm-react-components tailwindcss postcss autoprefixer
11
- ```
12
-
13
- ### 2. Copy Tailwind Configuration
14
-
15
- Copy the `tailwind.config.export.js` file to your project and rename it to `tailwind.config.js`:
16
-
17
- ```bash
18
- cp node_modules/@machinemetrics/mm-react-components/tailwind.config.export.js tailwind.config.js
19
- ```
20
-
21
- ### 3. Import Theme CSS
22
-
23
- **Option A: Complete All-in-One (Recommended)**
24
-
25
- ```css
26
- /* Import everything in one go - includes Tailwind reset, base theme, and Carbide theme */
27
- @import '@machinemetrics/mm-react-components/themes/complete';
28
- ```
29
-
30
- **Option B: Manual Setup**
31
-
32
- ```css
33
- /* Import base theme */
34
- @import '@machinemetrics/mm-react-components/themes/base';
35
-
36
- /* Import Carbide theme (optional) */
37
- @import '@machinemetrics/mm-react-components/themes/carbide';
38
- ```
39
-
40
- ### 4. Configure PostCSS
41
-
42
- Create or update your `postcss.config.js`:
43
-
44
- ```javascript
45
- export default {
46
- plugins: {
47
- tailwindcss: {},
48
- autoprefixer: {},
49
- },
50
- };
51
- ```
52
-
53
- ## Complete Setup Example
54
-
55
- ### package.json
56
-
57
- ```json
58
- {
59
- "dependencies": {
60
- "@machinemetrics/mm-react-components": "^0.2.1",
61
- "tailwindcss": "^3.4.17",
62
- "postcss": "^8.4.35",
63
- "autoprefixer": "^10.4.17"
64
- }
65
- }
66
- ```
67
-
68
- ### tailwind.config.js
69
-
70
- ```javascript
71
- /** @type {import('tailwindcss').Config} */
72
- export default {
73
- content: [
74
- './src/**/*.{js,ts,jsx,tsx}',
75
- './node_modules/@machinemetrics/mm-react-components/dist/**/*.{js,ts,jsx,tsx}',
76
- ],
77
- theme: {
78
- extend: {
79
- colors: {
80
- background: 'var(--background)',
81
- foreground: 'var(--foreground)',
82
- card: 'var(--card)',
83
- 'card-foreground': 'var(--card-foreground)',
84
- popover: 'var(--popover)',
85
- 'popover-foreground': 'var(--popover-foreground)',
86
- primary: 'var(--primary)',
87
- 'primary-foreground': 'var(--primary-foreground)',
88
- secondary: 'var(--secondary)',
89
- 'secondary-foreground': 'var(--secondary-foreground)',
90
- muted: 'var(--muted)',
91
- 'muted-foreground': 'var(--muted-foreground)',
92
- accent: 'var(--accent)',
93
- 'accent-foreground': 'var(--accent-foreground)',
94
- destructive: 'var(--destructive)',
95
- 'destructive-foreground': 'var(--destructive-foreground)',
96
- border: 'var(--border)',
97
- input: 'var(--input)',
98
- 'bg-input': 'var(--bg-input)',
99
- 'border-input': 'var(--border-input)',
100
- ring: 'var(--ring)',
101
- // Chart colors for data visualization
102
- 'chart-1': 'var(--chart-1)',
103
- 'chart-2': 'var(--chart-2)',
104
- 'chart-3': 'var(--chart-3)',
105
- 'chart-4': 'var(--chart-4)',
106
- 'chart-5': 'var(--chart-5)',
107
- // Sidebar colors
108
- sidebar: 'var(--sidebar)',
109
- 'sidebar-foreground': 'var(--sidebar-foreground)',
110
- 'sidebar-primary': 'var(--sidebar-primary)',
111
- 'sidebar-primary-foreground': 'var(--sidebar-primary-foreground)',
112
- 'sidebar-accent': 'var(--sidebar-accent)',
113
- 'sidebar-accent-foreground': 'var(--sidebar-accent-foreground)',
114
- 'sidebar-border': 'var(--sidebar-border)',
115
- 'sidebar-ring': 'var(--sidebar-ring)',
116
- },
117
- borderRadius: {
118
- sm: 'var(--radius-sm)',
119
- md: 'var(--radius-md)',
120
- lg: 'var(--radius-lg)',
121
- xl: 'var(--radius-xl)',
122
- },
123
- fontFamily: {
124
- sans: [
125
- 'Noto Sans',
126
- 'Inter',
127
- 'ui-sans-serif',
128
- 'system-ui',
129
- '-apple-system',
130
- 'BlinkMacSystemFont',
131
- 'Segoe UI',
132
- 'Roboto',
133
- 'Helvetica Neue',
134
- 'Arial',
135
- 'sans-serif',
136
- 'Apple Color Emoji',
137
- 'Segoe UI Emoji',
138
- 'Segoe UI Symbol',
139
- 'Noto Color Emoji',
140
- ],
141
- mono: [
142
- 'Inconsolata',
143
- 'ui-monospace',
144
- 'SFMono-Regular',
145
- 'Menlo',
146
- 'Monaco',
147
- 'Consolas',
148
- 'Liberation Mono',
149
- 'Courier New',
150
- 'monospace',
151
- ],
152
- },
153
- fontWeight: {
154
- normal: '400',
155
- medium: '500',
156
- semibold: '600',
157
- bold: 'var(--font-weight-bold)',
158
- },
159
- spacing: {
160
- sidebar: '16rem', // 256px for sidebar width
161
- },
162
- animation: {
163
- 'fade-in': 'fadeIn 0.2s ease-in-out',
164
- 'slide-in': 'slideIn 0.3s ease-out',
165
- },
166
- keyframes: {
167
- fadeIn: {
168
- '0%': { opacity: '0' },
169
- '100%': { opacity: '1' },
170
- },
171
- slideIn: {
172
- '0%': { transform: 'translateX(-10px)', opacity: '0' },
173
- '100%': { transform: 'translateX(0)', opacity: '1' },
174
- },
175
- },
176
- },
177
- },
178
- plugins: [
179
- function ({ addUtilities, theme }) {
180
- const newUtilities = {
181
- '.preview-sidebar': {
182
- width: '16rem',
183
- minHeight: '100vh',
184
- backgroundColor: 'var(--muted)',
185
- borderRight: '1px solid var(--border)',
186
- padding: '1rem',
187
- },
188
- '.preview-main': {
189
- flex: '1',
190
- minWidth: '0',
191
- padding: '2rem',
192
- },
193
- '.preview-card': {
194
- backgroundColor: 'var(--card)',
195
- border: '1px solid var(--border)',
196
- borderRadius: 'var(--radius-lg)',
197
- padding: '1.5rem',
198
- },
199
- '.preview-nav-item': {
200
- width: '100%',
201
- textAlign: 'left',
202
- padding: '0.75rem',
203
- borderRadius: '0.375rem',
204
- fontSize: '0.875rem',
205
- fontWeight: '500',
206
- transition: 'colors 0.2s ease-in-out',
207
- '&:hover': {
208
- backgroundColor: 'var(--muted)',
209
- color: 'var(--foreground)',
210
- },
211
- '&.active': {
212
- backgroundColor: 'var(--primary)',
213
- color: 'var(--primary-foreground)',
214
- },
215
- },
216
- };
217
- addUtilities(newUtilities);
218
- },
219
- ],
220
- };
221
- ```
222
-
223
- ### src/index.css
224
-
225
- ```css
226
- @import '@machinemetrics/mm-react-components/themes/base';
227
- @import '@machinemetrics/mm-react-components/themes/carbide';
228
- @import 'tailwindcss';
229
- ```
230
-
231
- ### postcss.config.js
232
-
233
- ```javascript
234
- export default {
235
- plugins: {
236
- tailwindcss: {},
237
- autoprefixer: {},
238
- },
239
- };
240
- ```
241
-
242
- ## Component Preview Interface
243
-
244
- To recreate the component preview interface from the library, use these utility classes:
245
-
246
- ```tsx
247
- // Main layout container
248
- <div className="min-h-screen bg-background flex">
249
- {/* Left Navigation Sidebar */}
250
- <div className="preview-sidebar">
251
- <h1 className="text-xl font-bold text-foreground mb-6">MM Components</h1>
252
-
253
- {/* Theme Toggles */}
254
- <div className="mb-6 space-y-3">
255
- {/* Add your theme toggle components here */}
256
- </div>
257
-
258
- {/* Component Navigation */}
259
- <nav className="space-y-2">
260
- <button className="preview-nav-item active">Button</button>
261
- <button className="preview-nav-item">Input</button>
262
- {/* Add more component navigation items */}
263
- </nav>
264
- </div>
265
-
266
- {/* Main Preview Pane */}
267
- <div className="preview-main">
268
- <div>
269
- <div className="mb-6">
270
- <h2 className="text-2xl font-semibold text-foreground capitalize">
271
- Component Name
272
- </h2>
273
- <p className="text-muted-foreground mt-1">
274
- Preview and test the component
275
- </p>
276
- </div>
277
- <div className="preview-card">{/* Your component preview content */}</div>
278
- </div>
279
- </div>
280
- </div>
281
- ```
282
-
283
- ## Theme Customization
284
-
285
- ### Using Base Theme Only
286
-
287
- ```css
288
- @import '@machinemetrics/mm-react-components/themes/base';
289
- ```
290
-
291
- ### Using Carbide Theme
292
-
293
- ```css
294
- @import '@machinemetrics/mm-react-components/themes/base';
295
- @import '@machinemetrics/mm-react-components/themes/carbide';
296
- ```
297
-
298
- ### Custom Theme Overrides
299
-
300
- You can override theme variables in your CSS:
301
-
302
- ```css
303
- :root {
304
- --primary: #your-custom-color;
305
- --background: #your-custom-background;
306
- /* Override other variables as needed */
307
- }
308
- ```
309
-
310
- ## Available Utility Classes
311
-
312
- The exported configuration includes these custom utility classes:
313
-
314
- - `.preview-sidebar` - Sidebar styling
315
- - `.preview-main` - Main content area styling
316
- - `.preview-card` - Component preview card styling
317
- - `.preview-nav-item` - Navigation item styling
318
-
319
- ## Color System
320
-
321
- The configuration includes a comprehensive color system:
322
-
323
- - **Semantic Colors**: `background`, `foreground`, `primary`, `secondary`, etc.
324
- - **Chart Colors**: `chart-1` through `chart-5` for data visualization
325
- - **Sidebar Colors**: Complete sidebar color system
326
- - **Input Colors**: Specialized input styling colors
327
-
328
- ## Typography
329
-
330
- - **Sans Font**: Noto Sans (primary), Inter, system fonts
331
- - Note: When using `/styles` export, Noto Sans is embedded via @fontsource
332
- - When using `/themes/carbide`, import fonts separately or use Google Fonts CDN
333
- - **Mono Font**: Inconsolata (primary), system monospace fonts
334
- - Note: When using `/styles` export, Inconsolata is embedded via @fontsource
335
- - **Font Weights**: Normal (400), Medium (500), Semibold (600)
336
- - Note: Bold (700) is not used; Carbide theme overrides bold to 600 (semibold)
337
-
338
- ## Animation
339
-
340
- - **Fade In**: `animate-fade-in`
341
- - **Slide In**: `animate-slide-in`
342
-
343
- This configuration ensures your consuming application will have the same professional styling as the component preview interface.
@@ -1,89 +0,0 @@
1
- /** @type {import('tailwindcss').Config} */
2
- export default {
3
- darkMode: 'class',
4
- content: ['./index.html', './src/**/*.{js,ts,jsx,tsx}'],
5
- theme: {
6
- extend: {
7
- colors: {
8
- background: 'var(--background)',
9
- foreground: 'var(--foreground)',
10
- card: 'var(--card)',
11
- 'card-foreground': 'var(--card-foreground)',
12
- popover: 'var(--popover)',
13
- 'popover-foreground': 'var(--popover-foreground)',
14
- primary: 'var(--primary)',
15
- 'primary-foreground': 'var(--primary-foreground)',
16
- secondary: 'var(--secondary)',
17
- 'secondary-foreground': 'var(--secondary-foreground)',
18
- muted: 'var(--muted)',
19
- 'muted-foreground': 'var(--muted-foreground)',
20
- accent: 'var(--accent)',
21
- 'accent-foreground': 'var(--accent-foreground)',
22
- destructive: 'var(--destructive)',
23
- border: 'var(--border)',
24
- input: 'var(--input)',
25
- 'bg-input': 'var(--bg-input)',
26
- 'border-input': 'var(--border-input)',
27
- ring: 'var(--ring)',
28
- },
29
- borderRadius: {
30
- sm: 'var(--radius-sm)',
31
- md: 'var(--radius-md)',
32
- lg: 'var(--radius-lg)',
33
- xl: 'var(--radius-xl)',
34
- },
35
- fontFamily: {
36
- sans: [
37
- 'var(--font-sans)',
38
- 'Noto Sans Variable',
39
- 'Inter',
40
- 'ui-sans-serif',
41
- 'system-ui',
42
- '-apple-system',
43
- 'BlinkMacSystemFont',
44
- 'Segoe UI',
45
- 'Roboto',
46
- 'Helvetica Neue',
47
- 'Arial',
48
- 'sans-serif',
49
- 'Apple Color Emoji',
50
- 'Segoe UI Emoji',
51
- 'Segoe UI Symbol',
52
- 'Noto Color Emoji',
53
- ],
54
- },
55
- fontWeight: {
56
- normal: '400',
57
- medium: '500',
58
- semibold: '600',
59
- bold: 'var(--font-weight-bold)',
60
- },
61
- keyframes: {
62
- 'collapsible-down': {
63
- from: { height: '0' },
64
- to: { height: 'var(--radix-collapsible-content-height)' },
65
- },
66
- 'collapsible-up': {
67
- from: { height: 'var(--radix-collapsible-content-height)' },
68
- to: { height: '0' },
69
- },
70
- 'accordion-down': {
71
- from: { height: '0' },
72
- to: { height: 'var(--radix-accordion-content-height)' },
73
- },
74
- 'accordion-up': {
75
- from: { height: 'var(--radix-accordion-content-height)' },
76
- to: { height: '0' },
77
- },
78
- },
79
- animation: {
80
- 'collapsible-down':
81
- 'collapsible-down 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
82
- 'collapsible-up': 'collapsible-up 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
83
- 'accordion-down': 'accordion-down 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
84
- 'accordion-up': 'accordion-up 0.3s cubic-bezier(0.4, 0, 0.2, 1)',
85
- },
86
- },
87
- },
88
- plugins: [],
89
- };