@aarhus-university/au-designsystem-delphinus 0.24.1 → 0.25.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.
Files changed (50) hide show
  1. package/Gruntfile.js +204 -4
  2. package/build/figma-tokens/breakpoint-styles.json +908 -0
  3. package/build/figma-tokens/color-themes.json +2653 -0
  4. package/build/figma-tokens/design-file.json +1378 -0
  5. package/build/figma-tokens/design-system.json +4652 -0
  6. package/build/projects/bachelor-applications/style.css +1 -1
  7. package/build/projects/bachelor-applications/style.css.map +1 -1
  8. package/build/projects/brightspace/style.css +1 -1
  9. package/build/projects/brightspace/style.css.map +1 -1
  10. package/build/projects/medarbejdere/style.css +1 -1
  11. package/build/projects/medarbejdere/style.css.map +1 -1
  12. package/build/projects/mitstudie/style.css +1 -1
  13. package/build/projects/mitstudie/style.css.map +1 -1
  14. package/build/projects/typo3/style.css +1 -1
  15. package/build/projects/typo3/style.css.map +1 -1
  16. package/build/style.css +1 -1
  17. package/build/style.css.map +3 -2
  18. package/package.json +3 -1
  19. package/source/atoms/_atoms-settings.scss +9 -3
  20. package/source/atoms/fonts/_fonts.scss +15 -13
  21. package/source/atoms/spacing/_spacing.scss +15 -13
  22. package/source/figma-tokens/blurs-default.json +11 -0
  23. package/source/figma-tokens/borders-default.json +98 -0
  24. package/source/figma-tokens/borders-nav-item-theme.json +124 -0
  25. package/source/figma-tokens/borders-nav-item.json +46 -0
  26. package/source/figma-tokens/borders-theme.json +98 -0
  27. package/source/figma-tokens/borders-widths.json +41 -0
  28. package/source/figma-tokens/colors-all.json +404 -0
  29. package/source/figma-tokens/cssvars/figma-tokens.scss +182 -0
  30. package/source/figma-tokens/shadows-default.json +136 -0
  31. package/source/{figma/figmatokens-wide.json → figma-tokens/sizes-default.json} +21 -21
  32. package/source/figma-tokens/sizing.json +129 -0
  33. package/source/figma-tokens/spacing.json +212 -0
  34. package/{build/figma/figmatokens-wide.json → source/figma-tokens/styles/breakpoint.json} +21 -21
  35. package/source/{figma/figmatokens-turquoise.json → figma-tokens/styles/theme.json} +41 -203
  36. package/source/figma-tokens/typography-fonts.json +78 -0
  37. package/source/figma-tokens/typography-line-widths.json +28 -0
  38. package/source/figma-tokens/typography-styles.json +620 -0
  39. package/source/js/components/modal-view.js +8 -6
  40. package/source/markup/components/stepper.pug +48 -0
  41. package/source/markup/partials/mixins/_stepper.pug +7 -0
  42. package/source/markup/partials/mixins-demo/_nav-components.pug +1 -0
  43. package/source/style/base/_forms.scss +6 -0
  44. package/source/style/module/_stepper.scss +190 -0
  45. package/source/style.scss +1 -0
  46. package/build/figma/figmatokens-all.json +0 -2157
  47. package/build/figma/figmatokens-global.json +0 -1698
  48. package/build/figma/figmatokens-turquoise.json +0 -364
  49. package/source/figma/figmatokens-all.json +0 -2157
  50. package/source/figma/figmatokens-global.json +0 -1698
package/Gruntfile.js CHANGED
@@ -6,6 +6,7 @@ module.exports = (grunt) => {
6
6
  // configure the tasks
7
7
  grunt.initConfig({
8
8
  pkg: grunt.file.readJSON('package.json'),
9
+
9
10
  // clean the build directory
10
11
  clean: {
11
12
  prebuild: {
@@ -14,6 +15,12 @@ module.exports = (grunt) => {
14
15
  postbuild: {
15
16
  src: ['build/**/_*.html'],
16
17
  },
18
+ figmatokens: {
19
+ src: ['build/figma-tokens', 'bin']
20
+ },
21
+ bin: {
22
+ src: ['bin']
23
+ }
17
24
  },
18
25
  cleanempty: {
19
26
  options: {},
@@ -28,6 +35,7 @@ module.exports = (grunt) => {
28
35
  '!**/*.scss',
29
36
  '!**/*.pug',
30
37
  '!**/*.js',
38
+ '!figma-tokens/**/*.json',
31
39
  'js/3rdparty/**/*.js',
32
40
  'projects/**/*.js',
33
41
  '.htaccess',
@@ -35,10 +43,40 @@ module.exports = (grunt) => {
35
43
  dest: 'build',
36
44
  expand: true,
37
45
  },
46
+ figmastyles: {
47
+ options: {
48
+ flatten: true
49
+ },
50
+ files: {
51
+ //the breakpoints
52
+ 'bin/pre/breakpoint/01_medium.json' : 'source/figma-tokens/styles/breakpoint.json',
53
+ 'bin/pre/breakpoint/02_wide.json' : 'source/figma-tokens/styles/breakpoint.json',
54
+ //the color colorthemes
55
+ 'bin/pre/theme/01_cyan.json' : 'source/figma-tokens/styles/theme.json',
56
+ 'bin/pre/theme/02_turquoise.json' : 'source/figma-tokens/styles/theme.json',
57
+ 'bin/pre/theme/03_green.json' : 'source/figma-tokens/styles/theme.json',
58
+ 'bin/pre/theme/04_yellow.json' : 'source/figma-tokens/styles/theme.json',
59
+ 'bin/pre/theme/05_orange.json' : 'source/figma-tokens/styles/theme.json',
60
+ 'bin/pre/theme/06_red.json' : 'source/figma-tokens/styles/theme.json',
61
+ 'bin/pre/theme/07_magenta.json' : 'source/figma-tokens/styles/theme.json',
62
+ 'bin/pre/theme/08_purple.json' : 'source/figma-tokens/styles/theme.json',
63
+ 'bin/pre/theme/09_blue.json' : 'source/figma-tokens/styles/theme.json',
64
+ 'bin/pre/theme/21_mitstudie.json' : 'source/figma-tokens/styles/theme.json',
65
+ 'bin/pre/theme/22_omnibus.json' : 'source/figma-tokens/styles/theme.json',
66
+ 'bin/pre/theme/23_brightspace.json' : 'source/figma-tokens/styles/theme.json',
67
+ },
68
+ },
69
+ figmatokens: {
70
+ cwd: 'source',
71
+ src: 'figma-tokens/*.json',
72
+ dest: 'bin/pre',
73
+ expand: true,
74
+ flatten: true,
75
+ }
38
76
  },
39
77
  watch: {
40
78
  sass: {
41
- files: ['source/**/*.scss'],
79
+ files: ['source/**/*.scss', '!source/figma-tokens/**/*.scss'],
42
80
  tasks: ['sass', 'cleanempty'],
43
81
  },
44
82
  pug: {
@@ -46,7 +84,7 @@ module.exports = (grunt) => {
46
84
  tasks: ['pug', 'cleanempty'],
47
85
  },
48
86
  copy: {
49
- files: ['source/**', '!source/**/*.scss', '!source/**/*.pug'],
87
+ files: ['source/**', '!source/**/*.scss', '!source/**/*.pug', '!source/figma-tokens/**/*.json'],
50
88
  tasks: ['copy', 'cleanempty'],
51
89
  },
52
90
  webpack: {
@@ -115,6 +153,18 @@ module.exports = (grunt) => {
115
153
  },
116
154
  ],
117
155
  },
156
+ figmatokens: {
157
+ files: [
158
+ {
159
+ expand: true,
160
+ cwd: 'source',
161
+ src: ['figma-tokens/**/*.scss'],
162
+ dest: 'bin/pre/cssvars',
163
+ ext: '.css',
164
+ flatten: true,
165
+ },
166
+ ],
167
+ },
118
168
  },
119
169
  connect: {
120
170
  server: {
@@ -180,6 +230,141 @@ module.exports = (grunt) => {
180
230
  progress: true,
181
231
  },
182
232
  },
233
+ 'merge-json': {
234
+ breakpoints: {
235
+ src: ['bin/pre/breakpoint/*.json'],
236
+ dest: 'bin/pre/sizes-breakpoints.json'
237
+ },
238
+ themes: {
239
+ src: ['bin/pre/theme/*.json'],
240
+ dest: 'bin/pre/colors-themes.json'
241
+ },
242
+ designsystem: {
243
+ src: [
244
+ 'bin/figma-tokens/colors-all.json',
245
+ 'bin/figma-tokens/colors-themes.json',
246
+ 'bin/figma-tokens/sizes-default.json',
247
+ 'bin/figma-tokens/sizes-breakpoints.json',
248
+ 'bin/figma-tokens/sizing.json',
249
+ 'bin/figma-tokens/spacing.json',
250
+ 'bin/figma-tokens/shadows-default.json',
251
+ 'bin/figma-tokens/blurs-default.json',
252
+ 'bin/figma-tokens/typography-fonts.json',
253
+ 'bin/figma-tokens/typography-line-widths.json',
254
+ 'bin/figma-tokens/typography-styles.json',
255
+ 'bin/figma-tokens/borders-widths.json',
256
+ 'bin/figma-tokens/borders-default.json',
257
+ 'bin/figma-tokens/borders-theme.json',
258
+ 'bin/figma-tokens/borders-nav-item.json',
259
+ 'bin/figma-tokens/borders-nav-item-theme.json',
260
+ ],
261
+ dest: 'build/figma-tokens/design-system.json'
262
+ },
263
+ designfile: {
264
+ src: [
265
+ 'bin/figma-tokens/sizes-default.json',
266
+ 'bin/figma-tokens/sizes-breakpoints.json',
267
+ 'bin/figma-tokens/sizing.json',
268
+ 'bin/figma-tokens/spacing.json',
269
+ 'bin/figma-tokens/blurs-default.json',
270
+ 'bin/figma-tokens/typography-fonts.json',
271
+ 'bin/figma-tokens/typography-line-widths.json',
272
+ 'bin/figma-tokens/typography-styles.json',
273
+ 'bin/figma-tokens/borders-widths.json',
274
+ ],
275
+ dest: 'build/figma-tokens/design-file.json'
276
+ },
277
+ colorthemes: {
278
+ src: [
279
+ 'bin/figma-tokens/borders-widths.json',
280
+ 'bin/figma-tokens/borders-theme.json',
281
+ 'bin/figma-tokens/borders-nav-item-theme.json',
282
+ 'bin/figma-tokens/colors-themes.json',
283
+ ],
284
+ dest: 'build/figma-tokens/color-themes.json'
285
+ },
286
+ breakpointstyles: {
287
+ src: [
288
+ 'bin/figma-tokens/typography-fonts.json',
289
+ 'bin/figma-tokens/typography-line-widths.json',
290
+ 'bin/figma-tokens/typography-styles.json',
291
+ 'bin/figma-tokens/sizes-breakpoints.json',
292
+ ],
293
+ dest: 'build/figma-tokens/breakpoint-styles.json'
294
+ },
295
+ },
296
+ 'string-replace': {
297
+ cssvars: {
298
+ files: [{
299
+ flatten: true,
300
+ expand: true,
301
+ cwd: 'bin/',
302
+ src: 'pre/*.json',
303
+ dest: 'bin/figma-tokens'
304
+ }],
305
+ options: {
306
+ replacements: [{
307
+ pattern: /(--[a-z0-9-]+)/ig,
308
+ replacement: function (match) {
309
+ //console.log(match)
310
+ var cssvars = grunt.file.read('bin/pre/cssvars/figma-tokens.css');
311
+ var regex = new RegExp(match + ': ([a-zA-Z0-9-#.,\(\)]+)');
312
+ var value = cssvars.match(regex);
313
+ if (value == null) {
314
+ grunt.fail.fatal('Cannot find css-var: ' + match);
315
+ }
316
+ else {
317
+ return value[1];
318
+ }
319
+ }
320
+ }]
321
+ }
322
+ },
323
+ figmastyles: {
324
+ files: [{
325
+ expand: true,
326
+ cwd: 'bin/',
327
+ src: ['pre/breakpoint/*.json', 'pre/theme/*.json'],
328
+ dest: 'bin/'
329
+ }],
330
+ options: {
331
+ replacements: [{
332
+ pattern: /{{([a-zA-Z0-9-]+)}}/ig,
333
+ replacement: function (match, value, a, b, path) {
334
+
335
+ //extract the filename
336
+ var regex = new RegExp('([a-zA-Z0-9]+)\/[0-9]+_([a-zA-Z0-9]+).json');
337
+ var file = path.match(regex);
338
+ if (file == null) {
339
+ grunt.fail.fatal('Unable to extract file and folder name from: ' + path);
340
+ }
341
+ else {
342
+ var foldername = file[1];
343
+ var filename = file[2];
344
+ }
345
+
346
+ //if matched value is not name, find display name i css vars file. Else return the filename.
347
+ if (value != 'name') {
348
+ var cssvars = grunt.file.read('bin/pre/cssvars/figma-tokens.css');
349
+ var regex = new RegExp('--' + foldername + '-' + filename + ': ([a-zA-Z0-9-#. ]+)');
350
+ var displayname = cssvars.match(regex);
351
+ if (displayname == null) {
352
+ grunt.fail.fatal('Cannot find css var with display name for: ' + filename);
353
+ }
354
+ else {
355
+ //console.log(displayname[1]);
356
+ return displayname[1];
357
+ }
358
+ }
359
+ else {
360
+ //console.log(filename);
361
+ return filename;
362
+ }
363
+ }
364
+ }]
365
+ }
366
+ }
367
+ }
183
368
  });
184
369
 
185
370
  // load the tasks
@@ -194,6 +379,8 @@ module.exports = (grunt) => {
194
379
  grunt.loadNpmTasks('grunt-browser-sync');
195
380
  grunt.loadNpmTasks('grunt-webpack');
196
381
  grunt.loadNpmTasks('grunt-sftp-deploy');
382
+ grunt.loadNpmTasks('grunt-merge-json');
383
+ grunt.loadNpmTasks('grunt-string-replace');
197
384
 
198
385
  // define the tasks
199
386
 
@@ -201,10 +388,10 @@ module.exports = (grunt) => {
201
388
  'clean:prebuild',
202
389
  'copy',
203
390
  'pug',
204
- 'sass',
391
+ 'sass:dist',
205
392
  'clean:postbuild',
206
393
  'cleanempty',
207
- 'webpack',
394
+ 'webpack'
208
395
  ]);
209
396
 
210
397
  grunt.registerTask('default', ['build', 'connect', 'browserSync', 'watch']);
@@ -214,4 +401,17 @@ module.exports = (grunt) => {
214
401
  grunt.registerTask('dev-deploy', ['sftp-deploy:dev']);
215
402
 
216
403
  grunt.registerTask('deploy-both', ['sftp-deploy']);
404
+
405
+ grunt.registerTask('figma-tokens', [
406
+ 'clean:figmatokens',
407
+ 'sass:figmatokens',
408
+ 'copy:figmastyles',
409
+ 'copy:figmatokens',
410
+ 'string-replace:figmastyles',
411
+ 'merge-json:breakpoints',
412
+ 'merge-json:themes',
413
+ 'string-replace:cssvars',
414
+ 'merge-json',
415
+ 'clean:bin'
416
+ ]);
217
417
  };