@bonniernews/dn-design-system-web 31.2.4 → 31.4.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.
- package/CHANGELOG.md +48 -0
- package/assets/teaser/teaser.scss +38 -0
- package/components/teaser-large/teaser-large.scss +0 -38
- package/components/teaser-split/teaser-split.scss +6 -0
- package/components/teaser-standard/README.md +1 -0
- package/components/teaser-standard/teaser-standard.js +7 -4
- package/components/teaser-standard/teaser-standard.njk +58 -47
- package/components/teaser-standard/teaser-standard.scss +40 -5
- package/foundations/variables/colorsDnLight.scss +1 -1
- package/package.json +1 -1
- package/variables/colors-light-mode.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,54 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [31.4.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@31.3.0...@bonniernews/dn-design-system-web@31.4.0) (2025-04-16)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **web:** support byline in standardteaser ([#1698](https://github.com/BonnierNews/dn-design-system/issues/1698)) ([12556b9](https://github.com/BonnierNews/dn-design-system/commit/12556b9390f7d219a93181733d19f59cbde4b3ca))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
* **app:** do not set animatedStyle on disabled PressableOpacity ([#1707](https://github.com/BonnierNews/dn-design-system/issues/1707)) ([fe84072](https://github.com/BonnierNews/dn-design-system/commit/fe840728c8e7e9a261f4536f66fa9801aa787be7))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Maintenance
|
|
21
|
+
|
|
22
|
+
* **deps-dev:** bump @react-native/metro-config from 0.75.2 to 0.79.1 ([#1704](https://github.com/BonnierNews/dn-design-system/issues/1704)) ([bf31863](https://github.com/BonnierNews/dn-design-system/commit/bf31863996356a3d43f82db8b657c352e0f87693))
|
|
23
|
+
* prerelease packages ([2a7fd96](https://github.com/BonnierNews/dn-design-system/commit/2a7fd96de28bdf59eeaec12f36cc087293ee3cc9))
|
|
24
|
+
* prerelease packages ([c3f4952](https://github.com/BonnierNews/dn-design-system/commit/c3f4952621f1050ca6dad69fa7f496c9623c2044))
|
|
25
|
+
* **web:** change to old token for checkout ([#1701](https://github.com/BonnierNews/dn-design-system/issues/1701)) ([d7fc4c5](https://github.com/BonnierNews/dn-design-system/commit/d7fc4c58e3bb84d9fa312be6d55c4e3379b96c19))
|
|
26
|
+
* **web:** debug screenshot update ([#1700](https://github.com/BonnierNews/dn-design-system/issues/1700)) ([4b56a40](https://github.com/BonnierNews/dn-design-system/commit/4b56a4008ae6aff0974b43d57791d4f89d4d884d))
|
|
27
|
+
* **web:** revert snapshot updates ([#1702](https://github.com/BonnierNews/dn-design-system/issues/1702)) ([769b39f](https://github.com/BonnierNews/dn-design-system/commit/769b39f73735a3e899807b47d3b7825cc3a139c5))
|
|
28
|
+
|
|
29
|
+
## [31.3.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@31.2.5...@bonniernews/dn-design-system-web@31.3.0) (2025-04-14)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
### Features
|
|
33
|
+
|
|
34
|
+
* **web:** break long words in split teaser ([#1684](https://github.com/BonnierNews/dn-design-system/issues/1684)) ([dfa70a6](https://github.com/BonnierNews/dn-design-system/commit/dfa70a6ceda7fd525d28636fa09a8b2f424ca467))
|
|
35
|
+
|
|
36
|
+
## [31.2.5](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@31.2.4...@bonniernews/dn-design-system-web@31.2.5) (2025-04-11)
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
### Bug Fixes
|
|
40
|
+
|
|
41
|
+
* **app:** medium fontweight Button ([#1686](https://github.com/BonnierNews/dn-design-system/issues/1686)) ([392b0cb](https://github.com/BonnierNews/dn-design-system/commit/392b0cbb277868241c902c3096f3fc6b26b20dd2))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### Maintenance
|
|
45
|
+
|
|
46
|
+
* **deps-dev:** bump @babel/runtime from 7.26.10 to 7.27.0 ([#1676](https://github.com/BonnierNews/dn-design-system/issues/1676)) ([3ccfb79](https://github.com/BonnierNews/dn-design-system/commit/3ccfb79956ad5fb3dd3b5e37284b66a1f7219f8b))
|
|
47
|
+
* **deps-dev:** bump axios from 1.8.3 to 1.8.4 ([#1673](https://github.com/BonnierNews/dn-design-system/issues/1673)) ([109626a](https://github.com/BonnierNews/dn-design-system/commit/109626ad5a55ed72ade512fdc637d5467e2e986c))
|
|
48
|
+
* **deps:** bump @babel/core from 7.26.9 to 7.26.10 ([#1674](https://github.com/BonnierNews/dn-design-system/issues/1674)) ([3c3f13b](https://github.com/BonnierNews/dn-design-system/commit/3c3f13bc6fd2a717df6fb246926270e5b464f7cf))
|
|
49
|
+
* **deps:** bump image-size from 1.1.1 to 1.2.1 ([#1682](https://github.com/BonnierNews/dn-design-system/issues/1682)) ([a72069f](https://github.com/BonnierNews/dn-design-system/commit/a72069f588010790e8a3948b10ea4aea9a74a778))
|
|
50
|
+
* **deps:** bump sass from 1.85.1 to 1.86.3 ([#1687](https://github.com/BonnierNews/dn-design-system/issues/1687)) ([f9d6b2d](https://github.com/BonnierNews/dn-design-system/commit/f9d6b2dffe546b265827b4ac45d2eaa7a5da8a8c))
|
|
51
|
+
* **foundations:** update variables from Figma ([#1690](https://github.com/BonnierNews/dn-design-system/issues/1690)) ([5a02617](https://github.com/BonnierNews/dn-design-system/commit/5a02617feeb8bab5625efdcf58e180595f344294))
|
|
52
|
+
* prerelease packages ([8ea072c](https://github.com/BonnierNews/dn-design-system/commit/8ea072cbb2df3b10d3fdb422403784dab24be9a6))
|
|
53
|
+
* prerelease packages ([80145b7](https://github.com/BonnierNews/dn-design-system/commit/80145b7da82f182783a16d2484e2a39edcaf3fd3))
|
|
54
|
+
|
|
7
55
|
## [31.2.4](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@31.2.3...@bonniernews/dn-design-system-web@31.2.4) (2025-03-27)
|
|
8
56
|
|
|
9
57
|
|
|
@@ -81,6 +81,44 @@ $ds-teaser-standard-image-width-desktop: 196px;
|
|
|
81
81
|
}
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
.ds-teaser__byline {
|
|
85
|
+
overflow: hidden;
|
|
86
|
+
position: relative;
|
|
87
|
+
margin-left: ds-spacing($ds-s-100);
|
|
88
|
+
margin-bottom: ds-spacing($ds-s-100, "px", true);
|
|
89
|
+
margin-top: ds-spacing($ds-s-025);
|
|
90
|
+
|
|
91
|
+
.picture {
|
|
92
|
+
position: absolute;
|
|
93
|
+
top: 0;
|
|
94
|
+
right: 0;
|
|
95
|
+
bottom: 0;
|
|
96
|
+
width: 100%;
|
|
97
|
+
min-width: 100%;
|
|
98
|
+
margin: auto 0 0;
|
|
99
|
+
max-height: 100%;
|
|
100
|
+
|
|
101
|
+
.picture__img {
|
|
102
|
+
margin: 0;
|
|
103
|
+
object-position: top;
|
|
104
|
+
max-height: unset;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@include ds-mq-largest-breakpoint(mobile) {
|
|
109
|
+
width: 96px;
|
|
110
|
+
min-height: 96px;
|
|
111
|
+
margin-left: ds-spacing($ds-s-050);
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
@include ds-mq-smallest-breakpoint(tablet) {
|
|
115
|
+
width: 144px;
|
|
116
|
+
// En bylinebild bör va lika hög som en "grekisk byst" - man ska se lite skjortkrage!
|
|
117
|
+
min-height: 110px;
|
|
118
|
+
margin-left: ds-spacing($ds-s-100);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
|
|
84
122
|
&--podcast {
|
|
85
123
|
.ds-teaser__vignette {
|
|
86
124
|
display: flex;
|
|
@@ -64,44 +64,6 @@
|
|
|
64
64
|
}
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
.ds-teaser__byline {
|
|
68
|
-
overflow: hidden;
|
|
69
|
-
position: relative;
|
|
70
|
-
margin-left: ds-spacing($ds-s-100);
|
|
71
|
-
margin-bottom: ds-spacing($ds-s-100, "px", true);
|
|
72
|
-
margin-top: ds-spacing($ds-s-025);
|
|
73
|
-
|
|
74
|
-
.picture {
|
|
75
|
-
position: absolute;
|
|
76
|
-
top: 0;
|
|
77
|
-
right: 0;
|
|
78
|
-
bottom: 0;
|
|
79
|
-
width: 100%;
|
|
80
|
-
min-width: 100%;
|
|
81
|
-
margin: auto 0 0;
|
|
82
|
-
max-height: 100%;
|
|
83
|
-
|
|
84
|
-
.picture__img {
|
|
85
|
-
margin: 0;
|
|
86
|
-
object-position: top;
|
|
87
|
-
max-height: unset;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
@include ds-mq-largest-breakpoint(mobile) {
|
|
92
|
-
width: 96px;
|
|
93
|
-
min-height: 96px;
|
|
94
|
-
margin-left: ds-spacing($ds-s-050);
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
@include ds-mq-smallest-breakpoint(tablet) {
|
|
98
|
-
width: 144px;
|
|
99
|
-
// En bylinebild bör va lika hög som en "grekisk byst" - man ska se lite skjortkrage!
|
|
100
|
-
min-height: 110px;
|
|
101
|
-
margin-left: ds-spacing($ds-s-100);
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
|
|
105
67
|
@include ds-mq-smallest-breakpoint(tablet) {
|
|
106
68
|
&.ds-teaser--right {
|
|
107
69
|
.ds-teaser__title {
|
|
@@ -31,7 +31,9 @@
|
|
|
31
31
|
display: block;
|
|
32
32
|
position: relative;
|
|
33
33
|
flex: 1;
|
|
34
|
+
min-width: 0; // Keep teaser from becoming too wide when it contains long word.
|
|
34
35
|
margin-right: ds-spacing($ds-s-100);
|
|
36
|
+
|
|
35
37
|
&:last-child {
|
|
36
38
|
margin-right: 0;
|
|
37
39
|
}
|
|
@@ -73,6 +75,10 @@
|
|
|
73
75
|
@include ds-typography($ds-typography-detail-teaser-twin);
|
|
74
76
|
}
|
|
75
77
|
|
|
78
|
+
.ds-teaser__text {
|
|
79
|
+
overflow-wrap: break-word;
|
|
80
|
+
}
|
|
81
|
+
|
|
76
82
|
.ds-teaser__media {
|
|
77
83
|
margin-top: ds-spacing($ds-s-025);
|
|
78
84
|
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
|highlight | String | no | | | Text before the heading |
|
|
21
21
|
|sticker | String | no | | | Red text before the text |
|
|
22
22
|
|mediaHtml | HTML String | no | | | Main image or other media |
|
|
23
|
+
|bylineHtml | HTML String | no | | | Side image of the author |
|
|
23
24
|
|isItalicHeadline | bool | no | true, false | false | If the headline should be italic |
|
|
24
25
|
|isCompact | bool | no | true, false | false | If the headline should be compact |
|
|
25
26
|
|isFlashingDot | bool | no | true, false | false | If there should be a flashing ball before the text |
|
|
@@ -8,13 +8,16 @@ function dsTeaserStandard(params = {}) {
|
|
|
8
8
|
// NOTE: this should match output of teaser-standard.njk for a subset of the parameters
|
|
9
9
|
teaser.innerHTML = `
|
|
10
10
|
<div class="ds-teaser__content">
|
|
11
|
-
<div class="ds-
|
|
12
|
-
|
|
13
|
-
<
|
|
14
|
-
|
|
11
|
+
<div class="ds-teaser__content-inner">
|
|
12
|
+
<div class="ds-teaser__title"></div>
|
|
13
|
+
<p class="ds-teaser__text">
|
|
14
|
+
<span class="ds-teaser-dot"></span>
|
|
15
|
+
</p>
|
|
16
|
+
</div>
|
|
15
17
|
</div>`;
|
|
16
18
|
teaser.classList.add("ds-teaser");
|
|
17
19
|
teaser.classList.add("ds-teaser--standard");
|
|
20
|
+
teaser.classList.add("ds-teaser--standard-without-byline");
|
|
18
21
|
|
|
19
22
|
if (params.targetLink) {
|
|
20
23
|
teaser.setAttribute("href", params.targetLink)
|
|
@@ -11,6 +11,9 @@
|
|
|
11
11
|
"ds-teaser--standard",
|
|
12
12
|
classNamePrefix + params.variant if params.variant,
|
|
13
13
|
classNamePrefix + "compact" if params.isCompact,
|
|
14
|
+
classNamePrefix + "standard-with-byline" if params.bylineHtml,
|
|
15
|
+
classNamePrefix + "standard-without-byline" if not params.bylineHtml,
|
|
16
|
+
classNamePrefix + "standard-with-vignette" if params.vignette,
|
|
14
17
|
params.classNames if params.classNames
|
|
15
18
|
] | join(" ") %}
|
|
16
19
|
|
|
@@ -22,58 +25,66 @@
|
|
|
22
25
|
classNames: extraClasses
|
|
23
26
|
}) %}
|
|
24
27
|
<div class="{{ componentClassName + '__content'}}">
|
|
25
|
-
|
|
26
|
-
{%
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
{{
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
{% if params.vignette %}
|
|
37
|
-
<div class="ds-teaser__vignette">
|
|
38
|
-
{% if params.variant === "podcast" %}
|
|
39
|
-
{{ IconUse({ icon: "headphones" }) }}
|
|
40
|
-
{% endif %}
|
|
41
|
-
{{ params.vignette }}
|
|
42
|
-
</div>
|
|
43
|
-
{% endif %}
|
|
28
|
+
<div class="ds-teaser__content-inner">
|
|
29
|
+
{% if params.mediaHtml and not params.bylineHtml %}
|
|
30
|
+
{% set mediaClass = [
|
|
31
|
+
componentClassName + '__media',
|
|
32
|
+
componentClassName + '__media--rounded' if not params.isItalicHeadline,
|
|
33
|
+
componentClassName + '__media--square-image' if params.isSquareImage
|
|
34
|
+
] | join(" ") %}
|
|
35
|
+
<div class="{{ mediaClass }}">
|
|
36
|
+
{{ params.mediaHtml }}
|
|
37
|
+
</div>
|
|
38
|
+
{% endif %}
|
|
44
39
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
40
|
+
{% if params.vignette %}
|
|
41
|
+
<div class="ds-teaser__vignette">
|
|
42
|
+
{% if params.variant === "podcast" %}
|
|
43
|
+
{{ IconUse({ icon: "headphones" }) }}
|
|
44
|
+
{% endif %}
|
|
45
|
+
{{ params.vignette }}
|
|
46
|
+
</div>
|
|
48
47
|
{% endif %}
|
|
49
|
-
{{ params.title }}
|
|
50
|
-
</h2>
|
|
51
48
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
{{ TeaserDot({ flashing: params.isFlashingDot }) }}
|
|
56
|
-
<span class="ds-teaser__sticker">
|
|
57
|
-
{{ params.sticker }}
|
|
58
|
-
</span>
|
|
49
|
+
<h2 class="{{ componentClassName + '__title'}} {{ componentClassName + '__title--italic' if params.isItalicHeadline}}">
|
|
50
|
+
{% if params.highlight %}
|
|
51
|
+
<span class="{{ componentClassName + '__highlight'}}">{{ params.highlight }}</span>
|
|
59
52
|
{% endif %}
|
|
60
|
-
{{ params.
|
|
61
|
-
</
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
53
|
+
{{ params.title }}
|
|
54
|
+
</h2>
|
|
55
|
+
|
|
56
|
+
{% if params.text and params.areaType !== "right" %}
|
|
57
|
+
<p class="{{ componentClassName + '__text' }}">
|
|
58
|
+
{% if params.sticker %}
|
|
59
|
+
{{ TeaserDot({ flashing: params.isFlashingDot }) }}
|
|
60
|
+
<span class="ds-teaser__sticker">
|
|
61
|
+
{{ params.sticker }}
|
|
62
|
+
</span>
|
|
63
|
+
{% endif %}
|
|
64
|
+
{{ params.text }}
|
|
65
|
+
</p>
|
|
66
|
+
{% endif %}
|
|
67
|
+
{% if params.variant === "podcast" %}
|
|
68
|
+
{{ TeaserFooter({
|
|
69
|
+
variant: "podcast",
|
|
73
70
|
publicationTime: params.publicationTime,
|
|
74
|
-
|
|
75
|
-
})
|
|
76
|
-
}
|
|
71
|
+
duration: params.duration
|
|
72
|
+
})}}
|
|
73
|
+
{% elif params.publicationTime %}
|
|
74
|
+
{{
|
|
75
|
+
TeaserFooter({
|
|
76
|
+
variant: "informationText",
|
|
77
|
+
publicationTime: params.publicationTime,
|
|
78
|
+
sectionName: params.sectionName
|
|
79
|
+
})
|
|
80
|
+
}}
|
|
81
|
+
{% endif %}
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
{% if params.bylineHtml %}
|
|
85
|
+
<div class="{{ componentClassName + '__byline'}}">
|
|
86
|
+
{{ params.bylineHtml | safe }}
|
|
87
|
+
</div>
|
|
77
88
|
{% endif %}
|
|
78
89
|
</div>
|
|
79
90
|
{% endcall %}
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
overflow: hidden;
|
|
7
7
|
|
|
8
8
|
.ds-teaser__vignette {
|
|
9
|
-
|
|
9
|
+
padding-top: ds-spacing($ds-s-025);
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
.ds-teaser__title {
|
|
@@ -25,15 +25,50 @@
|
|
|
25
25
|
@include ds-typography($ds-typography-detail-teaser-standard-compact-opinion);
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
|
+
|
|
29
|
+
@include ds-hover(true) {
|
|
30
|
+
.ds-teaser__title {
|
|
31
|
+
@include ds-underline(2px);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
28
34
|
}
|
|
29
35
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
36
|
+
&.ds-teaser--standard-without-byline {
|
|
37
|
+
.ds-teaser__media,
|
|
38
|
+
.ds-teaser__content {
|
|
39
|
+
margin-bottom: ds-spacing($ds-s-100);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ds-teaser__content .ds-teaser__content-inner {
|
|
43
|
+
display: block;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
&.ds-teaser--standard-with-byline {
|
|
48
|
+
.ds-teaser__content .ds-teaser__content-inner {
|
|
49
|
+
padding-bottom: ds-spacing($ds-s-075);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@include ds-hover(true) {
|
|
54
|
+
.ds-teaser__title {
|
|
55
|
+
@include ds-underline(3px);
|
|
56
|
+
}
|
|
33
57
|
}
|
|
34
58
|
|
|
35
59
|
.ds-teaser__content {
|
|
36
|
-
display:
|
|
60
|
+
display: flex;
|
|
61
|
+
flex-direction: row;
|
|
62
|
+
|
|
63
|
+
.ds-teaser__content-inner {
|
|
64
|
+
display: flex;
|
|
65
|
+
flex-direction: column;
|
|
66
|
+
flex: 1;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.ds-teaser__byline {
|
|
71
|
+
float: right;
|
|
37
72
|
}
|
|
38
73
|
|
|
39
74
|
.ds-teaser__media {
|
package/package.json
CHANGED