@machinemetrics/mm-react-components 1.2.1 → 1.2.3

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.
@@ -1 +1 @@
1
- {"version":3,"file":"CardPreview.d.ts","sourceRoot":"","sources":["../../src/preview/CardPreview.tsx"],"names":[],"mappings":"AAcA,MAAM,CAAC,OAAO,UAAU,WAAW,4CAsLlC"}
1
+ {"version":3,"file":"CardPreview.d.ts","sourceRoot":"","sources":["../../src/preview/CardPreview.tsx"],"names":[],"mappings":"AAcA,MAAM,CAAC,OAAO,UAAU,WAAW,4CAkMlC"}
@@ -1,4 +1,6 @@
1
- export type ColorsSection = 'Carbide Palette' | 'Core' | 'Sidebar' | 'Inputs & Surfaces' | 'Tabs' | 'Table' | 'Overlay' | 'Spinner' | 'Charts';
1
+ export type ColorsSection = 'Carbide Palette' | 'Core' | 'Sidebar' | 'Inputs & Surfaces' | 'Tabs' | 'Table' | 'Overlay' | 'Spinner' | 'Charts' | 'Buttons' | 'Code' | 'Style reference';
2
+ /** Page header tab order — single source for `App.tsx` and Colors visual tests. */
3
+ export declare const COLORS_SECTION_ORDER: readonly ["Carbide Palette", "Core", "Sidebar", "Inputs & Surfaces", "Tabs", "Table", "Overlay", "Spinner", "Charts", "Buttons", "Code", "Style reference"];
2
4
  interface ColorsPreviewProps {
3
5
  section?: ColorsSection;
4
6
  }
@@ -1 +1 @@
1
- {"version":3,"file":"ColorsPreview.d.ts","sourceRoot":"","sources":["../../src/preview/ColorsPreview.tsx"],"names":[],"mappings":"AAubA,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,MAAM,GACN,SAAS,GACT,mBAAmB,GACnB,MAAM,GACN,OAAO,GACP,SAAS,GACT,SAAS,GACT,QAAQ,CAAC;AAEb,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,2CAgGpE"}
1
+ {"version":3,"file":"ColorsPreview.d.ts","sourceRoot":"","sources":["../../src/preview/ColorsPreview.tsx"],"names":[],"mappings":"AAOA,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,MAAM,GACN,SAAS,GACT,mBAAmB,GACnB,MAAM,GACN,OAAO,GACP,SAAS,GACT,SAAS,GACT,QAAQ,GACR,SAAS,GACT,MAAM,GACN,iBAAiB,CAAC;AAEtB,mFAAmF;AACnF,eAAO,MAAM,oBAAoB,6JAaY,CAAC;AAE9C,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,UAAU,aAAa,CAAC,EAAE,OAAO,EAAE,EAAE,kBAAkB,2CA0GpE"}
@@ -1 +1 @@
1
- {"version":3,"file":"HoverCardPreview.d.ts","sourceRoot":"","sources":["../../src/preview/HoverCardPreview.tsx"],"names":[],"mappings":"AAYA,MAAM,CAAC,OAAO,UAAU,gBAAgB,4CAmCvC"}
1
+ {"version":3,"file":"HoverCardPreview.d.ts","sourceRoot":"","sources":["../../src/preview/HoverCardPreview.tsx"],"names":[],"mappings":"AAWA,MAAM,CAAC,OAAO,UAAU,gBAAgB,4CAmCvC"}
@@ -1 +1 @@
1
- {"version":3,"file":"SidebarPreview.d.ts","sourceRoot":"","sources":["../../src/preview/SidebarPreview.tsx"],"names":[],"mappings":"AAcA,MAAM,CAAC,OAAO,UAAU,cAAc,4CAwCrC"}
1
+ {"version":3,"file":"SidebarPreview.d.ts","sourceRoot":"","sources":["../../src/preview/SidebarPreview.tsx"],"names":[],"mappings":"AAcA,MAAM,CAAC,OAAO,UAAU,cAAc,4CA2CrC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Semantic Tailwind class probes for Carbide `@theme` tokens (Colors → Style reference).
3
+ * Layout matches other Colors sections (`mmc-colors__*`); swatches use `rounded-full` like
4
+ * the palette, except border/ring probes use `rounded-md` so corners read clearly.
5
+ */
6
+ export declare function StyleReferenceProbesGrid(): import("react/jsx-runtime").JSX.Element;
7
+ //# sourceMappingURL=StyleReferenceProbesGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"StyleReferenceProbesGrid.d.ts","sourceRoot":"","sources":["../../src/preview/StyleReferenceProbesGrid.tsx"],"names":[],"mappings":"AAkBA;;;;GAIG;AACH,wBAAgB,wBAAwB,4CA0DvC"}
@@ -0,0 +1,133 @@
1
+ /**
2
+ * Dev-only: Colors preview token lists + style reference probes.
3
+ * Update when `src/themes/carbide.css` changes (no build step).
4
+ */
5
+ export type TokenGroup = {
6
+ title: string;
7
+ tokens: string[];
8
+ };
9
+ export type ManualToken = {
10
+ name: string;
11
+ light: string;
12
+ dark: string;
13
+ };
14
+ /**
15
+ * Literal class probes for the Style reference tab (see `colors.spec.ts` screenshots).
16
+ * Not derived from carbide.css — class strings must appear as literals in source for the library build.
17
+ */
18
+ /**
19
+ * Slugs for `--color-*` entries in `carbide.css` `@theme inline` (semantic color keys).
20
+ */
21
+ export declare const THEME_INLINE_COLOR_SLUGS: readonly ["background", "foreground", "card", "card-foreground", "popover", "popover-foreground", "primary", "primary-foreground", "secondary", "secondary-foreground", "muted", "muted-foreground", "accent", "accent-foreground", "destructive", "border", "input", "ring", "chart-1", "chart-2", "chart-3", "chart-4", "chart-5", "sidebar", "sidebar-foreground", "sidebar-primary", "sidebar-primary-foreground", "sidebar-accent", "sidebar-accent-foreground", "sidebar-border", "sidebar-ring"];
22
+ export type ThemeInlineColorSlug = (typeof THEME_INLINE_COLOR_SLUGS)[number];
23
+ /**
24
+ * Literal class strings for each `@theme` color (content scan + Playwright).
25
+ * Do not build these with template literals — each class must appear verbatim in source.
26
+ */
27
+ export declare const STYLE_REFERENCE_PROBES: readonly [{
28
+ readonly className: "bg-background";
29
+ readonly kind: "background";
30
+ }, {
31
+ readonly className: "text-foreground";
32
+ readonly kind: "text";
33
+ }, {
34
+ readonly className: "bg-card";
35
+ readonly kind: "background";
36
+ }, {
37
+ readonly className: "text-card-foreground";
38
+ readonly kind: "text";
39
+ }, {
40
+ readonly className: "bg-popover";
41
+ readonly kind: "background";
42
+ }, {
43
+ readonly className: "text-popover-foreground";
44
+ readonly kind: "text";
45
+ }, {
46
+ readonly className: "bg-primary";
47
+ readonly kind: "background";
48
+ }, {
49
+ readonly className: "text-primary-foreground";
50
+ readonly kind: "text";
51
+ }, {
52
+ readonly className: "bg-secondary";
53
+ readonly kind: "background";
54
+ }, {
55
+ readonly className: "text-secondary-foreground";
56
+ readonly kind: "text";
57
+ }, {
58
+ readonly className: "bg-muted";
59
+ readonly kind: "background";
60
+ }, {
61
+ readonly className: "text-muted-foreground";
62
+ readonly kind: "text";
63
+ }, {
64
+ readonly className: "bg-accent";
65
+ readonly kind: "background";
66
+ }, {
67
+ readonly className: "text-accent-foreground";
68
+ readonly kind: "text";
69
+ }, {
70
+ readonly className: "bg-destructive";
71
+ readonly kind: "background";
72
+ }, {
73
+ readonly className: "text-destructive-foreground";
74
+ readonly kind: "text";
75
+ }, {
76
+ readonly className: "border-2 border-border";
77
+ readonly kind: "border";
78
+ }, {
79
+ readonly className: "bg-input";
80
+ readonly kind: "background";
81
+ }, {
82
+ readonly className: "ring-2 ring-ring";
83
+ readonly kind: "ring";
84
+ }, {
85
+ readonly className: "bg-chart-1";
86
+ readonly kind: "background";
87
+ }, {
88
+ readonly className: "bg-chart-2";
89
+ readonly kind: "background";
90
+ }, {
91
+ readonly className: "bg-chart-3";
92
+ readonly kind: "background";
93
+ }, {
94
+ readonly className: "bg-chart-4";
95
+ readonly kind: "background";
96
+ }, {
97
+ readonly className: "bg-chart-5";
98
+ readonly kind: "background";
99
+ }, {
100
+ readonly className: "bg-sidebar";
101
+ readonly kind: "background";
102
+ }, {
103
+ readonly className: "text-sidebar-foreground";
104
+ readonly kind: "text";
105
+ }, {
106
+ readonly className: "bg-sidebar-primary";
107
+ readonly kind: "background";
108
+ }, {
109
+ readonly className: "text-sidebar-primary-foreground";
110
+ readonly kind: "text";
111
+ }, {
112
+ readonly className: "bg-sidebar-accent";
113
+ readonly kind: "background";
114
+ }, {
115
+ readonly className: "text-sidebar-accent-foreground";
116
+ readonly kind: "text";
117
+ }, {
118
+ readonly className: "border-2 border-sidebar-border";
119
+ readonly kind: "border";
120
+ }, {
121
+ readonly className: "ring-2 ring-sidebar-ring";
122
+ readonly kind: "ring";
123
+ }];
124
+ export type StyleProbeKind = 'background' | 'text' | 'border' | 'ring';
125
+ export type StyleReferenceProbe = {
126
+ className: string;
127
+ kind: StyleProbeKind;
128
+ };
129
+ /** Probes used by Colors preview (Style reference tab); covered by `colors.spec.ts` screenshots. */
130
+ export declare function getStyleReferenceProbes(): StyleReferenceProbe[];
131
+ export declare const CARBIDE_TOKEN_GROUPS: TokenGroup[];
132
+ export declare const CARBIDE_MANUAL_SEMANTIC: Record<string, ManualToken[]>;
133
+ //# sourceMappingURL=colors-preview-data.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"colors-preview-data.d.ts","sourceRoot":"","sources":["../../src/preview/colors-preview-data.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,UAAU,GAAG;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,EAAE,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,WAAW,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAExE;;;GAGG;AAEH;;GAEG;AACH,eAAO,MAAM,wBAAwB,yeAgC3B,CAAC;AAEX,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,wBAAwB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE7E;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCzB,CAAC;AAEX,MAAM,MAAM,cAAc,GAAG,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,CAAC;AAEvE,MAAM,MAAM,mBAAmB,GAAG;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,cAAc,CAAC;CACtB,CAAC;AAEF,oGAAoG;AACpG,wBAAgB,uBAAuB,IAAI,mBAAmB,EAAE,CAE/D;AAED,eAAO,MAAM,oBAAoB,EAAE,UAAU,EAsN5C,CAAC;AAEF,eAAO,MAAM,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,EAAE,CA0VjE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@machinemetrics/mm-react-components",
3
- "version": "1.2.1",
3
+ "version": "1.2.3",
4
4
  "description": "Industrial-grade React components for manufacturing applications",
5
5
  "keywords": [
6
6
  "react",
@@ -38,7 +38,8 @@
38
38
  "./README": "./dist/README.md",
39
39
  "./migration/config": "./dist/scripts/chakra-to-shadcn-migrator/chakra-to-shadcn.config.json",
40
40
  "./agent-docs": "./agent-docs/",
41
- "./agent-docs/lovable": "./agent-docs/lovable.md"
41
+ "./agent-docs/lovable": "./agent-docs/lovable.md",
42
+ "./agent-docs/style-color-reference": "./agent-docs/style-color-reference.md"
42
43
  },
43
44
  "engines": {
44
45
  "node": ">=20"
@@ -79,16 +80,16 @@
79
80
  "type-check": "tsc --noEmit",
80
81
  "format": "prettier --write \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
81
82
  "format:check": "prettier --check \"src/**/*.{ts,tsx,js,jsx,json,css,md}\"",
82
- "test": "playwright test",
83
- "test:ui": "playwright test --ui",
84
- "test:headed": "playwright test --headed",
83
+ "test": "playwright test --config=playwright.config.ts --reporter=line",
84
+ "test:ui": "playwright test --config=playwright.config.ts --ui",
85
+ "test:headed": "playwright test --config=playwright.config.ts --headed",
85
86
  "test:visual": "npm run test:visual:light && npm run test:visual:dark",
86
87
  "test:visual:light": "playwright test --config=playwright.config.ts --project=chromium",
87
- "test:visual:dark": "cross-env PLAYWRIGHT_DARK_RUN=1 playwright test --config=playwright.config.ts --project=chromium-dark --workers=1",
88
+ "test:visual:dark": "playwright test --config=playwright.config.ts --project=chromium-dark",
88
89
  "test:visual:ui": "playwright test --config=playwright.config.ts --ui",
89
90
  "test:visual:update": "npm run test:visual:update:light && npm run test:visual:update:dark",
90
91
  "test:visual:update:light": "playwright test --config=playwright.config.ts --project=chromium --update-snapshots",
91
- "test:visual:update:dark": "cross-env PLAYWRIGHT_DARK_RUN=1 playwright test --config=playwright.config.ts --project=chromium-dark --workers=1 --update-snapshots",
92
+ "test:visual:update:dark": "playwright test --config=playwright.config.ts --project=chromium-dark --update-snapshots",
92
93
  "test:visual:ci": "npm run test:visual:light -- --reporter=github && npm run test:visual:dark -- --reporter=github",
93
94
  "update-components": "tsx scripts/update-components.ts",
94
95
  "update-components:bash": "./scripts/update-components.sh",
package/src/index.css CHANGED
@@ -49,6 +49,91 @@
49
49
  border: none;
50
50
  }
51
51
 
52
+ /*
53
+ * Playwright element screenshots use the element's client box; overflow-y-auto on
54
+ * component_preview clips content below the fold. In visual-test mode, grow the
55
+ * preview column to full content height (no internal scroll in that pane).
56
+ * Excludes data-table: that preview needs a fixed viewport + internal scroll.
57
+ */
58
+ html[data-visual-test]
59
+ [data-slot='preview_app_root']:not([data-preview-component='data-table']) {
60
+ height: auto !important;
61
+ min-height: 100dvh !important;
62
+ overflow: visible !important;
63
+ }
64
+
65
+ html[data-visual-test]
66
+ [data-slot='preview_app_root']:not([data-preview-component='data-table'])
67
+ [data-slot='main_content'] {
68
+ align-self: flex-start !important;
69
+ overflow: visible !important;
70
+ }
71
+
72
+ html[data-visual-test]
73
+ [data-slot='preview_app_root']:not([data-preview-component='data-table'])
74
+ [data-slot='preview_column'] {
75
+ flex: 0 0 auto !important;
76
+ min-height: auto !important;
77
+ overflow: visible !important;
78
+ }
79
+
80
+ html[data-visual-test]
81
+ [data-slot='preview_app_root']:not([data-preview-component='data-table'])
82
+ [data-slot='component_preview'] {
83
+ flex: 0 0 auto !important;
84
+ max-height: none !important;
85
+ min-height: auto !important;
86
+ overflow: visible !important;
87
+ }
88
+
89
+ /*
90
+ * CodePreview wraps demos in [data-slot="code-preview-container"] with overflow-x-auto.
91
+ * On most engines that creates a scroll container that also clips overflow on the other axis,
92
+ * so NavigationMenu / dropdown surfaces are cut off in screenshots even when the app root is visible.
93
+ */
94
+ html[data-visual-test] [data-slot='code-preview-container'] {
95
+ overflow: visible !important;
96
+ }
97
+
98
+ /*
99
+ * Mobile Playwright viewports (375–430px): screenshots target the component, not CodePreview
100
+ * chrome (outer padding, card border, inner p-6). Small inset (8px) from the PNG edge for readability.
101
+ * Desktop / author UX unchanged. Skip data-table: its preview relies on full chrome + scroll layout.
102
+ */
103
+ @media (max-width: 480px) {
104
+ html[data-visual-test]
105
+ [data-slot='preview_app_root']:not([data-preview-component='data-table'])
106
+ [data-slot='component_preview'] {
107
+ padding: 8px !important;
108
+ }
109
+
110
+ /* Preview roots use `p-8` + data-testid; avoid matching inner widgets that reuse data-testid. */
111
+ html[data-visual-test]
112
+ [data-slot='preview_app_root']:not([data-preview-component='data-table'])
113
+ [data-slot='component_preview']
114
+ div[data-testid].p-8 {
115
+ padding-left: 0 !important;
116
+ padding-right: 0 !important;
117
+ }
118
+
119
+ html[data-visual-test]
120
+ [data-slot='preview_app_root']:not([data-preview-component='data-table'])
121
+ [data-slot='code-preview-container'] {
122
+ border: none !important;
123
+ border-radius: 0 !important;
124
+ box-shadow: none !important;
125
+ background: transparent !important;
126
+ }
127
+
128
+ html[data-visual-test]
129
+ [data-slot='preview_app_root']:not([data-preview-component='data-table'])
130
+ [data-slot='code-preview-output'] {
131
+ padding-left: 0 !important;
132
+ padding-right: 0 !important;
133
+ border-bottom: none !important;
134
+ }
135
+ }
136
+
52
137
  /* Animated ellipsis for in-progress labels */
53
138
  @keyframes mm-ellipsis {
54
139
  0% {