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