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

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 +733 -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 +134 -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 +35 -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 +59 -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 +42 -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 +88 -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 +40 -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 +25 -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 +7 -1
  119. package/foundations/variables/spacingLayoutLargeScreen.scss +6 -0
  120. package/foundations/variables/spacingLayoutList.scss +6 -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 +7 -1
  128. package/foundations/icons/icon-sprite.svg +0 -2
@@ -0,0 +1,52 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-large](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-large)
2
+ - Storybook (PROD): [TeaserLarge > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teaserlarge-web)
3
+ - Storybook (LATEST): [TeaserLarge > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teaserlarge-web)
4
+
5
+ ----
6
+
7
+ # teaser-large
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
+ |bylineHtml | HTML String | no | | | Side image of the author |
25
+ |isItalicHeadline | bool | no | true, false | false | If the headline should be italic |
26
+ |isLargeHeadline | bool | no | true, false | false | If the headline should be large. Only has an effect if `isItalicHeadline` is true. |
27
+ |isFlashingDot | bool | no | true, false | false | If there should be a flashing ball before the text |
28
+ |isLocked | bool | no | true, false | false | If the paywall indicator should be shown. It is only shown if the teaser has an image. |
29
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
30
+ |classNames | String | no | | | Ex. "my-special-class" |
31
+ |~forcePx~ | | | | | Not supported |
32
+
33
+ ## Minimum requirement example
34
+
35
+ ### Nunjucks
36
+
37
+ These are copy paste friendly examples to quickliy get started using a component.
38
+
39
+ ```html
40
+ {% from '@bonniernews/dn-design-system-web/components/teaser-large/teaser-large.njk' import TeaserLarge %}
41
+
42
+ {{ TeaserLarge({
43
+ title: "Upp på börsen",
44
+ text: "Det ser ganska normalt ut på Stockholmsbörsen.",
45
+ highlight: "Ekonominytt:"
46
+ })}}
47
+ ```
48
+
49
+ ### SCSS
50
+ ```scss
51
+ @use "@bonniernews/dn-design-system-web/components/teaser-large/teaser-large" as *;
52
+ ```
@@ -0,0 +1,96 @@
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 TeaserLarge(params) %}
6
+ {% set componentClassName = "ds-teaser" %}
7
+ {% set classNamePrefix = componentClassName + "--" %}
8
+ {% set additionalClasses = ["ds-teaser--large"] %}
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 not params.bylineHtml and params.isItalicHeadline %}
24
+ {% set additionalClasses = (additionalClasses.push(classNamePrefix + "quote-badge"), additionalClasses) %}
25
+ {% endif %}
26
+
27
+ {% if params.mediaHtml %}
28
+ {% set additionalClasses = (additionalClasses.push(classNamePrefix + 'top-img'), additionalClasses) %}
29
+ {% endif %}
30
+
31
+ {% if params.classNames %}
32
+ {% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
33
+ {% endif%}
34
+
35
+ {% if params.isItalicHeadline and params.isLargeHeadline and params.areaType !== "right" %}
36
+ {% set additionalClasses = (additionalClasses.push("ds-teaser--large-big-italic"), additionalClasses) %}
37
+ {% elif params.isItalicHeadline %}
38
+ {% set additionalClasses = (additionalClasses.push("ds-teaser--large-italic"), additionalClasses) %}
39
+ {% endif %}
40
+
41
+ {% set classes = componentClassName + " " + additionalClasses | join(" ") %}
42
+
43
+ <a href="{{ params.targetLink }}"
44
+ class="{{ classes }}"
45
+ {{- attributes | safe }}>
46
+
47
+ {% if params.mediaHtml %}
48
+ <div class="{{ componentClassName + '__media'}}">
49
+ {{ params.mediaHtml }}
50
+ {% if params.isLocked %}
51
+ {{ VipBadge({
52
+ showText: true,
53
+ forcePx: true
54
+ }) }}
55
+ {% endif %}
56
+ </div>
57
+ {% elif params.isItalicHeadline and params.isLocked %}
58
+ {{ VipBadge({
59
+ showText: false,
60
+ forcePx: true
61
+ }) }}
62
+ {% endif %}
63
+
64
+ <div class="{{ componentClassName + '__content'}}">
65
+ <div class="ds-teaser__content-inner">
66
+ {% if params.vignette %}
67
+ <div class="ds-teaser__vignette">{{ params.vignette }}</div>
68
+ {% endif %}
69
+ <h2 class="ds-teaser__title">
70
+ {% if params.highlight %}
71
+ <span class="{{ componentClassName + '__highlight'}}">{{ params.highlight }}</span>
72
+ {% endif %}
73
+ {{ params.title }}
74
+ </h2>
75
+
76
+ {% if params.text and params.areaType !== "right" %}
77
+ <p class="{{ componentClassName + '__text' }}">
78
+ {{ getDotOrGrade({ flashing: params.isFlashingDot, grade: params.grade }) }}
79
+ {% if params.sticker %}
80
+ <span class="ds-teaser__sticker">
81
+ {{ params.sticker }}
82
+ </span>
83
+ {% endif %}
84
+ {{ params.text }}
85
+ </p>
86
+ {% endif %}
87
+ </div>
88
+
89
+ {% if params.bylineHtml %}
90
+ <div class="{{ componentClassName + '__byline'}}">
91
+ {{ params.bylineHtml | safe }}
92
+ </div>
93
+ {% endif %}
94
+ </div>
95
+ </a>
96
+ {% endmacro %}
@@ -0,0 +1,134 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../assets/teaser/teaser.scss" as *;
3
+
4
+ .ds-teaser.ds-teaser--large {
5
+ display: flex;
6
+ flex-direction: column;
7
+ position: relative;
8
+
9
+ .ds-teaser__media {
10
+ video {
11
+ max-width: 100%;
12
+ }
13
+ }
14
+
15
+ .ds-teaser__content {
16
+ display: flex;
17
+ flex-direction: row;
18
+ @include ds-spacing-layout(
19
+ $ds-sl-teaser-vertical-small $ds-sl-teaser-horizontal
20
+ $ds-sl-teaser-vertical-medium
21
+ );
22
+
23
+ .ds-teaser__content-inner {
24
+ display: flex;
25
+ flex-direction: column;
26
+ flex: 1;
27
+ }
28
+ }
29
+
30
+ &:focus-visible {
31
+ outline: none !important;
32
+
33
+ .ds-teaser__content {
34
+ @include ds-teaser-focus(-8px, false);
35
+ }
36
+ }
37
+
38
+ .ds-teaser__title {
39
+ @include ds-typography($ds-typography-expressive-heading04bold);
40
+ }
41
+
42
+ @include ds-hover(true) {
43
+ .ds-teaser__title {
44
+ @include ds-underline(3px);
45
+ }
46
+ }
47
+
48
+ &.ds-teaser--large-big-italic {
49
+ .ds-teaser__title {
50
+ @include ds-typography($ds-typography-expressive-heading04italicregular);
51
+ }
52
+ }
53
+
54
+ &.ds-teaser--large-italic {
55
+ .ds-teaser__title {
56
+ @include ds-typography($ds-typography-expressive-heading03italicregular);
57
+ }
58
+
59
+ @include ds-hover(true) {
60
+ .ds-teaser__title {
61
+ @include ds-underline();
62
+ }
63
+ }
64
+ }
65
+
66
+ .ds-teaser__byline {
67
+ overflow: hidden;
68
+ position: relative;
69
+ margin-left: ds-spacing-component($ds-sc-x4);
70
+
71
+ // margin-bottom needs to be the negative value of padding-bottom on .ds-teaser__content
72
+ @include ds-mq-only-breakpoint(mobile) {
73
+ margin-bottom: ds-spacing-component($ds-sc-x3, "px", true);
74
+ }
75
+ @include ds-mq-smallest-breakpoint(tablet) {
76
+ margin-bottom: ds-spacing-component($ds-sc-x4, "px", true);
77
+ }
78
+
79
+ .picture {
80
+ position: absolute;
81
+ top: 0;
82
+ right: 0;
83
+ bottom: 0;
84
+ width: 100%;
85
+ min-width: 96px;
86
+ margin: 0;
87
+
88
+ > .picture__img {
89
+ margin: 0;
90
+ top: unset;
91
+ max-height: unset;
92
+ }
93
+ }
94
+
95
+ @include ds-mq-largest-breakpoint(mobile) {
96
+ width: 96px;
97
+ min-height: 96px;
98
+ margin-left: ds-spacing-component($ds-sc-x2);
99
+ }
100
+
101
+ @include ds-mq-smallest-breakpoint(tablet) {
102
+ width: 144px;
103
+ // En bylinebild bör va lika hög som en "grekisk byst" - man ska se lite skjortkrage!
104
+ min-height: 110px;
105
+ margin-left: ds-spacing-component($ds-sc-x4);
106
+ }
107
+ }
108
+
109
+ @include ds-mq-smallest-breakpoint(tablet) {
110
+ &.ds-teaser--right {
111
+ .ds-teaser__title {
112
+ @include ds-typography($ds-typography-expressive-heading02bold);
113
+ }
114
+
115
+ &.ds-teaser--large-italic .ds-teaser__title {
116
+ @include ds-typography(
117
+ $ds-typography-expressive-heading02italicregular
118
+ );
119
+
120
+ @include ds-hover(true) {
121
+ .ds-teaser__title {
122
+ @include ds-underline(2px, 1px);
123
+ }
124
+ }
125
+ }
126
+
127
+ .ds-teaser__byline {
128
+ width: 96px;
129
+ min-height: 96px;
130
+ margin-left: ds-spacing-component($ds-sc-x2);
131
+ }
132
+ }
133
+ }
134
+ }
@@ -0,0 +1,45 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-onsite](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-onsite)
2
+ - Storybook (PROD): [TeaserOnSite > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teaseronsite-web)
3
+ - Storybook (LATEST): [TeaserOnSite > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teaseronsite-web)
4
+
5
+ ----
6
+
7
+ # teaser-onsite
8
+
9
+ Also known as "På Plats-puffen".
10
+
11
+ In the CMS title will be set to a location like "Kiev, Ukraina" or "USA" and text is usually set to some author names like "Jan Banan och Kalle Kula"
12
+
13
+ ## Parameters
14
+
15
+ |parameter | type | required | options | default | description |
16
+ |:--- | :--- | :--- | :--- | :--- | :--- |
17
+ |title | String | yes | | | Heading of the teaser |
18
+ |targetLink | String | yes | | | Target URL for the teaser |
19
+ |areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
20
+ |theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme-class to apply to the teaser |
21
+ |text | String | no | | | Teaser subtext |
22
+ |mediaHtml | HTML String | no | | | Main image or other media |
23
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
24
+ |classNames | String | no | | | Ex. "my-special-class" |
25
+ |~forcePx~ | | | | | Not supported |
26
+
27
+ ## Minimum requirement example
28
+
29
+ ### Nunjucks
30
+
31
+ These are copy paste friendly examples to quickly get started using a component.
32
+
33
+ ```html
34
+ {% from '@bonniernews/dn-design-system-web/components/teaser-onsite/teaser-onsite.njk' import TeaserOnSite %}
35
+
36
+ {{ TeaserOnSite({
37
+ title: 'Kiev, Ukraina',
38
+ text: 'Henrik Brandão Jönsson och Eduardo Leal'
39
+ })}}
40
+ ```
41
+
42
+ ### SCSS
43
+ ```scss
44
+ @use "@bonniernews/dn-design-system-web/components/teaser-onsite/teaser-onsite";
45
+ ```
@@ -0,0 +1,45 @@
1
+ {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
+
3
+ {% macro TeaserOnSite(params) %}
4
+ {% set componentClassName = "ds-teaser" %}
5
+ {% set classNamePrefix = componentClassName + "--" %}
6
+ {% set additionalClasses = ["ds-teaser--onsite"] %}
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
+ <a href="{{ params.targetLink }}"
24
+ class="{{ classes }}"
25
+ {{- attributes | safe }}>
26
+
27
+ {% if params.mediaHtml %}
28
+ <div class="{{ componentClassName + '__media'}}">
29
+ {{ params.mediaHtml }}
30
+ </div>
31
+ {% endif %}
32
+
33
+ <div class="{{ componentClassName + '__content'}}">
34
+ <h2 class="ds-teaser__title">
35
+ PÅ PLATS | {{ params.title }}
36
+ </h2>
37
+
38
+ {% if params.text %}
39
+ <p class="{{ componentClassName + '__text'}}">
40
+ {{ params.text }}
41
+ </p>
42
+ {% endif %}
43
+ </div>
44
+ </a>
45
+ {% endmacro %}
@@ -0,0 +1,35 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../assets/teaser/teaser.scss" as *;
3
+
4
+ .ds-teaser.ds-teaser--onsite {
5
+ @include ds-spacing-layout(
6
+ $ds-sl-teaser-vertical-medium $ds-sl-teaser-horizontal
7
+ );
8
+ display: flex;
9
+
10
+ .ds-teaser__title {
11
+ color: $ds-theme-color;
12
+ @include ds-typography($ds-typography-detailarticle-label);
13
+ }
14
+
15
+ @include ds-hover(true) {
16
+ .ds-teaser__title {
17
+ text-decoration: none;
18
+ }
19
+
20
+ .ds-teaser__text {
21
+ @include ds-underline();
22
+ }
23
+ }
24
+
25
+ .ds-teaser__text {
26
+ margin-top: 0;
27
+ @include ds-typography($ds-typography-functional-heading01bold);
28
+ }
29
+
30
+ .ds-teaser__media {
31
+ margin-right: ds-spacing-component($ds-sc-x4);
32
+ width: 56px;
33
+ height: 56px;
34
+ }
35
+ }
@@ -0,0 +1,42 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-package](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-package)
2
+ - Storybook (PROD): [TeaserPackage > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teaserpackage-web)
3
+ - Storybook (LATEST): [TeaserPackage > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teaserpackage-web)
4
+
5
+ ----
6
+
7
+ # teaser-package
8
+
9
+ ## Parameters
10
+
11
+ |parameter | type | required | options | default | description |
12
+ |:--- | :--- | :--- | :--- | :--- | :--- |
13
+ |teasersHtml | HTML String | yes | | | HTML teaser output |
14
+ |vignetteText | String | yes | | | Heading of the teaser |
15
+ |vignetteTargetUrl | String | no | | | Target URL for the teaser |
16
+ |areaType | String | no | "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
+ |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-package/teaser-package.njk' import TeaserPackage %}
30
+
31
+ {{ TeaserPackage({
32
+ teasersHtml: "",
33
+ areaType: "bauta",
34
+ vignetteText: "Svensk politik",
35
+ vignetteTargetUrl: "/om/svensk-politik/"
36
+ })}}
37
+ ```
38
+
39
+ ### SCSS
40
+ ```scss
41
+ @use "@bonniernews/dn-design-system-web/components/teaser-package/teaser-package" as *;
42
+ ```
@@ -0,0 +1,39 @@
1
+ {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
+ {% from '@bonniernews/dn-design-system-web/components/icon-sprite/icon-sprite.njk' import IconUse %}
3
+
4
+ {% macro TeaserPackage(params) %}
5
+ {%- set componentClassName = "ds-teaser-package" %}
6
+ {%- set classNamePrefix = componentClassName + "--" %}
7
+ {%- set additionalClasses = [] %}
8
+ {%- set attributes = getAttributes(params.attributes) %}
9
+
10
+ {%- if params.areaType %}
11
+ {% set additionalClasses = (additionalClasses.push(classNamePrefix + params.areaType), additionalClasses) %}
12
+ {% endif %}
13
+
14
+ {%- if params.theme %}
15
+ {% set additionalClasses = (additionalClasses.push('ds-theme--' + params.theme), additionalClasses) %}
16
+ {% endif %}
17
+
18
+ {%- if params.classNames %}
19
+ {% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
20
+ {% endif%}
21
+
22
+ {%- set classes = componentClassName + " " + additionalClasses | join(" ") %}
23
+ <div class="{{ classes }}">
24
+ {%- if params.vignetteTargetUrl %}
25
+ <a href="{{ params.vignetteTargetUrl }}"
26
+ class="{{ componentClassName + '__vignette'}}"
27
+ {{- attributes | safe }}>
28
+ <span>{{ params.vignetteText }}</span>
29
+ {# To keep the design as close to the old master design as possible, bautaXL does not have an arrow now. But we are hoping it'll make a comeback. #}
30
+ {% if params.areaType != "bautaxl" %}
31
+ {{ IconUse({ icon: "arrow_forward", attributes: {"aria-hidden": true} }) }}
32
+ {% endif %}
33
+ </a>
34
+ {% elif params.vignetteText %}
35
+ <div class="{{ componentClassName + '__vignette'}}">{{ params.vignetteText }}</div>
36
+ {% endif %}
37
+ {{ params.teasersHtml | safe }}
38
+ </div>
39
+ {% endmacro %}
@@ -0,0 +1,114 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../assets/teaser/teaser.scss";
3
+
4
+ .ds-teaser-package {
5
+ position: relative;
6
+ background-color: $ds-color-background-primary;
7
+
8
+ & > .ds-teaser {
9
+ position: relative;
10
+ }
11
+
12
+ > .ds-teaser::after,
13
+ > .ds-teaser + .ds-split-container::after {
14
+ content: "";
15
+ height: ds-metrics-border-width(x1);
16
+ background-color: $ds-color-border-primary;
17
+ position: absolute;
18
+ display: block;
19
+ top: 0;
20
+ left: 0;
21
+ right: 0;
22
+ @include ds-spacing-layout(0 $ds-sl-teaser-horizontal, margin);
23
+ box-sizing: border-box;
24
+ z-index: 5;
25
+ }
26
+
27
+ .ds-teaser-package__vignette + .ds-teaser::after,
28
+ .ds-teaser--top-img::after,
29
+ > .ds-teaser:first-child:after {
30
+ display: none;
31
+ }
32
+
33
+ &::after {
34
+ content: "";
35
+ position: absolute;
36
+ height: 100%;
37
+ width: 4px;
38
+ top: 0;
39
+ background-color: $ds-theme-color;
40
+ z-index: 5;
41
+ }
42
+
43
+ .ds-teaser-package__vignette {
44
+ padding: ds-spacing-component($ds-sc-x3);
45
+ @include ds-spacing-layout($ds-sl-teaser-horizontal, padding-left);
46
+ @include ds-spacing-layout($ds-sl-teaser-horizontal, padding-right);
47
+ @include ds-typography($ds-typography-functional-body02bold);
48
+ display: flex;
49
+ justify-content: space-between;
50
+ align-items: center;
51
+ background-color: $ds-color-component-secondary;
52
+
53
+ @include ds-hover(true) {
54
+ @include ds-underline(1px, 2px);
55
+ }
56
+
57
+ @include ds-teaser-focus(-8px);
58
+ }
59
+
60
+ a.ds-teaser-package__vignette {
61
+ @include ds-link($ds-link-list);
62
+ }
63
+
64
+ .ds-teaser-package__vignette,
65
+ a.ds-teaser-package__vignette {
66
+ color: $ds-color-text-primary;
67
+ }
68
+
69
+ &.ds-teaser-package--bauta {
70
+ .ds-teaser-package__vignette {
71
+ color: $ds-color-static-white;
72
+ background-color: $ds-theme-color;
73
+ }
74
+ }
75
+
76
+ &.ds-teaser-package--bautaxl {
77
+ &::after {
78
+ background-color: transparent;
79
+ }
80
+
81
+ .ds-teaser-package__vignette {
82
+ color: $ds-color-static-yellow;
83
+ background-color: #2b2b2b; // @todo change to token when available
84
+ @include ds-typography($ds-typography-detailbaota-xl-label);
85
+ }
86
+
87
+ .ds-teaser-package__vignette
88
+ + .ds-teaser--large:not(.ds-teaser--large-italic):not(.ds-teaser--large-big-italic) {
89
+ .ds-teaser__title {
90
+ @include ds-typography($ds-typography-expressive-heading05bold);
91
+ }
92
+
93
+ @include ds-mq-only-breakpoint(mobile) {
94
+ background-color: #2b2b2b; // @todo change to token when available
95
+ .ds-teaser__title,
96
+ .ds-teaser__text {
97
+ color: $ds-color-static-white;
98
+ }
99
+
100
+ & + .ds-teaser::after,
101
+ & + .ds-split-container::after {
102
+ display: none;
103
+ }
104
+ }
105
+ }
106
+ }
107
+
108
+ .ds-icon {
109
+ width: ds-px-to-rem(24px);
110
+ height: ds-px-to-rem(24px);
111
+ color: currentColor;
112
+ display: inline-flex;
113
+ }
114
+ }
@@ -0,0 +1,37 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-right-now](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-right-now)
2
+ - Storybook (PROD): [TeaserRightNow > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teaserrightnow-web--right-now)
3
+ - Storybook (LATEST): [TeaserRightNow > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teaserrightnow-web--right-now)
4
+
5
+ ----
6
+
7
+ # teaser-right-now
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
+ |theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme-class to apply to the teaser |
16
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
17
+ |classNames | String | no | | | Ex. "my-special-class" |
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-right-now/teaser-right-now.njk' import TeaserRightNow %}
28
+
29
+ {{ TeaserRightNow({
30
+ title: "Tågtrafiken är avstängd mellan Malmö och Göteborg",
31
+ })}}
32
+ ```
33
+
34
+ ### SCSS
35
+ ```scss
36
+ @use "@bonniernews/dn-design-system-web/components/teaser-right-now/teaser-right-now" as *;
37
+ ```
@@ -0,0 +1,29 @@
1
+ {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
+
3
+ {% macro TeaserRightNow(params) %}
4
+ {%- set componentClassName = "ds-teaser" %}
5
+ {%- set classNamePrefix = componentClassName + "--" %}
6
+ {%- set additionalClasses = ["ds-teaser--right-now"] %}
7
+ {%- set attributes = getAttributes(params.attributes) %}
8
+
9
+ {%- if params.classNames %}
10
+ {% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
11
+ {% endif%}
12
+
13
+ {%- if params.theme %}
14
+ {% set additionalClasses = (additionalClasses.push('ds-theme--' + params.theme), additionalClasses) %}
15
+ {% endif %}
16
+
17
+ {%- set classes = componentClassName + " " + additionalClasses | join(" ") %}
18
+ <a href="{{ params.targetLink }}"
19
+ class="{{ classes }}"
20
+ {{- attributes | safe }}>
21
+
22
+ <span class="ds-teaser__right-now-sticker">Just nu</span>
23
+ <div class="{{ componentClassName + '__content'}}">
24
+ <h2 class="ds-teaser__title">
25
+ {{ params.title }}
26
+ </h2>
27
+ </div>
28
+ </a>
29
+ {% endmacro %}