@bonniernews/dn-design-system-web 31.4.3 → 32.0.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 CHANGED
@@ -4,6 +4,24 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
4
4
 
5
5
 
6
6
 
7
+ ## [32.0.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@31.4.3...@bonniernews/dn-design-system-web@32.0.0) (2025-04-28)
8
+
9
+
10
+ ### ⚠ BREAKING CHANGES
11
+
12
+ * **web:** DO NOT USE 31.3.*-31.4.* They have misstakes (affecting standard teaser) that are now corrected
13
+
14
+ ### Bug Fixes
15
+
16
+ * **web:** change source for test images in hope to reduce flakyness ([#1718](https://github.com/BonnierNews/dn-design-system/issues/1718)) ([9b4008f](https://github.com/BonnierNews/dn-design-system/commit/9b4008fb0c7af7194976b5bcffd012f122a7389d))
17
+ * **web:** reapply the pr support byline in standardteaser after mergeknas ([#1720](https://github.com/BonnierNews/dn-design-system/issues/1720)) ([880bdae](https://github.com/BonnierNews/dn-design-system/commit/880bdaeaa9129652cd9654bcf76872229f40a414))
18
+
19
+
20
+ ### Maintenance
21
+
22
+ * **deps-dev:** bump axios from 1.8.4 to 1.9.0 ([#1715](https://github.com/BonnierNews/dn-design-system/issues/1715)) ([57460d2](https://github.com/BonnierNews/dn-design-system/commit/57460d20bbf8f40aabfa381d9149972581cd965c))
23
+ * **deps-dev:** bump style-dictionary from 4.3.3 to 4.4.0 ([#1716](https://github.com/BonnierNews/dn-design-system/issues/1716)) ([9de788e](https://github.com/BonnierNews/dn-design-system/commit/9de788eb2fcd87a1dae1bc730e45355fcf145b88))
24
+
7
25
  ## [31.4.3](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@31.4.2...@bonniernews/dn-design-system-web@31.4.3) (2025-04-25)
8
26
 
9
27
 
@@ -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 {
@@ -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-teaser__title"></div>
12
- <p class="ds-teaser__text">
13
- <span class="ds-teaser-dot"></span>
14
- </p>
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
- {% if params.mediaHtml %}
26
- {% set mediaClass = [
27
- componentClassName + '__media',
28
- componentClassName + '__media--rounded' if not params.isItalicHeadline,
29
- componentClassName + '__media--square-image' if params.isSquareImage
30
- ] | join(" ") %}
31
- <div class="{{ mediaClass }}">
32
- {{ params.mediaHtml }}
33
- </div>
34
- {% endif %}
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
- <h2 class="{{ componentClassName + '__title'}} {{ componentClassName + '__title--italic' if params.isItalicHeadline}}">
46
- {% if params.highlight %}
47
- <span class="{{ componentClassName + '__highlight'}}">{{ params.highlight }}</span>
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
- {% if params.text and params.areaType !== "right" %}
53
- <p class="{{ componentClassName + '__text' }}">
54
- {% if params.sticker %}
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.text }}
61
- </p>
62
- {% endif %}
63
- {% if params.variant === "podcast" %}
64
- {{ TeaserFooter({
65
- variant: "podcast",
66
- publicationTime: params.publicationTime,
67
- duration: params.duration
68
- })}}
69
- {% elif params.publicationTime %}
70
- {{
71
- TeaserFooter({
72
- variant: "informationText",
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
- sectionName: params.sectionName
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
- margin-top: ds-spacing($ds-s-025);
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
- .ds-teaser__media,
31
- .ds-teaser__content {
32
- margin-bottom: ds-spacing($ds-s-100);
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: block;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "31.4.3",
3
+ "version": "32.0.0",
4
4
  "description": "DN design system for web.",
5
5
  "type": "module",
6
6
  "homepage": "https://github.com/BonnierNews/dn-design-system/tree/main/web/src#readme",