@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.
- package/dist/assets/icons.json +1 -1
- package/package.json +1 -1
- package/src/components/inputs/_checkbox-elem/_template.njk +2 -0
- package/src/components/inputs/button-checkbox/_template.njk +2 -1
- package/src/components/inputs/button-checkbox/button-checkbox.njk +2 -1
- package/src/components/inputs/combobox/_template.njk +2 -0
- package/src/components/inputs/combobox/combobox.njk +2 -1
- package/src/components/inputs/file-upload/_template.njk +2 -0
- package/src/components/inputs/file-upload/file-upload.njk +2 -1
- package/src/components/inputs/input/_template.njk +2 -0
- package/src/components/inputs/input/input.njk +2 -1
- package/src/components/inputs/radio/_template.njk +3 -1
- package/src/components/inputs/radio/radio.njk +2 -1
- package/src/components/inputs/select/_template.njk +2 -0
- package/src/components/inputs/select/select.njk +2 -1
- package/src/components/inputs/single-checkbox/_template.njk +2 -1
- package/src/components/inputs/single-checkbox/single-checkbox.config.js +19 -0
- package/src/components/inputs/single-checkbox/single-checkbox.njk +2 -1
- package/src/components/inputs/text-editor/_template.njk +2 -0
- package/src/components/inputs/text-editor/text-editor.njk +2 -1
- package/src/components/inputs/textarea/_template.njk +2 -0
- package/src/components/inputs/textarea/textarea.njk +2 -1
package/dist/assets/icons.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"name":"add"},{"name":"arrow-left"},{"name":"arrow-right"},{"name":"asterisk"},{"name":"
|
|
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
|
@@ -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>
|
|
@@ -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 #}
|
|
@@ -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>
|
|
@@ -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}}">{#
|
|
@@ -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="">
|
|
@@ -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: {
|
|
@@ -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>
|
|
@@ -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>
|