@bonniernews/dn-design-system-web 37.2.2 → 37.2.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 +20 -0
- package/components/factbox/README-njk.md +0 -9
- package/components/factbox/README.md +0 -1
- package/components/factbox/factbox.njk +0 -18
- package/components/factbox/factbox.scss +2 -58
- package/components/list-item/README.md +2 -2
- package/package.json +1 -1
- package/preact/components/byline/byline.d.ts +1 -0
- package/preact/components/byline/byline.js +5 -4
- package/preact/components/byline/byline.js.map +2 -2
- package/preact/components/byline-list/byline-list.js +5 -4
- package/preact/components/byline-list/byline-list.js.map +2 -2
- package/preact/components/factbox/factbox.d.ts +1 -2
- package/preact/components/factbox/factbox.js +13 -226
- package/preact/components/factbox/factbox.js.map +4 -4
- package/components/factbox/factbox.js +0 -39
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [37.2.4](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@37.2.3...@bonniernews/dn-design-system-web@37.2.4) (2026-01-29)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **web:** bylinelist followbutton needs classname watch--follow ([#2012](https://github.com/BonnierNews/dn-design-system/issues/2012)) ([c05ced6](https://github.com/BonnierNews/dn-design-system/commit/c05ced65f102fa08cb30d1d9f7f5a5da0a9af595))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Maintenance
|
|
16
|
+
|
|
17
|
+
* **app:** reanimated 4.2.1 ([#2011](https://github.com/BonnierNews/dn-design-system/issues/2011)) ([dd38656](https://github.com/BonnierNews/dn-design-system/commit/dd3865651f83176bbe0f00d1d68c944524469782))
|
|
18
|
+
* prerelease packages ([d113335](https://github.com/BonnierNews/dn-design-system/commit/d113335f4fe21d8df23ea94bddfedc5e8b6625a2))
|
|
19
|
+
|
|
20
|
+
## [37.2.3](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@37.2.2...@bonniernews/dn-design-system-web@37.2.3) (2026-01-27)
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* **web:** always full height fact boxes ([#2001](https://github.com/BonnierNews/dn-design-system/issues/2001)) ([b46770a](https://github.com/BonnierNews/dn-design-system/commit/b46770aceb34b2d4c93133c6f9fc8265d82a23f3))
|
|
26
|
+
|
|
7
27
|
## [37.2.2](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@37.2.1...@bonniernews/dn-design-system-web@37.2.2) (2026-01-26)
|
|
8
28
|
|
|
9
29
|
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
|theme | String | no | default, kultur, nyheter | | Design theme |
|
|
18
18
|
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
19
19
|
|classNames | String | no | | | Ex. "my-special-class" |
|
|
20
|
-
|forceExpanded | bool | no | true, false | false | Full factbox is shown regardless of height and no control buttons are shown|
|
|
21
20
|
|forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size |
|
|
22
21
|
|
|
23
22
|
## Minimum requirement example
|
|
@@ -51,11 +50,3 @@ These are copy paste friendly examples to quickliy get started using a component
|
|
|
51
50
|
```scss
|
|
52
51
|
@use "@bonniernews/dn-design-system-web/components/factbox/factbox" as *;
|
|
53
52
|
```
|
|
54
|
-
|
|
55
|
-
### Javascript
|
|
56
|
-
|
|
57
|
-
```javascript
|
|
58
|
-
import dsFactbox from '@bonniernews/dn-design-system-web/components/factbox/factbox.js'
|
|
59
|
-
const factboxElements = Array.from(document.getElementsByClassName("ds-factbox"));
|
|
60
|
-
dsFactbox(factboxElements);
|
|
61
|
-
```
|
|
@@ -13,7 +13,6 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
13
13
|
| titleImage | ComponentChild | \- |
|
|
14
14
|
| bodyParts\* | BodyPart\[\] | \- |
|
|
15
15
|
| theme | "kultur", "nyheter", "default" | \- |
|
|
16
|
-
| forceExpand | boolean | false |
|
|
17
16
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
18
17
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
19
18
|
|
|
@@ -50,24 +50,6 @@
|
|
|
50
50
|
</div>
|
|
51
51
|
{% endif %}
|
|
52
52
|
</div>
|
|
53
|
-
<div class="{{ componentClassName + '__show-more'}}">
|
|
54
|
-
{{ Button({
|
|
55
|
-
text: 'Visa mer',
|
|
56
|
-
variant: 'secondaryOutline',
|
|
57
|
-
size: 'sm',
|
|
58
|
-
fullWidth: true,
|
|
59
|
-
classNames: 'ds-factbox__expand-more',
|
|
60
|
-
forcePx: params.forcePx
|
|
61
|
-
})}}
|
|
62
|
-
{{ Button({
|
|
63
|
-
text: 'Visa mindre',
|
|
64
|
-
variant: 'secondaryOutline',
|
|
65
|
-
size: 'sm',
|
|
66
|
-
fullWidth: true,
|
|
67
|
-
classNames: 'ds-factbox__expand-less',
|
|
68
|
-
forcePx: params.forcePx
|
|
69
|
-
})}}
|
|
70
|
-
</div>
|
|
71
53
|
</div>
|
|
72
54
|
</div>
|
|
73
55
|
{% endmacro %}
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
@use "../button/button.scss" as *;
|
|
3
3
|
|
|
4
4
|
$ds-factbox__grade-size: 40px;
|
|
5
|
-
$ds-factbox__show-more-fade-height: 48px;
|
|
6
5
|
$ds-factbox__padding: ds-spacing($ds-s-100);
|
|
7
|
-
$ds-factbox__max-height: 500px; // includes top/bottom spacing
|
|
8
6
|
|
|
9
7
|
.ds-factbox {
|
|
10
|
-
background-color:
|
|
8
|
+
background-color: none;
|
|
11
9
|
box-sizing: border-box;
|
|
12
10
|
margin: 0;
|
|
13
11
|
padding: ds-spacing($ds-s-100 0 $ds-s-200);
|
|
@@ -15,19 +13,10 @@ $ds-factbox__max-height: 500px; // includes top/bottom spacing
|
|
|
15
13
|
.ds-factbox__inner {
|
|
16
14
|
border: ds-border-width(xxs) solid $ds-color-border-primary;
|
|
17
15
|
border-radius: ds-border-radius(050);
|
|
18
|
-
max-height:
|
|
16
|
+
max-height: none;
|
|
19
17
|
overflow: hidden;
|
|
20
18
|
position: relative;
|
|
21
19
|
padding: $ds-factbox__padding;
|
|
22
|
-
|
|
23
|
-
@at-root .ds-force-px#{&} {
|
|
24
|
-
max-height: $ds-factbox__max-height;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
&--expanded .ds-factbox__inner,
|
|
29
|
-
&--expanded.ds-force-px .ds-factbox__inner {
|
|
30
|
-
max-height: none;
|
|
31
20
|
}
|
|
32
21
|
|
|
33
22
|
.ds-factbox__title-image {
|
|
@@ -100,49 +89,4 @@ $ds-factbox__max-height: 500px; // includes top/bottom spacing
|
|
|
100
89
|
height: $ds-factbox__grade-size;
|
|
101
90
|
}
|
|
102
91
|
}
|
|
103
|
-
.ds-factbox__show-more--collapsable::before {
|
|
104
|
-
content: "";
|
|
105
|
-
background: $ds-gradient-content-fade-up;
|
|
106
|
-
height: ds-px-to-rem($ds-factbox__show-more-fade-height);
|
|
107
|
-
width: 100%;
|
|
108
|
-
position: absolute;
|
|
109
|
-
top: -#{ds-px-to-rem($ds-factbox__show-more-fade-height)};
|
|
110
|
-
|
|
111
|
-
@at-root .ds-force-px#{&} {
|
|
112
|
-
height: $ds-factbox__show-more-fade-height;
|
|
113
|
-
top: -#{$ds-factbox__show-more-fade-height};
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
.ds-factbox__show-more {
|
|
117
|
-
display: none;
|
|
118
|
-
}
|
|
119
|
-
.ds-factbox__show-more--collapsable {
|
|
120
|
-
background-color: $ds-color-surface-primary;
|
|
121
|
-
display: block;
|
|
122
|
-
button {
|
|
123
|
-
margin: ds-spacing($ds-s-100 0 0);
|
|
124
|
-
}
|
|
125
|
-
&:not([data-factbox-expanded]) .ds-factbox__expand-more,
|
|
126
|
-
&[data-factbox-expanded] .ds-factbox__expand-less {
|
|
127
|
-
display: flex;
|
|
128
|
-
}
|
|
129
|
-
&:not([data-factbox-expanded]) .ds-factbox__expand-less,
|
|
130
|
-
&[data-factbox-expanded] .ds-factbox__expand-more,
|
|
131
|
-
&[data-factbox-expanded]::before {
|
|
132
|
-
display: none;
|
|
133
|
-
}
|
|
134
|
-
&:not([data-factbox-expanded]) {
|
|
135
|
-
position: absolute;
|
|
136
|
-
bottom: $ds-factbox__padding;
|
|
137
|
-
width: calc(100% - ($ds-factbox__padding * 2));
|
|
138
|
-
|
|
139
|
-
&::after {
|
|
140
|
-
content: "";
|
|
141
|
-
height: $ds-factbox__padding;
|
|
142
|
-
width: 100%;
|
|
143
|
-
background-color: $ds-color-surface-primary;
|
|
144
|
-
position: absolute;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
92
|
}
|
|
@@ -36,10 +36,10 @@ dsListItem(listElements);
|
|
|
36
36
|
| accordionContent | any | \- |
|
|
37
37
|
| name | string | "ds-list-item" |
|
|
38
38
|
| href | Links entire list item<br />string | \- |
|
|
39
|
-
| checked | boolean | \- |
|
|
40
|
-
| stripLabel | boolean | \- |
|
|
41
39
|
| interactiveElementAttributes | Applied to the right element: checkbox or button ('toggle')<br />{ \[key: string\]: string; } | \- |
|
|
42
40
|
| interactiveElementClassNames | string | \- |
|
|
41
|
+
| checked | boolean | \- |
|
|
42
|
+
| stripLabel | boolean | \- |
|
|
43
43
|
| mediaHtml\* | string | \- |
|
|
44
44
|
| trailingIcon | "search", "link", "add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay" | \- |
|
|
45
45
|
| showMeta | boolean | \- |
|
package/package.json
CHANGED
|
@@ -203,7 +203,7 @@ var BylineList = ({
|
|
|
203
203
|
const componentClassName = "ds-byline-list__item";
|
|
204
204
|
const classes = formatClassString(["ds-byline-list", forcePx && "ds-force-px", classNames]);
|
|
205
205
|
return /* @__PURE__ */ jsx6("ul", { className: classes, ...attributes, children: bylines && bylines.map((byline, index) => {
|
|
206
|
-
const { name, authorId, authorPageUrl, bylineImage, role, followable } = byline;
|
|
206
|
+
const { name, authorId, authorPageUrl, bylineImage, role, followable, followButtonAttributes } = byline;
|
|
207
207
|
const linkAttributes = {
|
|
208
208
|
"data-link-category": "article author",
|
|
209
209
|
"data-index": `${index}`,
|
|
@@ -219,6 +219,7 @@ var BylineList = ({
|
|
|
219
219
|
border: shouldShowBorder,
|
|
220
220
|
followable,
|
|
221
221
|
authorPageUrl,
|
|
222
|
+
followButtonAttributes,
|
|
222
223
|
children: [
|
|
223
224
|
bylineImage && /* @__PURE__ */ jsx6("div", { className: `${componentClassName}__portrait`, children: bylineImage }),
|
|
224
225
|
/* @__PURE__ */ jsx6(
|
|
@@ -242,7 +243,7 @@ var BylineListInner = ({
|
|
|
242
243
|
linkAttributes,
|
|
243
244
|
authorPageUrl,
|
|
244
245
|
listItemClassNames,
|
|
245
|
-
|
|
246
|
+
followButtonAttributes,
|
|
246
247
|
buttonClassNames,
|
|
247
248
|
followable,
|
|
248
249
|
followed,
|
|
@@ -269,8 +270,8 @@ var BylineListInner = ({
|
|
|
269
270
|
selected: followed,
|
|
270
271
|
disabled,
|
|
271
272
|
forcePx,
|
|
272
|
-
attributes:
|
|
273
|
-
classNames: buttonClassNames
|
|
273
|
+
attributes: followButtonAttributes,
|
|
274
|
+
classNames: `${buttonClassNames || ""} watch--follow`
|
|
274
275
|
}
|
|
275
276
|
}
|
|
276
277
|
)
|