@bonniernews/dn-design-system-web 29.1.1-beta.0 → 29.2.0
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
|
@@ -4,6 +4,13 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [29.2.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@29.1.0...@bonniernews/dn-design-system-web@29.2.0) (2025-02-24)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **web:** redesign disclaimer ([#1623](https://github.com/BonnierNews/dn-design-system/issues/1623)) ([8aa498b](https://github.com/BonnierNews/dn-design-system/commit/8aa498b2b151be0eb9a848ef24a71be242d2a361))
|
|
13
|
+
|
|
7
14
|
## [29.1.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@29.0.1...@bonniernews/dn-design-system-web@29.1.0) (2025-02-20)
|
|
8
15
|
|
|
9
16
|
|
|
@@ -22,8 +22,10 @@ $ds-btn-outlined__border-width: ds-border-width(xxs);
|
|
|
22
22
|
.ds-disclaimer__body-html {
|
|
23
23
|
margin: 0;
|
|
24
24
|
flex-grow: 1;
|
|
25
|
+
border-radius: ds-border-radius(050);
|
|
26
|
+
|
|
25
27
|
@include ds-typography($ds-typography-functional-body-sm) {
|
|
26
|
-
color: $ds-color-text-primary
|
|
28
|
+
color: $ds-color-text-primary;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
31
|
@at-root .ds-force-px#{&} {
|
|
@@ -66,6 +68,11 @@ $ds-btn-outlined__border-width: ds-border-width(xxs);
|
|
|
66
68
|
|
|
67
69
|
.ds-disclaimer__body-html {
|
|
68
70
|
padding-left: 0;
|
|
71
|
+
border-radius: ds-border-radius(0 050 050 0);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.ds-disclaimer__icon-wrapper {
|
|
75
|
+
border-radius: ds-border-radius(050 0 0 050);
|
|
69
76
|
}
|
|
70
77
|
}
|
|
71
78
|
|
|
@@ -10,11 +10,11 @@
|
|
|
10
10
|
|
|
11
11
|
|parameter | type | required | options | default | description |
|
|
12
12
|
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|bodyParts| Object | yes | | | Ex. [{ type: "gradeMeter", grade: "two" }, { type: "paragraph", bodyHtml: "<p>Html markup</p>" }, { type: "image", mediaHtml: "<div class='picture'>..</div>", author: "", caption: "", imageType: "bild" }]|
|
|
13
|
+
|vignetteHtml | HTML String | no | | | |
|
|
14
|
+
|titleHtml | HTML String | yes | | | |
|
|
15
|
+
|bodyHtml | HTML String | yes | | | |
|
|
17
16
|
|theme | String | no | default, kultur, nyheter | | Design theme |
|
|
17
|
+
|grade | String | no | | | zero, one, two, three, four, five, none |
|
|
18
18
|
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
19
19
|
|classNames | String | no | | | Ex. "my-special-class" |
|
|
20
20
|
|forceExpanded | bool | no | true, false | false | Full factbox is shown regardless of height and no control buttons are shown|
|
|
@@ -30,19 +30,11 @@ These are copy paste friendly examples to quickliy get started using a component
|
|
|
30
30
|
{% from '@bonniernews/dn-design-system-web/components/factbox/factbox.njk' import Factbox %}
|
|
31
31
|
|
|
32
32
|
{{ Factbox({
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
{
|
|
37
|
-
"type": "gradeMeter",
|
|
38
|
-
"grade": "2",
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
"type": "paragraph",
|
|
42
|
-
"bodyHtml": "<p>”Irrational man”<br />Regi och manus: Woody Allen<br />I rollerna: Joaquin Phoenix, Emma Stone, Parker Posey m fl.<br />Längd: 1 tim 35 min (från 11 år.)</p>"
|
|
43
|
-
},
|
|
44
|
-
],
|
|
33
|
+
vignetteHtml: "",
|
|
34
|
+
titleHtml: "Drama",
|
|
35
|
+
bodyHtml: "<p>”Irrational man”<br />Regi och manus: Woody Allen<br />I rollerna: Joaquin Phoenix, Emma Stone, Parker Posey m fl.<br />Längd: 1 tim 35 min (från 11 år.)</p>",
|
|
45
36
|
theme: "kultur",
|
|
37
|
+
grade: "two",
|
|
46
38
|
forcePx: true
|
|
47
39
|
})}}
|
|
48
40
|
```
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{% from '@bonniernews/dn-design-system-web/foundations/icons/grade-icon.njk' import GetGrade %}
|
|
2
|
-
{% from '@bonniernews/dn-design-system-web/components/article-body-image/article-body-image.njk' import ArticleBodyImage %}
|
|
3
2
|
{% from '@bonniernews/dn-design-system-web/components/button/button.njk' import Button %}
|
|
4
3
|
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
5
4
|
|
|
6
5
|
{% macro Factbox(params) %}
|
|
7
6
|
{% set componentClassName = "ds-factbox" %}
|
|
8
7
|
{% set classNamePrefix = componentClassName + "--" %}
|
|
8
|
+
{% set grade = params.grade | default("") | string %}
|
|
9
9
|
{% set attributes = getAttributes(params.attributes) %}
|
|
10
10
|
|
|
11
11
|
{%- set classes = [
|
|
@@ -19,43 +19,20 @@
|
|
|
19
19
|
<div class="{{ classes }}" {{- attributes | safe }}>
|
|
20
20
|
<div class="{{ componentClassName + '__inner'}}">
|
|
21
21
|
<div class="{{ componentClassName + '__content'}}">
|
|
22
|
-
{
|
|
23
|
-
<
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
{
|
|
27
|
-
{
|
|
28
|
-
<h2 class="{{ componentClassName + '__title'}}">
|
|
29
|
-
{%- if params.titleHighlight %}<span class="{{ componentClassName + '__title-highlight'}}">{{ params.titleHighlight }}</span>{%- endif %}
|
|
30
|
-
{{- params.title -}}
|
|
31
|
-
</h2>
|
|
32
|
-
{% endif %}
|
|
33
|
-
{% if params.bodyParts.length %}
|
|
34
|
-
<div class="{{ componentClassName + '__body'}}">
|
|
35
|
-
{% for part in params.bodyParts %}
|
|
36
|
-
{% if part.type == "paragraph" %}
|
|
37
|
-
{{ part.bodyHtml | safe }}
|
|
38
|
-
{% elif part.type == "gradeMeter" %}
|
|
39
|
-
{{ GetGrade({ grade: part.grade, type: "scale" }) | safe }}
|
|
40
|
-
{% elif part.type == "image" %}
|
|
41
|
-
{{ ArticleBodyImage({
|
|
42
|
-
imageHtml: part.mediaHtml | safe,
|
|
43
|
-
fullWidth: false,
|
|
44
|
-
imageType: part.imageType,
|
|
45
|
-
caption: part.caption if part.caption else "",
|
|
46
|
-
author: part.author if part.author else ""
|
|
47
|
-
}) }}
|
|
48
|
-
{% endif %}
|
|
49
|
-
{% endfor %}
|
|
50
|
-
</div>
|
|
51
|
-
{% endif %}
|
|
22
|
+
<h2 class="{{ componentClassName + '__title'}}">
|
|
23
|
+
{%- if params.vignetteHtml %}<span class="{{ componentClassName + '__vignette'}}">{{ params.vignetteHtml | safe }}</span>{%- endif %}
|
|
24
|
+
{{- params.titleHtml | safe -}}
|
|
25
|
+
</h2>
|
|
26
|
+
{{ GetGrade({ grade: grade, type: "scale" }) if grade }}
|
|
27
|
+
<div class="{{ componentClassName + '__body'}}">{{ params.bodyHtml | safe }}</div>
|
|
52
28
|
</div>
|
|
53
29
|
<div class="{{ componentClassName + '__show-more'}}">
|
|
54
30
|
{{ Button({
|
|
55
31
|
text: 'Visa mer',
|
|
56
|
-
variant: '
|
|
57
|
-
size: '
|
|
58
|
-
|
|
32
|
+
variant: 'secondaryFilled',
|
|
33
|
+
size: 'md',
|
|
34
|
+
iconPosition: 'right',
|
|
35
|
+
iconName: 'expand_more',
|
|
59
36
|
classNames: 'ds-factbox__expand-more',
|
|
60
37
|
attributes: { "aria-hidden": "true" },
|
|
61
38
|
mobile: { fullWidth: true },
|
|
@@ -63,9 +40,10 @@
|
|
|
63
40
|
})}}
|
|
64
41
|
{{ Button({
|
|
65
42
|
text: 'Visa mindre',
|
|
66
|
-
variant: '
|
|
67
|
-
size: '
|
|
68
|
-
|
|
43
|
+
variant: 'secondaryFilled',
|
|
44
|
+
size: 'md',
|
|
45
|
+
iconPosition: 'right',
|
|
46
|
+
iconName: 'expand_less',
|
|
69
47
|
classNames: 'ds-factbox__expand-less',
|
|
70
48
|
attributes: { "aria-hidden": "true" },
|
|
71
49
|
mobile: { fullWidth: true },
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
$ds-factbox__grade-size: 40px;
|
|
5
5
|
$ds-factbox__show-more-fade-height: 48px;
|
|
6
6
|
$ds-factbox__padding: ds-spacing($ds-s-100);
|
|
7
|
+
$ds-factbox-border-width: 4px;
|
|
8
|
+
$ds-factbox__padding-left: $ds-factbox__padding - $ds-factbox-border-width;
|
|
7
9
|
$ds-factbox__max-height: 500px; // includes top/bottom spacing
|
|
8
10
|
|
|
9
11
|
.ds-factbox {
|
|
@@ -13,12 +15,14 @@ $ds-factbox__max-height: 500px; // includes top/bottom spacing
|
|
|
13
15
|
padding: ds-spacing($ds-s-100 0 $ds-s-200);
|
|
14
16
|
|
|
15
17
|
.ds-factbox__inner {
|
|
16
|
-
border: ds-border-width(xxs) solid $ds-color-border-primary;
|
|
17
|
-
border-
|
|
18
|
+
border-top: ds-border-width(xxs) solid $ds-color-border-primary;
|
|
19
|
+
border-left: $ds-factbox-border-width solid $ds-theme-color;
|
|
18
20
|
max-height: ds-px-to-rem($ds-factbox__max-height);
|
|
19
21
|
overflow: hidden;
|
|
20
22
|
position: relative;
|
|
21
23
|
padding: $ds-factbox__padding;
|
|
24
|
+
padding-left: $ds-factbox__padding-left;
|
|
25
|
+
padding-top: $ds-factbox__padding - ds-border-width(xxs);
|
|
22
26
|
|
|
23
27
|
@at-root .ds-force-px#{&} {
|
|
24
28
|
max-height: $ds-factbox__max-height;
|
|
@@ -30,17 +34,6 @@ $ds-factbox__max-height: 500px; // includes top/bottom spacing
|
|
|
30
34
|
max-height: none;
|
|
31
35
|
}
|
|
32
36
|
|
|
33
|
-
.ds-factbox__title-image {
|
|
34
|
-
margin: ds-spacing(0 0 $ds-s-100);
|
|
35
|
-
}
|
|
36
|
-
.ds-factbox__title-image,
|
|
37
|
-
.ds-article-image {
|
|
38
|
-
border-radius: ds-border-radius(012);
|
|
39
|
-
overflow: hidden;
|
|
40
|
-
}
|
|
41
|
-
img {
|
|
42
|
-
max-width: 100%;
|
|
43
|
-
}
|
|
44
37
|
.ds-factbox__body {
|
|
45
38
|
overflow: hidden;
|
|
46
39
|
@include ds-typography($ds-typography-functional-body-md) {
|
|
@@ -49,14 +42,11 @@ $ds-factbox__max-height: 500px; // includes top/bottom spacing
|
|
|
49
42
|
@at-root .ds-force-px#{&} {
|
|
50
43
|
@include ds-typography($ds-typography-functional-body-md, true);
|
|
51
44
|
}
|
|
52
|
-
p
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
&:last-child {
|
|
58
|
-
margin-bottom: 0;
|
|
59
|
-
}
|
|
45
|
+
p {
|
|
46
|
+
margin: ds-spacing(0 0 $ds-s-100);
|
|
47
|
+
}
|
|
48
|
+
p:last-child {
|
|
49
|
+
margin-bottom: 0;
|
|
60
50
|
}
|
|
61
51
|
a {
|
|
62
52
|
@include ds-link($ds-link-article-body);
|
|
@@ -71,9 +61,12 @@ $ds-factbox__max-height: 500px; // includes top/bottom spacing
|
|
|
71
61
|
@include ds-typography($ds-typography-functional-body-md, $forcePx: true, $fontWeight: $ds-fontweight-semibold);
|
|
72
62
|
}
|
|
73
63
|
}
|
|
64
|
+
img {
|
|
65
|
+
max-width: 100%;
|
|
66
|
+
}
|
|
74
67
|
}
|
|
75
68
|
.ds-factbox__title {
|
|
76
|
-
margin: ds-spacing(0 0 $ds-s-
|
|
69
|
+
margin: ds-spacing(0 0 $ds-s-100);
|
|
77
70
|
@include ds-typography($ds-typography-functional-heading-xxs, $lineHeight: $ds-lineheight-md) {
|
|
78
71
|
color: $ds-color-text-primary;
|
|
79
72
|
}
|
|
@@ -81,12 +74,13 @@ $ds-factbox__max-height: 500px; // includes top/bottom spacing
|
|
|
81
74
|
@include ds-typography($ds-typography-functional-heading-xxs, $forcePx: true, $lineHeight: $ds-lineheight-md);
|
|
82
75
|
}
|
|
83
76
|
}
|
|
84
|
-
.ds-
|
|
77
|
+
.ds-factbox__vignette {
|
|
85
78
|
color: $ds-theme-color;
|
|
86
79
|
margin-right: ds-spacing($ds-s-025);
|
|
87
80
|
}
|
|
88
81
|
.ds-icon--grade {
|
|
89
82
|
color: $ds-color-text-primary;
|
|
83
|
+
margin: ds-spacing(0 0 $ds-s-100);
|
|
90
84
|
display: block;
|
|
91
85
|
height: ds-px-to-rem($ds-factbox__grade-size);
|
|
92
86
|
svg {
|
|
@@ -134,7 +128,7 @@ $ds-factbox__max-height: 500px; // includes top/bottom spacing
|
|
|
134
128
|
&:not([data-factbox-expanded]) {
|
|
135
129
|
position: absolute;
|
|
136
130
|
bottom: $ds-factbox__padding;
|
|
137
|
-
width: calc(100% - ($ds-factbox__padding
|
|
131
|
+
width: calc(100% - ($ds-factbox__padding-left + $ds-factbox__padding));
|
|
138
132
|
|
|
139
133
|
&::after {
|
|
140
134
|
content: "";
|
package/package.json
CHANGED