@bonniernews/dn-design-system-web 3.0.0-alpha.9 → 3.0.0-alpha.90

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.
Files changed (128) hide show
  1. package/CHANGELOG.md +720 -0
  2. package/assets/article-image/article-image.njk +11 -10
  3. package/assets/article-image/article-image.scss +1 -15
  4. package/assets/form-field/form-field.njk +2 -2
  5. package/assets/form-field/form-field.scss +2 -6
  6. package/assets/teaser/dot-or-grade.njk +7 -0
  7. package/assets/teaser/teaser.scss +96 -0
  8. package/components/article-body-image/README.md +2 -2
  9. package/components/article-body-image/article-body-image.njk +1 -5
  10. package/components/article-top-image/README.md +2 -2
  11. package/components/article-top-image/article-top-image.njk +1 -5
  12. package/components/article-top-image/article-top-image.scss +1 -1
  13. package/components/badge/badge.scss +1 -5
  14. package/components/buddy-menu/buddy-menu.scss +1 -8
  15. package/components/button/button.njk +38 -43
  16. package/components/button/button.scss +6 -1
  17. package/components/button-toggle/button-toggle.js +2 -0
  18. package/components/button-toggle/button-toggle.njk +36 -36
  19. package/components/button-toggle/button-toggle.scss +6 -1
  20. package/components/byline/byline.njk +2 -2
  21. package/components/byline/byline.scss +1 -3
  22. package/components/checkbox/checkbox.njk +3 -3
  23. package/components/checkbox/checkbox.scss +8 -9
  24. package/components/disclaimer/disclaimer.njk +2 -2
  25. package/components/disclaimer/disclaimer.scss +23 -10
  26. package/components/factbox/README.md +2 -2
  27. package/components/factbox/factbox.njk +12 -24
  28. package/components/factbox/factbox.scss +16 -51
  29. package/components/footer/footer.scss +2 -8
  30. package/components/icon-button/README.md +2 -1
  31. package/components/icon-button/icon-button.njk +4 -4
  32. package/components/icon-button/icon-button.scss +5 -2
  33. package/components/icon-button-toggle/icon-button-toggle.js +2 -0
  34. package/components/icon-button-toggle/icon-button-toggle.njk +28 -36
  35. package/components/icon-button-toggle/icon-button-toggle.scss +5 -2
  36. package/components/icon-sprite/README.md +51 -0
  37. package/components/icon-sprite/icon-sprite.njk +12 -0
  38. package/components/icon-sprite/icon-sprite.scss +12 -0
  39. package/components/icon-with-wrapper/README.md +9 -2
  40. package/components/icon-with-wrapper/icon-with-wrapper.njk +2 -2
  41. package/components/icon-with-wrapper/icon-with-wrapper.scss +2 -1
  42. package/components/image-caption/README.md +38 -0
  43. package/components/image-caption/image-caption.njk +36 -0
  44. package/components/image-caption/image-caption.scss +25 -0
  45. package/components/list-item/list-item.njk +5 -5
  46. package/components/list-item/list-item.scss +1 -3
  47. package/components/pictogram/README.md +39 -0
  48. package/components/pictogram/pictogram.njk +30 -0
  49. package/components/pictogram/pictogram.scss +54 -0
  50. package/components/quote/README.md +1 -2
  51. package/components/quote/quote.njk +6 -8
  52. package/components/quote/quote.scss +1 -14
  53. package/components/radio-button/radio-button.njk +3 -3
  54. package/components/radio-button/radio-button.scss +8 -10
  55. package/components/spinner/spinner.njk +19 -23
  56. package/components/spinner/spinner.scss +4 -1
  57. package/components/teaser-dot/README.md +34 -0
  58. package/components/teaser-dot/teaser-dot.njk +24 -0
  59. package/components/teaser-dot/teaser-dot.scss +39 -0
  60. package/components/teaser-image/README.md +40 -0
  61. package/components/teaser-image/teaser-image.njk +21 -0
  62. package/components/teaser-image/teaser-image.scss +21 -0
  63. package/components/teaser-large/README.md +52 -0
  64. package/components/teaser-large/teaser-large.njk +96 -0
  65. package/components/teaser-large/teaser-large.scss +139 -0
  66. package/components/teaser-onsite/README.md +45 -0
  67. package/components/teaser-onsite/teaser-onsite.njk +45 -0
  68. package/components/teaser-onsite/teaser-onsite.scss +33 -0
  69. package/components/teaser-package/README.md +42 -0
  70. package/components/teaser-package/teaser-package.njk +39 -0
  71. package/components/teaser-package/teaser-package.scss +114 -0
  72. package/components/teaser-right-now/README.md +37 -0
  73. package/components/teaser-right-now/teaser-right-now.njk +29 -0
  74. package/components/teaser-right-now/teaser-right-now.scss +57 -0
  75. package/components/teaser-slideshow/README.md +42 -0
  76. package/components/teaser-slideshow/teaser-slideshow.njk +38 -0
  77. package/components/teaser-slideshow/teaser-slideshow.scss +37 -0
  78. package/components/teaser-split/README-container.md +40 -0
  79. package/components/teaser-split/README.md +49 -0
  80. package/components/teaser-split/teaser-split.njk +93 -0
  81. package/components/teaser-split/teaser-split.scss +85 -0
  82. package/components/teaser-standard/README.md +50 -0
  83. package/components/teaser-standard/teaser-standard.njk +81 -0
  84. package/components/teaser-standard/teaser-standard.scss +38 -0
  85. package/components/teaser-tipsa/README.md +41 -0
  86. package/components/teaser-tipsa/teaser-tipsa.njk +31 -0
  87. package/components/teaser-tipsa/teaser-tipsa.scss +22 -0
  88. package/components/text-button/text-button.njk +34 -37
  89. package/components/text-button/text-button.scss +12 -10
  90. package/components/text-button-toggle/text-button-toggle.js +2 -0
  91. package/components/text-button-toggle/text-button-toggle.njk +30 -33
  92. package/components/text-button-toggle/text-button-toggle.scss +10 -10
  93. package/components/text-input/text-input.scss +3 -8
  94. package/components/video-caption/README.md +1 -1
  95. package/components/video-caption/video-caption.njk +12 -6
  96. package/components/vip-badge/README.md +35 -0
  97. package/components/vip-badge/vip-badge.njk +23 -0
  98. package/components/vip-badge/vip-badge.scss +54 -0
  99. package/foundations/colors.scss +31 -0
  100. package/foundations/helpers/README-links.md +1 -1
  101. package/foundations/helpers/colors.scss +2 -0
  102. package/foundations/helpers/hover.scss +14 -0
  103. package/foundations/helpers/links.scss +15 -7
  104. package/foundations/helpers/typography.scss +22 -2
  105. package/foundations/icons/grade-icon.njk +50 -11
  106. package/foundations/icons/icon.njk +172 -143
  107. package/foundations/icons/sprite.njk +1 -0
  108. package/foundations/icons/sprite.svg +1 -0
  109. package/foundations/icons/svg/download.svg +3 -0
  110. package/foundations/icons/svg/filter_list.svg +3 -0
  111. package/foundations/icons/svg/pause.svg +3 -0
  112. package/foundations/icons/svg/system_update.svg +3 -0
  113. package/foundations/icons/svg/vip.svg +3 -0
  114. package/foundations/typography/fontDefinitions.scss +82 -67
  115. package/foundations/variables/colorsCssVariables.scss +6 -0
  116. package/foundations/variables/colorsDnDarkTokens.scss +7 -1
  117. package/foundations/variables/colorsDnLightTokens.scss +8 -2
  118. package/foundations/variables/spacingLayout.scss +6 -1
  119. package/foundations/variables/spacingLayoutLargeScreen.scss +5 -0
  120. package/foundations/variables/spacingLayoutList.scss +5 -0
  121. package/foundations/variables/typographyTokensList.scss +5 -0
  122. package/foundations/variables/typographyTokensScreenExtraLarge.scss +571 -0
  123. package/foundations/variables/typographyTokensScreenLarge.scss +133 -100
  124. package/foundations/variables/typographyTokensScreenSmall.scss +147 -114
  125. package/package.json +2 -2
  126. package/tokens/colors-css-variables.json +6 -0
  127. package/tokens/spacing-layout-list.json +6 -1
  128. package/foundations/icons/icon-sprite.svg +0 -2
@@ -0,0 +1,57 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../assets/teaser/teaser.scss";
3
+ @use "sass:math";
4
+
5
+ .ds-teaser.ds-teaser--right-now {
6
+ display: flex;
7
+ flex-direction: row;
8
+ align-items: center;
9
+ @include ds-spacing-layout($ds-sl-teaser-vertical $ds-sl-teaser-horizontal);
10
+
11
+ .ds-teaser__content {
12
+ padding-left: ds-spacing-component($ds-sc-x3);
13
+ flex: 1;
14
+ }
15
+
16
+ .ds-teaser__title {
17
+ @include ds-typography($ds-typography-functional-heading01bold);
18
+ }
19
+
20
+ @include ds-hover(true) {
21
+ .ds-teaser__title {
22
+ @include ds-underline(2px, 1px);
23
+ }
24
+ }
25
+
26
+ .ds-teaser__right-now-sticker {
27
+ $flag-height: ds-spacing-component($ds-sc-x8);
28
+ $flag-height-half: math.div($flag-height, 2);
29
+ $flag-color: $ds-color-static-yellow;
30
+
31
+ position: relative;
32
+ display: flex;
33
+ justify-content: center;
34
+ align-items: center;
35
+
36
+ @include ds-typography($ds-typography-detailarticle-label);
37
+
38
+ height: $flag-height;
39
+ padding: ds-spacing-component(0 $ds-sc-x1 0 $ds-sc-x2);
40
+ margin-right: $flag-height-half;
41
+
42
+ background-color: $flag-color;
43
+ color: $ds-color-static-black;
44
+
45
+ &::after {
46
+ display: block;
47
+ content: "";
48
+ position: absolute;
49
+ right: -#{$flag-height-half};
50
+ top: 0;
51
+
52
+ border-left: $flag-height-half solid $flag-color;
53
+ border-top: $flag-height-half solid transparent;
54
+ border-bottom: $flag-height-half solid transparent;
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,42 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-slideshow](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-slideshow)
2
+ - Storybook (PROD): [TeaserSlideshow > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teaserslideshow-web)
3
+ - Storybook (LATEST): [TeaserSlideshow > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teaserslideshow-web)
4
+
5
+ ----
6
+
7
+ # teaser-slideshow
8
+
9
+ ## Parameters
10
+
11
+ |parameter | type | required | options | default | description |
12
+ |:--- | :--- | :--- | :--- | :--- | :--- |
13
+ |title | String | yes | | | Heading of the teaser |
14
+ |text | String | no | | | Teaser subtext |
15
+ |areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
16
+ |theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme-class to apply to the teaser |
17
+ |mediaHtml | HTML String | no | | | Gallery html |
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
+ NB: this component does not render a link. If a link element is desired, it needs to be inserted through the `mediaHtml` property.
23
+
24
+ ## Minimum requirement example
25
+
26
+ ### Nunjucks
27
+
28
+ These are copy paste friendly examples to quickliy get started using a component.
29
+
30
+ ```html
31
+ {% from '@bonniernews/dn-design-system-web/components/teaser-slideshow/teaser-slideshow.njk' import TeaserSlideshow %}
32
+
33
+ {{ TeaserSlideshow({
34
+ title: 'Nyårsafton 2023',
35
+ text: 'Kolla på alla fina bilder från festen!'
36
+ })}}
37
+ ```
38
+
39
+ ### SCSS
40
+ ```scss
41
+ @use "@bonniernews/dn-design-system-web/components/teaser-slideshow/teaser-slideshow" as *;
42
+ ```
@@ -0,0 +1,38 @@
1
+ {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
+
3
+ {% macro TeaserSlideshow(params) %}
4
+ {% set componentClassName = "ds-teaser" %}
5
+ {% set classNamePrefix = componentClassName + "--" %}
6
+ {% set additionalClasses = ["ds-teaser--slideshow ds-dark"] %}
7
+ {% set attributes = getAttributes(params.attributes) %}
8
+
9
+ {% if params.theme %}
10
+ {% set additionalClasses = (additionalClasses.push('ds-theme--' + params.theme), additionalClasses) %}
11
+ {% endif %}
12
+
13
+ {% if params.areaType %}
14
+ {% set additionalClasses = (additionalClasses.push(classNamePrefix + params.areaType), additionalClasses) %}
15
+ {% endif %}
16
+
17
+ {% if params.classNames %}
18
+ {% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
19
+ {% endif%}
20
+
21
+ {% set classes = componentClassName + " " + additionalClasses | join(" ") %}
22
+
23
+ <div class="{{ classes }}" {{ attributes | safe }}>
24
+ <div class="{{ componentClassName + '__content'}}">
25
+ <h2 class="ds-teaser__title">
26
+ {{ params.title }}
27
+ </h2>
28
+ {% if params.text %}
29
+ <span class="{{ componentClassName + '__text'}}">
30
+ {{ params.text }}
31
+ </span>
32
+ {% endif %}
33
+ </div>
34
+ {% if params.mediaHtml %}
35
+ {{ params.mediaHtml | safe }}
36
+ {% endif %}
37
+ </div>
38
+ {% endmacro %}
@@ -0,0 +1,37 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../assets/teaser/teaser.scss" as *;
3
+
4
+ .ds-teaser.ds-teaser--slideshow {
5
+ background-color: $ds-color-background-primary;
6
+ overflow: hidden;
7
+ max-height: 230px;
8
+ box-sizing: border-box;
9
+
10
+ @include ds-mq-smallest-breakpoint(tablet) {
11
+ &.ds-teaser--right {
12
+ max-width: 300px;
13
+ }
14
+ }
15
+
16
+ .ds-teaser__content {
17
+ @include ds-spacing-layout($ds-sl-teaser-vertical $ds-sl-teaser-horizontal);
18
+ display: block;
19
+ color: $ds-color-text-primary;
20
+
21
+ .ds-teaser__title {
22
+ display: inline;
23
+ @include ds-typography($ds-typography-functional-heading01bold);
24
+ }
25
+
26
+ .ds-teaser__text {
27
+ display: inline;
28
+ @include ds-typography($ds-typography-functional-heading01regular);
29
+ }
30
+ }
31
+
32
+ @include ds-hover {
33
+ &:hover .ds-teaser__title {
34
+ text-decoration: none;
35
+ }
36
+ }
37
+ }
@@ -0,0 +1,40 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-split](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-split)
2
+ - Storybook (PROD): [TeaserSplitContainer > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teasersplitcontainer-web)
3
+ - Storybook (LATEST): [TeaserSplitContainer > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teasersplitcontainer-web)
4
+
5
+ ----
6
+
7
+ # TeaserSplitContainer
8
+
9
+ ## Parameters
10
+
11
+ |parameter | type | required | options | default | description |
12
+ |:--- | :--- | :--- | :--- | :--- | :--- |
13
+ |teasersHtml | HTML String | yes | | | HTML teaser output |
14
+ |theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme is applied to all teasers in the container |
15
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
16
+ |classNames | String | no | | | Ex. "my-special-class" |
17
+ |areaType | string | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
18
+ |~forcePx~ | | | | | Not supported |
19
+
20
+ ## Minimum requirement example
21
+
22
+ ### Nunjucks
23
+
24
+ These are copy paste friendly examples to quickliy get started using a component.
25
+
26
+ ```html
27
+ {% from "@bonniernews/dn-design-system-web/components/teaser-split/teaser-split.njk" import TeaserSplitContainer %}
28
+
29
+ {{ TeaserSplitContainer({
30
+ areaType: "bauta",
31
+ teasersHtml: "",
32
+ attributes: {},
33
+ classNames: ""
34
+ })}}
35
+ ```
36
+
37
+ ### SCSS
38
+ ```scss
39
+ @use "@bonniernews/dn-design-system-web/components/teaser-split/teaser-split";
40
+ ```
@@ -0,0 +1,49 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-split](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-split)
2
+ - Storybook (PROD): [TeaserSplit > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teasersplit-web)
3
+ - Storybook (LATEST): [TeaserSplit > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teasersplit-web)
4
+
5
+ ----
6
+
7
+ # TeaserSplit
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
+ |~variant~ | String | no | "default" or "podd" | "default" | Not implemented |
16
+ |areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
17
+ |theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme-class to apply to the teaser |
18
+ |text | String | no | | | Teaser subtext |
19
+ |vignette | String | no | | | Top text in the teaser |
20
+ |highlight | String | no | | | Text before the heading |
21
+ |sticker | String | no | | | Red text before the text |
22
+ |grade | String | no | | | zero, one, two, three, four, five, none |
23
+ |mediaHtml | HTML String | no | | | Main image or other media |
24
+ |isFlashingDot | bool | no | true, false | false | If there should be a flashing ball before the text |
25
+ |isLocked | bool | no | true, false | false | If the paywall indicator should be shown. It is only shown if the teaser has an image. |
26
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
27
+ |classNames | String | no | | | Ex. "my-special-class" |
28
+ |~forcePx~ | | | | | Not supported |
29
+
30
+ ## Minimum requirement example
31
+
32
+ ### Nunjucks
33
+
34
+ These are copy paste friendly examples to quickliy get started using a component.
35
+
36
+ ```html
37
+ {% from "@bonniernews/dn-design-system-web/components/teaser-split/teaser-split.njk" import TeaserSplit %}
38
+
39
+ {{ TeaserSplit({
40
+ title: "Sju miljoner i humanitärt stöd till Turkiet och Syrien",
41
+ targetLink: "#",
42
+ text: "Tält och temporära nödboenden samt ledningsresurser för att koordinera räddningsarbetet."
43
+ })}}
44
+ ```
45
+
46
+ ### SCSS
47
+ ```scss
48
+ @use "@bonniernews/dn-design-system-web/components/teaser-split/teaser-split";
49
+ ```
@@ -0,0 +1,93 @@
1
+ {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
+ {% from '@bonniernews/dn-design-system-web/components/vip-badge/vip-badge.njk' import VipBadge %}
3
+ {% from '@bonniernews/dn-design-system-web/assets/teaser/dot-or-grade.njk' import getDotOrGrade %}
4
+
5
+ {% macro TeaserSplit(params) %}
6
+ {% set componentClassName = "ds-teaser" %}
7
+ {% set classNamePrefix = componentClassName + "--" %}
8
+ {% set additionalClasses = ["ds-teaser--split"] %}
9
+ {% set attributes = getAttributes(params.attributes) %}
10
+
11
+ {% if params.variant %}
12
+ {% set additionalClasses = (additionalClasses.push(classNamePrefix + params.variant), additionalClasses) %}
13
+ {% endif %}
14
+
15
+ {% if params.areaType == "bauta" or params.areaType == "bautaxl" %}
16
+ {% set additionalClasses = (additionalClasses.push(classNamePrefix + params.areaType), additionalClasses) %}
17
+ {% endif %}
18
+
19
+ {% if params.theme %}
20
+ {% set additionalClasses = (additionalClasses.push('ds-theme--' + params.theme), additionalClasses) %}
21
+ {% endif %}
22
+
23
+ {% if params.classNames %}
24
+ {% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
25
+ {% endif%}
26
+
27
+ {% set classes = componentClassName + " " + additionalClasses | join(" ") %}
28
+
29
+ <a href="{{ params.targetLink }}"
30
+ class="{{ classes }}"
31
+ {{- attributes | safe }}>
32
+
33
+ {% if params.mediaHtml %}
34
+ <div class="{{ componentClassName + '__media'}}">
35
+ {{ params.mediaHtml }}
36
+ {% if params.isLocked %}
37
+ {{ VipBadge({
38
+ showText: false,
39
+ forcePx: true
40
+ }) }}
41
+ {% endif %}
42
+ </div>
43
+ {% endif %}
44
+
45
+ <div class="{{ componentClassName + '__content'}}">
46
+ {% if params.vignette %}
47
+ <div class="ds-teaser__vignette">{{ params.vignette }}</div>
48
+ {% endif %}
49
+
50
+ <h2 class="{{ componentClassName + '__title' }}">
51
+ {% if params.highlight %}
52
+ <span class="{{ componentClassName + '__highlight'}}">{{ params.highlight }}</span>
53
+ {% endif %}
54
+ {{ params.title }}
55
+ </h2>
56
+
57
+ {% if params.text %}
58
+ <p class="{{ componentClassName + '__text'}}">
59
+ {{ getDotOrGrade({ flashing: params.isFlashingDot, grade: params.grade }) }}
60
+ {% if params.sticker %}
61
+ <span class="ds-teaser__sticker">
62
+ {{ params.sticker }}
63
+ </span>
64
+ {% endif %}
65
+ {{ params.text }}
66
+ </p>
67
+ {% endif %}
68
+ </div>
69
+ </a>
70
+ {% endmacro %}
71
+
72
+ {% macro TeaserSplitContainer(params) %}
73
+ {{ params.teasers | dump }}
74
+ {%- set componentClassName = "ds-split-container" %}
75
+ {%- set classNamePrefix = componentClassName + "--" %}
76
+ {%- set additionalClasses = [] %}
77
+ {%- set attributes = getAttributes(params.attributes) %}
78
+
79
+ {% if params.areaType == "bauta" or params.areaType == "bautaxl" %}
80
+ {% set additionalClasses = (additionalClasses.push(classNamePrefix + params.areaType), additionalClasses) %}
81
+ {% endif %}
82
+
83
+ {% if params.theme %}
84
+ {% set additionalClasses = (additionalClasses.push('ds-theme--' + params.theme), additionalClasses) %}
85
+ {% endif %}
86
+
87
+ {%- if params.classNames %}
88
+ {% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
89
+ {% endif%}
90
+
91
+ {%- set classes = componentClassName + " " + additionalClasses | join(" ") %}
92
+ <div class="{{ classes }}" {{- attributes | safe }}>{{ params.teasersHtml | safe }}</div>
93
+ {% endmacro %}
@@ -0,0 +1,85 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../assets/teaser/teaser.scss" as *;
3
+
4
+ .ds-split-container {
5
+ @include ds-spacing-layout($ds-sl-teaser-vertical $ds-sl-teaser-horizontal);
6
+ display: flex;
7
+ flex-wrap: wrap;
8
+ position: relative;
9
+ box-sizing: border-box;
10
+
11
+ & + .ds-split-container {
12
+ &:before {
13
+ content: "";
14
+ height: ds-metrics-border-width(x1);
15
+ background-color: $ds-color-border-primary;
16
+ left: 0;
17
+ right: 0;
18
+ top: 0;
19
+ position: absolute;
20
+ @include ds-spacing-layout(0 $ds-sl-teaser-horizontal, margin);
21
+ }
22
+ }
23
+
24
+ .ds-teaser--split {
25
+ box-sizing: content-box;
26
+ display: block;
27
+ position: relative;
28
+ flex: 1;
29
+ margin-right: ds-spacing-component($ds-sc-x4);
30
+ &:last-child {
31
+ margin-right: 0;
32
+ }
33
+
34
+ @include ds-teaser-focus(4px);
35
+
36
+ @include ds-mq-largest-breakpoint(mobile) {
37
+ width: calc(50% - ds-spacing-component($ds-sc-x4) / 2);
38
+ flex: auto;
39
+ // if a teaser is both third and last child it has the row by itself and should be full width
40
+ &:nth-child(3):last-child {
41
+ flex: 1;
42
+ }
43
+ &:nth-child(2) {
44
+ margin-right: 0;
45
+ }
46
+ }
47
+
48
+ &:nth-child(3)::before,
49
+ &:nth-child(4)::before {
50
+ display: block;
51
+ content: "";
52
+ @include ds-spacing-layout($ds-sl-teaser-vertical, margin-top);
53
+ @include ds-spacing-layout($ds-sl-teaser-vertical, padding-top);
54
+ border-top: ds-metrics-border-width(x1) solid $ds-color-border-primary;
55
+
56
+ @include ds-mq-smallest-breakpoint(tablet) {
57
+ margin-top: 0;
58
+ padding-top: 0;
59
+ border-top: none;
60
+ }
61
+ }
62
+
63
+ &:nth-child(3):not(:last-child)::before {
64
+ margin-right: ds-spacing-component($ds-sc-x4, "px", true);
65
+ }
66
+
67
+ .ds-teaser__title {
68
+ @include ds-typography($ds-typography-expressive-heading02bold);
69
+ }
70
+
71
+ .ds-teaser__media {
72
+ @include ds-mq-largest-breakpoint(mobile) {
73
+ margin-bottom: ds-spacing-component($ds-sc-x2);
74
+
75
+ .ds-teaser-image__byline {
76
+ display: none;
77
+ }
78
+ }
79
+
80
+ @include ds-mq-smallest-breakpoint(tablet) {
81
+ margin-bottom: ds-spacing-component($ds-sc-x3);
82
+ }
83
+ }
84
+ }
85
+ }
@@ -0,0 +1,50 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-standard](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-standard)
2
+ - Storybook (PROD): [TeaserStandard > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teaserstandard-web)
3
+ - Storybook (LATEST): [TeaserStandard > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teaserstandard-web)
4
+
5
+ ----
6
+
7
+ # teaser-standard
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
+ |variant | String | no | "default" or "podd" | "default" | |
16
+ |areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
17
+ |theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme-class to apply to the teaser |
18
+ |text | String | no | | | Teaser subtext |
19
+ |vignette | String | no | | | Top text in the teaser |
20
+ |highlight | String | no | | | Text before the heading |
21
+ |sticker | String | no | | | Red text before the text |
22
+ |grade | String | no | | | zero, one, two, three, four, five, none |
23
+ |mediaHtml | HTML String | no | | | Main image or other media |
24
+ |isItalicHeadline | bool | no | true, false | false | If the headline should be italic |
25
+ |isFlashingDot | bool | no | true, false | false | If there should be a flashing ball before the text |
26
+ |isLocked | bool | no | true, false | false | If the paywall indicator should be shown. It is only shown if the teaser has an image. |
27
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
28
+ |classNames | String | no | | | Ex. "my-special-class" |
29
+ |~forcePx~ | | | | | Not supported |
30
+
31
+ ## Minimum requirement example
32
+
33
+ ### Nunjucks
34
+
35
+ These are copy paste friendly examples to quickliy get started using a component.
36
+
37
+ ```html
38
+ {% from '@bonniernews/dn-design-system-web/components/teaser-standard/teaser-standard.njk' import TeaserStandard %}
39
+
40
+ {{ TeaserStandard({
41
+ title: "Upp på börsen",
42
+ text: "Det ser ganska normalt ut på Stockholmsbörsen.",
43
+ highlight: "Ekonominytt:"
44
+ })}}
45
+ ```
46
+
47
+ ### SCSS
48
+ ```scss
49
+ @use "@bonniernews/dn-design-system-web/components/teaser-standard/teaser-standard" as *;
50
+ ```
@@ -0,0 +1,81 @@
1
+ {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
+ {% from '@bonniernews/dn-design-system-web/components/vip-badge/vip-badge.njk' import VipBadge %}
3
+ {% from '@bonniernews/dn-design-system-web/assets/teaser/dot-or-grade.njk' import getDotOrGrade %}
4
+
5
+ {% macro TeaserStandard(params) %}
6
+ {% set componentClassName = "ds-teaser" %}
7
+ {% set classNamePrefix = componentClassName + "--" %}
8
+ {% set additionalClasses = ["ds-teaser--standard"] %}
9
+ {% set attributes = getAttributes(params.attributes) %}
10
+
11
+ {% if params.variant %}
12
+ {% set additionalClasses = (additionalClasses.push(classNamePrefix + params.variant), additionalClasses) %}
13
+ {% endif %}
14
+
15
+ {% if params.theme %}
16
+ {% set additionalClasses = (additionalClasses.push('ds-theme--' + params.theme), additionalClasses) %}
17
+ {% endif %}
18
+
19
+ {% if params.areaType %}
20
+ {% set additionalClasses = (additionalClasses.push(classNamePrefix + params.areaType), additionalClasses) %}
21
+ {% endif %}
22
+
23
+ {% if params.isLocked and not params.mediaHtml and params.isItalicHeadline %}
24
+ {% set additionalClasses = (additionalClasses.push(classNamePrefix + "quote-badge"), additionalClasses) %}
25
+ {% endif %}
26
+
27
+ {% if params.classNames %}
28
+ {% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
29
+ {% endif%}
30
+
31
+ {% set classes = componentClassName + " " + additionalClasses | join(" ") %}
32
+
33
+ <a href="{{ params.targetLink }}"
34
+ class="{{ classes }}"
35
+ {{- attributes | safe }}>
36
+
37
+ {% if params.isLocked and not params.mediaHtml and params.isItalicHeadline %}
38
+ {{ VipBadge({
39
+ showText: false,
40
+ forcePx: true
41
+ }) }}
42
+ {% endif %}
43
+
44
+ <div class="{{ componentClassName + '__content'}}">
45
+ {% if params.vignette %}
46
+ <div class="ds-teaser__vignette">{{ params.vignette }}</div>
47
+ {% endif %}
48
+
49
+ <h2 class="{{ componentClassName + '__title'}} {{ componentClassName + '__title--italic' if params.isItalicHeadline}}">
50
+ {% if params.highlight %}
51
+ <span class="{{ componentClassName + '__highlight'}}">{{ params.highlight }}</span>
52
+ {% endif %}
53
+ {{ params.title }}
54
+ </h2>
55
+
56
+ {% if params.text and params.areaType !== "right" %}
57
+ <p class="{{ componentClassName + '__text' }}">
58
+ {{ getDotOrGrade({ flashing: params.isFlashingDot, grade: params.grade }) }}
59
+ {% if params.sticker %}
60
+ <span class="ds-teaser__sticker">
61
+ {{ params.sticker }}
62
+ </span>
63
+ {% endif %}
64
+ {{ params.text }}
65
+ </p>
66
+ {% endif %}
67
+ </div>
68
+
69
+ {% if params.mediaHtml %}
70
+ <div class="{{ componentClassName + '__media'}}">
71
+ {{ params.mediaHtml }}
72
+ {% if params.isLocked %}
73
+ {{ VipBadge({
74
+ showText: false,
75
+ forcePx: true
76
+ }) }}
77
+ {% endif %}
78
+ </div>
79
+ {% endif %}
80
+ </a>
81
+ {% endmacro %}
@@ -0,0 +1,38 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../assets/teaser/teaser.scss" as *;
3
+
4
+ .ds-teaser.ds-teaser--standard {
5
+ display: flex;
6
+
7
+ @include ds-spacing-layout($ds-sl-teaser-vertical $ds-sl-teaser-horizontal);
8
+
9
+ .ds-teaser__title {
10
+ @include ds-typography($ds-typography-expressive-heading03bold);
11
+
12
+ &--italic {
13
+ @include ds-typography($ds-typography-expressive-heading03italicregular);
14
+ }
15
+ }
16
+
17
+ .ds-teaser__media {
18
+ margin-left: ds-spacing-component($ds-sc-x4);
19
+
20
+ @include ds-mq-largest-breakpoint(mobile) {
21
+ min-width: 104px;
22
+ max-width: 104px;
23
+
24
+ .ds-teaser-image__byline {
25
+ display: none;
26
+ }
27
+ }
28
+
29
+ @include ds-mq-smallest-breakpoint(tablet) {
30
+ min-width: 196px;
31
+ max-width: 196px;
32
+ }
33
+
34
+ .teaser__video {
35
+ max-width: 100%;
36
+ }
37
+ }
38
+ }
@@ -0,0 +1,41 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-tipsa](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-tipsa)
2
+ - Storybook (PROD): [TeaserTipsa > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teasertipsa-web)
3
+ - Storybook (LATEST): [TeaserTipsa > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teasertipsa-web)
4
+
5
+ ----
6
+
7
+ # teaser-tipsa
8
+
9
+ It's quite common to include a dot in the title string, like "• This is a title"
10
+
11
+ ## Parameters
12
+
13
+ |parameter | type | required | options | default | description |
14
+ |:--- | :--- | :--- | :--- | :--- | :--- |
15
+ |title | String | yes | | | Heading of the teaser |
16
+ |targetLink | String | yes | | | Target URL for the teaser |
17
+ |text | String | no | | | Teaser subtext |
18
+ |areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
19
+ |theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme-class to apply to the teaser |
20
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
21
+ |classNames | String | no | | | Ex. "my-special-class" |
22
+ |~forcePx~ | | | | | Not supported |
23
+
24
+ ## Minimum requirement example
25
+
26
+ ### Nunjucks
27
+
28
+ These are copy paste friendly examples to quickliy get started using a component.
29
+
30
+ ```html
31
+ {% from '@bonniernews/dn-design-system-web/components/teaser-tipsa/teaser-tipsa.njk' import TeaserTipsa %}
32
+
33
+ {{ TeaserTipsa({
34
+ title: "• Jessie Ware låter den fullödiga fullängdaren vänta på sig",
35
+ })}}
36
+ ```
37
+
38
+ ### SCSS
39
+ ```scss
40
+ @use "@bonniernews/dn-design-system-web/components/teaser-tipsa/teaser-tipsa" as *;
41
+ ```