@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,113 @@
1
+ {
2
+ "covers": "sample 2026-10-13: color/focus/ring on color/bg/muted is 2.997 in Light: fails raw, prints 2.99",
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/muted"
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": "color/focus/ring"
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/focus/ring": {
91
+ "modes": {
92
+ "Light": "#169c46",
93
+ "Dark": "#1db954"
94
+ },
95
+ "defaultMode": "Light"
96
+ },
97
+ "color/bg/muted": {
98
+ "modes": {
99
+ "Light": "#ebebeb",
100
+ "Dark": "#353535"
101
+ },
102
+ "defaultMode": "Light"
103
+ }
104
+ },
105
+ "missingSurfaces": []
106
+ },
107
+ "expected": {
108
+ "structural-read-back": "pass",
109
+ "state-baseline": "pass",
110
+ "focus-indicator": "pass",
111
+ "focus-contrast": "fail"
112
+ }
113
+ }
@@ -0,0 +1,169 @@
1
+ {
2
+ "covers": "sample 2026-10-13: ring and ringOnFill variants on color/bg/canvas clear 3:1 in both modes",
3
+ "expect": {
4
+ "name": "Button",
5
+ "matrix": {
6
+ "variant": [
7
+ "primary",
8
+ "secondary"
9
+ ],
10
+ "state": [
11
+ "default",
12
+ "hover",
13
+ "focus",
14
+ "active",
15
+ "disabled"
16
+ ]
17
+ },
18
+ "uiFramework": "shadcn",
19
+ "surfaces": [
20
+ "color/bg/canvas"
21
+ ]
22
+ },
23
+ "snapshot": {
24
+ "type": "COMPONENT_SET",
25
+ "variantGroupProperties": {
26
+ "Variant": {
27
+ "values": [
28
+ "Primary",
29
+ "Secondary"
30
+ ]
31
+ },
32
+ "State": {
33
+ "values": [
34
+ "Default",
35
+ "Hover",
36
+ "Focus",
37
+ "Active",
38
+ "Disabled"
39
+ ]
40
+ }
41
+ },
42
+ "children": [
43
+ {
44
+ "type": "COMPONENT",
45
+ "variantProperties": {
46
+ "Variant": "Primary",
47
+ "State": "Default"
48
+ }
49
+ },
50
+ {
51
+ "type": "COMPONENT",
52
+ "variantProperties": {
53
+ "Variant": "Primary",
54
+ "State": "Hover"
55
+ }
56
+ },
57
+ {
58
+ "type": "COMPONENT",
59
+ "variantProperties": {
60
+ "Variant": "Primary",
61
+ "State": "Focus"
62
+ },
63
+ "effects": [
64
+ {
65
+ "type": "DROP_SHADOW",
66
+ "visible": true,
67
+ "spread": 3,
68
+ "colorVariable": "color/focus/ringOnFill"
69
+ }
70
+ ],
71
+ "strokeAlign": "INSIDE",
72
+ "strokeVariables": [],
73
+ "strokeWeightBound": false,
74
+ "children": []
75
+ },
76
+ {
77
+ "type": "COMPONENT",
78
+ "variantProperties": {
79
+ "Variant": "Primary",
80
+ "State": "Active"
81
+ }
82
+ },
83
+ {
84
+ "type": "COMPONENT",
85
+ "variantProperties": {
86
+ "Variant": "Primary",
87
+ "State": "Disabled"
88
+ }
89
+ },
90
+ {
91
+ "type": "COMPONENT",
92
+ "variantProperties": {
93
+ "Variant": "Secondary",
94
+ "State": "Default"
95
+ }
96
+ },
97
+ {
98
+ "type": "COMPONENT",
99
+ "variantProperties": {
100
+ "Variant": "Secondary",
101
+ "State": "Hover"
102
+ }
103
+ },
104
+ {
105
+ "type": "COMPONENT",
106
+ "variantProperties": {
107
+ "Variant": "Secondary",
108
+ "State": "Focus"
109
+ },
110
+ "effects": [
111
+ {
112
+ "type": "DROP_SHADOW",
113
+ "visible": true,
114
+ "spread": 3,
115
+ "colorVariable": "color/focus/ring"
116
+ }
117
+ ],
118
+ "strokeAlign": "INSIDE",
119
+ "strokeVariables": [],
120
+ "strokeWeightBound": false,
121
+ "children": []
122
+ },
123
+ {
124
+ "type": "COMPONENT",
125
+ "variantProperties": {
126
+ "Variant": "Secondary",
127
+ "State": "Active"
128
+ }
129
+ },
130
+ {
131
+ "type": "COMPONENT",
132
+ "variantProperties": {
133
+ "Variant": "Secondary",
134
+ "State": "Disabled"
135
+ }
136
+ }
137
+ ],
138
+ "colors": {
139
+ "color/focus/ring": {
140
+ "modes": {
141
+ "Light": "#169c46",
142
+ "Dark": "#1db954"
143
+ },
144
+ "defaultMode": "Light"
145
+ },
146
+ "color/focus/ringOnFill": {
147
+ "modes": {
148
+ "Light": "#242424",
149
+ "Dark": "#f9f9f9"
150
+ },
151
+ "defaultMode": "Light"
152
+ },
153
+ "color/bg/canvas": {
154
+ "modes": {
155
+ "Light": "#ffffff",
156
+ "Dark": "#181818"
157
+ },
158
+ "defaultMode": "Light"
159
+ }
160
+ },
161
+ "missingSurfaces": []
162
+ },
163
+ "expected": {
164
+ "structural-read-back": "pass",
165
+ "state-baseline": "pass",
166
+ "focus-indicator": "pass",
167
+ "focus-contrast": "pass"
168
+ }
169
+ }
@@ -0,0 +1,108 @@
1
+ {
2
+ "covers": "a named surface with no local colour variable fails, naming it",
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/canvsa"
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": "color/focus/ring"
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/focus/ring": {
91
+ "modes": {
92
+ "Light": "#169c46",
93
+ "Dark": "#1db954"
94
+ },
95
+ "defaultMode": "Light"
96
+ }
97
+ },
98
+ "missingSurfaces": [
99
+ "color/bg/canvsa"
100
+ ]
101
+ },
102
+ "expected": {
103
+ "structural-read-back": "pass",
104
+ "state-baseline": "pass",
105
+ "focus-indicator": "pass",
106
+ "focus-contrast": "fail"
107
+ }
108
+ }
@@ -0,0 +1,112 @@
1
+ {
2
+ "covers": "a single-mode surface is read in both ring modes: 2 pairs, not 3",
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": "color/focus/ring"
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/focus/ring": {
91
+ "modes": {
92
+ "Light": "#169c46",
93
+ "Dark": "#0e6b30"
94
+ },
95
+ "defaultMode": "Light"
96
+ },
97
+ "color/bg/canvas": {
98
+ "modes": {
99
+ "Default": "#ffffff"
100
+ },
101
+ "defaultMode": "Default"
102
+ }
103
+ },
104
+ "missingSurfaces": []
105
+ },
106
+ "expected": {
107
+ "structural-read-back": "pass",
108
+ "state-baseline": "pass",
109
+ "focus-indicator": "pass",
110
+ "focus-contrast": "pass"
111
+ }
112
+ }
@@ -0,0 +1,112 @@
1
+ {
2
+ "covers": "a translucent surface is skipped and counted; nothing compared is a skip",
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/overlay"
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": "color/focus/ring"
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/focus/ring": {
91
+ "modes": {
92
+ "Light": "#169c46",
93
+ "Dark": "#1db954"
94
+ },
95
+ "defaultMode": "Light"
96
+ },
97
+ "color/bg/overlay": {
98
+ "modes": {
99
+ "Default": "#ffffff80"
100
+ },
101
+ "defaultMode": "Default"
102
+ }
103
+ },
104
+ "missingSurfaces": []
105
+ },
106
+ "expected": {
107
+ "structural-read-back": "pass",
108
+ "state-baseline": "pass",
109
+ "focus-indicator": "pass",
110
+ "focus-contrast": "skip"
111
+ }
112
+ }