@internetstiftelsen/styleguide 5.0.12 → 5.0.14-beta.0.1
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/LICENSE +21 -0
- package/dist/organisms/mailchimp/mailchimp.js +7 -1
- package/dist/organisms/mega-menu/mega-menu.js +1 -1
- package/package.json +1 -1
- package/src/atoms/main-menu/_main-menu.scss +0 -4
- package/src/atoms/main-menu/main-menu.config.js +2 -2
- package/src/organisms/domain-search/_domain-search.scss +8 -121
- package/src/organisms/domain-search/domain-search.config.js +44 -4
- package/src/organisms/mailchimp/mailchimp.js +4 -1
- package/src/organisms/mega-menu/mega-menu.js +1 -1
- package/src/pages/domain-search-page/domain-search-page.config.js +53 -0
- package/src/utilities/_text.scss +12 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 The Swedish Internet Foundation
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -4,8 +4,14 @@ var _debounce = require('../../assets/js/debounce');
|
|
|
4
4
|
|
|
5
5
|
var _debounce2 = _interopRequireDefault(_debounce);
|
|
6
6
|
|
|
7
|
+
var _hasCookieConsent = require('../../assets/js/hasCookieConsent');
|
|
8
|
+
|
|
9
|
+
var _hasCookieConsent2 = _interopRequireDefault(_hasCookieConsent);
|
|
10
|
+
|
|
7
11
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
8
12
|
|
|
13
|
+
var consent = (0, _hasCookieConsent2.default)('C0003');
|
|
14
|
+
|
|
9
15
|
var slidingForm = document.querySelector('[class*="--sliding"]');
|
|
10
16
|
var staticForm = document.querySelector('[class*="--static"]');
|
|
11
17
|
var closeButton = document.querySelector('[class*="--sliding"] .js-close-mailchimp-popup');
|
|
@@ -82,7 +88,7 @@ function slideForm() {
|
|
|
82
88
|
}
|
|
83
89
|
|
|
84
90
|
var elementIsInViewport = (0, _debounce2.default)(function () {
|
|
85
|
-
if (slidingForm) {
|
|
91
|
+
if (consent && slidingForm) {
|
|
86
92
|
slideForm();
|
|
87
93
|
}
|
|
88
94
|
}, throttle);
|
|
@@ -197,7 +197,7 @@ function toggleMegaMenu(e) {
|
|
|
197
197
|
}
|
|
198
198
|
|
|
199
199
|
function handleMouseUp(e) {
|
|
200
|
-
var button = e.target.closest('.js-toggle-domain-search');
|
|
200
|
+
var button = e.target.closest('.js-toggle-domain-search-page');
|
|
201
201
|
|
|
202
202
|
if (button && megaMenu.getAttribute('aria-hidden') === 'false') {
|
|
203
203
|
hideMegaMenu();
|
package/package.json
CHANGED
|
@@ -55,9 +55,9 @@ module.exports = {
|
|
|
55
55
|
url: false,
|
|
56
56
|
is_current: false,
|
|
57
57
|
icon: 'icon-arrow-down',
|
|
58
|
-
extra_class: 'js-toggle-domain-search',
|
|
58
|
+
extra_class: 'js-toggle-domain-search-page',
|
|
59
59
|
has_expandable: true,
|
|
60
|
-
controls: 'domain-search',
|
|
60
|
+
controls: 'domain-search-page',
|
|
61
61
|
hide_mobile: true
|
|
62
62
|
},
|
|
63
63
|
{
|
|
@@ -11,75 +11,21 @@
|
|
|
11
11
|
@use '../../vendor/grid/breakpoints' as breakpoint;
|
|
12
12
|
|
|
13
13
|
@include mixin.organism(domain-search) {
|
|
14
|
-
padding: func.rhythm(2) 0 func.rhythm(1) 0;
|
|
15
|
-
|
|
16
|
-
&:not([class*='is-in-mega-menu']) {
|
|
17
|
-
display: none;
|
|
18
|
-
position: absolute;
|
|
19
|
-
z-index: func.z_index(middlegroundImportant);
|
|
20
|
-
bottom: 0;
|
|
21
|
-
transform: translateY(0);
|
|
22
|
-
transition: transform 0.25s ease-out;
|
|
23
|
-
|
|
24
|
-
&[aria-hidden='false'] {
|
|
25
|
-
|
|
26
|
-
@extend %box-shadow;
|
|
27
|
-
|
|
28
|
-
transform: translateY(100%);
|
|
29
|
-
|
|
30
|
-
a,
|
|
31
|
-
button,
|
|
32
|
-
input {
|
|
33
|
-
animation-direction: reverse;
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
@include breakpoint.bp-up(xl) {
|
|
38
|
-
display: flex;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&[aria-hidden='true'] {
|
|
42
|
-
a,
|
|
43
|
-
button,
|
|
44
|
-
input {
|
|
45
|
-
display: none;
|
|
46
|
-
animation: 0 ease-in 0s 2s reverse both paused fadeIn;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
a {
|
|
52
|
-
color: colors.$color-cyberspace;
|
|
53
|
-
text-decoration: underline;
|
|
54
|
-
|
|
55
|
-
&:hover,
|
|
56
|
-
&:focus {
|
|
57
|
-
border-bottom: func.to_rem(2px) solid colors.$color-jade;
|
|
58
|
-
border-radius: 0;
|
|
59
|
-
background-color: transparent;
|
|
60
|
-
text-decoration: none;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
[class*='icon'] {
|
|
64
|
-
transform: translateY(func.to_rem(2px));
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
14
|
|
|
68
15
|
@include breakpoint.bp-up(md) {
|
|
69
16
|
padding: func.rhythm(3) func.rhythm(1);
|
|
70
17
|
}
|
|
71
18
|
|
|
72
|
-
@include bem.e(
|
|
73
|
-
|
|
19
|
+
@include bem.e(form-wrapper) {
|
|
20
|
+
gap: func.rhythm(2);
|
|
74
21
|
}
|
|
75
22
|
|
|
76
23
|
@include bem.e(input) {
|
|
77
24
|
display: block;
|
|
78
25
|
width: calc(100% - #{func.rhythm(2)});
|
|
79
|
-
margin-right: func.rhythm(2);
|
|
80
26
|
padding: func.rhythm(1) func.rhythm(2);
|
|
81
27
|
transition: padding 0.25s ease-out;
|
|
82
|
-
border:
|
|
28
|
+
border: 1px solid colors.$color-granit;
|
|
83
29
|
border-radius: var.$border-radius;
|
|
84
30
|
background-color: color.adjust(colors.$color-ash, $lightness: 4%);
|
|
85
31
|
letter-spacing: -0.1px;
|
|
@@ -89,51 +35,6 @@
|
|
|
89
35
|
font-size: func.to_rem(32px);
|
|
90
36
|
}
|
|
91
37
|
|
|
92
|
-
@include bem.m(force-focus-look) {
|
|
93
|
-
background-color: color.adjust(colors.$color-ash, $lightness: 4%);
|
|
94
|
-
|
|
95
|
-
&:focus {
|
|
96
|
-
background-color: color.adjust(colors.$color-ash, $lightness: 4%);
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
@include bem.e(list) {
|
|
102
|
-
display: flex;
|
|
103
|
-
flex-wrap: wrap;
|
|
104
|
-
padding: func.rhythm(1) 0 0 0;
|
|
105
|
-
|
|
106
|
-
li {
|
|
107
|
-
padding: func.rhythm(1) 0;
|
|
108
|
-
white-space: nowrap;
|
|
109
|
-
|
|
110
|
-
+ li {
|
|
111
|
-
border-top: 1px solid colors.$color-concrete;
|
|
112
|
-
|
|
113
|
-
@include breakpoint.bp-up(md) {
|
|
114
|
-
padding-bottom: 0;
|
|
115
|
-
border-top: 0;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
a {
|
|
120
|
-
padding: 0 func.rhythm(1);
|
|
121
|
-
border-bottom: 0;
|
|
122
|
-
font-size: func.to_rem(var.$size-medium-plus);
|
|
123
|
-
text-decoration: underline;
|
|
124
|
-
|
|
125
|
-
@include breakpoint.bp-up(md) {
|
|
126
|
-
padding: 0;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
@include breakpoint.bp-up(md) {
|
|
133
|
-
|
|
134
|
-
@include bem.e(pretext) {
|
|
135
|
-
font-size: func.to_rem(32px);
|
|
136
|
-
}
|
|
137
38
|
}
|
|
138
39
|
|
|
139
40
|
@include bem.e(submit) {
|
|
@@ -152,24 +53,10 @@
|
|
|
152
53
|
}
|
|
153
54
|
}
|
|
154
55
|
|
|
155
|
-
@include
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
@keyframes fadeIn {
|
|
161
|
-
0% {
|
|
162
|
-
opacity: 0;
|
|
163
|
-
display: none;
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
1% {
|
|
167
|
-
opacity: 1;
|
|
168
|
-
display: block;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
100% {
|
|
172
|
-
opacity: 1;
|
|
173
|
-
display: block;
|
|
56
|
+
@include bem.e(result) {
|
|
57
|
+
@include bem.e(button-wrapper) {
|
|
58
|
+
flex-wrap: wrap;
|
|
59
|
+
gap: func.rhythm(2);
|
|
60
|
+
}
|
|
174
61
|
}
|
|
175
62
|
}
|
|
@@ -3,9 +3,49 @@ module.exports = {
|
|
|
3
3
|
|
|
4
4
|
context: {
|
|
5
5
|
hidden: 'false',
|
|
6
|
-
id: 'domain-search',
|
|
7
|
-
addidional_classes: 'o-domain-search--narrow',
|
|
6
|
+
id: 'domain-search-page',
|
|
7
|
+
addidional_classes: 'o-domain-search-page--narrow',
|
|
8
8
|
label: 'sök en .se- eller .nu-domän',
|
|
9
|
-
white_background: true
|
|
10
|
-
|
|
9
|
+
white_background: true,
|
|
10
|
+
result: false,
|
|
11
|
+
available: false,
|
|
12
|
+
},
|
|
13
|
+
variants: [
|
|
14
|
+
{
|
|
15
|
+
name: 'result-available',
|
|
16
|
+
context: {
|
|
17
|
+
result: false,
|
|
18
|
+
available: true,
|
|
19
|
+
wildcard: false,
|
|
20
|
+
duplicate: false,
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'result-unavailable',
|
|
25
|
+
context: {
|
|
26
|
+
result: true,
|
|
27
|
+
available: false,
|
|
28
|
+
wildcard: false,
|
|
29
|
+
duplicate: false,
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'result-wildcard',
|
|
34
|
+
context: {
|
|
35
|
+
result: true,
|
|
36
|
+
available: false,
|
|
37
|
+
wildcard: true,
|
|
38
|
+
duplicate: false,
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
name: 'result-duplicate',
|
|
43
|
+
context: {
|
|
44
|
+
result: true,
|
|
45
|
+
available: false,
|
|
46
|
+
wildcard: false,
|
|
47
|
+
duplicate: true,
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
]
|
|
11
51
|
};
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import debounce from '../../assets/js/debounce';
|
|
2
|
+
import hasCookieConsent from '../../assets/js/hasCookieConsent';
|
|
3
|
+
|
|
4
|
+
let consent = hasCookieConsent('C0003');
|
|
2
5
|
|
|
3
6
|
const slidingForm = document.querySelector('[class*="--sliding"]');
|
|
4
7
|
const staticForm = document.querySelector('[class*="--static"]');
|
|
@@ -79,7 +82,7 @@ function slideForm() {
|
|
|
79
82
|
}
|
|
80
83
|
|
|
81
84
|
const elementIsInViewport = debounce(() => {
|
|
82
|
-
if (slidingForm) {
|
|
85
|
+
if (consent && slidingForm) {
|
|
83
86
|
slideForm();
|
|
84
87
|
}
|
|
85
88
|
}, throttle);
|
|
@@ -209,7 +209,7 @@ function toggleMegaMenu(e) {
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
function handleMouseUp(e) {
|
|
212
|
-
const button = e.target.closest('.js-toggle-domain-search');
|
|
212
|
+
const button = e.target.closest('.js-toggle-domain-search-page');
|
|
213
213
|
|
|
214
214
|
if (button && megaMenu.getAttribute('aria-hidden') === 'false') {
|
|
215
215
|
hideMegaMenu();
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
status: 'wip',
|
|
3
|
+
|
|
4
|
+
context: {
|
|
5
|
+
noResult: true,
|
|
6
|
+
singleResult: false,
|
|
7
|
+
availableResult: false,
|
|
8
|
+
wildcardResult: false,
|
|
9
|
+
duplicateResult: false,
|
|
10
|
+
},
|
|
11
|
+
variants: [
|
|
12
|
+
{
|
|
13
|
+
name: 'result-available',
|
|
14
|
+
context: {
|
|
15
|
+
noResult: false,
|
|
16
|
+
availableResult: true,
|
|
17
|
+
singleResult: false,
|
|
18
|
+
wildcardResult: false,
|
|
19
|
+
duplicateResult: false
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: 'result-unavailable',
|
|
24
|
+
context: {
|
|
25
|
+
noResult: false,
|
|
26
|
+
availableResult: false,
|
|
27
|
+
singleResult: true,
|
|
28
|
+
wildcardResult: false,
|
|
29
|
+
duplicateResult: false
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'result-wildcard',
|
|
34
|
+
context: {
|
|
35
|
+
noResult: false,
|
|
36
|
+
availableResult: false,
|
|
37
|
+
singleResult: false,
|
|
38
|
+
wildcardResult: true,
|
|
39
|
+
duplicateResult: false,
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'result-duplicate',
|
|
44
|
+
context: {
|
|
45
|
+
noResult: false,
|
|
46
|
+
availableResult: false,
|
|
47
|
+
singleResult: false,
|
|
48
|
+
wildcardResult: false,
|
|
49
|
+
duplicateResult: true,
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
]
|
|
53
|
+
};
|
package/src/utilities/_text.scss
CHANGED
|
@@ -15,3 +15,15 @@
|
|
|
15
15
|
.u-style-no-italic {
|
|
16
16
|
font-style: normal !important;
|
|
17
17
|
}
|
|
18
|
+
|
|
19
|
+
.u-uppercase {
|
|
20
|
+
text-transform: uppercase !important;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.u-lowercase {
|
|
24
|
+
text-transform: lowercase !important;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.u-capitalize {
|
|
28
|
+
text-transform: capitalize !important;
|
|
29
|
+
}
|