@bonniernews/dn-design-system-web 3.0.0-alpha.8 → 3.0.0-alpha.81
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +649 -0
- package/assets/article-image/article-image.njk +11 -10
- package/assets/article-image/article-image.scss +1 -15
- package/assets/form-field/form-field.njk +2 -2
- package/assets/form-field/form-field.scss +2 -6
- package/assets/teaser/dot-or-grade.njk +7 -0
- package/assets/teaser/teaser.scss +94 -0
- package/components/article-body-image/README.md +2 -2
- package/components/article-body-image/article-body-image.njk +1 -5
- package/components/article-top-image/README.md +2 -2
- package/components/article-top-image/article-top-image.njk +1 -5
- package/components/article-top-image/article-top-image.scss +1 -1
- package/components/badge/badge.scss +1 -5
- package/components/buddy-menu/buddy-menu.scss +1 -8
- package/components/button/button.njk +38 -43
- package/components/button/button.scss +6 -1
- package/components/button-toggle/button-toggle.js +2 -0
- package/components/button-toggle/button-toggle.njk +36 -36
- package/components/button-toggle/button-toggle.scss +6 -1
- package/components/byline/byline.njk +2 -2
- package/components/byline/byline.scss +1 -3
- package/components/checkbox/checkbox.njk +3 -3
- package/components/checkbox/checkbox.scss +8 -9
- package/components/disclaimer/disclaimer.njk +2 -2
- package/components/disclaimer/disclaimer.scss +23 -10
- package/components/factbox/README.md +2 -2
- package/components/factbox/factbox.njk +12 -24
- package/components/factbox/factbox.scss +16 -51
- package/components/footer/footer.scss +2 -8
- package/components/icon-button/README.md +2 -1
- package/components/icon-button/icon-button.njk +4 -4
- package/components/icon-button/icon-button.scss +5 -2
- package/components/icon-button-toggle/icon-button-toggle.js +2 -0
- package/components/icon-button-toggle/icon-button-toggle.njk +28 -36
- package/components/icon-button-toggle/icon-button-toggle.scss +5 -2
- package/components/icon-sprite/README.md +51 -0
- package/components/icon-sprite/icon-sprite.njk +12 -0
- package/components/icon-sprite/icon-sprite.scss +12 -0
- package/components/icon-with-wrapper/README.md +9 -2
- package/components/icon-with-wrapper/icon-with-wrapper.njk +2 -2
- package/components/icon-with-wrapper/icon-with-wrapper.scss +2 -1
- package/components/image-caption/README.md +38 -0
- package/components/image-caption/image-caption.njk +36 -0
- package/components/image-caption/image-caption.scss +25 -0
- package/components/list-item/list-item.njk +5 -5
- package/components/list-item/list-item.scss +1 -3
- package/components/pictogram/README.md +39 -0
- package/components/pictogram/pictogram.njk +30 -0
- package/components/pictogram/pictogram.scss +54 -0
- package/components/quote/README.md +1 -2
- package/components/quote/quote.njk +6 -8
- package/components/quote/quote.scss +1 -14
- package/components/radio-button/radio-button.njk +3 -3
- package/components/radio-button/radio-button.scss +8 -10
- package/components/spinner/spinner.njk +19 -23
- package/components/spinner/spinner.scss +4 -1
- package/components/teaser-dot/README.md +34 -0
- package/components/teaser-dot/teaser-dot.njk +24 -0
- package/components/teaser-dot/teaser-dot.scss +39 -0
- package/components/teaser-image/README.md +40 -0
- package/components/teaser-image/teaser-image.njk +21 -0
- package/components/teaser-image/teaser-image.scss +21 -0
- package/components/teaser-large/README.md +52 -0
- package/components/teaser-large/teaser-large.njk +93 -0
- package/components/teaser-large/teaser-large.scss +165 -0
- package/components/teaser-onsite/README.md +53 -0
- package/components/teaser-onsite/teaser-onsite.njk +45 -0
- package/components/teaser-onsite/teaser-onsite.scss +35 -0
- package/components/teaser-package/README.md +42 -0
- package/components/teaser-package/teaser-package.njk +36 -0
- package/components/teaser-package/teaser-package.scss +119 -0
- package/components/teaser-right-now/README.md +37 -0
- package/components/teaser-right-now/teaser-right-now.njk +29 -0
- package/components/teaser-right-now/teaser-right-now.scss +57 -0
- package/components/teaser-slideshow/README.md +42 -0
- package/components/teaser-slideshow/teaser-slideshow.njk +38 -0
- package/components/teaser-slideshow/teaser-slideshow.scss +37 -0
- package/components/teaser-split/README-container.md +40 -0
- package/components/teaser-split/README.md +49 -0
- package/components/teaser-split/teaser-split.njk +93 -0
- package/components/teaser-split/teaser-split.scss +85 -0
- package/components/teaser-standard/README.md +50 -0
- package/components/teaser-standard/teaser-standard.njk +81 -0
- package/components/teaser-standard/teaser-standard.scss +38 -0
- package/components/teaser-tipsa/README.md +41 -0
- package/components/teaser-tipsa/teaser-tipsa.njk +31 -0
- package/components/teaser-tipsa/teaser-tipsa.scss +22 -0
- package/components/text-button/text-button.njk +34 -37
- package/components/text-button/text-button.scss +12 -10
- package/components/text-button-toggle/text-button-toggle.js +2 -0
- package/components/text-button-toggle/text-button-toggle.njk +30 -33
- package/components/text-button-toggle/text-button-toggle.scss +10 -10
- package/components/text-input/text-input.scss +3 -8
- package/components/video-caption/README.md +1 -1
- package/components/video-caption/video-caption.njk +12 -6
- package/components/vip-badge/README.md +35 -0
- package/components/vip-badge/vip-badge.njk +23 -0
- package/components/vip-badge/vip-badge.scss +54 -0
- package/foundations/colors.scss +31 -0
- package/foundations/helpers/README-links.md +1 -1
- package/foundations/helpers/colors.scss +2 -0
- package/foundations/helpers/hover.scss +14 -0
- package/foundations/helpers/links.scss +15 -7
- package/foundations/icons/grade-icon.njk +50 -11
- package/foundations/icons/icon.njk +167 -143
- package/foundations/icons/sprite.njk +1 -0
- package/foundations/icons/sprite.svg +1 -0
- package/foundations/icons/svg/download.svg +3 -0
- package/foundations/icons/svg/filter_list.svg +3 -0
- package/foundations/icons/svg/pause.svg +3 -0
- package/foundations/icons/svg/vip.svg +3 -0
- package/foundations/typography/fontDefinitions.scss +82 -67
- package/foundations/variables/colorsCssVariables.scss +6 -0
- package/foundations/variables/colorsDnDarkTokens.scss +7 -1
- package/foundations/variables/colorsDnLightTokens.scss +8 -2
- package/foundations/variables/spacingLayout.scss +6 -1
- package/foundations/variables/spacingLayoutLargeScreen.scss +5 -0
- package/foundations/variables/spacingLayoutList.scss +5 -0
- package/foundations/variables/typographyTokensList.scss +5 -0
- package/foundations/variables/typographyTokensScreenLarge.scss +156 -123
- package/foundations/variables/typographyTokensScreenSmall.scss +147 -114
- package/package.json +2 -2
- package/tokens/colors-css-variables.json +6 -0
- package/tokens/spacing-layout-list.json +6 -1
- 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,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 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
|
+
{% if params.vignette %}
|
|
66
|
+
<div class="ds-teaser__vignette">{{ params.vignette }}</div>
|
|
67
|
+
{% endif %}
|
|
68
|
+
<h2 class="ds-teaser__title">
|
|
69
|
+
{% if params.highlight %}
|
|
70
|
+
<span class="{{ componentClassName + '__highlight'}}">{{ params.highlight }}</span>
|
|
71
|
+
{% endif %}
|
|
72
|
+
{{ params.title | safe }}
|
|
73
|
+
</h2>
|
|
74
|
+
|
|
75
|
+
{% if params.text and params.areaType !== "right" %}
|
|
76
|
+
<p class="{{ componentClassName + '__text' }}">
|
|
77
|
+
{{ getDotOrGrade({ flashing: params.isFlashingDot, grade: params.grade }) }}
|
|
78
|
+
{% if params.sticker %}
|
|
79
|
+
<span class="ds-teaser__sticker">
|
|
80
|
+
{{ params.sticker }}
|
|
81
|
+
</span>
|
|
82
|
+
{% endif %}
|
|
83
|
+
{{ params.text | safe }}
|
|
84
|
+
</p>
|
|
85
|
+
{% endif %}
|
|
86
|
+
{% if params.bylineHtml %}
|
|
87
|
+
<div class="{{ componentClassName + '__byline'}}">
|
|
88
|
+
{{ params.bylineHtml | safe }}
|
|
89
|
+
</div>
|
|
90
|
+
{% endif %}
|
|
91
|
+
</div>
|
|
92
|
+
</a>
|
|
93
|
+
{% endmacro %}
|
|
@@ -0,0 +1,165 @@
|
|
|
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
|
+
&:focus-visible {
|
|
31
|
+
outline: none !important;
|
|
32
|
+
|
|
33
|
+
.ds-teaser__content {
|
|
34
|
+
@include ds-teaser-focus(-8px, false);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ds-teaser__vignette {
|
|
39
|
+
grid-column: 1;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.ds-teaser__title {
|
|
43
|
+
grid-row: 1;
|
|
44
|
+
grid-column: 1 / span 1;
|
|
45
|
+
@include ds-typography($ds-typography-expressive-heading04bold);
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
@include ds-hover(true) {
|
|
49
|
+
.ds-teaser__title {
|
|
50
|
+
@include ds-underline(3px);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.ds-teaser__vignette + .ds-teaser__title {
|
|
55
|
+
grid-row: 2;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
.ds-teaser__text {
|
|
59
|
+
grid-row: 3;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&.ds-teaser--large-big-italic {
|
|
63
|
+
.ds-teaser__title {
|
|
64
|
+
@include ds-typography($ds-typography-expressive-heading04italicregular);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@include ds-mq-largest-breakpoint(mobile) {
|
|
68
|
+
.ds-teaser__title {
|
|
69
|
+
grid-column-end: span 2;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ds-teaser__byline {
|
|
73
|
+
grid-row: 3;
|
|
74
|
+
margin-top: ds-spacing-component($ds-sc-x2);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
@include ds-mq-smallest-breakpoint(tablet) {
|
|
79
|
+
.ds-teaser__title {
|
|
80
|
+
grid-column-end: span 1;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
&.ds-teaser--large-italic {
|
|
86
|
+
.ds-teaser__title {
|
|
87
|
+
@include ds-typography($ds-typography-expressive-heading03italicregular);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
@include ds-hover(true) {
|
|
91
|
+
.ds-teaser__title {
|
|
92
|
+
@include ds-underline();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.ds-teaser__byline {
|
|
98
|
+
grid-column: 2;
|
|
99
|
+
grid-row: 1 / span 3;
|
|
100
|
+
overflow: hidden;
|
|
101
|
+
position: relative;
|
|
102
|
+
margin-left: ds-spacing-component($ds-sc-x4);
|
|
103
|
+
// margin-bottom needs to be the negative value of padding-bottom on .ds-teaser__content
|
|
104
|
+
@include ds-mq-only-breakpoint(mobile) {
|
|
105
|
+
margin-bottom: ds-spacing-component($ds-sc-x3, "px", true);
|
|
106
|
+
}
|
|
107
|
+
@include ds-mq-smallest-breakpoint(tablet) {
|
|
108
|
+
margin-bottom: ds-spacing-component($ds-sc-x4, "px", true);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
.picture {
|
|
112
|
+
position: absolute;
|
|
113
|
+
top: 0;
|
|
114
|
+
right: 0;
|
|
115
|
+
@include ds-spacing-layout($ds-sl-teaser-vertical, bottom, "px", true);
|
|
116
|
+
width: 100%;
|
|
117
|
+
min-width: 104px;
|
|
118
|
+
margin: 0;
|
|
119
|
+
|
|
120
|
+
> .picture__img {
|
|
121
|
+
margin: 0;
|
|
122
|
+
top: unset;
|
|
123
|
+
max-height: unset;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@include ds-mq-largest-breakpoint(mobile) {
|
|
128
|
+
width: 104px;
|
|
129
|
+
min-height: 85px;
|
|
130
|
+
margin-left: ds-spacing-component($ds-sc-x2);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
@include ds-mq-smallest-breakpoint(tablet) {
|
|
134
|
+
width: 156px;
|
|
135
|
+
// En bylinebild bör va lika hög som en "grekisk byst" - man ska se lite skjortkrage!
|
|
136
|
+
min-height: 110px;
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
@include ds-mq-smallest-breakpoint(tablet) {
|
|
141
|
+
&.ds-teaser--right {
|
|
142
|
+
.ds-teaser__title {
|
|
143
|
+
@include ds-typography($ds-typography-expressive-heading02bold);
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
&.ds-teaser--large-italic .ds-teaser__title {
|
|
147
|
+
@include ds-typography(
|
|
148
|
+
$ds-typography-expressive-heading02italicregular
|
|
149
|
+
);
|
|
150
|
+
|
|
151
|
+
@include ds-hover(true) {
|
|
152
|
+
.ds-teaser__title {
|
|
153
|
+
@include ds-underline(2px, 1px);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
.ds-teaser__byline {
|
|
159
|
+
width: 104px;
|
|
160
|
+
min-height: 85px;
|
|
161
|
+
margin-left: ds-spacing-component($ds-sc-x2);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
@@ -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,119 @@
|
|
|
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
|
+
@include ds-teaser-focus(-8px);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
a.ds-teaser-package__vignette {
|
|
65
|
+
@include ds-link($ds-link-list);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.ds-teaser-package__vignette,
|
|
69
|
+
a.ds-teaser-package__vignette {
|
|
70
|
+
color: $ds-color-text-primary;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
&.ds-teaser-package--bauta {
|
|
74
|
+
.ds-teaser-package__vignette {
|
|
75
|
+
color: $ds-color-static-white;
|
|
76
|
+
background-color: $ds-theme-color;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
&.ds-teaser-package--bautaxl {
|
|
81
|
+
&::after {
|
|
82
|
+
background-color: transparent;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.ds-teaser-package__vignette {
|
|
86
|
+
color: $ds-color-static-white;
|
|
87
|
+
background-color: #2b2b2b; // @todo change to token when available
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.ds-teaser-package__vignette
|
|
91
|
+
+ .ds-teaser--large:not(.ds-teaser--large-italic):not(.ds-teaser--large-big-italic) {
|
|
92
|
+
@include ds-mq-smallest-breakpoint(desktop) {
|
|
93
|
+
.ds-teaser__title {
|
|
94
|
+
font-size: 80px; // special case, will not have a token
|
|
95
|
+
line-height: 88px;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
@include ds-mq-only-breakpoint(mobile) {
|
|
99
|
+
background-color: #2b2b2b; // @todo change to token when available
|
|
100
|
+
.ds-teaser__title,
|
|
101
|
+
.ds-teaser__text {
|
|
102
|
+
color: $ds-color-static-white;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
& + .ds-teaser::after,
|
|
106
|
+
& + .ds-split-container::after {
|
|
107
|
+
display: none;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.ds-icon {
|
|
114
|
+
width: ds-px-to-rem(24px);
|
|
115
|
+
height: ds-px-to-rem(24px);
|
|
116
|
+
color: currentColor;
|
|
117
|
+
display: inline-flex;
|
|
118
|
+
}
|
|
119
|
+
}
|
|
@@ -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
|
+
```
|