@bonniernews/dn-design-system-web 5.1.0 → 6.0.1
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 +21 -0
- package/components/group-header/group-header.scss +1 -1
- package/components/teaser-list-swipe/README.md +4 -1
- package/components/teaser-list-swipe/teaser-list-swipe.njk +13 -8
- package/components/teaser-list-swipe/teaser-list-swipe.scss +4 -4
- package/foundations/variables/typographyTokensScreenSmall.scss +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,27 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## 6.0.1 (2023-09-29)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
## 6.0.0 (2023-09-27)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### ⚠ BREAKING CHANGES
|
|
18
|
+
|
|
19
|
+
* **web:** change TeaserListSwipe to use variant instead of scrollType (#1015)
|
|
20
|
+
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
|
|
23
|
+
* **web:** change TeaserListSwipe to use variant instead of scrollType ([#1015](https://github.com/BonnierNews/dn-design-system/issues/1015)) ([b0a4400](https://github.com/BonnierNews/dn-design-system/commit/b0a440032a2ba65f89946c1f005b442b6d0479c0))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
6
27
|
## 5.1.0 (2023-09-27)
|
|
7
28
|
|
|
8
29
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
|title | String | yes | | | Heading of the teaser |
|
|
14
14
|
|titleHref | String | no | | | Target URL for the header |
|
|
15
15
|
|areaType | String | no | "main", "right", "bauta", "bautaxl" | | The area where the column is rendered |
|
|
16
|
-
|
|
|
16
|
+
|arrowPosition | String | no | "floating", "header" | "floating" | Determines where the scroll arrows are rendered |
|
|
17
17
|
|theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme-class to apply to the teaser |
|
|
18
18
|
|teasers | Object | yes | | | A list of arguments to TeaserSwipeCard |
|
|
19
19
|
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
@@ -40,3 +40,6 @@ These are copy paste friendly examples to quickly get started using a component.
|
|
|
40
40
|
```scss
|
|
41
41
|
@use "@bonniernews/dn-design-system-web/components/teaser-list-swipe/teaser-list-swipe";
|
|
42
42
|
```
|
|
43
|
+
|
|
44
|
+
### JS
|
|
45
|
+
This component does not come with any JS to facilitate scrolling via the buttons. Implementing that is left as an exercise to the reader.
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
2
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-card/teaser-card.njk' import TeaserCard %}
|
|
2
3
|
{% from '@bonniernews/dn-design-system-web/components/icon-button/icon-button.njk' import IconButton %}
|
|
3
4
|
{% from '@bonniernews/dn-design-system-web/components/group-header/group-header.njk' import GroupHeader %}
|
|
4
5
|
{% from '@bonniernews/dn-design-system-web/components/teaser-swipe-card/teaser-swipe-card.njk' import TeaserSwipeCard %}
|
|
@@ -6,19 +7,23 @@
|
|
|
6
7
|
{% macro TeaserListSwipe(params) %}
|
|
7
8
|
{% set componentClassName = "ds-teaser" %}
|
|
8
9
|
{% set classNamePrefix = componentClassName + "--" %}
|
|
9
|
-
{% set
|
|
10
|
+
{% set arrowPosition = params.arrowPosition or 'floating' %}
|
|
10
11
|
{%- set classes = [
|
|
11
|
-
componentClassName,
|
|
12
12
|
"ds-teaser--list-swipe",
|
|
13
|
-
"ds-theme--" + params.theme if params.theme,
|
|
14
|
-
classNamePrefix + params.areaType if params.areaType,
|
|
15
13
|
params.classNames if params.classNames
|
|
16
14
|
] | join(" ") %}
|
|
17
|
-
|
|
15
|
+
|
|
16
|
+
{%- call TeaserCard({
|
|
17
|
+
areaType: params.areaType,
|
|
18
|
+
theme: params.theme,
|
|
19
|
+
attributes: params.attributes,
|
|
20
|
+
classNames: classes
|
|
21
|
+
}) %}
|
|
18
22
|
{{ GroupHeader({
|
|
19
23
|
title: params.title,
|
|
20
24
|
href: params.titleHref,
|
|
21
|
-
variant: 'arrows' if
|
|
25
|
+
variant: 'arrows' if arrowPosition === 'header' else 'link',
|
|
26
|
+
linkText: 'Visa alla' if arrowPosition === 'floating'
|
|
22
27
|
}) }}
|
|
23
28
|
<div class="{{ componentClassName + '__carousel'}}">
|
|
24
29
|
{% for teaser in params.teasers %}
|
|
@@ -26,7 +31,7 @@
|
|
|
26
31
|
{% endfor %}
|
|
27
32
|
</div>
|
|
28
33
|
|
|
29
|
-
{% if
|
|
34
|
+
{% if arrowPosition === 'floating' %}
|
|
30
35
|
{{ IconButton({
|
|
31
36
|
iconName: 'arrow_back',
|
|
32
37
|
variant: 'elevated',
|
|
@@ -44,5 +49,5 @@
|
|
|
44
49
|
forcePx: true
|
|
45
50
|
}) }}
|
|
46
51
|
{% endif %}
|
|
47
|
-
|
|
52
|
+
{% endcall %}
|
|
48
53
|
{% endmacro %}
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
@include ds-teaser-focus(2px);
|
|
12
12
|
|
|
13
13
|
.ds-teaser__carousel {
|
|
14
|
-
|
|
14
|
+
margin: ds-spacing-component(0 $ds-sc-x4);
|
|
15
15
|
padding-bottom: ds-spacing-component($ds-sc-x3);
|
|
16
16
|
overflow-x: scroll;
|
|
17
17
|
display: grid;
|
|
@@ -27,14 +27,14 @@
|
|
|
27
27
|
position: absolute;
|
|
28
28
|
top: 50%;
|
|
29
29
|
transform: translateY(-50%);
|
|
30
|
-
z-index:
|
|
30
|
+
z-index: 2;
|
|
31
31
|
|
|
32
32
|
&--back {
|
|
33
|
-
left:
|
|
33
|
+
left: 0;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
&--forward {
|
|
37
|
-
right:
|
|
37
|
+
right: 0;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
package/package.json
CHANGED