@internetstiftelsen/styleguide 2.26.18 → 2.26.19

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetstiftelsen/styleguide",
3
- "version": "2.26.18",
3
+ "version": "2.26.19",
4
4
  "main": "dist/components.js",
5
5
  "ports": {
6
6
  "fractal": "3000"
package/src/app.scss CHANGED
@@ -16,7 +16,6 @@ $namespace: '';
16
16
  @import 'configurations/typography/typography';
17
17
  @import 'configurations/forms/fields';
18
18
  @import 'configurations/wordpress';
19
- @import 'configurations/recaptcha';
20
19
 
21
20
  // Atoms
22
21
  @import 'atoms/skip/skip';
@@ -69,6 +69,7 @@
69
69
  font-size: rem($size-small);
70
70
  text-decoration: none;
71
71
  -webkit-appearance: none;
72
+ line-height: 1;
72
73
 
73
74
  &:focus,
74
75
  &:hover {
@@ -29,13 +29,6 @@ export default class Form {
29
29
  this.errors = {};
30
30
  this.validationRules = null;
31
31
 
32
- this.recaptcha = this.element.getAttribute('data-recaptcha');
33
-
34
- if (this.recaptcha) {
35
- window.captchaCallback = this.captchaCallback;
36
- this.renderCaptchaForm();
37
- }
38
-
39
32
  if (this.validation) {
40
33
  this.parseValidationRules();
41
34
  }
@@ -48,14 +41,6 @@ export default class Form {
48
41
  this.inputs = this.element.querySelectorAll('input');
49
42
  }
50
43
 
51
- renderCaptchaForm() {
52
- const s = document.createElement('script');
53
- s.defer = true;
54
- s.setAttribute('data-origin', this.recaptcha);
55
- s.setAttribute('src', 'https://www.google.com/recaptcha/api.js?onload=captchaCallback&render=6LdtNnkUAAAAACYo0vISI-z9tOyr3djjZore-6wY&hl=sv');
56
- document.body.appendChild(s);
57
- }
58
-
59
44
  parseValidationRules() {
60
45
  const validationsStr = this.validation.getAttribute('content');
61
46
  const validations = validationsStr.split('|');
@@ -142,10 +127,6 @@ export default class Form {
142
127
  this.clearFieldErrors();
143
128
 
144
129
  if (this.validate()) {
145
- if (this.recaptcha) {
146
- this.captchaCallback();
147
- }
148
-
149
130
  this.send();
150
131
  } else {
151
132
  this.displayError({ message: this.i18n('Alla fält måste vara ifyllda') });
@@ -281,16 +262,6 @@ export default class Form {
281
262
  this.events.emit('success', json);
282
263
  };
283
264
 
284
- captchaCallback = () => {
285
- if (typeof window.grecaptcha !== 'undefined' && process.env.RECAPTCHA_KEY !== undefined) {
286
- /* global grecaptcha */
287
- grecaptcha.execute(process.env.RECAPTCHA_KEY, { action: this.recaptcha })
288
- .then((token) => {
289
- this.token = token;
290
- });
291
- }
292
- };
293
-
294
265
  reset = () => {
295
266
  this.element.reset();
296
267
  this.hideMessages();