@polyxd/ds-kit 0.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.
- package/LICENSE +202 -0
- package/NOTICE +177 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +216 -0
- package/dist/cli.js.map +1 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.js +274 -0
- package/dist/index.js.map +1 -0
- package/dist/infer.d.ts +27 -0
- package/dist/infer.js +201 -0
- package/dist/infer.js.map +1 -0
- package/dist/polyxd.d.ts +2 -0
- package/dist/polyxd.js +45 -0
- package/dist/polyxd.js.map +1 -0
- package/package.json +52 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
export type Json = any;
|
|
2
|
+
export type Vars = Record<string, string>;
|
|
3
|
+
/**
|
|
4
|
+
* Every custom property from the CSS rules whose selector satisfies `matches`, in file order, so a
|
|
5
|
+
* later rule overrides an earlier one exactly as a browser resolves it. Selectors spanning several
|
|
6
|
+
* lines are handled: a design system's dark block is usually `:root[data-scheme='dark'], :host(…)`.
|
|
7
|
+
*
|
|
8
|
+
* `matches` also receives the enclosing at-rule when there is one, so a caller can skip overrides
|
|
9
|
+
* it can't use — Radix Themes, for example, repeats every colour in display-p3 inside @supports,
|
|
10
|
+
* and contrast is defined on sRGB.
|
|
11
|
+
*/
|
|
12
|
+
export declare function cssVars(css: string, matches: (selector: string, atRule?: string) => boolean, prefix?: string): Vars;
|
|
13
|
+
/** Resolves `var(--x)` references within one set of variables, so tokens hold values. */
|
|
14
|
+
export declare function resolveVars(vars: Vars, depth?: number): Vars;
|
|
15
|
+
/**
|
|
16
|
+
* A CSS length as a DTCG dimension. rem and em are 16px at the root, and the simple `calc()` a
|
|
17
|
+
* scale is usually written with — `calc(0.5rem * 1)`, Mantine's scale factor — is evaluated.
|
|
18
|
+
*/
|
|
19
|
+
export declare function length(value: string, rootPx?: number): {
|
|
20
|
+
value: number;
|
|
21
|
+
unit: "px";
|
|
22
|
+
};
|
|
23
|
+
/** Splits on whitespace that isn't inside brackets, so `calc(1rem * 2)` stays one piece. */
|
|
24
|
+
export declare function splitOutside(value: string): string[];
|
|
25
|
+
/** A CSS duration as a DTCG duration. */
|
|
26
|
+
export declare function duration(value: string): {
|
|
27
|
+
value: number;
|
|
28
|
+
unit: "ms";
|
|
29
|
+
};
|
|
30
|
+
/** A cubic-bezier() string as its four numbers. */
|
|
31
|
+
export declare const bezier: (value: string) => number[];
|
|
32
|
+
/** A CSS box-shadow (one or more layers) as DTCG shadow layers. */
|
|
33
|
+
export declare function shadowLayers(css: string): Json[];
|
|
34
|
+
/** How a source variable becomes a DTCG token: which type, and how the value is converted. */
|
|
35
|
+
export interface TypeRule {
|
|
36
|
+
match: RegExp;
|
|
37
|
+
type: "color" | "dimension" | "duration" | "cubicBezier" | "shadow" | "fontFamily" | "number";
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* One system tier: the design system's own variables, names kept, typed by the rules given.
|
|
41
|
+
* A variable no rule matches, and that doesn't look like a colour, is left out rather than guessed at.
|
|
42
|
+
*/
|
|
43
|
+
export declare function systemTier(vars: Vars, namespace: string, rules: TypeRule[], description: string): Json;
|
|
44
|
+
export interface PackFiles {
|
|
45
|
+
dir: string;
|
|
46
|
+
name: string;
|
|
47
|
+
displayName: string;
|
|
48
|
+
contractVersion: string;
|
|
49
|
+
provenance: Json[];
|
|
50
|
+
light: Json;
|
|
51
|
+
dark: Json;
|
|
52
|
+
semantic: Json;
|
|
53
|
+
/** Tokens shared by both modes, if the pack has any. */
|
|
54
|
+
shared?: Json;
|
|
55
|
+
/** The modes the pack actually has. A system with one theme ships one mode rather than a copy. */
|
|
56
|
+
modes?: string[];
|
|
57
|
+
/** Layout variables the renderer defines and this pack sets; see the manifest schema. */
|
|
58
|
+
layout?: Record<string, string>;
|
|
59
|
+
}
|
|
60
|
+
/** Writes a pack's token files, manifest and package.json. */
|
|
61
|
+
export declare function writePack(pack: PackFiles): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* The nearest step of a palette that clears a contrast floor against `background`, searching
|
|
64
|
+
* outward from `from`. This is the rule every pack follows when a design system's own choice
|
|
65
|
+
* doesn't pass: move along that system's own ramp rather than inventing a colour.
|
|
66
|
+
*
|
|
67
|
+
* `steps` is the ramp in order (index 0 lightest). Returns the chosen index, or the end of the
|
|
68
|
+
* ramp it searched toward when nothing passes — the caller reports that.
|
|
69
|
+
*/
|
|
70
|
+
export declare function nearestPassing(steps: string[], background: string, min: number, from: number, direction: "darker" | "lighter"): {
|
|
71
|
+
index: number;
|
|
72
|
+
ratio: number;
|
|
73
|
+
passes: boolean;
|
|
74
|
+
};
|
|
75
|
+
/** `{alias}` helpers for writing a semantic tier. */
|
|
76
|
+
export declare const alias: (path: string) => {
|
|
77
|
+
$value: string;
|
|
78
|
+
};
|
|
79
|
+
export declare const aliasWith: (path: string, description: string) => {
|
|
80
|
+
$value: string;
|
|
81
|
+
$description: string;
|
|
82
|
+
};
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,274 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared parts of building a design-system pack.
|
|
3
|
+
*
|
|
4
|
+
* A pack is: vendored source tokens, a mapping onto the Polyxd contract, and the DTCG files that
|
|
5
|
+
* come out. The mapping is the interesting part and stays per pack; everything else — reading CSS
|
|
6
|
+
* custom properties, turning CSS lengths and shadows into DTCG values, writing the tiers and the
|
|
7
|
+
* manifest — is the same every time, and lives here.
|
|
8
|
+
*
|
|
9
|
+
* Used by @polyxd/ds-mantine and @polyxd/ds-radix. The earlier packs (Material 3, Carbon, Ant,
|
|
10
|
+
* Fluent, shadcn, Bootstrap) have their own generators, written before this existed; they produce
|
|
11
|
+
* the same shape of output and are checked the same way.
|
|
12
|
+
*/
|
|
13
|
+
import { mkdir, writeFile } from "node:fs/promises";
|
|
14
|
+
import { contrastRatio } from "@polyxd/spec";
|
|
15
|
+
import { join } from "node:path";
|
|
16
|
+
/**
|
|
17
|
+
* Every custom property from the CSS rules whose selector satisfies `matches`, in file order, so a
|
|
18
|
+
* later rule overrides an earlier one exactly as a browser resolves it. Selectors spanning several
|
|
19
|
+
* lines are handled: a design system's dark block is usually `:root[data-scheme='dark'], :host(…)`.
|
|
20
|
+
*
|
|
21
|
+
* `matches` also receives the enclosing at-rule when there is one, so a caller can skip overrides
|
|
22
|
+
* it can't use — Radix Themes, for example, repeats every colour in display-p3 inside @supports,
|
|
23
|
+
* and contrast is defined on sRGB.
|
|
24
|
+
*/
|
|
25
|
+
export function cssVars(css, matches, prefix = "--") {
|
|
26
|
+
const out = {};
|
|
27
|
+
const declarations = new RegExp(`(${prefix}[a-zA-Z0-9-]+)\\s*:\\s*([^;]+);`, "g");
|
|
28
|
+
// A brace scanner rather than a regex: real stylesheets nest rules inside @media and @supports,
|
|
29
|
+
// and a regex that assumes one level silently reads the wrong blocks.
|
|
30
|
+
let depth = 0;
|
|
31
|
+
let start = 0;
|
|
32
|
+
const stack = [];
|
|
33
|
+
for (let i = 0; i < css.length; i++) {
|
|
34
|
+
const ch = css[i];
|
|
35
|
+
if (ch === "{") {
|
|
36
|
+
stack.push(css.slice(start, i).replace(/\/\*[\s\S]*?\*\//g, "").replace(/\s+/g, " ").trim());
|
|
37
|
+
depth++;
|
|
38
|
+
start = i + 1;
|
|
39
|
+
}
|
|
40
|
+
else if (ch === "}") {
|
|
41
|
+
const selector = stack.pop() ?? "";
|
|
42
|
+
const body = css.slice(start, i);
|
|
43
|
+
// An at-rule wraps other rules; a normal selector's body holds the declarations we want.
|
|
44
|
+
// The nearest enclosing at-rule, so a caller can skip a wide-gamut or print override.
|
|
45
|
+
const atRule = [...stack].reverse().find((s) => s.startsWith("@"));
|
|
46
|
+
if (!selector.startsWith("@") && matches(selector, atRule)) {
|
|
47
|
+
for (const [, name, value] of body.matchAll(declarations))
|
|
48
|
+
out[name] = value.trim();
|
|
49
|
+
}
|
|
50
|
+
depth = Math.max(0, depth - 1);
|
|
51
|
+
start = i + 1;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return out;
|
|
55
|
+
}
|
|
56
|
+
/** Resolves `var(--x)` references within one set of variables, so tokens hold values. */
|
|
57
|
+
export function resolveVars(vars, depth = 6) {
|
|
58
|
+
const out = { ...vars };
|
|
59
|
+
for (let pass = 0; pass < depth; pass++) {
|
|
60
|
+
let changed = false;
|
|
61
|
+
for (const [name, value] of Object.entries(out)) {
|
|
62
|
+
const next = value.replace(/var\((--[a-zA-Z0-9-]+)(?:\s*,\s*([^)]+))?\)/g, (whole, ref, fallback) => out[ref] ?? fallback ?? whole);
|
|
63
|
+
if (next !== value) {
|
|
64
|
+
out[name] = next;
|
|
65
|
+
changed = true;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
if (!changed)
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
return out;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A CSS length as a DTCG dimension. rem and em are 16px at the root, and the simple `calc()` a
|
|
75
|
+
* scale is usually written with — `calc(0.5rem * 1)`, Mantine's scale factor — is evaluated.
|
|
76
|
+
*/
|
|
77
|
+
export function length(value, rootPx = 16) {
|
|
78
|
+
const s = String(value).trim();
|
|
79
|
+
const calc = /^calc\(\s*([\d.]+)(rem|em|px)?\s*([*/+-])\s*([\d.]+)(rem|em|px)?\s*\)$/.exec(s);
|
|
80
|
+
if (calc) {
|
|
81
|
+
const [, a, unitA, op, b, unitB] = calc;
|
|
82
|
+
const toPx = (n, unit) => (unit === "rem" || unit === "em" ? Number(n) * rootPx : Number(n));
|
|
83
|
+
const left = toPx(a, unitA);
|
|
84
|
+
// A bare number on either side is a multiplier, not a length.
|
|
85
|
+
const right = unitB ? toPx(b, unitB) : Number(b);
|
|
86
|
+
const result = op === "*" ? left * right : op === "/" ? left / right : op === "+" ? left + toPx(b, unitB ?? unitA) : left - toPx(b, unitB ?? unitA);
|
|
87
|
+
return { value: Math.round(result * 1000) / 1000, unit: "px" };
|
|
88
|
+
}
|
|
89
|
+
const n = Number.parseFloat(s);
|
|
90
|
+
if (Number.isNaN(n))
|
|
91
|
+
return { value: 0, unit: "px" };
|
|
92
|
+
if (s.endsWith("rem") || s.endsWith("em"))
|
|
93
|
+
return { value: Math.round(n * rootPx * 1000) / 1000, unit: "px" };
|
|
94
|
+
return { value: n, unit: "px" };
|
|
95
|
+
}
|
|
96
|
+
/** Splits on whitespace that isn't inside brackets, so `calc(1rem * 2)` stays one piece. */
|
|
97
|
+
export function splitOutside(value) {
|
|
98
|
+
const parts = [];
|
|
99
|
+
let depth = 0;
|
|
100
|
+
let current = "";
|
|
101
|
+
for (const ch of value) {
|
|
102
|
+
if (ch === "(")
|
|
103
|
+
depth++;
|
|
104
|
+
if (ch === ")")
|
|
105
|
+
depth--;
|
|
106
|
+
if (/\s/.test(ch) && depth === 0) {
|
|
107
|
+
if (current)
|
|
108
|
+
parts.push(current);
|
|
109
|
+
current = "";
|
|
110
|
+
}
|
|
111
|
+
else
|
|
112
|
+
current += ch;
|
|
113
|
+
}
|
|
114
|
+
if (current)
|
|
115
|
+
parts.push(current);
|
|
116
|
+
return parts;
|
|
117
|
+
}
|
|
118
|
+
/** A CSS duration as a DTCG duration. */
|
|
119
|
+
export function duration(value) {
|
|
120
|
+
const s = String(value).trim();
|
|
121
|
+
const n = Number.parseFloat(s) || 0;
|
|
122
|
+
return { value: s.endsWith("ms") ? n : n * 1000, unit: "ms" };
|
|
123
|
+
}
|
|
124
|
+
/** A cubic-bezier() string as its four numbers. */
|
|
125
|
+
export const bezier = (value) => (String(value).match(/-?\d*\.?\d+/g) ?? [0, 0, 1, 1]).map(Number).slice(-4);
|
|
126
|
+
/** Splits a comma-separated list on the commas that aren't inside brackets. */
|
|
127
|
+
function splitLayers(css) {
|
|
128
|
+
const parts = [];
|
|
129
|
+
let depth = 0;
|
|
130
|
+
let current = "";
|
|
131
|
+
for (const ch of css) {
|
|
132
|
+
if (ch === "(")
|
|
133
|
+
depth++;
|
|
134
|
+
if (ch === ")")
|
|
135
|
+
depth--;
|
|
136
|
+
if (ch === "," && depth === 0) {
|
|
137
|
+
parts.push(current);
|
|
138
|
+
current = "";
|
|
139
|
+
}
|
|
140
|
+
else
|
|
141
|
+
current += ch;
|
|
142
|
+
}
|
|
143
|
+
parts.push(current);
|
|
144
|
+
return parts;
|
|
145
|
+
}
|
|
146
|
+
/** The colour of one shadow layer, including a `color-mix()` whose own commas nest. */
|
|
147
|
+
function layerColour(layer) {
|
|
148
|
+
const mix = layer.indexOf("color-mix(");
|
|
149
|
+
if (mix > -1) {
|
|
150
|
+
let depth = 0;
|
|
151
|
+
for (let i = layer.indexOf("(", mix); i < layer.length; i++) {
|
|
152
|
+
if (layer[i] === "(")
|
|
153
|
+
depth++;
|
|
154
|
+
else if (layer[i] === ")" && --depth === 0)
|
|
155
|
+
return layer.slice(mix, i + 1);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return layer.match(/(rgba?\([^)]*\)|hsla?\([^)]*\)|oklch\([^)]*\)|#[0-9a-f]{3,8})/i)?.[0];
|
|
159
|
+
}
|
|
160
|
+
/** A CSS box-shadow (one or more layers) as DTCG shadow layers. */
|
|
161
|
+
export function shadowLayers(css) {
|
|
162
|
+
return splitLayers(String(css))
|
|
163
|
+
.map((layer) => layer.trim())
|
|
164
|
+
.filter(Boolean)
|
|
165
|
+
.map((layer) => {
|
|
166
|
+
const colour = layerColour(layer) ?? "rgba(0, 0, 0, 0.15)";
|
|
167
|
+
const lengths = splitOutside(layer.replace(colour, "").replace("inset", "").trim()).filter(Boolean);
|
|
168
|
+
const [offsetX = "0", offsetY = "0", blur = "0", spread = "0"] = lengths;
|
|
169
|
+
return {
|
|
170
|
+
offsetX: length(offsetX),
|
|
171
|
+
offsetY: length(offsetY),
|
|
172
|
+
blur: length(blur),
|
|
173
|
+
spread: length(spread),
|
|
174
|
+
color: colour,
|
|
175
|
+
...(layer.includes("inset") ? { inset: true } : {}),
|
|
176
|
+
};
|
|
177
|
+
});
|
|
178
|
+
}
|
|
179
|
+
const CONVERT = {
|
|
180
|
+
color: (v) => v,
|
|
181
|
+
dimension: (v) => length(v),
|
|
182
|
+
duration: (v) => duration(v),
|
|
183
|
+
cubicBezier: (v) => bezier(v),
|
|
184
|
+
shadow: (v) => shadowLayers(v),
|
|
185
|
+
fontFamily: (v) => v,
|
|
186
|
+
number: (v) => Number.parseFloat(v) || 0,
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* One system tier: the design system's own variables, names kept, typed by the rules given.
|
|
190
|
+
* A variable no rule matches, and that doesn't look like a colour, is left out rather than guessed at.
|
|
191
|
+
*/
|
|
192
|
+
export function systemTier(vars, namespace, rules, description) {
|
|
193
|
+
const tokens = {};
|
|
194
|
+
for (const [name, value] of Object.entries(vars)) {
|
|
195
|
+
const key = name.replace(/^--/, "").replace(new RegExp(`^${namespace}-`), "");
|
|
196
|
+
const rule = rules.find((r) => r.match.test(key));
|
|
197
|
+
// A value a design system writes as a colour: hex, a colour function, or a plain keyword.
|
|
198
|
+
const looksLikeColour = /^(#|rgb|hsl|oklch|color-mix|white$|black$|transparent$)/.test(value.trim());
|
|
199
|
+
if (!rule && !looksLikeColour)
|
|
200
|
+
continue;
|
|
201
|
+
// A unitless number is never a CSS length (except 0), but it is how every design system writes
|
|
202
|
+
// a line height. Typing one as a dimension produces `line-height: 1.5px`, which collapses every
|
|
203
|
+
// line box in the pack, so a rule that says "dimension" yields to what the value actually is.
|
|
204
|
+
const unitless = /^-?\d*\.?\d+$/.test(value.trim()) && Number(value) !== 0;
|
|
205
|
+
const type = rule ? (rule.type === "dimension" && unitless ? "number" : rule.type) : "color";
|
|
206
|
+
tokens[key] = { $value: CONVERT[type](value), $type: type };
|
|
207
|
+
}
|
|
208
|
+
return { $description: description, [namespace]: tokens };
|
|
209
|
+
}
|
|
210
|
+
/** Writes a pack's token files, manifest and package.json. */
|
|
211
|
+
export async function writePack(pack) {
|
|
212
|
+
const tokens = join(pack.dir, "tokens");
|
|
213
|
+
await mkdir(tokens, { recursive: true });
|
|
214
|
+
const write = (file, data) => writeFile(join(tokens, file), JSON.stringify(data, null, 2) + "\n");
|
|
215
|
+
const modes = pack.modes ?? ["light", "dark"];
|
|
216
|
+
if (pack.shared)
|
|
217
|
+
await write("system.json", pack.shared);
|
|
218
|
+
if (modes.includes("light"))
|
|
219
|
+
await write("system.light.json", pack.light);
|
|
220
|
+
if (modes.includes("dark"))
|
|
221
|
+
await write("system.dark.json", pack.dark);
|
|
222
|
+
await write("semantic.json", pack.semantic);
|
|
223
|
+
const files = (mode) => [...(pack.shared ? ["tokens/system.json"] : []), `tokens/system.${mode}.json`, "tokens/semantic.json"];
|
|
224
|
+
await writeFile(join(pack.dir, "manifest.json"), JSON.stringify({
|
|
225
|
+
$schema: "../spec/schema/design-system.schema.json",
|
|
226
|
+
name: pack.name,
|
|
227
|
+
displayName: pack.displayName,
|
|
228
|
+
version: "0.0.0",
|
|
229
|
+
contractVersion: pack.contractVersion,
|
|
230
|
+
license: "Apache-2.0",
|
|
231
|
+
modes: Object.fromEntries(modes.map((mode) => [mode, files(mode)])),
|
|
232
|
+
defaultMode: modes[0],
|
|
233
|
+
...(pack.layout ? { layout: pack.layout } : {}),
|
|
234
|
+
provenance: pack.provenance,
|
|
235
|
+
}, null, 2) + "\n");
|
|
236
|
+
await writeFile(join(pack.dir, "package.json"), JSON.stringify({
|
|
237
|
+
name: `@polyxd/ds-${pack.name}`,
|
|
238
|
+
version: "0.0.0",
|
|
239
|
+
private: true,
|
|
240
|
+
description: `${pack.displayName} design-system pack for Polyxd (DTCG 2025.10 tokens)`,
|
|
241
|
+
license: "Apache-2.0",
|
|
242
|
+
type: "module",
|
|
243
|
+
files: ["manifest.json", "tokens", "README.md"],
|
|
244
|
+
scripts: {
|
|
245
|
+
generate: "node scripts/generate.ts",
|
|
246
|
+
check: "node ../spec/src/cli/check-design-system.ts manifest.json",
|
|
247
|
+
test: "npm run check",
|
|
248
|
+
},
|
|
249
|
+
}, null, 2) + "\n");
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* The nearest step of a palette that clears a contrast floor against `background`, searching
|
|
253
|
+
* outward from `from`. This is the rule every pack follows when a design system's own choice
|
|
254
|
+
* doesn't pass: move along that system's own ramp rather than inventing a colour.
|
|
255
|
+
*
|
|
256
|
+
* `steps` is the ramp in order (index 0 lightest). Returns the chosen index, or the end of the
|
|
257
|
+
* ramp it searched toward when nothing passes — the caller reports that.
|
|
258
|
+
*/
|
|
259
|
+
export function nearestPassing(steps, background, min, from, direction) {
|
|
260
|
+
const step = direction === "darker" ? 1 : -1;
|
|
261
|
+
let best = { index: from, ratio: contrastRatio(steps[from], background), passes: false };
|
|
262
|
+
for (let i = from; i >= 0 && i < steps.length; i += step) {
|
|
263
|
+
const ratio = contrastRatio(steps[i], background);
|
|
264
|
+
if (ratio >= min)
|
|
265
|
+
return { index: i, ratio, passes: true };
|
|
266
|
+
if (ratio > best.ratio)
|
|
267
|
+
best = { index: i, ratio, passes: false };
|
|
268
|
+
}
|
|
269
|
+
return best;
|
|
270
|
+
}
|
|
271
|
+
/** `{alias}` helpers for writing a semantic tier. */
|
|
272
|
+
export const alias = (path) => ({ $value: `{${path}}` });
|
|
273
|
+
export const aliasWith = (path, description) => ({ $value: `{${path}}`, $description: description });
|
|
274
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAKjC;;;;;;;;GAQG;AACH,MAAM,UAAU,OAAO,CAAC,GAAW,EAAE,OAAuD,EAAE,MAAM,GAAG,IAAI;IACzG,MAAM,GAAG,GAAS,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C,IAAI,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,IAAI,EAAE,CAAC;QACzD,MAAM,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,UAAU,CAAC,CAAC;QAClD,IAAI,KAAK,IAAI,GAAG;YAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;QAC3D,IAAI,KAAK,GAAG,IAAI,CAAC,KAAK;YAAE,IAAI,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,CAAC;IACpE,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,qDAAqD;AACrD,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,IAAY,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,IAAI,GAAG,EAAE,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,SAAS,GAAG,CAAC,IAAY,EAAE,WAAmB,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,IAAI,GAAG,EAAE,YAAY,EAAE,WAAW,EAAE,CAAC,CAAC"}
|
package/dist/infer.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { Vars } from "./index.ts";
|
|
2
|
+
export interface Guess {
|
|
3
|
+
/** The contract token, e.g. "color.surface.default" */
|
|
4
|
+
token: string;
|
|
5
|
+
/** The source variable it came from, without the leading dashes */
|
|
6
|
+
from?: string;
|
|
7
|
+
/** Why this variable and not another */
|
|
8
|
+
why: string;
|
|
9
|
+
/** How sure: "named" (the name said so), "measured" (the value said so), "default" (nothing did) */
|
|
10
|
+
how: "named" | "measured" | "derived" | "default";
|
|
11
|
+
}
|
|
12
|
+
export interface Mapping {
|
|
13
|
+
$comment: string;
|
|
14
|
+
/** contract token → source variable name, or a literal value */
|
|
15
|
+
tokens: Record<string, string>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Guesses which of the team's variables is each contract token.
|
|
19
|
+
*
|
|
20
|
+
* Names first, because a variable called `--border-focus` is telling you what it is. Then
|
|
21
|
+
* measurement, for the handful of roles whose job is defined by contrast rather than by name:
|
|
22
|
+
* the page is the lightest neutral, body text is the one furthest from it.
|
|
23
|
+
*/
|
|
24
|
+
export declare function inferMapping(vars: Vars): {
|
|
25
|
+
mapping: Mapping;
|
|
26
|
+
guesses: Guess[];
|
|
27
|
+
};
|
package/dist/infer.js
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Turning somebody else's design tokens into a Polyxd pack.
|
|
3
|
+
*
|
|
4
|
+
* The thirteen packs in this repository were each written by hand, because each design system
|
|
5
|
+
* names things its own way and the interesting decisions are the ones a generator can't make. A
|
|
6
|
+
* team adopting Polyxd has one design system — theirs — and no appetite for that.
|
|
7
|
+
*
|
|
8
|
+
* So this does the boring nine tenths: read their variables, guess which of the contract's tokens
|
|
9
|
+
* each one is, measure whether the guesses actually pass, and write down every guess it made in a
|
|
10
|
+
* mapping file the team can correct. It is explicitly a draft. What makes it useful is not the
|
|
11
|
+
* guessing but the report: `radius.control: no variable matched` is a question someone can answer
|
|
12
|
+
* in a second, where "write a design-system pack" is a week nobody starts.
|
|
13
|
+
*/
|
|
14
|
+
import { contrastRatio, luminance, toRgb } from "@polyxd/spec";
|
|
15
|
+
/** Words a design system uses for each role. Order matters: the first match wins. */
|
|
16
|
+
const NAMES = {
|
|
17
|
+
"color.surface.default": [/^(colors?-)?(bg|background)$/, /background-(default|primary|base|canvas)/, /surface(-default)?$/, /^base$/],
|
|
18
|
+
"color.surface.subtle": [/(bg|background|surface)-(subtle|muted|secondary|alt|sunken|inset)/, /^muted$/],
|
|
19
|
+
"color.surface.raised": [/(bg|background|surface)-(raised|card|panel|elevated)/, /^card$/, /^paper$/],
|
|
20
|
+
"color.surface.overlay": [/(bg|background|surface)-(overlay|popover|menu|dialog|modal)/, /^popover$/],
|
|
21
|
+
"color.surface.inverse": [/(bg|background|surface)-(inverse|inverted|emphasis)/],
|
|
22
|
+
"color.text.default": [/^(colors?-)?(fg|foreground|text|ink)$/, /(text|fg|foreground)-(default|primary|body|base)/],
|
|
23
|
+
"color.text.muted": [/(text|fg|foreground)-(muted|secondary|subtle|tertiary|dim)/],
|
|
24
|
+
"color.text.inverse": [/(text|fg|foreground)-(inverse|inverted|on-?emphasis|on-?primary)/],
|
|
25
|
+
"color.text.link": [/(text|fg|foreground)?-?link/, /^link$/, /(text|fg)-(accent|brand)/],
|
|
26
|
+
"color.border.default": [/^(colors?-)?border$/, /border-(default|primary|base)/, /^divider$/, /^outline$/],
|
|
27
|
+
"color.border.strong": [/border-(strong|emphasis|emphasized|heavy|dark)/],
|
|
28
|
+
"color.border.focus": [/focus(-ring|-outline)?(-color)?$/, /^ring$/, /border-focus/],
|
|
29
|
+
"color.action.primary.background": [/(button|btn)-primary(-bg|-background)?$/, /^primary$/, /primary-(bg|background|default|solid)/, /^brand$/, /accent-(bg|background)/],
|
|
30
|
+
"color.action.primary.foreground": [/(button|btn)-primary-(fg|foreground|text|color)/, /^primary-foreground$/, /on-?primary/],
|
|
31
|
+
"color.action.secondary.background": [/(button|btn)-(secondary|default)(-bg|-background)?$/, /^secondary$/, /secondary-(bg|background)/],
|
|
32
|
+
"color.action.secondary.foreground": [/(button|btn)-(secondary|default)-(fg|foreground|text)/, /^secondary-foreground$/],
|
|
33
|
+
"color.action.secondary.border": [/(button|btn)-(secondary|default)-border/],
|
|
34
|
+
"color.action.danger.background": [/(danger|destructive|critical|error|negative)(-bg|-background|-solid|-emphasis)?$/],
|
|
35
|
+
"color.action.danger.foreground": [/(danger|destructive|critical|error|negative)-(fg|foreground|text)/, /on-?(danger|destructive|error)/],
|
|
36
|
+
"color.selection.background": [/(selection|selected)(-bg|-background)?$/, /^accent$/],
|
|
37
|
+
"color.selection.foreground": [/(selection|selected)-(fg|foreground|text)/, /^accent-foreground$/],
|
|
38
|
+
"color.status.info.background": [/(info|informative)-(bg|background|muted|subtle|surface)/],
|
|
39
|
+
"color.status.info.foreground": [/(info|informative)-(fg|foreground|text)/],
|
|
40
|
+
"color.status.info.emphasis": [/(info|informative)(-emphasis|-solid|-strong)?$/],
|
|
41
|
+
"color.status.success.background": [/(success|positive)-(bg|background|muted|subtle|surface)/],
|
|
42
|
+
"color.status.success.foreground": [/(success|positive)-(fg|foreground|text)/],
|
|
43
|
+
"color.status.success.emphasis": [/(success|positive)(-emphasis|-solid|-strong)?$/],
|
|
44
|
+
"color.status.warning.background": [/(warning|caution|attention)-(bg|background|muted|subtle|surface)/],
|
|
45
|
+
"color.status.warning.foreground": [/(warning|caution|attention)-(fg|foreground|text)/],
|
|
46
|
+
"color.status.warning.emphasis": [/(warning|caution|attention)(-emphasis|-solid|-strong)?$/],
|
|
47
|
+
"color.status.danger.background": [/(danger|destructive|critical|error|negative)-(bg|background|muted|subtle|surface)/],
|
|
48
|
+
"color.status.danger.foreground": [/(danger|destructive|critical|error|negative)-(fg|foreground|text)/],
|
|
49
|
+
"color.status.danger.emphasis": [/(danger|destructive|critical|error|negative)(-emphasis|-solid|-strong)?$/],
|
|
50
|
+
"color.scrim": [/(scrim|backdrop|overlay-bg)/],
|
|
51
|
+
"radius.small": [/rad(ius)?-(xs|sm|small|1)$/],
|
|
52
|
+
"radius.control": [/(button|btn|control|input)-rad(ius)?/, /rad(ius)?-(md|medium|default|2)$/],
|
|
53
|
+
"radius.default": [/rad(ius)?-(md|medium|default|2)$/],
|
|
54
|
+
"radius.large": [/rad(ius)?-(lg|large|xl|3)$/],
|
|
55
|
+
"radius.full": [/rad(ius)?-(full|round|pill|circle)$/],
|
|
56
|
+
"border.width.default": [/border-width(-default|-thin|-1)?$/],
|
|
57
|
+
"border.width.strong": [/border-width-(strong|thick|2)/],
|
|
58
|
+
"focus.ring.width": [/focus-(ring|outline)-width/],
|
|
59
|
+
"focus.ring.offset": [/focus-(ring|outline)-offset/],
|
|
60
|
+
"shadow.raised": [/shadow-(sm|small|1|raised|card)$/],
|
|
61
|
+
"shadow.overlay": [/shadow-(lg|large|3|overlay|popover|modal)$/],
|
|
62
|
+
"space.inset.compact": [/(space|spacing|padding)-(xs|1|compact)$/],
|
|
63
|
+
"space.inset.default": [/(space|spacing|padding)-(md|4|default)$/],
|
|
64
|
+
"space.inset.comfortable": [/(space|spacing|padding)-(lg|6|comfortable)$/],
|
|
65
|
+
"space.stack.tight": [/(space|spacing|gap)-(xs|1)$/],
|
|
66
|
+
"space.stack.default": [/(space|spacing|gap)-(sm|2)$/],
|
|
67
|
+
"space.stack.loose": [/(space|spacing|gap)-(md|4)$/],
|
|
68
|
+
"space.stack.section": [/(space|spacing|gap)-(xl|8)$/],
|
|
69
|
+
"space.inline.tight": [/(space|spacing|gap)-(xs|1)$/],
|
|
70
|
+
"space.inline.default": [/(space|spacing|gap)-(sm|2)$/],
|
|
71
|
+
"space.inline.loose": [/(space|spacing|gap)-(md|4)$/],
|
|
72
|
+
"size.icon.small": [/(icon|size)-(sm|small|4)$/],
|
|
73
|
+
"size.icon.default": [/(icon|size)-(md|medium|5)$/],
|
|
74
|
+
"motion.duration.instant": [/duration-(50|75|100|instant|fastest)$/],
|
|
75
|
+
"motion.duration.short": [/duration-(150|200|short|fast)$/],
|
|
76
|
+
"motion.duration.medium": [/duration-(200|300|medium|moderate|normal)$/],
|
|
77
|
+
"motion.duration.long": [/duration-(400|500|long|slow)$/],
|
|
78
|
+
"motion.easing.standard": [/eas(e|ing)-(in-out|standard|default)$/],
|
|
79
|
+
"motion.easing.enter": [/eas(e|ing)-(out|enter|decelerate)$/],
|
|
80
|
+
"motion.easing.exit": [/eas(e|ing)-(in|exit|accelerate)$/],
|
|
81
|
+
};
|
|
82
|
+
const isColour = (v) => /^(#|rgb|hsl|oklch|lab|color-mix|white$|black$)/i.test(v.trim());
|
|
83
|
+
const isLength = (v) => /^-?[\d.]+(px|rem|em)$/.test(v.trim());
|
|
84
|
+
const isDuration = (v) => /^[\d.]+m?s$/.test(v.trim());
|
|
85
|
+
const isEasing = (v) => /^cubic-bezier\(/.test(v.trim());
|
|
86
|
+
const isShadow = (v) => /\d+px .*(rgb|hsl|#|color-mix)/i.test(v.trim());
|
|
87
|
+
const KIND = {
|
|
88
|
+
color: isColour,
|
|
89
|
+
radius: isLength,
|
|
90
|
+
space: isLength,
|
|
91
|
+
size: isLength,
|
|
92
|
+
border: isLength,
|
|
93
|
+
focus: isLength,
|
|
94
|
+
shadow: isShadow,
|
|
95
|
+
motion: (v) => isDuration(v) || isEasing(v),
|
|
96
|
+
};
|
|
97
|
+
/**
|
|
98
|
+
* Guesses which of the team's variables is each contract token.
|
|
99
|
+
*
|
|
100
|
+
* Names first, because a variable called `--border-focus` is telling you what it is. Then
|
|
101
|
+
* measurement, for the handful of roles whose job is defined by contrast rather than by name:
|
|
102
|
+
* the page is the lightest neutral, body text is the one furthest from it.
|
|
103
|
+
*/
|
|
104
|
+
export function inferMapping(vars) {
|
|
105
|
+
const clean = Object.fromEntries(Object.entries(vars).map(([k, v]) => [k.replace(/^--/, ""), v.trim()]));
|
|
106
|
+
const names = Object.keys(clean);
|
|
107
|
+
// `--acme-border` is the same variable as `--border` as far as a pattern is concerned. Rather
|
|
108
|
+
// than guess one project-wide prefix — real files mix `--acme-bg` with a bare `--primary` — a
|
|
109
|
+
// pattern is tried against the name and against every suffix of it.
|
|
110
|
+
const spellings = (n) => {
|
|
111
|
+
const parts = n.split("-");
|
|
112
|
+
return parts.map((_, i) => parts.slice(i).join("-"));
|
|
113
|
+
};
|
|
114
|
+
const guesses = [];
|
|
115
|
+
const kindOf = (token) => KIND[token.split(".")[0]] ?? (() => true);
|
|
116
|
+
for (const [token, patterns] of Object.entries(NAMES)) {
|
|
117
|
+
const fits = kindOf(token);
|
|
118
|
+
let found;
|
|
119
|
+
for (const pattern of patterns) {
|
|
120
|
+
// One variable can serve several tokens, and usually does: a system with one small spacing
|
|
121
|
+
// step uses it for tight stacks and tight inline gaps alike.
|
|
122
|
+
found = names.find((n) => fits(clean[n]) && spellings(n).some((spelling) => pattern.test(spelling)));
|
|
123
|
+
if (found)
|
|
124
|
+
break;
|
|
125
|
+
}
|
|
126
|
+
if (found)
|
|
127
|
+
guesses.push({ token, from: found, why: `"${found}" reads as ${token}`, how: "named" });
|
|
128
|
+
}
|
|
129
|
+
// Measurement, for what naming didn't reach. A design system always has a page colour and a
|
|
130
|
+
// text colour even when it calls them something this doesn't recognise.
|
|
131
|
+
const colours = names.filter((n) => isColour(clean[n]));
|
|
132
|
+
const has = (token) => guesses.some((g) => g.token === token);
|
|
133
|
+
if (colours.length && (!has("color.surface.default") || !has("color.text.default"))) {
|
|
134
|
+
const sorted = [...colours].sort((a, b) => {
|
|
135
|
+
try {
|
|
136
|
+
return luminance(toRgb(clean[b])) - luminance(toRgb(clean[a]));
|
|
137
|
+
}
|
|
138
|
+
catch {
|
|
139
|
+
return 0;
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
if (!has("color.surface.default") && sorted[0]) {
|
|
143
|
+
guesses.push({ token: "color.surface.default", from: sorted[0], why: `the lightest colour you define`, how: "measured" });
|
|
144
|
+
}
|
|
145
|
+
const page = clean[guesses.find((g) => g.token === "color.surface.default")?.from ?? sorted[0]];
|
|
146
|
+
if (!has("color.text.default")) {
|
|
147
|
+
const readable = sorted.filter((n) => {
|
|
148
|
+
try {
|
|
149
|
+
return contrastRatio(clean[n], page) >= 4.5;
|
|
150
|
+
}
|
|
151
|
+
catch {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
const pick = readable[readable.length - 1];
|
|
156
|
+
if (pick)
|
|
157
|
+
guesses.push({ token: "color.text.default", from: pick, why: `${contrastRatio(clean[pick], page).toFixed(1)}:1 on your page colour`, how: "measured" });
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
// What one role implies about another. A system that names a success colour has said enough for
|
|
161
|
+
// the chart's positive series; one that has an informative tint has said enough for selection.
|
|
162
|
+
// Each of these is recorded as derived, so the report says where it came from.
|
|
163
|
+
const DERIVED = [
|
|
164
|
+
["color.selection.background", "color.status.info.background", "your informative tint is what a selected row is"],
|
|
165
|
+
["color.selection.foreground", "color.status.info.foreground", "the text that sits on that tint"],
|
|
166
|
+
["color.data.positive", "color.status.success.emphasis", "your success colour"],
|
|
167
|
+
["color.data.negative", "color.status.danger.emphasis", "your danger colour"],
|
|
168
|
+
["color.data.neutral", "color.text.muted", "your muted text colour"],
|
|
169
|
+
["color.data.categorical.1", "color.status.info.emphasis", "your informative colour"],
|
|
170
|
+
["color.data.categorical.2", "color.status.success.emphasis", "your success colour"],
|
|
171
|
+
["color.data.categorical.3", "color.action.primary.background", "your primary colour"],
|
|
172
|
+
["color.data.categorical.4", "color.status.warning.emphasis", "your warning colour"],
|
|
173
|
+
["color.data.categorical.5", "color.status.danger.emphasis", "your danger colour"],
|
|
174
|
+
["color.data.categorical.6", "color.border.strong", "your strongest neutral"],
|
|
175
|
+
["radius.default", "radius.control", "the radius your controls use"],
|
|
176
|
+
["color.status.danger.background", "color.action.danger.background", "your danger colour; a tint would be better if you have one"],
|
|
177
|
+
["color.status.danger.foreground", "color.action.danger.foreground", "the text that sits on your danger colour"],
|
|
178
|
+
["color.status.danger.emphasis", "color.action.danger.background", "your danger colour"],
|
|
179
|
+
["color.surface.overlay", "color.surface.raised", "the surface your cards use"],
|
|
180
|
+
["color.surface.inverse", "color.text.default", "the opposite end of your neutral range"],
|
|
181
|
+
["color.text.inverse", "color.surface.default", "your page colour, read on a dark surface"],
|
|
182
|
+
["space.stack.tight", "space.inline.tight", "the same small step"],
|
|
183
|
+
["space.inline.tight", "space.stack.tight", "the same small step"],
|
|
184
|
+
["space.inline.default", "space.stack.default", "the same step"],
|
|
185
|
+
["space.inline.loose", "space.stack.loose", "the same step"],
|
|
186
|
+
["space.stack.loose", "space.inset.default", "the same step"],
|
|
187
|
+
];
|
|
188
|
+
for (const [token, from, why] of DERIVED) {
|
|
189
|
+
if (guesses.some((g) => g.token === token))
|
|
190
|
+
continue;
|
|
191
|
+
const source = guesses.find((g) => g.token === from);
|
|
192
|
+
if (source?.from)
|
|
193
|
+
guesses.push({ token, from: source.from, why: `${why} (from ${from})`, how: "derived" });
|
|
194
|
+
}
|
|
195
|
+
const mapping = {
|
|
196
|
+
$comment: "Draft mapping from your design system's variables to the Polyxd token contract. Every line is a guess this tool made or a blank it couldn't fill. Correct the wrong ones, fill the empty ones, and run `polyxd pack` again.",
|
|
197
|
+
tokens: Object.fromEntries(guesses.map((g) => [g.token, g.from])),
|
|
198
|
+
};
|
|
199
|
+
return { mapping, guesses };
|
|
200
|
+
}
|
|
201
|
+
//# sourceMappingURL=infer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"infer.js","sourceRoot":"","sources":["../src/infer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,OAAO,EAAE,aAAa,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AAoB/D,qFAAqF;AACrF,MAAM,KAAK,GAA6B;IACtC,uBAAuB,EAAE,CAAC,8BAA8B,EAAE,0CAA0C,EAAE,qBAAqB,EAAE,QAAQ,CAAC;IACtI,sBAAsB,EAAE,CAAC,mEAAmE,EAAE,SAAS,CAAC;IACxG,sBAAsB,EAAE,CAAC,sDAAsD,EAAE,QAAQ,EAAE,SAAS,CAAC;IACrG,uBAAuB,EAAE,CAAC,6DAA6D,EAAE,WAAW,CAAC;IACrG,uBAAuB,EAAE,CAAC,qDAAqD,CAAC;IAChF,oBAAoB,EAAE,CAAC,uCAAuC,EAAE,kDAAkD,CAAC;IACnH,kBAAkB,EAAE,CAAC,4DAA4D,CAAC;IAClF,oBAAoB,EAAE,CAAC,kEAAkE,CAAC;IAC1F,iBAAiB,EAAE,CAAC,6BAA6B,EAAE,QAAQ,EAAE,0BAA0B,CAAC;IACxF,sBAAsB,EAAE,CAAC,qBAAqB,EAAE,+BAA+B,EAA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