@utrecht/design-tokens 2.1.0 → 2.2.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/.stylelintrc.json +5 -1
- package/CHANGELOG.md +14 -0
- package/config.json +8 -0
- package/dist/_mixin-theme.scss +34 -37
- package/dist/_mixin.scss +1009 -0
- package/dist/_variables.scss +34 -37
- package/dist/background-image-icon.css +0 -1
- package/dist/dark/_mixin-theme.scss +34 -37
- package/dist/dark/_mixin.scss +1020 -0
- package/dist/dark/_variables.scss +1017 -0
- package/dist/dark/index.cjs +1020 -0
- package/dist/dark/index.css +34 -37
- package/dist/dark/index.d.ts +1139 -0
- package/dist/dark/index.flat.json +1016 -0
- package/dist/dark/index.json +30694 -0
- package/dist/dark/index.mjs +1018 -0
- package/dist/dark/index.tokens.json +7885 -0
- package/dist/dark/list.json +30694 -0
- package/dist/dark/property.css +705 -0
- package/dist/dark/root.css +538 -541
- package/dist/dark/theme-prince-xml.css +1020 -0
- package/dist/dark/theme.css +1020 -0
- package/dist/dark/tokens.cjs +37567 -0
- package/dist/dark/tokens.d.ts +4842 -0
- package/dist/dark/tokens.json +37563 -0
- package/dist/dark/variables.cjs +1020 -0
- package/dist/dark/variables.css +1020 -0
- package/dist/dark/variables.d.ts +1139 -0
- package/dist/dark/variables.json +1016 -0
- package/dist/dark/variables.less +1017 -0
- package/dist/dark/variables.mjs +1018 -0
- package/dist/index.cjs +29 -32
- package/dist/index.css +149 -82
- package/dist/index.d.ts +18 -25
- package/dist/index.flat.json +591 -593
- package/dist/index.json +4577 -7587
- package/dist/index.mjs +31 -34
- package/dist/index.tokens.json +385 -71
- package/dist/list.json +31811 -0
- package/dist/property.css +770 -0
- package/dist/root.css +529 -532
- package/dist/theme-prince-xml.css +34 -37
- package/dist/theme.css +529 -532
- package/dist/tokens.cjs +6297 -8992
- package/dist/tokens.d.ts +208 -60
- package/dist/tokens.json +38705 -0
- package/dist/variables.cjs +1009 -0
- package/dist/variables.css +1009 -0
- package/dist/variables.d.ts +1128 -0
- package/dist/variables.json +1005 -0
- package/dist/variables.less +34 -37
- package/dist/variables.mjs +1007 -0
- package/package.json +6 -5
- package/src/background-image-icon.scss +0 -1
- package/src/brand/utrecht/typography.tokens.json +7 -9
- package/src/component/of/progress-indicator.tokens.json +1 -1
- package/src/component/utrecht/backdrop.tokens.json +1 -1
- package/src/component/utrecht/blockquote.tokens.json +3 -3
- package/src/component/utrecht/button.tokens.json +1 -3
- package/src/component/utrecht/code-block.tokens.json +2 -2
- package/src/component/utrecht/figure.tokens.json +2 -2
- package/src/component/utrecht/form-fieldset.tokens.json +2 -2
- package/src/component/utrecht/form-toggle.tokens.json +1 -1
- package/src/component/utrecht/link.tokens.json +3 -1
- package/src/component/utrecht/pagination.tokens.json +1 -1
- package/src/component/utrecht/skip-link.tokens.json +4 -2
- package/src/component/utrecht/table.tokens.json +1 -1
- package/src/component/utrecht/toptask-link.tokens.json +1 -1
- package/src/css-property-formatter.mjs +46 -0
- package/src/dark/component/tokens.json +1 -1
- package/src/index.scss +81 -5
- package/style-dictionary-build-dark.mjs +64 -0
- package/style-dictionary-build.mjs +41 -0
- package/style-dictionary-config.mjs +261 -0
- package/dist/figma-tokens.json +0 -40396
- package/src/css-property-formatter.js +0 -35
- package/src/style-dictionary-config-dark.js +0 -56
- package/src/style-dictionary-config.js +0 -63
- package/style-dictionary.config.json +0 -143
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license EUPL-1.2
|
|
3
|
-
* Copyright (c) 2021 Robbert Broersma
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
const stringSort = (a, b) => (a === b ? 0 : a > b ? 1 : -1);
|
|
7
|
-
|
|
8
|
-
module.exports = {
|
|
9
|
-
'css/property': function ({ dictionary }) {
|
|
10
|
-
let { allTokens } = dictionary;
|
|
11
|
-
|
|
12
|
-
// https://drafts.css-houdini.org/css-properties-values-api/#the-css-property-rule-interface
|
|
13
|
-
return allTokens
|
|
14
|
-
.sort((tokenA, tokenB) => stringSort(tokenA.name, tokenB.name))
|
|
15
|
-
.filter(
|
|
16
|
-
(token) => token.css && token.css.syntax && token.css.syntax !== '*' && typeof token.css.inherits === 'boolean',
|
|
17
|
-
)
|
|
18
|
-
.map((token) => {
|
|
19
|
-
let str = `@property --${token.name} { `;
|
|
20
|
-
|
|
21
|
-
str += `syntax: '${token.css.syntax}'; `;
|
|
22
|
-
|
|
23
|
-
str += `inherits: ${token.css.inherits}; `;
|
|
24
|
-
|
|
25
|
-
if (token.css.initialValue) {
|
|
26
|
-
str += `initial-value: ${token.css.initialValue}; `;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
str += `}`;
|
|
30
|
-
|
|
31
|
-
return str;
|
|
32
|
-
})
|
|
33
|
-
.join('\n');
|
|
34
|
-
},
|
|
35
|
-
};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
const config = require('./style-dictionary-config.js');
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
4
|
-
...config,
|
|
5
|
-
source: [
|
|
6
|
-
...config.source,
|
|
7
|
-
'./src/dark/tokens.json',
|
|
8
|
-
'./src/dark/*.tokens.json',
|
|
9
|
-
'./src/dark/**/tokens.json',
|
|
10
|
-
'./src/dark/**.tokens.json',
|
|
11
|
-
],
|
|
12
|
-
platforms: {
|
|
13
|
-
css: {
|
|
14
|
-
transforms: ['attribute/cti', 'name/cti/kebab', 'color/hsl-4'],
|
|
15
|
-
buildPath: 'dist/dark/',
|
|
16
|
-
files: [
|
|
17
|
-
{
|
|
18
|
-
destination: 'root.css',
|
|
19
|
-
format: 'css/variables',
|
|
20
|
-
options: {
|
|
21
|
-
selector: ':root, ::backdrop',
|
|
22
|
-
outputReferences: true,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
],
|
|
26
|
-
},
|
|
27
|
-
'css-theme': {
|
|
28
|
-
transforms: ['attribute/cti', 'name/cti/kebab', 'color/hsl-4'],
|
|
29
|
-
buildPath: 'dist/dark/',
|
|
30
|
-
files: [
|
|
31
|
-
{
|
|
32
|
-
destination: 'index.css',
|
|
33
|
-
format: 'css/variables',
|
|
34
|
-
options: {
|
|
35
|
-
selector: '.utrecht-theme--dark, .utrecht-theme--dark ::backdrop',
|
|
36
|
-
outputReferences: true,
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
],
|
|
40
|
-
},
|
|
41
|
-
'scss-theme-mixin': {
|
|
42
|
-
transforms: ['attribute/cti', 'name/cti/kebab', 'color/hsl-4'],
|
|
43
|
-
buildPath: 'dist/dark/',
|
|
44
|
-
files: [
|
|
45
|
-
{
|
|
46
|
-
destination: '_mixin-theme.scss',
|
|
47
|
-
format: 'css/variables',
|
|
48
|
-
options: {
|
|
49
|
-
selector: '@mixin utrecht-theme--dark',
|
|
50
|
-
outputReferences: true,
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
};
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
const { transform } = require('@divriots/style-dictionary-to-figma');
|
|
2
|
-
const mergeWith = require('lodash.mergewith');
|
|
3
|
-
const cssPropertyFormat = require('./css-property-formatter.js');
|
|
4
|
-
const jsonListFormat = require('./json-list-formatter.js');
|
|
5
|
-
const config = require('../style-dictionary.config.json');
|
|
6
|
-
const stringSort = (a, b) => (a === b ? 0 : a > b ? 1 : -1);
|
|
7
|
-
const destinationSort = (a, b) => stringSort(a.destination, b.destination);
|
|
8
|
-
|
|
9
|
-
const figmaTokensConfig = {
|
|
10
|
-
format: {
|
|
11
|
-
figmaTokensPlugin: ({ dictionary }) => {
|
|
12
|
-
const transformedTokens = transform(dictionary.tokens);
|
|
13
|
-
return JSON.stringify(transformedTokens, null, 2);
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
platforms: {
|
|
17
|
-
jsonx: {
|
|
18
|
-
transformGroup: 'js',
|
|
19
|
-
files: [
|
|
20
|
-
{
|
|
21
|
-
destination: 'dist/figma-tokens.json',
|
|
22
|
-
format: 'figmaTokensPlugin',
|
|
23
|
-
},
|
|
24
|
-
],
|
|
25
|
-
},
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
const cssPropertyConfig = {
|
|
30
|
-
format: {
|
|
31
|
-
...cssPropertyFormat,
|
|
32
|
-
},
|
|
33
|
-
platforms: {
|
|
34
|
-
css: {
|
|
35
|
-
files: [
|
|
36
|
-
{
|
|
37
|
-
destination: 'property.css',
|
|
38
|
-
format: 'css/property',
|
|
39
|
-
},
|
|
40
|
-
].sort(destinationSort),
|
|
41
|
-
},
|
|
42
|
-
},
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
const jsonConfig = {
|
|
46
|
-
format: {
|
|
47
|
-
...jsonListFormat,
|
|
48
|
-
},
|
|
49
|
-
platforms: {
|
|
50
|
-
json: {
|
|
51
|
-
files: [
|
|
52
|
-
{
|
|
53
|
-
destination: 'index.json',
|
|
54
|
-
format: 'json/list',
|
|
55
|
-
},
|
|
56
|
-
].sort(destinationSort),
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
module.exports = mergeWith({}, config, cssPropertyConfig, jsonConfig, figmaTokensConfig, (objValue, srcValue) =>
|
|
62
|
-
Array.isArray(objValue) && Array.isArray(srcValue) ? [...objValue, ...srcValue] : undefined,
|
|
63
|
-
);
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"source": [
|
|
3
|
-
"../../components/**/tokens.json",
|
|
4
|
-
"../../components/**/*.tokens.json",
|
|
5
|
-
"./src/brand/tokens.json",
|
|
6
|
-
"./src/brand/**/*.tokens.json",
|
|
7
|
-
"./src/common/tokens.json",
|
|
8
|
-
"./src/common/**/*.tokens.json",
|
|
9
|
-
"./src/component/tokens.json",
|
|
10
|
-
"./src/component/**/*.tokens.json"
|
|
11
|
-
],
|
|
12
|
-
"platforms": {
|
|
13
|
-
"js": {
|
|
14
|
-
"transforms": ["attribute/cti", "name/cti/camel", "color/hsl-4"],
|
|
15
|
-
"buildPath": "dist/",
|
|
16
|
-
"files": [
|
|
17
|
-
{
|
|
18
|
-
"destination": "index.cjs",
|
|
19
|
-
"format": "javascript/module-flat"
|
|
20
|
-
},
|
|
21
|
-
{
|
|
22
|
-
"destination": "index.mjs",
|
|
23
|
-
"format": "javascript/es6"
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
"format": "javascript/module",
|
|
27
|
-
"destination": "tokens.cjs"
|
|
28
|
-
}
|
|
29
|
-
]
|
|
30
|
-
},
|
|
31
|
-
"json": {
|
|
32
|
-
"transforms": ["attribute/cti", "name/cti/camel", "color/hsl-4"],
|
|
33
|
-
"buildPath": "dist/",
|
|
34
|
-
"files": [
|
|
35
|
-
{
|
|
36
|
-
"destination": "index.tokens.json",
|
|
37
|
-
"format": "json/nested"
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"destination": "index.flat.json",
|
|
41
|
-
"format": "json/flat"
|
|
42
|
-
}
|
|
43
|
-
]
|
|
44
|
-
},
|
|
45
|
-
"css": {
|
|
46
|
-
"transforms": ["attribute/cti", "name/cti/kebab", "color/hsl-4"],
|
|
47
|
-
"buildPath": "dist/",
|
|
48
|
-
"files": [
|
|
49
|
-
{
|
|
50
|
-
"destination": "root.css",
|
|
51
|
-
"format": "css/variables",
|
|
52
|
-
"options": {
|
|
53
|
-
"selector": ":root, ::backdrop",
|
|
54
|
-
"outputReferences": true
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
]
|
|
58
|
-
},
|
|
59
|
-
"css-theme": {
|
|
60
|
-
"transforms": ["attribute/cti", "name/cti/kebab", "color/hsl-4"],
|
|
61
|
-
"buildPath": "dist/",
|
|
62
|
-
"files": [
|
|
63
|
-
{
|
|
64
|
-
"destination": "theme.css",
|
|
65
|
-
"format": "css/variables",
|
|
66
|
-
"options": {
|
|
67
|
-
"selector": ".utrecht-theme, .utrecht-theme ::backdrop",
|
|
68
|
-
"outputReferences": true
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
]
|
|
72
|
-
},
|
|
73
|
-
"css-theme-prince-xml": {
|
|
74
|
-
"transforms": ["attribute/cti", "name/cti/kebab", "color/hsl-4"],
|
|
75
|
-
"buildPath": "dist/",
|
|
76
|
-
"files": [
|
|
77
|
-
{
|
|
78
|
-
"destination": "theme-prince-xml.css",
|
|
79
|
-
"format": "css/variables",
|
|
80
|
-
"options": {
|
|
81
|
-
"selector": ".utrecht-theme",
|
|
82
|
-
"outputReferences": true
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
]
|
|
86
|
-
},
|
|
87
|
-
"scss": {
|
|
88
|
-
"transforms": ["attribute/cti", "name/cti/kebab", "color/hsl-4"],
|
|
89
|
-
"buildPath": "dist/",
|
|
90
|
-
"files": [
|
|
91
|
-
{
|
|
92
|
-
"destination": "_variables.scss",
|
|
93
|
-
"format": "scss/variables",
|
|
94
|
-
"options": {
|
|
95
|
-
"outputReferences": true
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
]
|
|
99
|
-
},
|
|
100
|
-
"scss-theme-mixin": {
|
|
101
|
-
"transforms": ["attribute/cti", "name/cti/kebab", "color/hsl-4"],
|
|
102
|
-
"buildPath": "dist/",
|
|
103
|
-
"files": [
|
|
104
|
-
{
|
|
105
|
-
"destination": "_mixin-theme.scss",
|
|
106
|
-
"format": "css/variables",
|
|
107
|
-
"options": {
|
|
108
|
-
"selector": "@mixin utrecht-theme",
|
|
109
|
-
"outputReferences": true
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
]
|
|
113
|
-
},
|
|
114
|
-
"typescript": {
|
|
115
|
-
"transforms": ["attribute/cti", "name/cti/camel", "color/hsl-4"],
|
|
116
|
-
"transformGroup": "js",
|
|
117
|
-
"buildPath": "dist/",
|
|
118
|
-
"files": [
|
|
119
|
-
{
|
|
120
|
-
"format": "typescript/es6-declarations",
|
|
121
|
-
"destination": "index.d.ts"
|
|
122
|
-
},
|
|
123
|
-
{
|
|
124
|
-
"format": "typescript/module-declarations",
|
|
125
|
-
"destination": "tokens.d.ts"
|
|
126
|
-
}
|
|
127
|
-
]
|
|
128
|
-
},
|
|
129
|
-
"less": {
|
|
130
|
-
"transforms": ["attribute/cti", "name/cti/kebab", "color/hsl-4"],
|
|
131
|
-
"buildPath": "dist/",
|
|
132
|
-
"files": [
|
|
133
|
-
{
|
|
134
|
-
"destination": "variables.less",
|
|
135
|
-
"format": "less/variables",
|
|
136
|
-
"options": {
|
|
137
|
-
"outputReferences": true
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
]
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|