@digdir/designsystemet 1.11.0 → 1.12.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/dist/bin/config.js +24 -4
- package/dist/bin/designsystemet.js +912 -1223
- package/dist/src/colors/index.js +27 -1
- package/dist/src/colors/types.d.ts +24 -21
- package/dist/src/colors/types.d.ts.map +1 -1
- package/dist/src/colors/types.js +27 -0
- package/dist/src/config.js +24 -4
- package/dist/src/index.js +818 -1122
- package/dist/src/scripts/createJsonSchema.js +24 -4
- package/dist/src/scripts/update-preview-tokens.d.ts.map +1 -1
- package/dist/src/scripts/update-preview-tokens.js +1363 -1667
- package/dist/src/tokens/build.js +7 -8
- package/dist/src/tokens/create/generators/$designsystemet.js +7 -8
- package/dist/src/tokens/create/generators/$metadata.d.ts +2 -2
- package/dist/src/tokens/create/generators/$metadata.d.ts.map +1 -1
- package/dist/src/tokens/create/generators/$metadata.js +3 -7
- package/dist/src/tokens/create/generators/$themes.d.ts +17 -2
- package/dist/src/tokens/create/generators/$themes.d.ts.map +1 -1
- package/dist/src/tokens/create/generators/$themes.js +3 -3
- package/dist/src/tokens/create/generators/primitives/color-scheme.d.ts +5 -0
- package/dist/src/tokens/create/generators/primitives/color-scheme.d.ts.map +1 -0
- package/dist/src/tokens/create/generators/{color.js → primitives/color-scheme.js} +29 -6
- package/dist/src/tokens/create/generators/primitives/globals.d.ts +3 -0
- package/dist/src/tokens/create/generators/primitives/globals.d.ts.map +1 -0
- package/dist/src/tokens/create/generators/primitives/globals.js +148 -0
- package/dist/src/tokens/create/generators/primitives/size.d.ts +4 -0
- package/dist/src/tokens/create/generators/primitives/size.d.ts.map +1 -0
- package/dist/src/tokens/create/generators/primitives/size.js +157 -0
- package/dist/src/tokens/create/generators/primitives/typography.d.ts +4 -0
- package/dist/src/tokens/create/generators/primitives/typography.d.ts.map +1 -0
- package/dist/src/tokens/create/generators/primitives/typography.js +220 -0
- package/dist/src/tokens/create/generators/semantic/color-modes.d.ts +8 -0
- package/dist/src/tokens/create/generators/semantic/color-modes.d.ts.map +1 -0
- package/dist/src/tokens/create/generators/semantic/color-modes.js +61 -0
- package/dist/src/tokens/create/generators/semantic/color.d.ts +5 -0
- package/dist/src/tokens/create/generators/semantic/color.d.ts.map +1 -0
- package/dist/src/tokens/create/generators/{semantic.js → semantic/color.js} +50 -194
- package/dist/src/tokens/create/generators/semantic/style.d.ts +3 -0
- package/dist/src/tokens/create/generators/semantic/style.d.ts.map +1 -0
- package/dist/src/tokens/create/generators/semantic/style.js +384 -0
- package/dist/src/tokens/create/generators/{theme.d.ts → themes/theme.d.ts} +1 -1
- package/dist/src/tokens/create/generators/themes/theme.d.ts.map +1 -0
- package/dist/src/tokens/create/generators/{theme.js → themes/theme.js} +87 -129
- package/dist/src/tokens/create/write.d.ts.map +1 -1
- package/dist/src/tokens/create/write.js +16 -20
- package/dist/src/tokens/create.d.ts +1 -1
- package/dist/src/tokens/create.d.ts.map +1 -1
- package/dist/src/tokens/create.js +1340 -1647
- package/dist/src/tokens/format.d.ts.map +1 -1
- package/dist/src/tokens/format.js +1363 -1670
- package/dist/src/tokens/index.js +1363 -1670
- package/dist/src/tokens/process/output/declarations.js +7 -8
- package/dist/src/tokens/process/output/theme.js +7 -8
- package/dist/src/tokens/types.d.ts +7 -0
- package/dist/src/tokens/types.d.ts.map +1 -1
- package/package.json +8 -9
- package/dist/color.base.template-Z7YWN2TF.json +0 -22
- package/dist/color.template-LMPUQ72A.json +0 -66
- package/dist/color.template-XQNSHLTU.json +0 -66
- package/dist/global-Y35YADVH.json +0 -100
- package/dist/globals-76VAFMDF.json +0 -143
- package/dist/large-CIIHO7AY.json +0 -96
- package/dist/large-UUOZ6DYI.json +0 -16
- package/dist/medium-OQ7S7P4P.json +0 -16
- package/dist/medium-VSB2S4X3.json +0 -96
- package/dist/small-AEXJ6U7Z.json +0 -96
- package/dist/small-ZY4KOJWX.json +0 -16
- package/dist/src/scripts/update-template.d.ts +0 -2
- package/dist/src/scripts/update-template.d.ts.map +0 -1
- package/dist/src/scripts/update-template.js +0 -1366
- package/dist/src/tokens/create/defaults.d.ts +0 -7
- package/dist/src/tokens/create/defaults.d.ts.map +0 -1
- package/dist/src/tokens/create/defaults.js +0 -998
- package/dist/src/tokens/create/generators/color.d.ts +0 -5
- package/dist/src/tokens/create/generators/color.d.ts.map +0 -1
- package/dist/src/tokens/create/generators/semantic.d.ts +0 -32
- package/dist/src/tokens/create/generators/semantic.d.ts.map +0 -1
- package/dist/src/tokens/create/generators/theme.d.ts.map +0 -1
- package/dist/src/tokens/create/generators/typography.d.ts +0 -3
- package/dist/src/tokens/create/generators/typography.d.ts.map +0 -1
- package/dist/src/tokens/create/generators/typography.js +0 -33
- package/dist/src/tokens/template/design-tokens/primitives/globals.js +0 -5
- package/dist/src/tokens/template/design-tokens/primitives/modes/size/global.js +0 -5
- package/dist/src/tokens/template/design-tokens/primitives/modes/size/large.js +0 -5
- package/dist/src/tokens/template/design-tokens/primitives/modes/size/medium.js +0 -5
- package/dist/src/tokens/template/design-tokens/primitives/modes/size/small.js +0 -5
- package/dist/src/tokens/template/design-tokens/primitives/modes/typography/size/large.js +0 -5
- package/dist/src/tokens/template/design-tokens/primitives/modes/typography/size/medium.js +0 -5
- package/dist/src/tokens/template/design-tokens/primitives/modes/typography/size/small.js +0 -5
- package/dist/src/tokens/template/design-tokens/primitives/modes/typography/typography.template.js +0 -5
- package/dist/src/tokens/template/design-tokens/semantic/color.base.template.js +0 -5
- package/dist/src/tokens/template/design-tokens/semantic/color.template.js +0 -5
- package/dist/src/tokens/template/design-tokens/semantic/modes/color.template.js +0 -5
- package/dist/src/tokens/template/design-tokens/semantic/style.js +0 -5
- package/dist/src/tokens/template/design-tokens/themes/theme.base.template.js +0 -5
- package/dist/src/tokens/template/design-tokens/themes/theme.template.js +0 -5
- package/dist/style-FP5XVCUD.json +0 -378
- package/dist/theme.base.template-Y4RMFBQY.json +0 -55
- package/dist/theme.template-CTQRNOMO.json +0 -66
- package/dist/typography.template-4N5YLH7F.json +0 -22
|
@@ -1,1659 +1,1498 @@
|
|
|
1
|
-
// src/tokens/create/
|
|
2
|
-
import * as
|
|
1
|
+
// src/tokens/create/generators/primitives/color-scheme.ts
|
|
2
|
+
import * as R4 from "ramda";
|
|
3
3
|
|
|
4
|
-
// src/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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 dsLinkColor = "#663299";
|
|
13
|
+
var colorMetadata = {
|
|
14
|
+
"background-default": {
|
|
15
|
+
number: 1,
|
|
16
|
+
name: "background-default",
|
|
17
|
+
group: "background",
|
|
18
|
+
displayName: "Background Default",
|
|
19
|
+
description: {
|
|
20
|
+
long: "Background Default er den mest n\xF8ytrale bakgrunnsfargen.",
|
|
21
|
+
short: "Standard bakgrunnsfarge."
|
|
10
22
|
},
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
23
|
+
luminance: {
|
|
24
|
+
light: 1,
|
|
25
|
+
dark: 9e-3,
|
|
26
|
+
contrast: 1e-3
|
|
14
27
|
}
|
|
15
28
|
},
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
blur: "1",
|
|
25
|
-
spread: "0"
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
x: "0",
|
|
29
|
-
y: "1",
|
|
30
|
-
blur: "2",
|
|
31
|
-
spread: "0",
|
|
32
|
-
color: "rgba(0,0,0,0.12)"
|
|
33
|
-
}
|
|
34
|
-
]
|
|
29
|
+
"background-tinted": {
|
|
30
|
+
number: 2,
|
|
31
|
+
name: "background-tinted",
|
|
32
|
+
group: "background",
|
|
33
|
+
displayName: "Background Tinted",
|
|
34
|
+
description: {
|
|
35
|
+
long: "Background Tinted er en bakgrunnsfarge som har et hint av farge i seg.",
|
|
36
|
+
short: "Bakgrunn med et hint av farge i seg."
|
|
35
37
|
},
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
blur: "2",
|
|
51
|
-
spread: "0"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
x: "0",
|
|
55
|
-
y: "2",
|
|
56
|
-
blur: "4",
|
|
57
|
-
spread: "0",
|
|
58
|
-
color: "rgba(0,0,0,0.1)"
|
|
59
|
-
}
|
|
60
|
-
]
|
|
38
|
+
luminance: {
|
|
39
|
+
light: 0.9,
|
|
40
|
+
dark: 0.014,
|
|
41
|
+
contrast: 65e-4
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"surface-default": {
|
|
45
|
+
number: 3,
|
|
46
|
+
name: "surface-default",
|
|
47
|
+
group: "surface",
|
|
48
|
+
displayName: "Surface Default",
|
|
49
|
+
description: {
|
|
50
|
+
long: "Surface Default brukes p\xE5 flater som ligger opp\xE5 bakgrunnsfargene. Dette er den mest n\xF8ytrale surface fargen.",
|
|
51
|
+
short: "Standardfarge for overflater / komponenter."
|
|
61
52
|
},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
blur: "4",
|
|
77
|
-
spread: "0"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
x: "0",
|
|
81
|
-
y: "4",
|
|
82
|
-
blur: "8",
|
|
83
|
-
spread: "0",
|
|
84
|
-
color: "rgba(0,0,0,0.12)"
|
|
85
|
-
}
|
|
86
|
-
]
|
|
53
|
+
luminance: {
|
|
54
|
+
light: 1,
|
|
55
|
+
dark: 0.021,
|
|
56
|
+
contrast: 0.015
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
"surface-tinted": {
|
|
60
|
+
number: 4,
|
|
61
|
+
name: "surface-tinted",
|
|
62
|
+
group: "surface",
|
|
63
|
+
displayName: "Surface Tinted",
|
|
64
|
+
description: {
|
|
65
|
+
long: "Surface Tinted brukes p\xE5 flater som ligger opp\xE5 bakgrunnsfargene. Denne har et hint av farge i seg.",
|
|
66
|
+
short: "Overflater / komponenter med et hint av farge i seg."
|
|
87
67
|
},
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
blur: "5",
|
|
103
|
-
spread: "0"
|
|
104
|
-
},
|
|
105
|
-
{
|
|
106
|
-
x: "0",
|
|
107
|
-
y: "6",
|
|
108
|
-
blur: "12",
|
|
109
|
-
spread: "0",
|
|
110
|
-
color: "rgba(0,0,0,0.14)"
|
|
111
|
-
}
|
|
112
|
-
]
|
|
68
|
+
luminance: {
|
|
69
|
+
light: 0.81,
|
|
70
|
+
dark: 0.027,
|
|
71
|
+
contrast: 0.015
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
"surface-hover": {
|
|
75
|
+
number: 5,
|
|
76
|
+
name: "surface-hover",
|
|
77
|
+
group: "surface",
|
|
78
|
+
displayName: "Surface Hover",
|
|
79
|
+
description: {
|
|
80
|
+
long: "Surface Hover brukes p\xE5 interaktive flater som ligger opp\xE5 bakgrunnsfargene i en hover state.",
|
|
81
|
+
short: "Hover-farge til overflater / komponenter."
|
|
113
82
|
},
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
color: "rgba(0,0,0,0.12)",
|
|
119
|
-
x: "0",
|
|
120
|
-
y: "0",
|
|
121
|
-
blur: "1",
|
|
122
|
-
spread: "0"
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
color: "rgba(0,0,0,0.16)",
|
|
126
|
-
x: "0",
|
|
127
|
-
y: "4",
|
|
128
|
-
blur: "8",
|
|
129
|
-
spread: "0"
|
|
130
|
-
},
|
|
131
|
-
{
|
|
132
|
-
x: "0",
|
|
133
|
-
y: "12",
|
|
134
|
-
blur: "24",
|
|
135
|
-
spread: "0",
|
|
136
|
-
color: "rgba(0,0,0,0.16)"
|
|
137
|
-
}
|
|
138
|
-
]
|
|
83
|
+
luminance: {
|
|
84
|
+
light: 0.7,
|
|
85
|
+
dark: 0.036,
|
|
86
|
+
contrast: 0.028
|
|
139
87
|
}
|
|
140
88
|
},
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
89
|
+
"surface-active": {
|
|
90
|
+
number: 6,
|
|
91
|
+
name: "surface-active",
|
|
92
|
+
group: "surface",
|
|
93
|
+
displayName: "Surface Active",
|
|
94
|
+
description: {
|
|
95
|
+
long: "Surface Active brukes p\xE5 interaktive flater som ligger opp\xE5 bakgrunnsfargene i en active state.",
|
|
96
|
+
short: "Active-farge til overflater / komponenter."
|
|
97
|
+
},
|
|
98
|
+
luminance: {
|
|
99
|
+
light: 0.59,
|
|
100
|
+
dark: 0.056,
|
|
101
|
+
contrast: 0.045
|
|
145
102
|
}
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
103
|
+
},
|
|
104
|
+
"border-subtle": {
|
|
105
|
+
number: 7,
|
|
106
|
+
name: "border-subtle",
|
|
107
|
+
group: "border",
|
|
108
|
+
displayName: "Border Subtle",
|
|
109
|
+
description: {
|
|
110
|
+
long: "Border Subtle er den lyseste border-fargen og brukes for \xE5 skille elementer fra hverandre.",
|
|
111
|
+
short: "Border-farge med lav kontrast til dekorativ bruk (skillelinjer)."
|
|
155
112
|
},
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
113
|
+
luminance: {
|
|
114
|
+
light: 0.5,
|
|
115
|
+
dark: 0.08,
|
|
116
|
+
contrast: 0.26
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
"border-default": {
|
|
120
|
+
number: 8,
|
|
121
|
+
name: "border-default",
|
|
122
|
+
group: "border",
|
|
123
|
+
displayName: "Border Default",
|
|
124
|
+
description: {
|
|
125
|
+
long: "Border Default er en border-farge som brukes n\xE5r man \xF8nsker god kontrast mot bakgrunnsfargene.",
|
|
126
|
+
short: "Standard border-farge til skjemakomponenter og meningsb\xE6rende elementer."
|
|
159
127
|
},
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
"3": {
|
|
165
|
-
$type: "dimension",
|
|
166
|
-
$value: "floor({_size.unit} * 3)"
|
|
167
|
-
},
|
|
168
|
-
"4": {
|
|
169
|
-
$type: "dimension",
|
|
170
|
-
$value: "floor({_size.unit} * 4)"
|
|
171
|
-
},
|
|
172
|
-
"5": {
|
|
173
|
-
$type: "dimension",
|
|
174
|
-
$value: "floor({_size.unit} * 5)"
|
|
175
|
-
},
|
|
176
|
-
"6": {
|
|
177
|
-
$type: "dimension",
|
|
178
|
-
$value: "floor({_size.unit} * 6)"
|
|
179
|
-
},
|
|
180
|
-
"7": {
|
|
181
|
-
$type: "dimension",
|
|
182
|
-
$value: "floor({_size.unit} * 7)"
|
|
183
|
-
},
|
|
184
|
-
"8": {
|
|
185
|
-
$type: "dimension",
|
|
186
|
-
$value: "floor({_size.unit} * 8)"
|
|
187
|
-
},
|
|
188
|
-
"9": {
|
|
189
|
-
$type: "dimension",
|
|
190
|
-
$value: "floor({_size.unit} * 9)"
|
|
191
|
-
},
|
|
192
|
-
"10": {
|
|
193
|
-
$type: "dimension",
|
|
194
|
-
$value: "floor({_size.unit} * 10)"
|
|
195
|
-
},
|
|
196
|
-
"11": {
|
|
197
|
-
$type: "dimension",
|
|
198
|
-
$value: "floor({_size.unit} * 11)"
|
|
199
|
-
},
|
|
200
|
-
"12": {
|
|
201
|
-
$type: "dimension",
|
|
202
|
-
$value: "floor({_size.unit} * 12)"
|
|
203
|
-
},
|
|
204
|
-
"13": {
|
|
205
|
-
$type: "dimension",
|
|
206
|
-
$value: "floor({_size.unit} * 13)"
|
|
207
|
-
},
|
|
208
|
-
"14": {
|
|
209
|
-
$type: "dimension",
|
|
210
|
-
$value: "floor({_size.unit} * 14)"
|
|
211
|
-
},
|
|
212
|
-
"15": {
|
|
213
|
-
$type: "dimension",
|
|
214
|
-
$value: "floor({_size.unit} * 15)"
|
|
215
|
-
},
|
|
216
|
-
"18": {
|
|
217
|
-
$type: "dimension",
|
|
218
|
-
$value: "floor({_size.unit} * 18)"
|
|
219
|
-
},
|
|
220
|
-
"22": {
|
|
221
|
-
$type: "dimension",
|
|
222
|
-
$value: "floor({_size.unit} * 22)"
|
|
223
|
-
},
|
|
224
|
-
"26": {
|
|
225
|
-
$type: "dimension",
|
|
226
|
-
$value: "floor({_size.unit} * 26)"
|
|
227
|
-
},
|
|
228
|
-
"30": {
|
|
229
|
-
$type: "dimension",
|
|
230
|
-
$value: "floor({_size.unit} * 30)"
|
|
231
|
-
},
|
|
232
|
-
"mode-font-size": {
|
|
233
|
-
$type: "number",
|
|
234
|
-
$value: "{size._mode-font-size}"
|
|
235
|
-
},
|
|
236
|
-
base: {
|
|
237
|
-
$type: "number",
|
|
238
|
-
$value: "{size._base}"
|
|
239
|
-
},
|
|
240
|
-
step: {
|
|
241
|
-
$type: "number",
|
|
242
|
-
$value: "{size._step}"
|
|
243
|
-
},
|
|
244
|
-
unit: {
|
|
245
|
-
$type: "number",
|
|
246
|
-
$value: "{_size.step} / {_size.base} * {_size.mode-font-size}"
|
|
128
|
+
luminance: {
|
|
129
|
+
light: 0.19,
|
|
130
|
+
dark: 0.22,
|
|
131
|
+
contrast: 0.4
|
|
247
132
|
}
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
},
|
|
258
|
-
_base: {
|
|
259
|
-
$type: "dimension",
|
|
260
|
-
$value: "18"
|
|
133
|
+
},
|
|
134
|
+
"border-strong": {
|
|
135
|
+
number: 9,
|
|
136
|
+
name: "border-strong",
|
|
137
|
+
group: "border",
|
|
138
|
+
displayName: "Border Strong",
|
|
139
|
+
description: {
|
|
140
|
+
long: "Border Strong er den m\xF8rkeste border-fargen og brukes n\xE5r man \xF8nsker en veldig tydelig og sterk border.",
|
|
141
|
+
short: "Border-farge med h\xF8y kontrast for ekstra synlighet."
|
|
261
142
|
},
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
143
|
+
luminance: {
|
|
144
|
+
light: 0.11,
|
|
145
|
+
dark: 0.39,
|
|
146
|
+
contrast: 0.6
|
|
265
147
|
}
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
},
|
|
276
|
-
_base: {
|
|
277
|
-
$type: "dimension",
|
|
278
|
-
$value: "18"
|
|
148
|
+
},
|
|
149
|
+
"text-subtle": {
|
|
150
|
+
number: 10,
|
|
151
|
+
name: "text-subtle",
|
|
152
|
+
group: "text",
|
|
153
|
+
displayName: "Text Subtle",
|
|
154
|
+
description: {
|
|
155
|
+
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.",
|
|
156
|
+
short: "Tekst- og ikonfarge med lavere kontrast."
|
|
279
157
|
},
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
158
|
+
luminance: {
|
|
159
|
+
light: 0.11,
|
|
160
|
+
dark: 0.39,
|
|
161
|
+
contrast: 0.57
|
|
283
162
|
}
|
|
284
|
-
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
},
|
|
294
|
-
_base: {
|
|
295
|
-
$type: "dimension",
|
|
296
|
-
$value: "18"
|
|
163
|
+
},
|
|
164
|
+
"text-default": {
|
|
165
|
+
number: 11,
|
|
166
|
+
name: "text-default",
|
|
167
|
+
group: "text",
|
|
168
|
+
displayName: "Text Default",
|
|
169
|
+
description: {
|
|
170
|
+
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.",
|
|
171
|
+
short: "Tekst- og ikonfarge med h\xF8y kontrast og god synlighet."
|
|
297
172
|
},
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
|
|
305
|
-
// src/tokens/template/design-tokens/primitives/modes/typography/size/large.json with { type: 'json' }
|
|
306
|
-
var large_default2 = {
|
|
307
|
-
"line-height": {
|
|
308
|
-
sm: {
|
|
309
|
-
$type: "lineHeights",
|
|
310
|
-
$value: "130%"
|
|
311
|
-
},
|
|
312
|
-
md: {
|
|
313
|
-
$type: "lineHeights",
|
|
314
|
-
$value: "150%"
|
|
315
|
-
},
|
|
316
|
-
lg: {
|
|
317
|
-
$type: "lineHeights",
|
|
318
|
-
$value: "170%"
|
|
173
|
+
luminance: {
|
|
174
|
+
light: 0.0245,
|
|
175
|
+
dark: 0.84,
|
|
176
|
+
contrast: 0.86
|
|
319
177
|
}
|
|
320
178
|
},
|
|
321
|
-
"
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
},
|
|
330
|
-
"3": {
|
|
331
|
-
$type: "fontSizes",
|
|
332
|
-
$value: "18"
|
|
333
|
-
},
|
|
334
|
-
"4": {
|
|
335
|
-
$type: "fontSizes",
|
|
336
|
-
$value: "21"
|
|
337
|
-
},
|
|
338
|
-
"5": {
|
|
339
|
-
$type: "fontSizes",
|
|
340
|
-
$value: "24"
|
|
341
|
-
},
|
|
342
|
-
"6": {
|
|
343
|
-
$type: "fontSizes",
|
|
344
|
-
$value: "30"
|
|
345
|
-
},
|
|
346
|
-
"7": {
|
|
347
|
-
$type: "fontSizes",
|
|
348
|
-
$value: "36"
|
|
349
|
-
},
|
|
350
|
-
"8": {
|
|
351
|
-
$type: "fontSizes",
|
|
352
|
-
$value: "48"
|
|
353
|
-
},
|
|
354
|
-
"9": {
|
|
355
|
-
$type: "fontSizes",
|
|
356
|
-
$value: "60"
|
|
179
|
+
"base-default": {
|
|
180
|
+
number: 12,
|
|
181
|
+
name: "base-default",
|
|
182
|
+
group: "base",
|
|
183
|
+
displayName: "Base Default",
|
|
184
|
+
description: {
|
|
185
|
+
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.",
|
|
186
|
+
short: "Standardfarge for solide bakgrunner."
|
|
357
187
|
},
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
188
|
+
luminance: {
|
|
189
|
+
light: 1,
|
|
190
|
+
dark: 1,
|
|
191
|
+
contrast: 1
|
|
361
192
|
}
|
|
362
193
|
},
|
|
363
|
-
"
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
},
|
|
372
|
-
"3": {
|
|
373
|
-
$type: "letterSpacing",
|
|
374
|
-
$value: "-0.25%"
|
|
375
|
-
},
|
|
376
|
-
"4": {
|
|
377
|
-
$type: "letterSpacing",
|
|
378
|
-
$value: "-0.15%"
|
|
379
|
-
},
|
|
380
|
-
"5": {
|
|
381
|
-
$type: "letterSpacing",
|
|
382
|
-
$value: "0%"
|
|
194
|
+
"base-hover": {
|
|
195
|
+
number: 13,
|
|
196
|
+
name: "base-hover",
|
|
197
|
+
group: "base",
|
|
198
|
+
displayName: "Base Hover",
|
|
199
|
+
description: {
|
|
200
|
+
long: "Base Hover brukes som hover farge p\xE5 elementer som bruker Base Default fargen.",
|
|
201
|
+
short: "Hover-farge for solide bakgrunner."
|
|
383
202
|
},
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
203
|
+
luminance: {
|
|
204
|
+
light: 1,
|
|
205
|
+
dark: 1,
|
|
206
|
+
contrast: 1
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
"base-active": {
|
|
210
|
+
number: 14,
|
|
211
|
+
name: "base-active",
|
|
212
|
+
group: "base",
|
|
213
|
+
displayName: "Base Active",
|
|
214
|
+
description: {
|
|
215
|
+
long: "Base Active brukes som active farge p\xE5 elementer som bruker Base Default fargen.",
|
|
216
|
+
short: "Active-farge for solide bakgrunner."
|
|
387
217
|
},
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
218
|
+
luminance: {
|
|
219
|
+
light: 1,
|
|
220
|
+
dark: 1,
|
|
221
|
+
contrast: 1
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"base-contrast-subtle": {
|
|
225
|
+
number: 15,
|
|
226
|
+
name: "base-contrast-subtle",
|
|
227
|
+
group: "base",
|
|
228
|
+
displayName: "Contrast Subtle",
|
|
229
|
+
description: {
|
|
230
|
+
long: "Contrast Subtle brukes som en viktig meningsb\xE6rende farge opp\xE5 Base Default fargen.",
|
|
231
|
+
short: "Farge med god kontrast mot Base-default."
|
|
391
232
|
},
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
233
|
+
luminance: {
|
|
234
|
+
light: 1,
|
|
235
|
+
dark: 1,
|
|
236
|
+
contrast: 1
|
|
237
|
+
}
|
|
238
|
+
},
|
|
239
|
+
"base-contrast-default": {
|
|
240
|
+
number: 16,
|
|
241
|
+
name: "base-contrast-default",
|
|
242
|
+
group: "base",
|
|
243
|
+
displayName: "Contrast Default",
|
|
244
|
+
description: {
|
|
245
|
+
long: "Contrast Default brukes som en viktig meningsb\xE6rende farge opp\xE5 alle Base fargane.",
|
|
246
|
+
short: "Farge med god kontrast mot Base-default og Base-hover."
|
|
395
247
|
},
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
248
|
+
luminance: {
|
|
249
|
+
light: 1,
|
|
250
|
+
dark: 1,
|
|
251
|
+
contrast: 1
|
|
399
252
|
}
|
|
400
253
|
}
|
|
401
254
|
};
|
|
255
|
+
var colorMetadataByNumber = R.indexBy((metadata) => metadata.number, Object.values(colorMetadata));
|
|
256
|
+
var colorNames = Object.keys(colorMetadata);
|
|
257
|
+
var baseColorNames = Object.keys(baseColors);
|
|
402
258
|
|
|
403
|
-
// src/
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
$value: "12"
|
|
423
|
-
},
|
|
424
|
-
"2": {
|
|
425
|
-
$type: "fontSizes",
|
|
426
|
-
$value: "14"
|
|
427
|
-
},
|
|
428
|
-
"3": {
|
|
429
|
-
$type: "fontSizes",
|
|
430
|
-
$value: "16"
|
|
431
|
-
},
|
|
432
|
-
"4": {
|
|
433
|
-
$type: "fontSizes",
|
|
434
|
-
$value: "18"
|
|
435
|
-
},
|
|
436
|
-
"5": {
|
|
437
|
-
$type: "fontSizes",
|
|
438
|
-
$value: "21"
|
|
439
|
-
},
|
|
440
|
-
"6": {
|
|
441
|
-
$type: "fontSizes",
|
|
442
|
-
$value: "24"
|
|
443
|
-
},
|
|
444
|
-
"7": {
|
|
445
|
-
$type: "fontSizes",
|
|
446
|
-
$value: "30"
|
|
447
|
-
},
|
|
448
|
-
"8": {
|
|
449
|
-
$type: "fontSizes",
|
|
450
|
-
$value: "36"
|
|
451
|
-
},
|
|
452
|
-
"9": {
|
|
453
|
-
$type: "fontSizes",
|
|
454
|
-
$value: "48"
|
|
455
|
-
},
|
|
456
|
-
"10": {
|
|
457
|
-
$type: "fontSizes",
|
|
458
|
-
$value: "60"
|
|
459
|
-
}
|
|
460
|
-
},
|
|
461
|
-
"letter-spacing": {
|
|
462
|
-
"1": {
|
|
463
|
-
$type: "letterSpacing",
|
|
464
|
-
$value: "-1%"
|
|
465
|
-
},
|
|
466
|
-
"2": {
|
|
467
|
-
$type: "letterSpacing",
|
|
468
|
-
$value: "-0.5%"
|
|
469
|
-
},
|
|
470
|
-
"3": {
|
|
471
|
-
$type: "letterSpacing",
|
|
472
|
-
$value: "-0.25%"
|
|
473
|
-
},
|
|
474
|
-
"4": {
|
|
475
|
-
$type: "letterSpacing",
|
|
476
|
-
$value: "-0.15%"
|
|
477
|
-
},
|
|
478
|
-
"5": {
|
|
479
|
-
$type: "letterSpacing",
|
|
480
|
-
$value: "0%"
|
|
481
|
-
},
|
|
482
|
-
"6": {
|
|
483
|
-
$type: "letterSpacing",
|
|
484
|
-
$value: "0.15%"
|
|
485
|
-
},
|
|
486
|
-
"7": {
|
|
487
|
-
$type: "letterSpacing",
|
|
488
|
-
$value: "0.25%"
|
|
489
|
-
},
|
|
490
|
-
"8": {
|
|
491
|
-
$type: "letterSpacing",
|
|
492
|
-
$value: "0.5%"
|
|
493
|
-
},
|
|
494
|
-
"9": {
|
|
495
|
-
$type: "letterSpacing",
|
|
496
|
-
$value: "1.5%"
|
|
497
|
-
}
|
|
498
|
-
}
|
|
259
|
+
// src/colors/theme.ts
|
|
260
|
+
import chroma2 from "chroma-js";
|
|
261
|
+
import * as R2 from "ramda";
|
|
262
|
+
|
|
263
|
+
// src/colors/utils.ts
|
|
264
|
+
import chroma from "chroma-js";
|
|
265
|
+
import Colorjs from "colorjs.io";
|
|
266
|
+
import { Hsluv } from "hsluv";
|
|
267
|
+
var getLuminanceFromLightness = (lightness) => {
|
|
268
|
+
const conv = new Hsluv();
|
|
269
|
+
conv.hsluv_l = lightness;
|
|
270
|
+
conv.hsluvToHex();
|
|
271
|
+
return chroma(conv.hex).luminance();
|
|
272
|
+
};
|
|
273
|
+
var getLightnessFromHex = (hex) => {
|
|
274
|
+
const conv = new Hsluv();
|
|
275
|
+
conv.hex = hex;
|
|
276
|
+
conv.hexToHsluv();
|
|
277
|
+
return conv.hsluv_l;
|
|
499
278
|
};
|
|
500
279
|
|
|
501
|
-
// src/
|
|
502
|
-
var
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
md: {
|
|
509
|
-
$type: "lineHeights",
|
|
510
|
-
$value: "150%"
|
|
511
|
-
},
|
|
512
|
-
lg: {
|
|
513
|
-
$type: "lineHeights",
|
|
514
|
-
$value: "170%"
|
|
515
|
-
}
|
|
516
|
-
},
|
|
517
|
-
"font-size": {
|
|
518
|
-
"1": {
|
|
519
|
-
$type: "fontSizes",
|
|
520
|
-
$value: "11"
|
|
521
|
-
},
|
|
522
|
-
"2": {
|
|
523
|
-
$type: "fontSizes",
|
|
524
|
-
$value: "13"
|
|
525
|
-
},
|
|
526
|
-
"3": {
|
|
527
|
-
$type: "fontSizes",
|
|
528
|
-
$value: "14"
|
|
529
|
-
},
|
|
530
|
-
"4": {
|
|
531
|
-
$type: "fontSizes",
|
|
532
|
-
$value: "16"
|
|
533
|
-
},
|
|
534
|
-
"5": {
|
|
535
|
-
$type: "fontSizes",
|
|
536
|
-
$value: "18"
|
|
537
|
-
},
|
|
538
|
-
"6": {
|
|
539
|
-
$type: "fontSizes",
|
|
540
|
-
$value: "21"
|
|
541
|
-
},
|
|
542
|
-
"7": {
|
|
543
|
-
$type: "fontSizes",
|
|
544
|
-
$value: "24"
|
|
545
|
-
},
|
|
546
|
-
"8": {
|
|
547
|
-
$type: "fontSizes",
|
|
548
|
-
$value: "30"
|
|
549
|
-
},
|
|
550
|
-
"9": {
|
|
551
|
-
$type: "fontSizes",
|
|
552
|
-
$value: "36"
|
|
553
|
-
},
|
|
554
|
-
"10": {
|
|
555
|
-
$type: "fontSizes",
|
|
556
|
-
$value: "48"
|
|
557
|
-
}
|
|
558
|
-
},
|
|
559
|
-
"letter-spacing": {
|
|
560
|
-
"1": {
|
|
561
|
-
$type: "letterSpacing",
|
|
562
|
-
$value: "-1%"
|
|
563
|
-
},
|
|
564
|
-
"2": {
|
|
565
|
-
$type: "letterSpacing",
|
|
566
|
-
$value: "-0.5%"
|
|
567
|
-
},
|
|
568
|
-
"3": {
|
|
569
|
-
$type: "letterSpacing",
|
|
570
|
-
$value: "-0.25%"
|
|
571
|
-
},
|
|
572
|
-
"4": {
|
|
573
|
-
$type: "letterSpacing",
|
|
574
|
-
$value: "-0.15%"
|
|
575
|
-
},
|
|
576
|
-
"5": {
|
|
577
|
-
$type: "letterSpacing",
|
|
578
|
-
$value: "0%"
|
|
579
|
-
},
|
|
580
|
-
"6": {
|
|
581
|
-
$type: "letterSpacing",
|
|
582
|
-
$value: "0.15%"
|
|
583
|
-
},
|
|
584
|
-
"7": {
|
|
585
|
-
$type: "letterSpacing",
|
|
586
|
-
$value: "0.25%"
|
|
587
|
-
},
|
|
588
|
-
"8": {
|
|
589
|
-
$type: "letterSpacing",
|
|
590
|
-
$value: "0.5%"
|
|
591
|
-
},
|
|
592
|
-
"9": {
|
|
593
|
-
$type: "letterSpacing",
|
|
594
|
-
$value: "1.5%"
|
|
595
|
-
}
|
|
280
|
+
// src/colors/theme.ts
|
|
281
|
+
var generateColorScale = (color, colorScheme) => {
|
|
282
|
+
let interpolationColor = color;
|
|
283
|
+
if (colorScheme === "dark") {
|
|
284
|
+
const [L, C, H] = chroma2(color).oklch();
|
|
285
|
+
const chromaModifier = 0.7;
|
|
286
|
+
interpolationColor = chroma2(L, C * chromaModifier, H, "oklch").hex();
|
|
596
287
|
}
|
|
288
|
+
const colors = R2.mapObjIndexed((colorData) => {
|
|
289
|
+
const luminance = colorData.luminance[colorScheme];
|
|
290
|
+
return {
|
|
291
|
+
...colorData,
|
|
292
|
+
hex: chroma2(interpolationColor).luminance(luminance).hex()
|
|
293
|
+
};
|
|
294
|
+
}, colorMetadata);
|
|
295
|
+
const baseColors2 = generateBaseColors(color, colorScheme);
|
|
296
|
+
colors["base-default"] = { ...colors["base-default"], hex: baseColors2.default };
|
|
297
|
+
colors["base-hover"] = { ...colors["base-hover"], hex: baseColors2.hover };
|
|
298
|
+
colors["base-active"] = { ...colors["base-active"], hex: baseColors2.active };
|
|
299
|
+
colors["base-contrast-subtle"] = {
|
|
300
|
+
...colors["base-contrast-subtle"],
|
|
301
|
+
hex: generateColorContrast(baseColors2.default, "subtle")
|
|
302
|
+
};
|
|
303
|
+
colors["base-contrast-default"] = {
|
|
304
|
+
...colors["base-contrast-default"],
|
|
305
|
+
hex: generateColorContrast(baseColors2.default, "default")
|
|
306
|
+
};
|
|
307
|
+
return Object.values(colors);
|
|
308
|
+
};
|
|
309
|
+
var generateBaseColors = (color, colorScheme) => {
|
|
310
|
+
let colorLightness = getLightnessFromHex(color);
|
|
311
|
+
if (colorScheme !== "light") {
|
|
312
|
+
colorLightness = colorLightness <= 30 ? 70 : 100 - colorLightness;
|
|
313
|
+
}
|
|
314
|
+
const modifier = colorLightness <= 30 || colorLightness >= 49 && colorLightness <= 65 ? -8 : 8;
|
|
315
|
+
const calculateLightness = (base, mod) => base - mod;
|
|
316
|
+
return {
|
|
317
|
+
default: colorScheme === "light" ? color : chroma2(color).luminance(getLuminanceFromLightness(colorLightness)).hex(),
|
|
318
|
+
hover: chroma2(color).luminance(getLuminanceFromLightness(calculateLightness(colorLightness, modifier))).hex(),
|
|
319
|
+
active: chroma2(color).luminance(getLuminanceFromLightness(calculateLightness(colorLightness, modifier * 2))).hex()
|
|
320
|
+
};
|
|
321
|
+
};
|
|
322
|
+
var generateColorContrast = (color, type) => {
|
|
323
|
+
if (type === "default") {
|
|
324
|
+
return chroma2.contrast(color, "#ffffff") >= chroma2.contrast(color, "#000000") ? "#ffffff" : "#000000";
|
|
325
|
+
}
|
|
326
|
+
if (type === "subtle") {
|
|
327
|
+
const contrastWhite = chroma2.contrast(color, "#ffffff");
|
|
328
|
+
const contrastBlack = chroma2.contrast(color, "#000000");
|
|
329
|
+
const lightness = getLightnessFromHex(color);
|
|
330
|
+
const modifier = lightness <= 40 || lightness >= 60 ? 60 : 50;
|
|
331
|
+
const targetLightness = contrastWhite >= contrastBlack ? lightness + modifier : lightness - modifier;
|
|
332
|
+
return chroma2(color).luminance(getLuminanceFromLightness(targetLightness)).hex();
|
|
333
|
+
}
|
|
334
|
+
return color;
|
|
597
335
|
};
|
|
598
336
|
|
|
599
|
-
// src/
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
337
|
+
// src/colors/types.ts
|
|
338
|
+
import * as R3 from "ramda";
|
|
339
|
+
var semanticColorMap = {
|
|
340
|
+
"background-default": 1,
|
|
341
|
+
"background-tinted": 2,
|
|
342
|
+
"surface-default": 3,
|
|
343
|
+
"surface-tinted": 4,
|
|
344
|
+
"surface-hover": 5,
|
|
345
|
+
"surface-active": 6,
|
|
346
|
+
"border-subtle": 7,
|
|
347
|
+
"border-default": 8,
|
|
348
|
+
"border-strong": 9,
|
|
349
|
+
"text-subtle": 10,
|
|
350
|
+
"text-default": 11,
|
|
351
|
+
"base-default": 12,
|
|
352
|
+
"base-hover": 13,
|
|
353
|
+
"base-active": 14,
|
|
354
|
+
"base-contrast-subtle": 15,
|
|
355
|
+
"base-contrast-default": 16
|
|
356
|
+
};
|
|
357
|
+
var semanticColorNames = R3.keys(semanticColorMap);
|
|
358
|
+
var semanticColorNumbers = R3.values(semanticColorMap);
|
|
359
|
+
|
|
360
|
+
// src/tokens/create/generators/primitives/color-scheme.ts
|
|
361
|
+
var generateColor = (colorArray, overrides) => {
|
|
362
|
+
const obj = {};
|
|
363
|
+
const $type = "color";
|
|
364
|
+
for (const index in colorArray) {
|
|
365
|
+
const position = Number(index) + 1;
|
|
366
|
+
const overrideValue = overrides?.[position];
|
|
367
|
+
obj[position] = {
|
|
368
|
+
$type,
|
|
369
|
+
$value: overrideValue || colorArray[index].hex
|
|
370
|
+
};
|
|
371
|
+
}
|
|
372
|
+
return obj;
|
|
373
|
+
};
|
|
374
|
+
var generateColorScheme = (themeName, colorScheme, colors, overrides) => {
|
|
375
|
+
const createColorOverrides = (colorName) => {
|
|
376
|
+
if (!overrides?.colors || !(colorName in overrides.colors)) {
|
|
377
|
+
return void 0;
|
|
378
|
+
}
|
|
379
|
+
const colorOverrides = overrides.colors[colorName];
|
|
380
|
+
const positionOverrides = {};
|
|
381
|
+
Object.entries(colorOverrides).forEach(([semanticTokenName, modeOverrides]) => {
|
|
382
|
+
const position = colorMetadata[semanticTokenName].number;
|
|
383
|
+
if (position) {
|
|
384
|
+
let overrideValue;
|
|
385
|
+
if (colorScheme === "light" && modeOverrides.light) {
|
|
386
|
+
overrideValue = modeOverrides.light;
|
|
387
|
+
} else if (colorScheme === "dark" && modeOverrides.dark) {
|
|
388
|
+
overrideValue = modeOverrides.dark;
|
|
651
389
|
}
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
$type: "typography",
|
|
655
|
-
$value: {
|
|
656
|
-
fontFamily: "{font-family}",
|
|
657
|
-
fontWeight: "{font-weight.medium}",
|
|
658
|
-
lineHeight: "{line-height.sm}",
|
|
659
|
-
fontSize: "{font-size.5}",
|
|
660
|
-
letterSpacing: "{letter-spacing.6}"
|
|
390
|
+
if (overrideValue) {
|
|
391
|
+
positionOverrides[position] = overrideValue;
|
|
661
392
|
}
|
|
393
|
+
}
|
|
394
|
+
});
|
|
395
|
+
return Object.keys(positionOverrides).length > 0 ? positionOverrides : void 0;
|
|
396
|
+
};
|
|
397
|
+
const main = R4.mapObjIndexed(
|
|
398
|
+
(color, colorName) => generateColor(generateColorScale(color, colorScheme), createColorOverrides(colorName)),
|
|
399
|
+
colors.main
|
|
400
|
+
);
|
|
401
|
+
const support = R4.mapObjIndexed(
|
|
402
|
+
(color, colorName) => generateColor(generateColorScale(color, colorScheme), createColorOverrides(colorName)),
|
|
403
|
+
colors.support
|
|
404
|
+
);
|
|
405
|
+
const neutralColorScale = generateColorScale(colors.neutral, colorScheme);
|
|
406
|
+
const neutral = generateColor(neutralColorScale, createColorOverrides("neutral"));
|
|
407
|
+
const baseColorsWithOverrides = {
|
|
408
|
+
...baseColors,
|
|
409
|
+
...overrides?.severity
|
|
410
|
+
};
|
|
411
|
+
const globalColors = R4.mapObjIndexed(
|
|
412
|
+
(color, colorName) => generateColor(generateColorScale(color, colorScheme), createColorOverrides(colorName)),
|
|
413
|
+
baseColorsWithOverrides
|
|
414
|
+
);
|
|
415
|
+
const linkColor = generateColor(generateColorScale(dsLinkColor, colorScheme));
|
|
416
|
+
const defaultLinkVisited = linkColor[12];
|
|
417
|
+
const linkOverride = overrides?.linkVisited?.[colorScheme] ? { $type: "color", $value: overrides.linkVisited[colorScheme] } : void 0;
|
|
418
|
+
const defaultFocusInner = neutralColorScale[0].hex;
|
|
419
|
+
const defaultFocusOuter = neutralColorScale[10].hex;
|
|
420
|
+
const focusInnerOverride = overrides?.focus?.inner?.[colorScheme];
|
|
421
|
+
const focusOuterOverride = overrides?.focus?.outer?.[colorScheme];
|
|
422
|
+
return {
|
|
423
|
+
[themeName]: {
|
|
424
|
+
...main,
|
|
425
|
+
...support,
|
|
426
|
+
neutral,
|
|
427
|
+
...globalColors,
|
|
428
|
+
link: {
|
|
429
|
+
visited: linkOverride || defaultLinkVisited
|
|
662
430
|
},
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
431
|
+
focus: {
|
|
432
|
+
inner: {
|
|
433
|
+
$type: "color",
|
|
434
|
+
$value: focusInnerOverride || defaultFocusInner
|
|
435
|
+
},
|
|
436
|
+
outer: {
|
|
437
|
+
$type: "color",
|
|
438
|
+
$value: focusOuterOverride || defaultFocusOuter
|
|
671
439
|
}
|
|
672
440
|
}
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
// src/tokens/create/generators/primitives/globals.ts
|
|
446
|
+
var globals = {
|
|
447
|
+
"border-width": {
|
|
448
|
+
"1": {
|
|
449
|
+
$type: "borderWidth",
|
|
450
|
+
$value: "1px"
|
|
673
451
|
},
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
$type: "typography",
|
|
697
|
-
$value: {
|
|
698
|
-
fontFamily: "{font-family}",
|
|
699
|
-
fontWeight: "{font-weight.regular}",
|
|
700
|
-
lineHeight: "{line-height.md}",
|
|
701
|
-
fontSize: "{font-size.4}",
|
|
702
|
-
letterSpacing: "{letter-spacing.8}"
|
|
703
|
-
}
|
|
704
|
-
},
|
|
705
|
-
sm: {
|
|
706
|
-
$type: "typography",
|
|
707
|
-
$value: {
|
|
708
|
-
fontFamily: "{font-family}",
|
|
709
|
-
fontWeight: "{font-weight.regular}",
|
|
710
|
-
lineHeight: "{line-height.md}",
|
|
711
|
-
fontSize: "{font-size.3}",
|
|
712
|
-
letterSpacing: "{letter-spacing.7}"
|
|
713
|
-
}
|
|
714
|
-
},
|
|
715
|
-
xs: {
|
|
716
|
-
$type: "typography",
|
|
717
|
-
$value: {
|
|
718
|
-
fontFamily: "{font-family}",
|
|
719
|
-
fontWeight: "{font-weight.regular}",
|
|
720
|
-
lineHeight: "{line-height.md}",
|
|
721
|
-
fontSize: "{font-size.2}",
|
|
722
|
-
letterSpacing: "{letter-spacing.6}"
|
|
452
|
+
"3": {
|
|
453
|
+
$type: "borderWidth",
|
|
454
|
+
$value: "3px"
|
|
455
|
+
}
|
|
456
|
+
},
|
|
457
|
+
shadow: {
|
|
458
|
+
"100": {
|
|
459
|
+
$type: "boxShadow",
|
|
460
|
+
$value: [
|
|
461
|
+
{
|
|
462
|
+
color: "rgba(0,0,0,0.16)",
|
|
463
|
+
x: "0",
|
|
464
|
+
y: "0",
|
|
465
|
+
blur: "1",
|
|
466
|
+
spread: "0"
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
x: "0",
|
|
470
|
+
y: "1",
|
|
471
|
+
blur: "2",
|
|
472
|
+
spread: "0",
|
|
473
|
+
color: "rgba(0,0,0,0.12)"
|
|
723
474
|
}
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
475
|
+
]
|
|
476
|
+
},
|
|
477
|
+
"200": {
|
|
478
|
+
$type: "boxShadow",
|
|
479
|
+
$value: [
|
|
480
|
+
{
|
|
481
|
+
color: "rgba(0,0,0,0.15)",
|
|
482
|
+
x: "0",
|
|
483
|
+
y: "0",
|
|
484
|
+
blur: "1",
|
|
485
|
+
spread: "0"
|
|
735
486
|
},
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
fontSize: "{font-size.5}",
|
|
743
|
-
letterSpacing: "{letter-spacing.8}"
|
|
744
|
-
}
|
|
487
|
+
{
|
|
488
|
+
color: "rgba(0,0,0,0.12)",
|
|
489
|
+
x: "0",
|
|
490
|
+
y: "1",
|
|
491
|
+
blur: "2",
|
|
492
|
+
spread: "0"
|
|
745
493
|
},
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
494
|
+
{
|
|
495
|
+
x: "0",
|
|
496
|
+
y: "2",
|
|
497
|
+
blur: "4",
|
|
498
|
+
spread: "0",
|
|
499
|
+
color: "rgba(0,0,0,0.1)"
|
|
500
|
+
}
|
|
501
|
+
]
|
|
502
|
+
},
|
|
503
|
+
"300": {
|
|
504
|
+
$type: "boxShadow",
|
|
505
|
+
$value: [
|
|
506
|
+
{
|
|
507
|
+
color: "rgba(0,0,0,0.14)",
|
|
508
|
+
x: "0",
|
|
509
|
+
y: "0",
|
|
510
|
+
blur: "1",
|
|
511
|
+
spread: "0"
|
|
755
512
|
},
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
fontSize: "{font-size.3}",
|
|
763
|
-
letterSpacing: "{letter-spacing.7}"
|
|
764
|
-
}
|
|
513
|
+
{
|
|
514
|
+
color: "rgba(0,0,0,0.12)",
|
|
515
|
+
x: "0",
|
|
516
|
+
y: "2",
|
|
517
|
+
blur: "4",
|
|
518
|
+
spread: "0"
|
|
765
519
|
},
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
fontSize: "{font-size.2}",
|
|
773
|
-
letterSpacing: "{letter-spacing.6}"
|
|
774
|
-
}
|
|
520
|
+
{
|
|
521
|
+
x: "0",
|
|
522
|
+
y: "4",
|
|
523
|
+
blur: "8",
|
|
524
|
+
spread: "0",
|
|
525
|
+
color: "rgba(0,0,0,0.12)"
|
|
775
526
|
}
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
527
|
+
]
|
|
528
|
+
},
|
|
529
|
+
"400": {
|
|
530
|
+
$type: "boxShadow",
|
|
531
|
+
$value: [
|
|
532
|
+
{
|
|
533
|
+
color: "rgba(0,0,0,0.13)",
|
|
534
|
+
x: "0",
|
|
535
|
+
y: "0",
|
|
536
|
+
blur: "1",
|
|
537
|
+
spread: "0"
|
|
787
538
|
},
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
fontSize: "{font-size.5}",
|
|
795
|
-
letterSpacing: "{letter-spacing.8}"
|
|
796
|
-
}
|
|
539
|
+
{
|
|
540
|
+
color: "rgba(0,0,0,0.13)",
|
|
541
|
+
x: "0",
|
|
542
|
+
y: "3",
|
|
543
|
+
blur: "5",
|
|
544
|
+
spread: "0"
|
|
797
545
|
},
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
546
|
+
{
|
|
547
|
+
x: "0",
|
|
548
|
+
y: "6",
|
|
549
|
+
blur: "12",
|
|
550
|
+
spread: "0",
|
|
551
|
+
color: "rgba(0,0,0,0.14)"
|
|
552
|
+
}
|
|
553
|
+
]
|
|
554
|
+
},
|
|
555
|
+
"500": {
|
|
556
|
+
$type: "boxShadow",
|
|
557
|
+
$value: [
|
|
558
|
+
{
|
|
559
|
+
color: "rgba(0,0,0,0.12)",
|
|
560
|
+
x: "0",
|
|
561
|
+
y: "0",
|
|
562
|
+
blur: "1",
|
|
563
|
+
spread: "0"
|
|
807
564
|
},
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
fontSize: "{font-size.3}",
|
|
815
|
-
letterSpacing: "{letter-spacing.7}"
|
|
816
|
-
}
|
|
565
|
+
{
|
|
566
|
+
color: "rgba(0,0,0,0.16)",
|
|
567
|
+
x: "0",
|
|
568
|
+
y: "4",
|
|
569
|
+
blur: "8",
|
|
570
|
+
spread: "0"
|
|
817
571
|
},
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
fontSize: "{font-size.2}",
|
|
825
|
-
letterSpacing: "{letter-spacing.6}"
|
|
826
|
-
}
|
|
572
|
+
{
|
|
573
|
+
x: "0",
|
|
574
|
+
y: "12",
|
|
575
|
+
blur: "24",
|
|
576
|
+
spread: "0",
|
|
577
|
+
color: "rgba(0,0,0,0.16)"
|
|
827
578
|
}
|
|
828
|
-
|
|
579
|
+
]
|
|
829
580
|
}
|
|
830
581
|
},
|
|
831
582
|
opacity: {
|
|
832
|
-
|
|
583
|
+
"30": {
|
|
833
584
|
$type: "opacity",
|
|
834
|
-
$value: "
|
|
835
|
-
}
|
|
836
|
-
},
|
|
837
|
-
"border-width": {
|
|
838
|
-
default: {
|
|
839
|
-
$type: "borderWidth",
|
|
840
|
-
$value: "{border-width.1}"
|
|
841
|
-
},
|
|
842
|
-
focus: {
|
|
843
|
-
$type: "borderWidth",
|
|
844
|
-
$value: "{border-width.3}"
|
|
845
|
-
}
|
|
846
|
-
},
|
|
847
|
-
shadow: {
|
|
848
|
-
xs: {
|
|
849
|
-
$type: "boxShadow",
|
|
850
|
-
$value: "{shadow.100}"
|
|
851
|
-
},
|
|
852
|
-
sm: {
|
|
853
|
-
$type: "boxShadow",
|
|
854
|
-
$value: "{shadow.200}"
|
|
855
|
-
},
|
|
856
|
-
md: {
|
|
857
|
-
$type: "boxShadow",
|
|
858
|
-
$value: "{shadow.300}"
|
|
859
|
-
},
|
|
860
|
-
lg: {
|
|
861
|
-
$type: "boxShadow",
|
|
862
|
-
$value: "{shadow.400}"
|
|
863
|
-
},
|
|
864
|
-
xl: {
|
|
865
|
-
$type: "boxShadow",
|
|
866
|
-
$value: "{shadow.500}"
|
|
867
|
-
}
|
|
868
|
-
},
|
|
869
|
-
"border-radius": {
|
|
870
|
-
sm: {
|
|
871
|
-
$type: "dimension",
|
|
872
|
-
$value: "{border-radius.1}"
|
|
873
|
-
},
|
|
874
|
-
md: {
|
|
875
|
-
$type: "dimension",
|
|
876
|
-
$value: "{border-radius.2}"
|
|
877
|
-
},
|
|
878
|
-
lg: {
|
|
879
|
-
$type: "dimension",
|
|
880
|
-
$value: "{border-radius.3}"
|
|
881
|
-
},
|
|
882
|
-
xl: {
|
|
883
|
-
$type: "dimension",
|
|
884
|
-
$value: "{border-radius.4}"
|
|
885
|
-
},
|
|
886
|
-
default: {
|
|
887
|
-
$type: "dimension",
|
|
888
|
-
$value: "{border-radius.5}"
|
|
889
|
-
},
|
|
890
|
-
full: {
|
|
891
|
-
$type: "dimension",
|
|
892
|
-
$value: "{border-radius.6}"
|
|
585
|
+
$value: "30%"
|
|
893
586
|
}
|
|
894
|
-
}
|
|
895
|
-
|
|
587
|
+
}
|
|
588
|
+
};
|
|
589
|
+
var generateGlobals = () => globals;
|
|
590
|
+
|
|
591
|
+
// src/tokens/create/generators/primitives/size.ts
|
|
592
|
+
var global = {
|
|
593
|
+
_size: {
|
|
896
594
|
"0": {
|
|
897
595
|
$type: "dimension",
|
|
898
|
-
$value: "{_size.0
|
|
596
|
+
$value: "floor({_size.unit} * 0)"
|
|
899
597
|
},
|
|
900
598
|
"1": {
|
|
901
599
|
$type: "dimension",
|
|
902
|
-
$value: "{_size.1
|
|
600
|
+
$value: "floor({_size.unit} * 1)"
|
|
903
601
|
},
|
|
904
602
|
"2": {
|
|
905
603
|
$type: "dimension",
|
|
906
|
-
$value: "{_size.2
|
|
604
|
+
$value: "floor({_size.unit} * 2)"
|
|
907
605
|
},
|
|
908
606
|
"3": {
|
|
909
607
|
$type: "dimension",
|
|
910
|
-
$value: "{_size.3
|
|
608
|
+
$value: "floor({_size.unit} * 3)"
|
|
911
609
|
},
|
|
912
610
|
"4": {
|
|
913
611
|
$type: "dimension",
|
|
914
|
-
$value: "{_size.4
|
|
612
|
+
$value: "floor({_size.unit} * 4)"
|
|
915
613
|
},
|
|
916
614
|
"5": {
|
|
917
615
|
$type: "dimension",
|
|
918
|
-
$value: "{_size.5
|
|
616
|
+
$value: "floor({_size.unit} * 5)"
|
|
919
617
|
},
|
|
920
618
|
"6": {
|
|
921
619
|
$type: "dimension",
|
|
922
|
-
$value: "{_size.6
|
|
620
|
+
$value: "floor({_size.unit} * 6)"
|
|
923
621
|
},
|
|
924
622
|
"7": {
|
|
925
623
|
$type: "dimension",
|
|
926
|
-
$value: "{_size.7
|
|
624
|
+
$value: "floor({_size.unit} * 7)"
|
|
927
625
|
},
|
|
928
626
|
"8": {
|
|
929
627
|
$type: "dimension",
|
|
930
|
-
$value: "{_size.8
|
|
628
|
+
$value: "floor({_size.unit} * 8)"
|
|
931
629
|
},
|
|
932
630
|
"9": {
|
|
933
631
|
$type: "dimension",
|
|
934
|
-
$value: "{_size.9
|
|
632
|
+
$value: "floor({_size.unit} * 9)"
|
|
935
633
|
},
|
|
936
634
|
"10": {
|
|
937
635
|
$type: "dimension",
|
|
938
|
-
$value: "{_size.10
|
|
636
|
+
$value: "floor({_size.unit} * 10)"
|
|
939
637
|
},
|
|
940
638
|
"11": {
|
|
941
639
|
$type: "dimension",
|
|
942
|
-
$value: "{_size.11
|
|
640
|
+
$value: "floor({_size.unit} * 11)"
|
|
943
641
|
},
|
|
944
642
|
"12": {
|
|
945
643
|
$type: "dimension",
|
|
946
|
-
$value: "{_size.12
|
|
644
|
+
$value: "floor({_size.unit} * 12)"
|
|
947
645
|
},
|
|
948
646
|
"13": {
|
|
949
647
|
$type: "dimension",
|
|
950
|
-
$value: "{_size.13
|
|
648
|
+
$value: "floor({_size.unit} * 13)"
|
|
951
649
|
},
|
|
952
650
|
"14": {
|
|
953
651
|
$type: "dimension",
|
|
954
|
-
$value: "{_size.14
|
|
652
|
+
$value: "floor({_size.unit} * 14)"
|
|
955
653
|
},
|
|
956
654
|
"15": {
|
|
957
655
|
$type: "dimension",
|
|
958
|
-
$value: "{_size.15
|
|
656
|
+
$value: "floor({_size.unit} * 15)"
|
|
959
657
|
},
|
|
960
658
|
"18": {
|
|
961
659
|
$type: "dimension",
|
|
962
|
-
$value: "{_size.18
|
|
660
|
+
$value: "floor({_size.unit} * 18)"
|
|
963
661
|
},
|
|
964
662
|
"22": {
|
|
965
663
|
$type: "dimension",
|
|
966
|
-
$value: "{_size.22
|
|
664
|
+
$value: "floor({_size.unit} * 22)"
|
|
967
665
|
},
|
|
968
666
|
"26": {
|
|
969
667
|
$type: "dimension",
|
|
970
|
-
$value: "{_size.26
|
|
668
|
+
$value: "floor({_size.unit} * 26)"
|
|
971
669
|
},
|
|
972
670
|
"30": {
|
|
973
671
|
$type: "dimension",
|
|
974
|
-
$value: "{_size.30
|
|
975
|
-
}
|
|
976
|
-
}
|
|
977
|
-
};
|
|
978
|
-
|
|
979
|
-
// src/tokens/create/defaults.ts
|
|
980
|
-
var defaultTokens = {
|
|
981
|
-
"primitives/globals": globals_default,
|
|
982
|
-
"primitives/modes/size/small": small_default,
|
|
983
|
-
"primitives/modes/size/medium": medium_default,
|
|
984
|
-
"primitives/modes/size/large": large_default,
|
|
985
|
-
"primitives/modes/size/global": global_default,
|
|
986
|
-
"primitives/modes/typography/size/small": small_default2,
|
|
987
|
-
"primitives/modes/typography/size/medium": medium_default2,
|
|
988
|
-
"primitives/modes/typography/size/large": large_default2,
|
|
989
|
-
"semantic/style": style_default
|
|
990
|
-
};
|
|
991
|
-
var getDefaultTokens = (tokenSets) => Object.entries(R.pick(tokenSets, defaultTokens));
|
|
992
|
-
var getDefaultToken = (tokenPath) => {
|
|
993
|
-
return [tokenPath, defaultTokens[tokenPath]];
|
|
994
|
-
};
|
|
995
|
-
|
|
996
|
-
// src/tokens/create/generators/color.ts
|
|
997
|
-
import * as R4 from "ramda";
|
|
998
|
-
|
|
999
|
-
// src/colors/colorMetadata.ts
|
|
1000
|
-
import * as R2 from "ramda";
|
|
1001
|
-
var baseColors = {
|
|
1002
|
-
info: "#0A71C0",
|
|
1003
|
-
success: "#068718",
|
|
1004
|
-
warning: "#EA9B1B",
|
|
1005
|
-
danger: "#C01B1B"
|
|
1006
|
-
};
|
|
1007
|
-
var dsLinkColor = "#663299";
|
|
1008
|
-
var colorMetadata = {
|
|
1009
|
-
"background-default": {
|
|
1010
|
-
number: 1,
|
|
1011
|
-
name: "background-default",
|
|
1012
|
-
group: "background",
|
|
1013
|
-
displayName: "Background Default",
|
|
1014
|
-
description: {
|
|
1015
|
-
long: "Background Default er den mest n\xF8ytrale bakgrunnsfargen.",
|
|
1016
|
-
short: "Standard bakgrunnsfarge."
|
|
1017
|
-
},
|
|
1018
|
-
luminance: {
|
|
1019
|
-
light: 1,
|
|
1020
|
-
dark: 9e-3,
|
|
1021
|
-
contrast: 1e-3
|
|
1022
|
-
}
|
|
1023
|
-
},
|
|
1024
|
-
"background-tinted": {
|
|
1025
|
-
number: 2,
|
|
1026
|
-
name: "background-tinted",
|
|
1027
|
-
group: "background",
|
|
1028
|
-
displayName: "Background Tinted",
|
|
1029
|
-
description: {
|
|
1030
|
-
long: "Background Tinted er en bakgrunnsfarge som har et hint av farge i seg.",
|
|
1031
|
-
short: "Bakgrunn med et hint av farge i seg."
|
|
1032
|
-
},
|
|
1033
|
-
luminance: {
|
|
1034
|
-
light: 0.9,
|
|
1035
|
-
dark: 0.014,
|
|
1036
|
-
contrast: 65e-4
|
|
1037
|
-
}
|
|
1038
|
-
},
|
|
1039
|
-
"surface-default": {
|
|
1040
|
-
number: 3,
|
|
1041
|
-
name: "surface-default",
|
|
1042
|
-
group: "surface",
|
|
1043
|
-
displayName: "Surface Default",
|
|
1044
|
-
description: {
|
|
1045
|
-
long: "Surface Default brukes p\xE5 flater som ligger opp\xE5 bakgrunnsfargene. Dette er den mest n\xF8ytrale surface fargen.",
|
|
1046
|
-
short: "Standardfarge for overflater / komponenter."
|
|
1047
|
-
},
|
|
1048
|
-
luminance: {
|
|
1049
|
-
light: 1,
|
|
1050
|
-
dark: 0.021,
|
|
1051
|
-
contrast: 0.015
|
|
1052
|
-
}
|
|
1053
|
-
},
|
|
1054
|
-
"surface-tinted": {
|
|
1055
|
-
number: 4,
|
|
1056
|
-
name: "surface-tinted",
|
|
1057
|
-
group: "surface",
|
|
1058
|
-
displayName: "Surface Tinted",
|
|
1059
|
-
description: {
|
|
1060
|
-
long: "Surface Tinted brukes p\xE5 flater som ligger opp\xE5 bakgrunnsfargene. Denne har et hint av farge i seg.",
|
|
1061
|
-
short: "Overflater / komponenter med et hint av farge i seg."
|
|
1062
|
-
},
|
|
1063
|
-
luminance: {
|
|
1064
|
-
light: 0.81,
|
|
1065
|
-
dark: 0.027,
|
|
1066
|
-
contrast: 0.015
|
|
1067
|
-
}
|
|
1068
|
-
},
|
|
1069
|
-
"surface-hover": {
|
|
1070
|
-
number: 5,
|
|
1071
|
-
name: "surface-hover",
|
|
1072
|
-
group: "surface",
|
|
1073
|
-
displayName: "Surface Hover",
|
|
1074
|
-
description: {
|
|
1075
|
-
long: "Surface Hover brukes p\xE5 interaktive flater som ligger opp\xE5 bakgrunnsfargene i en hover state.",
|
|
1076
|
-
short: "Hover-farge til overflater / komponenter."
|
|
1077
|
-
},
|
|
1078
|
-
luminance: {
|
|
1079
|
-
light: 0.7,
|
|
1080
|
-
dark: 0.036,
|
|
1081
|
-
contrast: 0.028
|
|
1082
|
-
}
|
|
1083
|
-
},
|
|
1084
|
-
"surface-active": {
|
|
1085
|
-
number: 6,
|
|
1086
|
-
name: "surface-active",
|
|
1087
|
-
group: "surface",
|
|
1088
|
-
displayName: "Surface Active",
|
|
1089
|
-
description: {
|
|
1090
|
-
long: "Surface Active brukes p\xE5 interaktive flater som ligger opp\xE5 bakgrunnsfargene i en active state.",
|
|
1091
|
-
short: "Active-farge til overflater / komponenter."
|
|
1092
|
-
},
|
|
1093
|
-
luminance: {
|
|
1094
|
-
light: 0.59,
|
|
1095
|
-
dark: 0.056,
|
|
1096
|
-
contrast: 0.045
|
|
1097
|
-
}
|
|
1098
|
-
},
|
|
1099
|
-
"border-subtle": {
|
|
1100
|
-
number: 7,
|
|
1101
|
-
name: "border-subtle",
|
|
1102
|
-
group: "border",
|
|
1103
|
-
displayName: "Border Subtle",
|
|
1104
|
-
description: {
|
|
1105
|
-
long: "Border Subtle er den lyseste border-fargen og brukes for \xE5 skille elementer fra hverandre.",
|
|
1106
|
-
short: "Border-farge med lav kontrast til dekorativ bruk (skillelinjer)."
|
|
1107
|
-
},
|
|
1108
|
-
luminance: {
|
|
1109
|
-
light: 0.5,
|
|
1110
|
-
dark: 0.08,
|
|
1111
|
-
contrast: 0.26
|
|
1112
|
-
}
|
|
1113
|
-
},
|
|
1114
|
-
"border-default": {
|
|
1115
|
-
number: 8,
|
|
1116
|
-
name: "border-default",
|
|
1117
|
-
group: "border",
|
|
1118
|
-
displayName: "Border Default",
|
|
1119
|
-
description: {
|
|
1120
|
-
long: "Border Default er en border-farge som brukes n\xE5r man \xF8nsker god kontrast mot bakgrunnsfargene.",
|
|
1121
|
-
short: "Standard border-farge til skjemakomponenter og meningsb\xE6rende elementer."
|
|
672
|
+
$value: "floor({_size.unit} * 30)"
|
|
1122
673
|
},
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
contrast: 0.4
|
|
1127
|
-
}
|
|
1128
|
-
},
|
|
1129
|
-
"border-strong": {
|
|
1130
|
-
number: 9,
|
|
1131
|
-
name: "border-strong",
|
|
1132
|
-
group: "border",
|
|
1133
|
-
displayName: "Border Strong",
|
|
1134
|
-
description: {
|
|
1135
|
-
long: "Border Strong er den m\xF8rkeste border-fargen og brukes n\xE5r man \xF8nsker en veldig tydelig og sterk border.",
|
|
1136
|
-
short: "Border-farge med h\xF8y kontrast for ekstra synlighet."
|
|
674
|
+
"mode-font-size": {
|
|
675
|
+
$type: "number",
|
|
676
|
+
$value: "{size._mode-font-size}"
|
|
1137
677
|
},
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
contrast: 0.6
|
|
1142
|
-
}
|
|
1143
|
-
},
|
|
1144
|
-
"text-subtle": {
|
|
1145
|
-
number: 10,
|
|
1146
|
-
name: "text-subtle",
|
|
1147
|
-
group: "text",
|
|
1148
|
-
displayName: "Text Subtle",
|
|
1149
|
-
description: {
|
|
1150
|
-
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.",
|
|
1151
|
-
short: "Tekst- og ikonfarge med lavere kontrast."
|
|
678
|
+
base: {
|
|
679
|
+
$type: "number",
|
|
680
|
+
$value: "{size._base}"
|
|
1152
681
|
},
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
contrast: 0.57
|
|
1157
|
-
}
|
|
1158
|
-
},
|
|
1159
|
-
"text-default": {
|
|
1160
|
-
number: 11,
|
|
1161
|
-
name: "text-default",
|
|
1162
|
-
group: "text",
|
|
1163
|
-
displayName: "Text Default",
|
|
1164
|
-
description: {
|
|
1165
|
-
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.",
|
|
1166
|
-
short: "Tekst- og ikonfarge med h\xF8y kontrast og god synlighet."
|
|
682
|
+
step: {
|
|
683
|
+
$type: "number",
|
|
684
|
+
$value: "{size._step}"
|
|
1167
685
|
},
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
686
|
+
unit: {
|
|
687
|
+
$type: "number",
|
|
688
|
+
$value: "{_size.step} / {_size.base} * {_size.mode-font-size}"
|
|
689
|
+
}
|
|
690
|
+
}
|
|
691
|
+
};
|
|
692
|
+
var sizeModes = {
|
|
693
|
+
large: {
|
|
694
|
+
size: {
|
|
695
|
+
"_mode-font-size": {
|
|
696
|
+
$type: "dimension",
|
|
697
|
+
$value: "21"
|
|
698
|
+
},
|
|
699
|
+
_base: {
|
|
700
|
+
$type: "dimension",
|
|
701
|
+
$value: "18"
|
|
702
|
+
},
|
|
703
|
+
_step: {
|
|
704
|
+
$type: "dimension",
|
|
705
|
+
$value: "4"
|
|
706
|
+
}
|
|
1172
707
|
}
|
|
1173
708
|
},
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
709
|
+
medium: {
|
|
710
|
+
size: {
|
|
711
|
+
"_mode-font-size": {
|
|
712
|
+
$type: "dimension",
|
|
713
|
+
$value: "18"
|
|
714
|
+
},
|
|
715
|
+
_base: {
|
|
716
|
+
$type: "dimension",
|
|
717
|
+
$value: "18"
|
|
718
|
+
},
|
|
719
|
+
_step: {
|
|
720
|
+
$type: "dimension",
|
|
721
|
+
$value: "4"
|
|
722
|
+
}
|
|
1187
723
|
}
|
|
1188
724
|
},
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
725
|
+
small: {
|
|
726
|
+
size: {
|
|
727
|
+
"_mode-font-size": {
|
|
728
|
+
$type: "dimension",
|
|
729
|
+
$value: "16"
|
|
730
|
+
},
|
|
731
|
+
_base: {
|
|
732
|
+
$type: "dimension",
|
|
733
|
+
$value: "18"
|
|
734
|
+
},
|
|
735
|
+
_step: {
|
|
736
|
+
$type: "dimension",
|
|
737
|
+
$value: "4"
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
}
|
|
741
|
+
};
|
|
742
|
+
var generateSize = (size) => sizeModes[size];
|
|
743
|
+
var generateSizeGlobal = () => global;
|
|
744
|
+
|
|
745
|
+
// src/tokens/create/generators/primitives/typography.ts
|
|
746
|
+
var generateTypography = (themeName, { fontFamily }) => ({
|
|
747
|
+
[themeName]: {
|
|
748
|
+
"font-family": {
|
|
749
|
+
$type: "fontFamilies",
|
|
750
|
+
$value: fontFamily
|
|
1197
751
|
},
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
752
|
+
"font-weight": {
|
|
753
|
+
medium: {
|
|
754
|
+
$type: "fontWeights",
|
|
755
|
+
$value: "Medium"
|
|
756
|
+
},
|
|
757
|
+
semibold: {
|
|
758
|
+
$type: "fontWeights",
|
|
759
|
+
$value: "Semi bold"
|
|
760
|
+
},
|
|
761
|
+
regular: {
|
|
762
|
+
$type: "fontWeights",
|
|
763
|
+
$value: "Regular"
|
|
764
|
+
}
|
|
1202
765
|
}
|
|
766
|
+
}
|
|
767
|
+
});
|
|
768
|
+
var generateFontSizes = (size) => fontSizes[size];
|
|
769
|
+
var lineHeights = {
|
|
770
|
+
sm: {
|
|
771
|
+
$type: "lineHeights",
|
|
772
|
+
$value: "130%"
|
|
773
|
+
},
|
|
774
|
+
md: {
|
|
775
|
+
$type: "lineHeights",
|
|
776
|
+
$value: "150%"
|
|
777
|
+
},
|
|
778
|
+
lg: {
|
|
779
|
+
$type: "lineHeights",
|
|
780
|
+
$value: "170%"
|
|
781
|
+
}
|
|
782
|
+
};
|
|
783
|
+
var letterSpacings = {
|
|
784
|
+
"1": {
|
|
785
|
+
$type: "letterSpacing",
|
|
786
|
+
$value: "-1%"
|
|
1203
787
|
},
|
|
1204
|
-
"
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
788
|
+
"2": {
|
|
789
|
+
$type: "letterSpacing",
|
|
790
|
+
$value: "-0.5%"
|
|
791
|
+
},
|
|
792
|
+
"3": {
|
|
793
|
+
$type: "letterSpacing",
|
|
794
|
+
$value: "-0.25%"
|
|
795
|
+
},
|
|
796
|
+
"4": {
|
|
797
|
+
$type: "letterSpacing",
|
|
798
|
+
$value: "-0.15%"
|
|
799
|
+
},
|
|
800
|
+
"5": {
|
|
801
|
+
$type: "letterSpacing",
|
|
802
|
+
$value: "0%"
|
|
803
|
+
},
|
|
804
|
+
"6": {
|
|
805
|
+
$type: "letterSpacing",
|
|
806
|
+
$value: "0.15%"
|
|
807
|
+
},
|
|
808
|
+
"7": {
|
|
809
|
+
$type: "letterSpacing",
|
|
810
|
+
$value: "0.25%"
|
|
811
|
+
},
|
|
812
|
+
"8": {
|
|
813
|
+
$type: "letterSpacing",
|
|
814
|
+
$value: "0.5%"
|
|
815
|
+
},
|
|
816
|
+
"9": {
|
|
817
|
+
$type: "letterSpacing",
|
|
818
|
+
$value: "1.5%"
|
|
819
|
+
}
|
|
820
|
+
};
|
|
821
|
+
var fontSizes = {
|
|
822
|
+
large: {
|
|
823
|
+
"line-height": lineHeights,
|
|
824
|
+
"font-size": {
|
|
825
|
+
"1": {
|
|
826
|
+
$type: "fontSizes",
|
|
827
|
+
$value: "13"
|
|
828
|
+
},
|
|
829
|
+
"2": {
|
|
830
|
+
$type: "fontSizes",
|
|
831
|
+
$value: "16"
|
|
832
|
+
},
|
|
833
|
+
"3": {
|
|
834
|
+
$type: "fontSizes",
|
|
835
|
+
$value: "18"
|
|
836
|
+
},
|
|
837
|
+
"4": {
|
|
838
|
+
$type: "fontSizes",
|
|
839
|
+
$value: "21"
|
|
840
|
+
},
|
|
841
|
+
"5": {
|
|
842
|
+
$type: "fontSizes",
|
|
843
|
+
$value: "24"
|
|
844
|
+
},
|
|
845
|
+
"6": {
|
|
846
|
+
$type: "fontSizes",
|
|
847
|
+
$value: "30"
|
|
848
|
+
},
|
|
849
|
+
"7": {
|
|
850
|
+
$type: "fontSizes",
|
|
851
|
+
$value: "36"
|
|
852
|
+
},
|
|
853
|
+
"8": {
|
|
854
|
+
$type: "fontSizes",
|
|
855
|
+
$value: "48"
|
|
856
|
+
},
|
|
857
|
+
"9": {
|
|
858
|
+
$type: "fontSizes",
|
|
859
|
+
$value: "60"
|
|
860
|
+
},
|
|
861
|
+
"10": {
|
|
862
|
+
$type: "fontSizes",
|
|
863
|
+
$value: "72"
|
|
864
|
+
}
|
|
1212
865
|
},
|
|
1213
|
-
|
|
1214
|
-
light: 1,
|
|
1215
|
-
dark: 1,
|
|
1216
|
-
contrast: 1
|
|
1217
|
-
}
|
|
866
|
+
"letter-spacing": letterSpacings
|
|
1218
867
|
},
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
868
|
+
medium: {
|
|
869
|
+
"line-height": lineHeights,
|
|
870
|
+
"font-size": {
|
|
871
|
+
"1": {
|
|
872
|
+
$type: "fontSizes",
|
|
873
|
+
$value: "12"
|
|
874
|
+
},
|
|
875
|
+
"2": {
|
|
876
|
+
$type: "fontSizes",
|
|
877
|
+
$value: "14"
|
|
878
|
+
},
|
|
879
|
+
"3": {
|
|
880
|
+
$type: "fontSizes",
|
|
881
|
+
$value: "16"
|
|
882
|
+
},
|
|
883
|
+
"4": {
|
|
884
|
+
$type: "fontSizes",
|
|
885
|
+
$value: "18"
|
|
886
|
+
},
|
|
887
|
+
"5": {
|
|
888
|
+
$type: "fontSizes",
|
|
889
|
+
$value: "21"
|
|
890
|
+
},
|
|
891
|
+
"6": {
|
|
892
|
+
$type: "fontSizes",
|
|
893
|
+
$value: "24"
|
|
894
|
+
},
|
|
895
|
+
"7": {
|
|
896
|
+
$type: "fontSizes",
|
|
897
|
+
$value: "30"
|
|
898
|
+
},
|
|
899
|
+
"8": {
|
|
900
|
+
$type: "fontSizes",
|
|
901
|
+
$value: "36"
|
|
902
|
+
},
|
|
903
|
+
"9": {
|
|
904
|
+
$type: "fontSizes",
|
|
905
|
+
$value: "48"
|
|
906
|
+
},
|
|
907
|
+
"10": {
|
|
908
|
+
$type: "fontSizes",
|
|
909
|
+
$value: "60"
|
|
910
|
+
}
|
|
1227
911
|
},
|
|
1228
|
-
|
|
1229
|
-
light: 1,
|
|
1230
|
-
dark: 1,
|
|
1231
|
-
contrast: 1
|
|
1232
|
-
}
|
|
912
|
+
"letter-spacing": letterSpacings
|
|
1233
913
|
},
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
914
|
+
small: {
|
|
915
|
+
"line-height": lineHeights,
|
|
916
|
+
"font-size": {
|
|
917
|
+
"1": {
|
|
918
|
+
$type: "fontSizes",
|
|
919
|
+
$value: "11"
|
|
920
|
+
},
|
|
921
|
+
"2": {
|
|
922
|
+
$type: "fontSizes",
|
|
923
|
+
$value: "13"
|
|
924
|
+
},
|
|
925
|
+
"3": {
|
|
926
|
+
$type: "fontSizes",
|
|
927
|
+
$value: "14"
|
|
928
|
+
},
|
|
929
|
+
"4": {
|
|
930
|
+
$type: "fontSizes",
|
|
931
|
+
$value: "16"
|
|
932
|
+
},
|
|
933
|
+
"5": {
|
|
934
|
+
$type: "fontSizes",
|
|
935
|
+
$value: "18"
|
|
936
|
+
},
|
|
937
|
+
"6": {
|
|
938
|
+
$type: "fontSizes",
|
|
939
|
+
$value: "21"
|
|
940
|
+
},
|
|
941
|
+
"7": {
|
|
942
|
+
$type: "fontSizes",
|
|
943
|
+
$value: "24"
|
|
944
|
+
},
|
|
945
|
+
"8": {
|
|
946
|
+
$type: "fontSizes",
|
|
947
|
+
$value: "30"
|
|
948
|
+
},
|
|
949
|
+
"9": {
|
|
950
|
+
$type: "fontSizes",
|
|
951
|
+
$value: "36"
|
|
952
|
+
},
|
|
953
|
+
"10": {
|
|
954
|
+
$type: "fontSizes",
|
|
955
|
+
$value: "48"
|
|
956
|
+
}
|
|
1242
957
|
},
|
|
1243
|
-
|
|
1244
|
-
light: 1,
|
|
1245
|
-
dark: 1,
|
|
1246
|
-
contrast: 1
|
|
1247
|
-
}
|
|
958
|
+
"letter-spacing": letterSpacings
|
|
1248
959
|
}
|
|
1249
960
|
};
|
|
1250
|
-
var colorMetadataByNumber = R2.indexBy((metadata) => metadata.number, Object.values(colorMetadata));
|
|
1251
|
-
var colorNames = Object.keys(colorMetadata);
|
|
1252
|
-
var baseColorNames = Object.keys(baseColors);
|
|
1253
|
-
|
|
1254
|
-
// src/colors/theme.ts
|
|
1255
|
-
import chroma2 from "chroma-js";
|
|
1256
|
-
import * as R3 from "ramda";
|
|
1257
|
-
|
|
1258
|
-
// src/colors/utils.ts
|
|
1259
|
-
import chroma from "chroma-js";
|
|
1260
|
-
import Colorjs from "colorjs.io";
|
|
1261
|
-
import { Hsluv } from "hsluv";
|
|
1262
|
-
var getLuminanceFromLightness = (lightness) => {
|
|
1263
|
-
const conv = new Hsluv();
|
|
1264
|
-
conv.hsluv_l = lightness;
|
|
1265
|
-
conv.hsluvToHex();
|
|
1266
|
-
return chroma(conv.hex).luminance();
|
|
1267
|
-
};
|
|
1268
|
-
var getLightnessFromHex = (hex) => {
|
|
1269
|
-
const conv = new Hsluv();
|
|
1270
|
-
conv.hex = hex;
|
|
1271
|
-
conv.hexToHsluv();
|
|
1272
|
-
return conv.hsluv_l;
|
|
1273
|
-
};
|
|
1274
961
|
|
|
1275
|
-
// src/
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
const colors = R3.mapObjIndexed((colorData) => {
|
|
1284
|
-
const luminance = colorData.luminance[colorScheme];
|
|
1285
|
-
return {
|
|
1286
|
-
...colorData,
|
|
1287
|
-
hex: chroma2(interpolationColor).luminance(luminance).hex()
|
|
1288
|
-
};
|
|
1289
|
-
}, colorMetadata);
|
|
1290
|
-
const baseColors2 = generateBaseColors(color, colorScheme);
|
|
1291
|
-
colors["base-default"] = { ...colors["base-default"], hex: baseColors2.default };
|
|
1292
|
-
colors["base-hover"] = { ...colors["base-hover"], hex: baseColors2.hover };
|
|
1293
|
-
colors["base-active"] = { ...colors["base-active"], hex: baseColors2.active };
|
|
1294
|
-
colors["base-contrast-subtle"] = {
|
|
1295
|
-
...colors["base-contrast-subtle"],
|
|
1296
|
-
hex: generateColorContrast(baseColors2.default, "subtle")
|
|
1297
|
-
};
|
|
1298
|
-
colors["base-contrast-default"] = {
|
|
1299
|
-
...colors["base-contrast-default"],
|
|
1300
|
-
hex: generateColorContrast(baseColors2.default, "default")
|
|
1301
|
-
};
|
|
1302
|
-
return Object.values(colors);
|
|
1303
|
-
};
|
|
1304
|
-
var generateBaseColors = (color, colorScheme) => {
|
|
1305
|
-
let colorLightness = getLightnessFromHex(color);
|
|
1306
|
-
if (colorScheme !== "light") {
|
|
1307
|
-
colorLightness = colorLightness <= 30 ? 70 : 100 - colorLightness;
|
|
1308
|
-
}
|
|
1309
|
-
const modifier = colorLightness <= 30 || colorLightness >= 49 && colorLightness <= 65 ? -8 : 8;
|
|
1310
|
-
const calculateLightness = (base, mod) => base - mod;
|
|
962
|
+
// src/tokens/create/generators/semantic/color.ts
|
|
963
|
+
import * as R5 from "ramda";
|
|
964
|
+
var generateSemanticColors = (colors, _themeName) => {
|
|
965
|
+
const mainColorNames = Object.keys(colors.main);
|
|
966
|
+
const supportColorNames = Object.keys(colors.support);
|
|
967
|
+
const customColors = [...mainColorNames, "neutral", ...supportColorNames];
|
|
968
|
+
const allColors = [...customColors, ...baseColorNames];
|
|
969
|
+
const semanticColorTokens = allColors.map((colorName) => [colorName, generateColorScaleTokens(colorName)]);
|
|
1311
970
|
return {
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
971
|
+
...baseColorTemplate,
|
|
972
|
+
color: {
|
|
973
|
+
...Object.fromEntries(semanticColorTokens),
|
|
974
|
+
...baseColorTemplate.color
|
|
975
|
+
}
|
|
1315
976
|
};
|
|
1316
977
|
};
|
|
1317
|
-
var
|
|
1318
|
-
|
|
1319
|
-
|
|
978
|
+
var baseColorTemplate = {
|
|
979
|
+
color: {
|
|
980
|
+
focus: {
|
|
981
|
+
inner: {
|
|
982
|
+
$type: "color",
|
|
983
|
+
$value: "{color.focus.inner-color}"
|
|
984
|
+
},
|
|
985
|
+
outer: {
|
|
986
|
+
$type: "color",
|
|
987
|
+
$value: "{color.focus.outer-color}"
|
|
988
|
+
}
|
|
989
|
+
}
|
|
990
|
+
},
|
|
991
|
+
link: {
|
|
992
|
+
color: {
|
|
993
|
+
visited: {
|
|
994
|
+
$type: "color",
|
|
995
|
+
$value: "{color.link.visited}"
|
|
996
|
+
}
|
|
997
|
+
}
|
|
1320
998
|
}
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
999
|
+
};
|
|
1000
|
+
var generateColorScaleTokens = (colorName) => {
|
|
1001
|
+
const colorScale = {};
|
|
1002
|
+
for (const [colorSemantic, colorNumber] of R5.toPairs(semanticColorMap)) {
|
|
1003
|
+
colorScale[colorSemantic] = {
|
|
1004
|
+
$type: "color",
|
|
1005
|
+
$value: `{color.${colorName}.${colorNumber}}`
|
|
1006
|
+
};
|
|
1328
1007
|
}
|
|
1329
|
-
return
|
|
1008
|
+
return colorScale;
|
|
1330
1009
|
};
|
|
1331
1010
|
|
|
1332
|
-
// src/tokens/create/generators/color.ts
|
|
1333
|
-
var
|
|
1334
|
-
const
|
|
1335
|
-
const
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1011
|
+
// src/tokens/create/generators/semantic/color-modes.ts
|
|
1012
|
+
var generateColorModes = (colors, _themeName) => {
|
|
1013
|
+
const mainColorNames = Object.keys(colors.main);
|
|
1014
|
+
const supportColorNames = Object.keys(colors.support);
|
|
1015
|
+
const modes = {
|
|
1016
|
+
"main-color": {},
|
|
1017
|
+
"support-color": {}
|
|
1018
|
+
};
|
|
1019
|
+
const categories = [
|
|
1020
|
+
["main-color", mainColorNames],
|
|
1021
|
+
["support-color", supportColorNames]
|
|
1022
|
+
];
|
|
1023
|
+
for (const [colorCategory, colorNames2] of categories) {
|
|
1024
|
+
for (const colorName of colorNames2) {
|
|
1025
|
+
const category = colorCategory.replace("-color", "");
|
|
1026
|
+
const customColorTokens = {
|
|
1027
|
+
color: {
|
|
1028
|
+
[category]: generateColorScaleTokens2(colorName)
|
|
1029
|
+
}
|
|
1030
|
+
};
|
|
1031
|
+
modes[colorCategory][colorName] = customColorTokens;
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
return modes;
|
|
1035
|
+
};
|
|
1036
|
+
var generateColorScaleTokens2 = (colorName) => {
|
|
1037
|
+
const colorScale = {};
|
|
1038
|
+
for (const colorSemantic of semanticColorNames) {
|
|
1039
|
+
colorScale[colorSemantic] = {
|
|
1040
|
+
$type: "color",
|
|
1041
|
+
$value: `{color.${colorName}.${colorSemantic}}`
|
|
1342
1042
|
};
|
|
1343
1043
|
}
|
|
1344
|
-
return
|
|
1044
|
+
return colorScale;
|
|
1345
1045
|
};
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1046
|
+
|
|
1047
|
+
// src/tokens/create/generators/semantic/style.ts
|
|
1048
|
+
function generateSemanticStyle() {
|
|
1049
|
+
return {
|
|
1050
|
+
typography: {
|
|
1051
|
+
heading: {
|
|
1052
|
+
"2xl": {
|
|
1053
|
+
$type: "typography",
|
|
1054
|
+
$value: {
|
|
1055
|
+
fontFamily: "{font-family}",
|
|
1056
|
+
fontWeight: "{font-weight.medium}",
|
|
1057
|
+
lineHeight: "{line-height.sm}",
|
|
1058
|
+
fontSize: "{font-size.10}",
|
|
1059
|
+
letterSpacing: "{letter-spacing.1}"
|
|
1060
|
+
}
|
|
1061
|
+
},
|
|
1062
|
+
xl: {
|
|
1063
|
+
$type: "typography",
|
|
1064
|
+
$value: {
|
|
1065
|
+
fontFamily: "{font-family}",
|
|
1066
|
+
fontWeight: "{font-weight.medium}",
|
|
1067
|
+
lineHeight: "{line-height.sm}",
|
|
1068
|
+
fontSize: "{font-size.9}",
|
|
1069
|
+
letterSpacing: "{letter-spacing.1}"
|
|
1070
|
+
}
|
|
1071
|
+
},
|
|
1072
|
+
lg: {
|
|
1073
|
+
$type: "typography",
|
|
1074
|
+
$value: {
|
|
1075
|
+
fontFamily: "{font-family}",
|
|
1076
|
+
fontWeight: "{font-weight.medium}",
|
|
1077
|
+
lineHeight: "{line-height.sm}",
|
|
1078
|
+
fontSize: "{font-size.8}",
|
|
1079
|
+
letterSpacing: "{letter-spacing.2}"
|
|
1080
|
+
}
|
|
1081
|
+
},
|
|
1082
|
+
md: {
|
|
1083
|
+
$type: "typography",
|
|
1084
|
+
$value: {
|
|
1085
|
+
fontFamily: "{font-family}",
|
|
1086
|
+
fontWeight: "{font-weight.medium}",
|
|
1087
|
+
lineHeight: "{line-height.sm}",
|
|
1088
|
+
fontSize: "{font-size.7}",
|
|
1089
|
+
letterSpacing: "{letter-spacing.3}"
|
|
1090
|
+
}
|
|
1091
|
+
},
|
|
1092
|
+
sm: {
|
|
1093
|
+
$type: "typography",
|
|
1094
|
+
$value: {
|
|
1095
|
+
fontFamily: "{font-family}",
|
|
1096
|
+
fontWeight: "{font-weight.medium}",
|
|
1097
|
+
lineHeight: "{line-height.sm}",
|
|
1098
|
+
fontSize: "{font-size.6}",
|
|
1099
|
+
letterSpacing: "{letter-spacing.5}"
|
|
1100
|
+
}
|
|
1101
|
+
},
|
|
1102
|
+
xs: {
|
|
1103
|
+
$type: "typography",
|
|
1104
|
+
$value: {
|
|
1105
|
+
fontFamily: "{font-family}",
|
|
1106
|
+
fontWeight: "{font-weight.medium}",
|
|
1107
|
+
lineHeight: "{line-height.sm}",
|
|
1108
|
+
fontSize: "{font-size.5}",
|
|
1109
|
+
letterSpacing: "{letter-spacing.6}"
|
|
1110
|
+
}
|
|
1111
|
+
},
|
|
1112
|
+
"2xs": {
|
|
1113
|
+
$type: "typography",
|
|
1114
|
+
$value: {
|
|
1115
|
+
fontFamily: "{font-family}",
|
|
1116
|
+
fontWeight: "{font-weight.medium}",
|
|
1117
|
+
lineHeight: "{line-height.sm}",
|
|
1118
|
+
fontSize: "{font-size.4}",
|
|
1119
|
+
letterSpacing: "{letter-spacing.6}"
|
|
1120
|
+
}
|
|
1361
1121
|
}
|
|
1362
|
-
|
|
1363
|
-
|
|
1122
|
+
},
|
|
1123
|
+
body: {
|
|
1124
|
+
xl: {
|
|
1125
|
+
$type: "typography",
|
|
1126
|
+
$value: {
|
|
1127
|
+
fontFamily: "{font-family}",
|
|
1128
|
+
fontWeight: "{font-weight.regular}",
|
|
1129
|
+
lineHeight: "{line-height.md}",
|
|
1130
|
+
fontSize: "{font-size.6}",
|
|
1131
|
+
letterSpacing: "{letter-spacing.8}"
|
|
1132
|
+
}
|
|
1133
|
+
},
|
|
1134
|
+
lg: {
|
|
1135
|
+
$type: "typography",
|
|
1136
|
+
$value: {
|
|
1137
|
+
fontFamily: "{font-family}",
|
|
1138
|
+
fontWeight: "{font-weight.regular}",
|
|
1139
|
+
lineHeight: "{line-height.md}",
|
|
1140
|
+
fontSize: "{font-size.5}",
|
|
1141
|
+
letterSpacing: "{letter-spacing.8}"
|
|
1142
|
+
}
|
|
1143
|
+
},
|
|
1144
|
+
md: {
|
|
1145
|
+
$type: "typography",
|
|
1146
|
+
$value: {
|
|
1147
|
+
fontFamily: "{font-family}",
|
|
1148
|
+
fontWeight: "{font-weight.regular}",
|
|
1149
|
+
lineHeight: "{line-height.md}",
|
|
1150
|
+
fontSize: "{font-size.4}",
|
|
1151
|
+
letterSpacing: "{letter-spacing.8}"
|
|
1152
|
+
}
|
|
1153
|
+
},
|
|
1154
|
+
sm: {
|
|
1155
|
+
$type: "typography",
|
|
1156
|
+
$value: {
|
|
1157
|
+
fontFamily: "{font-family}",
|
|
1158
|
+
fontWeight: "{font-weight.regular}",
|
|
1159
|
+
lineHeight: "{line-height.md}",
|
|
1160
|
+
fontSize: "{font-size.3}",
|
|
1161
|
+
letterSpacing: "{letter-spacing.7}"
|
|
1162
|
+
}
|
|
1163
|
+
},
|
|
1164
|
+
xs: {
|
|
1165
|
+
$type: "typography",
|
|
1166
|
+
$value: {
|
|
1167
|
+
fontFamily: "{font-family}",
|
|
1168
|
+
fontWeight: "{font-weight.regular}",
|
|
1169
|
+
lineHeight: "{line-height.md}",
|
|
1170
|
+
fontSize: "{font-size.2}",
|
|
1171
|
+
letterSpacing: "{letter-spacing.6}"
|
|
1172
|
+
}
|
|
1173
|
+
},
|
|
1174
|
+
short: {
|
|
1175
|
+
xl: {
|
|
1176
|
+
$type: "typography",
|
|
1177
|
+
$value: {
|
|
1178
|
+
fontFamily: "{font-family}",
|
|
1179
|
+
fontWeight: "{font-weight.regular}",
|
|
1180
|
+
lineHeight: "{line-height.sm}",
|
|
1181
|
+
fontSize: "{font-size.6}",
|
|
1182
|
+
letterSpacing: "{letter-spacing.8}"
|
|
1183
|
+
}
|
|
1184
|
+
},
|
|
1185
|
+
lg: {
|
|
1186
|
+
$type: "typography",
|
|
1187
|
+
$value: {
|
|
1188
|
+
fontFamily: "{font-family}",
|
|
1189
|
+
fontWeight: "{font-weight.regular}",
|
|
1190
|
+
lineHeight: "{line-height.sm}",
|
|
1191
|
+
fontSize: "{font-size.5}",
|
|
1192
|
+
letterSpacing: "{letter-spacing.8}"
|
|
1193
|
+
}
|
|
1194
|
+
},
|
|
1195
|
+
md: {
|
|
1196
|
+
$type: "typography",
|
|
1197
|
+
$value: {
|
|
1198
|
+
fontFamily: "{font-family}",
|
|
1199
|
+
fontWeight: "{font-weight.regular}",
|
|
1200
|
+
lineHeight: "{line-height.sm}",
|
|
1201
|
+
fontSize: "{font-size.4}",
|
|
1202
|
+
letterSpacing: "{letter-spacing.8}"
|
|
1203
|
+
}
|
|
1204
|
+
},
|
|
1205
|
+
sm: {
|
|
1206
|
+
$type: "typography",
|
|
1207
|
+
$value: {
|
|
1208
|
+
fontFamily: "{font-family}",
|
|
1209
|
+
fontWeight: "{font-weight.regular}",
|
|
1210
|
+
lineHeight: "{line-height.sm}",
|
|
1211
|
+
fontSize: "{font-size.3}",
|
|
1212
|
+
letterSpacing: "{letter-spacing.7}"
|
|
1213
|
+
}
|
|
1214
|
+
},
|
|
1215
|
+
xs: {
|
|
1216
|
+
$type: "typography",
|
|
1217
|
+
$value: {
|
|
1218
|
+
fontFamily: "{font-family}",
|
|
1219
|
+
fontWeight: "{font-weight.regular}",
|
|
1220
|
+
lineHeight: "{line-height.sm}",
|
|
1221
|
+
fontSize: "{font-size.2}",
|
|
1222
|
+
letterSpacing: "{letter-spacing.6}"
|
|
1223
|
+
}
|
|
1224
|
+
}
|
|
1225
|
+
},
|
|
1226
|
+
long: {
|
|
1227
|
+
xl: {
|
|
1228
|
+
$type: "typography",
|
|
1229
|
+
$value: {
|
|
1230
|
+
fontFamily: "{font-family}",
|
|
1231
|
+
fontWeight: "{font-weight.regular}",
|
|
1232
|
+
lineHeight: "{line-height.lg}",
|
|
1233
|
+
fontSize: "{font-size.6}",
|
|
1234
|
+
letterSpacing: "{letter-spacing.8}"
|
|
1235
|
+
}
|
|
1236
|
+
},
|
|
1237
|
+
lg: {
|
|
1238
|
+
$type: "typography",
|
|
1239
|
+
$value: {
|
|
1240
|
+
fontFamily: "{font-family}",
|
|
1241
|
+
fontWeight: "{font-weight.regular}",
|
|
1242
|
+
lineHeight: "{line-height.lg}",
|
|
1243
|
+
fontSize: "{font-size.5}",
|
|
1244
|
+
letterSpacing: "{letter-spacing.8}"
|
|
1245
|
+
}
|
|
1246
|
+
},
|
|
1247
|
+
md: {
|
|
1248
|
+
$type: "typography",
|
|
1249
|
+
$value: {
|
|
1250
|
+
fontFamily: "{font-family}",
|
|
1251
|
+
fontWeight: "{font-weight.regular}",
|
|
1252
|
+
lineHeight: "{line-height.lg}",
|
|
1253
|
+
fontSize: "{font-size.4}",
|
|
1254
|
+
letterSpacing: "{letter-spacing.8}"
|
|
1255
|
+
}
|
|
1256
|
+
},
|
|
1257
|
+
sm: {
|
|
1258
|
+
$type: "typography",
|
|
1259
|
+
$value: {
|
|
1260
|
+
fontFamily: "{font-family}",
|
|
1261
|
+
fontWeight: "{font-weight.regular}",
|
|
1262
|
+
lineHeight: "{line-height.lg}",
|
|
1263
|
+
fontSize: "{font-size.3}",
|
|
1264
|
+
letterSpacing: "{letter-spacing.7}"
|
|
1265
|
+
}
|
|
1266
|
+
},
|
|
1267
|
+
xs: {
|
|
1268
|
+
$type: "typography",
|
|
1269
|
+
$value: {
|
|
1270
|
+
fontFamily: "{font-family}",
|
|
1271
|
+
fontWeight: "{font-weight.regular}",
|
|
1272
|
+
lineHeight: "{line-height.lg}",
|
|
1273
|
+
fontSize: "{font-size.2}",
|
|
1274
|
+
letterSpacing: "{letter-spacing.6}"
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1364
1277
|
}
|
|
1365
1278
|
}
|
|
1366
|
-
}
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1279
|
+
},
|
|
1280
|
+
opacity: {
|
|
1281
|
+
disabled: {
|
|
1282
|
+
$type: "opacity",
|
|
1283
|
+
$value: "{opacity.30}"
|
|
1284
|
+
}
|
|
1285
|
+
},
|
|
1286
|
+
"border-width": {
|
|
1287
|
+
default: {
|
|
1288
|
+
$type: "borderWidth",
|
|
1289
|
+
$value: "{border-width.1}"
|
|
1290
|
+
},
|
|
1291
|
+
focus: {
|
|
1292
|
+
$type: "borderWidth",
|
|
1293
|
+
$value: "{border-width.3}"
|
|
1294
|
+
}
|
|
1295
|
+
},
|
|
1296
|
+
shadow: {
|
|
1297
|
+
xs: {
|
|
1298
|
+
$type: "boxShadow",
|
|
1299
|
+
$value: "{shadow.100}"
|
|
1300
|
+
},
|
|
1301
|
+
sm: {
|
|
1302
|
+
$type: "boxShadow",
|
|
1303
|
+
$value: "{shadow.200}"
|
|
1304
|
+
},
|
|
1305
|
+
md: {
|
|
1306
|
+
$type: "boxShadow",
|
|
1307
|
+
$value: "{shadow.300}"
|
|
1308
|
+
},
|
|
1309
|
+
lg: {
|
|
1310
|
+
$type: "boxShadow",
|
|
1311
|
+
$value: "{shadow.400}"
|
|
1312
|
+
},
|
|
1313
|
+
xl: {
|
|
1314
|
+
$type: "boxShadow",
|
|
1315
|
+
$value: "{shadow.500}"
|
|
1316
|
+
}
|
|
1317
|
+
},
|
|
1318
|
+
"border-radius": {
|
|
1319
|
+
sm: {
|
|
1320
|
+
$type: "dimension",
|
|
1321
|
+
$value: "{border-radius.1}"
|
|
1322
|
+
},
|
|
1323
|
+
md: {
|
|
1324
|
+
$type: "dimension",
|
|
1325
|
+
$value: "{border-radius.2}"
|
|
1326
|
+
},
|
|
1327
|
+
lg: {
|
|
1328
|
+
$type: "dimension",
|
|
1329
|
+
$value: "{border-radius.3}"
|
|
1330
|
+
},
|
|
1331
|
+
xl: {
|
|
1332
|
+
$type: "dimension",
|
|
1333
|
+
$value: "{border-radius.4}"
|
|
1334
|
+
},
|
|
1335
|
+
default: {
|
|
1336
|
+
$type: "dimension",
|
|
1337
|
+
$value: "{border-radius.5}"
|
|
1338
|
+
},
|
|
1339
|
+
full: {
|
|
1340
|
+
$type: "dimension",
|
|
1341
|
+
$value: "{border-radius.6}"
|
|
1342
|
+
}
|
|
1343
|
+
},
|
|
1344
|
+
size: {
|
|
1345
|
+
"0": {
|
|
1346
|
+
$type: "dimension",
|
|
1347
|
+
$value: "{_size.0}"
|
|
1348
|
+
},
|
|
1349
|
+
"1": {
|
|
1350
|
+
$type: "dimension",
|
|
1351
|
+
$value: "{_size.1}"
|
|
1352
|
+
},
|
|
1353
|
+
"2": {
|
|
1354
|
+
$type: "dimension",
|
|
1355
|
+
$value: "{_size.2}"
|
|
1356
|
+
},
|
|
1357
|
+
"3": {
|
|
1358
|
+
$type: "dimension",
|
|
1359
|
+
$value: "{_size.3}"
|
|
1360
|
+
},
|
|
1361
|
+
"4": {
|
|
1362
|
+
$type: "dimension",
|
|
1363
|
+
$value: "{_size.4}"
|
|
1364
|
+
},
|
|
1365
|
+
"5": {
|
|
1366
|
+
$type: "dimension",
|
|
1367
|
+
$value: "{_size.5}"
|
|
1368
|
+
},
|
|
1369
|
+
"6": {
|
|
1370
|
+
$type: "dimension",
|
|
1371
|
+
$value: "{_size.6}"
|
|
1372
|
+
},
|
|
1373
|
+
"7": {
|
|
1374
|
+
$type: "dimension",
|
|
1375
|
+
$value: "{_size.7}"
|
|
1376
|
+
},
|
|
1377
|
+
"8": {
|
|
1378
|
+
$type: "dimension",
|
|
1379
|
+
$value: "{_size.8}"
|
|
1380
|
+
},
|
|
1381
|
+
"9": {
|
|
1382
|
+
$type: "dimension",
|
|
1383
|
+
$value: "{_size.9}"
|
|
1384
|
+
},
|
|
1385
|
+
"10": {
|
|
1386
|
+
$type: "dimension",
|
|
1387
|
+
$value: "{_size.10}"
|
|
1388
|
+
},
|
|
1389
|
+
"11": {
|
|
1390
|
+
$type: "dimension",
|
|
1391
|
+
$value: "{_size.11}"
|
|
1392
|
+
},
|
|
1393
|
+
"12": {
|
|
1394
|
+
$type: "dimension",
|
|
1395
|
+
$value: "{_size.12}"
|
|
1396
|
+
},
|
|
1397
|
+
"13": {
|
|
1398
|
+
$type: "dimension",
|
|
1399
|
+
$value: "{_size.13}"
|
|
1400
|
+
},
|
|
1401
|
+
"14": {
|
|
1402
|
+
$type: "dimension",
|
|
1403
|
+
$value: "{_size.14}"
|
|
1404
|
+
},
|
|
1405
|
+
"15": {
|
|
1406
|
+
$type: "dimension",
|
|
1407
|
+
$value: "{_size.15}"
|
|
1408
|
+
},
|
|
1409
|
+
"18": {
|
|
1410
|
+
$type: "dimension",
|
|
1411
|
+
$value: "{_size.18}"
|
|
1412
|
+
},
|
|
1413
|
+
"22": {
|
|
1414
|
+
$type: "dimension",
|
|
1415
|
+
$value: "{_size.22}"
|
|
1416
|
+
},
|
|
1417
|
+
"26": {
|
|
1418
|
+
$type: "dimension",
|
|
1419
|
+
$value: "{_size.26}"
|
|
1420
|
+
},
|
|
1421
|
+
"30": {
|
|
1422
|
+
$type: "dimension",
|
|
1423
|
+
$value: "{_size.30}"
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1382
1426
|
};
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
const
|
|
1389
|
-
const
|
|
1390
|
-
const
|
|
1391
|
-
const
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1396
|
-
|
|
1397
|
-
...
|
|
1398
|
-
|
|
1399
|
-
...globalColors,
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
// src/tokens/create/generators/themes/theme.ts
|
|
1430
|
+
import * as R6 from "ramda";
|
|
1431
|
+
var generateTheme = (colors, themeName, borderRadius) => {
|
|
1432
|
+
const mainColorNames = Object.keys(colors.main);
|
|
1433
|
+
const supportColorNames = Object.keys(colors.support);
|
|
1434
|
+
const customColors = [...mainColorNames, "neutral", ...supportColorNames, ...baseColorNames];
|
|
1435
|
+
const themeColorTokens = Object.fromEntries(
|
|
1436
|
+
customColors.map((colorName) => [colorName, generateColorScaleTokens3(colorName, themeName)])
|
|
1437
|
+
);
|
|
1438
|
+
const { color: themeBaseFileColor, ...remainingThemeFile } = generateBase(themeName);
|
|
1439
|
+
const themeFile = {
|
|
1440
|
+
color: {
|
|
1441
|
+
...themeColorTokens,
|
|
1442
|
+
...themeBaseFileColor,
|
|
1400
1443
|
link: {
|
|
1401
|
-
visited:
|
|
1444
|
+
visited: {
|
|
1445
|
+
$type: "color",
|
|
1446
|
+
$value: `{${themeName}.link.visited}`
|
|
1447
|
+
}
|
|
1402
1448
|
},
|
|
1403
1449
|
focus: {
|
|
1404
|
-
inner: {
|
|
1450
|
+
"inner-color": {
|
|
1405
1451
|
$type: "color",
|
|
1406
|
-
$value:
|
|
1452
|
+
$value: `{${themeName}.focus.inner}`
|
|
1407
1453
|
},
|
|
1408
|
-
outer: {
|
|
1454
|
+
"outer-color": {
|
|
1409
1455
|
$type: "color",
|
|
1410
|
-
$value:
|
|
1456
|
+
$value: `{${themeName}.focus.outer}`
|
|
1411
1457
|
}
|
|
1412
1458
|
}
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
};
|
|
1416
|
-
|
|
1417
|
-
// src/tokens/create/generators/semantic.ts
|
|
1418
|
-
import * as R5 from "ramda";
|
|
1419
|
-
|
|
1420
|
-
// src/tokens/template/design-tokens/semantic/color.base.template.json with { type: 'json' }
|
|
1421
|
-
var color_base_template_default = {
|
|
1422
|
-
color: {
|
|
1423
|
-
focus: {
|
|
1424
|
-
inner: {
|
|
1425
|
-
$type: "color",
|
|
1426
|
-
$value: "{color.focus.inner-color}"
|
|
1427
|
-
},
|
|
1428
|
-
outer: {
|
|
1429
|
-
$type: "color",
|
|
1430
|
-
$value: "{color.focus.outer-color}"
|
|
1431
|
-
}
|
|
1432
|
-
}
|
|
1433
|
-
},
|
|
1434
|
-
link: {
|
|
1435
|
-
color: {
|
|
1436
|
-
visited: {
|
|
1437
|
-
$type: "color",
|
|
1438
|
-
$value: "{color.link.visited}"
|
|
1439
|
-
}
|
|
1440
|
-
}
|
|
1441
|
-
}
|
|
1442
|
-
};
|
|
1443
|
-
|
|
1444
|
-
// src/tokens/template/design-tokens/semantic/color.template.json with { type: 'json' }
|
|
1445
|
-
var color_template_default = {
|
|
1446
|
-
"background-default": {
|
|
1447
|
-
$type: "color",
|
|
1448
|
-
$value: "{color.<color>.1}"
|
|
1449
|
-
},
|
|
1450
|
-
"background-tinted": {
|
|
1451
|
-
$type: "color",
|
|
1452
|
-
$value: "{color.<color>.2}"
|
|
1453
|
-
},
|
|
1454
|
-
"surface-default": {
|
|
1455
|
-
$type: "color",
|
|
1456
|
-
$value: "{color.<color>.3}"
|
|
1457
|
-
},
|
|
1458
|
-
"surface-tinted": {
|
|
1459
|
-
$type: "color",
|
|
1460
|
-
$value: "{color.<color>.4}"
|
|
1461
|
-
},
|
|
1462
|
-
"surface-hover": {
|
|
1463
|
-
$type: "color",
|
|
1464
|
-
$value: "{color.<color>.5}"
|
|
1465
|
-
},
|
|
1466
|
-
"surface-active": {
|
|
1467
|
-
$type: "color",
|
|
1468
|
-
$value: "{color.<color>.6}"
|
|
1469
|
-
},
|
|
1470
|
-
"border-subtle": {
|
|
1471
|
-
$type: "color",
|
|
1472
|
-
$value: "{color.<color>.7}"
|
|
1473
|
-
},
|
|
1474
|
-
"border-default": {
|
|
1475
|
-
$type: "color",
|
|
1476
|
-
$value: "{color.<color>.8}"
|
|
1477
|
-
},
|
|
1478
|
-
"border-strong": {
|
|
1479
|
-
$type: "color",
|
|
1480
|
-
$value: "{color.<color>.9}"
|
|
1481
|
-
},
|
|
1482
|
-
"text-subtle": {
|
|
1483
|
-
$type: "color",
|
|
1484
|
-
$value: "{color.<color>.10}"
|
|
1485
|
-
},
|
|
1486
|
-
"text-default": {
|
|
1487
|
-
$type: "color",
|
|
1488
|
-
$value: "{color.<color>.11}"
|
|
1489
|
-
},
|
|
1490
|
-
"base-default": {
|
|
1491
|
-
$type: "color",
|
|
1492
|
-
$value: "{color.<color>.12}"
|
|
1493
|
-
},
|
|
1494
|
-
"base-hover": {
|
|
1495
|
-
$type: "color",
|
|
1496
|
-
$value: "{color.<color>.13}"
|
|
1497
|
-
},
|
|
1498
|
-
"base-active": {
|
|
1499
|
-
$type: "color",
|
|
1500
|
-
$value: "{color.<color>.14}"
|
|
1501
|
-
},
|
|
1502
|
-
"base-contrast-subtle": {
|
|
1503
|
-
$type: "color",
|
|
1504
|
-
$value: "{color.<color>.15}"
|
|
1505
|
-
},
|
|
1506
|
-
"base-contrast-default": {
|
|
1507
|
-
$type: "color",
|
|
1508
|
-
$value: "{color.<color>.16}"
|
|
1509
|
-
}
|
|
1510
|
-
};
|
|
1511
|
-
|
|
1512
|
-
// src/tokens/template/design-tokens/semantic/modes/color.template.json with { type: 'json' }
|
|
1513
|
-
var color_template_default2 = {
|
|
1514
|
-
"background-default": {
|
|
1515
|
-
$type: "color",
|
|
1516
|
-
$value: "{color.<color>.background-default}"
|
|
1517
|
-
},
|
|
1518
|
-
"background-tinted": {
|
|
1519
|
-
$type: "color",
|
|
1520
|
-
$value: "{color.<color>.background-tinted}"
|
|
1521
|
-
},
|
|
1522
|
-
"surface-default": {
|
|
1523
|
-
$type: "color",
|
|
1524
|
-
$value: "{color.<color>.surface-default}"
|
|
1525
|
-
},
|
|
1526
|
-
"surface-tinted": {
|
|
1527
|
-
$type: "color",
|
|
1528
|
-
$value: "{color.<color>.surface-tinted}"
|
|
1529
|
-
},
|
|
1530
|
-
"surface-hover": {
|
|
1531
|
-
$type: "color",
|
|
1532
|
-
$value: "{color.<color>.surface-hover}"
|
|
1533
|
-
},
|
|
1534
|
-
"surface-active": {
|
|
1535
|
-
$type: "color",
|
|
1536
|
-
$value: "{color.<color>.surface-active}"
|
|
1537
|
-
},
|
|
1538
|
-
"border-subtle": {
|
|
1539
|
-
$type: "color",
|
|
1540
|
-
$value: "{color.<color>.border-subtle}"
|
|
1541
|
-
},
|
|
1542
|
-
"border-default": {
|
|
1543
|
-
$type: "color",
|
|
1544
|
-
$value: "{color.<color>.border-default}"
|
|
1545
|
-
},
|
|
1546
|
-
"border-strong": {
|
|
1547
|
-
$type: "color",
|
|
1548
|
-
$value: "{color.<color>.border-strong}"
|
|
1549
|
-
},
|
|
1550
|
-
"text-subtle": {
|
|
1551
|
-
$type: "color",
|
|
1552
|
-
$value: "{color.<color>.text-subtle}"
|
|
1553
|
-
},
|
|
1554
|
-
"text-default": {
|
|
1555
|
-
$type: "color",
|
|
1556
|
-
$value: "{color.<color>.text-default}"
|
|
1557
|
-
},
|
|
1558
|
-
"base-default": {
|
|
1559
|
-
$type: "color",
|
|
1560
|
-
$value: "{color.<color>.base-default}"
|
|
1561
|
-
},
|
|
1562
|
-
"base-hover": {
|
|
1563
|
-
$type: "color",
|
|
1564
|
-
$value: "{color.<color>.base-hover}"
|
|
1565
|
-
},
|
|
1566
|
-
"base-active": {
|
|
1567
|
-
$type: "color",
|
|
1568
|
-
$value: "{color.<color>.base-active}"
|
|
1569
|
-
},
|
|
1570
|
-
"base-contrast-subtle": {
|
|
1571
|
-
$type: "color",
|
|
1572
|
-
$value: "{color.<color>.base-contrast-subtle}"
|
|
1573
|
-
},
|
|
1574
|
-
"base-contrast-default": {
|
|
1575
|
-
$type: "color",
|
|
1576
|
-
$value: "{color.<color>.base-contrast-default}"
|
|
1577
|
-
}
|
|
1578
|
-
};
|
|
1579
|
-
|
|
1580
|
-
// src/tokens/create/generators/semantic.ts
|
|
1581
|
-
var generateSemantic = (colors, _themeName) => {
|
|
1582
|
-
const mainColorNames = Object.keys(colors.main);
|
|
1583
|
-
const supportColorNames = Object.keys(colors.support);
|
|
1584
|
-
const modes = {
|
|
1585
|
-
"main-color": {},
|
|
1586
|
-
"support-color": {}
|
|
1459
|
+
},
|
|
1460
|
+
...remainingThemeFile
|
|
1587
1461
|
};
|
|
1588
|
-
const
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
color: {
|
|
1597
|
-
[category]: JSON.parse(
|
|
1598
|
-
JSON.stringify(
|
|
1599
|
-
color_template_default2,
|
|
1600
|
-
(key, value) => {
|
|
1601
|
-
if (key === "$value") {
|
|
1602
|
-
return value.replace("<color>", colorName);
|
|
1603
|
-
}
|
|
1604
|
-
return value;
|
|
1605
|
-
},
|
|
1606
|
-
2
|
|
1607
|
-
)
|
|
1608
|
-
)
|
|
1462
|
+
const baseBorderRadius = R6.lensPath(["border-radius", "base", "$value"]);
|
|
1463
|
+
const updatedThemeFile = R6.set(baseBorderRadius, String(borderRadius), themeFile);
|
|
1464
|
+
const token = JSON.parse(
|
|
1465
|
+
JSON.stringify(
|
|
1466
|
+
updatedThemeFile,
|
|
1467
|
+
(key, value) => {
|
|
1468
|
+
if (key === "$value") {
|
|
1469
|
+
return value.replace("<theme>", themeName);
|
|
1609
1470
|
}
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
const customColors = [...mainColorNames, "neutral", ...supportColorNames];
|
|
1615
|
-
const allColors = [...customColors, ...baseColorNames];
|
|
1616
|
-
const semanticColorTokens = allColors.map(
|
|
1617
|
-
(colorName) => [
|
|
1618
|
-
colorName,
|
|
1619
|
-
R5.map((x) => ({ ...x, $value: x.$value.replace("<color>", colorName) }), color_template_default)
|
|
1620
|
-
]
|
|
1471
|
+
return value;
|
|
1472
|
+
},
|
|
1473
|
+
2
|
|
1474
|
+
)
|
|
1621
1475
|
);
|
|
1622
|
-
|
|
1623
|
-
...color_base_template_default,
|
|
1624
|
-
color: {
|
|
1625
|
-
...Object.fromEntries(semanticColorTokens),
|
|
1626
|
-
...color_base_template_default.color
|
|
1627
|
-
}
|
|
1628
|
-
};
|
|
1629
|
-
return {
|
|
1630
|
-
modes,
|
|
1631
|
-
color
|
|
1632
|
-
};
|
|
1476
|
+
return token;
|
|
1633
1477
|
};
|
|
1634
|
-
|
|
1635
|
-
// src/tokens/create/generators/theme.ts
|
|
1636
|
-
import * as R6 from "ramda";
|
|
1637
|
-
|
|
1638
|
-
// src/tokens/template/design-tokens/themes/theme.base.template.json with { type: 'json' }
|
|
1639
|
-
var theme_base_template_default = {
|
|
1478
|
+
var generateBase = (themeName) => ({
|
|
1640
1479
|
color: {},
|
|
1641
1480
|
"font-family": {
|
|
1642
1481
|
$type: "fontFamilies",
|
|
1643
|
-
$value:
|
|
1482
|
+
$value: `{${themeName}.font-family}`
|
|
1644
1483
|
},
|
|
1645
1484
|
"font-weight": {
|
|
1646
1485
|
medium: {
|
|
1647
1486
|
$type: "fontWeights",
|
|
1648
|
-
$value:
|
|
1487
|
+
$value: `{${themeName}.font-weight.medium}`
|
|
1649
1488
|
},
|
|
1650
1489
|
semibold: {
|
|
1651
1490
|
$type: "fontWeights",
|
|
1652
|
-
$value:
|
|
1491
|
+
$value: `{${themeName}.font-weight.semibold}`
|
|
1653
1492
|
},
|
|
1654
1493
|
regular: {
|
|
1655
1494
|
$type: "fontWeights",
|
|
1656
|
-
$value:
|
|
1495
|
+
$value: `{${themeName}.font-weight.regular}`
|
|
1657
1496
|
}
|
|
1658
1497
|
},
|
|
1659
1498
|
"border-radius": {
|
|
@@ -1690,159 +1529,16 @@ var theme_base_template_default = {
|
|
|
1690
1529
|
$value: "4"
|
|
1691
1530
|
}
|
|
1692
1531
|
}
|
|
1693
|
-
};
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
"2": {
|
|
1702
|
-
$type: "color",
|
|
1703
|
-
$value: "{<theme>.<color>.2}"
|
|
1704
|
-
},
|
|
1705
|
-
"3": {
|
|
1706
|
-
$type: "color",
|
|
1707
|
-
$value: "{<theme>.<color>.3}"
|
|
1708
|
-
},
|
|
1709
|
-
"4": {
|
|
1710
|
-
$type: "color",
|
|
1711
|
-
$value: "{<theme>.<color>.4}"
|
|
1712
|
-
},
|
|
1713
|
-
"5": {
|
|
1714
|
-
$type: "color",
|
|
1715
|
-
$value: "{<theme>.<color>.5}"
|
|
1716
|
-
},
|
|
1717
|
-
"6": {
|
|
1718
|
-
$type: "color",
|
|
1719
|
-
$value: "{<theme>.<color>.6}"
|
|
1720
|
-
},
|
|
1721
|
-
"7": {
|
|
1722
|
-
$type: "color",
|
|
1723
|
-
$value: "{<theme>.<color>.7}"
|
|
1724
|
-
},
|
|
1725
|
-
"8": {
|
|
1726
|
-
$type: "color",
|
|
1727
|
-
$value: "{<theme>.<color>.8}"
|
|
1728
|
-
},
|
|
1729
|
-
"9": {
|
|
1730
|
-
$type: "color",
|
|
1731
|
-
$value: "{<theme>.<color>.9}"
|
|
1732
|
-
},
|
|
1733
|
-
"10": {
|
|
1734
|
-
$type: "color",
|
|
1735
|
-
$value: "{<theme>.<color>.10}"
|
|
1736
|
-
},
|
|
1737
|
-
"11": {
|
|
1738
|
-
$type: "color",
|
|
1739
|
-
$value: "{<theme>.<color>.11}"
|
|
1740
|
-
},
|
|
1741
|
-
"12": {
|
|
1742
|
-
$type: "color",
|
|
1743
|
-
$value: "{<theme>.<color>.12}"
|
|
1744
|
-
},
|
|
1745
|
-
"13": {
|
|
1746
|
-
$type: "color",
|
|
1747
|
-
$value: "{<theme>.<color>.13}"
|
|
1748
|
-
},
|
|
1749
|
-
"14": {
|
|
1750
|
-
$type: "color",
|
|
1751
|
-
$value: "{<theme>.<color>.14}"
|
|
1752
|
-
},
|
|
1753
|
-
"15": {
|
|
1754
|
-
$type: "color",
|
|
1755
|
-
$value: "{<theme>.<color>.15}"
|
|
1756
|
-
},
|
|
1757
|
-
"16": {
|
|
1758
|
-
$type: "color",
|
|
1759
|
-
$value: "{<theme>.<color>.16}"
|
|
1760
|
-
}
|
|
1761
|
-
};
|
|
1762
|
-
|
|
1763
|
-
// src/tokens/create/generators/theme.ts
|
|
1764
|
-
var generateTheme = (colors, themeName, borderRadius) => {
|
|
1765
|
-
const mainColorNames = Object.keys(colors.main);
|
|
1766
|
-
const supportColorNames = Object.keys(colors.support);
|
|
1767
|
-
const customColors = [...mainColorNames, "neutral", ...supportColorNames, ...baseColorNames];
|
|
1768
|
-
const themeColorTokens = Object.fromEntries(
|
|
1769
|
-
customColors.map(
|
|
1770
|
-
(colorName) => [
|
|
1771
|
-
colorName,
|
|
1772
|
-
R6.map((x) => ({ ...x, $value: x.$value.replace("<color>", colorName) }), theme_template_default)
|
|
1773
|
-
]
|
|
1774
|
-
)
|
|
1775
|
-
);
|
|
1776
|
-
const { color: themeBaseFileColor, ...remainingThemeFile } = theme_base_template_default;
|
|
1777
|
-
const themeFile = {
|
|
1778
|
-
color: {
|
|
1779
|
-
...themeColorTokens,
|
|
1780
|
-
...themeBaseFileColor,
|
|
1781
|
-
link: {
|
|
1782
|
-
visited: {
|
|
1783
|
-
$type: "color",
|
|
1784
|
-
$value: `{${themeName}.link.visited}`
|
|
1785
|
-
}
|
|
1786
|
-
},
|
|
1787
|
-
focus: {
|
|
1788
|
-
"inner-color": {
|
|
1789
|
-
$type: "color",
|
|
1790
|
-
$value: `{${themeName}.focus.inner}`
|
|
1791
|
-
},
|
|
1792
|
-
"outer-color": {
|
|
1793
|
-
$type: "color",
|
|
1794
|
-
$value: `{${themeName}.focus.outer}`
|
|
1795
|
-
}
|
|
1796
|
-
}
|
|
1797
|
-
},
|
|
1798
|
-
...remainingThemeFile
|
|
1799
|
-
};
|
|
1800
|
-
const baseBorderRadius = R6.lensPath(["border-radius", "base", "$value"]);
|
|
1801
|
-
const updatedThemeFile = R6.set(baseBorderRadius, String(borderRadius), themeFile);
|
|
1802
|
-
const token = JSON.parse(
|
|
1803
|
-
JSON.stringify(
|
|
1804
|
-
updatedThemeFile,
|
|
1805
|
-
(key, value) => {
|
|
1806
|
-
if (key === "$value") {
|
|
1807
|
-
return value.replace("<theme>", themeName);
|
|
1808
|
-
}
|
|
1809
|
-
return value;
|
|
1810
|
-
},
|
|
1811
|
-
2
|
|
1812
|
-
)
|
|
1813
|
-
);
|
|
1814
|
-
return token;
|
|
1815
|
-
};
|
|
1816
|
-
|
|
1817
|
-
// src/tokens/template/design-tokens/primitives/modes/typography/typography.template.json with { type: 'json' }
|
|
1818
|
-
var typography_template_default = {
|
|
1819
|
-
"<theme>": {
|
|
1820
|
-
"font-family": {
|
|
1821
|
-
$type: "fontFamilies",
|
|
1822
|
-
$value: "<font-family>"
|
|
1823
|
-
},
|
|
1824
|
-
"font-weight": {
|
|
1825
|
-
medium: {
|
|
1826
|
-
$type: "fontWeights",
|
|
1827
|
-
$value: "Medium"
|
|
1828
|
-
},
|
|
1829
|
-
semibold: {
|
|
1830
|
-
$type: "fontWeights",
|
|
1831
|
-
$value: "Semi bold"
|
|
1832
|
-
},
|
|
1833
|
-
regular: {
|
|
1834
|
-
$type: "fontWeights",
|
|
1835
|
-
$value: "Regular"
|
|
1836
|
-
}
|
|
1837
|
-
}
|
|
1532
|
+
});
|
|
1533
|
+
var generateColorScaleTokens3 = (colorName, themeName) => {
|
|
1534
|
+
const colorScale = {};
|
|
1535
|
+
for (const [_, colorNumber] of R6.toPairs(semanticColorMap)) {
|
|
1536
|
+
colorScale[colorNumber] = {
|
|
1537
|
+
$type: "color",
|
|
1538
|
+
$value: `{${themeName}.${colorName}.${colorNumber}}`
|
|
1539
|
+
};
|
|
1838
1540
|
}
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
// src/tokens/create/generators/typography.ts
|
|
1842
|
-
var generateTypography = (themeName, { fontFamily }) => {
|
|
1843
|
-
return JSON.parse(
|
|
1844
|
-
JSON.stringify(typography_template_default).replaceAll(/<font-family>/g, fontFamily).replaceAll(/<theme>/g, themeName)
|
|
1845
|
-
);
|
|
1541
|
+
return colorScale;
|
|
1846
1542
|
};
|
|
1847
1543
|
|
|
1848
1544
|
// src/tokens/create.ts
|
|
@@ -1862,20 +1558,17 @@ var cliOptions = {
|
|
|
1862
1558
|
borderRadius: "border-radius"
|
|
1863
1559
|
}
|
|
1864
1560
|
};
|
|
1865
|
-
var createTokens = async (
|
|
1866
|
-
const { colors, typography, name, borderRadius, overrides } =
|
|
1561
|
+
var createTokens = async (theme) => {
|
|
1562
|
+
const { colors, typography, name, borderRadius, overrides } = theme;
|
|
1867
1563
|
const colorSchemes = ["light", "dark"];
|
|
1868
|
-
const
|
|
1564
|
+
const sizeModes2 = ["small", "medium", "large"];
|
|
1869
1565
|
const tokenSets = new Map([
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
"primitives/modes/typography/size/small",
|
|
1877
|
-
"primitives/modes/typography/size/medium",
|
|
1878
|
-
"primitives/modes/typography/size/large"
|
|
1566
|
+
["primitives/globals", generateGlobals()],
|
|
1567
|
+
...sizeModes2.map((size) => [`primitives/modes/size/${size}`, generateSize(size)]),
|
|
1568
|
+
["primitives/modes/size/global", generateSizeGlobal()],
|
|
1569
|
+
...sizeModes2.map((size) => [
|
|
1570
|
+
`primitives/modes/typography/size/${size}`,
|
|
1571
|
+
generateFontSizes(size)
|
|
1879
1572
|
]),
|
|
1880
1573
|
[`primitives/modes/typography/primary/${name}`, generateTypography(name, typography)],
|
|
1881
1574
|
[`primitives/modes/typography/secondary/${name}`, generateTypography(name, typography)],
|
|
@@ -1883,12 +1576,12 @@ var createTokens = async (opts) => {
|
|
|
1883
1576
|
[`primitives/modes/color-scheme/${scheme}/${name}`, generateColorScheme(name, scheme, colors, overrides)]
|
|
1884
1577
|
]),
|
|
1885
1578
|
[`themes/${name}`, generateTheme(colors, name, borderRadius)],
|
|
1886
|
-
["semantic/color",
|
|
1579
|
+
["semantic/color", generateSemanticColors(colors, name)],
|
|
1887
1580
|
// maps out semantic modes, ieg 'semantic/modes/main-color/accent', and 'semantic/modes/support-color/brand1'
|
|
1888
|
-
...Object.entries(
|
|
1581
|
+
...Object.entries(generateColorModes(colors, name)).flatMap(
|
|
1889
1582
|
([mode, colors2]) => Object.entries(colors2).map(([key, colorSet]) => [`semantic/modes/${mode}/${key}`, colorSet])
|
|
1890
1583
|
),
|
|
1891
|
-
|
|
1584
|
+
[`semantic/style`, generateSemanticStyle()]
|
|
1892
1585
|
]);
|
|
1893
1586
|
return { tokenSets };
|
|
1894
1587
|
};
|