@internetstiftelsen/styleguide 4.1.1 → 4.1.3

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 = 'color-ruby ' + (0, _className2.default)('a-meta');
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.classList.remove('color-granit');
81
- this.counterEl.className = 'color-ruby ' + (0, _className2.default)('a-meta');
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 = 'color-jade ' + (0, _className2.default)('a-meta');
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-granit ' + (0, _className2.default)('a-meta');
109
- counter.style.cssText = 'position: absolute; top: 5px; right: 10px; z-index: 501;';
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 */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetstiftelsen/styleguide",
3
- "version": "4.1.1",
3
+ "version": "4.1.3",
4
4
  "main": "dist/components.js",
5
5
  "ports": {
6
6
  "fractal": "3000"
@@ -19,7 +19,8 @@
19
19
  &.is-invalid {
20
20
  input,
21
21
  select,
22
- textarea {
22
+ textarea,
23
+ [class*='a-textarea--rich-text'] {
23
24
  @extend %invalid;
24
25
  }
25
26
 
@@ -29,7 +30,7 @@
29
30
  &::selection {
30
31
  background-color: $color-ruby;
31
32
  }
32
-
33
+
33
34
  &::-moz-selection {
34
35
  background-color: $color-ruby;
35
36
  }