@elabs-ai/components-process 4.1.0 → 4.2.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@elabs-ai/components-process",
3
- "version": "4.1.0",
3
+ "version": "4.2.0",
4
4
  "license": "MIT",
5
5
  "repository": {
6
6
  "type": "git",
@@ -39,11 +39,11 @@
39
39
  "@xyflow/react": "^12.11.1",
40
40
  "react": "^18.2.0 || ^19.0.0",
41
41
  "react-dom": "^18.2.0 || ^19.0.0",
42
- "@elabs-ai/components-charts": "4.1.0",
43
- "@elabs-ai/components-flow": "4.1.0",
44
- "@elabs-ai/components-data": "4.1.0",
45
- "@elabs-ai/components-tokens": "4.1.0",
46
- "@elabs-ai/components-ui": "4.1.0"
42
+ "@elabs-ai/components-data": "4.2.0",
43
+ "@elabs-ai/components-tokens": "4.2.0",
44
+ "@elabs-ai/components-charts": "4.2.0",
45
+ "@elabs-ai/components-ui": "4.2.0",
46
+ "@elabs-ai/components-flow": "4.2.0"
47
47
  },
48
48
  "devDependencies": {
49
49
  "@testing-library/jest-dom": "^6.6.3",
@@ -59,14 +59,14 @@
59
59
  "tsup": "^8.3.5",
60
60
  "typescript": "^5.7.3",
61
61
  "vitest": "^3.0.2",
62
- "@elabs-ai/components-charts": "4.1.0",
63
- "@elabs-ai/components-data": "4.1.0",
62
+ "@elabs-ai/components-charts": "4.2.0",
63
+ "@elabs-ai/components-data": "4.2.0",
64
64
  "@elabs-ai/components-eslint-config": "0.1.0",
65
- "@elabs-ai/components-flow": "4.1.0",
66
- "@elabs-ai/components-icons": "4.1.0",
65
+ "@elabs-ai/components-flow": "4.2.0",
66
+ "@elabs-ai/components-icons": "4.2.0",
67
+ "@elabs-ai/components-tokens": "4.2.0",
67
68
  "@elabs-ai/components-typescript-config": "0.1.0",
68
- "@elabs-ai/components-ui": "4.1.0",
69
- "@elabs-ai/components-tokens": "4.1.0"
69
+ "@elabs-ai/components-ui": "4.2.0"
70
70
  },
71
71
  "scripts": {
72
72
  "build": "rm -rf dist && tsup",
@@ -0,0 +1,49 @@
1
+ // GENERATED by scripts/gen-contract-tests.mjs — do not edit; re-run the generator instead.
2
+ /**
3
+ * Contract probe for ProcessKpiStrip (`packages/process/src/process-kpi-strip/process-kpi-strip.tsx`), derived from its
4
+ * `Default` story (packages/process/src/process-kpi-strip/process-kpi-strip.stories.tsx). See scripts/gen-contract-tests.mjs.
5
+ */
6
+ import { describe, it, expect, afterEach } from "vitest";
7
+ import { render, cleanup } from "@testing-library/react";
8
+ import { createRef } from "react";
9
+ import * as stories from "../process-kpi-strip/process-kpi-strip.stories";
10
+ import knownFailuresJson from "../../../../scripts/check/contract-known-failures.json";
11
+
12
+ afterEach(cleanup);
13
+
14
+ // Every component here has its own prop/ref/element shape; a generated probe
15
+ // stays generic on purpose (loosely typed, not untyped — see
16
+ // scripts/gen-contract-tests.mjs) rather than re-deriving each one.
17
+ const KNOWN_FAILURES: Record<string, string> = knownFailuresJson;
18
+ const meta = stories.default as { component?: unknown; args?: Record<string, unknown> };
19
+ const Default = (stories as { Default?: { args?: Record<string, unknown> } }).Default;
20
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any -- probe target; see comment above
21
+ const Component = meta.component as any;
22
+ const args = { ...(meta.args ?? {}), ...(Default?.args ?? {}) };
23
+ const isForwardRefComponent = Component?.["$$typeof"] === Symbol.for("react.forward_ref");
24
+
25
+ /** Wrap a known, tracked failure in `it.fails` so fixing it forces the key's removal. */
26
+ function contractIt(assertion: string, name: string, fn: () => void) {
27
+ const key = `process-processkpistrip--default|jsdom|jsdom|${assertion}`;
28
+ const reason = KNOWN_FAILURES[key];
29
+ if (reason) return it.fails(`${name} (known failure: ${reason})`, fn);
30
+ return it(name, fn);
31
+ }
32
+
33
+ describe("ProcessKpiStrip contract", () => {
34
+ it.skipIf(!isForwardRefComponent)("forwards a ref to a DOM element", () => {
35
+ const ref = createRef<Element>();
36
+ render(<Component {...args} ref={ref} />);
37
+ expect(ref.current).toBeInstanceOf(Element);
38
+ });
39
+
40
+ contractIt("className", "merges a caller className onto the root", () => {
41
+ const { container } = render(<Component {...args} className="contract-probe" />);
42
+ expect(container.querySelector(".contract-probe")).not.toBeNull();
43
+ });
44
+
45
+ contractIt("data-slot", 'exposes data-slot="process-kpi-strip" on its root', () => {
46
+ const { container } = render(<Component {...args} />);
47
+ expect(container.querySelector('[data-slot="process-kpi-strip"]')).not.toBeNull();
48
+ });
49
+ });