@madgex/design-system 3.9.6 → 3.11.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 (60) hide show
  1. package/coverage/cobertura-coverage.xml +1 -1
  2. package/coverage/components/accordion/accordion.js.html +1 -1
  3. package/coverage/components/accordion/index.html +1 -1
  4. package/coverage/components/button/button.js.html +1 -1
  5. package/coverage/components/button/index.html +1 -1
  6. package/coverage/components/inputs/combobox/combobox.js.html +1 -1
  7. package/coverage/components/inputs/combobox/index.html +1 -1
  8. package/coverage/components/inputs/combobox/vue-components/Combobox.vue.html +1 -1
  9. package/coverage/components/inputs/combobox/vue-components/ComboboxInput.vue.html +1 -1
  10. package/coverage/components/inputs/combobox/vue-components/ListBoxOption.vue.html +1 -1
  11. package/coverage/components/inputs/combobox/vue-components/index.html +1 -1
  12. package/coverage/components/inputs/file-upload/file-upload.js.html +1 -1
  13. package/coverage/components/inputs/file-upload/index.html +1 -1
  14. package/coverage/components/inputs/textarea/character-count.js.html +1 -1
  15. package/coverage/components/inputs/textarea/index.html +1 -1
  16. package/coverage/components/modal/index.html +1 -1
  17. package/coverage/components/modal/modal.js.html +1 -1
  18. package/coverage/components/notification/index.html +1 -1
  19. package/coverage/components/notification/notification.js.html +1 -1
  20. package/coverage/components/popover/index.html +1 -1
  21. package/coverage/components/popover/popover.js.html +1 -1
  22. package/coverage/components/switch-state/index.html +1 -1
  23. package/coverage/components/switch-state/switch-state.js.html +1 -1
  24. package/coverage/components/tabs/index.html +1 -1
  25. package/coverage/components/tabs/tabs.js.html +1 -1
  26. package/coverage/index.html +1 -1
  27. package/coverage/js/common.js.html +1 -1
  28. package/coverage/js/fractal-scripts/combobox.js.html +1 -1
  29. package/coverage/js/fractal-scripts/index.html +1 -1
  30. package/coverage/js/fractal-scripts/notification.js.html +1 -1
  31. package/coverage/js/fractal-scripts/switch-state.js.html +1 -1
  32. package/coverage/js/index-fractal.js.html +1 -1
  33. package/coverage/js/index-polyfills.js.html +1 -1
  34. package/coverage/js/index-vue.js.html +1 -1
  35. package/coverage/js/index.html +1 -1
  36. package/coverage/js/index.js.html +1 -1
  37. package/coverage/js/polyfills/arrayPrototypeFind.js.html +1 -1
  38. package/coverage/js/polyfills/closest.js.html +1 -1
  39. package/coverage/js/polyfills/index.html +1 -1
  40. package/coverage/js/polyfills/objectAssign.js.html +1 -1
  41. package/coverage/js/polyfills/remove.js.html +1 -1
  42. package/coverage/tokens/_config.js.html +1 -1
  43. package/coverage/tokens/index.html +1 -1
  44. package/dist/_tokens/css/_tokens.css +5 -1
  45. package/dist/_tokens/js/_tokens-module.js +93 -1
  46. package/dist/_tokens/scss/_tokens.scss +17 -1
  47. package/dist/assets/icons.json +1 -1
  48. package/dist/css/index.css +1 -1
  49. package/package.json +1 -1
  50. package/src/components/card/README.md +78 -0
  51. package/src/components/card/_template.njk +26 -2
  52. package/src/components/card/card.config.js +27 -0
  53. package/src/components/card/card.njk +16 -13
  54. package/src/components/card/card.scss +47 -1
  55. package/src/components/tabs/README.md +1 -1
  56. package/src/components/tabs/_template.njk +1 -1
  57. package/src/components/tabs/tabs.config.js +29 -6
  58. package/src/components/tabs/tabs.njk +2 -0
  59. package/src/scss/components/__index.scss +1 -1
  60. package/src/tokens/custom.json +22 -0
@@ -1,17 +1,20 @@
1
1
  {% from "./card/_macro.njk" import MdsCard %}
2
2
 
3
- <h2>{{ fractalLabel }}</h2>
4
- {% if fractalLabel === 'Card used in a list' %}
5
- <ul>
6
- {% endif %}
3
+ <div class="mds-margin-bottom-b5">
4
+ <h2>{{ fractalLabel }}</h2>
5
+ {%- if fractalLabel === 'Card used in a list' -%}
6
+ <ul>
7
+ {%- endif -%}
7
8
 
8
- {{ MdsCard({
9
- inList: inList,
10
- classes: classes,
11
- content: content,
12
- id: id
13
- }) }}
9
+ {{- MdsCard({
10
+ inList: inList,
11
+ classes: classes,
12
+ content: content,
13
+ id: id,
14
+ badges: badges
15
+ }) -}}
14
16
 
15
- {% if fractalLabel === 'Card used in a list' %}
16
- </ul>
17
- {% endif %}
17
+ {%- if fractalLabel === 'Card used in a list' -%}
18
+ </ul>
19
+ {%- endif -%}
20
+ </div>
@@ -1,11 +1,57 @@
1
1
  .mds-card {
2
- padding: ($mds-size-baseline * 3) ($mds-size-baseline * 4);
3
2
  border: $mds-size-border-width-base solid $mds-color-border;
4
3
 
5
4
  > *:last-child {
6
5
  margin-bottom: 0;
7
6
  }
8
7
  }
8
+ .mds-card__container {
9
+ padding: ($mds-size-baseline * 3) ($mds-size-baseline * 4);
10
+ }
11
+
9
12
  .mds-card--highlighted {
10
13
  background: $mds-color-neutral-lightest;
11
14
  }
15
+
16
+ .mds-badge-container {
17
+ display: flex;
18
+ flex-wrap: wrap;
19
+ column-gap: $mds-size-baseline;
20
+
21
+
22
+ &__column {
23
+ display: flex;
24
+ flex-wrap: wrap;
25
+ column-gap: $mds-size-baseline;
26
+ align-items: flex-start;
27
+ flex: 1 1 auto;
28
+
29
+ &--right {
30
+ justify-content: flex-end;
31
+ }
32
+ }
33
+ }
34
+
35
+ // get tokens from custom.badge
36
+ $badges: map-get($tokens, 'custom', 'badge');
37
+ // set of css properties that we accept
38
+ // any other properties found in the tokens won't be added to the css
39
+ $validProperties: background, color, font-size, font-weight, text-transform, padding, border;
40
+
41
+
42
+ .mds-badge {
43
+ display: block;
44
+ padding: $mds-size-baseline $mds-size-baseline * 2;
45
+ margin-bottom: $mds-size-baseline;
46
+ @extend .mds-font-minion;
47
+ text-transform: uppercase;
48
+ }
49
+
50
+ @each $name, $obj in $badges {
51
+ .mds-badge--#{$name} {
52
+ @each $property in $validProperties {
53
+ $value: map-get($obj, $property);
54
+ #{$property}: $value;
55
+ }
56
+ }
57
+ }
@@ -4,7 +4,7 @@
4
4
  - `classes`: add extra CSS classes to the component
5
5
  - `allHeadersTag`: the html tag to use for the panel header (h2 as default)
6
6
  - `allHeadersDisplay`: wheter the panel header should be always visible or not (default false)
7
- - `content`: is an array of objects containing [label, selected, id, content, headerText] for each tab, the content for the panel can also be a custom component, headerText is text used for each panel header
7
+ - `content`: is an array of objects containing [label, selected, id, content, headerText, linkCustomAttr] for each tab, the content for the panel can also be a custom component, headerText is text used for each panel header
8
8
 
9
9
  ## Variations
10
10
  Tabs have different style depending on the amount of items to display, if 2 tabs then it will always display tabs (except when js is disabled), if more than 2 then it will display a list of links for small devices and tabs for desktop
@@ -16,7 +16,7 @@
16
16
  {%- for item in params.content -%}
17
17
  {%- set tabId = TabId(item, params, loop.index) -%}
18
18
  <li class="mds-tabs__list-item">
19
- <a href="#{{ tabId }}" id="label-{{tabId}}" class="mds-tabs__tab{%- if item.selected %} mds-tabs__tab--selected{%- endif %} js-tabs-item" data-test="tabs-trigger{% if tabId %}-{{tabId}}{% endif %}">
19
+ <a href="#{{ tabId }}" id="label-{{tabId}}" class="mds-tabs__tab{%- if item.selected %} mds-tabs__tab--selected{%- endif %} js-tabs-item" data-test="tabs-trigger{% if tabId %}-{{tabId}}{% endif %}"{% if item.linkCustomAttr %} {{item.linkCustomAttr | safe}}{% endif %}>
20
20
  {{- item.label -}}
21
21
  </a>
22
22
  </li>
@@ -42,13 +42,11 @@ module.exports = {
42
42
  {
43
43
  label: 'Item 1',
44
44
  selected: true,
45
- content:
46
- '<p><strong>Two Items</strong> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla magna ex, lobortis in luctus quis, viverra eu libero. Donec commodo elementum ligula, vel posuere purus tempor sit amet.</p>',
45
+ content: '<p>When there are only two tabs they remain inline at mobile.</p>',
47
46
  },
48
47
  {
49
48
  label: 'Item 2',
50
- content:
51
- '<p> Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla magna ex, lobortis in luctus quis, viverra eu libero.</p>',
49
+ content: '<p>When there are only two tabs they remain inline at mobile.</p>',
52
50
  },
53
51
  ],
54
52
  },
@@ -56,7 +54,7 @@ module.exports = {
56
54
  {
57
55
  name: 'No Ids, visible headers, 3 items',
58
56
  context: {
59
- name: 'Wild Pets',
57
+ name: 'No Ids, visible headers, 3 items',
60
58
  classes: '',
61
59
  allHeadersTag: 'h3',
62
60
  allHeadersDisplay: true,
@@ -86,7 +84,7 @@ module.exports = {
86
84
  {
87
85
  name: 'No Ids, visible header, 2 items',
88
86
  context: {
89
- name: 'Recruiter',
87
+ name: 'No Ids, visible header, 2 items',
90
88
  classes: '',
91
89
  allHeadersTag: 'h3',
92
90
  allHeadersDisplay: true,
@@ -107,5 +105,30 @@ module.exports = {
107
105
  ],
108
106
  },
109
107
  },
108
+ {
109
+ name: 'Links in tabs have custom attributes',
110
+ context: {
111
+ name: 'Custom Link Attributes',
112
+ classes: '',
113
+ allHeadersTag: 'h3',
114
+ content: [
115
+ {
116
+ label: 'Plane',
117
+ selected: true,
118
+ headerText: 'Flying craft',
119
+ linkCustomAttr: 'data-metric="wings"',
120
+ content:
121
+ '<p>Inspect the anchor tags inside each tab to see the custom attributes that are added. One use case of this is allowing us to add click metrics.</p>',
122
+ },
123
+ {
124
+ label: 'Helicopter',
125
+ headerText: 'Flying craft',
126
+ linkCustomAttr: 'data-metric="rotor-blades"',
127
+ content:
128
+ '<p>Inspect the anchor tags inside each tab to see the custom attributes that are added. One use case of this is allowing us to add click metrics.</p>',
129
+ },
130
+ ],
131
+ },
132
+ },
110
133
  ],
111
134
  };
@@ -1,5 +1,7 @@
1
1
  {% from "./tabs/_macro.njk" import MdsTabs %}
2
2
 
3
+ <h2>{{ name }}</h2>
4
+
3
5
  <div class="mds-surface mds-margin-bottom-b5">
4
6
  {{ MdsTabs({
5
7
  name: name,
@@ -13,4 +13,4 @@
13
13
  @import '../../components/inputs/file-upload/file-upload';
14
14
  @import '../../components/inputs/textarea/textarea';
15
15
  @import '../../components/modal/modal';
16
- @import '../../components/skip-link/skip-link';
16
+ @import '../../components/skip-link/skip-link';
@@ -0,0 +1,22 @@
1
+ {
2
+ "custom": {
3
+ "badge": {
4
+ "1": {
5
+ "background": {
6
+ "value" : "{color.neutral.black.value}"
7
+ },
8
+ "color": {
9
+ "value" : "#fff"
10
+ }
11
+ },
12
+ "2": {
13
+ "background": {
14
+ "value" : "#40791B"
15
+ },
16
+ "color": {
17
+ "value" : "#fff"
18
+ }
19
+ }
20
+ }
21
+ }
22
+ }