@internetstiftelsen/styleguide 5.0.15 → 5.0.16
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/assets/js/iconToggle.js +6 -7
- package/package.json +1 -1
- package/src/app.scss +1 -0
- package/src/assets/js/iconToggle.js +10 -10
- package/src/molecules/glider/_glider-course.scss +44 -0
- package/src/molecules/icon-overlay/_icon-overlay.scss +1 -0
- package/src/molecules/simple-flow-chart/_simple-flow-chart.scss +60 -0
- package/src/molecules/simple-flow-chart/simple-flow-chart.config.js +24 -0
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
// Usage: data-toggle-icon-target="targetSvg" data-toggle-icon="copy|check"
|
|
4
|
-
function toggleIconOnClick(
|
|
5
|
-
e.preventDefault();
|
|
6
|
-
|
|
7
|
-
var el = e.target;
|
|
8
|
-
|
|
4
|
+
function toggleIconOnClick(el) {
|
|
9
5
|
var target = el.dataset.toggleIconTarget ? document.getElementById(el.dataset.toggleIconTarget) : el;
|
|
10
6
|
var i = parseInt(el.dataset.iconIteration || 0, 10);
|
|
11
7
|
var options = el.dataset.toggleIcon.split('|');
|
|
@@ -17,8 +13,11 @@ function toggleIconOnClick(e) {
|
|
|
17
13
|
}
|
|
18
14
|
|
|
19
15
|
document.addEventListener('click', function (e) {
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
var target = e.target.closest('[data-toggle-icon]');
|
|
17
|
+
|
|
18
|
+
if (target) {
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
toggleIconOnClick(target);
|
|
22
21
|
return false;
|
|
23
22
|
}
|
|
24
23
|
});
|
package/package.json
CHANGED
package/src/app.scss
CHANGED
|
@@ -67,6 +67,7 @@
|
|
|
67
67
|
@use 'molecules/overview-navigation/overview-navigation';
|
|
68
68
|
@use 'molecules/multi-select/multi-select';
|
|
69
69
|
@use 'molecules/input-group/input-group';
|
|
70
|
+
@use 'molecules/simple-flow-chart/simple-flow-chart';
|
|
70
71
|
|
|
71
72
|
// Organisms
|
|
72
73
|
@use 'organisms/header/header';
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
// Usage: data-toggle-icon-target="targetSvg" data-toggle-icon="copy|check"
|
|
2
|
-
function toggleIconOnClick(
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const target = (el.dataset.toggleIconTarget) ? document.getElementById(el.dataset.toggleIconTarget) : el;
|
|
2
|
+
function toggleIconOnClick(el) {
|
|
3
|
+
const target = el.dataset.toggleIconTarget
|
|
4
|
+
? document.getElementById(el.dataset.toggleIconTarget)
|
|
5
|
+
: el;
|
|
8
6
|
const i = parseInt(el.dataset.iconIteration || 0, 10);
|
|
9
7
|
const options = el.dataset.toggleIcon.split('|');
|
|
10
|
-
const nextIteration =
|
|
8
|
+
const nextIteration = i + 1 === options.length ? 0 : i + 1;
|
|
11
9
|
|
|
12
10
|
el.dataset.iconIteration = nextIteration;
|
|
13
11
|
const useElement = target.querySelector('use');
|
|
14
12
|
useElement.setAttribute('xlink:href', `#icon-${options[nextIteration]}`);
|
|
15
13
|
}
|
|
16
14
|
|
|
17
|
-
|
|
18
15
|
document.addEventListener('click', (e) => {
|
|
19
|
-
|
|
20
|
-
|
|
16
|
+
let target = e.target.closest('[data-toggle-icon]');
|
|
17
|
+
|
|
18
|
+
if (target) {
|
|
19
|
+
e.preventDefault();
|
|
20
|
+
toggleIconOnClick(target);
|
|
21
21
|
return false;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
@@ -123,5 +123,49 @@
|
|
|
123
123
|
margin-top: 0;
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
+
|
|
127
|
+
@include bem.e(info-box) {
|
|
128
|
+
margin-top: 0;
|
|
129
|
+
|
|
130
|
+
@include breakpoint.bp-up(lg) {
|
|
131
|
+
margin-bottom: 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
ol {
|
|
135
|
+
list-style-type: none;
|
|
136
|
+
counter-reset: list-counter;
|
|
137
|
+
padding-left: 0;
|
|
138
|
+
|
|
139
|
+
li {
|
|
140
|
+
padding-left: func.rhythm(5);
|
|
141
|
+
margin-bottom: func.rhythm(1);
|
|
142
|
+
position: relative;
|
|
143
|
+
|
|
144
|
+
* {
|
|
145
|
+
display: inline;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
&::before {
|
|
149
|
+
content: counter(list-counter);
|
|
150
|
+
counter-increment: list-counter;
|
|
151
|
+
display: inline-flex;
|
|
152
|
+
margin-right: func.rhythm(2);
|
|
153
|
+
background-color: colors.$color-ruby;
|
|
154
|
+
color: colors.$color-snow;
|
|
155
|
+
width: var.$icon-size-large;
|
|
156
|
+
height: var.$icon-size-large;
|
|
157
|
+
flex-grow: 0;
|
|
158
|
+
flex-shrink: 0;
|
|
159
|
+
border-radius: 50%;
|
|
160
|
+
align-items: center;
|
|
161
|
+
justify-content: center;
|
|
162
|
+
line-height: 1;
|
|
163
|
+
position: absolute;
|
|
164
|
+
top: func.to_rem(4px);
|
|
165
|
+
left: 0;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
}
|
|
126
170
|
}
|
|
127
171
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
@charset "UTF-8";
|
|
2
|
+
@use "sass:math";
|
|
3
|
+
@use "sass:color";
|
|
4
|
+
@use '../../configurations/mixins' as mixin;
|
|
5
|
+
@use '../../configurations/bem' as bem;
|
|
6
|
+
@use '../../configurations/config' as config;
|
|
7
|
+
@use '../../configurations/variables' as var;
|
|
8
|
+
@use '../../configurations/functions' as func;
|
|
9
|
+
@use '../../configurations/colors/colors' as colors;
|
|
10
|
+
@use '../../configurations/colors/colors-functions' as colorFunc;
|
|
11
|
+
@use '../../vendor/grid/breakpoints' as breakpoint;
|
|
12
|
+
@use '../../vendor/grid/grid' as grid;
|
|
13
|
+
|
|
14
|
+
@include mixin.molecule(simple-flow-chart) {
|
|
15
|
+
list-style: none;
|
|
16
|
+
margin:0 ;
|
|
17
|
+
padding: 0;
|
|
18
|
+
|
|
19
|
+
@include bem.m(jade) {
|
|
20
|
+
background: rgb(45,137,122);
|
|
21
|
+
background: linear-gradient(180deg, rgba(45,137,122,1) 0%, rgba(208,240,234,1) 100%);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@include bem.e(item) {
|
|
25
|
+
padding: func.rhythm(3) func.rhythm(2);
|
|
26
|
+
position: relative;
|
|
27
|
+
text-align: center;
|
|
28
|
+
font-family: var.$font-family-headings;
|
|
29
|
+
font-size: calc(var.$size-base * 1.5);
|
|
30
|
+
|
|
31
|
+
& + & {
|
|
32
|
+
border-top: func.rhythm(1) solid colors.$color-snow;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
&::after {
|
|
36
|
+
top: 100%;
|
|
37
|
+
left: 50%;
|
|
38
|
+
border: solid transparent;
|
|
39
|
+
content: '';
|
|
40
|
+
height: 0;
|
|
41
|
+
width: 0;
|
|
42
|
+
position: absolute;
|
|
43
|
+
pointer-events: none;
|
|
44
|
+
border-color: rgba(255, 255, 255, 0);
|
|
45
|
+
border-top-color: #ffffff;
|
|
46
|
+
border-width: func.rhythm(3) func.rhythm(5) 0 func.rhythm(5);
|
|
47
|
+
transform: translateX(-50%);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
&:first-child {
|
|
51
|
+
color: colors.$color-snow;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
&:last-child {
|
|
55
|
+
&::after {
|
|
56
|
+
display: none;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
status: 'prototype',
|
|
3
|
+
default: 'jade',
|
|
4
|
+
|
|
5
|
+
context: {
|
|
6
|
+
background_color: '#ffce2e',
|
|
7
|
+
icon_fill_color: '#1f2a36',
|
|
8
|
+
icon_background_hover_color: '#ffce2e',
|
|
9
|
+
},
|
|
10
|
+
variants: [
|
|
11
|
+
{
|
|
12
|
+
name: 'jade',
|
|
13
|
+
context: {
|
|
14
|
+
color: 'jade'
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
name: 'ruby',
|
|
19
|
+
context: {
|
|
20
|
+
color: 'jade'
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
]
|
|
24
|
+
};
|