@internetstiftelsen/styleguide 5.0.12-beta.0.1 → 5.0.13

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 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.
@@ -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();
@@ -249,4 +249,4 @@ if (closeMegaMenuBtn) {
249
249
  document.querySelector('#readspeakerBtn [class*=a-button--icon]').classList.add('u-hide-md');
250
250
  });
251
251
  });
252
- }
252
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetstiftelsen/styleguide",
3
- "version": "5.0.12-beta.0.1",
3
+ "version": "5.0.13",
4
4
  "main": "dist/components.js",
5
5
  "ports": {
6
6
  "fractal": "3000"
@@ -190,10 +190,6 @@
190
190
  transform: rotate(-45deg);
191
191
  }
192
192
  }
193
-
194
- @include breakpoint.bp-up(sm) {
195
- font-size: var.$size-base;
196
- }
197
193
  }
198
194
 
199
195
  @include bem.e(text) {
@@ -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(list-container) {
73
- padding: 0 func.rhythm(1) 0 func.rhythm(1);
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: 0;
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 breakpoint.bp-up(xl) {
156
- display: none;
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
  };
@@ -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
+ };
@@ -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
+ }