@bonniernews/dn-design-system-web 31.4.0 → 31.4.2

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,27 +4,27 @@ 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)
7
+ ## [31.4.2](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@31.3.2...@bonniernews/dn-design-system-web@31.4.2) (2025-04-24)
8
8
 
9
9
 
10
- ### Features
10
+ ### Bug Fixes
11
+
12
+ * **web:** manually bump package version after strange post-revert behaviour ([#1713](https://github.com/BonnierNews/dn-design-system/issues/1713)) ([043ec00](https://github.com/BonnierNews/dn-design-system/commit/043ec003a7139165273874fecd6021ee76f03e37))
11
13
 
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))
14
+ ## [31.3.2](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@31.3.1...@bonniernews/dn-design-system-web@31.3.2) (2025-04-24)
13
15
 
14
16
 
15
17
  ### Bug Fixes
16
18
 
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))
19
+ * **web:** reduce flakyness in tests and improve DX ([#1709](https://github.com/BonnierNews/dn-design-system/issues/1709)) ([142a8f3](https://github.com/BonnierNews/dn-design-system/commit/142a8f3b7922c1d307ce74db87e3f4788e1b4bd3))
20
+ * **web:** update typography and padding on small buttons ([#1699](https://github.com/BonnierNews/dn-design-system/issues/1699)) ([e7e10cd](https://github.com/BonnierNews/dn-design-system/commit/e7e10cd63957add40950858e926915cb9f4c11a7))
18
21
 
22
+ ## [31.3.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@31.4.0...@bonniernews/dn-design-system-web@31.3.1) (2025-04-17)
19
23
 
20
- ### Maintenance
21
24
 
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))
25
+ ### Bug Fixes
26
+
27
+ * **web:** revert push to main ([#1708](https://github.com/BonnierNews/dn-design-system/issues/1708)) ([12a810f](https://github.com/BonnierNews/dn-design-system/commit/12a810fd50af3e11216748f040fdcd0ce4d86f9b))
28
28
 
29
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
30
 
@@ -81,44 +81,6 @@ $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
-
122
84
  &--podcast {
123
85
  .ds-teaser__vignette {
124
86
  display: flex;
@@ -74,15 +74,18 @@ $ds-btn-outlined__border-width: ds-border-width(xxs);
74
74
  --ds-btn__icon-size: #{ds-px-to-rem(20px)};
75
75
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-050), true)};
76
76
  --ds-btn__icon-only-padding: #{ds-px-to-rem(5px)};
77
- padding: _btn-brdr(ds-spacing($ds-s-025), true) _btn-brdr(ds-spacing($ds-s-075), true);
78
- @include ds-typography($variable: $ds-typography-functional-body-md, $fontWeight: $ds-fontweight-medium);
77
+ // Using decimal pixels here to force (one-line) buttons to be 32px.
78
+ padding: #{ds-px-to-rem(4.5px)} _btn-brdr(ds-spacing($ds-s-100), true);
79
+ @include ds-typography($variable: $ds-typography-functional-body-sm, $fontWeight: $ds-fontweight-medium);
79
80
  @at-root .ds-force-px#{&} {
80
81
  --ds-btn__icon-size: 20px;
81
82
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-050))};
82
83
  --ds-btn__icon-only-padding: 5px;
83
- padding: _btn-brdr(ds-spacing($ds-s-025)) _btn-brdr(ds-spacing($ds-s-075));
84
+
85
+ padding: 5px _btn-brdr(ds-spacing($ds-s-100)) 4px;
86
+
84
87
  @include ds-typography(
85
- $variable: $ds-typography-functional-body-md,
88
+ $variable: $ds-typography-functional-body-sm,
86
89
  $fontWeight: $ds-fontweight-medium,
87
90
  $forcePx: true
88
91
  );
@@ -244,6 +247,8 @@ $ds-btn-outlined__border-width: ds-border-width(xxs);
244
247
  margin: ds-spacing(0 0 0 $ds-s-025, rem);
245
248
  @at-root .ds-force-px#{&} {
246
249
  margin: ds-spacing(0 0 0 $ds-s-025);
250
+ // Compensate for padding to align forcePx button height to 32px
251
+ margin-top: -1px;
247
252
  }
248
253
  }
249
254
  }
@@ -264,6 +269,8 @@ $ds-btn-outlined__border-width: ds-border-width(xxs);
264
269
  }
265
270
  &.ds-btn--sm .ds-icon {
266
271
  margin: ds-spacing(0 $ds-s-025 0 0);
272
+ // Compensate for padding to align forcePx button height to 32px
273
+ margin-top: -1px;
267
274
  }
268
275
  }
269
276
  }
@@ -64,6 +64,44 @@
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
+
67
105
  @include ds-mq-smallest-breakpoint(tablet) {
68
106
  &.ds-teaser--right {
69
107
  .ds-teaser__title {
@@ -20,7 +20,6 @@
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 |
24
23
  |isItalicHeadline | bool | no | true, false | false | If the headline should be italic |
25
24
  |isCompact | bool | no | true, false | false | If the headline should be compact |
26
25
  |isFlashingDot | bool | no | true, false | false | If there should be a flashing ball before the text |
@@ -8,16 +8,13 @@ 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__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>
11
+ <div class="ds-teaser__title"></div>
12
+ <p class="ds-teaser__text">
13
+ <span class="ds-teaser-dot"></span>
14
+ </p>
17
15
  </div>`;
18
16
  teaser.classList.add("ds-teaser");
19
17
  teaser.classList.add("ds-teaser--standard");
20
- teaser.classList.add("ds-teaser--standard-without-byline");
21
18
 
22
19
  if (params.targetLink) {
23
20
  teaser.setAttribute("href", params.targetLink)
@@ -11,9 +11,6 @@
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,
17
14
  params.classNames if params.classNames
18
15
  ] | join(" ") %}
19
16
 
@@ -25,66 +22,58 @@
25
22
  classNames: extraClasses
26
23
  }) %}
27
24
  <div class="{{ componentClassName + '__content'}}">
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 %}
39
-
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>
47
- {% endif %}
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 %}
48
35
 
49
- <h2 class="{{ componentClassName + '__title'}} {{ componentClassName + '__title--italic' if params.isItalicHeadline}}">
50
- {% if params.highlight %}
51
- <span class="{{ componentClassName + '__highlight'}}">{{ params.highlight }}</span>
36
+ {% if params.vignette %}
37
+ <div class="ds-teaser__vignette">
38
+ {% if params.variant === "podcast" %}
39
+ {{ IconUse({ icon: "headphones" }) }}
52
40
  {% endif %}
53
- {{ params.title }}
54
- </h2>
41
+ {{ params.vignette }}
42
+ </div>
43
+ {% endif %}
55
44
 
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>
45
+ <h2 class="{{ componentClassName + '__title'}} {{ componentClassName + '__title--italic' if params.isItalicHeadline}}">
46
+ {% if params.highlight %}
47
+ <span class="{{ componentClassName + '__highlight'}}">{{ params.highlight }}</span>
66
48
  {% endif %}
67
- {% if params.variant === "podcast" %}
68
- {{ TeaserFooter({
69
- variant: "podcast",
70
- publicationTime: params.publicationTime,
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>
49
+ {{ params.title }}
50
+ </h2>
83
51
 
84
- {% if params.bylineHtml %}
85
- <div class="{{ componentClassName + '__byline'}}">
86
- {{ params.bylineHtml | safe }}
87
- </div>
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>
59
+ {% 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",
73
+ publicationTime: params.publicationTime,
74
+ sectionName: params.sectionName
75
+ })
76
+ }}
88
77
  {% endif %}
89
78
  </div>
90
79
  {% endcall %}
@@ -6,7 +6,7 @@
6
6
  overflow: hidden;
7
7
 
8
8
  .ds-teaser__vignette {
9
- padding-top: ds-spacing($ds-s-025);
9
+ margin-top: ds-spacing($ds-s-025);
10
10
  }
11
11
 
12
12
  .ds-teaser__title {
@@ -25,50 +25,15 @@
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
- }
34
- }
35
-
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
- }
57
28
  }
58
29
 
30
+ .ds-teaser__media,
59
31
  .ds-teaser__content {
60
- display: flex;
61
- flex-direction: row;
62
-
63
- .ds-teaser__content-inner {
64
- display: flex;
65
- flex-direction: column;
66
- flex: 1;
67
- }
32
+ margin-bottom: ds-spacing($ds-s-100);
68
33
  }
69
34
 
70
- .ds-teaser__byline {
71
- float: right;
35
+ .ds-teaser__content {
36
+ display: block;
72
37
  }
73
38
 
74
39
  .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.0",
3
+ "version": "31.4.2",
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",