@internetstiftelsen/styleguide 4.1.1 → 4.1.2
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.
|
@@ -70,21 +70,26 @@ var CharCounter = function () {
|
|
|
70
70
|
|
|
71
71
|
if (this.min && count < this.min) {
|
|
72
72
|
this.counterEl.textContent = count + '/' + this.min;
|
|
73
|
-
this.counterEl.className = '
|
|
73
|
+
this.counterEl.className = 'backgrond-ruby-light ' + (0, _className2.default)('a-meta');
|
|
74
|
+
this.el.setAttribute('aria-invalid', 'true');
|
|
75
|
+
this.counterEl.closest('.field-group').classList.add('is-invalid');
|
|
74
76
|
|
|
75
77
|
return;
|
|
76
78
|
}
|
|
77
79
|
|
|
78
80
|
if (this.max && count > this.max) {
|
|
79
81
|
this.counterEl.textContent = count + '/' + this.max;
|
|
80
|
-
this.counterEl.
|
|
81
|
-
this.
|
|
82
|
+
this.counterEl.className = 'background-ruby-light ' + (0, _className2.default)('a-meta');
|
|
83
|
+
this.el.setAttribute('aria-invalid', 'true');
|
|
84
|
+
this.counterEl.closest('.field-group').classList.add('is-invalid');
|
|
82
85
|
|
|
83
86
|
return;
|
|
84
87
|
}
|
|
85
88
|
|
|
86
89
|
this.counterEl.textContent = count + '/' + (this.max || this.min);
|
|
87
|
-
this.counterEl.className = '
|
|
90
|
+
this.counterEl.className = 'background-jade-light ' + (0, _className2.default)('a-meta');
|
|
91
|
+
this.el.removeAttribute('aria-invalid');
|
|
92
|
+
this.counterEl.closest('.field-group').classList.remove('is-invalid');
|
|
88
93
|
}
|
|
89
94
|
}, {
|
|
90
95
|
key: 'build',
|
|
@@ -105,8 +110,8 @@ var CharCounter = function () {
|
|
|
105
110
|
this.el.style.paddingRight = '3.8333333333rem';
|
|
106
111
|
}
|
|
107
112
|
|
|
108
|
-
counter.className = 'color-
|
|
109
|
-
counter.style.cssText = 'position: absolute; top:
|
|
113
|
+
counter.className = 'color-cyberspace ' + (0, _className2.default)('a-meta');
|
|
114
|
+
counter.style.cssText = 'position: absolute; top: .5rem; right: .5rem; z-index: 501;background-color: #ff9fb4; border-radius: 0.25rem; padding: .25rem; line-height: 1;margin: 0';
|
|
110
115
|
|
|
111
116
|
wrapper.appendChild(counter);
|
|
112
117
|
|
|
@@ -9,9 +9,14 @@ function toggleTextOnClick(e) {
|
|
|
9
9
|
var i = parseInt(el.dataset.iteration || 0, 10);
|
|
10
10
|
var options = el.dataset.toggleText.split('|');
|
|
11
11
|
var nextIteration = i + 1 === options.length ? 0 : i + 1;
|
|
12
|
+
var ariaPressed = el.getAttribute('aria-pressed');
|
|
12
13
|
|
|
13
14
|
el.dataset.iteration = nextIteration;
|
|
14
15
|
target.innerText = options[nextIteration];
|
|
16
|
+
|
|
17
|
+
if (ariaPressed) {
|
|
18
|
+
el.setAttribute('aria-pressed', ariaPressed === 'true' ? 'false' : 'true');
|
|
19
|
+
}
|
|
15
20
|
}
|
|
16
21
|
|
|
17
22
|
/* eslint-disable */
|