mp-design-system 1.0.2 → 1.0.4
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/build/js/app.js +1 -1
- package/dist/build/js/app.js.map +1 -1
- package/dist/build/scss/main.css +1 -1
- package/dist/build/scss/main.css.map +1 -1
- package/package.json +1 -1
- package/src/_includes/components/input/input.config.js +1 -1
- package/src/_includes/components/input/input.njk +2 -0
- package/src/_includes/components/input/input.scss +6 -1
- package/src/assets/js/imports/off-canvas.js +6 -0
- package/src/assets/scss/objects/off-canvas.scss +1 -1
- package/src/assets/scss/utilities/disabled.scss +8 -0
- package/src/assets/scss/utilities/index.scss +1 -0
- package/src/components/utilities.md +8 -0
package/package.json
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
{% inputWrapper params.error %}
|
2
|
+
<div class="c-form-row u-disabled">
|
2
3
|
<label class="{{ 'u-hidden' if params.hideLabel else 'c-label' }}" for="{{ params.id }}">{{ params.label }}</label>
|
3
4
|
{% if params.button %}
|
4
5
|
<div class="u-flex u-border">
|
@@ -10,4 +11,5 @@
|
|
10
11
|
{% if params.button %}
|
11
12
|
</div>
|
12
13
|
{% endif %}
|
14
|
+
</div>
|
13
15
|
{% endinputWrapper %}
|
@@ -85,7 +85,8 @@
|
|
85
85
|
}
|
86
86
|
|
87
87
|
&[disabled],
|
88
|
-
[disabled]
|
88
|
+
[disabled],
|
89
|
+
&--disabled {
|
89
90
|
background-color: color('petrol', 'step-2');
|
90
91
|
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" id="lock" viewBox="0 0 25 24" fill="currentColor"><path fill-rule="evenodd" clip-rule="evenodd" d="M9.45 4.17A4 4 0 0 1 16.28 7v3h-8V7a4 4 0 0 1 1.17-2.83ZM6.28 10V7a6 6 0 1 1 12 0v3h.22c1.64 0 2.78 1.46 2.78 3v7c0 1.54-1.14 3-2.78 3H6.06c-1.65 0-2.78-1.46-2.78-3v-7c0-1.54 1.13-3 2.78-3h.22Zm1 2H6.06c-.33 0-.78.33-.78 1v7c0 .67.45 1 .78 1H18.5c.32 0 .78-.33.78-1v-7c0-.67-.46-1-.78-1H7.28Zm3 3.35a2 2 0 1 1 3 1.73v1.77a1 1 0 1 1-2 0v-1.77a2 2 0 0 1-1-1.73Z"/></svg>');
|
91
92
|
background-position: right var(--space-2xs) center;
|
@@ -96,6 +97,10 @@
|
|
96
97
|
}
|
97
98
|
}
|
98
99
|
|
100
|
+
.u-disabled > .c-input {
|
101
|
+
@extend .c-input--disabled;
|
102
|
+
}
|
103
|
+
|
99
104
|
.c-input--with-button {
|
100
105
|
// padding-right: 44px;
|
101
106
|
border: 0;
|
@@ -37,6 +37,9 @@ function openOffCanvas(offCanvas) {
|
|
37
37
|
|
38
38
|
// Add keydown event listener to close the off-canvas drawer with the Esc key
|
39
39
|
document.addEventListener('keydown', handleKeyDown);
|
40
|
+
|
41
|
+
// Prevent background scroll
|
42
|
+
document.body.style.overflowY = 'hidden';
|
40
43
|
}
|
41
44
|
|
42
45
|
// Function to handle the backdrop click
|
@@ -66,6 +69,9 @@ function closeOffCanvas(offCanvas) {
|
|
66
69
|
|
67
70
|
// Remove keydown event listener when closing the off-canvas drawer
|
68
71
|
document.removeEventListener('keydown', handleKeyDown);
|
72
|
+
|
73
|
+
// Allow background scroll
|
74
|
+
document.body.style.overflowY = '';
|
69
75
|
}
|
70
76
|
|
71
77
|
// Update button functionality
|
@@ -50,6 +50,14 @@ More typography utility classes are documented on the [typography page](/compone
|
|
50
50
|
<div class="u-revealed">The opposite of u-hidden, useful for e.g. accordions</div>
|
51
51
|
```
|
52
52
|
|
53
|
+
```html
|
54
|
+
<div class="u-disabled">
|
55
|
+
<label class="c-label" for="text_input">
|
56
|
+
Disabled input, without using the [disabled] attribute</label>
|
57
|
+
<input type="text" class="c-input">
|
58
|
+
</div>
|
59
|
+
```
|
60
|
+
|
53
61
|
---
|
54
62
|
|
55
63
|
## Layout
|