@madgex/design-system 1.21.9 → 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.
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 21 Aug 2019 12:37:48 GMT
3
+ * Generated on Fri, 30 Aug 2019 15:07:31 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Do not edit directly
3
- * Generated on Wed, 21 Aug 2019 12:37:48 GMT
3
+ * Generated on Fri, 30 Aug 2019 15:07:31 GMT
4
4
  */
5
5
 
6
6
  module.exports = {
@@ -1,7 +1,7 @@
1
1
 
2
2
  /*
3
3
  Do not edit directly
4
- Generated on Wed, 21 Aug 2019 12:37:48 GMT
4
+ Generated on Fri, 30 Aug 2019 15:07:31 GMT
5
5
  */
6
6
 
7
7
  $mds-color-brand-1-base: #1b75bb !default;
@@ -1,6 +1,6 @@
1
1
  /*
2
2
  Do not edit directly
3
- Generated on Wed, 21 Aug 2019 12:37:48 GMT
3
+ Generated on Fri, 30 Aug 2019 15:07:31 GMT
4
4
  */
5
5
  html,
6
6
  body,
@@ -1570,6 +1570,44 @@ body {
1570
1570
  padding: 28px 32px;
1571
1571
  }
1572
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
+
1573
1611
  .mds-font-canon {
1574
1612
  font-size: 1.75rem;
1575
1613
  line-height: 1.15;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madgex/design-system",
3
- "version": "1.21.9",
3
+ "version": "1.22.0",
4
4
  "scripts": {
5
5
  "clean": "rimraf dist public tokens/build",
6
6
  "commit": "commit",
@@ -0,0 +1,3 @@
1
+ {% macro MdsInput(params) %}
2
+ {%- include "./_template.njk" -%}
3
+ {% endmacro %}
@@ -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,11 @@
1
+ {% from "./input/_macro.njk" import MdsInput %}
2
+
3
+ {{ MdsInput({
4
+ labelText: labelText,
5
+ name: name,
6
+ id: id,
7
+ type: type,
8
+ required: required,
9
+ disabled: disabled,
10
+ validationMessage: validationMessage
11
+ }) }}
@@ -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,3 @@
1
+ {% macro MdsTextArea(params) %}
2
+ {%- include "./_template.njk" -%}
3
+ {% endmacro %}
@@ -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
+ };
@@ -0,0 +1,11 @@
1
+ {% from "./textarea/_macro.njk" import MdsTextArea %}
2
+
3
+ {{ MdsTextArea({
4
+ labelText: labelText,
5
+ labelHint: labelHint,
6
+ name: name,
7
+ id: id,
8
+ required: required,
9
+ disabled: disabled,
10
+ validationMessage: validationMessage
11
+ }) }}
@@ -0,0 +1,7 @@
1
+ .mds-textarea {
2
+ resize: none;
3
+ width: 100%;
4
+ background-color: $mds-color-neutral-lightest;
5
+ margin: $mds-size-baseline 0;
6
+ padding: $mds-size-baseline * 2;
7
+ }
@@ -3,3 +3,5 @@
3
3
  @import '../../components/card/card';
4
4
  @import '../../components/section-title/section-title';
5
5
  @import '../../components/tabs/tabs';
6
+ @import '../components/input/input';
7
+ @import '../components/textarea/textarea';