@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 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
 
@@ -53,7 +53,7 @@
53
53
  }
54
54
 
55
55
  .ds-group-header__right-link {
56
- text-decoration: none;
56
+ @include ds-underline(2px, 1px);
57
57
  }
58
58
  }
59
59
  }
@@ -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
- |scrollType | String | no | "arrows", "header" | "arrows" | Where to render the scroll arrows |
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 attributes = getAttributes(params.attributes) %}
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
- <div class="{{ classes }}" {{- attributes | safe }}>
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 params.scrollType == 'header'
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 params.scrollType != 'header' %}
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
- </div>
52
+ {% endcall %}
48
53
  {% endmacro %}
@@ -11,7 +11,7 @@
11
11
  @include ds-teaser-focus(2px);
12
12
 
13
13
  .ds-teaser__carousel {
14
- padding: ds-spacing-component(0 $ds-sc-x4);
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: 10;
30
+ z-index: 2;
31
31
 
32
32
  &--back {
33
- left: ds-spacing-component($ds-sc-x4);
33
+ left: 0;
34
34
  }
35
35
 
36
36
  &--forward {
37
- right: ds-spacing-component($ds-sc-x4);
37
+ right: 0;
38
38
  }
39
39
  }
40
40
  }
@@ -19,7 +19,7 @@ $typographyTokensScreenSmall: (
19
19
  ),
20
20
  expressive-heading01italicregular: (
21
21
  fontFamily: "DN Serif Text",
22
- fontWeight: Regular,
22
+ fontWeight: Medium,
23
23
  fontSize: 16,
24
24
  letterSpacing: "",
25
25
  lineHeight: 20,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "5.1.0",
3
+ "version": "6.0.1",
4
4
  "description": "DN design system for web.",
5
5
  "main": "index.js",
6
6
  "homepage": "https://github.com/BonnierNews/dn-design-system/tree/main/web/src#readme",