@digdir/designsystemet 1.6.1 → 1.7.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/README.md +1 -1
- package/configs/test-tokens.config.json +9 -0
- package/dist/bin/config.js +12 -14
- package/dist/bin/designsystemet.d.ts +1 -1
- package/dist/bin/designsystemet.d.ts.map +1 -1
- package/dist/bin/designsystemet.js +60 -317
- package/dist/color.base.template-QGZJKXMN.json +22 -0
- package/dist/config.schema.json +23 -7
- package/dist/src/colors/colorMetadata.d.ts +2 -0
- package/dist/src/colors/colorMetadata.d.ts.map +1 -1
- package/dist/src/colors/colorMetadata.js +8 -5
- package/dist/src/colors/index.js +9 -17
- package/dist/src/colors/theme.d.ts.map +1 -1
- package/dist/src/colors/theme.js +14 -18
- package/dist/src/colors/types.d.ts +1 -1
- package/dist/src/colors/types.d.ts.map +1 -1
- package/dist/src/config.d.ts +18 -0
- package/dist/src/config.d.ts.map +1 -1
- package/dist/src/config.js +12 -14
- package/dist/src/index.d.ts +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +211 -416
- package/dist/src/scripts/createJsonSchema.js +12 -14
- package/dist/src/scripts/update-preview-tokens.js +33 -294
- package/dist/src/scripts/update-template.d.ts.map +1 -1
- package/dist/src/scripts/update-template.js +349 -71
- package/dist/src/tokens/build.js +5 -5
- package/dist/src/tokens/create/generators/$designsystemet.js +5 -5
- package/dist/src/tokens/create/generators/$metadata.d.ts.map +1 -1
- package/dist/src/tokens/create/generators/$metadata.js +1 -4
- package/dist/src/tokens/create/generators/$themes.js +0 -1
- package/dist/src/tokens/create/generators/color.d.ts +0 -1
- package/dist/src/tokens/create/generators/color.d.ts.map +1 -1
- package/dist/src/tokens/create/generators/color.js +20 -23
- package/dist/src/tokens/create/generators/semantic.d.ts +1 -265
- package/dist/src/tokens/create/generators/semantic.d.ts.map +1 -1
- package/dist/src/tokens/create/generators/semantic.js +261 -270
- package/dist/src/tokens/create/generators/theme.d.ts.map +1 -1
- package/dist/src/tokens/create/generators/theme.js +265 -5
- package/dist/src/tokens/create/write.js +6 -10
- package/dist/src/tokens/create.d.ts.map +1 -1
- package/dist/src/tokens/create.js +33 -293
- package/dist/src/tokens/format.js +38 -299
- package/dist/src/tokens/index.js +38 -299
- package/dist/src/tokens/process/output/declarations.js +5 -5
- package/dist/src/tokens/process/output/theme.js +5 -5
- package/dist/src/tokens/template/design-tokens/semantic/color.base.template.js +1 -1
- package/package.json +5 -5
- package/dist/color.base.template-M7BHS4OV.json +0 -286
|
@@ -1,273 +1,263 @@
|
|
|
1
1
|
// src/tokens/create/generators/semantic.ts
|
|
2
|
-
import * as
|
|
2
|
+
import * as R2 from "ramda";
|
|
3
3
|
|
|
4
|
-
// src/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"
|
|
21
|
-
$type: "color",
|
|
22
|
-
$value: "{global.green.4}"
|
|
23
|
-
},
|
|
24
|
-
"surface-hover": {
|
|
25
|
-
$type: "color",
|
|
26
|
-
$value: "{global.green.5}"
|
|
27
|
-
},
|
|
28
|
-
"surface-active": {
|
|
29
|
-
$type: "color",
|
|
30
|
-
$value: "{global.green.6}"
|
|
31
|
-
},
|
|
32
|
-
"border-subtle": {
|
|
33
|
-
$type: "color",
|
|
34
|
-
$value: "{global.green.7}"
|
|
35
|
-
},
|
|
36
|
-
"border-default": {
|
|
37
|
-
$type: "color",
|
|
38
|
-
$value: "{global.green.8}"
|
|
39
|
-
},
|
|
40
|
-
"border-strong": {
|
|
41
|
-
$type: "color",
|
|
42
|
-
$value: "{global.green.9}"
|
|
43
|
-
},
|
|
44
|
-
"text-subtle": {
|
|
45
|
-
$type: "color",
|
|
46
|
-
$value: "{global.green.10}"
|
|
47
|
-
},
|
|
48
|
-
"text-default": {
|
|
49
|
-
$type: "color",
|
|
50
|
-
$value: "{global.green.11}"
|
|
51
|
-
},
|
|
52
|
-
"base-default": {
|
|
53
|
-
$type: "color",
|
|
54
|
-
$value: "{global.green.12}"
|
|
55
|
-
},
|
|
56
|
-
"base-hover": {
|
|
57
|
-
$type: "color",
|
|
58
|
-
$value: "{global.green.13}"
|
|
59
|
-
},
|
|
60
|
-
"base-active": {
|
|
61
|
-
$type: "color",
|
|
62
|
-
$value: "{global.green.14}"
|
|
63
|
-
},
|
|
64
|
-
"base-contrast-subtle": {
|
|
65
|
-
$type: "color",
|
|
66
|
-
$value: "{global.green.15}"
|
|
67
|
-
},
|
|
68
|
-
"base-contrast-default": {
|
|
69
|
-
$type: "color",
|
|
70
|
-
$value: "{global.green.16}"
|
|
71
|
-
}
|
|
4
|
+
// src/colors/colorMetadata.ts
|
|
5
|
+
import * as R from "ramda";
|
|
6
|
+
var baseColors = {
|
|
7
|
+
info: "#0A71C0",
|
|
8
|
+
success: "#068718",
|
|
9
|
+
warning: "#EA9B1B",
|
|
10
|
+
danger: "#C01B1B"
|
|
11
|
+
};
|
|
12
|
+
var colorMetadata = {
|
|
13
|
+
"background-default": {
|
|
14
|
+
number: 1,
|
|
15
|
+
name: "background-default",
|
|
16
|
+
group: "background",
|
|
17
|
+
displayName: "Background Default",
|
|
18
|
+
description: {
|
|
19
|
+
long: "Background Default er den mest n\xF8ytrale bakgrunnsfargen.",
|
|
20
|
+
short: "Standard bakgrunnsfarge."
|
|
72
21
|
},
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
"
|
|
87
|
-
$type: "color",
|
|
88
|
-
$value: "{global.red.4}"
|
|
89
|
-
},
|
|
90
|
-
"surface-hover": {
|
|
91
|
-
$type: "color",
|
|
92
|
-
$value: "{global.red.5}"
|
|
93
|
-
},
|
|
94
|
-
"surface-active": {
|
|
95
|
-
$type: "color",
|
|
96
|
-
$value: "{global.red.6}"
|
|
97
|
-
},
|
|
98
|
-
"border-subtle": {
|
|
99
|
-
$type: "color",
|
|
100
|
-
$value: "{global.red.7}"
|
|
101
|
-
},
|
|
102
|
-
"border-default": {
|
|
103
|
-
$type: "color",
|
|
104
|
-
$value: "{global.red.8}"
|
|
105
|
-
},
|
|
106
|
-
"border-strong": {
|
|
107
|
-
$type: "color",
|
|
108
|
-
$value: "{global.red.9}"
|
|
109
|
-
},
|
|
110
|
-
"text-subtle": {
|
|
111
|
-
$type: "color",
|
|
112
|
-
$value: "{global.red.10}"
|
|
113
|
-
},
|
|
114
|
-
"text-default": {
|
|
115
|
-
$type: "color",
|
|
116
|
-
$value: "{global.red.11}"
|
|
117
|
-
},
|
|
118
|
-
"base-default": {
|
|
119
|
-
$type: "color",
|
|
120
|
-
$value: "{global.red.12}"
|
|
121
|
-
},
|
|
122
|
-
"base-hover": {
|
|
123
|
-
$type: "color",
|
|
124
|
-
$value: "{global.red.13}"
|
|
125
|
-
},
|
|
126
|
-
"base-active": {
|
|
127
|
-
$type: "color",
|
|
128
|
-
$value: "{global.red.14}"
|
|
129
|
-
},
|
|
130
|
-
"base-contrast-subtle": {
|
|
131
|
-
$type: "color",
|
|
132
|
-
$value: "{global.red.15}"
|
|
133
|
-
},
|
|
134
|
-
"base-contrast-default": {
|
|
135
|
-
$type: "color",
|
|
136
|
-
$value: "{global.red.16}"
|
|
137
|
-
}
|
|
22
|
+
luminance: {
|
|
23
|
+
light: 1,
|
|
24
|
+
dark: 9e-3,
|
|
25
|
+
contrast: 1e-3
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"background-tinted": {
|
|
29
|
+
number: 2,
|
|
30
|
+
name: "background-tinted",
|
|
31
|
+
group: "background",
|
|
32
|
+
displayName: "Background Tinted",
|
|
33
|
+
description: {
|
|
34
|
+
long: "Background Tinted er en bakgrunnsfarge som har et hint av farge i seg.",
|
|
35
|
+
short: "Bakgrunn med et hint av farge i seg."
|
|
138
36
|
},
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
"
|
|
153
|
-
$type: "color",
|
|
154
|
-
$value: "{global.blue.4}"
|
|
155
|
-
},
|
|
156
|
-
"surface-hover": {
|
|
157
|
-
$type: "color",
|
|
158
|
-
$value: "{global.blue.5}"
|
|
159
|
-
},
|
|
160
|
-
"surface-active": {
|
|
161
|
-
$type: "color",
|
|
162
|
-
$value: "{global.blue.6}"
|
|
163
|
-
},
|
|
164
|
-
"border-subtle": {
|
|
165
|
-
$type: "color",
|
|
166
|
-
$value: "{global.blue.7}"
|
|
167
|
-
},
|
|
168
|
-
"border-default": {
|
|
169
|
-
$type: "color",
|
|
170
|
-
$value: "{global.blue.8}"
|
|
171
|
-
},
|
|
172
|
-
"border-strong": {
|
|
173
|
-
$type: "color",
|
|
174
|
-
$value: "{global.blue.9}"
|
|
175
|
-
},
|
|
176
|
-
"text-subtle": {
|
|
177
|
-
$type: "color",
|
|
178
|
-
$value: "{global.blue.10}"
|
|
179
|
-
},
|
|
180
|
-
"text-default": {
|
|
181
|
-
$type: "color",
|
|
182
|
-
$value: "{global.blue.11}"
|
|
183
|
-
},
|
|
184
|
-
"base-default": {
|
|
185
|
-
$type: "color",
|
|
186
|
-
$value: "{global.blue.12}"
|
|
187
|
-
},
|
|
188
|
-
"base-hover": {
|
|
189
|
-
$type: "color",
|
|
190
|
-
$value: "{global.blue.13}"
|
|
191
|
-
},
|
|
192
|
-
"base-active": {
|
|
193
|
-
$type: "color",
|
|
194
|
-
$value: "{global.blue.14}"
|
|
195
|
-
},
|
|
196
|
-
"base-contrast-subtle": {
|
|
197
|
-
$type: "color",
|
|
198
|
-
$value: "{global.blue.15}"
|
|
199
|
-
},
|
|
200
|
-
"base-contrast-default": {
|
|
201
|
-
$type: "color",
|
|
202
|
-
$value: "{global.blue.16}"
|
|
203
|
-
}
|
|
37
|
+
luminance: {
|
|
38
|
+
light: 0.9,
|
|
39
|
+
dark: 0.014,
|
|
40
|
+
contrast: 65e-4
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"surface-default": {
|
|
44
|
+
number: 3,
|
|
45
|
+
name: "surface-default",
|
|
46
|
+
group: "surface",
|
|
47
|
+
displayName: "Surface Default",
|
|
48
|
+
description: {
|
|
49
|
+
long: "Surface Default brukes p\xE5 flater som ligger opp\xE5 bakgrunnsfargene. Dette er den mest n\xF8ytrale surface fargen.",
|
|
50
|
+
short: "Standardfarge for overflater / komponenter."
|
|
204
51
|
},
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
"
|
|
219
|
-
$type: "color",
|
|
220
|
-
$value: "{global.orange.4}"
|
|
221
|
-
},
|
|
222
|
-
"surface-hover": {
|
|
223
|
-
$type: "color",
|
|
224
|
-
$value: "{global.orange.5}"
|
|
225
|
-
},
|
|
226
|
-
"surface-active": {
|
|
227
|
-
$type: "color",
|
|
228
|
-
$value: "{global.orange.6}"
|
|
229
|
-
},
|
|
230
|
-
"border-subtle": {
|
|
231
|
-
$type: "color",
|
|
232
|
-
$value: "{global.orange.7}"
|
|
233
|
-
},
|
|
234
|
-
"border-default": {
|
|
235
|
-
$type: "color",
|
|
236
|
-
$value: "{global.orange.8}"
|
|
237
|
-
},
|
|
238
|
-
"border-strong": {
|
|
239
|
-
$type: "color",
|
|
240
|
-
$value: "{global.orange.9}"
|
|
241
|
-
},
|
|
242
|
-
"text-subtle": {
|
|
243
|
-
$type: "color",
|
|
244
|
-
$value: "{global.orange.10}"
|
|
245
|
-
},
|
|
246
|
-
"text-default": {
|
|
247
|
-
$type: "color",
|
|
248
|
-
$value: "{global.orange.11}"
|
|
249
|
-
},
|
|
250
|
-
"base-default": {
|
|
251
|
-
$type: "color",
|
|
252
|
-
$value: "{global.orange.12}"
|
|
253
|
-
},
|
|
254
|
-
"base-hover": {
|
|
255
|
-
$type: "color",
|
|
256
|
-
$value: "{global.orange.13}"
|
|
257
|
-
},
|
|
258
|
-
"base-active": {
|
|
259
|
-
$type: "color",
|
|
260
|
-
$value: "{global.orange.14}"
|
|
261
|
-
},
|
|
262
|
-
"base-contrast-subtle": {
|
|
263
|
-
$type: "color",
|
|
264
|
-
$value: "{global.orange.15}"
|
|
265
|
-
},
|
|
266
|
-
"base-contrast-default": {
|
|
267
|
-
$type: "color",
|
|
268
|
-
$value: "{global.orange.16}"
|
|
269
|
-
}
|
|
52
|
+
luminance: {
|
|
53
|
+
light: 1,
|
|
54
|
+
dark: 0.021,
|
|
55
|
+
contrast: 0.015
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"surface-tinted": {
|
|
59
|
+
number: 4,
|
|
60
|
+
name: "surface-tinted",
|
|
61
|
+
group: "surface",
|
|
62
|
+
displayName: "Surface Tinted",
|
|
63
|
+
description: {
|
|
64
|
+
long: "Surface Tinted brukes p\xE5 flater som ligger opp\xE5 bakgrunnsfargene. Denne har et hint av farge i seg.",
|
|
65
|
+
short: "Overflater / komponenter med et hint av farge i seg."
|
|
270
66
|
},
|
|
67
|
+
luminance: {
|
|
68
|
+
light: 0.81,
|
|
69
|
+
dark: 0.027,
|
|
70
|
+
contrast: 0.015
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
"surface-hover": {
|
|
74
|
+
number: 5,
|
|
75
|
+
name: "surface-hover",
|
|
76
|
+
group: "surface",
|
|
77
|
+
displayName: "Surface Hover",
|
|
78
|
+
description: {
|
|
79
|
+
long: "Surface Hover brukes p\xE5 interaktive flater som ligger opp\xE5 bakgrunnsfargene i en hover state.",
|
|
80
|
+
short: "Hover-farge til overflater / komponenter."
|
|
81
|
+
},
|
|
82
|
+
luminance: {
|
|
83
|
+
light: 0.7,
|
|
84
|
+
dark: 0.036,
|
|
85
|
+
contrast: 0.028
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"surface-active": {
|
|
89
|
+
number: 6,
|
|
90
|
+
name: "surface-active",
|
|
91
|
+
group: "surface",
|
|
92
|
+
displayName: "Surface Active",
|
|
93
|
+
description: {
|
|
94
|
+
long: "Surface Active brukes p\xE5 interaktive flater som ligger opp\xE5 bakgrunnsfargene i en active state.",
|
|
95
|
+
short: "Active-farge til overflater / komponenter."
|
|
96
|
+
},
|
|
97
|
+
luminance: {
|
|
98
|
+
light: 0.59,
|
|
99
|
+
dark: 0.056,
|
|
100
|
+
contrast: 0.045
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"border-subtle": {
|
|
104
|
+
number: 7,
|
|
105
|
+
name: "border-subtle",
|
|
106
|
+
group: "border",
|
|
107
|
+
displayName: "Border Subtle",
|
|
108
|
+
description: {
|
|
109
|
+
long: "Border Subtle er den lyseste border-fargen og brukes for \xE5 skille elementer fra hverandre.",
|
|
110
|
+
short: "Border-farge med lav kontrast til dekorativ bruk (skillelinjer)."
|
|
111
|
+
},
|
|
112
|
+
luminance: {
|
|
113
|
+
light: 0.5,
|
|
114
|
+
dark: 0.08,
|
|
115
|
+
contrast: 0.26
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"border-default": {
|
|
119
|
+
number: 8,
|
|
120
|
+
name: "border-default",
|
|
121
|
+
group: "border",
|
|
122
|
+
displayName: "Border Default",
|
|
123
|
+
description: {
|
|
124
|
+
long: "Border Default er en border-farge som brukes n\xE5r man \xF8nsker god kontrast mot bakgrunnsfargene.",
|
|
125
|
+
short: "Standard border-farge til skjemakomponenter og meningsb\xE6rende elementer."
|
|
126
|
+
},
|
|
127
|
+
luminance: {
|
|
128
|
+
light: 0.19,
|
|
129
|
+
dark: 0.22,
|
|
130
|
+
contrast: 0.4
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
"border-strong": {
|
|
134
|
+
number: 9,
|
|
135
|
+
name: "border-strong",
|
|
136
|
+
group: "border",
|
|
137
|
+
displayName: "Border Strong",
|
|
138
|
+
description: {
|
|
139
|
+
long: "Border Strong er den m\xF8rkeste border-fargen og brukes n\xE5r man \xF8nsker en veldig tydelig og sterk border.",
|
|
140
|
+
short: "Border-farge med h\xF8y kontrast for ekstra synlighet."
|
|
141
|
+
},
|
|
142
|
+
luminance: {
|
|
143
|
+
light: 0.11,
|
|
144
|
+
dark: 0.39,
|
|
145
|
+
contrast: 0.6
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"text-subtle": {
|
|
149
|
+
number: 10,
|
|
150
|
+
name: "text-subtle",
|
|
151
|
+
group: "text",
|
|
152
|
+
displayName: "Text Subtle",
|
|
153
|
+
description: {
|
|
154
|
+
long: "Text Subtle er den lyseste tekstfargen og brukes p\xE5 tekst som skal v\xE6re litt mindre synlig eller for \xE5 skape variasjon i typografien.",
|
|
155
|
+
short: "Tekst- og ikonfarge med lavere kontrast."
|
|
156
|
+
},
|
|
157
|
+
luminance: {
|
|
158
|
+
light: 0.11,
|
|
159
|
+
dark: 0.39,
|
|
160
|
+
contrast: 0.57
|
|
161
|
+
}
|
|
162
|
+
},
|
|
163
|
+
"text-default": {
|
|
164
|
+
number: 11,
|
|
165
|
+
name: "text-default",
|
|
166
|
+
group: "text",
|
|
167
|
+
displayName: "Text Default",
|
|
168
|
+
description: {
|
|
169
|
+
long: "Text Default er den m\xF8rkeste tekstfargen og brukes p\xE5 tekst som skal v\xE6re mest synlig. Denne fargen b\xF8r brukes p\xE5 mesteparten av teksten p\xE5 en side.",
|
|
170
|
+
short: "Tekst- og ikonfarge med h\xF8y kontrast og god synlighet."
|
|
171
|
+
},
|
|
172
|
+
luminance: {
|
|
173
|
+
light: 0.0245,
|
|
174
|
+
dark: 0.84,
|
|
175
|
+
contrast: 0.86
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"base-default": {
|
|
179
|
+
number: 12,
|
|
180
|
+
name: "base-default",
|
|
181
|
+
group: "base",
|
|
182
|
+
displayName: "Base Default",
|
|
183
|
+
description: {
|
|
184
|
+
long: "Base Default fargen f\xE5r den samme hex koden som fargen som er valgt i verkt\xF8yet. Brukes ofte som farge p\xE5 viktige elementer og p\xE5 flater som skal fange brukerens oppmerksomhet.",
|
|
185
|
+
short: "Standardfarge for solide bakgrunner."
|
|
186
|
+
},
|
|
187
|
+
luminance: {
|
|
188
|
+
light: 1,
|
|
189
|
+
dark: 1,
|
|
190
|
+
contrast: 1
|
|
191
|
+
}
|
|
192
|
+
},
|
|
193
|
+
"base-hover": {
|
|
194
|
+
number: 13,
|
|
195
|
+
name: "base-hover",
|
|
196
|
+
group: "base",
|
|
197
|
+
displayName: "Base Hover",
|
|
198
|
+
description: {
|
|
199
|
+
long: "Base Hover brukes som hover farge p\xE5 elementer som bruker Base Default fargen.",
|
|
200
|
+
short: "Hover-farge for solide bakgrunner."
|
|
201
|
+
},
|
|
202
|
+
luminance: {
|
|
203
|
+
light: 1,
|
|
204
|
+
dark: 1,
|
|
205
|
+
contrast: 1
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
"base-active": {
|
|
209
|
+
number: 14,
|
|
210
|
+
name: "base-active",
|
|
211
|
+
group: "base",
|
|
212
|
+
displayName: "Base Active",
|
|
213
|
+
description: {
|
|
214
|
+
long: "Base Active brukes som active farge p\xE5 elementer som bruker Base Default fargen.",
|
|
215
|
+
short: "Active-farge for solide bakgrunner."
|
|
216
|
+
},
|
|
217
|
+
luminance: {
|
|
218
|
+
light: 1,
|
|
219
|
+
dark: 1,
|
|
220
|
+
contrast: 1
|
|
221
|
+
}
|
|
222
|
+
},
|
|
223
|
+
"base-contrast-subtle": {
|
|
224
|
+
number: 15,
|
|
225
|
+
name: "base-contrast-subtle",
|
|
226
|
+
group: "base",
|
|
227
|
+
displayName: "Contrast Subtle",
|
|
228
|
+
description: {
|
|
229
|
+
long: "Contrast Subtle brukes som en viktig meningsb\xE6rende farge opp\xE5 Base Default fargen.",
|
|
230
|
+
short: "Farge med god kontrast mot Base-default."
|
|
231
|
+
},
|
|
232
|
+
luminance: {
|
|
233
|
+
light: 1,
|
|
234
|
+
dark: 1,
|
|
235
|
+
contrast: 1
|
|
236
|
+
}
|
|
237
|
+
},
|
|
238
|
+
"base-contrast-default": {
|
|
239
|
+
number: 16,
|
|
240
|
+
name: "base-contrast-default",
|
|
241
|
+
group: "base",
|
|
242
|
+
displayName: "Contrast Default",
|
|
243
|
+
description: {
|
|
244
|
+
long: "Contrast Default brukes som en viktig meningsb\xE6rende farge opp\xE5 alle Base fargane.",
|
|
245
|
+
short: "Farge med god kontrast mot Base-default og Base-hover."
|
|
246
|
+
},
|
|
247
|
+
luminance: {
|
|
248
|
+
light: 1,
|
|
249
|
+
dark: 1,
|
|
250
|
+
contrast: 1
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
};
|
|
254
|
+
var colorMetadataByNumber = R.indexBy((metadata) => metadata.number, Object.values(colorMetadata));
|
|
255
|
+
var colorNames = Object.keys(colorMetadata);
|
|
256
|
+
var baseColorNames = Object.keys(baseColors);
|
|
257
|
+
|
|
258
|
+
// src/tokens/template/design-tokens/semantic/color.base.template.json with { type: 'json' }
|
|
259
|
+
var color_base_template_default = {
|
|
260
|
+
color: {
|
|
271
261
|
focus: {
|
|
272
262
|
inner: {
|
|
273
263
|
$type: "color",
|
|
@@ -283,7 +273,7 @@ var color_base_template_default = {
|
|
|
283
273
|
color: {
|
|
284
274
|
visited: {
|
|
285
275
|
$type: "color",
|
|
286
|
-
$value: "{
|
|
276
|
+
$value: "{color.link.visited}"
|
|
287
277
|
}
|
|
288
278
|
}
|
|
289
279
|
}
|
|
@@ -426,7 +416,7 @@ var color_template_default2 = {
|
|
|
426
416
|
};
|
|
427
417
|
|
|
428
418
|
// src/tokens/create/generators/semantic.ts
|
|
429
|
-
var generateSemantic = (colors) => {
|
|
419
|
+
var generateSemantic = (colors, _themeName) => {
|
|
430
420
|
const mainColorNames = Object.keys(colors.main);
|
|
431
421
|
const supportColorNames = Object.keys(colors.support);
|
|
432
422
|
const modes = {
|
|
@@ -437,8 +427,8 @@ var generateSemantic = (colors) => {
|
|
|
437
427
|
["main-color", mainColorNames],
|
|
438
428
|
["support-color", supportColorNames]
|
|
439
429
|
];
|
|
440
|
-
for (const [colorCategory,
|
|
441
|
-
for (const colorName of
|
|
430
|
+
for (const [colorCategory, colorNames2] of categories) {
|
|
431
|
+
for (const colorName of colorNames2) {
|
|
442
432
|
const category = colorCategory.replace("-color", "");
|
|
443
433
|
const customColorTokens = {
|
|
444
434
|
color: {
|
|
@@ -460,10 +450,11 @@ var generateSemantic = (colors) => {
|
|
|
460
450
|
}
|
|
461
451
|
}
|
|
462
452
|
const customColors = [...mainColorNames, "neutral", ...supportColorNames];
|
|
463
|
-
const
|
|
453
|
+
const allColors = [...customColors, ...baseColorNames];
|
|
454
|
+
const semanticColorTokens = allColors.map(
|
|
464
455
|
(colorName) => [
|
|
465
456
|
colorName,
|
|
466
|
-
|
|
457
|
+
R2.map((x) => ({ ...x, $value: x.$value.replace("<color>", colorName) }), color_template_default)
|
|
467
458
|
]
|
|
468
459
|
);
|
|
469
460
|
const color = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/create/generators/theme.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../../src/tokens/create/generators/theme.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAEvD,eAAO,MAAM,aAAa,GAAI,QAAQ,MAAM,EAAE,WAAW,MAAM,EAAE,cAAc,MAAM,aA+CpF,CAAC"}
|