@bonniernews/dn-design-system-web 8.9.4 → 8.9.6
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 +20 -0
- package/components/tag-header/README.md +3 -1
- package/components/tag-header/tag-header.njk +7 -2
- package/components/tag-header/tag-header.scss +6 -1
- package/components/teaser-list-vertical/README.md +1 -4
- package/components/teaser-list-vertical/teaser-list-vertical.njk +17 -35
- package/components/teaser-list-vertical/teaser-list-vertical.scss +11 -57
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [8.9.6](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@8.9.5...@bonniernews/dn-design-system-web@8.9.6) (2023-12-08)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Maintenance
|
|
11
|
+
|
|
12
|
+
* **deps-dev:** bump @types/react-native-vector-icons from 6.4.15 to 6.4.16 ([#1071](https://github.com/BonnierNews/dn-design-system/issues/1071)) ([1975ff0](https://github.com/BonnierNews/dn-design-system/commit/1975ff0d25548cc8a1a5f74f85ecadd0a4197913))
|
|
13
|
+
* **deps-dev:** bump @types/react-test-renderer from 18.0.3 to 18.0.7 ([#1113](https://github.com/BonnierNews/dn-design-system/issues/1113)) ([dde7014](https://github.com/BonnierNews/dn-design-system/commit/dde70144f6be0dce482004836182c638eda2761d))
|
|
14
|
+
* **deps:** bump @react-native-async-storage/async-storage from 1.19.1 to 1.21.0 ([#1140](https://github.com/BonnierNews/dn-design-system/issues/1140)) ([cb00a6f](https://github.com/BonnierNews/dn-design-system/commit/cb00a6f2bdc11303d06dbaf734b2e6bb002495cd))
|
|
15
|
+
* **deps:** bump @storybook/theming from 6.5.15 to 6.5.16 ([#1040](https://github.com/BonnierNews/dn-design-system/issues/1040)) ([2da4fdd](https://github.com/BonnierNews/dn-design-system/commit/2da4fdd7f7c2b1eaf3ec91b9aca15b86a49175da))
|
|
16
|
+
* prerelease packages ([cf0302b](https://github.com/BonnierNews/dn-design-system/commit/cf0302b19872562260c2a175e80791f6fe7d120a))
|
|
17
|
+
* prerelease packages ([2878ff0](https://github.com/BonnierNews/dn-design-system/commit/2878ff0d0fcde41a8b4791c00cde76973d7a76e7))
|
|
18
|
+
* **web:** remove variant from teaser list vertical ([#1136](https://github.com/BonnierNews/dn-design-system/issues/1136)) ([233219a](https://github.com/BonnierNews/dn-design-system/commit/233219aa04aa85cfc9073b7634ccda7cdef56e3f))
|
|
19
|
+
|
|
20
|
+
## [8.9.5](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@8.9.4...@bonniernews/dn-design-system-web@8.9.5) (2023-12-05)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **web:** change vignette to link ([#1134](https://github.com/BonnierNews/dn-design-system/issues/1134)) ([e88283d](https://github.com/BonnierNews/dn-design-system/commit/e88283d374e212257ad6f90b1946265827caca69))
|
|
26
|
+
|
|
7
27
|
## [8.9.4](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@8.9.3...@bonniernews/dn-design-system-web@8.9.4) (2023-12-04)
|
|
8
28
|
|
|
9
29
|
|
|
@@ -11,9 +11,11 @@
|
|
|
11
11
|
|parameter | type | required | options | default | description |
|
|
12
12
|
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
13
|
|title | String | yes | | | H1 Title |
|
|
14
|
-
|
|
|
14
|
+
|vignetteText | String | no | | | Heading of the link box |
|
|
15
|
+
|vignetteTargetUrl | String | no | | | Target URL for the vignette |
|
|
15
16
|
|mediaHtml | String | no | | | Main image |
|
|
16
17
|
|descriptionHtml | String | no | | | Intended use is text, links |
|
|
18
|
+
|theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme-class to apply to the vignette |
|
|
17
19
|
|toggle | Bool | no | true, false | false | Show/hide toggle button |
|
|
18
20
|
|toggleText | text | no | | | `text` parameter to ToggleButton (only if `toggle` is enabled) |
|
|
19
21
|
|toggleSelectedText | text | no | | | `selectedText` parameter to ToggleButton (only if `toggle` is enabled) |
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
{%- set classes = [
|
|
9
9
|
componentClassName,
|
|
10
|
+
'ds-theme--' + params.theme if params.theme,
|
|
10
11
|
params.classNames if params.classNames
|
|
11
12
|
] | join(" ") %}
|
|
12
13
|
|
|
@@ -19,8 +20,12 @@
|
|
|
19
20
|
<div class="{{ componentClassName }}__content">
|
|
20
21
|
<div class="{{ componentClassName }}__bar">
|
|
21
22
|
<div class="{{ componentClassName }}__heading">
|
|
22
|
-
{% if params.
|
|
23
|
-
|
|
23
|
+
{% if params.vignetteText %}
|
|
24
|
+
{% if params.vignetteTargetUrl %}
|
|
25
|
+
<a href="{{ params.vignetteTargetUrl }}" class="{{ componentClassName }}__vignette">{{ params.vignetteText }}</a>
|
|
26
|
+
{% else %}
|
|
27
|
+
<span class="{{ componentClassName }}__vignette">{{ params.vignetteText }}</span>
|
|
28
|
+
{% endif %}
|
|
24
29
|
{% endif %}
|
|
25
30
|
<h1 class="{{ componentClassName }}__title">{{ params.title}}</h1>
|
|
26
31
|
</div>
|
|
@@ -34,8 +34,13 @@
|
|
|
34
34
|
|
|
35
35
|
.ds-tag-header__vignette {
|
|
36
36
|
@include ds-typography($ds-typography-functional-meta02bold);
|
|
37
|
-
color: $ds-color
|
|
37
|
+
color: $ds-theme-color;
|
|
38
38
|
margin-bottom: ds-spacing($ds-s-025);
|
|
39
|
+
display: block;
|
|
40
|
+
text-decoration: none;
|
|
41
|
+
&:hover {
|
|
42
|
+
text-decoration: none;
|
|
43
|
+
}
|
|
39
44
|
}
|
|
40
45
|
|
|
41
46
|
.ds-tag-header__title {
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
13
|
|listTitle | String | yes | | | List title |
|
|
14
14
|
|listLink | Object | no | | | Ex. { text: "Alla nyheter", url: "#" } |
|
|
15
|
-
|listType | String | no | default, media | (empty) | |
|
|
16
15
|
|flexible | bool | no | true, false | false | |
|
|
17
16
|
|teasers | Array | yes | | | Array with teaser objects. Ex. [ { title: 'Malmö var det enda rimliga valet för Eurovision', targetLink: '#', highlight: 'Hanna Fahl:', publicationTime: 'I GÅR 12:28', sectionName: 'Kultur', attributes: { "data-test": "list-item-test-data" } } ] |
|
|
18
17
|
|~areaType~ | String | no | "right" or "bauta" or "bautaxl" | | Not implemented |
|
|
@@ -31,17 +30,15 @@ These are copy paste friendly examples to quickliy get started using a component
|
|
|
31
30
|
{% from '@bonniernews/dn-design-system-web/components/teaser-list-vertical/teaser-list-vertical.njk' import TeaserListVertical %}
|
|
32
31
|
|
|
33
32
|
{{ TeaserListVertical({
|
|
34
|
-
listTitle: "Senaste
|
|
33
|
+
listTitle: "Senaste artiklarna",
|
|
35
34
|
listLink: { text: "Alla nyheter", url: "#"},
|
|
36
35
|
flexible: true,
|
|
37
36
|
theme: "ekonomi",
|
|
38
37
|
teasers: [ { title: 'Malmö var det enda rimliga valet för Eurovision', targetLink: '#', highlight: 'Hanna Fahl:', publicationTime: 'I GÅR 12:28', sectionName: 'Kultur', attributes: { "data-test": "list-item-test-data" } } ]
|
|
39
38
|
})}}
|
|
40
39
|
|
|
41
|
-
{# listType == media #}
|
|
42
40
|
{{ TeaserListVertical({
|
|
43
41
|
listTitle: "Senaste klippen",
|
|
44
|
-
listType: "media",
|
|
45
42
|
mediaIcon: "play_arrow-filled",
|
|
46
43
|
teasers: [ { title: 'Svenska hjältehunden Killian arbetar mot klockan i Marocko – är det försent?', vignette: "VÄRLDEN", targetLink: '#', theme: 'nyheter', isItalicHeadline: false, publicationTime: 'I går 21:22', mediaHtml: '<div class="picture"><img class="picture__img" src="??"></div>', video: 'true', attributes: { "data-test": "list-item-test-data" } } ]
|
|
47
44
|
})}}
|
|
@@ -9,14 +9,12 @@
|
|
|
9
9
|
{% set classNamePrefix = componentClassName + "--" %}
|
|
10
10
|
{% set attributes = getAttributes(params.attributes) %}
|
|
11
11
|
{% set showButton = params.listLink and params.listLink.text and params.listLink.url %}
|
|
12
|
-
{% set isMediaList = params.listType === 'media' %}
|
|
13
12
|
|
|
14
13
|
{%- set classes = [
|
|
15
14
|
componentClassName,
|
|
16
15
|
"ds-theme--" + params.theme if params.theme,
|
|
17
16
|
classNamePrefix + "flexible" if params.flexible,
|
|
18
17
|
classNamePrefix + "linked" if showButton,
|
|
19
|
-
classNamePrefix + "media" if isMediaList,
|
|
20
18
|
params.classNames if params.classNames
|
|
21
19
|
] | join(" ") %}
|
|
22
20
|
|
|
@@ -28,11 +26,7 @@
|
|
|
28
26
|
|
|
29
27
|
<div class="{{ componentClassName + '__content'}}">
|
|
30
28
|
{% for teaser in params.teasers %}
|
|
31
|
-
{
|
|
32
|
-
{{ TeaserListVerticalMediaItem(teaser) }}
|
|
33
|
-
{% else %}
|
|
34
|
-
{{ TeaserListVerticalItem(teaser) }}
|
|
35
|
-
{% endif %}
|
|
29
|
+
{{ TeaserListVerticalItem(teaser) }}
|
|
36
30
|
{% endfor %}
|
|
37
31
|
</div>
|
|
38
32
|
{% if showButton %}
|
|
@@ -55,47 +49,35 @@
|
|
|
55
49
|
{% set attributes = getAttributes(teaser.attributes) %}
|
|
56
50
|
{%- set classes = [
|
|
57
51
|
"ds-teaser-list-vertical__item",
|
|
58
|
-
teaser
|
|
59
|
-
] | join(" ") %}
|
|
60
|
-
<a href="{{teaser.targetLink}}" class="{{ classes }}" {{- attributes | safe }}>
|
|
61
|
-
{{ TeaserDot() }}
|
|
62
|
-
<h3 class="ds-teaser-list-vertical__item-title">{{ teaser.highlight }} {{ teaser.title }}</h3>
|
|
63
|
-
{% if teaser.publicationTime or teaser.sectionName %}
|
|
64
|
-
<div class="ds-teaser-list-vertical__item-notes">
|
|
65
|
-
<span>{{ teaser.publicationTime }}</span>{{ " • " if teaser.publicationTime and teaser.sectionName }}<span>{{ teaser.sectionName }}</span>
|
|
66
|
-
</div>
|
|
67
|
-
{% endif %}
|
|
68
|
-
</a>
|
|
69
|
-
{% endmacro %}
|
|
70
|
-
|
|
71
|
-
{% macro TeaserListVerticalMediaItem(teaser) %}
|
|
72
|
-
{% set attributes = getAttributes(teaser.attributes) %}
|
|
73
|
-
{%- set classes = [
|
|
74
|
-
"ds-teaser-list-vertical__media-item",
|
|
75
|
-
"ds-teaser-list-vertical__media-item--italic" if teaser.isItalicHeadline,
|
|
52
|
+
"ds-teaser-list-vertical__item--italic" if teaser.isItalicHeadline,
|
|
76
53
|
"ds-theme--" + teaser.theme if teaser.theme,
|
|
77
54
|
teaser.classNames if teaser.classNames
|
|
78
55
|
] | join(" ") %}
|
|
79
56
|
|
|
80
57
|
<a href="{{teaser.targetLink}}" class="{{ classes }}" {{- attributes | safe }}>
|
|
81
|
-
<div class="ds-teaser-list-
|
|
58
|
+
<div class="ds-teaser-list-vertical__item-text">
|
|
82
59
|
{% if teaser.vignette %}
|
|
83
|
-
<div class="ds-teaser-list-
|
|
60
|
+
<div class="ds-teaser-list-vertical__item-vignette">{{ teaser.vignette }}</div>
|
|
84
61
|
{% endif %}
|
|
85
|
-
<h3 class="ds-teaser-list-
|
|
62
|
+
<h3 class="ds-teaser-list-vertical__item-title">
|
|
86
63
|
{%- if teaser.highlight %}
|
|
87
|
-
<span class="ds-teaser-list-
|
|
64
|
+
<span class="ds-teaser-list-vertical__item-highlight">{{ teaser.highlight }}</span>
|
|
88
65
|
{% endif %}
|
|
89
66
|
{{- teaser.title }}</h3>
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
67
|
+
{% if teaser.publicationTime or teaser.sectionName %}
|
|
68
|
+
<div class="ds-teaser-list-vertical__item-notes">
|
|
69
|
+
{% if teaser.publicationTime %}
|
|
70
|
+
<span>{{ teaser.publicationTime }}</span>
|
|
71
|
+
{% endif %}
|
|
72
|
+
{% if teaser.sectionName %}
|
|
73
|
+
{{ " • " if teaser.publicationTime }}<span>{{ teaser.sectionName }}</span>
|
|
74
|
+
{% endif %}
|
|
75
|
+
</div>
|
|
76
|
+
{% endif %}
|
|
95
77
|
</div>
|
|
96
78
|
|
|
97
79
|
{% if teaser.mediaHtml %}
|
|
98
|
-
<div class="ds-teaser-list-
|
|
80
|
+
<div class="ds-teaser-list-vertical__item-img">
|
|
99
81
|
{{ teaser.mediaHtml | safe }}
|
|
100
82
|
{% if teaser.video %}
|
|
101
83
|
{{ IconUse({ icon: 'play_arrow-filled' }) -}}
|
|
@@ -41,50 +41,6 @@ $ds-teaser-list-vertical-media-icon-size: 20px;
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
.ds-teaser-list-vertical__item {
|
|
44
|
-
padding: ds-spacing($ds-s-075 $ds-s-100, rem);
|
|
45
|
-
display: block;
|
|
46
|
-
text-decoration: none;
|
|
47
|
-
position: relative;
|
|
48
|
-
|
|
49
|
-
&:not(:last-child)::after {
|
|
50
|
-
content: "";
|
|
51
|
-
position: absolute;
|
|
52
|
-
bottom: 0;
|
|
53
|
-
height: ds-metrics-border-width(x1);
|
|
54
|
-
width: calc(100% - ds-spacing($ds-s-200));
|
|
55
|
-
background-color: $ds-color-border-primary;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
.ds-teaser-dot {
|
|
59
|
-
position: absolute;
|
|
60
|
-
margin-top: ds-px-to-rem(6px);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
.ds-teaser-list-vertical__item-title,
|
|
64
|
-
.ds-teaser-list-vertical__item-notes {
|
|
65
|
-
margin: 0 0 0 (ds-spacing($ds-s-050, rem) + $ds-dot-size);
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
.ds-teaser-list-vertical__item-title {
|
|
69
|
-
@include ds-typography($ds-typography-expressive-heading01bold);
|
|
70
|
-
color: $ds-color-text-primary;
|
|
71
|
-
word-break: break-word;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
.ds-teaser-list-vertical__item-notes {
|
|
75
|
-
@include ds-typography($ds-typography-functional-meta02regular);
|
|
76
|
-
color: $ds-color-text-primary-02;
|
|
77
|
-
margin-top: ds-spacing($ds-s-050, rem);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
@include ds-hover() {
|
|
81
|
-
&:hover .ds-teaser-list-vertical__item-title {
|
|
82
|
-
@include ds-underline(2px, 1px);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
.ds-teaser-list-vertical__media-item {
|
|
88
44
|
padding: ds-spacing($ds-s-075 $ds-s-100, rem);
|
|
89
45
|
display: flex;
|
|
90
46
|
justify-content: space-between;
|
|
@@ -100,42 +56,40 @@ $ds-teaser-list-vertical-media-icon-size: 20px;
|
|
|
100
56
|
background-color: $ds-color-border-primary;
|
|
101
57
|
}
|
|
102
58
|
|
|
103
|
-
.ds-teaser-list-
|
|
104
|
-
.ds-teaser-list-
|
|
105
|
-
.ds-teaser-list-
|
|
59
|
+
.ds-teaser-list-vertical__item-text,
|
|
60
|
+
.ds-teaser-list-vertical__item-title,
|
|
61
|
+
.ds-teaser-list-vertical__item-notes {
|
|
106
62
|
margin: 0;
|
|
107
63
|
}
|
|
108
64
|
|
|
109
|
-
.ds-teaser-list-
|
|
65
|
+
.ds-teaser-list-vertical__item-vignette {
|
|
110
66
|
display: block;
|
|
111
67
|
@include ds-typography($ds-typography-detailarticle-label);
|
|
112
68
|
color: $ds-theme-color;
|
|
113
69
|
margin-bottom: ds-spacing($ds-s-025);
|
|
114
70
|
}
|
|
115
71
|
|
|
116
|
-
.ds-teaser-list-
|
|
72
|
+
.ds-teaser-list-vertical__item-title {
|
|
117
73
|
@include ds-typography($ds-typography-expressive-heading01bold);
|
|
118
74
|
color: $ds-color-text-primary;
|
|
119
75
|
word-break: break-word;
|
|
120
76
|
|
|
121
|
-
.ds-teaser-list-
|
|
77
|
+
.ds-teaser-list-vertical__item-highlight {
|
|
122
78
|
color: $ds-theme-color;
|
|
123
79
|
}
|
|
124
80
|
}
|
|
125
81
|
|
|
126
|
-
&.ds-teaser-list-
|
|
127
|
-
|
|
128
|
-
@include ds-typography($ds-typography-expressive-heading01italicregular);
|
|
129
|
-
}
|
|
82
|
+
&.ds-teaser-list-vertical__item--italic .ds-teaser-list-vertical__item-title {
|
|
83
|
+
@include ds-typography($ds-typography-expressive-heading01italicregular);
|
|
130
84
|
}
|
|
131
85
|
|
|
132
|
-
.ds-teaser-list-
|
|
86
|
+
.ds-teaser-list-vertical__item-notes {
|
|
133
87
|
@include ds-typography($ds-typography-functional-meta02regular);
|
|
134
88
|
color: $ds-color-text-primary-02;
|
|
135
89
|
margin-top: ds-spacing($ds-s-050, rem);
|
|
136
90
|
}
|
|
137
91
|
|
|
138
|
-
.ds-teaser-list-
|
|
92
|
+
.ds-teaser-list-vertical__item-img {
|
|
139
93
|
flex: 0 0 91px;
|
|
140
94
|
align-self: flex-start;
|
|
141
95
|
position: relative;
|
|
@@ -155,7 +109,7 @@ $ds-teaser-list-vertical-media-icon-size: 20px;
|
|
|
155
109
|
}
|
|
156
110
|
|
|
157
111
|
@include ds-hover() {
|
|
158
|
-
&:hover .ds-teaser-list-
|
|
112
|
+
&:hover .ds-teaser-list-vertical__item-title {
|
|
159
113
|
@include ds-underline(2px, 1px);
|
|
160
114
|
}
|
|
161
115
|
}
|
package/package.json
CHANGED