@madgex/design-system 1.61.1 → 1.62.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 (73) hide show
  1. package/coverage/cobertura-coverage.xml +18 -11
  2. package/coverage/components/accordion/accordion.js.html +1 -1
  3. package/coverage/components/accordion/index.html +1 -1
  4. package/coverage/components/inputs/combobox/combobox.js.html +1 -1
  5. package/coverage/components/inputs/combobox/index.html +1 -1
  6. package/coverage/components/inputs/combobox/vue-components/Combobox.vue.html +1 -1
  7. package/coverage/components/inputs/combobox/vue-components/ListBoxOption.vue.html +25 -7
  8. package/coverage/components/inputs/combobox/vue-components/index.html +14 -14
  9. package/coverage/components/inputs/file-upload/file-upload.js.html +1 -1
  10. package/coverage/components/inputs/file-upload/index.html +1 -1
  11. package/coverage/components/inputs/textarea/character-count.js.html +1 -1
  12. package/coverage/components/inputs/textarea/index.html +1 -1
  13. package/coverage/components/modal/index.html +1 -1
  14. package/coverage/components/modal/modal.js.html +1 -1
  15. package/coverage/components/notification/index.html +1 -1
  16. package/coverage/components/notification/notification.js.html +1 -1
  17. package/coverage/components/popover/index.html +1 -1
  18. package/coverage/components/popover/popover.js.html +1 -1
  19. package/coverage/components/switch-state/index.html +1 -1
  20. package/coverage/components/switch-state/switch-state.js.html +1 -1
  21. package/coverage/components/tabs/index.html +1 -1
  22. package/coverage/components/tabs/tabs.js.html +1 -1
  23. package/coverage/index.html +19 -19
  24. package/coverage/js/common.js.html +1 -1
  25. package/coverage/js/fractal-scripts/combobox.js.html +1 -1
  26. package/coverage/js/fractal-scripts/index.html +1 -1
  27. package/coverage/js/fractal-scripts/notification.js.html +1 -1
  28. package/coverage/js/fractal-scripts/switch-state.js.html +1 -1
  29. package/coverage/js/index-fractal.js.html +1 -1
  30. package/coverage/js/index-polyfills.js.html +1 -1
  31. package/coverage/js/index-vue.js.html +1 -1
  32. package/coverage/js/index.html +1 -1
  33. package/coverage/js/index.js.html +1 -1
  34. package/coverage/js/polyfills/arrayPrototypeFind.js.html +1 -1
  35. package/coverage/js/polyfills/closest.js.html +1 -1
  36. package/coverage/js/polyfills/index.html +1 -1
  37. package/coverage/js/polyfills/objectAssign.js.html +1 -1
  38. package/coverage/js/polyfills/remove.js.html +1 -1
  39. package/coverage/tokens/_config.js.html +1 -1
  40. package/coverage/tokens/index.html +1 -1
  41. package/dist/_tokens/css/_tokens.css +1 -1
  42. package/dist/_tokens/js/_tokens-module.js +1 -1
  43. package/dist/_tokens/scss/_tokens.scss +1 -1
  44. package/dist/assets/icons.json +1 -1
  45. package/dist/js/index.js +4 -4
  46. package/package.json +1 -1
  47. package/src/components/accordion/_template.njk +12 -12
  48. package/src/components/accordion/accordion.config.js +4 -0
  49. package/src/components/button/_template.njk +14 -10
  50. package/src/components/button/button.config.js +9 -0
  51. package/src/components/button/button.njk +2 -1
  52. package/src/components/card/_template.njk +2 -2
  53. package/src/components/card/card.config.js +3 -0
  54. package/src/components/card/card.njk +2 -1
  55. package/src/components/inputs/checkbox/_template.njk +27 -27
  56. package/src/components/inputs/combobox/_template.njk +11 -12
  57. package/src/components/inputs/combobox/vue-components/ListBoxOption.vue +6 -0
  58. package/src/components/inputs/file-upload/_template.njk +28 -28
  59. package/src/components/inputs/input/_template.njk +3 -3
  60. package/src/components/inputs/radio/_template.njk +4 -4
  61. package/src/components/inputs/select/_template.njk +7 -7
  62. package/src/components/inputs/textarea/_template.njk +4 -4
  63. package/src/components/pagination/_template.njk +1 -1
  64. package/src/components/pagination/pagination.config.js +5 -0
  65. package/src/components/pagination/pagination.njk +2 -1
  66. package/src/components/pagination-numbers/_template.njk +1 -1
  67. package/src/components/pagination-numbers/pagination-numbers.config.js +9 -0
  68. package/src/components/pagination-numbers/pagination-numbers.njk +2 -1
  69. package/src/components/section-title/_template.njk +14 -14
  70. package/src/components/switch-state/_template.njk +5 -5
  71. package/src/components/switch-state/switch-state.config.js +2 -0
  72. package/src/components/switch-state/switch-state.njk +2 -1
  73. package/src/components/tabs/_template.njk +40 -36
@@ -8,7 +8,7 @@
8
8
  {% set name = params.id %}
9
9
  {% endif %}
10
10
 
11
- <div class="mds-form-element mds-form-element--textarea{% if params.state %} mds-form-element--{{params.state}}{% endif %}{% if params.classes %} {{params.classes}}{% endif %}{% if params.maxlength %} mds-form-element--character-count{% endif %}" id="{{ params.id }}-container" data-test="textarea">
11
+ <div class="mds-form-element mds-form-element--textarea{% if params.state %} mds-form-element--{{params.state}}{% endif %}{% if params.classes %} {{params.classes}}{% endif %}{% if params.maxlength %} mds-form-element--character-count{% endif %}" id="{{ params.id }}-container" data-test="textarea-{{ params.id }}">
12
12
  {{ MdsInputLabel({
13
13
  labelText: params.labelText,
14
14
  hideLabel: params.hideLabel,
@@ -21,7 +21,7 @@
21
21
  helpText: params.helpText,
22
22
  validationError: params.validationError
23
23
  }) }}
24
- <textarea
24
+ <textarea
25
25
  class="mds-form-control"
26
26
  name="{{ name }}"
27
27
  id="{{ params.id }}"
@@ -40,7 +40,7 @@
40
40
  >{#
41
41
  #}{% if params.value %}{{params.value}}{% endif %}{#
42
42
  #}</textarea>
43
- {% if params.maxlength %}
43
+ {% if params.maxlength %}
44
44
  <div class="mds-form-message mds-form-message--character-count" id="{{ params.id }}-character-count-text" aria-live="polite" aria-atomic="true">
45
45
  {{- MdsIcon({
46
46
  iconName: 'cross',
@@ -51,5 +51,5 @@
51
51
  -}}
52
52
  <span><span class="js-character-count-number">{{ params.maxlength }}</span> characters remaining</span>
53
53
  </div>
54
- {% endif %}
54
+ {% endif %}
55
55
  </div>
@@ -1,6 +1,6 @@
1
1
  {% from "../icons/_macro.njk" import MdsIcon %}
2
2
 
3
- <nav aria-label="{{ params.name }}" data-test="pagination">
3
+ <nav aria-label="{{ params.name }}" data-test="pagination-{{params.id}}">
4
4
  <ul class="mds-pagination mds-text-align-right{% if params.classes %} {{params.classes}}{% endif %}">
5
5
  {% if params.backToLabel and params.backToUrl -%}
6
6
  <li class="mds-float-left">
@@ -4,6 +4,7 @@ module.exports = {
4
4
  context: {
5
5
  name: 'Pagination',
6
6
  nextLabel: 'Next',
7
+ id: 'default',
7
8
  },
8
9
  variants: [
9
10
  {
@@ -14,6 +15,7 @@ module.exports = {
14
15
  prevUrl: '/prev-page',
15
16
  nextLabel: 'Next',
16
17
  nextUrl: '/next-page',
18
+ id: 'pag-1',
17
19
  },
18
20
  },
19
21
  {
@@ -27,6 +29,7 @@ module.exports = {
27
29
  nextExtraLabel: 'Customer Service, Special-Agent Assistant Part-Time',
28
30
  backToLabel: 'Results',
29
31
  backToUrl: '/results/',
32
+ id: 'pag-2',
30
33
  },
31
34
  },
32
35
  {
@@ -40,6 +43,7 @@ module.exports = {
40
43
  prevExtraLabel: 'Part Time Sales Assistant',
41
44
  backToLabel: 'Results',
42
45
  backToUrl: '/results/',
46
+ id: 'pag-3',
43
47
  },
44
48
  },
45
49
  {
@@ -57,6 +61,7 @@ module.exports = {
57
61
  nextExtraLabel: 'Customer Service, Special-Agent Assistant Part-Time',
58
62
  backToLabel: 'Results',
59
63
  backToUrl: '/results/',
64
+ id: 'pag-4',
60
65
  },
61
66
  },
62
67
  ],
@@ -13,5 +13,6 @@
13
13
  nextVisHiddenLabel: nextVisHiddenLabel,
14
14
  nextExtraLabel: nextExtraLabel,
15
15
  backToLabel: backToLabel,
16
- backToUrl: backToUrl
16
+ backToUrl: backToUrl,
17
+ id: id
17
18
  }) }}
@@ -58,7 +58,7 @@ Otherwise, show an extra page in front of the current page to make up the displa
58
58
 
59
59
  {# VIEW #}
60
60
 
61
- <nav aria-label="{{ params.name }}" data-test="pagination-numbers">
61
+ <nav aria-label="{{ params.name }}" data-test="pagination-numbers-{{ params.id }}">
62
62
  <ul class="mds-pagination mds-pagination--numbers mds-text-align-center {% if params.classes %} {{params.classes}}{% endif %}">
63
63
  {% if params.prevLabel -%}
64
64
  <li class="mds-pagination__item">
@@ -11,6 +11,7 @@ module.exports = {
11
11
  pageUrlTemplate: '/article/{pageNo}/my-seo-things',
12
12
  prevVisHiddenLabel: 'article',
13
13
  nextVisHiddenLabel: 'article',
14
+ id: 'default',
14
15
  },
15
16
  variants: [
16
17
  {
@@ -19,6 +20,7 @@ module.exports = {
19
20
  pageNo: 7,
20
21
  totalItemCount: 635,
21
22
  pageSize: 20,
23
+ id: '32-7',
22
24
  },
23
25
  },
24
26
  {
@@ -28,6 +30,7 @@ module.exports = {
28
30
  totalItemCount: 635,
29
31
  pageSize: 20,
30
32
  alwaysShowLastPage: true,
33
+ id: '32-9',
31
34
  },
32
35
  },
33
36
  {
@@ -36,6 +39,7 @@ module.exports = {
36
39
  pageNo: 32,
37
40
  totalItemCount: 635,
38
41
  pageSize: 20,
42
+ id: '32-32',
39
43
  },
40
44
  },
41
45
  {
@@ -44,6 +48,7 @@ module.exports = {
44
48
  pageNo: 3,
45
49
  totalItemCount: 635,
46
50
  pageSize: 20,
51
+ id: '32-3',
47
52
  },
48
53
  },
49
54
  {
@@ -52,6 +57,7 @@ module.exports = {
52
57
  pageNo: 2,
53
58
  totalItemCount: 45,
54
59
  pageSize: 20,
60
+ id: '3-2',
55
61
  },
56
62
  },
57
63
  {
@@ -60,6 +66,7 @@ module.exports = {
60
66
  pageNo: 1,
61
67
  totalItemCount: 21,
62
68
  pageSize: 20,
69
+ id: '2-1',
63
70
  },
64
71
  },
65
72
  {
@@ -68,6 +75,7 @@ module.exports = {
68
75
  pageNo: 3,
69
76
  totalItemCount: 141,
70
77
  pageSize: 20,
78
+ id: '8-3',
71
79
  },
72
80
  },
73
81
  {
@@ -76,6 +84,7 @@ module.exports = {
76
84
  pageNo: 1,
77
85
  totalItemCount: 19,
78
86
  pageSize: 20,
87
+ id: '1-render',
79
88
  },
80
89
  },
81
90
  ],
@@ -18,5 +18,6 @@
18
18
  pageNo: pageNo,
19
19
  pageSize: pageSize,
20
20
  totalItemCount: totalItemCount,
21
- alwaysShowLastPage: alwaysShowLastPage
21
+ alwaysShowLastPage: alwaysShowLastPage,
22
+ id: id
22
23
  }) }}
@@ -1,17 +1,17 @@
1
1
  {% from "../button/_macro.njk" import MdsButton %}
2
2
 
3
- <div class="mds-section-title{% if params.classes %} {{ params.classes }}{% endif %}" data-test="title">
4
- <{{ params.headingtag | default("h2") }} class="mds-section-title__header">{{ params.title }}</{{ params.headingtag | default("h2") }}>
5
- {% if params.actionText -%}
6
- <div class="mds-section-title__action">
7
- {%- if params.actionHref -%}
8
- {{ MdsButton({
9
- text: params.actionText,
10
- element: params.actionElement,
11
- href: params.actionHref,
12
- classes: params.classes
13
- }) }}
14
- {%- endif -%}
15
- </div>
16
- {% endif -%}
3
+ <div class="mds-section-title{% if params.classes %} {{ params.classes }}{% endif %}" data-test="title-{{params.id}}">
4
+ <{{ params.headingtag | default("h2") }} class="mds-section-title__header">{{ params.title }}</{{ params.headingtag | default("h2") }}>
5
+ {% if params.actionText -%}
6
+ <div class="mds-section-title__action">
7
+ {%- if params.actionHref -%}
8
+ {{ MdsButton({
9
+ text: params.actionText,
10
+ element: params.actionElement,
11
+ href: params.actionHref,
12
+ classes: params.classes
13
+ }) }}
14
+ {%- endif -%}
15
+ </div>
16
+ {% endif -%}
17
17
  </div>
@@ -1,8 +1,8 @@
1
1
  {% if params %}
2
- <button
2
+ <button
3
3
  class="mds-switch-state js-mds-switch-state mds-switch-state--default mds-button{% if params.classes %} {{params.classes}}{% endif %}"
4
- data-test="switch-state">
5
- <span class="mds-switch-state--default{% if params.defaultClasses %} {{params.defaultClasses}}{% endif %}" data-test="switch-state-default">{{- params.defaultLabel | safe -}}</span>
6
- <span class="mds-switch-state--inverse{% if params.inverseClasses %} {{params.inverseClasses}}{% endif %}" data-test="switch-state-inverse">{{- params.inverseLabel | safe -}}</span>
7
- </button>
4
+ data-test="switch-state-{{params.id}}">
5
+ <span class="mds-switch-state--default{% if params.defaultClasses %} {{params.defaultClasses}}{% endif %}" data-test="switch-state-default-{{params.id}}">{{- params.defaultLabel | safe -}}</span>
6
+ <span class="mds-switch-state--inverse{% if params.inverseClasses %} {{params.inverseClasses}}{% endif %}" data-test="switch-state-inverse-{{params.id}}">{{- params.inverseLabel | safe -}}</span>
7
+ </button>
8
8
  {% endif %}
@@ -4,6 +4,7 @@ module.exports = {
4
4
  context: {
5
5
  inverseLabel: 'Remove Job',
6
6
  defaultLabel: 'Save Job',
7
+ id: 'save',
7
8
  },
8
9
  variants: [
9
10
  {
@@ -12,6 +13,7 @@ module.exports = {
12
13
  classes: 'mds-button--plain',
13
14
  inverseLabel: 'Saved',
14
15
  defaultLabel: 'Save',
16
+ id: 'save',
15
17
  },
16
18
  },
17
19
  ],
@@ -5,5 +5,6 @@
5
5
  inverseLabel: inverseLabel,
6
6
  inverseClasses: inverseClasses,
7
7
  defaultLabel: defaultLabel,
8
- defaultClasses: defaultClasses
8
+ defaultClasses: defaultClasses,
9
+ id: id
9
10
  }) }}
@@ -1,44 +1,48 @@
1
1
  {% if params.content %}
2
- <div class="mds-tabs{%- if params.name %} mds-tabs--{{ params.name | lower | trim | replace(' ', '-')}}{%- endif -%}{% if params.classes %} {{ params.classes }}{% endif %}" data-test="tabs">
3
- <ul class="mds-tabs__list">
4
- {%- for item in params.content -%}
5
- {%- set tabId %}
6
- {%- if item.id -%}
7
- {{ item.id }}
8
- {%- else -%}
9
- {#
10
- if the id is missing it will be constructed using:
11
- [component name]-[item label]-[index]
12
- e.g. period-next-week-2
13
- #}
14
- {%- if params.name -%}{{ params.name | lower | trim | replace(' ', '-')}}-{%- endif -%}
15
- {{ item.label | lower | trim | replace(' ', '-') }}-{{loop.index}}
16
- {%- endif -%}
17
- {% endset -%}
18
2
 
19
- <li class="mds-tabs__list-item">
20
- <a href="#{{ tabId }}" class="mds-tabs__tab{%- if item.selected %} mds-tabs__tab--selected{%- endif %} js-tabs-item" data-test="tabs-trigger">
21
- {{- item.label -}}
22
- </a>
23
- </li>
24
- {%- endfor -%}
25
- </ul>
26
- {%- for item in params.content -%}
27
- {%- set tabPanelId %}
28
- {%- if item.id -%}
29
- {{ item.id }}
30
- {%- else -%}
31
- {#
3
+ {% set kebabName -%}
4
+ {{ params.name | lower | trim | replace(' ', '-')}}
5
+ {%- endset %}
6
+ <div class="mds-tabs{%- if params.name %} mds-tabs--{{ kebabName }}{%- endif -%}{% if params.classes %} {{ params.classes }}{% endif %}" data-test="tabs-{{kebabName}}">
7
+ <ul class="mds-tabs__list">
8
+ {%- for item in params.content -%}
9
+ {%- set tabId %}
10
+ {%- if item.id -%}
11
+ {{ item.id }}
12
+ {%- else -%}
13
+ {#
14
+ if the id is missing it will be constructed using:
15
+ [component name]-[item label]-[index]
16
+ e.g. period-next-week-2
17
+ #}
18
+ {%- if params.name -%}{{kebabName}}-{%- endif -%}
19
+ {{ item.label | lower | trim | replace(' ', '-') }}-{{loop.index}}
20
+ {%- endif -%}
21
+ {% endset -%}
22
+
23
+ <li class="mds-tabs__list-item">
24
+ <a href="#{{ tabId }}" class="mds-tabs__tab{%- if item.selected %} mds-tabs__tab--selected{%- endif %} js-tabs-item" data-test="tabs-trigger-{{tabId}}">
25
+ {{- item.label -}}
26
+ </a>
27
+ </li>
28
+ {%- endfor -%}
29
+ </ul>
30
+ {%- for item in params.content -%}
31
+ {%- set tabPanelId %}
32
+ {%- if item.id -%}
33
+ {{ item.id }}
34
+ {%- else -%}
35
+ {#
32
36
  if the id is missing it will be constructed using:
33
37
  [component name]-[item label]-[index]
34
38
  e.g. period-next-week-2
35
39
  #}
36
- {%- if params.name -%}{{ params.name | lower | trim | replace(' ', '-')}}-{%- endif -%}
37
- {{ item.label | lower | trim | replace(' ', '-') }}-{{loop.index}}
38
- {%- endif -%}
39
- {% endset -%}
40
+ {%- if params.name -%}{{kebabName}}-{%- endif -%}
41
+ {{ item.label | lower | trim | replace(' ', '-') }}-{{loop.index}}
42
+ {%- endif -%}
43
+ {% endset -%}
40
44
 
41
- <section class="mds-tabs__panel{%- if not item.selected %} mds-tabs__panel--hidden {%- endif -%}{% if item.contentClasses %} {{ item.contentClasses }}{% endif %}" id="{{ tabPanelId }}" data-test="tab-panel">{{ item.content | safe }}</section>
42
- {%- endfor -%}
43
- </div>
45
+ <section class="mds-tabs__panel{%- if not item.selected %} mds-tabs__panel--hidden {%- endif -%}{% if item.contentClasses %} {{ item.contentClasses }}{% endif %}" id="{{ tabPanelId }}" data-test="tab-panel-{{tabPanelId}}">{{ item.content | safe }}</section>
46
+ {%- endfor -%}
47
+ </div>
44
48
  {% endif %}