@bonniernews/dn-design-system-web 20.5.2 → 20.5.4
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 +26 -0
- package/components/pagination/README.md +9 -9
- package/components/pagination/pagination.njk +8 -4
- package/components/pagination/pagination.scss +4 -0
- package/components/teaser-list-swipe/README.md +6 -0
- package/components/teaser-list-swipe/teaser-list-swipe.njk +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,32 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [20.5.4](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@20.5.3...@bonniernews/dn-design-system-web@20.5.4) (2024-10-09)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **web:** support group header with toggle button in teaser list swipe ([#1427](https://github.com/BonnierNews/dn-design-system/issues/1427)) ([b9f92ec](https://github.com/BonnierNews/dn-design-system/commit/b9f92ecfeeb5a7d369fa6fb15516831064c81b73))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Maintenance
|
|
16
|
+
|
|
17
|
+
* **foundations:** update tokens from Figma ([#1425](https://github.com/BonnierNews/dn-design-system/issues/1425)) ([011234f](https://github.com/BonnierNews/dn-design-system/commit/011234f775c71a7a6590d5c038cc8a1a4c60c9ce))
|
|
18
|
+
* prerelease packages ([b738549](https://github.com/BonnierNews/dn-design-system/commit/b7385498577d28020b23b7235459431e107521b2))
|
|
19
|
+
|
|
20
|
+
## [20.5.3](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@20.5.2...@bonniernews/dn-design-system-web@20.5.3) (2024-10-09)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **web:** pagination next and prev are invisible when disabled ([#1421](https://github.com/BonnierNews/dn-design-system/issues/1421)) ([030cafb](https://github.com/BonnierNews/dn-design-system/commit/030cafb2c9a649927c17aaa5aa87779e9546951c))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
### Maintenance
|
|
29
|
+
|
|
30
|
+
* **foundations:** update tokens from Figma ([#1424](https://github.com/BonnierNews/dn-design-system/issues/1424)) ([0800afd](https://github.com/BonnierNews/dn-design-system/commit/0800afdc87dcc5b732d3b1e62c57e9082818abcb))
|
|
31
|
+
* prerelease packages ([9a0b844](https://github.com/BonnierNews/dn-design-system/commit/9a0b844af17656dbbcf0ac40b7b61a6ef48a5d1d))
|
|
32
|
+
|
|
7
33
|
## [20.5.2](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@20.5.1...@bonniernews/dn-design-system-web@20.5.2) (2024-10-08)
|
|
8
34
|
|
|
9
35
|
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
|parameter | type | required | options | default | description |
|
|
12
12
|
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
-
|pages | Array | no | | | Array with link objects. Ex. [ { label: '8' , url: 'https://www.dn.se/om/danmark/?
|
|
13
|
+
|pages | Array | no | | | Array with link objects. Ex. [ { label: '8' , url: 'https://www.dn.se/om/danmark/?page=8', current: true, attributes: {} } ] |
|
|
14
14
|
|previousLabel | String | no | 'Föregående' | | Previous button/link label |
|
|
15
15
|
|previousUrl | String | no | | | |
|
|
16
16
|
|previousAttributes | Object | no | | | |
|
|
@@ -33,19 +33,19 @@ These are copy paste friendly examples to quickliy get started using a component
|
|
|
33
33
|
{% from '@bonniernews/dn-design-system-web/components/pagination/pagination.njk' import Pagination %}
|
|
34
34
|
|
|
35
35
|
{{ Pagination({
|
|
36
|
-
nextUrl: 'https://www.dn.se/om/danmark/?
|
|
36
|
+
nextUrl: 'https://www.dn.se/om/danmark/?page=8',
|
|
37
37
|
nextLabel: undefined,
|
|
38
|
-
previousUrl: 'https://www.dn.se/om/danmark/?
|
|
38
|
+
previousUrl: 'https://www.dn.se/om/danmark/?page=7',
|
|
39
39
|
previousLabel: undefined,
|
|
40
40
|
pages: [
|
|
41
|
-
{ label: '6'
|
|
42
|
-
{ label: '7'
|
|
43
|
-
{ label: '8'
|
|
44
|
-
{ label: '9'
|
|
45
|
-
{ label: '10'
|
|
41
|
+
{ label: '6', url: 'https://www.dn.se/om/danmark/?page=6', attributes: {} },
|
|
42
|
+
{ label: '7', url: 'https://www.dn.se/om/danmark/?page=7' },
|
|
43
|
+
{ label: '8', url: 'https://www.dn.se/om/danmark/?page=8', current: true },
|
|
44
|
+
{ label: '9', url: 'https://www.dn.se/om/danmark/?page=9' },
|
|
45
|
+
{ label: '10', url: 'https://www.dn.se/om/danmark/?page=10' },
|
|
46
46
|
],
|
|
47
47
|
attributes: {},
|
|
48
|
-
classNames: undefined
|
|
48
|
+
classNames: undefined,
|
|
49
49
|
})}}
|
|
50
50
|
```
|
|
51
51
|
|
|
@@ -13,9 +13,11 @@
|
|
|
13
13
|
{%- set attributes = getAttributes(params.attributes) %}
|
|
14
14
|
{%- set visiblePages = 5 %}
|
|
15
15
|
<nav class="{{ classes }}" {{- attributes | safe }}>
|
|
16
|
+
{% set isPrevDisabled = true if not params.previousUrl else false %}
|
|
16
17
|
{%- set prevClasses = [
|
|
17
18
|
componentClassName + "__prev ",
|
|
18
|
-
params.previousClassNames if params.previousClassNames
|
|
19
|
+
params.previousClassNames if params.previousClassNames,
|
|
20
|
+
"invisible" if isPrevDisabled
|
|
19
21
|
] | join(" ") %}
|
|
20
22
|
{{ TextButton({
|
|
21
23
|
text: params.previousLabel if params.previousLabel else 'Föregående',
|
|
@@ -26,7 +28,7 @@
|
|
|
26
28
|
classNames: prevClasses,
|
|
27
29
|
attributes: params.previousAttributes,
|
|
28
30
|
href: params.previousUrl,
|
|
29
|
-
disabled:
|
|
31
|
+
disabled: isPrevDisabled
|
|
30
32
|
})}}
|
|
31
33
|
{% if params.pages %}
|
|
32
34
|
<div class="{{ componentClassName }}__pages">
|
|
@@ -42,9 +44,11 @@
|
|
|
42
44
|
{% endfor %}
|
|
43
45
|
</div>
|
|
44
46
|
{% endif %}
|
|
47
|
+
{% set isNextDisabled = true if not params.nextUrl else false %}
|
|
45
48
|
{%- set nextClasses = [
|
|
46
49
|
componentClassName + "__next ",
|
|
47
|
-
params.nextClassNames if params.nextClassNames
|
|
50
|
+
params.nextClassNames if params.nextClassNames,
|
|
51
|
+
"invisible" if isNextDisabled
|
|
48
52
|
] | join(" ") %}
|
|
49
53
|
{{ TextButton({
|
|
50
54
|
text: params.nextLabel if params.nextLabel else 'Nästa',
|
|
@@ -55,7 +59,7 @@
|
|
|
55
59
|
classNames: nextClasses,
|
|
56
60
|
attributes: params.nextAttributes,
|
|
57
61
|
href: params.nextUrl,
|
|
58
|
-
disabled:
|
|
62
|
+
disabled: isNextDisabled
|
|
59
63
|
})}}
|
|
60
64
|
</nav>
|
|
61
65
|
{% endmacro %}
|
|
@@ -17,6 +17,12 @@
|
|
|
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" } |
|
|
20
|
+
|groupHeaderType | String | no | "icon", "link", "toggle", "arrow" | | Type of group header |
|
|
21
|
+
|groupHeaderToggleText | String | no | | | Text in toggle button |
|
|
22
|
+
|groupHeaderToggleSelectedText | String | no | | | Text in toggle button when selected |
|
|
23
|
+
|groupHeaderToggleSelected | Boolean | no | | false | Is toogle button selected or not |
|
|
24
|
+
|groupHeaderToggleClassNames | String | no | | | Class names for toggle button |
|
|
25
|
+
|groupHeaderToggleAttributes | Object | no | | | Attributes for toogle button. Ex. { "data-entity-id": "dn.epi.434" } |
|
|
20
26
|
|classNames | String | no | | | Ex. "my-special-class" |
|
|
21
27
|
|~forcePx~ | | | | | Not supported |
|
|
22
28
|
|
|
@@ -31,6 +31,11 @@
|
|
|
31
31
|
title: params.title,
|
|
32
32
|
href: params.titleHref,
|
|
33
33
|
type: type,
|
|
34
|
+
toggleText: params.groupHeaderToggleText,
|
|
35
|
+
toggleSelectedText: params.groupHeaderToggleSelectedText,
|
|
36
|
+
toggleSelected: params.groupHeaderToggleSelected,
|
|
37
|
+
toggleClassNames: params.groupHeaderToggleClassNames,
|
|
38
|
+
toggleAttributes: params.groupHeaderToggleAttributes,
|
|
34
39
|
linkText: 'Visa alla'
|
|
35
40
|
}) }}
|
|
36
41
|
<div class="{{ componentClassName + '__carousel'}}" role="list">
|
package/package.json
CHANGED