@bonniernews/dn-design-system-web 20.5.1 → 20.5.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 +24 -0
- package/components/pagination/README.md +9 -9
- package/components/pagination/pagination.njk +8 -4
- package/components/pagination/pagination.scss +4 -0
- package/package.json +1 -1
- package/tokens/colors-css-variables.json +1 -1
- package/tokens-tmp/colors-css-variables.json +86 -0
- package/tokens-tmp/shadows-css-variables.json +6 -0
- package/tokens-tmp/spacing-base-list.json +14 -0
- package/tokens-tmp/spacing-detail-list.json +18 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,30 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [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)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **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))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Maintenance
|
|
16
|
+
|
|
17
|
+
* **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))
|
|
18
|
+
* prerelease packages ([9a0b844](https://github.com/BonnierNews/dn-design-system/commit/9a0b844af17656dbbcf0ac40b7b61a6ef48a5d1d))
|
|
19
|
+
|
|
20
|
+
## [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)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Maintenance
|
|
24
|
+
|
|
25
|
+
* **foundations:** update tokens from Figma ([#1420](https://github.com/BonnierNews/dn-design-system/issues/1420)) ([09bed27](https://github.com/BonnierNews/dn-design-system/commit/09bed27d5b9859dc7043aae93eedd498802f2082))
|
|
26
|
+
* **foundations:** update tokens from Figma ([#1423](https://github.com/BonnierNews/dn-design-system/issues/1423)) ([d8b68e0](https://github.com/BonnierNews/dn-design-system/commit/d8b68e05ad5a02b619b6f86d182bc0f30cc400bf))
|
|
27
|
+
* prerelease packages ([d264310](https://github.com/BonnierNews/dn-design-system/commit/d26431063ee3f86e03bc0f027c680f8fcd397f73))
|
|
28
|
+
* prerelease packages ([adc82e8](https://github.com/BonnierNews/dn-design-system/commit/adc82e84bd81599b993de929ed3af61f4cd8f7fe))
|
|
29
|
+
* **web:** disable token updates for web ([#1422](https://github.com/BonnierNews/dn-design-system/issues/1422)) ([4092eac](https://github.com/BonnierNews/dn-design-system/commit/4092eacab58a4246df8a54c40775dbe0e9911f04))
|
|
30
|
+
|
|
7
31
|
## [20.5.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@20.5.0...@bonniernews/dn-design-system-web@20.5.1) (2024-09-30)
|
|
8
32
|
|
|
9
33
|
|
|
@@ -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 %}
|
package/package.json
CHANGED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"text-primary": "var(--ds-color-text-primary)",
|
|
3
|
+
"text-primary-02": "var(--ds-color-text-primary-02)",
|
|
4
|
+
"text-secondary": "var(--ds-color-text-secondary)",
|
|
5
|
+
"text-critical": "var(--ds-color-text-critical)",
|
|
6
|
+
"text-disabled": "var(--ds-color-text-disabled)",
|
|
7
|
+
"text-on-brand": "var(--ds-color-text-on-brand)",
|
|
8
|
+
"text-on-business": "var(--ds-color-text-on-business)",
|
|
9
|
+
"text-on-critical": "var(--ds-color-text-on-critical)",
|
|
10
|
+
"text-on-success": "var(--ds-color-text-on-success)",
|
|
11
|
+
"text-brand": "var(--ds-color-text-brand)",
|
|
12
|
+
"text-body-link": "var(--ds-color-text-body-link)",
|
|
13
|
+
"text-body-link-visited": "var(--ds-color-text-body-link-visited)",
|
|
14
|
+
"text-positive": "var(--ds-color-text-positive)",
|
|
15
|
+
"icon-primary": "var(--ds-color-icon-primary)",
|
|
16
|
+
"icon-primary-02": "var(--ds-color-icon-primary-02)",
|
|
17
|
+
"icon-secondary": "var(--ds-color-icon-secondary)",
|
|
18
|
+
"icon-critical": "var(--ds-color-icon-critical)",
|
|
19
|
+
"icon-disabled": "var(--ds-color-icon-disabled)",
|
|
20
|
+
"icon-on-brand": "var(--ds-color-icon-on-brand)",
|
|
21
|
+
"icon-on-business": "var(--ds-color-icon-on-business)",
|
|
22
|
+
"icon-brand": "var(--ds-color-icon-brand)",
|
|
23
|
+
"icon-on-critical": "var(--ds-color-icon-on-critical)",
|
|
24
|
+
"icon-on-success": "var(--ds-color-icon-on-success)",
|
|
25
|
+
"component-brand": "var(--ds-color-component-brand)",
|
|
26
|
+
"component-business": "var(--ds-color-component-business)",
|
|
27
|
+
"component-primary": "var(--ds-color-component-primary)",
|
|
28
|
+
"component-primary-overlay": "var(--ds-color-component-primary-overlay)",
|
|
29
|
+
"component-primary-overlay-02": "var(--ds-color-component-primary-overlay-02)",
|
|
30
|
+
"component-secondary": "var(--ds-color-component-secondary)",
|
|
31
|
+
"component-secondary-overlay": "var(--ds-color-component-secondary-overlay)",
|
|
32
|
+
"component-secondary-overlay-02": "var(--ds-color-component-secondary-overlay-02)",
|
|
33
|
+
"component-critical": "var(--ds-color-component-critical)",
|
|
34
|
+
"component-critical-overlay": "var(--ds-color-component-critical-overlay)",
|
|
35
|
+
"component-static-white": "var(--ds-color-component-static-white)",
|
|
36
|
+
"component-positive": "var(--ds-color-component-positive)",
|
|
37
|
+
"component-primary-02": "var(--ds-color-component-primary-02)",
|
|
38
|
+
"surface-below": "var(--ds-color-surface-below)",
|
|
39
|
+
"surface-native-article": "var(--ds-color-surface-native-article)",
|
|
40
|
+
"surface-background": "var(--ds-color-surface-background)",
|
|
41
|
+
"surface-raised": "var(--ds-color-surface-raised)",
|
|
42
|
+
"surface-elevated": "var(--ds-color-surface-elevated)",
|
|
43
|
+
"surface-overlay": "var(--ds-color-surface-overlay)",
|
|
44
|
+
"surface-quiz": "var(--ds-color-surface-quiz)",
|
|
45
|
+
"surface-korsord": "var(--ds-color-surface-korsord)",
|
|
46
|
+
"surface-sudoko": "var(--ds-color-surface-sudoko)",
|
|
47
|
+
"surface-brand": "var(--ds-color-surface-brand)",
|
|
48
|
+
"surface-inverted": "var(--ds-color-surface-inverted)",
|
|
49
|
+
"surface-breaking": "var(--ds-color-surface-breaking)",
|
|
50
|
+
"border-primary": "var(--ds-color-border-primary)",
|
|
51
|
+
"border-primary-02": "var(--ds-color-border-primary-02)",
|
|
52
|
+
"border-primary-03": "var(--ds-color-border-primary-03)",
|
|
53
|
+
"border-secondary": "var(--ds-color-border-secondary)",
|
|
54
|
+
"border-business": "var(--ds-color-border-business)",
|
|
55
|
+
"border-critical": "var(--ds-color-border-critical)",
|
|
56
|
+
"border-focus": "var(--ds-color-border-focus)",
|
|
57
|
+
"border-focus-02": "var(--ds-color-border-focus-02)",
|
|
58
|
+
"border-focus-03": "var(--ds-color-border-focus-03)",
|
|
59
|
+
"border-focus-04": "var(--ds-color-border-focus-04)",
|
|
60
|
+
"border-brand": "var(--ds-color-border-brand)",
|
|
61
|
+
"background-primary": "var(--ds-color-background-primary)",
|
|
62
|
+
"static-red-100": "var(--ds-color-static-red-100)",
|
|
63
|
+
"static-black": "var(--ds-color-static-black)",
|
|
64
|
+
"static-transparent-black": "var(--ds-color-static-transparent-black)",
|
|
65
|
+
"static-white": "var(--ds-color-static-white)",
|
|
66
|
+
"static-transparent-white": "var(--ds-color-static-transparent-white)",
|
|
67
|
+
"static-green-100": "var(--ds-color-static-green-100)",
|
|
68
|
+
"static-red-300": "var(--ds-color-static-red-300)",
|
|
69
|
+
"static-transparent-white-10": "var(--ds-color-static-transparent-white-10)",
|
|
70
|
+
"static-kultur": "var(--ds-color-static-kultur)",
|
|
71
|
+
"static-economy": "var(--ds-color-static-economy)",
|
|
72
|
+
"static-sport": "var(--ds-color-static-sport)",
|
|
73
|
+
"static-neutral-200": "var(--ds-color-static-neutral-200)",
|
|
74
|
+
"static-sthlm": "var(--ds-color-static-sthlm)",
|
|
75
|
+
"static-ad-yellow": "var(--ds-color-static-ad-yellow)",
|
|
76
|
+
"static-neutral-100": "var(--ds-color-static-neutral-100)",
|
|
77
|
+
"static-neutral-500": "var(--ds-color-static-neutral-500)",
|
|
78
|
+
"static-red-500": "var(--ds-color-static-red-500)",
|
|
79
|
+
"static-yellow": "var(--ds-color-static-yellow)",
|
|
80
|
+
"static-red-200": "var(--ds-color-static-red-200)",
|
|
81
|
+
"static-red-0": "var(--ds-color-static-red-0)",
|
|
82
|
+
"gradient-content-fade-left": "var(--ds-color-gradient-content-fade-left)",
|
|
83
|
+
"gradient-content-fade-right": "var(--ds-color-gradient-content-fade-right)",
|
|
84
|
+
"gradient-content-fade-up": "var(--ds-color-gradient-content-fade-up)",
|
|
85
|
+
"gradient-content-fade-down": "var(--ds-color-gradient-content-fade-down)"
|
|
86
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"outer": "outer",
|
|
3
|
+
"outer-negative": "outer-negative",
|
|
4
|
+
"page-horizontal": "page-horizontal",
|
|
5
|
+
"page-top-small": "page-top-small",
|
|
6
|
+
"gap-vertical-static-medium": "gap-vertical-static-medium",
|
|
7
|
+
"gap-vertical-medium": "gap-vertical-medium",
|
|
8
|
+
"gap-vertical-static-large": "gap-vertical-static-large",
|
|
9
|
+
"gap-vertical-static-small": "gap-vertical-static-small",
|
|
10
|
+
"page-top-xsmall": "page-top-xsmall",
|
|
11
|
+
"teaser-vertical-small": "teaser-vertical-small",
|
|
12
|
+
"teaser-horizontal": "teaser-horizontal",
|
|
13
|
+
"teaser-vertical-medium": "teaser-vertical-medium",
|
|
14
|
+
"direkt-header-bottom": "direkt-header-bottom",
|
|
15
|
+
"spacing-sm": "spacing-sm",
|
|
16
|
+
"spacing-md": "spacing-md",
|
|
17
|
+
"spacing-lg": "spacing-lg"
|
|
18
|
+
}
|