@radicool/throughline 0.23.0 → 0.25.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 (71) hide show
  1. package/README.md +7 -5
  2. package/adapters/codex/AGENTS.md +1 -0
  3. package/adapters/codex/prompts/check-figma.md +41 -0
  4. package/adapters/codex/prompts/component-builder.md +8 -4
  5. package/adapters/cursor/.cursor/commands/check-figma.md +41 -0
  6. package/adapters/cursor/.cursor/rules/component-builder.mdc +8 -4
  7. package/adapters/generic/AGENTS.md +1 -0
  8. package/adapters/generic/commands/check-figma.md +41 -0
  9. package/adapters/generic/skills/component-builder/SKILL.md +8 -4
  10. package/package.json +1 -1
  11. package/references/figma-adherence.md +442 -0
  12. package/references/figma-checks.md +432 -40
  13. package/references/figma-component-standards.md +8 -0
  14. package/references/proof-bundle.md +1 -0
  15. package/scripts/README.md +7 -4
  16. package/scripts/build-figma-checks.mjs +139 -28
  17. package/scripts/install.mjs +5 -1
  18. package/scripts/lib/contrast.mjs +5 -2
  19. package/scripts/lib/figma-adherence-read.figma.js +207 -0
  20. package/scripts/lib/figma-adherence.mjs +146 -0
  21. package/scripts/lib/figma-checks-read.figma.js +68 -14
  22. package/scripts/lib/figma-checks.mjs +173 -17
  23. package/scripts/lib/figma-variables-read.figma.js +39 -0
  24. package/scripts/lib/fixtures/figma-adherence/clean.json +90 -0
  25. package/scripts/lib/fixtures/figma-adherence/detached-library.json +116 -0
  26. package/scripts/lib/fixtures/figma-adherence/ds01-gaps.json +84 -0
  27. package/scripts/lib/fixtures/figma-adherence/inert-all.json +45 -0
  28. package/scripts/lib/fixtures/figma-adherence/mixed-text.json +61 -0
  29. package/scripts/lib/fixtures/figma-adherence/nothing-scanned.json +49 -0
  30. package/scripts/lib/fixtures/figma-adherence/off-scale-gap.json +65 -0
  31. package/scripts/lib/fixtures/figma-adherence/override-raw.json +72 -0
  32. package/scripts/lib/fixtures/figma-adherence/padding-raw.json +74 -0
  33. package/scripts/lib/fixtures/figma-adherence/raw-colour-token.json +70 -0
  34. package/scripts/lib/fixtures/figma-adherence/root-radius.json +88 -0
  35. package/scripts/lib/fixtures/figma-adherence/skip-colour.json +86 -0
  36. package/scripts/lib/fixtures/figma-adherence/zygarden-override-bound.json +85 -0
  37. package/scripts/lib/fixtures/figma-adherence/zygarden-text-raw.json +208 -0
  38. package/scripts/lib/fixtures/figma-checks/avatar-not-in-table.json +2 -1
  39. package/scripts/lib/fixtures/figma-checks/button-ios-swift-skipped.json +2 -1
  40. package/scripts/lib/fixtures/figma-checks/button-missing-default.json +2 -1
  41. package/scripts/lib/fixtures/figma-checks/button-mui-ring.json +2 -1
  42. package/scripts/lib/fixtures/figma-checks/button-no-focus-variant.json +2 -1
  43. package/scripts/lib/fixtures/figma-checks/button-plain-frames.json +2 -1
  44. package/scripts/lib/fixtures/figma-checks/button-ring-child-not-absolute.json +2 -1
  45. package/scripts/lib/fixtures/figma-checks/button-ring-hidden.json +2 -1
  46. package/scripts/lib/fixtures/figma-checks/button-ring-unbound-colour.json +4 -3
  47. package/scripts/lib/fixtures/figma-checks/button-shadcn-filled.json +2 -1
  48. package/scripts/lib/fixtures/figma-checks/button-sparse.json +2 -1
  49. package/scripts/lib/fixtures/figma-checks/button-spread-zero.json +2 -1
  50. package/scripts/lib/fixtures/figma-checks/button-transparent-ring-child.json +2 -1
  51. package/scripts/lib/fixtures/figma-checks/button-vanilla-inside.json +2 -1
  52. package/scripts/lib/fixtures/figma-checks/button-vanilla-outside.json +2 -1
  53. package/scripts/lib/fixtures/figma-checks/button-wrong-combination.json +2 -1
  54. package/scripts/lib/fixtures/figma-checks/checkbox-checked-axis.real.json +2 -1
  55. package/scripts/lib/fixtures/figma-checks/checkbox-checked-synonym.json +2 -1
  56. package/scripts/lib/fixtures/figma-checks/checkbox-missing-selected.json +2 -1
  57. package/scripts/lib/fixtures/figma-checks/indicator-failed.json +106 -0
  58. package/scripts/lib/fixtures/figma-checks/input-control-layer-missing.json +2 -1
  59. package/scripts/lib/fixtures/figma-checks/input-control-layer-ring-on-wrapper.json +2 -1
  60. package/scripts/lib/fixtures/figma-checks/input-control-layer.json +2 -1
  61. package/scripts/lib/fixtures/figma-checks/input-mui-weight-unbound.json +2 -1
  62. package/scripts/lib/fixtures/figma-checks/input-mui.json +2 -1
  63. package/scripts/lib/fixtures/figma-checks/ring-single-mode.json +112 -0
  64. package/scripts/lib/fixtures/figma-checks/ring-translucent.json +111 -0
  65. package/scripts/lib/fixtures/figma-checks/sample-button.real.json +2 -1
  66. package/scripts/lib/fixtures/figma-checks/sample-ring-on-muted-raw.json +113 -0
  67. package/scripts/lib/fixtures/figma-checks/sample-ring-passes.json +169 -0
  68. package/scripts/lib/fixtures/figma-checks/surface-missing.json +108 -0
  69. package/scripts/lib/fixtures/figma-checks/surface-single-mode.json +112 -0
  70. package/scripts/lib/fixtures/figma-checks/surface-translucent.json +112 -0
  71. package/scripts/lib/fixtures/figma-checks/zygarden-ring-light-fails.json +113 -0
@@ -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
+ }
@@ -0,0 +1,113 @@
1
+ {
2
+ "covers": "Zygarden 2026-10-13: color/stroke/focus on color/bg/canvas is 2.378:1 in Light, passes in Dark",
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/stroke/focus"
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/stroke/focus": {
91
+ "modes": {
92
+ "Light": "#14b8d4",
93
+ "Dark": "#22d3ee"
94
+ },
95
+ "defaultMode": "Light"
96
+ },
97
+ "color/bg/canvas": {
98
+ "modes": {
99
+ "Light": "#ffffff",
100
+ "Dark": "#070a10"
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
+ }