@madgex/design-system 1.21.8 → 1.22.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/_tokens/css/_tokens.css +1 -1
- package/dist/_tokens/js/_tokens-module.js +1 -1
- package/dist/_tokens/scss/_tokens.scss +1 -1
- package/dist/css/index.css +41 -2
- package/package.json +1 -1
- package/src/components/button/button.scss +2 -1
- package/src/components/input/_macro.njk +3 -0
- package/src/components/input/_template.njk +32 -0
- package/src/components/input/input.config.js +42 -0
- package/src/components/input/input.njk +11 -0
- package/src/components/input/input.scss +24 -0
- package/src/components/textarea/_macro.njk +3 -0
- package/src/components/textarea/_template.njk +41 -0
- package/src/components/textarea/textarea.config.js +31 -0
- package/src/components/textarea/textarea.njk +11 -0
- package/src/components/textarea/textarea.scss +7 -0
- package/src/scss/components/__index.scss +2 -0
package/dist/css/index.css
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/*
|
|
2
2
|
Do not edit directly
|
|
3
|
-
Generated on
|
|
3
|
+
Generated on Fri, 30 Aug 2019 15:07:31 GMT
|
|
4
4
|
*/
|
|
5
5
|
html,
|
|
6
6
|
body,
|
|
@@ -1472,7 +1472,7 @@ body {
|
|
|
1472
1472
|
border: 1px solid transparent;
|
|
1473
1473
|
border-radius: 4px;
|
|
1474
1474
|
background-color: #f0af11;
|
|
1475
|
-
padding:
|
|
1475
|
+
padding: 12px 12px;
|
|
1476
1476
|
font-size: 100%;
|
|
1477
1477
|
width: 100%;
|
|
1478
1478
|
display: inline-block;
|
|
@@ -1484,6 +1484,7 @@ body {
|
|
|
1484
1484
|
@media (min-width: 37.5em) {
|
|
1485
1485
|
.mds-button {
|
|
1486
1486
|
width: auto;
|
|
1487
|
+
padding: 8px 12px;
|
|
1487
1488
|
}
|
|
1488
1489
|
}
|
|
1489
1490
|
|
|
@@ -1569,6 +1570,44 @@ body {
|
|
|
1569
1570
|
padding: 28px 32px;
|
|
1570
1571
|
}
|
|
1571
1572
|
|
|
1573
|
+
.mds-input {
|
|
1574
|
+
width: 100%;
|
|
1575
|
+
background-color: #f8f8f8;
|
|
1576
|
+
height: 2rem;
|
|
1577
|
+
margin: 4px 0;
|
|
1578
|
+
padding: 4px;
|
|
1579
|
+
}
|
|
1580
|
+
|
|
1581
|
+
.mds-input__label {
|
|
1582
|
+
font-weight: 600;
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
.mds-input__label--hint {
|
|
1586
|
+
font-weight: normal;
|
|
1587
|
+
color: #979797;
|
|
1588
|
+
}
|
|
1589
|
+
|
|
1590
|
+
.mds-input__validation-message {
|
|
1591
|
+
display: block;
|
|
1592
|
+
text-align: right;
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
.mds-input__validation-message--error {
|
|
1596
|
+
color: #e1021d;
|
|
1597
|
+
}
|
|
1598
|
+
|
|
1599
|
+
.mds-input--error {
|
|
1600
|
+
border-color: #e1021d;
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
.mds-textarea {
|
|
1604
|
+
resize: none;
|
|
1605
|
+
width: 100%;
|
|
1606
|
+
background-color: #f8f8f8;
|
|
1607
|
+
margin: 4px 0;
|
|
1608
|
+
padding: 8px;
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1572
1611
|
.mds-font-canon {
|
|
1573
1612
|
font-size: 1.75rem;
|
|
1574
1613
|
line-height: 1.15;
|
package/package.json
CHANGED
|
@@ -12,7 +12,7 @@ $mds-color-button-text-hover: $mds-color-button-text !default;
|
|
|
12
12
|
border: 1px solid transparent;
|
|
13
13
|
border-radius: $mds-size-button-border-radius;
|
|
14
14
|
background-color: $mds-color-button-bg;
|
|
15
|
-
padding: ($mds-size-baseline *
|
|
15
|
+
padding: ($mds-size-baseline * 3) ($mds-size-baseline * 3);
|
|
16
16
|
font-size: 100%;
|
|
17
17
|
width: 100%;
|
|
18
18
|
display: inline-block;
|
|
@@ -22,6 +22,7 @@ $mds-color-button-text-hover: $mds-color-button-text !default;
|
|
|
22
22
|
|
|
23
23
|
@include mq($from: md) {
|
|
24
24
|
width: auto;
|
|
25
|
+
padding: ($mds-size-baseline * 2) ($mds-size-baseline * 3);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
// Ensure that any global link styles are overridden
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<label class="mds-display-block mds-input__label mds-font-long-primer" for="{{ params.id }}">
|
|
3
|
+
{{ params.labelText }}
|
|
4
|
+
{% if params.required %}
|
|
5
|
+
<span>*</span>
|
|
6
|
+
{% endif %}
|
|
7
|
+
</label>
|
|
8
|
+
<input
|
|
9
|
+
class="mds-input mds-border mds-border-radius"
|
|
10
|
+
type="{{ params.type }}"
|
|
11
|
+
name="{{ params.name }}"
|
|
12
|
+
id="{{ params.id }}"
|
|
13
|
+
{% if params.validationMessage %}
|
|
14
|
+
aria-describedby="{{ params.id }}-validation-message"
|
|
15
|
+
{% endif %}
|
|
16
|
+
{% if params.required %}
|
|
17
|
+
required="required"
|
|
18
|
+
{% endif %}
|
|
19
|
+
{% if params.disabled %}
|
|
20
|
+
disabled="disabled"
|
|
21
|
+
{% endif %}
|
|
22
|
+
/>
|
|
23
|
+
{% if params.validationMessage %}
|
|
24
|
+
<span
|
|
25
|
+
aria-live="polite"
|
|
26
|
+
id="{{ params.id }}-validation-message"
|
|
27
|
+
class="mds-input__validation-message mds-font-brevier"
|
|
28
|
+
>
|
|
29
|
+
{{ params.validationMessage }}
|
|
30
|
+
</span>
|
|
31
|
+
{% endif %}
|
|
32
|
+
</div>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
title: 'Input',
|
|
3
|
+
status: 'prototype',
|
|
4
|
+
context: {
|
|
5
|
+
labelText: 'Text input',
|
|
6
|
+
name: 'Example input',
|
|
7
|
+
id: 'exampleInput',
|
|
8
|
+
type: 'text',
|
|
9
|
+
},
|
|
10
|
+
variants: [
|
|
11
|
+
{
|
|
12
|
+
name: 'Required input',
|
|
13
|
+
context: {
|
|
14
|
+
labelText: 'Required input',
|
|
15
|
+
name: 'Required input',
|
|
16
|
+
id: 'requiredInput',
|
|
17
|
+
type: 'password',
|
|
18
|
+
required: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'With validation message',
|
|
23
|
+
context: {
|
|
24
|
+
labelText: 'Validated input',
|
|
25
|
+
name: 'Validated input',
|
|
26
|
+
id: 'validatedInput',
|
|
27
|
+
type: 'text',
|
|
28
|
+
validationMessage: '100 characters remaining',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
name: 'Disabled input',
|
|
33
|
+
context: {
|
|
34
|
+
labelText: 'Disabled input',
|
|
35
|
+
name: 'Disabled input',
|
|
36
|
+
id: 'disabledInput',
|
|
37
|
+
type: 'email',
|
|
38
|
+
disabled: true,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
],
|
|
42
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
.mds-input {
|
|
2
|
+
width: 100%;
|
|
3
|
+
background-color: $mds-color-neutral-lightest;
|
|
4
|
+
height: 2rem;
|
|
5
|
+
margin: $mds-size-baseline 0;
|
|
6
|
+
padding: $mds-size-baseline;
|
|
7
|
+
&__label {
|
|
8
|
+
font-weight: 600;
|
|
9
|
+
&--hint {
|
|
10
|
+
font-weight: normal;
|
|
11
|
+
color: $mds-color-neutral-base;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
&__validation-message {
|
|
15
|
+
display: block;
|
|
16
|
+
text-align: right;
|
|
17
|
+
&--error {
|
|
18
|
+
color: $mds-color-status-error-base;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
&--error {
|
|
22
|
+
border-color: $mds-color-status-error-base;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<div>
|
|
2
|
+
<label class="mds-display-block mds-input__label mds-font-long-primer mds-margin-bottom-b1" for="{{ params.id }}">
|
|
3
|
+
{{ params.labelText }}
|
|
4
|
+
{% if params.required %}
|
|
5
|
+
<span>*</span>
|
|
6
|
+
{% endif %}
|
|
7
|
+
</label>
|
|
8
|
+
{% if params.labelHint %}
|
|
9
|
+
<span
|
|
10
|
+
class="mds-display-block mds-input__label--hint mds-font-long-primer mds-margin-bottom-b1"
|
|
11
|
+
id="{{ params.id }}-hint"
|
|
12
|
+
>
|
|
13
|
+
{{ params.labelHint }}
|
|
14
|
+
</span>
|
|
15
|
+
{% endif %}
|
|
16
|
+
<textarea
|
|
17
|
+
class="mds-textarea mds-border mds-border-radius"
|
|
18
|
+
name="{{ params.name }}"
|
|
19
|
+
id="{{ params.id }}"
|
|
20
|
+
cols="{{ params.cols | default(30) }}"
|
|
21
|
+
rows="{{ params.rows | default(10) }}"
|
|
22
|
+
{% if params.labelHint or params.validationMessage %}
|
|
23
|
+
aria-describedby="{% if params.labelHint %}{{ params.id }}-hint {% endif %}{% if params.validationMessage %}{{ params.id }}-validation-message{% endif %}"
|
|
24
|
+
{% endif %}
|
|
25
|
+
{% if params.disabled %}
|
|
26
|
+
disabled="disabled"
|
|
27
|
+
{% endif %}
|
|
28
|
+
{% if params.required %}
|
|
29
|
+
required="required"
|
|
30
|
+
{% endif %}
|
|
31
|
+
></textarea>
|
|
32
|
+
{% if params.validationMessage %}
|
|
33
|
+
<span
|
|
34
|
+
aria-live="polite"
|
|
35
|
+
id="{{ params.id }}-validation-message"
|
|
36
|
+
class="mds-input__validation-message mds-font-brevier"
|
|
37
|
+
>
|
|
38
|
+
{{ params.validationMessage }}
|
|
39
|
+
</span>
|
|
40
|
+
{% endif %}
|
|
41
|
+
</div>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
title: 'Text Area',
|
|
3
|
+
status: 'prototype',
|
|
4
|
+
context: {
|
|
5
|
+
labelText: 'Text area',
|
|
6
|
+
name: 'Example text area',
|
|
7
|
+
id: 'exampleTextArea',
|
|
8
|
+
},
|
|
9
|
+
variants: [
|
|
10
|
+
{
|
|
11
|
+
name: 'With label hint',
|
|
12
|
+
context: {
|
|
13
|
+
labelText: 'Hint input',
|
|
14
|
+
name: 'Hint input',
|
|
15
|
+
id: 'hintInput',
|
|
16
|
+
type: 'text',
|
|
17
|
+
labelHint: 'This is a text area',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
name: 'With validation message',
|
|
22
|
+
context: {
|
|
23
|
+
labelText: 'Validated input',
|
|
24
|
+
name: 'Validated input',
|
|
25
|
+
id: 'validatedInput',
|
|
26
|
+
type: 'text',
|
|
27
|
+
validationMessage: '100 characters remaining',
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
};
|