@madgex/design-system 13.7.0 → 13.8.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.
@@ -1 +1 @@
1
- [{"name":"add"},{"name":"arrow-left"},{"name":"arrow-right"},{"name":"asterisk"},{"name":"calendar"},{"name":"cart"},{"name":"check"},{"name":"chevron-down"},{"name":"chevron-left"},{"name":"chevron-right"},{"name":"chevron-up"},{"name":"close"},{"name":"cross"},{"name":"doc-pdf"},{"name":"doc"},{"name":"email"},{"name":"external"},{"name":"flag"},{"name":"information"},{"name":"job"},{"name":"list-bullets"},{"name":"list-numbers"},{"name":"location-pin"},{"name":"menu"},{"name":"minus"},{"name":"plus-small"},{"name":"plus"},{"name":"question-mark"},{"name":"redo"},{"name":"remove"},{"name":"search"},{"name":"settings"},{"name":"share"},{"name":"social-facebook"},{"name":"social-linkedin"},{"name":"social-pinterest"},{"name":"social-reddit"},{"name":"social-twitter"},{"name":"spinner"},{"name":"star-fill"},{"name":"star-outline"},{"name":"text-bold"},{"name":"text-italic"},{"name":"text-link"},{"name":"text-strike-through"},{"name":"text-underline"},{"name":"triangle-down"},{"name":"triangle-right"},{"name":"triangle-up"},{"name":"undo"},{"name":"upload"},{"name":"user"}]
1
+ [{"name":"add"},{"name":"arrow-left"},{"name":"arrow-right"},{"name":"asterisk"},{"name":"cart"},{"name":"check"},{"name":"chevron-down"},{"name":"chevron-left"},{"name":"chevron-right"},{"name":"chevron-up"},{"name":"close"},{"name":"cross"},{"name":"doc-pdf"},{"name":"doc"},{"name":"email"},{"name":"external"},{"name":"flag"},{"name":"information"},{"name":"job"},{"name":"calendar"},{"name":"list-numbers"},{"name":"list-bullets"},{"name":"location-pin"},{"name":"menu"},{"name":"plus-small"},{"name":"minus"},{"name":"plus"},{"name":"question-mark"},{"name":"redo"},{"name":"search"},{"name":"remove"},{"name":"settings"},{"name":"share"},{"name":"social-facebook"},{"name":"social-linkedin"},{"name":"social-pinterest"},{"name":"social-reddit"},{"name":"social-twitter"},{"name":"spinner"},{"name":"star-fill"},{"name":"star-outline"},{"name":"text-bold"},{"name":"text-italic"},{"name":"text-link"},{"name":"text-strike-through"},{"name":"triangle-down"},{"name":"triangle-right"},{"name":"triangle-up"},{"name":"undo"},{"name":"upload"},{"name":"user"},{"name":"text-underline"}]
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@madgex/design-system",
3
3
  "author": "Madgex",
4
4
  "license": "UNLICENSED",
5
- "version": "13.7.0",
5
+ "version": "13.8.0",
6
6
  "main": "dist/js/index.js",
7
7
  "exports": {
8
8
  ".": "./dist/js/index.js",
@@ -1,4 +1,5 @@
1
1
  {% from "../../icons/_macro.njk" import MdsIcon %}
2
+ {% from "../../../sub-components/attributes/macro.njk" import MdsAttributes %}
2
3
  <input
3
4
  type="checkbox"
4
5
  class="{{ params.inputClass | default('mds-form-check__input') }}"
@@ -11,6 +12,7 @@
11
12
  value="{{ params.value }}"
12
13
  {% if params.dataPath %}data-path="{{ params.dataPath }}"{% endif %}
13
14
  {% if params.controls %}aria-controls="{{ params.controls }}"{% endif %}
15
+ {{- MdsAttributes(params.attributes) -}}
14
16
  />{%- if not params.inputOnly -%}{#
15
17
  #}<label class="mds-form-check__label" for="{{ params.id }}">{#
16
18
  #}{{- params.labelText | safe -}}{#
@@ -37,7 +37,8 @@
37
37
  value: params.value,
38
38
  labelledBy: titleId + ' ' + priceId,
39
39
  describedBy: ariaDescribedBy,
40
- controls: params.controls
40
+ controls: params.controls,
41
+ attributes: params.attributes
41
42
  }) -}}
42
43
  <span class="mds-button-checkbox__icon--add">{{- MdsIcon({ iconName: "add", classes: "mds-font-s2" }) -}}</span>
43
44
  <span class="mds-button-checkbox__icon--remove">{{- MdsIcon({ iconName: "remove", classes: "mds-font-s2" }) -}}</span>
@@ -10,6 +10,7 @@
10
10
  helpText: helpText,
11
11
  value: value,
12
12
  i18n: i18n,
13
- disabled: disabled
13
+ disabled: disabled,
14
+ attributes: attributes
14
15
  }) -}}
15
16
  </div>
@@ -1,5 +1,6 @@
1
1
  {% from "../label/_macro.njk" import MdsInputLabel %}
2
2
  {% from "../_message/_macro.njk" import MdsInputMessages %}
3
+ {% from "../../../sub-components/attributes/macro.njk" import MdsAttributes %}
3
4
 
4
5
  {%- set comboboxId %}
5
6
  {%- if params.id -%}
@@ -68,6 +69,7 @@
68
69
  {% if params.fallbackTo === 'input' %}name="{{ comboboxName }}"{% endif %}
69
70
  {% if params.value %}value="{{ params.value }}"{% endif %}
70
71
  {% if ariaDescribedBy %} describedby-id="{{ariaDescribedBy}}"{% endif -%}
72
+ {{- MdsAttributes(params.attributes) -}}
71
73
  >
72
74
  <div class="mds-form-element__fallback">
73
75
  {% if params.fallbackTo === 'select' and params.options %}
@@ -23,7 +23,8 @@
23
23
  apiUrl: apiUrl,
24
24
  apiQueryKey: apiQueryKey,
25
25
  apiOptionsPath: apiOptionsPath,
26
- optionLabelPath: optionLabelPath
26
+ optionLabelPath: optionLabelPath,
27
+ attributes: attributes
27
28
  }) %}
28
29
  {#
29
30
  The below demonstrates how a target input value can be set on option selection, or on clear of combobox
@@ -4,6 +4,7 @@
4
4
  {% from "../../button/_macro.njk" import MdsButton %}
5
5
  {% from "../../modal/_macro.njk" import MdsModal %}
6
6
  {% from "../../image-cropper/_macro.njk" import MdsImageCropper %}
7
+ {% from "../../../sub-components/attributes/macro.njk" import MdsAttributes %}
7
8
 
8
9
  {% if params.name %}
9
10
  {% set name = params.name %}
@@ -58,6 +59,7 @@
58
59
  {% if ariaDescribedBy %}
59
60
  aria-describedby="{{ariaDescribedBy}}"
60
61
  {% endif %}
62
+ {{- MdsAttributes(params.attributes) -}}
61
63
  />
62
64
  <div class="mds-file-upload__wrapper" aria-live="assertive" aria-atomic="true">
63
65
  {# NO FILE STATE #}
@@ -21,7 +21,8 @@
21
21
  siteContainerId:siteContainerId,
22
22
  noImageCropper: noImageCropper,
23
23
  noAutoOpenImageCropper: noAutoOpenImageCropper,
24
- cropper: cropper
24
+ cropper: cropper,
25
+ attributes: attributes
25
26
  }) }}
26
27
  </div>
27
28
  </div>
@@ -1,5 +1,6 @@
1
1
  {% from "../label/_macro.njk" import MdsInputLabel %}
2
2
  {% from "../_message/_macro.njk" import MdsInputMessages %}
3
+ {% from "../../../sub-components/attributes/macro.njk" import MdsAttributes %}
3
4
 
4
5
  {% if params.name %}
5
6
  {% set name = params.name %}
@@ -58,5 +59,6 @@
58
59
  {% if ariaDescribedBy %}
59
60
  aria-describedby="{{ariaDescribedBy}}"
60
61
  {% endif %}
62
+ {{- MdsAttributes(params.attributes) -}}
61
63
  />
62
64
  </div>
@@ -18,7 +18,8 @@
18
18
  state: state,
19
19
  classes: classes,
20
20
  tooltipMessage: tooltipMessage,
21
- autocompleteValue: autocompleteValue
21
+ autocompleteValue: autocompleteValue,
22
+ attributes: attributes
22
23
  }) }}
23
24
  </div>
24
25
  </div>
@@ -1,5 +1,6 @@
1
1
  {% from "../label/_macro.njk" import MdsInputLabel %}
2
2
  {% from "../_message/_macro.njk" import MdsInputMessages %}
3
+ {% from "../../../sub-components/attributes/macro.njk" import MdsAttributes %}
3
4
 
4
5
  {%- if params.name -%}
5
6
  {%- set name = params.name -%}
@@ -53,7 +54,8 @@
53
54
  id="{{optionId}}"
54
55
  {% if params.disabled %}disabled="disabled"{% endif %}
55
56
  {% if params.value == radio.value %}checked="checked"{% endif %}
56
- value="{{radio.value}}"/>
57
+ value="{{radio.value}}"
58
+ {{- MdsAttributes(params.attributes) -}}/>
57
59
  {#
58
60
  # Avoid extra space created by line breaks #
59
61
  #}<label class="mds-form-check__label" for="{{optionId}}">{#
@@ -10,6 +10,7 @@
10
10
  options: options,
11
11
  classes: classes,
12
12
  helpText: helpText,
13
- validationError: validationError
13
+ validationError: validationError,
14
+ attributes: attributes
14
15
  }) }}
15
16
  </div>
@@ -1,5 +1,6 @@
1
1
  {% from "../label/_macro.njk" import MdsInputLabel %}
2
2
  {% from "../_message/_macro.njk" import MdsInputMessages %}
3
+ {% from "../../../sub-components/attributes/macro.njk" import MdsAttributes %}
3
4
 
4
5
  {% if params.name %}
5
6
  {% set name = params.name %}
@@ -51,6 +52,7 @@
51
52
  {% if ariaDescribedBy %}
52
53
  aria-describedby="{{ariaDescribedBy}}"
53
54
  {% endif %}
55
+ {{- MdsAttributes(params.attributes) -}}
54
56
  >
55
57
  {% if not params.hideDefault -%}
56
58
  <option {%- if not params.value %} selected="selected"{% endif %} value="">
@@ -20,7 +20,8 @@
20
20
  tooltipMessage: tooltipMessage,
21
21
  hideDefault: hideDefault,
22
22
  options: options,
23
- i18n: i18n
23
+ i18n: i18n,
24
+ attributes: attributes
24
25
  }) }}
25
26
  </div>
26
27
  </div>
@@ -54,7 +54,8 @@
54
54
  name: name,
55
55
  id: id,
56
56
  value: options.value,
57
- i18n: params.i18n
57
+ i18n: params.i18n,
58
+ attributes: params.attributes
58
59
  }) -}}
59
60
  </div>
60
61
  </div>
@@ -42,6 +42,25 @@ module.exports = {
42
42
  ],
43
43
  },
44
44
  },
45
+ {
46
+ name: 'Checkbox with custom attributes',
47
+ context: {
48
+ id: 'custom-attrs',
49
+ optional: true,
50
+ options: [
51
+ {
52
+ labelText:
53
+ 'This checkbox has custom <code>data-upsell</code> and <code>data-upsell-id</code> attributes on the input element.',
54
+ value: 'data-yes',
55
+ id: 'data-attrs',
56
+ },
57
+ ],
58
+ attributes: {
59
+ 'data-upsell': '',
60
+ 'data-upsell-id': '123',
61
+ },
62
+ },
63
+ },
45
64
  {
46
65
  name: 'Checkbox with validation error',
47
66
  context: {
@@ -14,6 +14,7 @@
14
14
  helpText: helpText,
15
15
  value: value,
16
16
  options: options,
17
- i18n: i18n
17
+ i18n: i18n,
18
+ attributes: attributes
18
19
  }) -}}
19
20
  </div>
@@ -1,6 +1,7 @@
1
1
  {% from "../label/_macro.njk" import MdsInputLabel %}
2
2
  {% from "../_message/_macro.njk" import MdsInputMessages %}
3
3
  {% from "../../icons/_macro.njk" import MdsIcon %}
4
+ {% from "../../../sub-components/attributes/macro.njk" import MdsAttributes %}
4
5
 
5
6
  {% if params.helpText %}
6
7
  {% set helpTextId = [params.id, '-help-text'] | join %}
@@ -41,6 +42,7 @@
41
42
  {% if ariaDescribedBy %}
42
43
  aria-describedby="{{ariaDescribedBy}}"
43
44
  {% endif %}
45
+ {{- MdsAttributes(params.attributes) -}}
44
46
  >{#
45
47
  #}{% if params.value %}{{params.value}}{% endif %}{#
46
48
  #}</textarea>
@@ -10,7 +10,8 @@
10
10
  value: value,
11
11
  state: state,
12
12
  validationError: validationError,
13
- noMenu: noMenu
13
+ noMenu: noMenu,
14
+ attributes: attributes
14
15
  }) }}
15
16
 
16
17
  <div class="mds-margin-top-b10"></div>
@@ -1,6 +1,7 @@
1
1
  {% from "../label/_macro.njk" import MdsInputLabel %}
2
2
  {% from "../_message/_macro.njk" import MdsInputMessages %}
3
3
  {% from "../../icons/_macro.njk" import MdsIcon %}
4
+ {% from "../../../sub-components/attributes/macro.njk" import MdsAttributes %}
4
5
 
5
6
  {% if params.name %}
6
7
  {% set name = params.name %}
@@ -59,6 +60,7 @@
59
60
  {% if params.validationError %}
60
61
  aria-invalid="true"
61
62
  {% endif %}
63
+ {{- MdsAttributes(params.attributes) -}}
62
64
  >{#
63
65
  #}{% if params.value %}{{params.value}}{% endif %}{#
64
66
  #}</textarea>
@@ -19,7 +19,8 @@
19
19
  classes: classes,
20
20
  tooltipMessage: tooltipMessage,
21
21
  maxlength: maxlength,
22
- i18n: i18n
22
+ i18n: i18n,
23
+ attributes: attributes
23
24
  }) }}
24
25
  </div>
25
26
  </div>