@digdir/designsystemet 0.1.0-alpha.9 → 0.1.0-next.21
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/designsystemet.js +34 -0
- package/dist/src/colors/colorUtils.js +242 -0
- package/dist/src/colors/index.js +3 -0
- package/dist/src/colors/themeUtils.js +245 -0
- package/dist/src/colors/types.js +0 -0
- package/dist/src/init/createTokensPackage.js +250 -0
- package/dist/src/init/generateMetadataJson.js +19 -0
- package/dist/src/init/generateThemesJson.js +52 -0
- package/dist/src/init/index.js +10 -0
- package/dist/src/init/nextStepsMarkdown.js +92 -0
- package/dist/src/init/template/default-files/README.md +10 -0
- package/dist/src/init/template/default-files/design-tokens/README.md +3 -0
- package/dist/src/init/template/default-files/design-tokens/primitives/globals.json +197 -0
- package/dist/src/init/template/default-files/design-tokens/primitives/typography/default.json +86 -0
- package/dist/src/init/template/default-files/design-tokens/semantic/color.json +562 -0
- package/dist/src/init/template/default-files/design-tokens/semantic/style.json +543 -0
- package/dist/src/init/template/prettier.config.js +5 -0
- package/dist/src/init/template/template-files/design-tokens/primitives/colors/contrast/global.json +376 -0
- package/dist/src/init/template/template-files/design-tokens/primitives/colors/contrast/theme-template.json +314 -0
- package/dist/src/init/template/template-files/design-tokens/primitives/colors/dark/global.json +376 -0
- package/dist/src/init/template/template-files/design-tokens/primitives/colors/dark/theme-template.json +314 -0
- package/dist/src/init/template/template-files/design-tokens/primitives/colors/light/global.json +376 -0
- package/dist/src/init/template/template-files/design-tokens/primitives/colors/light/theme-template.json +314 -0
- package/dist/src/init/template/template-files/design-tokens/themes/theme-template.json +314 -0
- package/dist/src/init/template/template-files/package.json +24 -0
- package/dist/src/init/utils.js +15 -0
- package/dist/src/migrations/beta-to-v1.js +344 -0
- package/dist/src/migrations/codemods/css/plugins.js +47 -0
- package/dist/src/migrations/codemods/css/run.js +19 -0
- package/dist/src/migrations/codemods/jsx/classname-prefix.js +63 -0
- package/dist/src/migrations/codemods/jsx/run.js +22 -0
- package/dist/src/migrations/index.js +9 -0
- package/dist/src/migrations/react-beta-to-v1.js +5 -0
- package/dist/src/tokens/actions.js +33 -0
- package/dist/src/tokens/build.js +74 -0
- package/dist/src/tokens/configs.js +223 -0
- package/dist/src/tokens/formats/css.js +170 -0
- package/dist/src/tokens/formats/js-tokens.js +31 -0
- package/dist/src/tokens/transformers.js +47 -0
- package/dist/src/tokens/utils/noCase.js +24 -0
- package/dist/src/tokens/utils/permutateThemes.js +64 -0
- package/dist/src/tokens/utils/utils.js +14 -0
- package/package.json +21 -13
- package/LICENSE +0 -7
- package/dist/build/bin/designsystemet.js +0 -50
- package/dist/build/src/colors/colorUtils.js +0 -314
- package/dist/build/src/colors/index.js +0 -3
- package/dist/build/src/colors/themeUtils.js +0 -290
- package/dist/build/src/colors/types.js +0 -1
- package/dist/build/src/migrations/beta-to-v1.js +0 -341
- package/dist/build/src/migrations/codemods/css/plugins.js +0 -45
- package/dist/build/src/migrations/codemods/css/run.js +0 -17
- package/dist/build/src/migrations/codemods/jsx/classname-prefix.js +0 -80
- package/dist/build/src/migrations/codemods/jsx/run.js +0 -19
- package/dist/build/src/migrations/index.js +0 -6
- package/dist/build/src/migrations/react-beta-to-v1.js +0 -2
- package/dist/build/src/test/jsx-test.js +0 -10
- package/dist/build/src/tokens/actions.js +0 -20
- package/dist/build/src/tokens/build.js +0 -63
- package/dist/build/src/tokens/configs.js +0 -229
- package/dist/build/src/tokens/formats/css-classes.js +0 -50
- package/dist/build/src/tokens/formats/css-variables.js +0 -39
- package/dist/build/src/tokens/formats/js-tokens.js +0 -29
- package/dist/build/src/tokens/transformers.js +0 -42
- package/dist/build/src/tokens/utils/noCase.js +0 -30
- package/dist/build/src/tokens/utils/permutateThemes.js +0 -56
- package/dist/build/src/tokens/utils/utils.js +0 -21
- package/dist/build/tsconfig.tsbuildinfo +0 -1
- package/dist/types/bin/designsystemet.d.ts +0 -3
- package/dist/types/bin/designsystemet.d.ts.map +0 -1
- package/dist/types/src/colors/colorUtils.d.ts +0 -118
- package/dist/types/src/colors/colorUtils.d.ts.map +0 -1
- package/dist/types/src/colors/index.d.ts +0 -4
- package/dist/types/src/colors/index.d.ts.map +0 -1
- package/dist/types/src/colors/themeUtils.d.ts +0 -101
- package/dist/types/src/colors/themeUtils.d.ts.map +0 -1
- package/dist/types/src/colors/types.d.ts +0 -16
- package/dist/types/src/colors/types.d.ts.map +0 -1
- package/dist/types/src/migrations/beta-to-v1.d.ts +0 -3
- package/dist/types/src/migrations/beta-to-v1.d.ts.map +0 -1
- package/dist/types/src/migrations/codemods/css/plugins.d.ts +0 -6
- package/dist/types/src/migrations/codemods/css/plugins.d.ts.map +0 -1
- package/dist/types/src/migrations/codemods/css/run.d.ts +0 -8
- package/dist/types/src/migrations/codemods/css/run.d.ts.map +0 -1
- package/dist/types/src/migrations/codemods/jsx/classname-prefix.d.ts +0 -10
- package/dist/types/src/migrations/codemods/jsx/classname-prefix.d.ts.map +0 -1
- package/dist/types/src/migrations/codemods/jsx/run.d.ts +0 -7
- package/dist/types/src/migrations/codemods/jsx/run.d.ts.map +0 -1
- package/dist/types/src/migrations/index.d.ts +0 -6
- package/dist/types/src/migrations/index.d.ts.map +0 -1
- package/dist/types/src/migrations/react-beta-to-v1.d.ts +0 -3
- package/dist/types/src/migrations/react-beta-to-v1.d.ts.map +0 -1
- package/dist/types/src/test/jsx-test.d.ts +0 -4
- package/dist/types/src/test/jsx-test.d.ts.map +0 -1
- package/dist/types/src/tokens/actions.d.ts +0 -3
- package/dist/types/src/tokens/actions.d.ts.map +0 -1
- package/dist/types/src/tokens/build.d.ts +0 -11
- package/dist/types/src/tokens/build.d.ts.map +0 -1
- package/dist/types/src/tokens/configs.d.ts +0 -23
- package/dist/types/src/tokens/configs.d.ts.map +0 -1
- package/dist/types/src/tokens/formats/css-classes.d.ts +0 -6
- package/dist/types/src/tokens/formats/css-classes.d.ts.map +0 -1
- package/dist/types/src/tokens/formats/css-variables.d.ts +0 -3
- package/dist/types/src/tokens/formats/css-variables.d.ts.map +0 -1
- package/dist/types/src/tokens/formats/js-tokens.d.ts +0 -6
- package/dist/types/src/tokens/formats/js-tokens.d.ts.map +0 -1
- package/dist/types/src/tokens/transformers.d.ts +0 -5
- package/dist/types/src/tokens/transformers.d.ts.map +0 -1
- package/dist/types/src/tokens/utils/noCase.d.ts +0 -11
- package/dist/types/src/tokens/utils/noCase.d.ts.map +0 -1
- package/dist/types/src/tokens/utils/permutateThemes.d.ts +0 -7
- package/dist/types/src/tokens/utils/permutateThemes.d.ts.map +0 -1
- package/dist/types/src/tokens/utils/utils.d.ts +0 -17
- package/dist/types/src/tokens/utils/utils.d.ts.map +0 -1
|
@@ -0,0 +1,314 @@
|
|
|
1
|
+
{
|
|
2
|
+
"color": {
|
|
3
|
+
"accent": {
|
|
4
|
+
"1": {
|
|
5
|
+
"type": "color",
|
|
6
|
+
"value": "{<theme>.accent.1}"
|
|
7
|
+
},
|
|
8
|
+
"2": {
|
|
9
|
+
"type": "color",
|
|
10
|
+
"value": "{<theme>.accent.2}"
|
|
11
|
+
},
|
|
12
|
+
"3": {
|
|
13
|
+
"type": "color",
|
|
14
|
+
"value": "{<theme>.accent.3}"
|
|
15
|
+
},
|
|
16
|
+
"4": {
|
|
17
|
+
"type": "color",
|
|
18
|
+
"value": "{<theme>.accent.4}"
|
|
19
|
+
},
|
|
20
|
+
"5": {
|
|
21
|
+
"type": "color",
|
|
22
|
+
"value": "{<theme>.accent.5}"
|
|
23
|
+
},
|
|
24
|
+
"6": {
|
|
25
|
+
"type": "color",
|
|
26
|
+
"value": "{<theme>.accent.6}"
|
|
27
|
+
},
|
|
28
|
+
"7": {
|
|
29
|
+
"type": "color",
|
|
30
|
+
"value": "{<theme>.accent.7}"
|
|
31
|
+
},
|
|
32
|
+
"8": {
|
|
33
|
+
"type": "color",
|
|
34
|
+
"value": "{<theme>.accent.8}"
|
|
35
|
+
},
|
|
36
|
+
"9": {
|
|
37
|
+
"type": "color",
|
|
38
|
+
"value": "{<theme>.accent.9}"
|
|
39
|
+
},
|
|
40
|
+
"10": {
|
|
41
|
+
"type": "color",
|
|
42
|
+
"value": "{<theme>.accent.10}"
|
|
43
|
+
},
|
|
44
|
+
"11": {
|
|
45
|
+
"type": "color",
|
|
46
|
+
"value": "{<theme>.accent.11}"
|
|
47
|
+
},
|
|
48
|
+
"12": {
|
|
49
|
+
"type": "color",
|
|
50
|
+
"value": "{<theme>.accent.12}"
|
|
51
|
+
},
|
|
52
|
+
"13": {
|
|
53
|
+
"type": "color",
|
|
54
|
+
"value": "{<theme>.accent.13}"
|
|
55
|
+
},
|
|
56
|
+
"contrast-1": {
|
|
57
|
+
"type": "color",
|
|
58
|
+
"value": "{<theme>.accent.contrast-1}"
|
|
59
|
+
},
|
|
60
|
+
"contrast-2": {
|
|
61
|
+
"type": "color",
|
|
62
|
+
"value": "{<theme>.accent.contrast-2}"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"neutral": {
|
|
66
|
+
"1": {
|
|
67
|
+
"type": "color",
|
|
68
|
+
"value": "{<theme>.neutral.1}"
|
|
69
|
+
},
|
|
70
|
+
"2": {
|
|
71
|
+
"type": "color",
|
|
72
|
+
"value": "{<theme>.neutral.2}"
|
|
73
|
+
},
|
|
74
|
+
"3": {
|
|
75
|
+
"type": "color",
|
|
76
|
+
"value": "{<theme>.neutral.3}"
|
|
77
|
+
},
|
|
78
|
+
"4": {
|
|
79
|
+
"type": "color",
|
|
80
|
+
"value": "{<theme>.neutral.4}"
|
|
81
|
+
},
|
|
82
|
+
"5": {
|
|
83
|
+
"type": "color",
|
|
84
|
+
"value": "{<theme>.neutral.5}"
|
|
85
|
+
},
|
|
86
|
+
"6": {
|
|
87
|
+
"type": "color",
|
|
88
|
+
"value": "{<theme>.neutral.6}"
|
|
89
|
+
},
|
|
90
|
+
"7": {
|
|
91
|
+
"type": "color",
|
|
92
|
+
"value": "{<theme>.neutral.7}"
|
|
93
|
+
},
|
|
94
|
+
"8": {
|
|
95
|
+
"type": "color",
|
|
96
|
+
"value": "{<theme>.neutral.8}"
|
|
97
|
+
},
|
|
98
|
+
"9": {
|
|
99
|
+
"type": "color",
|
|
100
|
+
"value": "{<theme>.neutral.9}"
|
|
101
|
+
},
|
|
102
|
+
"10": {
|
|
103
|
+
"type": "color",
|
|
104
|
+
"value": "{<theme>.neutral.10}"
|
|
105
|
+
},
|
|
106
|
+
"11": {
|
|
107
|
+
"type": "color",
|
|
108
|
+
"value": "{<theme>.neutral.11}"
|
|
109
|
+
},
|
|
110
|
+
"12": {
|
|
111
|
+
"type": "color",
|
|
112
|
+
"value": "{<theme>.neutral.12}"
|
|
113
|
+
},
|
|
114
|
+
"13": {
|
|
115
|
+
"type": "color",
|
|
116
|
+
"value": "{<theme>.neutral.13}"
|
|
117
|
+
},
|
|
118
|
+
"contrast-1": {
|
|
119
|
+
"type": "color",
|
|
120
|
+
"value": "{<theme>.neutral.contrast-1}"
|
|
121
|
+
},
|
|
122
|
+
"contrast-2": {
|
|
123
|
+
"type": "color",
|
|
124
|
+
"value": "{<theme>.neutral.contrast-2}"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"brand1": {
|
|
128
|
+
"1": {
|
|
129
|
+
"type": "color",
|
|
130
|
+
"value": "{<theme>.brand1.1}"
|
|
131
|
+
},
|
|
132
|
+
"2": {
|
|
133
|
+
"type": "color",
|
|
134
|
+
"value": "{<theme>.brand1.2}"
|
|
135
|
+
},
|
|
136
|
+
"3": {
|
|
137
|
+
"type": "color",
|
|
138
|
+
"value": "{<theme>.brand1.3}"
|
|
139
|
+
},
|
|
140
|
+
"4": {
|
|
141
|
+
"type": "color",
|
|
142
|
+
"value": "{<theme>.brand1.4}"
|
|
143
|
+
},
|
|
144
|
+
"5": {
|
|
145
|
+
"type": "color",
|
|
146
|
+
"value": "{<theme>.brand1.5}"
|
|
147
|
+
},
|
|
148
|
+
"6": {
|
|
149
|
+
"type": "color",
|
|
150
|
+
"value": "{<theme>.brand1.6}"
|
|
151
|
+
},
|
|
152
|
+
"7": {
|
|
153
|
+
"type": "color",
|
|
154
|
+
"value": "{<theme>.brand1.7}"
|
|
155
|
+
},
|
|
156
|
+
"8": {
|
|
157
|
+
"type": "color",
|
|
158
|
+
"value": "{<theme>.brand1.8}"
|
|
159
|
+
},
|
|
160
|
+
"9": {
|
|
161
|
+
"type": "color",
|
|
162
|
+
"value": "{<theme>.brand1.9}"
|
|
163
|
+
},
|
|
164
|
+
"10": {
|
|
165
|
+
"type": "color",
|
|
166
|
+
"value": "{<theme>.brand1.10}"
|
|
167
|
+
},
|
|
168
|
+
"11": {
|
|
169
|
+
"type": "color",
|
|
170
|
+
"value": "{<theme>.brand1.11}"
|
|
171
|
+
},
|
|
172
|
+
"12": {
|
|
173
|
+
"type": "color",
|
|
174
|
+
"value": "{<theme>.brand1.12}"
|
|
175
|
+
},
|
|
176
|
+
"13": {
|
|
177
|
+
"type": "color",
|
|
178
|
+
"value": "{<theme>.brand1.13}"
|
|
179
|
+
},
|
|
180
|
+
"contrast-1": {
|
|
181
|
+
"type": "color",
|
|
182
|
+
"value": "{<theme>.brand1.contrast-1}"
|
|
183
|
+
},
|
|
184
|
+
"contrast-2": {
|
|
185
|
+
"type": "color",
|
|
186
|
+
"value": "{<theme>.brand1.contrast-2}"
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"brand2": {
|
|
190
|
+
"1": {
|
|
191
|
+
"type": "color",
|
|
192
|
+
"value": "{<theme>.brand2.1}"
|
|
193
|
+
},
|
|
194
|
+
"2": {
|
|
195
|
+
"type": "color",
|
|
196
|
+
"value": "{<theme>.brand2.2}"
|
|
197
|
+
},
|
|
198
|
+
"3": {
|
|
199
|
+
"type": "color",
|
|
200
|
+
"value": "{<theme>.brand2.3}"
|
|
201
|
+
},
|
|
202
|
+
"4": {
|
|
203
|
+
"type": "color",
|
|
204
|
+
"value": "{<theme>.brand2.4}"
|
|
205
|
+
},
|
|
206
|
+
"5": {
|
|
207
|
+
"type": "color",
|
|
208
|
+
"value": "{<theme>.brand2.5}"
|
|
209
|
+
},
|
|
210
|
+
"6": {
|
|
211
|
+
"type": "color",
|
|
212
|
+
"value": "{<theme>.brand2.6}"
|
|
213
|
+
},
|
|
214
|
+
"7": {
|
|
215
|
+
"type": "color",
|
|
216
|
+
"value": "{<theme>.brand2.7}"
|
|
217
|
+
},
|
|
218
|
+
"8": {
|
|
219
|
+
"type": "color",
|
|
220
|
+
"value": "{<theme>.brand2.8}"
|
|
221
|
+
},
|
|
222
|
+
"9": {
|
|
223
|
+
"type": "color",
|
|
224
|
+
"value": "{<theme>.brand2.9}"
|
|
225
|
+
},
|
|
226
|
+
"10": {
|
|
227
|
+
"type": "color",
|
|
228
|
+
"value": "{<theme>.brand2.10}"
|
|
229
|
+
},
|
|
230
|
+
"11": {
|
|
231
|
+
"type": "color",
|
|
232
|
+
"value": "{<theme>.brand2.11}"
|
|
233
|
+
},
|
|
234
|
+
"12": {
|
|
235
|
+
"type": "color",
|
|
236
|
+
"value": "{<theme>.brand2.12}"
|
|
237
|
+
},
|
|
238
|
+
"13": {
|
|
239
|
+
"type": "color",
|
|
240
|
+
"value": "{<theme>.brand2.13}"
|
|
241
|
+
},
|
|
242
|
+
"contrast-1": {
|
|
243
|
+
"type": "color",
|
|
244
|
+
"value": "{<theme>.brand2.contrast-1}"
|
|
245
|
+
},
|
|
246
|
+
"contrast-2": {
|
|
247
|
+
"type": "color",
|
|
248
|
+
"value": "{<theme>.brand2.contrast-2}"
|
|
249
|
+
}
|
|
250
|
+
},
|
|
251
|
+
"brand3": {
|
|
252
|
+
"1": {
|
|
253
|
+
"type": "color",
|
|
254
|
+
"value": "{<theme>.brand3.1}"
|
|
255
|
+
},
|
|
256
|
+
"2": {
|
|
257
|
+
"type": "color",
|
|
258
|
+
"value": "{<theme>.brand3.2}"
|
|
259
|
+
},
|
|
260
|
+
"3": {
|
|
261
|
+
"type": "color",
|
|
262
|
+
"value": "{<theme>.brand3.3}"
|
|
263
|
+
},
|
|
264
|
+
"4": {
|
|
265
|
+
"type": "color",
|
|
266
|
+
"value": "{<theme>.brand3.4}"
|
|
267
|
+
},
|
|
268
|
+
"5": {
|
|
269
|
+
"type": "color",
|
|
270
|
+
"value": "{<theme>.brand3.5}"
|
|
271
|
+
},
|
|
272
|
+
"6": {
|
|
273
|
+
"type": "color",
|
|
274
|
+
"value": "{<theme>.brand3.6}"
|
|
275
|
+
},
|
|
276
|
+
"7": {
|
|
277
|
+
"type": "color",
|
|
278
|
+
"value": "{<theme>.brand3.7}"
|
|
279
|
+
},
|
|
280
|
+
"8": {
|
|
281
|
+
"type": "color",
|
|
282
|
+
"value": "{<theme>.brand3.8}"
|
|
283
|
+
},
|
|
284
|
+
"9": {
|
|
285
|
+
"type": "color",
|
|
286
|
+
"value": "{<theme>.brand3.9}"
|
|
287
|
+
},
|
|
288
|
+
"10": {
|
|
289
|
+
"type": "color",
|
|
290
|
+
"value": "{<theme>.brand3.10}"
|
|
291
|
+
},
|
|
292
|
+
"11": {
|
|
293
|
+
"type": "color",
|
|
294
|
+
"value": "{<theme>.brand3.11}"
|
|
295
|
+
},
|
|
296
|
+
"12": {
|
|
297
|
+
"type": "color",
|
|
298
|
+
"value": "{<theme>.brand3.12}"
|
|
299
|
+
},
|
|
300
|
+
"13": {
|
|
301
|
+
"type": "color",
|
|
302
|
+
"value": "{<theme>.brand3.13}"
|
|
303
|
+
},
|
|
304
|
+
"contrast-1": {
|
|
305
|
+
"type": "color",
|
|
306
|
+
"value": "{<theme>.brand3.contrast-1}"
|
|
307
|
+
},
|
|
308
|
+
"contrast-2": {
|
|
309
|
+
"type": "color",
|
|
310
|
+
"value": "{<theme>.brand3.contrast-2}"
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "package-name-here",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CSS variables for @digdir/designsystemet",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/<default-theme>",
|
|
7
|
+
"files": [
|
|
8
|
+
"dist"
|
|
9
|
+
],
|
|
10
|
+
"exports": {
|
|
11
|
+
".": "./dist/<default-theme>",
|
|
12
|
+
"./*": "./dist/*"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "npm run clean && designsystemet tokens -o ./dist",
|
|
16
|
+
"clean": "rimraf dist"
|
|
17
|
+
},
|
|
18
|
+
"author": "",
|
|
19
|
+
"license": "ISC",
|
|
20
|
+
"devDependencies": {
|
|
21
|
+
"@digdir/designsystemet": "^0.1.0-alpha.7",
|
|
22
|
+
"rimraf": "^5.0.7"
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { kebabCase } from "change-case";
|
|
2
|
+
function normalizeTokenSetName(name) {
|
|
3
|
+
return kebabCase(name);
|
|
4
|
+
}
|
|
5
|
+
function toGeneratedCssFileName(name) {
|
|
6
|
+
return `${name.toLowerCase()}.css`;
|
|
7
|
+
}
|
|
8
|
+
function toValidPackageName(projectName) {
|
|
9
|
+
return projectName.trim().toLowerCase().replace(/\s+/g, "-").replace(/^[._]/, "").replace(/[^a-z\d\-~]+/g, "-");
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
normalizeTokenSetName,
|
|
13
|
+
toGeneratedCssFileName,
|
|
14
|
+
toValidPackageName
|
|
15
|
+
};
|