@bonniernews/dn-design-system-web 16.2.1 → 18.0.0-beta.0

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,59 +6,73 @@
6
6
  @use "../button-toggle/button-toggle.scss" as *;
7
7
 
8
8
  $ds-list-item__icon-size: 24px;
9
-
10
- .ds-list-item__outer {
11
- list-style: none;
12
- line-height: 0;
13
- position: relative;
14
- }
9
+ $ds-list-item__portrait-size: 44px;
10
+ $ds-list-item__portrait-size--small: 36px;
15
11
 
16
12
  .ds-list-item {
17
- cursor: pointer;
18
13
  background-color: transparent;
19
14
  border: 0;
20
- display: inline-flex;
15
+ display: flex;
16
+ flex-direction: column;
21
17
  align-items: center;
22
18
  justify-content: center;
23
- padding: 0;
24
19
  width: 100%;
20
+ list-style: none;
21
+ line-height: 0;
25
22
  position: relative;
26
23
 
27
- .ds-list-item__inner {
24
+ &.ds-list-item--border:not(:last-of-type)::after {
25
+ content: "";
26
+ width: 100%;
27
+ height: ds-border-width(x1);
28
+ background: $ds-color-border-primary;
29
+ position: absolute;
30
+ bottom: 0;
31
+ }
32
+
33
+ .ds-list-item__content {
28
34
  box-sizing: border-box;
29
35
  border-radius: 0;
30
36
  margin: 0;
31
37
  display: flex;
38
+ gap: ds-spacing($ds-s-100);
32
39
  align-items: center;
33
40
  justify-content: space-between;
34
- position: relative;
35
- padding: ds-spacing($ds-s-100 $ds-s-100);
41
+ padding: ds-spacing($ds-s-100 0);
36
42
  width: 100%;
43
+ border: none;
44
+ background: none;
37
45
 
38
- &::before {
39
- content: "";
40
- border-radius: inherit;
41
- pointer-events: none;
42
- position: absolute;
43
- top: 0;
44
- left: 0;
45
- bottom: 0;
46
- right: 0;
46
+ &:active {
47
+ opacity: 0.6;
47
48
  }
49
+ }
48
50
 
49
- .ds-icon {
50
- position: relative;
51
- display: flex;
52
- height: ds-px-to-rem($ds-list-item__icon-size);
53
- width: ds-px-to-rem($ds-list-item__icon-size);
54
- margin: 0;
55
- @at-root .ds-force-px#{&} {
56
- height: $ds-list-item__icon-size;
57
- width: $ds-list-item__icon-size;
58
- }
59
- svg {
60
- fill: currentColor;
61
- }
51
+ label.ds-list-item__content,
52
+ button.ds-list-item__content,
53
+ a.ds-list-item__content {
54
+ cursor: pointer;
55
+ @include ds-hover(true) {
56
+ opacity: 0.6;
57
+ }
58
+ }
59
+
60
+ a.ds-list-item__content {
61
+ text-decoration: none; /* full-element links are covered by the opacity hover effect - adding underlines makes it too busy */
62
+ }
63
+
64
+ .ds-icon {
65
+ position: relative;
66
+ display: flex;
67
+ height: ds-px-to-rem($ds-list-item__icon-size);
68
+ width: ds-px-to-rem($ds-list-item__icon-size);
69
+ margin: 0;
70
+ @at-root .ds-force-px#{&} {
71
+ height: $ds-list-item__icon-size;
72
+ width: $ds-list-item__icon-size;
73
+ }
74
+ svg {
75
+ fill: currentColor;
62
76
  }
63
77
  }
64
78
 
@@ -72,6 +86,7 @@ $ds-list-item__icon-size: 24px;
72
86
  flex-direction: column;
73
87
  flex-grow: 1;
74
88
  align-items: flex-start;
89
+ overflow-wrap: anywhere;
75
90
 
76
91
  .ds-list-item__title {
77
92
  @include ds-typography($ds-typography-functionalbody02);
@@ -82,12 +97,17 @@ $ds-list-item__icon-size: 24px;
82
97
  text-align: left;
83
98
  }
84
99
 
100
+ a.ds-list-item__title {
101
+ @include ds-link($ds-link-list);
102
+ }
103
+
85
104
  .ds-list-item__subtitle {
86
105
  @include ds-typography($ds-typography-functionalbody02);
87
106
  @at-root .ds-force-px#{&} {
88
107
  @include ds-typography($ds-typography-functionalbody02, true);
89
108
  }
90
109
  color: $ds-color-text-primary-02;
110
+ text-align: left;
91
111
  }
92
112
  }
93
113
 
@@ -97,17 +117,15 @@ $ds-list-item__icon-size: 24px;
97
117
  @include ds-typography($ds-typography-functionalbody01, true);
98
118
  }
99
119
  color: $ds-color-text-primary-02;
100
- margin-left: ds-spacing($ds-s-100);
120
+ text-align: right;
101
121
  }
102
122
 
103
123
  .ds-list-item__icon-left {
104
124
  display: inline-flex;
105
- margin-right: ds-spacing($ds-s-100);
106
125
  }
107
126
 
108
127
  .ds-list-item__icon-right {
109
128
  display: inline-flex;
110
- margin-left: ds-spacing($ds-s-100);
111
129
  }
112
130
 
113
131
  .ds-list-item__image {
@@ -129,8 +147,6 @@ $ds-list-item__icon-size: 24px;
129
147
  }
130
148
 
131
149
  + .ds-list-item__titles {
132
- margin-left: ds-spacing($ds-s-100);
133
-
134
150
  .ds-list-item__title {
135
151
  @include ds-typography($ds-typography-functionalbody02, $fontWeight: $ds-fontweight-semibold);
136
152
 
@@ -141,15 +157,23 @@ $ds-list-item__icon-size: 24px;
141
157
  }
142
158
  }
143
159
 
144
- @include ds-hover() {
145
- &:hover:not(.ds-list-item--disabled) .ds-list-item__inner::before {
146
- background-color: $ds-color-component-primary-overlay;
160
+ .ds-list-item__portrait {
161
+ border-radius: 50%;
162
+ overflow: hidden;
163
+ background-color: $ds-color-component-primary-overlay;
164
+ flex-shrink: 0;
165
+
166
+ .picture,
167
+ img {
168
+ width: ds-px-to-rem($ds-list-item__portrait-size);
169
+ height: ds-px-to-rem($ds-list-item__portrait-size);
147
170
  }
148
171
  }
149
172
 
150
173
  &:active:not(.ds-list-item--disabled) .ds-list-item__inner::before {
151
174
  background-color: $ds-color-component-primary-overlay;
152
175
  }
176
+
153
177
  &:focus-visible {
154
178
  outline: none;
155
179
  .ds-list-item__inner {
@@ -165,34 +189,15 @@ $ds-list-item__icon-size: 24px;
165
189
  }
166
190
  }
167
191
 
168
- .ds-list-item--border {
169
- position: relative;
170
-
171
- &::after,
172
- &.ds-list-item--accordion-active + .ds-list-item__accordion-inner::after {
173
- content: "";
174
- height: ds-border-width(x1);
175
- width: calc(100% - (ds-spacing($ds-s-100) * 2));
176
- background-color: $ds-color-border-primary;
177
- position: absolute;
178
- left: ds-spacing($ds-s-100);
179
- bottom: 0;
180
- }
181
-
182
- &.ds-list-item--accordion-active {
183
- &::after {
184
- background-color: transparent;
185
- }
186
- }
187
- }
188
-
189
192
  .ds-list-item--accordion {
190
- .ds-list-item__inner .ds-icon--expand_less {
193
+ .ds-icon--expand_less {
191
194
  display: none;
192
195
  }
193
196
 
194
197
  @at-root .ds-list-item__accordion-inner {
195
198
  display: none;
199
+ padding: ds-spacing(0 $ds-s-050);
200
+ border-top: ds-border-width(x1) solid $ds-color-border-primary;
196
201
  ul {
197
202
  margin: 0;
198
203
  padding: 0;
@@ -200,40 +205,22 @@ $ds-list-item__icon-size: 24px;
200
205
  }
201
206
 
202
207
  &.ds-list-item--accordion-active {
203
- .ds-list-item__inner .ds-icon--expand_less {
208
+ .ds-icon--expand_less {
204
209
  display: flex;
205
210
  }
206
- .ds-list-item__inner .ds-icon--expand_more {
211
+ .ds-icon--expand_more {
207
212
  display: none;
208
213
  }
209
214
 
210
215
  & + .ds-list-item__accordion-inner {
211
216
  display: block;
212
- position: relative;
213
217
  }
214
218
  }
215
219
  }
216
220
 
217
221
  .ds-list-item--disabled {
218
222
  cursor: not-allowed;
219
- .ds-list-item__titles .ds-list-item__title,
220
- .ds-list-item__titles .ds-list-item__subtitle {
221
- color: $ds-color-text-disabled;
222
- }
223
- .ds-list-item__icon-left,
224
- .ds-list-item__icon-right {
225
- color: $ds-color-icon-disabled;
226
- }
227
-
228
- .ds-list-item__wrapping-label::after {
229
- cursor: not-allowed;
230
- }
231
- .ds-list-item__inner {
232
- color: $ds-color-icon-disabled;
233
- &::before {
234
- background-color: unset;
235
- }
236
- }
223
+ opacity: 0.5;
237
224
  }
238
225
 
239
226
  .ds-list-item--accordion .ds-checkbox__accordion,
@@ -252,34 +239,42 @@ $ds-list-item__icon-size: 24px;
252
239
  }
253
240
  }
254
241
 
255
- .ds-list-item__wrapping-label {
256
- &::after {
257
- content: "";
242
+ .ds-list-item--toggle {
243
+ a {
244
+ @include ds-link($ds-link-list);
245
+ display: block;
258
246
  width: 100%;
259
- height: 100%;
260
- position: absolute;
261
- top: 0;
262
- left: 0;
263
- z-index: 1;
264
- cursor: pointer;
265
247
  }
266
248
  }
267
249
 
268
- .ds-list-item--toggle {
269
- cursor: default;
270
- .ds-list-item__inner {
271
- display: flex;
272
- padding: ds-spacing(0 0 0 $ds-s-100);
273
- }
250
+ .ds-list-item--byline {
274
251
  .ds-list-item__titles {
275
- padding: ds-spacing($ds-s-100) 0;
276
- }
277
- .ds-btn--toggle {
278
- margin: ds-spacing(0 $ds-s-100 0 $ds-s-100);
252
+ .ds-list-item__title {
253
+ @include ds-typography(
254
+ $ds-typography-functionalheading01,
255
+ $lineHeight: $ds-lineheight-m,
256
+ $fontWeight: $ds-fontweight-semibold
257
+ );
258
+ @at-root .ds-force-px#{&} {
259
+ @include ds-typography(
260
+ $ds-typography-functionalheading01,
261
+ $forcePx: true,
262
+ $lineHeight: $ds-lineheight-m,
263
+ $fontWeight: $ds-fontweight-semibold
264
+ );
265
+ }
266
+ }
279
267
  }
280
- a {
281
- @include ds-link($ds-link-list);
282
- display: block;
283
- width: 100%;
268
+
269
+ &.ds-byline--direkt {
270
+ padding: ds-spacing($ds-s-075 0);
271
+
272
+ .ds-list-item__portrait {
273
+ .picture,
274
+ img {
275
+ width: ds-px-to-rem($ds-list-item__portrait-size--small);
276
+ height: ds-px-to-rem($ds-list-item__portrait-size--small);
277
+ }
278
+ }
284
279
  }
285
280
  }
@@ -8,11 +8,7 @@
8
8
  @use "../variables/typographyTokensScreenSmall.scss" as *;
9
9
  @use "../variables/typographyTokensScreenLarge.scss" as *;
10
10
  @use "../variables/typographyTokensScreenExtraLarge.scss" as *;
11
- @use "../variables/deprecated/typographyTokensScreenSmall.scss" as deprecatedSmall;
12
- @use "../variables/deprecated/typographyTokensScreenLarge.scss" as deprecatedLarge;
13
- @use "../variables/deprecated/typographyTokensScreenExtraLarge.scss" as deprecatedExtraLarge;
14
11
  @use "fontFamily.scss" as *;
15
- @forward "../variables/deprecated/typographyTokensList.scss";
16
12
  @forward "../variables/typographyTokensList.scss";
17
13
  @forward "../variables/typographyFontWeight.scss";
18
14
  @forward "../variables/typographyLetterSpacing.scss";
@@ -51,13 +47,6 @@ $dsSerifWeights: (
51
47
  black: 900,
52
48
  );
53
49
 
54
- $typographyTokensScreenSmall: map.merge($typographyTokensScreenSmall, deprecatedSmall.$typographyTokensScreenSmall);
55
- $typographyTokensScreenLarge: map.merge($typographyTokensScreenLarge, deprecatedLarge.$typographyTokensScreenLarge);
56
- $typographyTokensScreenExtraLarge: map.merge(
57
- $typographyTokensScreenExtraLarge,
58
- deprecatedExtraLarge.$typographyTokensScreenExtraLarge
59
- );
60
-
61
50
  // Serif variation changes, text 18px, headline 26px, display 34px. As fallback we will always use headline
62
51
 
63
52
  @mixin ds-typography(
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "16.2.1",
3
+ "version": "18.0.0-beta.0",
4
4
  "description": "DN design system for web.",
5
5
  "main": "index.js",
6
6
  "homepage": "https://github.com/BonnierNews/dn-design-system/tree/main/web/src#readme",
@@ -1,78 +0,0 @@
1
- $ds-typography-expressive-heading01regular: 'expressive-heading01regular';
2
- $ds-typography-expressive-heading01semibold: 'expressive-heading01semibold';
3
- $ds-typography-expressive-heading01bold: 'expressive-heading01bold';
4
- $ds-typography-expressive-heading01italicregular: 'expressive-heading01italicregular';
5
- $ds-typography-expressive-heading01italicsemibold: 'expressive-heading01italicsemibold';
6
- $ds-typography-expressive-heading01italicbold: 'expressive-heading01italicbold';
7
- $ds-typography-expressive-heading02regular: 'expressive-heading02regular';
8
- $ds-typography-expressive-heading02semibold: 'expressive-heading02semibold';
9
- $ds-typography-expressive-heading02bold: 'expressive-heading02bold';
10
- $ds-typography-expressive-heading02italicregular: 'expressive-heading02italicregular';
11
- $ds-typography-expressive-heading02italicsemibold: 'expressive-heading02italicsemibold';
12
- $ds-typography-expressive-heading02italicbold: 'expressive-heading02italicbold';
13
- $ds-typography-expressive-heading03regular: 'expressive-heading03regular';
14
- $ds-typography-expressive-heading03semibold: 'expressive-heading03semibold';
15
- $ds-typography-expressive-heading03bold: 'expressive-heading03bold';
16
- $ds-typography-expressive-heading03italicregular: 'expressive-heading03italicregular';
17
- $ds-typography-expressive-heading03italicsemibold: 'expressive-heading03italicsemibold';
18
- $ds-typography-expressive-heading03italicbold: 'expressive-heading03italicbold';
19
- $ds-typography-expressive-heading04regular: 'expressive-heading04regular';
20
- $ds-typography-expressive-heading04semibold: 'expressive-heading04semibold';
21
- $ds-typography-expressive-heading04bold: 'expressive-heading04bold';
22
- $ds-typography-expressive-heading04italicregular: 'expressive-heading04italicregular';
23
- $ds-typography-expressive-heading04italicsemibold: 'expressive-heading04italicsemibold';
24
- $ds-typography-expressive-heading04italicbold: 'expressive-heading04italicbold';
25
- $ds-typography-expressive-heading05regular: 'expressive-heading05regular';
26
- $ds-typography-expressive-heading05semibold: 'expressive-heading05semibold';
27
- $ds-typography-expressive-heading05bold: 'expressive-heading05bold';
28
- $ds-typography-expressive-heading05italicregular: 'expressive-heading05italicregular';
29
- $ds-typography-expressive-heading05italicsemibold: 'expressive-heading05italicsemibold';
30
- $ds-typography-expressive-heading05italicbold: 'expressive-heading05italicbold';
31
- $ds-typography-functional-heading01regular: 'functional-heading01regular';
32
- $ds-typography-functional-heading01semibold: 'functional-heading01semibold';
33
- $ds-typography-functional-heading01bold: 'functional-heading01bold';
34
- $ds-typography-functional-heading02regular: 'functional-heading02regular';
35
- $ds-typography-functional-heading02semibold: 'functional-heading02semibold';
36
- $ds-typography-functional-heading02bold: 'functional-heading02bold';
37
- $ds-typography-functional-heading03regular: 'functional-heading03regular';
38
- $ds-typography-functional-heading03semibold: 'functional-heading03semibold';
39
- $ds-typography-functional-heading03bold: 'functional-heading03bold';
40
- $ds-typography-functional-heading04regular: 'functional-heading04regular';
41
- $ds-typography-functional-heading04semibold: 'functional-heading04semibold';
42
- $ds-typography-functional-heading04bold: 'functional-heading04bold';
43
- $ds-typography-functional-heading05regular: 'functional-heading05regular';
44
- $ds-typography-functional-heading05semibold: 'functional-heading05semibold';
45
- $ds-typography-functional-heading05bold: 'functional-heading05bold';
46
- $ds-typography-expressive-preamble01regular: 'expressive-preamble01regular';
47
- $ds-typography-expressive-preamble01semibold: 'expressive-preamble01semibold';
48
- $ds-typography-expressive-preamble01bold: 'expressive-preamble01bold';
49
- $ds-typography-expressive-preamble01italicregular: 'expressive-preamble01italicregular';
50
- $ds-typography-expressive-preamble01italicsemibold: 'expressive-preamble01italicsemibold';
51
- $ds-typography-expressive-preamble01italicbold: 'expressive-preamble01italicbold';
52
- $ds-typography-expressive-body01regular: 'expressive-body01regular';
53
- $ds-typography-expressive-body01semibold: 'expressive-body01semibold';
54
- $ds-typography-expressive-body01bold: 'expressive-body01bold';
55
- $ds-typography-expressive-body01italicregular: 'expressive-body01italicregular';
56
- $ds-typography-expressive-body01italicsemibold: 'expressive-body01italicsemibold';
57
- $ds-typography-expressive-body01italicbold: 'expressive-body01italicbold';
58
- $ds-typography-expressive-body02regular: 'expressive-body02regular';
59
- $ds-typography-expressive-body02semibold: 'expressive-body02semibold';
60
- $ds-typography-expressive-body02bold: 'expressive-body02bold';
61
- $ds-typography-expressive-body02italicregular: 'expressive-body02italicregular';
62
- $ds-typography-expressive-body02italicsemibold: 'expressive-body02italicsemibold';
63
- $ds-typography-expressive-body02italicbold: 'expressive-body02italicbold';
64
- $ds-typography-functional-body01regular: 'functional-body01regular';
65
- $ds-typography-functional-body01semibold: 'functional-body01semibold';
66
- $ds-typography-functional-body01bold: 'functional-body01bold';
67
- $ds-typography-functional-body02regular: 'functional-body02regular';
68
- $ds-typography-functional-body02semibold: 'functional-body02semibold';
69
- $ds-typography-functional-body02bold: 'functional-body02bold';
70
- $ds-typography-functional-body03regular: 'functional-body03regular';
71
- $ds-typography-functional-body03semibold: 'functional-body03semibold';
72
- $ds-typography-functional-body03bold: 'functional-body03bold';
73
- $ds-typography-functional-meta01regular: 'functional-meta01regular';
74
- $ds-typography-functional-meta01semibold: 'functional-meta01semibold';
75
- $ds-typography-functional-meta01bold: 'functional-meta01bold';
76
- $ds-typography-functional-meta02regular: 'functional-meta02regular';
77
- $ds-typography-functional-meta02semibold: 'functional-meta02semibold';
78
- $ds-typography-functional-meta02bold: 'functional-meta02bold';