@internetstiftelsen/styleguide 2.23.3 → 2.23.6

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.
@@ -6,6 +6,7 @@ var selectStore = {};
6
6
 
7
7
  function effectChain(element, value) {
8
8
  var options = element.querySelectorAll('option[data-if-chain]');
9
+ var oldValue = element.value;
9
10
 
10
11
  if (!(element.name in selectStore)) {
11
12
  // First time, cache options
@@ -47,6 +48,10 @@ function effectChain(element, value) {
47
48
  if (newOptions.length === 1) {
48
49
  element.value = newOptions[0].value;
49
50
  }
51
+
52
+ if (oldValue !== element.value) {
53
+ element.dispatchEvent(new Event('change', { bubbles: true }));
54
+ }
50
55
  }
51
56
 
52
57
  function effectDisable(element, disable, value) {
@@ -91,8 +96,6 @@ function update(element, value) {
91
96
  });
92
97
  var conditionMet = !values.length && !!value || matches;
93
98
 
94
- console.log(values, value, matches);
95
-
96
99
  if (effect === 'disable') {
97
100
  effectDisable(element, !conditionMet, value);
98
101
  } else if (effect === 'toggle') {
@@ -102,33 +105,6 @@ function update(element, value) {
102
105
  }
103
106
  }
104
107
 
105
- function delegate(_ref3) {
106
- var target = _ref3.target;
107
- var name = target.name;
108
-
109
-
110
- if (!name) {
111
- return;
112
- }
113
-
114
- var elements = document.querySelectorAll('[data-if^="' + name + '"]');
115
-
116
- if (!elements.length) {
117
- return;
118
- }
119
-
120
- var value = target.value;
121
-
122
-
123
- if (['checkbox', 'radio'].includes(target.getAttribute('type'))) {
124
- value = target.checked ? target.value : null;
125
- }
126
-
127
- [].forEach.call(elements, function (element) {
128
- return update(element, value);
129
- });
130
- }
131
-
132
108
  function init() {
133
109
  var elements = document.querySelectorAll('[data-if]');
134
110
 
@@ -159,5 +135,32 @@ function init() {
159
135
  });
160
136
  }
161
137
 
138
+ function delegate(_ref3) {
139
+ var target = _ref3.target;
140
+ var name = target.name;
141
+
142
+
143
+ if (!name) {
144
+ return;
145
+ }
146
+
147
+ var elements = document.querySelectorAll('[data-if^="' + name + '"]');
148
+
149
+ if (!elements.length) {
150
+ return;
151
+ }
152
+
153
+ var value = target.value;
154
+
155
+
156
+ if (['checkbox', 'radio'].includes(target.getAttribute('type'))) {
157
+ value = target.checked ? target.value : null;
158
+ }
159
+
160
+ [].forEach.call(elements, function (element) {
161
+ return update(element, value);
162
+ });
163
+ }
164
+
162
165
  init();
163
166
  document.body.addEventListener('change', delegate);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetstiftelsen/styleguide",
3
- "version": "2.23.3",
3
+ "version": "2.23.6",
4
4
  "main": "dist/components.js",
5
5
  "ports": {
6
6
  "fractal": "3000"
@@ -11,14 +11,13 @@
11
11
  "build:fractal": "fractal build",
12
12
  "scss": "sass src/app.scss public/assets/css/app.css",
13
13
  "stylelint": "stylelint 'src/**/*.scss' '!**/vendor/**' '!**/colors/_colors-functions.scss' --fix --cache --cache-location '.stylelintcache'",
14
- "autoprefixer": "postcss --use autoprefixer -b 'last 2 versions' public/assets/css/app.css -d public/assets/css/",
15
14
  "cssmin": "postcss --use cssnano -b '' public/assets/css/app.css > public/assets/css/app.min.css",
16
15
  "browserify": "browserify public/assets/js/cjs/app.js -o public/assets/js/scripts.js",
17
16
  "babel": "npx babel src --out-dir public/assets/js/cjs --ignore src/**/*.config.js",
18
17
  "eslint": "eslint --fix src",
19
18
  "uglify": "uglifyjs -o public/assets/js/scripts.js public/assets/js/scripts.js",
20
19
  "imagemin": "imagemin --out-dir=public/assets/img src/**/*.{png,jpg,gif}",
21
- "build:css": "npm run stylelint && npm run scss && npm run autoprefixer && npm run cssmin",
20
+ "build:css": "npm run stylelint && npm run scss && npm run cssmin",
22
21
  "build:js": "npm run eslint && npm run babel && npm run browserify",
23
22
  "build:img": "npm run imagemin",
24
23
  "watch:css": "onchange 'src/**/*.scss' -- npm run build:css",
@@ -45,7 +44,6 @@
45
44
  "@frctl/mandelbrot": "^1.9.2",
46
45
  "@internetstiftelsen/eslint-config": "^0.0.5",
47
46
  "@internetstiftelsen/stylelint-config": "^1.0.0",
48
- "autoprefixer": "^10.2.6",
49
47
  "babel-cli": "^6.26.0",
50
48
  "babel-eslint": "^10.0.3",
51
49
  "babel-plugin-syntax-dynamic-import": "^6.18.0",
@@ -2,6 +2,7 @@ const selectStore = {};
2
2
 
3
3
  function effectChain(element, value) {
4
4
  const options = element.querySelectorAll('option[data-if-chain]');
5
+ const oldValue = element.value;
5
6
 
6
7
  if (!(element.name in selectStore)) {
7
8
  // First time, cache options
@@ -39,6 +40,10 @@ function effectChain(element, value) {
39
40
  if (newOptions.length === 1) {
40
41
  element.value = newOptions[0].value;
41
42
  }
43
+
44
+ if (oldValue !== element.value) {
45
+ element.dispatchEvent(new Event('change', { bubbles: true }));
46
+ }
42
47
  }
43
48
 
44
49
  function effectDisable(element, disable, value) {
@@ -72,8 +77,6 @@ function update(element, value) {
72
77
  const matches = values.some((match) => match === value || (match.indexOf('!') === 0 && match.substring(1) !== value));
73
78
  const conditionMet = (!values.length && !!value) || matches;
74
79
 
75
- console.log(values, value, matches);
76
-
77
80
  if (effect === 'disable') {
78
81
  effectDisable(element, !conditionMet, value);
79
82
  } else if (effect === 'toggle') {
@@ -83,28 +86,6 @@ function update(element, value) {
83
86
  }
84
87
  }
85
88
 
86
- function delegate({ target }) {
87
- const { name } = target;
88
-
89
- if (!name) {
90
- return;
91
- }
92
-
93
- const elements = document.querySelectorAll(`[data-if^="${name}"]`);
94
-
95
- if (!elements.length) {
96
- return;
97
- }
98
-
99
- let { value } = target;
100
-
101
- if (['checkbox', 'radio'].includes(target.getAttribute('type'))) {
102
- value = (target.checked) ? target.value : null;
103
- }
104
-
105
- [].forEach.call(elements, (element) => update(element, value));
106
- }
107
-
108
89
  function init() {
109
90
  const elements = document.querySelectorAll('[data-if]');
110
91
 
@@ -131,5 +112,27 @@ function init() {
131
112
  });
132
113
  }
133
114
 
115
+ function delegate({ target }) {
116
+ const { name } = target;
117
+
118
+ if (!name) {
119
+ return;
120
+ }
121
+
122
+ const elements = document.querySelectorAll(`[data-if^="${name}"]`);
123
+
124
+ if (!elements.length) {
125
+ return;
126
+ }
127
+
128
+ let { value } = target;
129
+
130
+ if (['checkbox', 'radio'].includes(target.getAttribute('type'))) {
131
+ value = (target.checked) ? target.value : null;
132
+ }
133
+
134
+ [].forEach.call(elements, (element) => update(element, value));
135
+ }
136
+
134
137
  init();
135
138
  document.body.addEventListener('change', delegate);
@@ -339,3 +339,12 @@ div.aligncenter {
339
339
  border-radius: $border-radius;
340
340
  overflow: hidden;
341
341
  }
342
+
343
+ .wp-block-graph {
344
+ padding-top: rhythm(4);
345
+ margin-top: rhythm(4);
346
+
347
+ & + & {
348
+ margin-top: -#{rhythm(3)};
349
+ }
350
+ }
@@ -37,9 +37,8 @@
37
37
  > h6,
38
38
  > ul,
39
39
  > ol,
40
- > div:not(.wp-block-iis-info):not(.wp-block-image):not(.wp-block-iis-hero):not(.wp-block-iis-grid):not([class*='accordion']),
40
+ > :not(.wp-block-iis-info):not(.wp-block-image):not(.wp-block-iis-hero):not(.wp-block-iis-grid):not([class*='accordion']),
41
41
  > .wp-block-iis-card,
42
- > figure,
43
42
  > blockquote {
44
43
  &:not(.alignfull):not(.alignleft):not(.alignright):not(.alignwide) {
45
44
  max-width: calc(#{rem(612px)} + #{($indent * 2)});
@@ -136,4 +135,4 @@
136
135
  @include molecule(card) {
137
136
  margin-bottom: rhythm(4);
138
137
  }
139
- }
138
+ }
package/src/.DS_Store DELETED
Binary file
Binary file