@radicool/throughline 0.22.0 → 0.24.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.
Files changed (52) hide show
  1. package/README.md +5 -5
  2. package/adapters/codex/prompts/component-builder.md +12 -4
  3. package/adapters/cursor/.cursor/rules/component-builder.mdc +12 -4
  4. package/adapters/generic/skills/component-builder/SKILL.md +12 -4
  5. package/package.json +1 -1
  6. package/references/figma-checks.md +813 -0
  7. package/references/figma-component-standards.md +16 -38
  8. package/references/figma-scripting.md +6 -6
  9. package/references/proof-bundle.md +1 -0
  10. package/references/state-baseline.md +5 -3
  11. package/scripts/README.md +5 -2
  12. package/scripts/build-figma-checks.mjs +111 -0
  13. package/scripts/build-state-baseline.mjs +5 -3
  14. package/scripts/install.mjs +9 -4
  15. package/scripts/lib/component-states.mjs +4 -1
  16. package/scripts/lib/contrast.mjs +5 -2
  17. package/scripts/lib/figma-checks-read.figma.js +174 -0
  18. package/scripts/lib/figma-checks.mjs +385 -0
  19. package/scripts/lib/fixtures/figma-checks/avatar-not-in-table.json +44 -0
  20. package/scripts/lib/fixtures/figma-checks/button-ios-swift-skipped.json +86 -0
  21. package/scripts/lib/fixtures/figma-checks/button-missing-default.json +72 -0
  22. package/scripts/lib/fixtures/figma-checks/button-mui-ring.json +93 -0
  23. package/scripts/lib/fixtures/figma-checks/button-no-focus-variant.json +72 -0
  24. package/scripts/lib/fixtures/figma-checks/button-plain-frames.json +93 -0
  25. package/scripts/lib/fixtures/figma-checks/button-ring-child-not-absolute.json +95 -0
  26. package/scripts/lib/fixtures/figma-checks/button-ring-hidden.json +93 -0
  27. package/scripts/lib/fixtures/figma-checks/button-ring-unbound-colour.json +99 -0
  28. package/scripts/lib/fixtures/figma-checks/button-shadcn-filled.json +93 -0
  29. package/scripts/lib/fixtures/figma-checks/button-sparse.json +135 -0
  30. package/scripts/lib/fixtures/figma-checks/button-spread-zero.json +93 -0
  31. package/scripts/lib/fixtures/figma-checks/button-transparent-ring-child.json +95 -0
  32. package/scripts/lib/fixtures/figma-checks/button-vanilla-inside.json +88 -0
  33. package/scripts/lib/fixtures/figma-checks/button-vanilla-outside.json +88 -0
  34. package/scripts/lib/fixtures/figma-checks/button-wrong-combination.json +93 -0
  35. package/scripts/lib/fixtures/figma-checks/checkbox-checked-axis.real.json +246 -0
  36. package/scripts/lib/fixtures/figma-checks/checkbox-checked-synonym.json +88 -0
  37. package/scripts/lib/fixtures/figma-checks/checkbox-missing-selected.json +80 -0
  38. package/scripts/lib/fixtures/figma-checks/indicator-failed.json +106 -0
  39. package/scripts/lib/fixtures/figma-checks/input-control-layer-missing.json +67 -0
  40. package/scripts/lib/fixtures/figma-checks/input-control-layer-ring-on-wrapper.json +80 -0
  41. package/scripts/lib/fixtures/figma-checks/input-control-layer.json +80 -0
  42. package/scripts/lib/fixtures/figma-checks/input-mui-weight-unbound.json +67 -0
  43. package/scripts/lib/fixtures/figma-checks/input-mui.json +67 -0
  44. package/scripts/lib/fixtures/figma-checks/ring-single-mode.json +112 -0
  45. package/scripts/lib/fixtures/figma-checks/ring-translucent.json +111 -0
  46. package/scripts/lib/fixtures/figma-checks/sample-button.real.json +1498 -0
  47. package/scripts/lib/fixtures/figma-checks/sample-ring-on-muted-raw.json +113 -0
  48. package/scripts/lib/fixtures/figma-checks/sample-ring-passes.json +169 -0
  49. package/scripts/lib/fixtures/figma-checks/surface-missing.json +108 -0
  50. package/scripts/lib/fixtures/figma-checks/surface-single-mode.json +112 -0
  51. package/scripts/lib/fixtures/figma-checks/surface-translucent.json +112 -0
  52. package/scripts/lib/fixtures/figma-checks/zygarden-ring-light-fails.json +113 -0
@@ -0,0 +1,88 @@
1
+ {
2
+ "covers": "checked stands for selected",
3
+ "expect": {
4
+ "name": "Checkbox",
5
+ "matrix": {
6
+ "state": [
7
+ "default",
8
+ "hover",
9
+ "focus",
10
+ "active",
11
+ "checked",
12
+ "disabled"
13
+ ]
14
+ },
15
+ "uiFramework": "shadcn"
16
+ },
17
+ "snapshot": {
18
+ "type": "COMPONENT_SET",
19
+ "variantGroupProperties": {
20
+ "State": {
21
+ "values": [
22
+ "Default",
23
+ "Hover",
24
+ "Focus",
25
+ "Active",
26
+ "Disabled",
27
+ "Checked"
28
+ ]
29
+ }
30
+ },
31
+ "children": [
32
+ {
33
+ "type": "COMPONENT",
34
+ "variantProperties": {
35
+ "State": "Default"
36
+ }
37
+ },
38
+ {
39
+ "type": "COMPONENT",
40
+ "variantProperties": {
41
+ "State": "Hover"
42
+ }
43
+ },
44
+ {
45
+ "type": "COMPONENT",
46
+ "variantProperties": {
47
+ "State": "Focus"
48
+ },
49
+ "effects": [
50
+ {
51
+ "type": "DROP_SHADOW",
52
+ "visible": true,
53
+ "spread": 3,
54
+ "colorVariable": "Color/Border/Focus"
55
+ }
56
+ ],
57
+ "strokeAlign": "INSIDE",
58
+ "strokeVariables": [],
59
+ "strokeWeightBound": false,
60
+ "children": []
61
+ },
62
+ {
63
+ "type": "COMPONENT",
64
+ "variantProperties": {
65
+ "State": "Active"
66
+ }
67
+ },
68
+ {
69
+ "type": "COMPONENT",
70
+ "variantProperties": {
71
+ "State": "Disabled"
72
+ }
73
+ },
74
+ {
75
+ "type": "COMPONENT",
76
+ "variantProperties": {
77
+ "State": "Checked"
78
+ }
79
+ }
80
+ ]
81
+ },
82
+ "expected": {
83
+ "structural-read-back": "pass",
84
+ "state-baseline": "pass",
85
+ "focus-indicator": "pass",
86
+ "focus-contrast": "skip"
87
+ }
88
+ }
@@ -0,0 +1,80 @@
1
+ {
2
+ "covers": "matrix has no selected: state check fails (structural matches its own matrix)",
3
+ "expect": {
4
+ "name": "Checkbox",
5
+ "matrix": {
6
+ "state": [
7
+ "default",
8
+ "hover",
9
+ "focus",
10
+ "active",
11
+ "disabled"
12
+ ]
13
+ },
14
+ "uiFramework": "shadcn"
15
+ },
16
+ "snapshot": {
17
+ "type": "COMPONENT_SET",
18
+ "variantGroupProperties": {
19
+ "State": {
20
+ "values": [
21
+ "Default",
22
+ "Hover",
23
+ "Focus",
24
+ "Active",
25
+ "Disabled"
26
+ ]
27
+ }
28
+ },
29
+ "children": [
30
+ {
31
+ "type": "COMPONENT",
32
+ "variantProperties": {
33
+ "State": "Default"
34
+ }
35
+ },
36
+ {
37
+ "type": "COMPONENT",
38
+ "variantProperties": {
39
+ "State": "Hover"
40
+ }
41
+ },
42
+ {
43
+ "type": "COMPONENT",
44
+ "variantProperties": {
45
+ "State": "Focus"
46
+ },
47
+ "effects": [
48
+ {
49
+ "type": "DROP_SHADOW",
50
+ "visible": true,
51
+ "spread": 3,
52
+ "colorVariable": "Color/Border/Focus"
53
+ }
54
+ ],
55
+ "strokeAlign": "INSIDE",
56
+ "strokeVariables": [],
57
+ "strokeWeightBound": false,
58
+ "children": []
59
+ },
60
+ {
61
+ "type": "COMPONENT",
62
+ "variantProperties": {
63
+ "State": "Active"
64
+ }
65
+ },
66
+ {
67
+ "type": "COMPONENT",
68
+ "variantProperties": {
69
+ "State": "Disabled"
70
+ }
71
+ }
72
+ ]
73
+ },
74
+ "expected": {
75
+ "structural-read-back": "pass",
76
+ "state-baseline": "fail",
77
+ "focus-indicator": "pass",
78
+ "focus-contrast": "skip"
79
+ }
80
+ }
@@ -0,0 +1,106 @@
1
+ {
2
+ "covers": "no ring on the focus variant: focus-indicator fails, so focus-contrast skips",
3
+ "expect": {
4
+ "name": "Button",
5
+ "matrix": {
6
+ "variant": [
7
+ "primary"
8
+ ],
9
+ "state": [
10
+ "default",
11
+ "hover",
12
+ "focus",
13
+ "active",
14
+ "disabled"
15
+ ]
16
+ },
17
+ "uiFramework": "shadcn",
18
+ "surfaces": [
19
+ "color/bg/canvas"
20
+ ]
21
+ },
22
+ "snapshot": {
23
+ "type": "COMPONENT_SET",
24
+ "variantGroupProperties": {
25
+ "Variant": {
26
+ "values": [
27
+ "Primary"
28
+ ]
29
+ },
30
+ "State": {
31
+ "values": [
32
+ "Default",
33
+ "Hover",
34
+ "Focus",
35
+ "Active",
36
+ "Disabled"
37
+ ]
38
+ }
39
+ },
40
+ "children": [
41
+ {
42
+ "type": "COMPONENT",
43
+ "variantProperties": {
44
+ "Variant": "Primary",
45
+ "State": "Default"
46
+ }
47
+ },
48
+ {
49
+ "type": "COMPONENT",
50
+ "variantProperties": {
51
+ "Variant": "Primary",
52
+ "State": "Hover"
53
+ }
54
+ },
55
+ {
56
+ "type": "COMPONENT",
57
+ "variantProperties": {
58
+ "Variant": "Primary",
59
+ "State": "Focus"
60
+ },
61
+ "effects": [
62
+ {
63
+ "type": "DROP_SHADOW",
64
+ "visible": true,
65
+ "spread": 3,
66
+ "colorVariable": null
67
+ }
68
+ ],
69
+ "strokeAlign": "INSIDE",
70
+ "strokeVariables": [],
71
+ "strokeWeightBound": false,
72
+ "children": []
73
+ },
74
+ {
75
+ "type": "COMPONENT",
76
+ "variantProperties": {
77
+ "Variant": "Primary",
78
+ "State": "Active"
79
+ }
80
+ },
81
+ {
82
+ "type": "COMPONENT",
83
+ "variantProperties": {
84
+ "Variant": "Primary",
85
+ "State": "Disabled"
86
+ }
87
+ }
88
+ ],
89
+ "colors": {
90
+ "color/bg/canvas": {
91
+ "modes": {
92
+ "Light": "#ffffff",
93
+ "Dark": "#181818"
94
+ },
95
+ "defaultMode": "Light"
96
+ }
97
+ },
98
+ "missingSurfaces": []
99
+ },
100
+ "expected": {
101
+ "structural-read-back": "pass",
102
+ "state-baseline": "pass",
103
+ "focus-indicator": "fail",
104
+ "focus-contrast": "skip"
105
+ }
106
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "covers": "controlLayer named but absent from the focus variant",
3
+ "expect": {
4
+ "name": "Input",
5
+ "matrix": {
6
+ "state": [
7
+ "default",
8
+ "hover",
9
+ "focus",
10
+ "disabled"
11
+ ]
12
+ },
13
+ "uiFramework": "tailwind",
14
+ "controlLayer": "Control"
15
+ },
16
+ "snapshot": {
17
+ "type": "COMPONENT_SET",
18
+ "variantGroupProperties": {
19
+ "State": {
20
+ "values": [
21
+ "Default",
22
+ "Hover",
23
+ "Focus",
24
+ "Disabled"
25
+ ]
26
+ }
27
+ },
28
+ "children": [
29
+ {
30
+ "type": "COMPONENT",
31
+ "variantProperties": {
32
+ "State": "Default"
33
+ }
34
+ },
35
+ {
36
+ "type": "COMPONENT",
37
+ "variantProperties": {
38
+ "State": "Hover"
39
+ }
40
+ },
41
+ {
42
+ "type": "COMPONENT",
43
+ "variantProperties": {
44
+ "State": "Focus"
45
+ },
46
+ "effects": [],
47
+ "strokeAlign": "INSIDE",
48
+ "strokeVariables": [],
49
+ "strokeWeightBound": false,
50
+ "children": [],
51
+ "controlLayer": null
52
+ },
53
+ {
54
+ "type": "COMPONENT",
55
+ "variantProperties": {
56
+ "State": "Disabled"
57
+ }
58
+ }
59
+ ]
60
+ },
61
+ "expected": {
62
+ "structural-read-back": "pass",
63
+ "state-baseline": "pass",
64
+ "focus-indicator": "fail",
65
+ "focus-contrast": "skip"
66
+ }
67
+ }
@@ -0,0 +1,80 @@
1
+ {
2
+ "covers": "a ring on the wrapper does not count when controlLayer is named",
3
+ "expect": {
4
+ "name": "Input",
5
+ "matrix": {
6
+ "state": [
7
+ "default",
8
+ "hover",
9
+ "focus",
10
+ "disabled"
11
+ ]
12
+ },
13
+ "uiFramework": "tailwind",
14
+ "controlLayer": "Control"
15
+ },
16
+ "snapshot": {
17
+ "type": "COMPONENT_SET",
18
+ "variantGroupProperties": {
19
+ "State": {
20
+ "values": [
21
+ "Default",
22
+ "Hover",
23
+ "Focus",
24
+ "Disabled"
25
+ ]
26
+ }
27
+ },
28
+ "children": [
29
+ {
30
+ "type": "COMPONENT",
31
+ "variantProperties": {
32
+ "State": "Default"
33
+ }
34
+ },
35
+ {
36
+ "type": "COMPONENT",
37
+ "variantProperties": {
38
+ "State": "Hover"
39
+ }
40
+ },
41
+ {
42
+ "type": "COMPONENT",
43
+ "variantProperties": {
44
+ "State": "Focus"
45
+ },
46
+ "effects": [
47
+ {
48
+ "type": "DROP_SHADOW",
49
+ "visible": true,
50
+ "spread": 3,
51
+ "colorVariable": "Color/Border/Focus"
52
+ }
53
+ ],
54
+ "strokeAlign": "INSIDE",
55
+ "strokeVariables": [],
56
+ "strokeWeightBound": false,
57
+ "children": [],
58
+ "controlLayer": {
59
+ "effects": [],
60
+ "strokeAlign": "INSIDE",
61
+ "strokeVariables": [],
62
+ "strokeWeightBound": false,
63
+ "children": []
64
+ }
65
+ },
66
+ {
67
+ "type": "COMPONENT",
68
+ "variantProperties": {
69
+ "State": "Disabled"
70
+ }
71
+ }
72
+ ]
73
+ },
74
+ "expected": {
75
+ "structural-read-back": "pass",
76
+ "state-baseline": "pass",
77
+ "focus-indicator": "fail",
78
+ "focus-contrast": "skip"
79
+ }
80
+ }
@@ -0,0 +1,80 @@
1
+ {
2
+ "covers": "wrapped control: ring checked on the named controlLayer, not on the variant",
3
+ "expect": {
4
+ "name": "Input",
5
+ "matrix": {
6
+ "state": [
7
+ "default",
8
+ "hover",
9
+ "focus",
10
+ "disabled"
11
+ ]
12
+ },
13
+ "uiFramework": "tailwind",
14
+ "controlLayer": "Control"
15
+ },
16
+ "snapshot": {
17
+ "type": "COMPONENT_SET",
18
+ "variantGroupProperties": {
19
+ "State": {
20
+ "values": [
21
+ "Default",
22
+ "Hover",
23
+ "Focus",
24
+ "Disabled"
25
+ ]
26
+ }
27
+ },
28
+ "children": [
29
+ {
30
+ "type": "COMPONENT",
31
+ "variantProperties": {
32
+ "State": "Default"
33
+ }
34
+ },
35
+ {
36
+ "type": "COMPONENT",
37
+ "variantProperties": {
38
+ "State": "Hover"
39
+ }
40
+ },
41
+ {
42
+ "type": "COMPONENT",
43
+ "variantProperties": {
44
+ "State": "Focus"
45
+ },
46
+ "effects": [],
47
+ "strokeAlign": "INSIDE",
48
+ "strokeVariables": [],
49
+ "strokeWeightBound": false,
50
+ "children": [],
51
+ "controlLayer": {
52
+ "effects": [
53
+ {
54
+ "type": "DROP_SHADOW",
55
+ "visible": true,
56
+ "spread": 3,
57
+ "colorVariable": "color/focus/ring"
58
+ }
59
+ ],
60
+ "strokeAlign": "INSIDE",
61
+ "strokeVariables": [],
62
+ "strokeWeightBound": false,
63
+ "children": []
64
+ }
65
+ },
66
+ {
67
+ "type": "COMPONENT",
68
+ "variantProperties": {
69
+ "State": "Disabled"
70
+ }
71
+ }
72
+ ]
73
+ },
74
+ "expected": {
75
+ "structural-read-back": "pass",
76
+ "state-baseline": "pass",
77
+ "focus-indicator": "pass",
78
+ "focus-contrast": "skip"
79
+ }
80
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "covers": "mui input with a bound colour but a raw stroke weight",
3
+ "expect": {
4
+ "name": "Input",
5
+ "matrix": {
6
+ "state": [
7
+ "default",
8
+ "hover",
9
+ "focus",
10
+ "disabled"
11
+ ]
12
+ },
13
+ "uiFramework": "mui"
14
+ },
15
+ "snapshot": {
16
+ "type": "COMPONENT_SET",
17
+ "variantGroupProperties": {
18
+ "State": {
19
+ "values": [
20
+ "Default",
21
+ "Hover",
22
+ "Focus",
23
+ "Disabled"
24
+ ]
25
+ }
26
+ },
27
+ "children": [
28
+ {
29
+ "type": "COMPONENT",
30
+ "variantProperties": {
31
+ "State": "Default"
32
+ }
33
+ },
34
+ {
35
+ "type": "COMPONENT",
36
+ "variantProperties": {
37
+ "State": "Hover"
38
+ }
39
+ },
40
+ {
41
+ "type": "COMPONENT",
42
+ "variantProperties": {
43
+ "State": "Focus"
44
+ },
45
+ "effects": [],
46
+ "strokeAlign": "INSIDE",
47
+ "strokeVariables": [
48
+ "border/focus"
49
+ ],
50
+ "strokeWeightBound": false,
51
+ "children": []
52
+ },
53
+ {
54
+ "type": "COMPONENT",
55
+ "variantProperties": {
56
+ "State": "Disabled"
57
+ }
58
+ }
59
+ ]
60
+ },
61
+ "expected": {
62
+ "structural-read-back": "pass",
63
+ "state-baseline": "pass",
64
+ "focus-indicator": "fail",
65
+ "focus-contrast": "skip"
66
+ }
67
+ }
@@ -0,0 +1,67 @@
1
+ {
2
+ "covers": "mui input: own stroke bound to a focus variable and weight bound",
3
+ "expect": {
4
+ "name": "Text Field",
5
+ "matrix": {
6
+ "state": [
7
+ "default",
8
+ "hover",
9
+ "focus",
10
+ "disabled"
11
+ ]
12
+ },
13
+ "uiFramework": "mui"
14
+ },
15
+ "snapshot": {
16
+ "type": "COMPONENT_SET",
17
+ "variantGroupProperties": {
18
+ "State": {
19
+ "values": [
20
+ "Default",
21
+ "Hover",
22
+ "Focus",
23
+ "Disabled"
24
+ ]
25
+ }
26
+ },
27
+ "children": [
28
+ {
29
+ "type": "COMPONENT",
30
+ "variantProperties": {
31
+ "State": "Default"
32
+ }
33
+ },
34
+ {
35
+ "type": "COMPONENT",
36
+ "variantProperties": {
37
+ "State": "Hover"
38
+ }
39
+ },
40
+ {
41
+ "type": "COMPONENT",
42
+ "variantProperties": {
43
+ "State": "Focus"
44
+ },
45
+ "effects": [],
46
+ "strokeAlign": "INSIDE",
47
+ "strokeVariables": [
48
+ "border/focus"
49
+ ],
50
+ "strokeWeightBound": true,
51
+ "children": []
52
+ },
53
+ {
54
+ "type": "COMPONENT",
55
+ "variantProperties": {
56
+ "State": "Disabled"
57
+ }
58
+ }
59
+ ]
60
+ },
61
+ "expected": {
62
+ "structural-read-back": "pass",
63
+ "state-baseline": "pass",
64
+ "focus-indicator": "pass",
65
+ "focus-contrast": "skip"
66
+ }
67
+ }