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
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
import fs from "node:fs";
|
|
2
|
-
import { CrossAxisPlugin, type CrossAxisRule, type Ctx } from "./constraints/cross-axis.js";
|
|
3
|
-
|
|
4
|
-
type When = { id: string; op: "<="|">="|"<"|">"|"=="|"!="; value: number };
|
|
5
|
-
type Require = { id: string; op: "<="|">="|"<"|">"|"=="|"!="; ref?: string; fallback?: string|number };
|
|
6
|
-
type Compare = { a: string; op: "<="|">="|"<"|">"|"=="|"!="; b: string; delta?: string|number };
|
|
7
|
-
type RawRule = { id: string; level?: "error"|"warn"; where?: string; bp?: string; when?: When; require?: Require; compare?: Compare; };
|
|
8
|
-
|
|
9
|
-
export function loadCrossAxisPlugin(
|
|
10
|
-
path: string,
|
|
11
|
-
bp?: string,
|
|
12
|
-
opts?: { debug?: boolean; knownIds?: Set<string> }
|
|
13
|
-
) {
|
|
14
|
-
const debug = !!opts?.debug;
|
|
15
|
-
const known = opts?.knownIds ?? new Set<string>();
|
|
16
|
-
const log = (...args: any[]) => { if (debug) console.log("[cross-axis]", ...args); };
|
|
17
|
-
|
|
18
|
-
if (!fs.existsSync(path)) {
|
|
19
|
-
log(`no rules file at ${path} (bp=${bp ?? "global"})`);
|
|
20
|
-
return CrossAxisPlugin([], bp);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const raw = JSON.parse(fs.readFileSync(path, "utf8")) as { rules: RawRule[] };
|
|
24
|
-
const rules: CrossAxisRule[] = [];
|
|
25
|
-
const unknownIds = new Set<string>();
|
|
26
|
-
const skipped: Array<{ id?: string; reason: string }> = [];
|
|
27
|
-
|
|
28
|
-
// Fuzzy suggestion helpers (lightweight Levenshtein)
|
|
29
|
-
function levenshtein(a: string, b: string) {
|
|
30
|
-
const dp = Array(b.length + 1).fill(0).map((_, j) => j);
|
|
31
|
-
for (let i = 1; i <= a.length; i++) {
|
|
32
|
-
let prev = i - 1, cur = i;
|
|
33
|
-
for (let j = 1; j <= b.length; j++) {
|
|
34
|
-
const tmp = cur;
|
|
35
|
-
const cost = a[i - 1] === b[j - 1] ? 0 : 1;
|
|
36
|
-
cur = Math.min(dp[j] + 1, cur + 1, prev + cost);
|
|
37
|
-
dp[j] = tmp;
|
|
38
|
-
prev = tmp;
|
|
39
|
-
}
|
|
40
|
-
dp[b.length] = cur;
|
|
41
|
-
}
|
|
42
|
-
return dp[b.length];
|
|
43
|
-
}
|
|
44
|
-
function suggest(id: string, k = 3) {
|
|
45
|
-
return [...known].map(c => ({ id: c, d: levenshtein(id, c) }))
|
|
46
|
-
.sort((a, b) => a.d - b.d)
|
|
47
|
-
.slice(0, k);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
const needId = (id?: string) => {
|
|
51
|
-
if (!id) return false;
|
|
52
|
-
if (!known.has(id)) { unknownIds.add(id); }
|
|
53
|
-
return true;
|
|
54
|
-
};
|
|
55
|
-
|
|
56
|
-
for (const r of raw.rules || []) {
|
|
57
|
-
if (r.bp && bp && r.bp !== bp) { continue; }
|
|
58
|
-
if (r.bp && !bp) { // rule targets specific breakpoint; skip in global run
|
|
59
|
-
continue;
|
|
60
|
-
}
|
|
61
|
-
try {
|
|
62
|
-
if (r.when && r.require) {
|
|
63
|
-
// Validate IDs
|
|
64
|
-
needId(r.when.id);
|
|
65
|
-
needId(r.require.id);
|
|
66
|
-
if (r.require.ref) needId(r.require.ref);
|
|
67
|
-
|
|
68
|
-
rules.push({
|
|
69
|
-
id: r.id, level: r.level, where: r.where,
|
|
70
|
-
when: { id: r.when.id, test: makeOp(r.when.op, r.when.value) },
|
|
71
|
-
require: {
|
|
72
|
-
id: r.require.id,
|
|
73
|
-
test: (v: number, ctx: Ctx) => {
|
|
74
|
-
const rhs = valueOrRef(ctx, r.require!.ref, r.require!.fallback);
|
|
75
|
-
return cmp(v, rhs, r.require!.op);
|
|
76
|
-
},
|
|
77
|
-
msg: (v: number, ctx: Ctx) => {
|
|
78
|
-
const rhs = valueOrRef(ctx, r.require!.ref, r.require!.fallback);
|
|
79
|
-
return `${r.require!.id} ${prettyFail(r.require!.op)} ${fmt(rhs)} (was ${fmt(v)})`;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
});
|
|
83
|
-
} else if (r.compare) {
|
|
84
|
-
needId(r.compare.a);
|
|
85
|
-
needId(r.compare.b);
|
|
86
|
-
|
|
87
|
-
rules.push({
|
|
88
|
-
id: r.id, level: r.level, where: r.where,
|
|
89
|
-
when: { id: r.compare.a, test: () => true },
|
|
90
|
-
require: {
|
|
91
|
-
id: r.compare.a,
|
|
92
|
-
test: (_: number, ctx: Ctx) => {
|
|
93
|
-
const a = ctx.getPx(r.compare!.a) ?? NaN;
|
|
94
|
-
const b = ctx.getPx(r.compare!.b) ?? NaN;
|
|
95
|
-
const delta = px(r.compare!.delta ?? 0);
|
|
96
|
-
if (Number.isNaN(a) || Number.isNaN(b)) return true; // skip check if missing
|
|
97
|
-
return cmp(a, b + delta, r.compare!.op);
|
|
98
|
-
},
|
|
99
|
-
msg: (_: number, ctx: Ctx) => {
|
|
100
|
-
const a = ctx.getPx(r.compare!.a);
|
|
101
|
-
const b = ctx.getPx(r.compare!.b);
|
|
102
|
-
const delta = px(r.compare!.delta ?? 0);
|
|
103
|
-
return `${r.compare!.a} ${prettyFail(r.compare!.op)} ${fmt((b ?? 0) + delta)} (was ${fmt(a ?? NaN)})`;
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
} else {
|
|
108
|
-
skipped.push({ id: r.id, reason: "neither when+require nor compare present" });
|
|
109
|
-
}
|
|
110
|
-
} catch (e: any) {
|
|
111
|
-
skipped.push({ id: r.id, reason: `exception: ${e?.message ?? e}` });
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
log(`loaded ${rules.length} rule(s) from ${path}${bp ? ` [bp=${bp}]` : ""}`);
|
|
116
|
-
if (unknownIds.size) {
|
|
117
|
-
log(`unknown ids referenced:`, [...unknownIds].join(", "));
|
|
118
|
-
for (const u of unknownIds) {
|
|
119
|
-
const s = suggest(u, 3);
|
|
120
|
-
if (s.length) log(` did you mean: ${s.map(x => `${x.id} (d=${x.d})`).join(', ')}`);
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
if (skipped.length) {
|
|
124
|
-
for (const s of skipped) log(`skipped rule ${s.id ?? "(no id)"} — ${s.reason}`);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
// Extra hint for common anchor pitfall
|
|
128
|
-
for (const r of raw.rules || []) {
|
|
129
|
-
if (r.require?.ref && !known.has(r.require.ref)) {
|
|
130
|
-
log(`anchor missing: ${r.require.ref} → will use fallback=${JSON.stringify(r.require.fallback)} when evaluating`);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return CrossAxisPlugin(rules, bp);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// helpers
|
|
138
|
-
const px = (v: string|number) => typeof v === "number" ? v : parseFloat(String(v)) * (String(v).trim().endsWith("rem") ? 16 : 1);
|
|
139
|
-
const cmp = (a:number,b:number,op:When["op"]) =>
|
|
140
|
-
op === ">="? a>=b : op === ">"? a>b : op === "<="? a<=b : op === "<"? a<b : op === "=="? a===b : a!==b;
|
|
141
|
-
const prettyFail = (op: string) => ({">=":"<",">":"≤","<=":">","<": "≥","==":"≠","!=":"="} as any)[op] || "≠";
|
|
142
|
-
const fmt = (v:number|string) => Number.isFinite(Number(v)) ? `${Number(v)}px` : String(v);
|
|
143
|
-
function valueOrRef(ctx: Ctx, ref?: string, fallback?: string|number) {
|
|
144
|
-
if (ref) {
|
|
145
|
-
const v = ctx.getPx(ref);
|
|
146
|
-
if (v != null) return v;
|
|
147
|
-
}
|
|
148
|
-
return typeof fallback === "number" ? fallback : px(fallback ?? 0);
|
|
149
|
-
}
|
|
150
|
-
function makeOp(op: When["op"], rhs: number) {
|
|
151
|
-
return (v: number) => cmp(v, rhs, op);
|
|
152
|
-
}
|
package/dist/tmp.patch.json
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 1,
|
|
3
|
-
"generatedAt": "2025-11-01T06:31:35.033Z",
|
|
4
|
-
"baseFile": "tokens/tokens.example.json",
|
|
5
|
-
"changes": [
|
|
6
|
-
{
|
|
7
|
-
"id": "color.palette.brand.600",
|
|
8
|
-
"from": "oklch(0.62 0.18 260)",
|
|
9
|
-
"to": "#ffffff",
|
|
10
|
-
"type": "modify"
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"id": "color.palette.brand.700",
|
|
14
|
-
"from": "oklch(0.56 0.19 260)",
|
|
15
|
-
"to": null,
|
|
16
|
-
"type": "remove"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"id": "color.role.accent.default",
|
|
20
|
-
"from": "oklch(0.62 0.18 260)",
|
|
21
|
-
"to": "#ffffff",
|
|
22
|
-
"type": "modify"
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"patch": {
|
|
26
|
-
"color.palette.brand.600": "#ffffff",
|
|
27
|
-
"color.palette.brand.700": null,
|
|
28
|
-
"color.role.accent.default": "#ffffff"
|
|
29
|
-
},
|
|
30
|
-
"hash": "e925a3d3532d35c4a569788d9b061fda15f0b5b904867094b3cba727091edf3c",
|
|
31
|
-
"baseTokensHash": "9c75c6bc19e4700ab5393e9118c6ce5596727e0fdbba890aaef1ebb831868c26",
|
|
32
|
-
"meta": {
|
|
33
|
-
"changeCount": 3
|
|
34
|
-
}
|
|
35
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"overrides": {
|
|
3
|
-
"color": {
|
|
4
|
-
"palette": {
|
|
5
|
-
"brand": {
|
|
6
|
-
"600": {
|
|
7
|
-
"$value": "oklch(0.620 0.180 171)"
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"typography": {
|
|
13
|
-
"font": {
|
|
14
|
-
"body": {
|
|
15
|
-
"$value": "Lora"
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
"links": {},
|
|
21
|
-
"expressions": {}
|
|
22
|
-
}
|
package/tokens/overrides/lg.json
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": {
|
|
3
|
-
"size": {
|
|
4
|
-
"h1": "oklch(0.15 0.01 0) 3rem/1.1 'Segoe UI', system-ui",
|
|
5
|
-
"h2": "oklch(0.15 0.01 0) 2.25rem/1.2 'Segoe UI', system-ui",
|
|
6
|
-
"body": "oklch(0.20 0.01 0) 1.125rem/1.7 'Segoe UI', system-ui"
|
|
7
|
-
},
|
|
8
|
-
"weight": {
|
|
9
|
-
"body": "300"
|
|
10
|
-
}
|
|
11
|
-
},
|
|
12
|
-
"dimension": {
|
|
13
|
-
"spacing": {
|
|
14
|
-
"scale": {
|
|
15
|
-
"section": "4rem",
|
|
16
|
-
"component": "2rem"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
package/tokens/overrides/md.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": {
|
|
3
|
-
"size": {
|
|
4
|
-
"h1": "oklch(0.15 0.01 0) 2.25rem/1.2 'Segoe UI', system-ui",
|
|
5
|
-
"body": "oklch(0.20 0.01 0) 1rem/1.6 'Segoe UI', system-ui"
|
|
6
|
-
}
|
|
7
|
-
},
|
|
8
|
-
"dimension": {
|
|
9
|
-
"spacing": {
|
|
10
|
-
"scale": {
|
|
11
|
-
"section": "2.5rem",
|
|
12
|
-
"component": "1.25rem"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
package/tokens/overrides/sm.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"type": {
|
|
3
|
-
"size": {
|
|
4
|
-
"body": "oklch(0.20 0.01 0) 0.875rem/1.5 'Segoe UI', system-ui",
|
|
5
|
-
"caption": "oklch(0.20 0.01 0) 0.75rem/1.4 'Segoe UI', system-ui"
|
|
6
|
-
}
|
|
7
|
-
},
|
|
8
|
-
"dimension": {
|
|
9
|
-
"spacing": {
|
|
10
|
-
"scale": {
|
|
11
|
-
"section": "1.5rem",
|
|
12
|
-
"component": "0.75rem"
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
@@ -1,116 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schemaVersion": "1.0.0",
|
|
3
|
-
|
|
4
|
-
"color": {
|
|
5
|
-
"palette": {
|
|
6
|
-
"gray": {
|
|
7
|
-
"0": { "$type": "color", "$value": "oklch(0.99 0.001 95)" },
|
|
8
|
-
"300": { "$type": "color", "$value": "oklch(0.75 0.01 95)" },
|
|
9
|
-
"400": { "$type": "color", "$value": "oklch(0.65 0.015 95)" },
|
|
10
|
-
"500": { "$type": "color", "$value": "oklch(0.55 0.02 95)" },
|
|
11
|
-
"600": { "$type": "color", "$value": "oklch(0.45 0.02 95)" },
|
|
12
|
-
"900": { "$type": "color", "$value": "oklch(0.20 0.02 95)" }
|
|
13
|
-
},
|
|
14
|
-
"brand": {
|
|
15
|
-
"400": { "$type": "color", "$value": "oklch(0.70 0.15 260)" },
|
|
16
|
-
"500": { "$type": "color", "$value": "oklch(0.62 0.12 29)" },
|
|
17
|
-
"600": { "$type": "color", "$value": "oklch(0.80 0.10 29)" },
|
|
18
|
-
"700": { "$type": "color", "$value": "oklch(0.56 0.19 260)" }
|
|
19
|
-
},
|
|
20
|
-
"danger": {
|
|
21
|
-
"600": { "$type": "color", "$value": "oklch(0.60 0.25 25)" },
|
|
22
|
-
"700": { "$type": "color", "$value": "oklch(0.55 0.28 25)" }
|
|
23
|
-
},
|
|
24
|
-
"white": { "$type": "color", "$value": "oklch(1 0 0)" }
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
"role": {
|
|
28
|
-
"text": {
|
|
29
|
-
"default": { "$type": "color", "$value": "{color.palette.gray.900}" },
|
|
30
|
-
"muted": { "$type": "color", "$value": "oklch(0.55 0.02 95)" }
|
|
31
|
-
},
|
|
32
|
-
"surface": {
|
|
33
|
-
"default": { "$type": "color", "$value": "{color.palette.gray.0}" },
|
|
34
|
-
"hover": { "$type": "color", "$value": "oklch(0.95 0.001 95)" }
|
|
35
|
-
},
|
|
36
|
-
"accent": {
|
|
37
|
-
"default": { "$type": "color", "$value": "{color.palette.brand.500}" }
|
|
38
|
-
},
|
|
39
|
-
"danger": {
|
|
40
|
-
"default": { "$type": "color", "$value": "{color.palette.danger.600}" }
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
|
|
45
|
-
"spacing": {
|
|
46
|
-
"0": { "$type": "dimension", "$value": "0px" },
|
|
47
|
-
"0.5": { "$type": "dimension", "$value": "2px" },
|
|
48
|
-
"1": { "$type": "dimension", "$value": "4px" },
|
|
49
|
-
"2": { "$type": "dimension", "$value": "8px" },
|
|
50
|
-
"2.5": { "$type": "dimension", "$value": "10px" },
|
|
51
|
-
"3": { "$type": "dimension", "$value": "12px" },
|
|
52
|
-
"4": { "$type": "dimension", "$value": "16px" },
|
|
53
|
-
"6": { "$type": "dimension", "$value": "24px" },
|
|
54
|
-
"8": { "$type": "dimension", "$value": "32px" },
|
|
55
|
-
"10": { "$type": "dimension", "$value": "40px" },
|
|
56
|
-
"12": { "$type": "dimension", "$value": "48px" }
|
|
57
|
-
},
|
|
58
|
-
|
|
59
|
-
"typography": {
|
|
60
|
-
"font": {
|
|
61
|
-
"body": { "$type": "fontFamily", "$value": "system-ui, 'Inter', sans-serif" }
|
|
62
|
-
},
|
|
63
|
-
"size": {
|
|
64
|
-
"h1": { "$type": "fontSize", "$value": "16px" },
|
|
65
|
-
"h2": { "$type": "fontSize", "$value": "20px" },
|
|
66
|
-
"h3": { "$type": "fontSize", "$value": "18px" },
|
|
67
|
-
"h4": { "$type": "fontSize", "$value": "16px" },
|
|
68
|
-
"h5": { "$type": "fontSize", "$value": "14px" },
|
|
69
|
-
"h6": { "$type": "fontSize", "$value": "12px" },
|
|
70
|
-
"xl": { "$type": "fontSize", "$value": "20px" },
|
|
71
|
-
"lg": { "$type": "fontSize", "$value": "18px" },
|
|
72
|
-
"base": { "$type": "fontSize", "$value": "16px" },
|
|
73
|
-
"sm": { "$type": "fontSize", "$value": "14px" },
|
|
74
|
-
"xs": { "$type": "fontSize", "$value": "12px" },
|
|
75
|
-
"body": { "$type": "fontSize", "$value": "clamp(1rem, 0.95rem + 0.5vw, 1.125rem)" }
|
|
76
|
-
},
|
|
77
|
-
"lineHeight": {
|
|
78
|
-
"body": { "$type": "lineHeight", "$value": 1.6 }
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
|
|
82
|
-
"motion": {
|
|
83
|
-
"duration": {
|
|
84
|
-
"fast": { "$type": "duration", "$value": "150ms" }
|
|
85
|
-
},
|
|
86
|
-
"easing": {
|
|
87
|
-
"standard": { "$type": "easing", "$value": "cubic-bezier(.2,.9,.1,1)" }
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
|
|
91
|
-
"elevation": {
|
|
92
|
-
"1": {
|
|
93
|
-
"$type": "shadow",
|
|
94
|
-
"$value": "0 1px 2px oklch(0.2 0 0 / 0.1), 0 1px 1px oklch(0.2 0 0 / 0.06)"
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
"layout": {
|
|
99
|
-
"container": {
|
|
100
|
-
"xs": { "$type": "dimension", "$value": "540px" },
|
|
101
|
-
"sm": { "$type": "dimension", "$value": "640px" },
|
|
102
|
-
"md": { "$type": "dimension", "$value": "768px" },
|
|
103
|
-
"lg": { "$type": "dimension", "$value": "1024px" },
|
|
104
|
-
"xl": { "$type": "dimension", "$value": "1280px" }
|
|
105
|
-
},
|
|
106
|
-
"padding": {
|
|
107
|
-
"page": { "$type": "dimension", "$value": "48px" },
|
|
108
|
-
"section": { "$type": "dimension", "$value": "32px" },
|
|
109
|
-
"card": { "$type": "dimension", "$value": "24px" },
|
|
110
|
-
"chip": { "$type": "dimension", "$value": "8px" }
|
|
111
|
-
},
|
|
112
|
-
"grid": {
|
|
113
|
-
"gutter": { "$type": "dimension", "$value": "16px" }
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}
|
|
@@ -1,128 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schemaVersion": "1.0.0",
|
|
3
|
-
|
|
4
|
-
"color": {
|
|
5
|
-
"palette": {
|
|
6
|
-
"gray": {
|
|
7
|
-
"0": { "$type": "color", "$value": "oklch(0.99 0.001 95)" },
|
|
8
|
-
"300": { "$type": "color", "$value": "oklch(0.75 0.01 95)" },
|
|
9
|
-
"400": { "$type": "color", "$value": "oklch(0.65 0.015 95)" },
|
|
10
|
-
"500": { "$type": "color", "$value": "oklch(0.55 0.02 95)" },
|
|
11
|
-
"600": { "$type": "color", "$value": "oklch(0.45 0.02 95)" },
|
|
12
|
-
"900": { "$type": "color", "$value": "oklch(0.20 0.02 95)" }
|
|
13
|
-
},
|
|
14
|
-
"brand": {
|
|
15
|
-
"400": { "$type": "color", "$value": "oklch(0.70 0.15 260)" },
|
|
16
|
-
"500": { "$type": "color", "$value": "oklch(0.66 0.16 260)" },
|
|
17
|
-
"600": { "$type": "color", "$value": "oklch(0.62 0.18 260)" },
|
|
18
|
-
"700": { "$type": "color", "$value": "oklch(0.56 0.19 260)" }
|
|
19
|
-
},
|
|
20
|
-
"danger": {
|
|
21
|
-
"600": { "$type": "color", "$value": "oklch(0.60 0.25 25)" },
|
|
22
|
-
"700": { "$type": "color", "$value": "oklch(0.55 0.28 25)" }
|
|
23
|
-
},
|
|
24
|
-
"white": { "$type": "color", "$value": "oklch(1 0 0)" }
|
|
25
|
-
},
|
|
26
|
-
|
|
27
|
-
"role": {
|
|
28
|
-
"text": {
|
|
29
|
-
"default": { "$type": "color", "$value": "{color.palette.gray.900}" },
|
|
30
|
-
"muted": { "$type": "color", "$value": "oklch(0.55 0.02 95)" }
|
|
31
|
-
},
|
|
32
|
-
"bg": {
|
|
33
|
-
"surface": { "$type": "color", "$value": "{color.palette.gray.0}" }
|
|
34
|
-
},
|
|
35
|
-
"accent": {
|
|
36
|
-
"default": { "$type": "color", "$value": "{color.palette.brand.600}" },
|
|
37
|
-
"hover": { "$type": "color", "$value": "{color.palette.brand.700}" }
|
|
38
|
-
},
|
|
39
|
-
"danger": {
|
|
40
|
-
"default": { "$type": "color", "$value": "{color.palette.danger.600}" },
|
|
41
|
-
"hover": { "$type": "color", "$value": "{color.palette.danger.700}" }
|
|
42
|
-
},
|
|
43
|
-
"on": {
|
|
44
|
-
"accent": { "$type": "color", "$value": "{color.palette.white}" },
|
|
45
|
-
"danger": { "$type": "color", "$value": "{color.palette.white}" }
|
|
46
|
-
},
|
|
47
|
-
"focus": {
|
|
48
|
-
"ring": { "$type": "color", "$value": "oklch(0.62 0.18 260 / 0.5)" }
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
|
|
53
|
-
"size": {
|
|
54
|
-
"spacing": {
|
|
55
|
-
"2": { "$type": "dimension", "$value": "0.5rem" },
|
|
56
|
-
"3": { "$type": "dimension", "$value": "0.75rem" },
|
|
57
|
-
"4": { "$type": "dimension", "$value": "1rem" },
|
|
58
|
-
"5": { "$type": "dimension", "$value": "1.25rem" },
|
|
59
|
-
"6": { "$type": "dimension", "$value": "1.5rem" }
|
|
60
|
-
},
|
|
61
|
-
"radius": {
|
|
62
|
-
"md": { "$type": "borderRadius", "$value": "0.5rem" }
|
|
63
|
-
},
|
|
64
|
-
"border": {
|
|
65
|
-
"1": { "$type": "dimension", "$value": "1px" }
|
|
66
|
-
}
|
|
67
|
-
},
|
|
68
|
-
|
|
69
|
-
"typography": {
|
|
70
|
-
"font": {
|
|
71
|
-
"body": { "$type": "fontFamily", "$value": "system-ui, 'Inter', sans-serif" }
|
|
72
|
-
},
|
|
73
|
-
"size": {
|
|
74
|
-
"body": { "$type": "fontSize", "$value": "clamp(1rem, 0.95rem + 0.5vw, 1.125rem)" },
|
|
75
|
-
"h2": { "$type": "fontSize", "$value": "22px" },
|
|
76
|
-
"h3": { "$type": "fontSize", "$value": "18px" }
|
|
77
|
-
},
|
|
78
|
-
"lineHeight": {
|
|
79
|
-
"body": { "$type": "lineHeight", "$value": 1.6 }
|
|
80
|
-
},
|
|
81
|
-
"weight": {
|
|
82
|
-
"body": { "$type": "fontWeight", "$value": 400 },
|
|
83
|
-
"emphasis": { "$type": "fontWeight", "$value": 600 },
|
|
84
|
-
"strong": { "$type": "fontWeight", "$value": 700 }
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
|
|
88
|
-
"motion": {
|
|
89
|
-
"duration": {
|
|
90
|
-
"fast": { "$type": "duration", "$value": "150ms" }
|
|
91
|
-
},
|
|
92
|
-
"easing": {
|
|
93
|
-
"standard": { "$type": "easing", "$value": "cubic-bezier(.2,.9,.1,1)" }
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
|
|
97
|
-
"elevation": {
|
|
98
|
-
"1": {
|
|
99
|
-
"$type": "shadow",
|
|
100
|
-
"$value": "0 1px 2px oklch(0.2 0 0 / 0.1), 0 1px 1px oklch(0.2 0 0 / 0.06)"
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
"control": {
|
|
105
|
-
"size": {
|
|
106
|
-
"min": { "$type": "dimension", "$value": "30px" }
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
"layout": {
|
|
111
|
-
"container": {
|
|
112
|
-
"xs": { "$type": "dimension", "$value": "540px" },
|
|
113
|
-
"sm": { "$type": "dimension", "$value": "640px" },
|
|
114
|
-
"md": { "$type": "dimension", "$value": "768px" },
|
|
115
|
-
"lg": { "$type": "dimension", "$value": "1024px" },
|
|
116
|
-
"xl": { "$type": "dimension", "$value": "1280px" }
|
|
117
|
-
},
|
|
118
|
-
"padding": {
|
|
119
|
-
"page": { "$type": "dimension", "$value": "48px" },
|
|
120
|
-
"section": { "$type": "dimension", "$value": "32px" },
|
|
121
|
-
"card": { "$type": "dimension", "$value": "24px" },
|
|
122
|
-
"chip": { "$type": "dimension", "$value": "8px" }
|
|
123
|
-
},
|
|
124
|
-
"grid": {
|
|
125
|
-
"gutter": { "$type": "dimension", "$value": "16px" }
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
}
|
package/tokens/tokens.json
DELETED
|
@@ -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
|
-
}
|