design-constraint-validator 1.0.0 → 1.1.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 (116) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +215 -659
  3. package/adapters/README.md +46 -46
  4. package/adapters/css.ts +116 -116
  5. package/adapters/js.ts +14 -14
  6. package/adapters/json.ts +45 -45
  7. package/cli/build-css.ts +32 -32
  8. package/cli/commands/build.ts +65 -65
  9. package/cli/commands/graph.d.ts.map +1 -1
  10. package/cli/commands/graph.js +26 -10
  11. package/cli/commands/graph.ts +180 -137
  12. package/cli/commands/index.ts +7 -7
  13. package/cli/commands/patch-apply.ts +80 -80
  14. package/cli/commands/patch.ts +22 -22
  15. package/cli/commands/set.d.ts.map +1 -1
  16. package/cli/commands/set.js +12 -4
  17. package/cli/commands/set.ts +239 -225
  18. package/cli/commands/utils.ts +50 -50
  19. package/cli/commands/validate.d.ts.map +1 -1
  20. package/cli/commands/validate.js +86 -33
  21. package/cli/commands/validate.ts +176 -115
  22. package/cli/commands/why.d.ts.map +1 -1
  23. package/cli/commands/why.js +86 -20
  24. package/cli/commands/why.ts +158 -46
  25. package/cli/config-schema.ts +27 -27
  26. package/cli/config.ts +35 -35
  27. package/cli/constraint-registry.d.ts +101 -0
  28. package/cli/constraint-registry.d.ts.map +1 -0
  29. package/cli/constraint-registry.js +225 -0
  30. package/cli/constraint-registry.ts +304 -0
  31. package/cli/constraints-loader.d.ts +30 -0
  32. package/cli/constraints-loader.d.ts.map +1 -0
  33. package/cli/constraints-loader.js +58 -0
  34. package/cli/constraints-loader.ts +83 -0
  35. package/cli/cross-axis-loader.d.ts +91 -0
  36. package/cli/cross-axis-loader.d.ts.map +1 -0
  37. package/cli/cross-axis-loader.js +222 -0
  38. package/cli/cross-axis-loader.ts +289 -0
  39. package/cli/dcv.js +4 -0
  40. package/cli/dcv.ts +111 -107
  41. package/cli/engine-helpers.d.ts +33 -0
  42. package/cli/engine-helpers.d.ts.map +1 -1
  43. package/cli/engine-helpers.js +87 -22
  44. package/cli/engine-helpers.ts +133 -61
  45. package/cli/graph-poset.ts +74 -74
  46. package/cli/json-output.d.ts +64 -0
  47. package/cli/json-output.d.ts.map +1 -0
  48. package/cli/json-output.js +107 -0
  49. package/cli/json-output.ts +177 -0
  50. package/cli/result.ts +27 -27
  51. package/cli/run.ts +54 -54
  52. package/cli/smoke-test.ts +40 -40
  53. package/cli/types.d.ts +6 -0
  54. package/cli/types.d.ts.map +1 -1
  55. package/cli/types.ts +84 -78
  56. package/core/breakpoints.ts +50 -50
  57. package/core/cli-format.ts +31 -31
  58. package/core/color.ts +148 -148
  59. package/core/constraints/cross-axis.ts +114 -114
  60. package/core/constraints/monotonic-lightness.ts +38 -38
  61. package/core/constraints/monotonic.ts +74 -74
  62. package/core/constraints/threshold.ts +43 -43
  63. package/core/constraints/wcag.ts +70 -70
  64. package/core/cross-axis-config.d.ts +29 -0
  65. package/core/cross-axis-config.d.ts.map +1 -1
  66. package/core/cross-axis-config.js +29 -0
  67. package/core/cross-axis-config.ts +181 -151
  68. package/core/engine.d.ts +95 -0
  69. package/core/engine.d.ts.map +1 -1
  70. package/core/engine.js +22 -0
  71. package/core/engine.ts +167 -65
  72. package/core/flatten.ts +116 -116
  73. package/core/image-export.ts +48 -48
  74. package/core/index.d.ts +9 -30
  75. package/core/index.d.ts.map +1 -1
  76. package/core/index.js +7 -54
  77. package/core/index.ts +10 -72
  78. package/core/patch.ts +134 -134
  79. package/core/poset.ts +311 -311
  80. package/core/why.ts +63 -63
  81. package/package.json +96 -90
  82. package/themes/color.lg.order.json +15 -15
  83. package/themes/color.md.order.json +15 -15
  84. package/themes/color.order.json +15 -15
  85. package/themes/color.sm.order.json +15 -15
  86. package/themes/cross-axis.rules.json +35 -35
  87. package/themes/cross-axis.sm.rules.json +12 -12
  88. package/themes/layout.lg.order.json +18 -18
  89. package/themes/layout.md.order.json +18 -18
  90. package/themes/layout.order.json +18 -18
  91. package/themes/layout.sm.order.json +18 -18
  92. package/themes/spacing.order.json +14 -14
  93. package/themes/typography.lg.order.json +15 -15
  94. package/themes/typography.md.order.json +15 -15
  95. package/themes/typography.order.json +15 -15
  96. package/themes/typography.sm.order.json +15 -15
  97. package/dist/test-overrides-removal.json +0 -4
  98. package/dist/tmp.patch.json +0 -35
  99. package/tokens/overrides/base.json +0 -22
  100. package/tokens/overrides/lg.json +0 -20
  101. package/tokens/overrides/md.json +0 -16
  102. package/tokens/overrides/sm.json +0 -16
  103. package/tokens/overrides/viol.color.json +0 -6
  104. package/tokens/overrides/viol.typography.json +0 -6
  105. package/tokens/tokens.demo-violations.json +0 -116
  106. package/tokens/tokens.example.json +0 -128
  107. package/tokens/tokens.json +0 -67
  108. package/tokens/tokens.multi-violations.json +0 -21
  109. package/tokens/tokens.schema.d.ts +0 -2298
  110. package/tokens/tokens.schema.d.ts.map +0 -1
  111. package/tokens/tokens.schema.js +0 -148
  112. package/tokens/tokens.schema.ts +0 -196
  113. package/tokens/tokens.test.json +0 -38
  114. package/tokens/tokens.touch-violation.json +0 -8
  115. package/tokens/typography.classes.css +0 -11
  116. package/tokens/typography.css +0 -20
@@ -1,67 +0,0 @@
1
- {
2
- "color": {
3
- "palette": {
4
- "brand": {
5
- "600": { "$type": "color", "$value": "#7e3ff2" },
6
- "700": { "$type": "color", "$value": "#6a29e6" }
7
- },
8
- "gray": {
9
- "0": { "$type": "color", "$value": "#fafafa" },
10
- "50": { "$type": "color", "$value": "#f4f4f5" },
11
- "900": { "$type": "color", "$value": "#1e1e20" }
12
- },
13
- "white": { "$type": "color", "$value": "#fff" }
14
- },
15
- "role": {
16
- "text": {
17
- "default": { "$value": "{color.palette.gray.900}" },
18
- "muted": { "$value": "#555b66" }
19
- },
20
- "bg": {
21
- "surface": { "$value": "{color.palette.gray.0}" },
22
- "elevated": { "$value": "{color.palette.gray.50}" }
23
- },
24
- "accent": {
25
- "default": { "$value": "{color.palette.brand.600}" },
26
- "hover": { "$value": "{color.palette.brand.700}" }
27
- },
28
- "on": { "accent": { "$value": "{color.palette.white}" } },
29
- "focus": { "ring": { "$value": "{color.palette.brand.600}" } }
30
- }
31
- },
32
- "size": {
33
- "spacing": {
34
- "2": { "$value": "0.5rem" },
35
- "2-5": { "$value": "0.625rem" },
36
- "3": { "$value": "0.75rem" },
37
- "4": { "$value": "1rem" },
38
- "6": { "$value": "1.5rem" }
39
- },
40
- "radius": { "md": { "$value": "0.5rem" } },
41
- "border": { "1": { "$value": "1px" } },
42
- "offset": { "hairline": { "$value": "1px" } }
43
- },
44
- "motion": {
45
- "duration": { "fast": { "$value": "150ms" } },
46
- "easing": { "standard": { "$value": "cubic-bezier(.2,.9,.1,1)" } },
47
- "depth": { "kick": { "$value": "1px" } }
48
- },
49
- "elevation": { "1": { "$value": "0 1px 2px #0000001a, 0 1px 1px #0000000f" } },
50
- "typography": {
51
- "font": { "sans": { "$value": "system-ui, -apple-system, segoe ui, roboto, sans-serif" } },
52
- "weight": {
53
- "regular": { "$value": 400 },
54
- "medium": { "$value": 500 },
55
- "semibold": { "$value": 600 },
56
- "body": { "$value": 400 }
57
- },
58
- "size": {
59
- "sm": { "$value": "0.875rem" },
60
- "base": { "$value": "1rem" },
61
- "body": { "$value": "16px" },
62
- "h2": { "$value": "20px" },
63
- "h3": { "$value": "18px" }
64
- },
65
- "lineHeight": { "tight": { "$value": "1.25" }, "base": { "$value": "1.6" } }
66
- }
67
- }
@@ -1,21 +0,0 @@
1
- {
2
- "$schemaVersion": "1.0.0",
3
- "control": {
4
- "size": {
5
- "min": { "$type": "dimension", "$value": "30px" }
6
- }
7
- },
8
- "typography": {
9
- "size": {
10
- "h1": { "$type": "fontSize", "$value": "16px" },
11
- "h2": { "$type": "fontSize", "$value": "20px" },
12
- "h3": { "$type": "fontSize", "$value": "18px" }
13
- }
14
- },
15
- "layout": {
16
- "padding": {
17
- "card": { "$type": "dimension", "$value": "24px" },
18
- "chip": { "$type": "dimension", "$value": "32px" }
19
- }
20
- }
21
- }