@bonniernews/dn-design-system-web 3.0.0-alpha.7 → 3.0.0-alpha.71

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 (121) hide show
  1. package/CHANGELOG.md +571 -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/teaser.scss +75 -0
  7. package/components/article-body-image/README.md +2 -2
  8. package/components/article-body-image/article-body-image.njk +1 -5
  9. package/components/article-top-image/README.md +2 -2
  10. package/components/article-top-image/article-top-image.njk +1 -5
  11. package/components/article-top-image/article-top-image.scss +1 -1
  12. package/components/badge/badge.scss +1 -5
  13. package/components/buddy-menu/buddy-menu.scss +1 -8
  14. package/components/button/button.njk +38 -43
  15. package/components/button/button.scss +6 -1
  16. package/components/button-toggle/button-toggle.js +2 -0
  17. package/components/button-toggle/button-toggle.njk +36 -36
  18. package/components/button-toggle/button-toggle.scss +6 -1
  19. package/components/byline/byline.njk +2 -2
  20. package/components/byline/byline.scss +1 -3
  21. package/components/checkbox/checkbox.njk +3 -3
  22. package/components/checkbox/checkbox.scss +8 -9
  23. package/components/disclaimer/disclaimer.njk +2 -2
  24. package/components/disclaimer/disclaimer.scss +25 -11
  25. package/components/factbox/README.md +2 -2
  26. package/components/factbox/factbox.njk +9 -11
  27. package/components/factbox/factbox.scss +6 -37
  28. package/components/footer/footer.scss +2 -8
  29. package/components/icon-button/README.md +2 -1
  30. package/components/icon-button/icon-button.njk +4 -4
  31. package/components/icon-button/icon-button.scss +5 -2
  32. package/components/icon-button-toggle/icon-button-toggle.js +2 -0
  33. package/components/icon-button-toggle/icon-button-toggle.njk +28 -36
  34. package/components/icon-button-toggle/icon-button-toggle.scss +5 -2
  35. package/components/icon-sprite/README.md +51 -0
  36. package/components/icon-sprite/icon-sprite.njk +12 -0
  37. package/components/icon-sprite/icon-sprite.scss +12 -0
  38. package/components/icon-with-wrapper/README.md +9 -2
  39. package/components/icon-with-wrapper/icon-with-wrapper.njk +2 -2
  40. package/components/icon-with-wrapper/icon-with-wrapper.scss +2 -1
  41. package/components/image-caption/README.md +38 -0
  42. package/components/image-caption/image-caption.njk +25 -0
  43. package/components/image-caption/image-caption.scss +15 -0
  44. package/components/list-item/list-item.njk +5 -5
  45. package/components/list-item/list-item.scss +1 -3
  46. package/components/pictogram/README.md +39 -0
  47. package/components/pictogram/pictogram.njk +30 -0
  48. package/components/pictogram/pictogram.scss +54 -0
  49. package/components/quote/README.md +1 -2
  50. package/components/quote/quote.njk +6 -8
  51. package/components/quote/quote.scss +1 -14
  52. package/components/radio-button/radio-button.njk +3 -3
  53. package/components/radio-button/radio-button.scss +8 -10
  54. package/components/spinner/spinner.njk +19 -23
  55. package/components/spinner/spinner.scss +4 -1
  56. package/components/teaser-dot/README.md +34 -0
  57. package/components/teaser-dot/teaser-dot.njk +24 -0
  58. package/components/teaser-dot/teaser-dot.scss +39 -0
  59. package/components/teaser-image/README.md +40 -0
  60. package/components/teaser-image/teaser-image.njk +21 -0
  61. package/components/teaser-image/teaser-image.scss +21 -0
  62. package/components/teaser-large/README.md +51 -0
  63. package/components/teaser-large/teaser-large.njk +93 -0
  64. package/components/teaser-large/teaser-large.scss +174 -0
  65. package/components/teaser-onsite/README.md +53 -0
  66. package/components/teaser-onsite/teaser-onsite.njk +45 -0
  67. package/components/teaser-onsite/teaser-onsite.scss +35 -0
  68. package/components/teaser-package/README.md +42 -0
  69. package/components/teaser-package/teaser-package.njk +36 -0
  70. package/components/teaser-package/teaser-package.scss +112 -0
  71. package/components/teaser-right-now/README.md +37 -0
  72. package/components/teaser-right-now/teaser-right-now.njk +28 -0
  73. package/components/teaser-right-now/teaser-right-now.scss +16 -0
  74. package/components/teaser-slideshow/README.md +42 -0
  75. package/components/teaser-slideshow/teaser-slideshow.njk +38 -0
  76. package/components/teaser-slideshow/teaser-slideshow.scss +35 -0
  77. package/components/teaser-split/README-container.md +40 -0
  78. package/components/teaser-split/README.md +48 -0
  79. package/components/teaser-split/teaser-split.njk +93 -0
  80. package/components/teaser-split/teaser-split.scss +77 -0
  81. package/components/teaser-standard/README.md +49 -0
  82. package/components/teaser-standard/teaser-standard.njk +81 -0
  83. package/components/teaser-standard/teaser-standard.scss +38 -0
  84. package/components/teaser-tipsa/README.md +41 -0
  85. package/components/teaser-tipsa/teaser-tipsa.njk +31 -0
  86. package/components/teaser-tipsa/teaser-tipsa.scss +23 -0
  87. package/components/text-button/text-button.njk +34 -37
  88. package/components/text-button/text-button.scss +12 -10
  89. package/components/text-button-toggle/text-button-toggle.js +2 -0
  90. package/components/text-button-toggle/text-button-toggle.njk +30 -33
  91. package/components/text-button-toggle/text-button-toggle.scss +10 -10
  92. package/components/text-input/text-input.scss +3 -8
  93. package/components/video-caption/README.md +1 -1
  94. package/components/video-caption/video-caption.njk +12 -6
  95. package/components/vip-badge/README.md +35 -0
  96. package/components/vip-badge/vip-badge.njk +23 -0
  97. package/components/vip-badge/vip-badge.scss +54 -0
  98. package/foundations/colors.scss +31 -0
  99. package/foundations/helpers/README-links.md +1 -1
  100. package/foundations/helpers/colors.scss +2 -0
  101. package/foundations/helpers/links.scss +14 -6
  102. package/foundations/icons/icon.njk +167 -143
  103. package/foundations/icons/sprite.njk +1 -0
  104. package/foundations/icons/sprite.svg +1 -0
  105. package/foundations/icons/svg/download.svg +3 -0
  106. package/foundations/icons/svg/filter_list.svg +3 -0
  107. package/foundations/icons/svg/pause.svg +3 -0
  108. package/foundations/icons/svg/vip.svg +3 -0
  109. package/foundations/typography/fontDefinitions.scss +82 -67
  110. package/foundations/variables/colorsCssVariables.scss +5 -0
  111. package/foundations/variables/colorsDnDarkTokens.scss +6 -1
  112. package/foundations/variables/colorsDnLightTokens.scss +7 -2
  113. package/foundations/variables/spacingLayout.scss +6 -1
  114. package/foundations/variables/spacingLayoutLargeScreen.scss +5 -0
  115. package/foundations/variables/spacingLayoutList.scss +5 -0
  116. package/foundations/variables/typographyTokensScreenLarge.scss +87 -87
  117. package/foundations/variables/typographyTokensScreenSmall.scss +114 -114
  118. package/package.json +2 -2
  119. package/tokens/colors-css-variables.json +5 -0
  120. package/tokens/spacing-layout-list.json +6 -1
  121. package/foundations/icons/icon-sprite.svg +0 -2
@@ -0,0 +1,174 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../assets/teaser/teaser.scss" as *;
3
+
4
+ .ds-teaser.ds-teaser--large {
5
+ display: block;
6
+ position: relative;
7
+
8
+ .ds-teaser__media {
9
+ video {
10
+ max-width: 100%;
11
+ }
12
+ }
13
+
14
+ .ds-teaser__content {
15
+ flex: 1;
16
+ display: grid;
17
+ grid-auto-rows: auto;
18
+ grid-template-columns: 1fr auto;
19
+ @include ds-spacing-layout($ds-sl-teaser-vertical $ds-sl-teaser-horizontal);
20
+
21
+ // Special case for large teaser, should be replaced with dynamic spacing layout token when available
22
+ @include ds-mq-only-breakpoint(mobile) {
23
+ padding-bottom: ds-spacing-component($ds-sc-x3);
24
+ }
25
+ @include ds-mq-smallest-breakpoint(tablet) {
26
+ padding-bottom: ds-spacing-component($ds-sc-x4);
27
+ }
28
+ }
29
+
30
+ .ds-teaser__vignette {
31
+ grid-column: 1;
32
+ }
33
+
34
+ .ds-teaser__title {
35
+ grid-row: 1;
36
+ grid-column: 1 / span 1;
37
+ @include ds-mq-only-breakpoint(mobile) {
38
+ @include ds-typography-without-mq(
39
+ $ds-typography-expressive-heading04bold,
40
+ mobile
41
+ );
42
+ }
43
+ @include ds-mq-only-breakpoint(tablet) {
44
+ @include ds-typography-without-mq(
45
+ $ds-typography-expressive-heading04bold,
46
+ tablet
47
+ );
48
+ }
49
+ @include ds-mq-only-breakpoint(desktop) {
50
+ @include ds-typography-without-mq(
51
+ $ds-typography-expressive-heading05bold,
52
+ desktop
53
+ );
54
+ }
55
+ }
56
+
57
+ @include ds-hover(true) {
58
+ .ds-teaser__title {
59
+ @include ds-underline(3px);
60
+ }
61
+ }
62
+
63
+ .ds-teaser__vignette + .ds-teaser__title {
64
+ grid-row: 2;
65
+ }
66
+
67
+ .ds-teaser__text {
68
+ grid-row: 3;
69
+ }
70
+
71
+ &.ds-teaser--large-big-italic {
72
+ .ds-teaser__title {
73
+ @include ds-typography($ds-typography-expressive-heading04italicregular);
74
+ }
75
+
76
+ @include ds-mq-largest-breakpoint(mobile) {
77
+ .ds-teaser__title {
78
+ grid-column-end: span 2;
79
+ }
80
+
81
+ .ds-teaser__byline {
82
+ grid-row: 3;
83
+ margin-top: ds-spacing-component($ds-sc-x2);
84
+ }
85
+ }
86
+
87
+ @include ds-mq-smallest-breakpoint(tablet) {
88
+ .ds-teaser__title {
89
+ grid-column-end: span 1;
90
+ }
91
+ }
92
+ }
93
+
94
+ &.ds-teaser--large-italic {
95
+ .ds-teaser__title {
96
+ @include ds-typography($ds-typography-expressive-heading03italicregular);
97
+ }
98
+
99
+ @include ds-hover(true) {
100
+ .ds-teaser__title {
101
+ @include ds-underline();
102
+ }
103
+ }
104
+ }
105
+
106
+ .ds-teaser__byline {
107
+ grid-column: 2;
108
+ grid-row: 1 / span 3;
109
+ overflow: hidden;
110
+ position: relative;
111
+ margin-left: ds-spacing-component($ds-sc-x4);
112
+ // margin-bottom needs to be the negative value of padding-bottom on .ds-teaser__content
113
+ @include ds-mq-only-breakpoint(mobile) {
114
+ margin-bottom: ds-spacing-component($ds-sc-x3, "px", true);
115
+ }
116
+ @include ds-mq-smallest-breakpoint(tablet) {
117
+ margin-bottom: ds-spacing-component($ds-sc-x4, "px", true);
118
+ }
119
+
120
+ .picture {
121
+ position: absolute;
122
+ top: 0;
123
+ right: 0;
124
+ @include ds-spacing-layout($ds-sl-teaser-vertical, bottom, "px", true);
125
+ width: 100%;
126
+ min-width: 104px;
127
+ margin: 0;
128
+
129
+ > .picture__img {
130
+ margin: 0;
131
+ top: unset;
132
+ max-height: unset;
133
+ }
134
+ }
135
+
136
+ @include ds-mq-largest-breakpoint(mobile) {
137
+ width: 104px;
138
+ min-height: 85px;
139
+ margin-left: ds-spacing-component($ds-sc-x2);
140
+ }
141
+
142
+ @include ds-mq-smallest-breakpoint(tablet) {
143
+ width: 156px;
144
+ // En bylinebild bör va lika hög som en "grekisk byst" - man ska se lite skjortkrage!
145
+ min-height: 110px;
146
+ }
147
+ }
148
+
149
+ @include ds-mq-smallest-breakpoint(tablet) {
150
+ &.ds-teaser--right {
151
+ .ds-teaser__title {
152
+ @include ds-typography($ds-typography-expressive-heading02bold);
153
+ }
154
+
155
+ &.ds-teaser--large-italic .ds-teaser__title {
156
+ @include ds-typography(
157
+ $ds-typography-expressive-heading02italicregular
158
+ );
159
+
160
+ @include ds-hover(true) {
161
+ .ds-teaser__title {
162
+ @include ds-underline(2px, 1px);
163
+ }
164
+ }
165
+ }
166
+
167
+ .ds-teaser__byline {
168
+ width: 104px;
169
+ min-height: 85px;
170
+ margin-left: ds-spacing-component($ds-sc-x2);
171
+ }
172
+ }
173
+ }
174
+ }
@@ -0,0 +1,53 @@
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
+ The worldMap has to be set by the parent page as a CSS variable. This is done in the StoryBook and will have to be done from the production website codebase.
14
+
15
+ ```
16
+ :root {
17
+ --ds-onsite-background-image-url: url("https://i.imgur.com/GJh7Fbl.png");
18
+ }
19
+ ```
20
+
21
+ ## Parameters
22
+
23
+ |parameter | type | required | options | default | description |
24
+ |:--- | :--- | :--- | :--- | :--- | :--- |
25
+ |title | String | yes | | | Heading of the teaser |
26
+ |targetLink | String | yes | | | Target URL for the teaser |
27
+ |areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
28
+ |theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme-class to apply to the teaser |
29
+ |text | String | no | | | Teaser subtext |
30
+ |mediaHtml | HTML String | no | | | Main image or other media |
31
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
32
+ |classNames | String | no | | | Ex. "my-special-class" |
33
+ |~forcePx~ | | | | | Not supported |
34
+
35
+ ## Minimum requirement example
36
+
37
+ ### Nunjucks
38
+
39
+ These are copy paste friendly examples to quickliy get started using a component.
40
+
41
+ ```html
42
+ {% from '@bonniernews/dn-design-system-web/components/teaser-onsite/teaser-onsite.njk' import TeaserOnSite %}
43
+
44
+ {{ TeaserOnSite({
45
+ title: 'Kiev, Ukraina',
46
+ text: 'Henrik Brandão Jönsson och Eduardo Leal'
47
+ })}}
48
+ ```
49
+
50
+ ### SCSS
51
+ ```scss
52
+ @use "@bonniernews/dn-design-system-web/components/teaser-onsite/teaser-onsite" as *;
53
+ ```
@@ -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 | safe }}
36
+ </h2>
37
+
38
+ {% if params.text %}
39
+ <p class="{{ componentClassName + '__text'}}">
40
+ {{ params.text | safe }}
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($ds-sl-teaser-vertical $ds-sl-teaser-horizontal);
6
+ background-image: var(
7
+ --ds-onsite-background-image-url
8
+ ); //Set by parent context (like Storybook or Bang)
9
+ background-position: 100%;
10
+ background-repeat: no-repeat;
11
+ overflow: hidden;
12
+
13
+ .ds-teaser__title {
14
+ color: $ds-theme-color;
15
+ @include ds-typography($ds-typography-detailarticle-label);
16
+ }
17
+
18
+ @include ds-hover(true) {
19
+ .ds-teaser__title {
20
+ @include ds-underline(2px, 1px);
21
+ }
22
+ }
23
+
24
+ .ds-teaser__text {
25
+ margin-top: 0;
26
+ @include ds-typography($ds-typography-functional-heading01bold);
27
+ }
28
+
29
+ .ds-teaser__media {
30
+ float: left;
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,36 @@
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
+ {{ IconUse({ icon: "arrow_forward", attributes: {"aria-hidden": true} }) }}
30
+ </a>
31
+ {% elif params.vignetteText %}
32
+ <div class="{{ componentClassName + '__vignette'}}">{{ params.vignetteText }}</div>
33
+ {% endif %}
34
+ {{ params.teasersHtml | safe }}
35
+ </div>
36
+ {% endmacro %}
@@ -0,0 +1,112 @@
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
+ .ds-teaser--onsite {
34
+ background-position-y: 1px;
35
+ }
36
+
37
+ &::after {
38
+ content: "";
39
+ position: absolute;
40
+ height: 100%;
41
+ width: 4px;
42
+ top: 0;
43
+ background-color: $ds-theme-color;
44
+ z-index: 5;
45
+ }
46
+
47
+ .ds-teaser-package__vignette {
48
+ padding: ds-spacing-component($ds-sc-x3);
49
+ @include ds-spacing-layout($ds-sl-teaser-horizontal, padding-left);
50
+ @include ds-spacing-layout($ds-sl-teaser-horizontal, padding-right);
51
+ @include ds-typography($ds-typography-functional-body02bold);
52
+ display: flex;
53
+ justify-content: space-between;
54
+ align-items: center;
55
+ background-color: $ds-color-component-secondary;
56
+
57
+ @include ds-hover(true) {
58
+ @include ds-underline(1px, 2px);
59
+ }
60
+ }
61
+
62
+ a.ds-teaser-package__vignette {
63
+ @include ds-link($ds-link-list);
64
+ }
65
+
66
+ .ds-teaser-package__vignette,
67
+ a.ds-teaser-package__vignette {
68
+ color: $ds-color-text-primary;
69
+ }
70
+
71
+ &.ds-teaser-package--bauta {
72
+ .ds-teaser-package__vignette {
73
+ color: $ds-color-static-white;
74
+ background-color: $ds-theme-color;
75
+ }
76
+ }
77
+
78
+ &.ds-teaser-package--bautaxl {
79
+ &::after {
80
+ background-color: transparent;
81
+ }
82
+
83
+ .ds-teaser-package__vignette {
84
+ color: $ds-color-static-white;
85
+ background-color: #2b2b2b; // @todo change to token when available
86
+ }
87
+
88
+ .ds-teaser-package__vignette
89
+ + .ds-teaser--large:not(.ds-teaser--large-italic):not(.ds-teaser--large-big-italic) {
90
+ @include ds-mq-smallest-breakpoint(desktop) {
91
+ .ds-teaser__title {
92
+ font-size: 80px; // special case, will not have a token
93
+ line-height: 88px;
94
+ }
95
+ }
96
+ @include ds-mq-only-breakpoint(mobile) {
97
+ background-color: #2b2b2b; // @todo change to token when available
98
+ .ds-teaser__title,
99
+ .ds-teaser__text {
100
+ color: $ds-color-static-white;
101
+ }
102
+ }
103
+ }
104
+ }
105
+
106
+ .ds-icon {
107
+ width: ds-px-to-rem(24px);
108
+ height: ds-px-to-rem(24px);
109
+ color: currentColor;
110
+ display: inline-flex;
111
+ }
112
+ }
@@ -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 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,28 @@
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
+ <div class="{{ componentClassName + '__content'}}">
23
+ <h2 class="ds-teaser__title">
24
+ <span class="ds-teaser__right-now-sticker">Just nu:</span> {{ params.title | safe }}
25
+ </h2>
26
+ </div>
27
+ </a>
28
+ {% endmacro %}
@@ -0,0 +1,16 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../assets/teaser/teaser.scss";
3
+
4
+ .ds-teaser.ds-teaser--right-now {
5
+ .ds-teaser__content {
6
+ @include ds-spacing-layout($ds-sl-teaser-vertical $ds-sl-teaser-horizontal);
7
+ }
8
+
9
+ .ds-teaser__title {
10
+ @include ds-typography($ds-typography-expressive-heading01bold);
11
+ }
12
+
13
+ .ds-teaser__right-now-sticker {
14
+ color: $ds-theme-color;
15
+ }
16
+ }
@@ -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"] %}
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 | safe }}
27
+ </h2>
28
+ {% if params.text %}
29
+ <span class="{{ componentClassName + '__text'}}">
30
+ {{ params.text | safe }}
31
+ </span>
32
+ {% endif %}
33
+ </div>
34
+ {% if params.mediaHtml %}
35
+ {{ params.mediaHtml | safe }}
36
+ {% endif %}
37
+ </div>
38
+ {% endmacro %}