@rijkshuisstijl-community/design-tokens 1.0.0-alpha.3 → 1.0.0-alpha.30
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.md +7 -282
- package/README.md +21 -3
- package/dist/_variables.scss +1091 -7
- package/dist/index.css +1091 -7
- package/dist/index.d.ts +1091 -6
- package/dist/index.js +1091 -7
- package/dist/index.json +1091 -7
- package/dist/index.tokens.json +1674 -11
- package/dist/root.css +1091 -7
- package/dist/tokens.d.ts +1673 -10
- package/dist/tokens.js +25606 -72
- package/dist/variables.less +1091 -7
- package/figma/figma.tokens.json +6497 -0
- package/package.json +16 -12
- package/src/common/utrecht/action.tokens.json +10 -0
- package/src/common/utrecht/focus.tokens.json +17 -0
- package/src/generated/figma.tokens.json +5088 -0
- package/token-transformer.mjs +49 -0
- package/src/brand/rhc/color.tokens.json +0 -13
- package/src/common/rhc/focus.tokens.json +0 -7
- package/src/components/rhc/button.tokens.json +0 -8
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { dirname } from 'node:path';
|
|
3
|
+
|
|
4
|
+
import { transformTokens } from 'token-transformer';
|
|
5
|
+
|
|
6
|
+
const init = async ({ input, output }) => {
|
|
7
|
+
const json = await readFile(input, 'utf-8');
|
|
8
|
+
const rawTokens = JSON.parse(json);
|
|
9
|
+
|
|
10
|
+
const setsToUse = [];
|
|
11
|
+
|
|
12
|
+
// The following components didn't work yet because of broken design token references.
|
|
13
|
+
// You can remove excludes from this list at any time, as long as they don't break the build.
|
|
14
|
+
const excludes = [
|
|
15
|
+
'components/avatar',
|
|
16
|
+
'components/backdrop',
|
|
17
|
+
'components/drawer',
|
|
18
|
+
'components/form-field-option-label',
|
|
19
|
+
'components/modal-dialog',
|
|
20
|
+
'components/pagination',
|
|
21
|
+
'components/status-badge',
|
|
22
|
+
'components/summary-list',
|
|
23
|
+
'components/task-list',
|
|
24
|
+
'components/toolbar-button',
|
|
25
|
+
];
|
|
26
|
+
|
|
27
|
+
const transformerOptions = {
|
|
28
|
+
// expandTypography: true,
|
|
29
|
+
// expandShadow: true,
|
|
30
|
+
// expandComposition: true,
|
|
31
|
+
// expandBorder: true,
|
|
32
|
+
// preserveRawValue: false,
|
|
33
|
+
// throwErrorWhenNotResolved: true,
|
|
34
|
+
// resolveReferences: true,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
let resolved = transformTokens(rawTokens, setsToUse, excludes, transformerOptions);
|
|
38
|
+
|
|
39
|
+
delete resolved['tokenSetOrder'];
|
|
40
|
+
|
|
41
|
+
await mkdir(dirname(output), { recursive: true });
|
|
42
|
+
|
|
43
|
+
await writeFile(output, JSON.stringify(resolved, null, 2));
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
init({
|
|
47
|
+
input: './figma/figma.tokens.json',
|
|
48
|
+
output: './src/generated/figma.tokens.json',
|
|
49
|
+
});
|