@bonniernews/dn-design-system-web 4.5.0 → 4.6.1

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.1 (2023-09-13)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * **web:** use correct token for teaser bg ([#994](https://github.com/BonnierNews/dn-design-system/issues/994)) ([e007c6e](https://github.com/BonnierNews/dn-design-system/commit/e007c6e54612bd0df3ac52a4fc9ff35c93bde590))
12
+
13
+
14
+
15
+ ## 4.6.0 (2023-09-12)
16
+
17
+
18
+ ### Features
19
+
20
+ * **web:** add teaser longlife ([#992](https://github.com/BonnierNews/dn-design-system/issues/992)) ([f60fb92](https://github.com/BonnierNews/dn-design-system/commit/f60fb92bbf5bbd39e620de6551a6b261593bed5f))
21
+
22
+
23
+
24
+ ## 4.5.2 (2023-09-12)
25
+
26
+
27
+ ### Bug Fixes
28
+
29
+ * **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))
30
+
31
+
32
+
33
+ ## 4.5.1 (2023-09-12)
34
+
35
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
36
+
37
+
38
+
39
+
40
+
6
41
  ## 4.5.0 (2023-09-11)
7
42
 
8
43
 
@@ -13,7 +13,7 @@ $grade-size: ds-px-to-rem(34px);
13
13
 
14
14
  .ds-teaser {
15
15
  display: block;
16
- background-color: $ds-color-background-primary;
16
+ background-color: $ds-color-surface-background;
17
17
  text-decoration: none;
18
18
  position: relative;
19
19
 
@@ -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 |
@@ -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
+ }
@@ -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.5.0",
3
+ "version": "4.6.1",
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
  }