design-constraint-validator 1.0.0 → 2.0.1
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.
- package/LICENSE +21 -21
- package/README.md +229 -659
- package/adapters/README.md +46 -46
- package/adapters/css.ts +116 -116
- package/adapters/decisionthemes.d.ts +44 -0
- package/adapters/decisionthemes.d.ts.map +1 -0
- package/adapters/decisionthemes.js +35 -0
- package/adapters/decisionthemes.ts +59 -0
- package/adapters/js.ts +14 -14
- package/adapters/json.ts +45 -45
- package/cli/build-css.ts +32 -32
- package/cli/commands/build.ts +65 -65
- package/cli/commands/graph.d.ts.map +1 -1
- package/cli/commands/graph.js +26 -10
- package/cli/commands/graph.ts +180 -137
- package/cli/commands/index.ts +7 -7
- package/cli/commands/patch-apply.ts +80 -80
- package/cli/commands/patch.ts +22 -22
- package/cli/commands/set.d.ts.map +1 -1
- package/cli/commands/set.js +12 -4
- package/cli/commands/set.ts +239 -225
- package/cli/commands/utils.ts +50 -50
- package/cli/commands/validate.d.ts.map +1 -1
- package/cli/commands/validate.js +89 -33
- package/cli/commands/validate.ts +180 -115
- package/cli/commands/why.d.ts.map +1 -1
- package/cli/commands/why.js +86 -20
- package/cli/commands/why.ts +158 -46
- package/cli/config-schema.ts +27 -27
- package/cli/config.ts +35 -35
- package/cli/constraint-registry.d.ts +101 -0
- package/cli/constraint-registry.d.ts.map +1 -0
- package/cli/constraint-registry.js +225 -0
- package/cli/constraint-registry.ts +304 -0
- package/cli/constraints-loader.d.ts.map +1 -0
- package/cli/cross-axis-loader.d.ts +91 -0
- package/cli/cross-axis-loader.d.ts.map +1 -0
- package/cli/cross-axis-loader.js +222 -0
- package/cli/cross-axis-loader.ts +289 -0
- package/cli/dcv.js +4 -0
- package/cli/dcv.ts +111 -107
- package/cli/engine-helpers.d.ts.map +1 -1
- package/cli/graph-poset.ts +74 -74
- package/cli/json-output.d.ts +69 -0
- package/cli/json-output.d.ts.map +1 -0
- package/cli/json-output.js +109 -0
- package/cli/json-output.ts +184 -0
- package/cli/result.ts +27 -27
- package/cli/run.ts +54 -54
- package/cli/smoke-test.ts +40 -40
- package/cli/types.d.ts +6 -0
- package/cli/types.d.ts.map +1 -1
- package/cli/types.ts +84 -78
- package/cli/version-banner.d.ts +20 -0
- package/cli/version-banner.d.ts.map +1 -0
- package/cli/version-banner.js +49 -0
- package/cli/version-banner.ts +61 -0
- package/core/breakpoints.ts +50 -50
- package/core/cli-format.ts +31 -31
- package/core/color.ts +148 -148
- package/core/constraints/cross-axis.ts +114 -114
- package/core/constraints/monotonic-lightness.ts +38 -38
- package/core/constraints/monotonic.ts +74 -74
- package/core/constraints/threshold.ts +43 -43
- package/core/constraints/wcag.ts +70 -70
- package/core/cross-axis-config.d.ts.map +1 -1
- package/core/engine.d.ts +95 -0
- package/core/engine.d.ts.map +1 -1
- package/core/engine.js +22 -0
- package/core/engine.ts +167 -65
- package/core/flatten.ts +116 -116
- package/core/image-export.ts +48 -48
- package/core/index.d.ts +9 -30
- package/core/index.d.ts.map +1 -1
- package/core/index.js +7 -54
- package/core/index.ts +10 -72
- package/core/patch.ts +134 -134
- package/core/poset.ts +311 -311
- package/core/why.ts +63 -63
- package/package.json +96 -90
- package/themes/color.lg.order.json +15 -15
- package/themes/color.md.order.json +15 -15
- package/themes/color.order.json +15 -15
- package/themes/color.sm.order.json +15 -15
- package/themes/cross-axis.rules.json +35 -35
- package/themes/cross-axis.sm.rules.json +12 -12
- package/themes/layout.lg.order.json +18 -18
- package/themes/layout.md.order.json +18 -18
- package/themes/layout.order.json +18 -18
- package/themes/layout.sm.order.json +18 -18
- package/themes/spacing.order.json +14 -14
- package/themes/typography.lg.order.json +15 -15
- package/themes/typography.md.order.json +15 -15
- package/themes/typography.order.json +15 -15
- package/themes/typography.sm.order.json +15 -15
- package/cli/engine-helpers.d.ts +0 -8
- package/cli/engine-helpers.js +0 -70
- package/cli/engine-helpers.ts +0 -61
- package/core/cross-axis-config.d.ts +0 -5
- package/core/cross-axis-config.js +0 -144
- package/core/cross-axis-config.ts +0 -152
- package/dist/test-overrides-removal.json +0 -4
- package/dist/tmp.patch.json +0 -35
- package/tokens/overrides/base.json +0 -22
- package/tokens/overrides/lg.json +0 -20
- package/tokens/overrides/md.json +0 -16
- package/tokens/overrides/sm.json +0 -16
- package/tokens/overrides/viol.color.json +0 -6
- package/tokens/overrides/viol.typography.json +0 -6
- package/tokens/tokens.demo-violations.json +0 -116
- package/tokens/tokens.example.json +0 -128
- package/tokens/tokens.json +0 -67
- package/tokens/tokens.multi-violations.json +0 -21
- package/tokens/tokens.schema.d.ts +0 -2298
- package/tokens/tokens.schema.d.ts.map +0 -1
- package/tokens/tokens.schema.js +0 -148
- package/tokens/tokens.schema.ts +0 -196
- package/tokens/tokens.test.json +0 -38
- package/tokens/tokens.touch-violation.json +0 -8
- package/tokens/typography.classes.css +0 -11
- package/tokens/typography.css +0 -20
package/core/why.ts
CHANGED
|
@@ -1,63 +1,63 @@
|
|
|
1
|
-
import type { FlatToken } from "./flatten.js";
|
|
2
|
-
|
|
3
|
-
export type WhyReport = {
|
|
4
|
-
id: string;
|
|
5
|
-
value: string | number | undefined;
|
|
6
|
-
raw?: string | number;
|
|
7
|
-
refs?: string[];
|
|
8
|
-
provenance: "base" | "theme" | "override" | "unknown";
|
|
9
|
-
dependsOn: string[]; // immediate refs (parents)
|
|
10
|
-
dependents: string[]; // immediate children
|
|
11
|
-
chain?: string[]; // simple linear chain if raw is a single {ref} repeated
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
export function makeReverseEdges(edges: Array<[string,string]>): Map<string, Set<string>> {
|
|
15
|
-
const rev = new Map<string, Set<string>>();
|
|
16
|
-
for (const [from, to] of edges) {
|
|
17
|
-
if (!rev.has(to)) rev.set(to, new Set());
|
|
18
|
-
rev.get(to)!.add(from);
|
|
19
|
-
if (!rev.has(from)) rev.set(from, new Set());
|
|
20
|
-
}
|
|
21
|
-
return rev;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function explain(
|
|
25
|
-
id: string,
|
|
26
|
-
flat: Record<string, FlatToken>,
|
|
27
|
-
edges: Array<[string,string]>,
|
|
28
|
-
layers: { overrides?: Record<string, unknown>, theme?: Record<string, unknown> } = {}
|
|
29
|
-
): WhyReport {
|
|
30
|
-
const node = flat[id];
|
|
31
|
-
const rev = makeReverseEdges(edges);
|
|
32
|
-
const dependsOn = Array.from(rev.get(id) ?? []);
|
|
33
|
-
const dependents = edges.filter(([from, _to]) => from === id).map(([_, to]) => to);
|
|
34
|
-
|
|
35
|
-
const prov: WhyReport["provenance"] =
|
|
36
|
-
layers.overrides && id in layers.overrides ? "override" :
|
|
37
|
-
layers.theme && id in layers.theme ? "theme" :
|
|
38
|
-
flat[id] ? "base" : "unknown";
|
|
39
|
-
|
|
40
|
-
// Try to produce a simple chain if it's a 1→1 alias chain
|
|
41
|
-
const chain: string[] = [id];
|
|
42
|
-
let cursor = id; let guard = 0;
|
|
43
|
-
while (guard++ < 32) {
|
|
44
|
-
const f = flat[cursor];
|
|
45
|
-
if (!f || !Array.isArray(f.refs) || f.refs.length !== 1) break;
|
|
46
|
-
const next = f.refs[0];
|
|
47
|
-
chain.push(next);
|
|
48
|
-
cursor = next;
|
|
49
|
-
const nxt = flat[next];
|
|
50
|
-
if (!nxt || !nxt.refs?.length) break;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
return {
|
|
54
|
-
id,
|
|
55
|
-
value: node?.value,
|
|
56
|
-
raw: node?.raw,
|
|
57
|
-
refs: node?.refs,
|
|
58
|
-
provenance: prov,
|
|
59
|
-
dependsOn,
|
|
60
|
-
dependents,
|
|
61
|
-
chain: chain.length > 1 ? chain : undefined
|
|
62
|
-
};
|
|
63
|
-
}
|
|
1
|
+
import type { FlatToken } from "./flatten.js";
|
|
2
|
+
|
|
3
|
+
export type WhyReport = {
|
|
4
|
+
id: string;
|
|
5
|
+
value: string | number | undefined;
|
|
6
|
+
raw?: string | number;
|
|
7
|
+
refs?: string[];
|
|
8
|
+
provenance: "base" | "theme" | "override" | "unknown";
|
|
9
|
+
dependsOn: string[]; // immediate refs (parents)
|
|
10
|
+
dependents: string[]; // immediate children
|
|
11
|
+
chain?: string[]; // simple linear chain if raw is a single {ref} repeated
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export function makeReverseEdges(edges: Array<[string,string]>): Map<string, Set<string>> {
|
|
15
|
+
const rev = new Map<string, Set<string>>();
|
|
16
|
+
for (const [from, to] of edges) {
|
|
17
|
+
if (!rev.has(to)) rev.set(to, new Set());
|
|
18
|
+
rev.get(to)!.add(from);
|
|
19
|
+
if (!rev.has(from)) rev.set(from, new Set());
|
|
20
|
+
}
|
|
21
|
+
return rev;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function explain(
|
|
25
|
+
id: string,
|
|
26
|
+
flat: Record<string, FlatToken>,
|
|
27
|
+
edges: Array<[string,string]>,
|
|
28
|
+
layers: { overrides?: Record<string, unknown>, theme?: Record<string, unknown> } = {}
|
|
29
|
+
): WhyReport {
|
|
30
|
+
const node = flat[id];
|
|
31
|
+
const rev = makeReverseEdges(edges);
|
|
32
|
+
const dependsOn = Array.from(rev.get(id) ?? []);
|
|
33
|
+
const dependents = edges.filter(([from, _to]) => from === id).map(([_, to]) => to);
|
|
34
|
+
|
|
35
|
+
const prov: WhyReport["provenance"] =
|
|
36
|
+
layers.overrides && id in layers.overrides ? "override" :
|
|
37
|
+
layers.theme && id in layers.theme ? "theme" :
|
|
38
|
+
flat[id] ? "base" : "unknown";
|
|
39
|
+
|
|
40
|
+
// Try to produce a simple chain if it's a 1→1 alias chain
|
|
41
|
+
const chain: string[] = [id];
|
|
42
|
+
let cursor = id; let guard = 0;
|
|
43
|
+
while (guard++ < 32) {
|
|
44
|
+
const f = flat[cursor];
|
|
45
|
+
if (!f || !Array.isArray(f.refs) || f.refs.length !== 1) break;
|
|
46
|
+
const next = f.refs[0];
|
|
47
|
+
chain.push(next);
|
|
48
|
+
cursor = next;
|
|
49
|
+
const nxt = flat[next];
|
|
50
|
+
if (!nxt || !nxt.refs?.length) break;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
id,
|
|
55
|
+
value: node?.value,
|
|
56
|
+
raw: node?.raw,
|
|
57
|
+
refs: node?.refs,
|
|
58
|
+
provenance: prov,
|
|
59
|
+
dependsOn,
|
|
60
|
+
dependents,
|
|
61
|
+
chain: chain.length > 1 ? chain : undefined
|
|
62
|
+
};
|
|
63
|
+
}
|
package/package.json
CHANGED
|
@@ -1,90 +1,96 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "design-constraint-validator",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "Mathematical constraint validator for design systems — ensuring consistency, accessibility, and logical coherence",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"engines": {
|
|
7
|
-
"node": ">=18"
|
|
8
|
-
},
|
|
9
|
-
"main": "core/index.js",
|
|
10
|
-
"types": "core/index.d.ts",
|
|
11
|
-
"exports": {
|
|
12
|
-
".": {
|
|
13
|
-
"types": "./core/index.d.ts",
|
|
14
|
-
"import": "./core/index.js"
|
|
15
|
-
},
|
|
16
|
-
"./core/*": "./core/*",
|
|
17
|
-
"./cli/*": "./cli/*"
|
|
18
|
-
},
|
|
19
|
-
"bin": {
|
|
20
|
-
"dcv": "./cli/index.js",
|
|
21
|
-
"design-constraint-validator": "./cli/index.js"
|
|
22
|
-
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"test": "vitest run",
|
|
25
|
-
"test:watch": "vitest",
|
|
26
|
-
"typecheck": "tsc --noEmit",
|
|
27
|
-
"build": "tsc",
|
|
28
|
-
"lint": "eslint . --ext .js,.ts,.mjs,.cjs",
|
|
29
|
-
"format": "prettier -w .",
|
|
30
|
-
"check": "npm run typecheck && npm run lint && npm test",
|
|
31
|
-
"prepublishOnly": "npm run check && npm run build",
|
|
32
|
-
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
33
|
-
"release:notes": "npm run changelog && git add CHANGELOG.md && git commit -m \"docs(changelog): update\"",
|
|
34
|
-
"release:patch": "npm version patch && git push && git push --tags && echo '\n⚠️ Now run: npm publish'",
|
|
35
|
-
"release:minor": "npm version minor && git push && git push --tags && echo '\n⚠️ Now run: npm publish'",
|
|
36
|
-
"release:major": "npm version major && git push && git push --tags && echo '\n⚠️ Now run: npm publish'"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
"
|
|
81
|
-
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "design-constraint-validator",
|
|
3
|
+
"version": "2.0.1",
|
|
4
|
+
"description": "Mathematical constraint validator for design systems — ensuring consistency, accessibility, and logical coherence",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"engines": {
|
|
7
|
+
"node": ">=18"
|
|
8
|
+
},
|
|
9
|
+
"main": "core/index.js",
|
|
10
|
+
"types": "core/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./core/index.d.ts",
|
|
14
|
+
"import": "./core/index.js"
|
|
15
|
+
},
|
|
16
|
+
"./core/*": "./core/*",
|
|
17
|
+
"./cli/*": "./cli/*"
|
|
18
|
+
},
|
|
19
|
+
"bin": {
|
|
20
|
+
"dcv": "./cli/index.js",
|
|
21
|
+
"design-constraint-validator": "./cli/index.js"
|
|
22
|
+
},
|
|
23
|
+
"scripts": {
|
|
24
|
+
"test": "vitest run",
|
|
25
|
+
"test:watch": "vitest",
|
|
26
|
+
"typecheck": "tsc --noEmit",
|
|
27
|
+
"build": "tsc",
|
|
28
|
+
"lint": "eslint . --ext .js,.ts,.mjs,.cjs",
|
|
29
|
+
"format": "prettier -w .",
|
|
30
|
+
"check": "npm run typecheck && npm run lint && npm test",
|
|
31
|
+
"prepublishOnly": "npm run check && npm run build",
|
|
32
|
+
"changelog": "conventional-changelog -p angular -i CHANGELOG.md -s",
|
|
33
|
+
"release:notes": "npm run changelog && git add CHANGELOG.md && git commit -m \"docs(changelog): update\"",
|
|
34
|
+
"release:patch": "npm version patch && git push && git push --tags && echo '\n⚠️ Now run: npm publish'",
|
|
35
|
+
"release:minor": "npm version minor && git push && git push --tags && echo '\n⚠️ Now run: npm publish'",
|
|
36
|
+
"release:major": "npm version major && git push && git push --tags && echo '\n⚠️ Now run: npm publish'",
|
|
37
|
+
"demo": "cd ../designLab-DEMO && npm run dev",
|
|
38
|
+
"demo:build": "cd ../designLab-DEMO && npm run build",
|
|
39
|
+
"demo:v2": "cd designLab-v2 && npm run dev",
|
|
40
|
+
"demo:v2:build": "cd designLab-v2 && npm run build"
|
|
41
|
+
},
|
|
42
|
+
"keywords": [
|
|
43
|
+
"design-constraints",
|
|
44
|
+
"design-systems",
|
|
45
|
+
"constraint-validation",
|
|
46
|
+
"design-tokens",
|
|
47
|
+
"accessibility",
|
|
48
|
+
"wcag",
|
|
49
|
+
"mathematical-validation",
|
|
50
|
+
"typography",
|
|
51
|
+
"color",
|
|
52
|
+
"monotonicity",
|
|
53
|
+
"cli-tool"
|
|
54
|
+
],
|
|
55
|
+
"author": "Cseperke Papp",
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"repository": {
|
|
58
|
+
"type": "git",
|
|
59
|
+
"url": "https://github.com/CseperkePapp/design-constraint-validator.git"
|
|
60
|
+
},
|
|
61
|
+
"bugs": {
|
|
62
|
+
"url": "https://github.com/CseperkePapp/design-constraint-validator/issues"
|
|
63
|
+
},
|
|
64
|
+
"homepage": "https://github.com/CseperkePapp/design-constraint-validator#readme",
|
|
65
|
+
"sideEffects": false,
|
|
66
|
+
"publishConfig": {
|
|
67
|
+
"access": "public"
|
|
68
|
+
},
|
|
69
|
+
"dependencies": {
|
|
70
|
+
"fast-glob": "^3.3.2",
|
|
71
|
+
"yargs": "^17.0.0",
|
|
72
|
+
"zod": "^3.0.0"
|
|
73
|
+
},
|
|
74
|
+
"devDependencies": {
|
|
75
|
+
"@types/node": "^22.0.0",
|
|
76
|
+
"@types/yargs": "^17.0.0",
|
|
77
|
+
"@typescript-eslint/eslint-plugin": "^8.0.0",
|
|
78
|
+
"@typescript-eslint/parser": "^8.0.0",
|
|
79
|
+
"conventional-changelog-cli": "^2.2.2",
|
|
80
|
+
"eslint": "^9.0.0",
|
|
81
|
+
"eslint-config-prettier": "^9.0.0",
|
|
82
|
+
"pdf-parse": "^2.4.5",
|
|
83
|
+
"prettier": "^3.0.0",
|
|
84
|
+
"tsx": "^4.0.0",
|
|
85
|
+
"typescript": "^5.0.0",
|
|
86
|
+
"vitest": "^3.0.0"
|
|
87
|
+
},
|
|
88
|
+
"files": [
|
|
89
|
+
"cli/",
|
|
90
|
+
"core/",
|
|
91
|
+
"adapters/",
|
|
92
|
+
"themes/",
|
|
93
|
+
"LICENSE",
|
|
94
|
+
"README.md"
|
|
95
|
+
]
|
|
96
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$description": "Color lightness hierarchy constraints - LG breakpoint specific",
|
|
3
|
-
"order": [
|
|
4
|
-
["color.palette.brand.400", ">=", "color.palette.brand.500"],
|
|
5
|
-
["color.palette.brand.500", ">=", "color.palette.brand.600"],
|
|
6
|
-
["color.palette.brand.600", ">=", "color.palette.brand.700"],
|
|
7
|
-
|
|
8
|
-
["color.palette.gray.300", ">=", "color.palette.gray.400"],
|
|
9
|
-
["color.palette.gray.400", ">=", "color.palette.gray.500"],
|
|
10
|
-
["color.palette.gray.500", ">=", "color.palette.gray.600"],
|
|
11
|
-
["color.palette.gray.600", ">=", "color.palette.gray.900"],
|
|
12
|
-
|
|
13
|
-
["color.palette.brand.600", ">=", "color.palette.gray.500"]
|
|
14
|
-
]
|
|
15
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$description": "Color lightness hierarchy constraints - LG breakpoint specific",
|
|
3
|
+
"order": [
|
|
4
|
+
["color.palette.brand.400", ">=", "color.palette.brand.500"],
|
|
5
|
+
["color.palette.brand.500", ">=", "color.palette.brand.600"],
|
|
6
|
+
["color.palette.brand.600", ">=", "color.palette.brand.700"],
|
|
7
|
+
|
|
8
|
+
["color.palette.gray.300", ">=", "color.palette.gray.400"],
|
|
9
|
+
["color.palette.gray.400", ">=", "color.palette.gray.500"],
|
|
10
|
+
["color.palette.gray.500", ">=", "color.palette.gray.600"],
|
|
11
|
+
["color.palette.gray.600", ">=", "color.palette.gray.900"],
|
|
12
|
+
|
|
13
|
+
["color.palette.brand.600", ">=", "color.palette.gray.500"]
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$description": "Color lightness hierarchy constraints - MD breakpoint specific",
|
|
3
|
-
"order": [
|
|
4
|
-
["color.palette.brand.400", ">=", "color.palette.brand.500"],
|
|
5
|
-
["color.palette.brand.500", ">=", "color.palette.brand.600"],
|
|
6
|
-
["color.palette.brand.600", ">=", "color.palette.brand.700"],
|
|
7
|
-
|
|
8
|
-
["color.palette.gray.300", ">=", "color.palette.gray.400"],
|
|
9
|
-
["color.palette.gray.400", ">=", "color.palette.gray.500"],
|
|
10
|
-
["color.palette.gray.500", ">=", "color.palette.gray.600"],
|
|
11
|
-
["color.palette.gray.600", ">=", "color.palette.gray.900"],
|
|
12
|
-
|
|
13
|
-
["color.palette.brand.600", ">=", "color.palette.gray.500"]
|
|
14
|
-
]
|
|
15
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$description": "Color lightness hierarchy constraints - MD breakpoint specific",
|
|
3
|
+
"order": [
|
|
4
|
+
["color.palette.brand.400", ">=", "color.palette.brand.500"],
|
|
5
|
+
["color.palette.brand.500", ">=", "color.palette.brand.600"],
|
|
6
|
+
["color.palette.brand.600", ">=", "color.palette.brand.700"],
|
|
7
|
+
|
|
8
|
+
["color.palette.gray.300", ">=", "color.palette.gray.400"],
|
|
9
|
+
["color.palette.gray.400", ">=", "color.palette.gray.500"],
|
|
10
|
+
["color.palette.gray.500", ">=", "color.palette.gray.600"],
|
|
11
|
+
["color.palette.gray.600", ">=", "color.palette.gray.900"],
|
|
12
|
+
|
|
13
|
+
["color.palette.brand.600", ">=", "color.palette.gray.500"]
|
|
14
|
+
]
|
|
15
|
+
}
|
package/themes/color.order.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$description": "Color lightness hierarchy constraints - comprehensive brand and gray ladders with bridge constraints",
|
|
3
|
-
"order": [
|
|
4
|
-
["color.palette.brand.400", ">=", "color.palette.brand.500"],
|
|
5
|
-
["color.palette.brand.500", ">=", "color.palette.brand.600"],
|
|
6
|
-
["color.palette.brand.600", ">=", "color.palette.brand.700"],
|
|
7
|
-
|
|
8
|
-
["color.palette.gray.300", ">=", "color.palette.gray.400"],
|
|
9
|
-
["color.palette.gray.400", ">=", "color.palette.gray.500"],
|
|
10
|
-
["color.palette.gray.500", ">=", "color.palette.gray.600"],
|
|
11
|
-
["color.palette.gray.600", ">=", "color.palette.gray.900"],
|
|
12
|
-
|
|
13
|
-
["color.palette.brand.600", ">=", "color.palette.gray.500"]
|
|
14
|
-
]
|
|
15
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$description": "Color lightness hierarchy constraints - comprehensive brand and gray ladders with bridge constraints",
|
|
3
|
+
"order": [
|
|
4
|
+
["color.palette.brand.400", ">=", "color.palette.brand.500"],
|
|
5
|
+
["color.palette.brand.500", ">=", "color.palette.brand.600"],
|
|
6
|
+
["color.palette.brand.600", ">=", "color.palette.brand.700"],
|
|
7
|
+
|
|
8
|
+
["color.palette.gray.300", ">=", "color.palette.gray.400"],
|
|
9
|
+
["color.palette.gray.400", ">=", "color.palette.gray.500"],
|
|
10
|
+
["color.palette.gray.500", ">=", "color.palette.gray.600"],
|
|
11
|
+
["color.palette.gray.600", ">=", "color.palette.gray.900"],
|
|
12
|
+
|
|
13
|
+
["color.palette.brand.600", ">=", "color.palette.gray.500"]
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$description": "Color lightness hierarchy constraints - SM breakpoint specific",
|
|
3
|
-
"order": [
|
|
4
|
-
["color.palette.brand.400", ">=", "color.palette.brand.500"],
|
|
5
|
-
["color.palette.brand.500", ">=", "color.palette.brand.600"],
|
|
6
|
-
["color.palette.brand.600", ">=", "color.palette.brand.700"],
|
|
7
|
-
|
|
8
|
-
["color.palette.gray.300", ">=", "color.palette.gray.400"],
|
|
9
|
-
["color.palette.gray.400", ">=", "color.palette.gray.500"],
|
|
10
|
-
["color.palette.gray.500", ">=", "color.palette.gray.600"],
|
|
11
|
-
["color.palette.gray.600", ">=", "color.palette.gray.900"],
|
|
12
|
-
|
|
13
|
-
["color.palette.brand.600", ">=", "color.palette.gray.500"]
|
|
14
|
-
]
|
|
15
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$description": "Color lightness hierarchy constraints - SM breakpoint specific",
|
|
3
|
+
"order": [
|
|
4
|
+
["color.palette.brand.400", ">=", "color.palette.brand.500"],
|
|
5
|
+
["color.palette.brand.500", ">=", "color.palette.brand.600"],
|
|
6
|
+
["color.palette.brand.600", ">=", "color.palette.brand.700"],
|
|
7
|
+
|
|
8
|
+
["color.palette.gray.300", ">=", "color.palette.gray.400"],
|
|
9
|
+
["color.palette.gray.400", ">=", "color.palette.gray.500"],
|
|
10
|
+
["color.palette.gray.500", ">=", "color.palette.gray.600"],
|
|
11
|
+
["color.palette.gray.600", ">=", "color.palette.gray.900"],
|
|
12
|
+
|
|
13
|
+
["color.palette.brand.600", ">=", "color.palette.gray.500"]
|
|
14
|
+
]
|
|
15
|
+
}
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"rules": [
|
|
3
|
-
{
|
|
4
|
-
"id": "body-weight-vs-size",
|
|
5
|
-
"level": "error",
|
|
6
|
-
"where": "Body legibility",
|
|
7
|
-
"when": { "id": "typography.weight.body", "op": "<=", "value": 400 },
|
|
8
|
-
"require": { "id": "typography.size.body", "op": ">=", "fallback": "16px" }
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"id": "emphasis-weight-size-balance",
|
|
12
|
-
"level": "warn",
|
|
13
|
-
"where": "Legibility emphasis",
|
|
14
|
-
"when": { "id": "typography.weight.emphasis", "op": ">=", "value": 600 },
|
|
15
|
-
"require": { "id": "typography.size.body", "op": ">=", "fallback": "15px" }
|
|
16
|
-
},
|
|
17
|
-
{
|
|
18
|
-
"id": "heading-emphasis-h2",
|
|
19
|
-
"level": "warn",
|
|
20
|
-
"where": "Heading emphasis",
|
|
21
|
-
"compare": { "a": "typography.size.h2", "op": ">=", "b": "typography.size.body", "delta": "2px" }
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"id": "heading-emphasis-h3",
|
|
25
|
-
"level": "warn",
|
|
26
|
-
"where": "Heading emphasis",
|
|
27
|
-
"compare": { "a": "typography.size.h3", "op": ">=", "b": "typography.size.body", "delta": "2px" }
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"id": "layout-padding-vs-container",
|
|
31
|
-
"level": "warn",
|
|
32
|
-
"where": "Layout density",
|
|
33
|
-
"compare": { "a": "layout.padding.section", "op": "<=", "b": "layout.container.sm", "delta": "-560px" }
|
|
34
|
-
}
|
|
35
|
-
]
|
|
1
|
+
{
|
|
2
|
+
"rules": [
|
|
3
|
+
{
|
|
4
|
+
"id": "body-weight-vs-size",
|
|
5
|
+
"level": "error",
|
|
6
|
+
"where": "Body legibility",
|
|
7
|
+
"when": { "id": "typography.weight.body", "op": "<=", "value": 400 },
|
|
8
|
+
"require": { "id": "typography.size.body", "op": ">=", "fallback": "16px" }
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"id": "emphasis-weight-size-balance",
|
|
12
|
+
"level": "warn",
|
|
13
|
+
"where": "Legibility emphasis",
|
|
14
|
+
"when": { "id": "typography.weight.emphasis", "op": ">=", "value": 600 },
|
|
15
|
+
"require": { "id": "typography.size.body", "op": ">=", "fallback": "15px" }
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"id": "heading-emphasis-h2",
|
|
19
|
+
"level": "warn",
|
|
20
|
+
"where": "Heading emphasis",
|
|
21
|
+
"compare": { "a": "typography.size.h2", "op": ">=", "b": "typography.size.body", "delta": "2px" }
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
"id": "heading-emphasis-h3",
|
|
25
|
+
"level": "warn",
|
|
26
|
+
"where": "Heading emphasis",
|
|
27
|
+
"compare": { "a": "typography.size.h3", "op": ">=", "b": "typography.size.body", "delta": "2px" }
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"id": "layout-padding-vs-container",
|
|
31
|
+
"level": "warn",
|
|
32
|
+
"where": "Layout density",
|
|
33
|
+
"compare": { "a": "layout.padding.section", "op": "<=", "b": "layout.container.sm", "delta": "-560px" }
|
|
34
|
+
}
|
|
35
|
+
]
|
|
36
36
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
{
|
|
2
|
-
"rules": [
|
|
3
|
-
{
|
|
4
|
-
"id": "body-size-min-sm",
|
|
5
|
-
"bp": "sm",
|
|
6
|
-
"level": "warn",
|
|
7
|
-
"where": "Small screen legibility",
|
|
8
|
-
"when": { "id": "typography.size.body", "op": ">=", "value": 0 },
|
|
9
|
-
"require": { "id": "typography.size.body", "op": ">=", "fallback": "15px" }
|
|
10
|
-
}
|
|
11
|
-
]
|
|
12
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"rules": [
|
|
3
|
+
{
|
|
4
|
+
"id": "body-size-min-sm",
|
|
5
|
+
"bp": "sm",
|
|
6
|
+
"level": "warn",
|
|
7
|
+
"where": "Small screen legibility",
|
|
8
|
+
"when": { "id": "typography.size.body", "op": ">=", "value": 0 },
|
|
9
|
+
"require": { "id": "typography.size.body", "op": ">=", "fallback": "15px" }
|
|
10
|
+
}
|
|
11
|
+
]
|
|
12
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$description": "Layout hierarchy order constraints - LG breakpoint specific",
|
|
3
|
-
"order": [
|
|
4
|
-
["layout.container.xs", "<=", "layout.container.sm"],
|
|
5
|
-
["layout.container.sm", "<=", "layout.container.md"],
|
|
6
|
-
["layout.container.md", "<=", "layout.container.lg"],
|
|
7
|
-
["layout.container.lg", "<=", "layout.container.xl"],
|
|
8
|
-
|
|
9
|
-
["layout.padding.page", ">=", "layout.padding.section"],
|
|
10
|
-
["layout.padding.section", ">=", "layout.padding.card"],
|
|
11
|
-
["layout.padding.card", ">=", "layout.padding.chip"],
|
|
12
|
-
|
|
13
|
-
["layout.grid.gutter", "<=", "layout.padding.section"],
|
|
14
|
-
["layout.grid.gutter", "<=", "layout.padding.card"],
|
|
15
|
-
|
|
16
|
-
["control.size.min", ">=", "layout.padding.card"]
|
|
17
|
-
]
|
|
18
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$description": "Layout hierarchy order constraints - LG breakpoint specific",
|
|
3
|
+
"order": [
|
|
4
|
+
["layout.container.xs", "<=", "layout.container.sm"],
|
|
5
|
+
["layout.container.sm", "<=", "layout.container.md"],
|
|
6
|
+
["layout.container.md", "<=", "layout.container.lg"],
|
|
7
|
+
["layout.container.lg", "<=", "layout.container.xl"],
|
|
8
|
+
|
|
9
|
+
["layout.padding.page", ">=", "layout.padding.section"],
|
|
10
|
+
["layout.padding.section", ">=", "layout.padding.card"],
|
|
11
|
+
["layout.padding.card", ">=", "layout.padding.chip"],
|
|
12
|
+
|
|
13
|
+
["layout.grid.gutter", "<=", "layout.padding.section"],
|
|
14
|
+
["layout.grid.gutter", "<=", "layout.padding.card"],
|
|
15
|
+
|
|
16
|
+
["control.size.min", ">=", "layout.padding.card"]
|
|
17
|
+
]
|
|
18
|
+
}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$description": "Layout hierarchy order constraints - MD breakpoint specific",
|
|
3
|
-
"order": [
|
|
4
|
-
["layout.container.xs", "<=", "layout.container.sm"],
|
|
5
|
-
["layout.container.sm", "<=", "layout.container.md"],
|
|
6
|
-
["layout.container.md", "<=", "layout.container.lg"],
|
|
7
|
-
["layout.container.lg", "<=", "layout.container.xl"],
|
|
8
|
-
|
|
9
|
-
["layout.padding.page", ">=", "layout.padding.section"],
|
|
10
|
-
["layout.padding.section", ">=", "layout.padding.card"],
|
|
11
|
-
["layout.padding.card", ">=", "layout.padding.chip"],
|
|
12
|
-
|
|
13
|
-
["layout.grid.gutter", "<=", "layout.padding.section"],
|
|
14
|
-
["layout.grid.gutter", "<=", "layout.padding.card"],
|
|
15
|
-
|
|
16
|
-
["control.size.min", ">=", "layout.padding.card"]
|
|
17
|
-
]
|
|
18
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"$description": "Layout hierarchy order constraints - MD breakpoint specific",
|
|
3
|
+
"order": [
|
|
4
|
+
["layout.container.xs", "<=", "layout.container.sm"],
|
|
5
|
+
["layout.container.sm", "<=", "layout.container.md"],
|
|
6
|
+
["layout.container.md", "<=", "layout.container.lg"],
|
|
7
|
+
["layout.container.lg", "<=", "layout.container.xl"],
|
|
8
|
+
|
|
9
|
+
["layout.padding.page", ">=", "layout.padding.section"],
|
|
10
|
+
["layout.padding.section", ">=", "layout.padding.card"],
|
|
11
|
+
["layout.padding.card", ">=", "layout.padding.chip"],
|
|
12
|
+
|
|
13
|
+
["layout.grid.gutter", "<=", "layout.padding.section"],
|
|
14
|
+
["layout.grid.gutter", "<=", "layout.padding.card"],
|
|
15
|
+
|
|
16
|
+
["control.size.min", ">=", "layout.padding.card"]
|
|
17
|
+
]
|
|
18
|
+
}
|