@bonniernews/dn-design-system-web 4.4.1 → 4.6.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
@@ -3,6 +3,41 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 4.6.0 (2023-09-12)
7
+
8
+
9
+ ### Features
10
+
11
+ * **web:** add teaser longlife ([#992](https://github.com/BonnierNews/dn-design-system/issues/992)) ([f60fb92](https://github.com/BonnierNews/dn-design-system/commit/f60fb92bbf5bbd39e620de6551a6b261593bed5f))
12
+
13
+
14
+
15
+ ## 4.5.2 (2023-09-12)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **web:** specify when email and followable can be used ([#996](https://github.com/BonnierNews/dn-design-system/issues/996)) ([b8458e9](https://github.com/BonnierNews/dn-design-system/commit/b8458e9a9dca3c50f32151222b6955d4f1038ffb))
21
+
22
+
23
+
24
+ ## 4.5.1 (2023-09-12)
25
+
26
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
27
+
28
+
29
+
30
+
31
+
32
+ ## 4.5.0 (2023-09-11)
33
+
34
+
35
+ ### Features
36
+
37
+ * **web:** implement the app's teaser dot animation ([#990](https://github.com/BonnierNews/dn-design-system/issues/990)) ([3147f94](https://github.com/BonnierNews/dn-design-system/commit/3147f942cb5ff276c2c788e8549e43fa7ba14830))
38
+
39
+
40
+
6
41
  ## 4.4.1 (2023-09-08)
7
42
 
8
43
 
@@ -8,6 +8,9 @@
8
8
 
9
9
  The byline is a list item and should be wrapped in a list.
10
10
 
11
+ * If variant:'follow', followable:true AND authorPageUrl are set at the same time, the element will render as a div with an inner `<a>` and a button.
12
+ * If variant:'link' and authorpageUrl are set, the outer elment will render as an `<a>`.
13
+
11
14
  ## Parameters
12
15
 
13
16
  |parameter | type | required | options | default | description |
@@ -15,6 +15,7 @@
15
15
  |forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size |
16
16
  |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
17
17
 
18
+
18
19
  ## Minimum requirement example
19
20
 
20
21
  ### Nunjucks
@@ -32,4 +33,9 @@ These are copy paste friendly examples to quickliy get started using a component
32
33
  ### SCSS
33
34
  ```scss
34
35
  @use "@bonniernews/dn-design-system-web/components/teaser-dot/teaser-dot";
36
+
37
+ .ds-teaser-dot {
38
+ // use css variable to optionally override size
39
+ --ds-teaser-dot-size: 10px;
40
+ }
35
41
  ```
@@ -1,39 +1,70 @@
1
1
  @use "../../foundations/helpers/forward.helpers.scss" as *;
2
2
 
3
- $ds-teaser-dot-size: 10px;
4
-
5
3
  .ds-teaser-dot {
6
- display: inline-flex;
7
- box-sizing: border-box;
8
- background-color: $ds-theme-color;
9
- border-radius: 50%;
10
- height: ds-px-to-rem($ds-teaser-dot-size);
11
- width: ds-px-to-rem($ds-teaser-dot-size);
12
- margin-right: ds-px-to-rem(1px);
4
+ --ds-teaser-dot-size: #{ds-px-to-rem(10px)};
13
5
 
14
6
  @at-root .ds-force-px#{&} {
15
- height: $ds-teaser-dot-size;
16
- width: $ds-teaser-dot-size;
17
- margin-right: 1px;
7
+ --ds-teaser-dot-size: 10px;
18
8
  }
19
9
 
10
+ display: inline-block;
11
+ box-sizing: border-box;
12
+ position: relative;
13
+ height: var(--ds-teaser-dot-size);
14
+ width: var(--ds-teaser-dot-size);
15
+ margin-right: calc(var(--ds-teaser-dot-size) * 0.1);
16
+ color: $ds-theme-color;
17
+
20
18
  @media (prefers-reduced-motion: no-preference) {
21
19
  &.ds-teaser-dot--flashing {
22
- animation: pulse 1.25s ease-in-out infinite;
20
+ animation: dot-pulse 2s ease infinite;
21
+ }
22
+ &.ds-teaser-dot--flashing::after {
23
+ animation: ripple-pulse 2s linear infinite;
23
24
  }
24
25
  }
26
+
27
+ &::after,
28
+ &.ds-teaser-dot--flashing::before {
29
+ content: '';
30
+ position: absolute;
31
+ top: 0;
32
+ bottom: 0;
33
+ left: 0;
34
+ right: 0;
35
+ transform-origin: 50% 50%;
36
+ background-color: currentColor;
37
+ border-radius: 50%;
38
+ }
25
39
  }
26
40
 
27
- @keyframes pulse {
41
+ @keyframes dot-pulse {
28
42
  0% {
29
- opacity: 0;
43
+ transform: scale(.95);
30
44
  }
31
45
 
32
- 50% {
33
- opacity: 1;
46
+ 70% {
47
+ transform: scale(1);
34
48
  }
35
49
 
36
50
  100% {
51
+ transform: scale(0.95);
52
+ }
53
+ }
54
+
55
+ @keyframes ripple-pulse {
56
+ 0% {
57
+ transform: scale(.95);
58
+ opacity: 0.4;
59
+ }
60
+
61
+ 70% {
62
+ transform: scale(2);
37
63
  opacity: 0;
38
64
  }
65
+
66
+ 100% {
67
+ transform: scale(.95);
68
+ opacity: 0
69
+ }
39
70
  }
@@ -0,0 +1,42 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-longlife](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-longlife)
2
+ - Storybook: [TeaserRightNow](https://designsystem.dn.se/?path=/docs/section-teaserlonglife--docs)
3
+ - Storybook (Latest): [TeaserRightNow](https://designsystem-latest.dn.se/?path=/docs/section-teaserlonglife--docs)
4
+
5
+ ----
6
+
7
+ # teaser-longlife
8
+
9
+ ## Parameters
10
+
11
+ |parameter | type | required | options | default | description |
12
+ |:--- | :--- | :--- | :--- | :--- | :--- |
13
+ |title | String | yes | | | Heading of the teaser |
14
+ |targetLink | String | yes | | | Target URL for the teaser |
15
+ |vignette | String | no | | | Top text in the teaser |
16
+ |mediaHtml | HTML String | no | | | Main image or other media |
17
+ |isLocked | bool | no | true, false | false | If the paywall indicator should be shown. It is only shown if the teaser has an image. |
18
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
19
+ |classNames | String | no | | | Ex. "my-special-class" |
20
+ |~forcePx~ | | | | | Not supported |
21
+
22
+ ## Minimum requirement example
23
+
24
+ ### Nunjucks
25
+
26
+ These are copy paste friendly examples to quickliy get started using a component.
27
+
28
+ ```html
29
+ {% from '@bonniernews/dn-design-system-web/components/teaser-longlife/teaser-longlife.njk' import TeaserLonglife %}
30
+
31
+ {{ TeaserLonglife({
32
+ title: 'Susa fram på DN-elcykeln',
33
+ targetLink: 'https://dngranskar.dn.se',
34
+ vignette: 'Beställ DN-cykeln',
35
+ mediaHtml: 'image-html',
36
+ })}}
37
+ ```
38
+
39
+ ### SCSS
40
+ ```scss
41
+ @use "@bonniernews/dn-design-system-web/components/teaser-longlife/teaser-longlife" as *;
42
+ ```
@@ -0,0 +1,38 @@
1
+ {% from '@bonniernews/dn-design-system-web/components/teaser-card/teaser-card.njk' import TeaserCard %}
2
+ {% from '@bonniernews/dn-design-system-web/components/vip-badge/vip-badge.njk' import VipBadge %}
3
+
4
+ {% macro TeaserLonglife(params) %}
5
+ {%- set additionalClasses = ["ds-teaser--longlife"] %}
6
+
7
+ {%- if params.classNames %}
8
+ {% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
9
+ {% endif %}
10
+
11
+ {% call TeaserCard({
12
+ targetLink: params.targetLink,
13
+ areaType: 'right',
14
+ attributes: params.attributes,
15
+ classNames: additionalClasses | join(" ")
16
+ }) %}
17
+
18
+ {% if params.mediaHtml %}
19
+ {{ params.mediaHtml }}
20
+ {% if params.isLocked %}
21
+ {{ VipBadge({
22
+ showText: false,
23
+ forcePx: true
24
+ }) }}
25
+ {% endif %}
26
+ {% endif %}
27
+
28
+ <div class="ds-teaser__content">
29
+ {% if params.vignette %}
30
+ <div class="ds-teaser__vignette">{{ params.vignette }}</div>
31
+ {% endif %}
32
+ <h2 class="ds-teaser__title">
33
+ {{ params.title }}
34
+ </h2>
35
+ </div>
36
+ {% endcall %}
37
+ {% endmacro %}
38
+
@@ -0,0 +1,56 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../assets/teaser/teaser.scss";
3
+
4
+ .ds-teaser.ds-teaser--longlife {
5
+ position: relative;
6
+
7
+ .ds-teaser-image {
8
+ position: relative;
9
+ width: 100%;
10
+ height: auto;
11
+
12
+ &::after {
13
+ content: "";
14
+ position: absolute;
15
+ top: 0;
16
+ left: 0;
17
+ bottom: 0;
18
+ right: 0;
19
+ background-color: $ds-color-static-transparent-black;
20
+ z-index: 1;
21
+ }
22
+
23
+ figcaption {
24
+ display: none;
25
+ }
26
+ }
27
+
28
+ .ds-teaser__content {
29
+ color: $ds-color-static-white;
30
+ position: absolute;
31
+ bottom: 0;
32
+ left: 0;
33
+ z-index: 2;
34
+ padding: ds-spacing-component($ds-sc-x4);
35
+ }
36
+
37
+ &:not(:has(.ds-teaser-image)) {
38
+ background-color: $ds-color-static-black;
39
+
40
+ .ds-teaser__content {
41
+ position: relative;
42
+ }
43
+ }
44
+
45
+ .ds-teaser__vignette {
46
+ color: currentColor;
47
+ @include ds-typography($ds-typography-functional-meta02bold);
48
+ text-transform: uppercase;
49
+ margin: 0;
50
+ }
51
+
52
+ .ds-teaser__title {
53
+ color: currentColor;
54
+ @include ds-typography($ds-typography-functional-heading02bold);
55
+ }
56
+ }
@@ -106,6 +106,6 @@
106
106
  }
107
107
 
108
108
  .ds-teaser-dot {
109
- background-color: $ds-color-text-primary;
109
+ color: $ds-color-text-primary;
110
110
  }
111
111
  }
@@ -100,7 +100,7 @@
100
100
  color: $ds-color-static-white;
101
101
  }
102
102
  .ds-teaser-dot {
103
- background-color: $ds-color-static-red-300;
103
+ color: $ds-color-static-red-300;
104
104
  }
105
105
  .ds-teaser__vignette,
106
106
  .ds-teaser__sticker {
@@ -89,3 +89,5 @@ $ds-typography-detailarticle-longread: 'detailarticle-longread';
89
89
  $ds-typography-detailarticle-longread-premium: 'detailarticle-longread-premium';
90
90
  $ds-typography-detailarticle-quote: 'detailarticle-quote';
91
91
  $ds-typography-detailmellanrubrik: 'detailmellanrubrik';
92
+ $ds-typography-detailarticle-direkt: 'detailarticle-direkt';
93
+ $ds-typography-detailarticle-direkt-opinion: 'detailarticle-direkt-opinion';
@@ -220,6 +220,19 @@ $typographyTokensScreenExtraLarge: (
220
220
  lineHeight: 64,
221
221
  fontSize: 56
222
222
  ),
223
+ detailarticle-direkt: (
224
+ fontFamily: "DN Serif Display",
225
+ fontWeight: Bold,
226
+ lineHeight: 36,
227
+ fontSize: 32
228
+ ),
229
+ detailarticle-direkt-opinion: (
230
+ fontFamily: "DN Serif Display",
231
+ fontWeight: Regular,
232
+ lineHeight: 36,
233
+ fontSize: 32,
234
+ fontStyle: italic
235
+ ),
223
236
  detaildropcap: (
224
237
  fontFamily: "DN Serif Display",
225
238
  fontWeight: Bold,
@@ -445,6 +445,19 @@ $typographyTokensScreenLarge: (
445
445
  lineHeight: 36,
446
446
  fontSize: 32
447
447
  ),
448
+ detailarticle-direkt: (
449
+ fontFamily: "DN Serif Headline",
450
+ fontWeight: Bold,
451
+ lineHeight: 30,
452
+ fontSize: 26
453
+ ),
454
+ detailarticle-direkt-opinion: (
455
+ fontFamily: "DN Serif Headline",
456
+ fontWeight: Regular,
457
+ lineHeight: 30,
458
+ fontSize: 26,
459
+ fontStyle: italic
460
+ ),
448
461
  detailstandard-button: (
449
462
  fontFamily: "DN Sans",
450
463
  fontWeight: SemiBold,
@@ -584,5 +584,18 @@ $typographyTokensScreenSmall: (
584
584
  fontWeight: Bold,
585
585
  fontSize: 20,
586
586
  lineHeight: 24
587
+ ),
588
+ detailarticle-direkt: (
589
+ fontFamily: "DN Serif Headline",
590
+ fontWeight: Bold,
591
+ lineHeight: 24,
592
+ fontSize: 20
593
+ ),
594
+ detailarticle-direkt-opinion: (
595
+ fontFamily: "DN Serif Headline",
596
+ fontWeight: Regular,
597
+ lineHeight: 24,
598
+ fontSize: 20,
599
+ fontStyle: italic
587
600
  )
588
601
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "4.4.1",
3
+ "version": "4.6.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",
@@ -88,5 +88,8 @@
88
88
  "detailarticle-opinion": "'detailarticle-opinion'",
89
89
  "detailarticle-longread": "'detailarticle-longread'",
90
90
  "detailarticle-longread-premium": "'detailarticle-longread-premium'",
91
- "detailarticle-quote": "'detailarticle-quote'"
91
+ "detailarticle-quote": "'detailarticle-quote'",
92
+ "detailmellanrubrik": "'detailmellanrubrik'",
93
+ "detailarticle-direkt": "'detailarticle-direkt'",
94
+ "detailarticle-direkt-opinion": "'detailarticle-direkt-opinion'"
92
95
  }