@madgex/design-system 5.11.2 → 6.0.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 (71) hide show
  1. package/README.md +4 -10
  2. package/dist/_tokens/css/_tokens.css +62 -96
  3. package/dist/_tokens/js/_tokens-module.js +1342 -1406
  4. package/dist/_tokens/sketch/_tokens.sketchpalette +1 -1
  5. package/dist/assets/icons.json +1 -1
  6. package/dist/css/index.css +1 -1
  7. package/dist/js/index-fractal.js +1 -1
  8. package/dist/js/index.js +1 -1
  9. package/package.json +5 -5
  10. package/src/components/_preview.njk +1 -0
  11. package/src/components/button/button.scss +50 -37
  12. package/src/components/card/README.md +1 -1
  13. package/src/components/card/_template.njk +1 -1
  14. package/src/components/card/card.config.js +1 -2
  15. package/src/components/card/card.scss +29 -39
  16. package/src/components/icons/README.md +3 -3
  17. package/src/components/icons/icons.scss +26 -19
  18. package/src/components/inputs/_form-elements.scss +44 -44
  19. package/src/components/inputs/checkbox-pill/checkbox-pill.scss +14 -14
  20. package/src/components/inputs/combobox/combobox.scss +13 -13
  21. package/src/components/inputs/file-upload/file-upload.scss +14 -14
  22. package/src/components/inputs/input-number/input-number.scss +10 -10
  23. package/src/components/inputs/text-editor/text-editor.scss +16 -16
  24. package/src/components/modal/modal.js +1 -1
  25. package/src/components/modal/modal.scss +4 -4
  26. package/src/components/notification/notification.scss +1 -1
  27. package/src/components/pagination/pagination.scss +8 -8
  28. package/src/components/popover/popover.js +1 -1
  29. package/src/components/popover/popover.scss +13 -13
  30. package/src/components/section-title/section-title.scss +1 -1
  31. package/src/components/skip-link/skip-link.scss +4 -4
  32. package/src/components/tabs/tabs.js +1 -1
  33. package/src/components/tabs/tabs.scss +16 -16
  34. package/src/components/toggle-button-links/toggle-button-links.scss +20 -20
  35. package/src/helpers/spacing/README.md +2 -2
  36. package/src/layout/grid/README.md +5 -5
  37. package/src/layout/grid/grid.njk +7 -0
  38. package/src/scss/constants/__index.scss +2 -0
  39. package/src/scss/constants/_sd-tokens.scss +81 -0
  40. package/src/scss/constants/_vars.scss +4 -0
  41. package/src/scss/core/_containers.scss +35 -38
  42. package/src/scss/core/_defaults.scss +14 -8
  43. package/src/scss/core/_grid.scss +39 -24
  44. package/src/scss/core/_lists.scss +13 -13
  45. package/src/scss/core/_message.scss +32 -32
  46. package/src/scss/core/_typography.scss +13 -13
  47. package/src/scss/functions/__index.scss +0 -2
  48. package/src/scss/functions/_media-queries.scss +4 -4
  49. package/src/scss/functions/_text-contrast.scss +6 -7
  50. package/src/scss/helpers/_borders.scss +5 -38
  51. package/src/scss/helpers/_display.scss +0 -1
  52. package/src/scss/helpers/_edited-text.scss +5 -5
  53. package/src/scss/helpers/_floats.scss +0 -1
  54. package/src/scss/helpers/_font-types.scss +15 -15
  55. package/src/scss/helpers/_spacing.scss +33 -36
  56. package/src/scss/helpers/_text-align.scss +0 -1
  57. package/src/scss/helpers/_vertical-align.scss +0 -2
  58. package/src/scss/helpers/_width-height.scss +4 -6
  59. package/src/scss/import.scss +1 -0
  60. package/src/scss/index.scss +0 -2
  61. package/src/tokens/_config.js +22 -9
  62. package/src/tokens/_constants.json +130 -0
  63. package/src/tokens/color.json +8 -76
  64. package/src/tokens/custom.json +0 -8
  65. package/src/tokens/size.json +0 -16
  66. package/src/tokens/typography.json +3 -1
  67. package/tasks/registerTransforms.js +28 -1
  68. package/tasks/svgsprite.js +5 -2
  69. package/dist/_tokens/scss/_tokens.scss +0 -741
  70. package/src/scss/functions/_color.scss +0 -0
  71. package/src/scss/functions/_px2rem.scss +0 -20
@@ -53,59 +53,6 @@
53
53
  }
54
54
  }
55
55
  },
56
- "status": {
57
- "error": {
58
- "light": {
59
- "value" : "#fd0826"
60
- },
61
- "lightest": {
62
- "value" : "#ffe3e6"
63
- },
64
- "dark": {
65
- "value" : "#d0021b"
66
- },
67
- "darkest": {
68
- "value" : "#ae0216"
69
- },
70
- "base": {
71
- "value" : "#e1021d"
72
- }
73
- },
74
- "success": {
75
- "light": {
76
- "value" : "#6ac52d"
77
- },
78
- "lightest": {
79
- "value" : "#f0faea"
80
- },
81
- "dark": {
82
- "value" : "#549b24"
83
- },
84
- "darkest": {
85
- "value" : "#40791B"
86
- },
87
- "base": {
88
- "value" : "#5ba927"
89
- }
90
- },
91
- "info": {
92
- "light": {
93
- "value" : "#ffc442"
94
- },
95
- "lightest": {
96
- "value" : "#fff7e5"
97
- },
98
- "dark": {
99
- "value" : "#f4aa08"
100
- },
101
- "darkest": {
102
- "value" : "#946500"
103
- },
104
- "base": {
105
- "value" : "#ffb411"
106
- }
107
- }
108
- },
109
56
  "background": {
110
57
  "body": {
111
58
  "value" : "{color.neutral.white.value}"
@@ -120,29 +67,6 @@
120
67
  "value" : "rgba(0,0,0,0)"
121
68
  }
122
69
  },
123
- "neutral": {
124
- "white": {
125
- "value" : "#FFFFFF"
126
- },
127
- "black": {
128
- "value" : "#000000"
129
- },
130
- "base": {
131
- "value" : "#707070"
132
- },
133
- "light": {
134
- "value" : "#949494"
135
- },
136
- "lighter": {
137
- "value" : "#DDDDDD"
138
- },
139
- "lightest": {
140
- "value" : "#F8F8F8"
141
- },
142
- "darker": {
143
- "value" : "#333333"
144
- }
145
- },
146
70
  "text": {
147
71
  "base": {
148
72
  "value" : "#343433"
@@ -281,6 +205,14 @@
281
205
  "value" : "{color.pill.text.base.value}"
282
206
  }
283
207
  }
208
+ },
209
+ "new-badge": {
210
+ "background": {
211
+ "value" : "#40791B"
212
+ },
213
+ "text": {
214
+ "value" : "#fff"
215
+ }
284
216
  }
285
217
  }
286
218
  }
@@ -8,14 +8,6 @@
8
8
  "color": {
9
9
  "value" : "#fff"
10
10
  }
11
- },
12
- "2": {
13
- "background": {
14
- "value" : "#40791B"
15
- },
16
- "color": {
17
- "value" : "#fff"
18
- }
19
11
  }
20
12
  },
21
13
  "card": {
@@ -1,12 +1,5 @@
1
1
  {
2
2
  "size": {
3
- "baseline": { "value": "4px" },
4
- "breakpoint": {
5
- "sm": { "value": "400px" },
6
- "md": { "value": "600px" },
7
- "lg": { "value": "1008px" },
8
- "xl": { "value": "1280px" }
9
- },
10
3
  "border": {
11
4
  "width": {
12
5
  "base": {
@@ -28,7 +21,6 @@
28
21
  }
29
22
  }
30
23
  },
31
- "gutter-width": { "value": "20px" },
32
24
  "container": {
33
25
  "width": {
34
26
  "value": "100%"
@@ -64,14 +56,6 @@
64
56
  "value": "0 auto"
65
57
  }
66
58
  },
67
- "icon": {
68
- "default": { "value": "1em" },
69
- "sm": { "value": "16px" },
70
- "md": { "value": "24px" },
71
- "lg": { "value": "32px" },
72
- "xl": { "value": "48px" },
73
- "xxl": { "value": "72px" }
74
- },
75
59
  "height": {
76
60
  "ad-container": {
77
61
  "leaderboard": {
@@ -61,7 +61,9 @@
61
61
  "type": {
62
62
  "canon": {
63
63
  "default": {
64
- "size": { "value": "28px" },
64
+ "size": {
65
+ "value": "28px"
66
+ },
65
67
  "line-height": { "value": "1.15" }
66
68
  },
67
69
  "sm": {
@@ -1,4 +1,4 @@
1
- function registerTransforms(StyleDictionary) {
1
+ function registerTransforms(StyleDictionary, tokenBaseFontSize) {
2
2
  return new Promise((resolve) => {
3
3
  StyleDictionary.registerTransform({
4
4
  name: 'css/rawData',
@@ -10,6 +10,33 @@ function registerTransforms(StyleDictionary) {
10
10
  return prop.rawData;
11
11
  },
12
12
  });
13
+ StyleDictionary.registerTransform({
14
+ name: 'custom/pxToRem',
15
+ type: 'value',
16
+ matcher(token) {
17
+ return (
18
+ token.attributes.category === 'font' && token.attributes.type === 'type' && token.attributes.state === 'size'
19
+ );
20
+ },
21
+ transformer(token) {
22
+ const baseFontSize = tokenBaseFontSize ? parseFloat(tokenBaseFontSize) : 16; // default to 16px
23
+ const tokenValue = parseFloat(token.value);
24
+
25
+ if (Number.isNaN(tokenBaseFontSize)) {
26
+ throw new Error(`Invalid number for base font size: ${tokenBaseFontSize}`);
27
+ }
28
+
29
+ if (Number.isNaN(tokenValue)) {
30
+ throw new Error(`Invalid number: ${token.value}. Could not convert ${token.name} to rem`);
31
+ }
32
+
33
+ if (tokenValue === 0) {
34
+ return '0';
35
+ }
36
+
37
+ return `${tokenValue / baseFontSize}rem`;
38
+ },
39
+ });
13
40
  resolve('Transform registered');
14
41
  });
15
42
  }
@@ -63,8 +63,11 @@ async function createSvgStack() {
63
63
 
64
64
  return fs.mkdir(path.resolve(__dirname, '../dist/assets'), { recursive: true }, async () => {
65
65
  icons.push({ name: fileName });
66
- fs.writeFileSync(`${path.resolve(__dirname, '../dist/assets', 'icons.svg')}`, sprites);
67
- fs.writeFileSync(`${path.resolve(__dirname, '../dist/assets', 'icons-inline.svg')}`, inlineSprites);
66
+ fs.writeFileSync(`${path.resolve(__dirname, '../dist/assets', 'icons.svg')}`, sprites.toString());
67
+ fs.writeFileSync(
68
+ `${path.resolve(__dirname, '../dist/assets', 'icons-inline.svg')}`,
69
+ inlineSprites.toString()
70
+ );
68
71
  fs.writeFileSync(`${path.resolve(__dirname, '../dist/assets', 'icons.json')}`, JSON.stringify(icons));
69
72
  });
70
73
  })