@bonniernews/dn-design-system-web 31.0.1 → 31.1.3
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 +46 -0
- package/components/teaser-text-on-image/README-UXD.md +0 -0
- package/components/teaser-text-on-image/README.md +40 -0
- package/components/teaser-text-on-image/teaser-text-on-image.njk +41 -0
- package/components/teaser-text-on-image/teaser-text-on-image.scss +73 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,52 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [31.1.3](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@31.1.2...@bonniernews/dn-design-system-web@31.1.3) (2025-03-18)
|
|
8
|
+
|
|
9
|
+
## [31.1.2](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@31.1.0...@bonniernews/dn-design-system-web@31.1.2) (2025-03-18)
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Bug Fixes
|
|
13
|
+
|
|
14
|
+
* **web:** make room for photo credit on teasers with text on image ([#1666](https://github.com/BonnierNews/dn-design-system/issues/1666)) ([6e204fa](https://github.com/BonnierNews/dn-design-system/commit/6e204fa2f1fc0a53fc21a29bb006b56ae291ab60))
|
|
15
|
+
* **web:** set exit with status 1 if failed to generate documentation ([#1668](https://github.com/BonnierNews/dn-design-system/issues/1668)) ([36c8d4a](https://github.com/BonnierNews/dn-design-system/commit/36c8d4afac9ac9b7e9adbd30c115a18a2dce6ebd))
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Maintenance
|
|
19
|
+
|
|
20
|
+
* remove vs code settings ([#1646](https://github.com/BonnierNews/dn-design-system/issues/1646)) ([bcf9f02](https://github.com/BonnierNews/dn-design-system/commit/bcf9f022b47cb018e2ac0a39e75104ab489df76a))
|
|
21
|
+
* replace tj-actions ([#1663](https://github.com/BonnierNews/dn-design-system/issues/1663)) ([5122022](https://github.com/BonnierNews/dn-design-system/commit/5122022570c2547588cd3967d5aba3dba18f613a))
|
|
22
|
+
* **web:** released version v31.1.1 ([5f3670c](https://github.com/BonnierNews/dn-design-system/commit/5f3670c1ca51740145b472f5c5f06b6516c4b32d))
|
|
23
|
+
|
|
24
|
+
## [31.1.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@31.1.0...@bonniernews/dn-design-system-web@31.1.1) (2025-03-18)
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* **web:** make room for photo credit on teasers with text on image ([#1666](https://github.com/BonnierNews/dn-design-system/issues/1666)) ([6e204fa](https://github.com/BonnierNews/dn-design-system/commit/6e204fa2f1fc0a53fc21a29bb006b56ae291ab60))
|
|
30
|
+
* **web:** set exit with status 1 if failed to generate documentation ([#1668](https://github.com/BonnierNews/dn-design-system/issues/1668)) ([36c8d4a](https://github.com/BonnierNews/dn-design-system/commit/36c8d4afac9ac9b7e9adbd30c115a18a2dce6ebd))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
### Maintenance
|
|
34
|
+
|
|
35
|
+
* remove vs code settings ([#1646](https://github.com/BonnierNews/dn-design-system/issues/1646)) ([bcf9f02](https://github.com/BonnierNews/dn-design-system/commit/bcf9f022b47cb018e2ac0a39e75104ab489df76a))
|
|
36
|
+
* replace tj-actions ([#1663](https://github.com/BonnierNews/dn-design-system/issues/1663)) ([5122022](https://github.com/BonnierNews/dn-design-system/commit/5122022570c2547588cd3967d5aba3dba18f613a))
|
|
37
|
+
|
|
38
|
+
## [31.1.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@31.0.1...@bonniernews/dn-design-system-web@31.1.0) (2025-03-13)
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
### Features
|
|
42
|
+
|
|
43
|
+
* **web:** text on image teaser ([#1656](https://github.com/BonnierNews/dn-design-system/issues/1656)) ([bf0325c](https://github.com/BonnierNews/dn-design-system/commit/bf0325c0b8044580030fdbe41eabee26476d5f5f))
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
### Maintenance
|
|
47
|
+
|
|
48
|
+
* **deps:** bump @babel/helpers from 7.24.0 to 7.26.10 in /web ([#1661](https://github.com/BonnierNews/dn-design-system/issues/1661)) ([183c4bf](https://github.com/BonnierNews/dn-design-system/commit/183c4bf793c4143916b30ecf0a3903f1b56e5fa4))
|
|
49
|
+
* **deps:** bump @babel/runtime from 7.24.1 to 7.26.10 in /web ([#1660](https://github.com/BonnierNews/dn-design-system/issues/1660)) ([b76f457](https://github.com/BonnierNews/dn-design-system/commit/b76f4575ece3ffaf92cbe4b03297820f4b3add8f))
|
|
50
|
+
* **deps:** bump sass from 1.83.4 to 1.85.1 ([#1633](https://github.com/BonnierNews/dn-design-system/issues/1633)) ([8c8098b](https://github.com/BonnierNews/dn-design-system/commit/8c8098b99168cd8d3b11765719619654baf821cb))
|
|
51
|
+
* prerelease packages ([e111703](https://github.com/BonnierNews/dn-design-system/commit/e1117039ea9d1bcd6bcaf5225f8f3a8a93a7bc0f))
|
|
52
|
+
|
|
7
53
|
## [31.0.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@31.0.0...@bonniernews/dn-design-system-web@31.0.1) (2025-03-12)
|
|
8
54
|
|
|
9
55
|
|
|
File without changes
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-text-on-image](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-text-on-image)
|
|
2
|
+
- Storybook: [TeaserTextOnImage](https://designsystem.dn.se/?path=/docs/section-teasertextonimage--docs)
|
|
3
|
+
- Storybook (Latest): [TeaserTextOnImage](https://designsystem-latest.dn.se/?path=/docs/section-teasertextonimage--docs)
|
|
4
|
+
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
# teaser-text-on-image
|
|
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
|
+
|text | String | no | | | Teaser subtext |
|
|
16
|
+
|vignette | String | no | | | Top text in the teaser |
|
|
17
|
+
|mediaHtml | HTML String | yes | | | Main image |
|
|
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
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
24
|
+
|
|
25
|
+
### Nunjucks
|
|
26
|
+
```html
|
|
27
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-text-on-image/teaser-text-on-image.njk' import TeaserTextOnImage %}
|
|
28
|
+
|
|
29
|
+
{{ TeaserTextOnImage({
|
|
30
|
+
title: 'Ludmila Engquist: "Det skulle kännas fel att dö utan att ha förklarat sig"',
|
|
31
|
+
targetLink: "https://www.dn.se/sport/ludmila-enguist-det-skulle-kannas-fel-att-do-utan-att-ha-forklarat-sig/",
|
|
32
|
+
text: "Nu träder Ludmila Engquist fram och berättar sanningen – innan det är för sent.",
|
|
33
|
+
mediaHtml: "text-on-image",
|
|
34
|
+
})}}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### SCSS
|
|
38
|
+
```scss
|
|
39
|
+
@use "@bonniernews/dn-design-system-web/components/teaser-text-on-image/teaser-text-on-image" as *;
|
|
40
|
+
```
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-card/teaser-card.njk' import TeaserCard %}
|
|
2
|
+
|
|
3
|
+
{% macro TeaserTextOnImage(params) %}
|
|
4
|
+
{% set componentClassName = "ds-teaser" %}
|
|
5
|
+
{% set classNamePrefix = componentClassName + "--" %}
|
|
6
|
+
|
|
7
|
+
{% set extraClasses = [
|
|
8
|
+
"ds-teaser--text-on-image",
|
|
9
|
+
params.classNames if params.classNames
|
|
10
|
+
] | join(" ") %}
|
|
11
|
+
|
|
12
|
+
{% call TeaserCard({
|
|
13
|
+
targetLink: params.targetLink,
|
|
14
|
+
attributes: params.attributes,
|
|
15
|
+
classNames: extraClasses
|
|
16
|
+
}) %}
|
|
17
|
+
<div class="{{ componentClassName + '__content'}}">
|
|
18
|
+
<div class="{{ componentClassName + '__media' }}">
|
|
19
|
+
{{ params.mediaHtml }}
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div class="{{ componentClassName + '__text-content'}}">
|
|
23
|
+
{% if params.vignette %}
|
|
24
|
+
<p class="{{ componentClassName + '__vignette' }}">
|
|
25
|
+
{{ params.vignette }}
|
|
26
|
+
</p>
|
|
27
|
+
{% endif %}
|
|
28
|
+
|
|
29
|
+
<h2 class="{{ componentClassName + '__title'}} {{ componentClassName + '__title--italic' if params.isItalicHeadline}}">
|
|
30
|
+
{{ params.title }}
|
|
31
|
+
</h2>
|
|
32
|
+
|
|
33
|
+
{% if params.text %}
|
|
34
|
+
<p class="{{ componentClassName + '__text' }}">
|
|
35
|
+
{{ params.text }}
|
|
36
|
+
</p>
|
|
37
|
+
{% endif %}
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
{% endcall %}
|
|
41
|
+
{% endmacro %}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
+
@use "../../assets/teaser/teaser.scss" as *;
|
|
3
|
+
|
|
4
|
+
.ds-teaser.ds-teaser--text-on-image {
|
|
5
|
+
overflow: hidden;
|
|
6
|
+
|
|
7
|
+
.ds-teaser__vignette {
|
|
8
|
+
color: $ds-color-neutral-white;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ds-teaser__content {
|
|
12
|
+
position: relative;
|
|
13
|
+
color: $ds-color-neutral-white;
|
|
14
|
+
|
|
15
|
+
&:after {
|
|
16
|
+
content: "";
|
|
17
|
+
position: absolute;
|
|
18
|
+
top: 0;
|
|
19
|
+
left: 0;
|
|
20
|
+
width: 100%;
|
|
21
|
+
height: 100%;
|
|
22
|
+
background: linear-gradient(var(--ds-color-gradients-overlay-end), var(--ds-color-gradients-overlay-start));
|
|
23
|
+
z-index: 2;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.ds-teaser__title,
|
|
28
|
+
.ds-teaser__text {
|
|
29
|
+
position: relative;
|
|
30
|
+
color: $ds-color-neutral-white;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ds-teaser__text {
|
|
34
|
+
margin-top: ds-spacing($ds-s-100);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ds-teaser__title {
|
|
38
|
+
margin-top: ds-spacing($ds-s-050);
|
|
39
|
+
|
|
40
|
+
@include ds-typography($ds-typography-detail-teaser-text-i-bild, $forcePx: true);
|
|
41
|
+
|
|
42
|
+
&--italic {
|
|
43
|
+
@include ds-typography($ds-typography-detail-medryckare);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.ds-teaser-image__byline,
|
|
48
|
+
.ds-teaser__text-content {
|
|
49
|
+
z-index: 3;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.ds-teaser__text-content {
|
|
53
|
+
position: absolute;
|
|
54
|
+
bottom: ds-spacing($ds-s-200);
|
|
55
|
+
left: ds-spacing($ds-s-100);
|
|
56
|
+
max-width: 90%;
|
|
57
|
+
|
|
58
|
+
@include ds-mq-only-breakpoint(desktop) {
|
|
59
|
+
max-width: 75%;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.ds-teaser__media {
|
|
64
|
+
.picture {
|
|
65
|
+
width: 100%;
|
|
66
|
+
height: 100%;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.ds-teaser-image__byline {
|
|
70
|
+
@include ds-typography($ds-typography-functional-meta-sm, $forcePx: true, $lineHeight: $ds-lineheight-lg);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
package/package.json
CHANGED