@radicool/throughline 0.21.4 → 0.23.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 (44) hide show
  1. package/README.md +5 -5
  2. package/adapters/codex/prompts/component-builder.md +12 -7
  3. package/adapters/codex/prompts/token-sync-layer.md +4 -1
  4. package/adapters/cursor/.cursor/rules/component-builder.mdc +12 -7
  5. package/adapters/cursor/.cursor/rules/token-sync-layer.mdc +4 -1
  6. package/adapters/generic/skills/component-builder/SKILL.md +12 -7
  7. package/adapters/generic/skills/token-sync-layer/SKILL.md +4 -1
  8. package/package.json +1 -1
  9. package/references/figma-checks.md +484 -0
  10. package/references/figma-component-standards.md +21 -53
  11. package/references/figma-scripting.md +8 -7
  12. package/references/state-baseline.md +27 -0
  13. package/scripts/README.md +5 -1
  14. package/scripts/build-figma-checks.mjs +98 -0
  15. package/scripts/build-state-baseline.mjs +71 -0
  16. package/scripts/install.mjs +9 -4
  17. package/scripts/lib/component-states.mjs +28 -7
  18. package/scripts/lib/figma-checks-read.figma.js +120 -0
  19. package/scripts/lib/figma-checks.mjs +240 -0
  20. package/scripts/lib/fixtures/figma-checks/avatar-not-in-table.json +43 -0
  21. package/scripts/lib/fixtures/figma-checks/button-ios-swift-skipped.json +85 -0
  22. package/scripts/lib/fixtures/figma-checks/button-missing-default.json +71 -0
  23. package/scripts/lib/fixtures/figma-checks/button-mui-ring.json +92 -0
  24. package/scripts/lib/fixtures/figma-checks/button-no-focus-variant.json +71 -0
  25. package/scripts/lib/fixtures/figma-checks/button-plain-frames.json +92 -0
  26. package/scripts/lib/fixtures/figma-checks/button-ring-child-not-absolute.json +94 -0
  27. package/scripts/lib/fixtures/figma-checks/button-ring-hidden.json +92 -0
  28. package/scripts/lib/fixtures/figma-checks/button-ring-unbound-colour.json +98 -0
  29. package/scripts/lib/fixtures/figma-checks/button-shadcn-filled.json +92 -0
  30. package/scripts/lib/fixtures/figma-checks/button-sparse.json +134 -0
  31. package/scripts/lib/fixtures/figma-checks/button-spread-zero.json +92 -0
  32. package/scripts/lib/fixtures/figma-checks/button-transparent-ring-child.json +94 -0
  33. package/scripts/lib/fixtures/figma-checks/button-vanilla-inside.json +87 -0
  34. package/scripts/lib/fixtures/figma-checks/button-vanilla-outside.json +87 -0
  35. package/scripts/lib/fixtures/figma-checks/button-wrong-combination.json +92 -0
  36. package/scripts/lib/fixtures/figma-checks/checkbox-checked-axis.real.json +245 -0
  37. package/scripts/lib/fixtures/figma-checks/checkbox-checked-synonym.json +87 -0
  38. package/scripts/lib/fixtures/figma-checks/checkbox-missing-selected.json +79 -0
  39. package/scripts/lib/fixtures/figma-checks/input-control-layer-missing.json +66 -0
  40. package/scripts/lib/fixtures/figma-checks/input-control-layer-ring-on-wrapper.json +79 -0
  41. package/scripts/lib/fixtures/figma-checks/input-control-layer.json +79 -0
  42. package/scripts/lib/fixtures/figma-checks/input-mui-weight-unbound.json +66 -0
  43. package/scripts/lib/fixtures/figma-checks/input-mui.json +66 -0
  44. package/scripts/lib/fixtures/figma-checks/sample-button.real.json +1497 -0
@@ -0,0 +1,43 @@
1
+ {
2
+ "covers": "name not in the state table: state and focus checks skip",
3
+ "expect": {
4
+ "name": "Avatar",
5
+ "matrix": {
6
+ "size": [
7
+ "sm",
8
+ "md"
9
+ ]
10
+ },
11
+ "uiFramework": "shadcn"
12
+ },
13
+ "snapshot": {
14
+ "type": "COMPONENT_SET",
15
+ "variantGroupProperties": {
16
+ "Size": {
17
+ "values": [
18
+ "sm",
19
+ "md"
20
+ ]
21
+ }
22
+ },
23
+ "children": [
24
+ {
25
+ "type": "COMPONENT",
26
+ "variantProperties": {
27
+ "Size": "sm"
28
+ }
29
+ },
30
+ {
31
+ "type": "COMPONENT",
32
+ "variantProperties": {
33
+ "Size": "md"
34
+ }
35
+ }
36
+ ]
37
+ },
38
+ "expected": {
39
+ "structural-read-back": "pass",
40
+ "state-baseline": "skip",
41
+ "focus-indicator": "skip"
42
+ }
43
+ }
@@ -0,0 +1,85 @@
1
+ {
2
+ "covers": "framework out of scope: focus check 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": "ios-swift"
18
+ },
19
+ "snapshot": {
20
+ "type": "COMPONENT_SET",
21
+ "variantGroupProperties": {
22
+ "Variant": {
23
+ "values": [
24
+ "Primary"
25
+ ]
26
+ },
27
+ "State": {
28
+ "values": [
29
+ "Default",
30
+ "Hover",
31
+ "Focus",
32
+ "Active",
33
+ "Disabled"
34
+ ]
35
+ }
36
+ },
37
+ "children": [
38
+ {
39
+ "type": "COMPONENT",
40
+ "variantProperties": {
41
+ "Variant": "Primary",
42
+ "State": "Default"
43
+ }
44
+ },
45
+ {
46
+ "type": "COMPONENT",
47
+ "variantProperties": {
48
+ "Variant": "Primary",
49
+ "State": "Hover"
50
+ }
51
+ },
52
+ {
53
+ "type": "COMPONENT",
54
+ "variantProperties": {
55
+ "Variant": "Primary",
56
+ "State": "Focus"
57
+ },
58
+ "effects": [],
59
+ "strokeAlign": "INSIDE",
60
+ "strokeVariables": [],
61
+ "strokeWeightBound": false,
62
+ "children": []
63
+ },
64
+ {
65
+ "type": "COMPONENT",
66
+ "variantProperties": {
67
+ "Variant": "Primary",
68
+ "State": "Active"
69
+ }
70
+ },
71
+ {
72
+ "type": "COMPONENT",
73
+ "variantProperties": {
74
+ "Variant": "Primary",
75
+ "State": "Disabled"
76
+ }
77
+ }
78
+ ]
79
+ },
80
+ "expected": {
81
+ "structural-read-back": "pass",
82
+ "state-baseline": "pass",
83
+ "focus-indicator": "skip"
84
+ }
85
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "covers": "no default on the state axis",
3
+ "expect": {
4
+ "name": "Button",
5
+ "matrix": {
6
+ "state": [
7
+ "hover",
8
+ "focus",
9
+ "active",
10
+ "disabled"
11
+ ]
12
+ },
13
+ "uiFramework": "shadcn"
14
+ },
15
+ "snapshot": {
16
+ "type": "COMPONENT_SET",
17
+ "variantGroupProperties": {
18
+ "State": {
19
+ "values": [
20
+ "Hover",
21
+ "Focus",
22
+ "Active",
23
+ "Disabled"
24
+ ]
25
+ }
26
+ },
27
+ "children": [
28
+ {
29
+ "type": "COMPONENT",
30
+ "variantProperties": {
31
+ "State": "Hover"
32
+ }
33
+ },
34
+ {
35
+ "type": "COMPONENT",
36
+ "variantProperties": {
37
+ "State": "Focus"
38
+ },
39
+ "effects": [
40
+ {
41
+ "type": "DROP_SHADOW",
42
+ "visible": true,
43
+ "spread": 3,
44
+ "colorVariable": "Color/Border/Focus"
45
+ }
46
+ ],
47
+ "strokeAlign": "INSIDE",
48
+ "strokeVariables": [],
49
+ "strokeWeightBound": false,
50
+ "children": []
51
+ },
52
+ {
53
+ "type": "COMPONENT",
54
+ "variantProperties": {
55
+ "State": "Active"
56
+ }
57
+ },
58
+ {
59
+ "type": "COMPONENT",
60
+ "variantProperties": {
61
+ "State": "Disabled"
62
+ }
63
+ }
64
+ ]
65
+ },
66
+ "expected": {
67
+ "structural-read-back": "pass",
68
+ "state-baseline": "fail",
69
+ "focus-indicator": "pass"
70
+ }
71
+ }
@@ -0,0 +1,92 @@
1
+ {
2
+ "covers": "mui on a non-input uses the ring recipe",
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": "mui"
18
+ },
19
+ "snapshot": {
20
+ "type": "COMPONENT_SET",
21
+ "variantGroupProperties": {
22
+ "Variant": {
23
+ "values": [
24
+ "Primary"
25
+ ]
26
+ },
27
+ "State": {
28
+ "values": [
29
+ "Default",
30
+ "Hover",
31
+ "Focus",
32
+ "Active",
33
+ "Disabled"
34
+ ]
35
+ }
36
+ },
37
+ "children": [
38
+ {
39
+ "type": "COMPONENT",
40
+ "variantProperties": {
41
+ "Variant": "Primary",
42
+ "State": "Default"
43
+ }
44
+ },
45
+ {
46
+ "type": "COMPONENT",
47
+ "variantProperties": {
48
+ "Variant": "Primary",
49
+ "State": "Hover"
50
+ }
51
+ },
52
+ {
53
+ "type": "COMPONENT",
54
+ "variantProperties": {
55
+ "Variant": "Primary",
56
+ "State": "Focus"
57
+ },
58
+ "effects": [
59
+ {
60
+ "type": "DROP_SHADOW",
61
+ "visible": true,
62
+ "spread": 3,
63
+ "colorVariable": "Color/Border/Focus"
64
+ }
65
+ ],
66
+ "strokeAlign": "INSIDE",
67
+ "strokeVariables": [],
68
+ "strokeWeightBound": false,
69
+ "children": []
70
+ },
71
+ {
72
+ "type": "COMPONENT",
73
+ "variantProperties": {
74
+ "Variant": "Primary",
75
+ "State": "Active"
76
+ }
77
+ },
78
+ {
79
+ "type": "COMPONENT",
80
+ "variantProperties": {
81
+ "Variant": "Primary",
82
+ "State": "Disabled"
83
+ }
84
+ }
85
+ ]
86
+ },
87
+ "expected": {
88
+ "structural-read-back": "pass",
89
+ "state-baseline": "pass",
90
+ "focus-indicator": "pass"
91
+ }
92
+ }
@@ -0,0 +1,71 @@
1
+ {
2
+ "covers": "zero focus variants on an in-scope component is not a pass",
3
+ "expect": {
4
+ "name": "Button",
5
+ "matrix": {
6
+ "variant": [
7
+ "primary"
8
+ ],
9
+ "state": [
10
+ "default",
11
+ "hover",
12
+ "active",
13
+ "disabled"
14
+ ]
15
+ },
16
+ "uiFramework": "shadcn"
17
+ },
18
+ "snapshot": {
19
+ "type": "COMPONENT_SET",
20
+ "variantGroupProperties": {
21
+ "Variant": {
22
+ "values": [
23
+ "Primary"
24
+ ]
25
+ },
26
+ "State": {
27
+ "values": [
28
+ "Default",
29
+ "Hover",
30
+ "Active",
31
+ "Disabled"
32
+ ]
33
+ }
34
+ },
35
+ "children": [
36
+ {
37
+ "type": "COMPONENT",
38
+ "variantProperties": {
39
+ "Variant": "Primary",
40
+ "State": "Default"
41
+ }
42
+ },
43
+ {
44
+ "type": "COMPONENT",
45
+ "variantProperties": {
46
+ "Variant": "Primary",
47
+ "State": "Hover"
48
+ }
49
+ },
50
+ {
51
+ "type": "COMPONENT",
52
+ "variantProperties": {
53
+ "Variant": "Primary",
54
+ "State": "Active"
55
+ }
56
+ },
57
+ {
58
+ "type": "COMPONENT",
59
+ "variantProperties": {
60
+ "Variant": "Primary",
61
+ "State": "Disabled"
62
+ }
63
+ }
64
+ ]
65
+ },
66
+ "expected": {
67
+ "structural-read-back": "pass",
68
+ "state-baseline": "fail",
69
+ "focus-indicator": "fail"
70
+ }
71
+ }
@@ -0,0 +1,92 @@
1
+ {
2
+ "covers": "plain FRAMEs instead of a COMPONENT_SET of COMPONENTs",
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
+ },
19
+ "snapshot": {
20
+ "type": "FRAME",
21
+ "variantGroupProperties": {
22
+ "Variant": {
23
+ "values": [
24
+ "Primary"
25
+ ]
26
+ },
27
+ "State": {
28
+ "values": [
29
+ "Default",
30
+ "Hover",
31
+ "Focus",
32
+ "Active",
33
+ "Disabled"
34
+ ]
35
+ }
36
+ },
37
+ "children": [
38
+ {
39
+ "type": "FRAME",
40
+ "variantProperties": {
41
+ "Variant": "Primary",
42
+ "State": "Default"
43
+ }
44
+ },
45
+ {
46
+ "type": "FRAME",
47
+ "variantProperties": {
48
+ "Variant": "Primary",
49
+ "State": "Hover"
50
+ }
51
+ },
52
+ {
53
+ "type": "FRAME",
54
+ "variantProperties": {
55
+ "Variant": "Primary",
56
+ "State": "Focus"
57
+ },
58
+ "effects": [
59
+ {
60
+ "type": "DROP_SHADOW",
61
+ "visible": true,
62
+ "spread": 3,
63
+ "colorVariable": "Color/Border/Focus"
64
+ }
65
+ ],
66
+ "strokeAlign": "INSIDE",
67
+ "strokeVariables": [],
68
+ "strokeWeightBound": false,
69
+ "children": []
70
+ },
71
+ {
72
+ "type": "FRAME",
73
+ "variantProperties": {
74
+ "Variant": "Primary",
75
+ "State": "Active"
76
+ }
77
+ },
78
+ {
79
+ "type": "FRAME",
80
+ "variantProperties": {
81
+ "Variant": "Primary",
82
+ "State": "Disabled"
83
+ }
84
+ }
85
+ ]
86
+ },
87
+ "expected": {
88
+ "structural-read-back": "fail",
89
+ "state-baseline": "pass",
90
+ "focus-indicator": "fail"
91
+ }
92
+ }
@@ -0,0 +1,94 @@
1
+ {
2
+ "covers": "ring child that is in flow, not ABSOLUTE",
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
+ },
19
+ "snapshot": {
20
+ "type": "COMPONENT_SET",
21
+ "variantGroupProperties": {
22
+ "Variant": {
23
+ "values": [
24
+ "Primary"
25
+ ]
26
+ },
27
+ "State": {
28
+ "values": [
29
+ "Default",
30
+ "Hover",
31
+ "Focus",
32
+ "Active",
33
+ "Disabled"
34
+ ]
35
+ }
36
+ },
37
+ "children": [
38
+ {
39
+ "type": "COMPONENT",
40
+ "variantProperties": {
41
+ "Variant": "Primary",
42
+ "State": "Default"
43
+ }
44
+ },
45
+ {
46
+ "type": "COMPONENT",
47
+ "variantProperties": {
48
+ "Variant": "Primary",
49
+ "State": "Hover"
50
+ }
51
+ },
52
+ {
53
+ "type": "COMPONENT",
54
+ "variantProperties": {
55
+ "Variant": "Primary",
56
+ "State": "Focus"
57
+ },
58
+ "effects": [],
59
+ "strokeAlign": "INSIDE",
60
+ "strokeVariables": [],
61
+ "strokeWeightBound": false,
62
+ "children": [
63
+ {
64
+ "layoutPositioning": "AUTO",
65
+ "strokeAlign": "OUTSIDE",
66
+ "strokeVariables": [
67
+ "border/focus"
68
+ ],
69
+ "strokeWeightBound": true
70
+ }
71
+ ]
72
+ },
73
+ {
74
+ "type": "COMPONENT",
75
+ "variantProperties": {
76
+ "Variant": "Primary",
77
+ "State": "Active"
78
+ }
79
+ },
80
+ {
81
+ "type": "COMPONENT",
82
+ "variantProperties": {
83
+ "Variant": "Primary",
84
+ "State": "Disabled"
85
+ }
86
+ }
87
+ ]
88
+ },
89
+ "expected": {
90
+ "structural-read-back": "pass",
91
+ "state-baseline": "pass",
92
+ "focus-indicator": "fail"
93
+ }
94
+ }
@@ -0,0 +1,92 @@
1
+ {
2
+ "covers": "shadow with visible: false",
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
+ },
19
+ "snapshot": {
20
+ "type": "COMPONENT_SET",
21
+ "variantGroupProperties": {
22
+ "Variant": {
23
+ "values": [
24
+ "Primary"
25
+ ]
26
+ },
27
+ "State": {
28
+ "values": [
29
+ "Default",
30
+ "Hover",
31
+ "Focus",
32
+ "Active",
33
+ "Disabled"
34
+ ]
35
+ }
36
+ },
37
+ "children": [
38
+ {
39
+ "type": "COMPONENT",
40
+ "variantProperties": {
41
+ "Variant": "Primary",
42
+ "State": "Default"
43
+ }
44
+ },
45
+ {
46
+ "type": "COMPONENT",
47
+ "variantProperties": {
48
+ "Variant": "Primary",
49
+ "State": "Hover"
50
+ }
51
+ },
52
+ {
53
+ "type": "COMPONENT",
54
+ "variantProperties": {
55
+ "Variant": "Primary",
56
+ "State": "Focus"
57
+ },
58
+ "effects": [
59
+ {
60
+ "type": "DROP_SHADOW",
61
+ "visible": false,
62
+ "spread": 3,
63
+ "colorVariable": "Color/Border/Focus"
64
+ }
65
+ ],
66
+ "strokeAlign": "INSIDE",
67
+ "strokeVariables": [],
68
+ "strokeWeightBound": false,
69
+ "children": []
70
+ },
71
+ {
72
+ "type": "COMPONENT",
73
+ "variantProperties": {
74
+ "Variant": "Primary",
75
+ "State": "Active"
76
+ }
77
+ },
78
+ {
79
+ "type": "COMPONENT",
80
+ "variantProperties": {
81
+ "Variant": "Primary",
82
+ "State": "Disabled"
83
+ }
84
+ }
85
+ ]
86
+ },
87
+ "expected": {
88
+ "structural-read-back": "pass",
89
+ "state-baseline": "pass",
90
+ "focus-indicator": "fail"
91
+ }
92
+ }