@bonniernews/dn-design-system-web 32.6.1 → 32.7.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 +14 -0
- package/components/button/README.md +2 -2
- package/components/button-toggle/README.md +1 -1
- package/components/byline/README-NJK.md +55 -0
- package/components/byline/README.md +27 -49
- package/components/byline/byline.scss +4 -3
- package/components/byline-list/README.md +13 -2
- package/components/pill/README.md +25 -0
- package/components/pill/pill.scss +67 -0
- package/package.json +1 -1
- package/preact/components/byline/byline.d.ts +37 -0
- package/preact/components/byline/byline.js +505 -0
- package/preact/components/byline/byline.js.map +7 -0
- package/preact/components/byline-list/byline-list.d.ts +4 -21
- package/preact/components/byline-list/byline-list.js +31 -30
- package/preact/components/byline-list/byline-list.js.map +2 -2
- package/preact/components/pill/pill.d.ts +18 -0
- package/preact/components/pill/pill.js +48 -0
- package/preact/components/pill/pill.js.map +7 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [32.7.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.6.2...@bonniernews/dn-design-system-web@32.7.0) (2025-06-13)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **web:** implement pill component ([#1776](https://github.com/BonnierNews/dn-design-system/issues/1776)) ([9ef9506](https://github.com/BonnierNews/dn-design-system/commit/9ef9506cf6b85b7e8e278f7706df20b5b151d743))
|
|
13
|
+
|
|
14
|
+
## [32.6.2](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.6.1...@bonniernews/dn-design-system-web@32.6.2) (2025-06-10)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **web:** byline as tsx ([#1771](https://github.com/BonnierNews/dn-design-system/issues/1771)) ([f52f4e3](https://github.com/BonnierNews/dn-design-system/commit/f52f4e38506a2211b9a4d8dfb7333b5a52bf96cb))
|
|
20
|
+
|
|
7
21
|
## [32.6.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.6.0...@bonniernews/dn-design-system-web@32.6.1) (2025-06-10)
|
|
8
22
|
|
|
9
23
|
|
|
@@ -18,10 +18,10 @@ Button
|
|
|
18
18
|
| classNames | string | \- |
|
|
19
19
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />{ \[key: string\]: string; } | \- |
|
|
20
20
|
| forcePx | Fixed pixel value is used for typography to prevent scaling based on html font-size<br />boolean | false |
|
|
21
|
-
| size | "sm", "
|
|
21
|
+
| size | "sm", "lg", "md", "xl" | "md" |
|
|
22
22
|
| loading | boolean | false |
|
|
23
|
-
| mobileFullWidth | Button will only full width on mobile<br />boolean | false |
|
|
24
23
|
| href | If href is set the button will be rendered as an a-tag<br />string | \- |
|
|
24
|
+
| mobileFullWidth | Button will only full width on mobile<br />boolean | false |
|
|
25
25
|
| type | "button", "submit" | "button" |
|
|
26
26
|
| iconPosition | "right", "none", "left" | "none" |
|
|
27
27
|
|
|
@@ -26,7 +26,7 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
26
26
|
| classNames | string | \- |
|
|
27
27
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />{ \[key: string\]: string; } | { } |
|
|
28
28
|
| forcePx | Fixed pixel value is used for typography to prevent scaling based on html font-size<br />boolean | false |
|
|
29
|
-
| size | "sm", "
|
|
29
|
+
| size | "sm", "lg", "md", "xl" | "md" |
|
|
30
30
|
| loading | boolean | false |
|
|
31
31
|
| selected | boolean | false |
|
|
32
32
|
| selectedIconName | "add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay", "bookmark-filled", "bookmarked" | \- |
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/byline](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/byline)
|
|
2
|
+
- Storybook: [Byline](https://designsystem.dn.se/?path=/docs/article-byline--docs)
|
|
3
|
+
|
|
4
|
+
----
|
|
5
|
+
|
|
6
|
+
# Byline
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
|parameter | type | required | options | default | description |
|
|
11
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
12
|
+
|largeByline | Boolean | no | true, false | false | Specify if web should render a large byline, used for profile articles |
|
|
13
|
+
|bylineTitle | String | yes | | | The titles of the bylines, supplied by the api |
|
|
14
|
+
|bylines | Array | yes | | | Array of bylines from api |
|
|
15
|
+
|authorImages | Array[HTML] | no | | | Array with html image from bang. The component only makes the image round. Scaling is up to the user. Should be 44px for non retina screens. |
|
|
16
|
+
|hideBylineImages | Boolean | no | true, false | true | Specify if byline images should be renderd or not |
|
|
17
|
+
|renderBylineModal | Boolean | false | true, false | false | Specify if byline sheet should be renderd. Should be true for bottomByline |
|
|
18
|
+
|showNameAsLink | Boolean | false | true, false | false | If true, author names will be renders as link and sheet will not load. Used for desktop |
|
|
19
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
20
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
21
|
+
|
|
22
|
+
## Minimum requirement example
|
|
23
|
+
|
|
24
|
+
### Nunjucks
|
|
25
|
+
|
|
26
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
{% from '@bonniernews/dn-design-system-web/components/byline/byline.njk' import Byline %}
|
|
30
|
+
|
|
31
|
+
{{ Byline({
|
|
32
|
+
largeByline: largeByline,
|
|
33
|
+
bylineTitle: bylineTitle,
|
|
34
|
+
bylines: bylines,
|
|
35
|
+
authorImages: [imageHtml(), imageHtml(), imageHtml()],
|
|
36
|
+
hideBylineImages: hideBylineImages,
|
|
37
|
+
renderBylineModal: renderBylineModal,
|
|
38
|
+
attributes: attributes,
|
|
39
|
+
classNames: classNames
|
|
40
|
+
variant: variant,
|
|
41
|
+
})}}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### SCSS
|
|
45
|
+
```scss
|
|
46
|
+
@use "@bonniernews/dn-design-system-web/components/byline/byline";
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Javascript
|
|
50
|
+
|
|
51
|
+
```javascript
|
|
52
|
+
import dsButtonToggle from '@bonniernews/dn-design-system-web/components/button/button-interactions.js'
|
|
53
|
+
const toggleElements = Array.from(document.getElementsByClassName("ds-btn--toggle"));
|
|
54
|
+
dsButtonToggle(toggleElements);
|
|
55
|
+
```
|
|
@@ -1,55 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
Byline
|
|
2
|
+
======
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
* GitHub: [BonnierNews/dn-design-system/../web/src/components/byline](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/byline)
|
|
5
|
+
* Storybook: [Byline](https://designsystem.dn.se/?path=/docs/article-byline--docs)
|
|
5
6
|
|
|
6
|
-
|
|
7
|
+
The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use '@bonniernews/dn-design-system-web/components/byline/byline.scss'`
|
|
7
8
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|parameter | type | required | options | default | description |
|
|
11
|
-
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
12
|
-
|largeByline | Boolean | no | true, false | false | Specify if web should render a large byline, used for profile articles |
|
|
13
|
-
|bylineTitle | String | yes | | | The titles of the bylines, supplied by the api |
|
|
14
|
-
|bylines | Array | yes | | | Array of bylines from api |
|
|
15
|
-
|authorImages | Array[HTML] | no | | | Array with html image from bang. The component only makes the image round. Scaling is up to the user. Should be 44px for non retina screens. |
|
|
16
|
-
|hideBylineImages | Boolean | no | true, false | true | Specify if byline images should be renderd or not |
|
|
17
|
-
|renderBylineModal | Boolean | false | true, false | false | Specify if byline sheet should be renderd. Should be true for bottomByline |
|
|
18
|
-
|showNameAsLink | Boolean | false | true, false | false | If true, author names will be renders as link and sheet will not load. Used for desktop |
|
|
19
|
-
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
20
|
-
|classNames | String | no | | | Ex. "my-special-class" |
|
|
21
|
-
|
|
22
|
-
## Minimum requirement example
|
|
23
|
-
|
|
24
|
-
### Nunjucks
|
|
25
|
-
|
|
26
|
-
These are copy paste friendly examples to quickliy get started using a component.
|
|
27
|
-
|
|
28
|
-
```html
|
|
29
|
-
{% from '@bonniernews/dn-design-system-web/components/byline/byline.njk' import Byline %}
|
|
30
|
-
|
|
31
|
-
{{ Byline({
|
|
32
|
-
largeByline: largeByline,
|
|
33
|
-
bylineTitle: bylineTitle,
|
|
34
|
-
bylines: bylines,
|
|
35
|
-
authorImages: [imageHtml(), imageHtml(), imageHtml()],
|
|
36
|
-
hideBylineImages: hideBylineImages,
|
|
37
|
-
renderBylineModal: renderBylineModal,
|
|
38
|
-
attributes: attributes,
|
|
39
|
-
classNames: classNames
|
|
40
|
-
variant: variant,
|
|
41
|
-
})}}
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
### SCSS
|
|
45
|
-
```scss
|
|
46
|
-
@use "@bonniernews/dn-design-system-web/components/byline/byline";
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### Javascript
|
|
9
|
+
### [](#javascript)Javascript
|
|
50
10
|
|
|
51
11
|
```javascript
|
|
52
|
-
import
|
|
53
|
-
const
|
|
54
|
-
|
|
12
|
+
import { initModalByline } from '@bonniernews/dn-design-system-web/components/byline/byline-interaction.js'
|
|
13
|
+
const articleElement = document.querySelector('.some-article-class');
|
|
14
|
+
initModalByline(articleElement);
|
|
55
15
|
```
|
|
16
|
+
|
|
17
|
+
| Name | Description | Default |
|
|
18
|
+
|:--- | :--- | :--- |
|
|
19
|
+
| largeByline | boolean | false |
|
|
20
|
+
| bylineTitle\* | string | \- |
|
|
21
|
+
| bylines\* | BylineData\[\] | \- |
|
|
22
|
+
| hideBylineImages | boolean | false |
|
|
23
|
+
| renderBylineModal | boolean | false |
|
|
24
|
+
| showNameAsLink | boolean | false |
|
|
25
|
+
| classNames | string | \- |
|
|
26
|
+
| attributes | object | \- |
|
|
27
|
+
|
|
28
|
+
```jsx
|
|
29
|
+
<RunComponentJs
|
|
30
|
+
component={<><div className="ds-byline ds-byline--show-images"><div className="ds-byline__inner"><div className="ds-byline__portrait" dangerouslySetInnerHTML={{__html: '<div class="picture lazy-image" style="aspect-ratio: 1 / 1"><img class="picture__img picture__img--fullheight" src="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80" srcset="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80 44w, https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=88:88&output-quality=60 88w" sizes="44px" alt="" aria-hidden="true"></div>'}}/><div className="ds-byline__info"><span className="ds-byline__role">Text</span><a className="ds-byline__name" data-id="https://www.dn.se/av/peter-wolodarski" data-index="1" data-label="Peter Wolodarski" data-link-category="article author" href="https://www.dn.se/av/peter-wolodarski">Peter Wolodarski</a></div></div></div></>}
|
|
31
|
+
jsFunction={() => {}}
|
|
32
|
+
/>
|
|
33
|
+
```
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
+
@use "../../components/byline-list/byline-list.scss";
|
|
2
3
|
@use "../../components/byline-list-item/byline-list-item.scss";
|
|
3
4
|
@use "../../components/modal/modal.scss";
|
|
4
5
|
|
|
@@ -46,7 +47,7 @@ $ds-list-item__portrait-size--large: 104px;
|
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
&--show-images .ds-byline__info {
|
|
49
|
-
margin-left: ds-spacing($ds-s-
|
|
50
|
+
margin-left: ds-spacing($ds-s-075);
|
|
50
51
|
}
|
|
51
52
|
|
|
52
53
|
.ds-byline__info {
|
|
@@ -59,7 +60,7 @@ $ds-list-item__portrait-size--large: 104px;
|
|
|
59
60
|
|
|
60
61
|
.ds-byline__role {
|
|
61
62
|
display: block;
|
|
62
|
-
@include ds-typography($ds-typography-functional-
|
|
63
|
+
@include ds-typography($ds-typography-functional-heading-xxs, $fontWeight: $ds-fontweight-regular);
|
|
63
64
|
}
|
|
64
65
|
|
|
65
66
|
.ds-byline__name,
|
|
@@ -87,7 +88,7 @@ $ds-list-item__portrait-size--large: 104px;
|
|
|
87
88
|
&.ds-byline--show-images {
|
|
88
89
|
.ds-byline__inner--multiple {
|
|
89
90
|
.ds-byline__info {
|
|
90
|
-
margin-top: ds-spacing($ds-s-
|
|
91
|
+
margin-top: ds-spacing($ds-s-075);
|
|
91
92
|
}
|
|
92
93
|
}
|
|
93
94
|
}
|
|
@@ -12,8 +12,9 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
12
12
|
|
|
13
13
|
| Name | Description | Default |
|
|
14
14
|
|:--- | :--- | :--- |
|
|
15
|
-
| bylines\* |
|
|
15
|
+
| bylines\* | BylineData\[\] | \- |
|
|
16
16
|
| attributes | { \[key: string\]: string; } | \- |
|
|
17
|
+
| showBorderOnLastItem | boolean | false |
|
|
17
18
|
| forcePx | boolean | \- |
|
|
18
19
|
| classNames | string | \- |
|
|
19
20
|
|
|
@@ -21,10 +22,20 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
21
22
|
<BylineList
|
|
22
23
|
bylines={[
|
|
23
24
|
{
|
|
24
|
-
|
|
25
|
+
authorId: '1',
|
|
25
26
|
authorPageUrl: 'https://www.dn.se/av/peter-wolodarski',
|
|
26
27
|
bylineImage: '<div class="picture lazy-image" style="aspect-ratio: 1 / 1"><img class="picture__img picture__img--fullheight" src="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80" srcset="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80 44w, https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=88:88&output-quality=60 88w" sizes="44px" alt="" aria-hidden="true"></div>',
|
|
28
|
+
followable: false,
|
|
29
|
+
name: 'Byline link',
|
|
27
30
|
role: 'Grafik'
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
authorId: '123',
|
|
34
|
+
authorPageUrl: 'https://www.dn.se/av/peter-wolodarski',
|
|
35
|
+
bylineImage: '<div class="picture lazy-image" style="aspect-ratio: 1 / 1"><img class="picture__img picture__img--fullheight" src="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80" srcset="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80 44w, https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=88:88&output-quality=60 88w" sizes="44px" alt="" aria-hidden="true"></div>',
|
|
36
|
+
followable: true,
|
|
37
|
+
name: 'Test Testsson',
|
|
38
|
+
role: 'Text'
|
|
28
39
|
}
|
|
29
40
|
]}
|
|
30
41
|
/>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
Pill
|
|
2
|
+
====
|
|
3
|
+
|
|
4
|
+
* GitHub: [BonnierNews/dn-design-system/../web/src/components/pill](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/pill)
|
|
5
|
+
* Storybook: [Pill](https://designsystem.dn.se/?path=/docs/basic-pill--docs)
|
|
6
|
+
|
|
7
|
+
The component will not include styling by itself. Make sure to include the right styles for the component. See example below: `@use '@bonniernews/dn-design-system-web/components/pill/pill.scss'`
|
|
8
|
+
|
|
9
|
+
| Name | Description | Default |
|
|
10
|
+
|:--- | :--- | :--- |
|
|
11
|
+
| text\* | string | \- |
|
|
12
|
+
| variant | "link" | link |
|
|
13
|
+
| size | "sm", "lg" | "lg" |
|
|
14
|
+
| href\* | string | \- |
|
|
15
|
+
| classNames | string | \- |
|
|
16
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />object | { } |
|
|
17
|
+
|
|
18
|
+
```jsx
|
|
19
|
+
<Pill
|
|
20
|
+
href="https://www.bonniernews.se"
|
|
21
|
+
size="lg"
|
|
22
|
+
text="Ukraina"
|
|
23
|
+
variant="link"
|
|
24
|
+
/>
|
|
25
|
+
```
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
+
@use "../icon-sprite/icon-sprite.scss";
|
|
3
|
+
@use "../spinner/spinner.scss" as *;
|
|
4
|
+
|
|
5
|
+
$ds-pill-outlined__border-width: ds-border-width(xxs);
|
|
6
|
+
@function _pill-brdr($value, $rem: false) {
|
|
7
|
+
$value: (ds-strip-unit($value) - ds-strip-unit($ds-pill-outlined__border-width)) * 1px;
|
|
8
|
+
@if $rem {
|
|
9
|
+
@return ds-px-to-rem($value);
|
|
10
|
+
}
|
|
11
|
+
@return $value;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.ds-pill {
|
|
15
|
+
cursor: pointer;
|
|
16
|
+
border: $ds-pill-outlined__border-width solid $ds-color-border-primary;
|
|
17
|
+
border-radius: 100px;
|
|
18
|
+
position: relative;
|
|
19
|
+
background-color: $ds-color-surface-primary;
|
|
20
|
+
color: $ds-color-text-primary;
|
|
21
|
+
text-decoration: none;
|
|
22
|
+
@include ds-typography($variable: $ds-typography-functional-body-sm, $fontWeight: $ds-fontweight-medium);
|
|
23
|
+
|
|
24
|
+
&.ds-pill--sm {
|
|
25
|
+
padding: _pill-brdr(ds-spacing($ds-s-025), true) _pill-brdr(ds-spacing($ds-s-050), true)
|
|
26
|
+
_pill-brdr(ds-spacing($ds-s-025), true) _pill-brdr(ds-spacing($ds-s-075), true);
|
|
27
|
+
height: 32px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&.ds-pill--lg {
|
|
31
|
+
padding: _pill-brdr(ds-spacing($ds-s-050), true) _pill-brdr(ds-spacing($ds-s-075), true)
|
|
32
|
+
_pill-brdr(ds-spacing($ds-s-050), true) _pill-brdr(ds-spacing($ds-s-100), true);
|
|
33
|
+
height: 40px;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
&:focus-visible {
|
|
37
|
+
outline: ds-border-width(xs) solid $ds-color-border-primary-strongest;
|
|
38
|
+
outline-offset: 2px;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@include min-click-surface();
|
|
42
|
+
|
|
43
|
+
@include ds-hover() {
|
|
44
|
+
&:hover {
|
|
45
|
+
opacity: $ds-opacity-component-hover-pressed;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.ds-pill--link {
|
|
51
|
+
display: inline-flex;
|
|
52
|
+
align-items: center;
|
|
53
|
+
justify-content: center;
|
|
54
|
+
.ds-icon {
|
|
55
|
+
display: flex;
|
|
56
|
+
height: ds-px-to-rem(20px);
|
|
57
|
+
width: ds-px-to-rem(20px);
|
|
58
|
+
margin: ds-spacing(0 0 0 $ds-s-050, rem);
|
|
59
|
+
svg {
|
|
60
|
+
fill: $ds-color-surface-brand;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.ds-pill--sm .ds-icon {
|
|
65
|
+
margin: ds-spacing(0 0 0 $ds-s-025, rem);
|
|
66
|
+
}
|
|
67
|
+
}
|
package/package.json
CHANGED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface BylineData {
|
|
2
|
+
name: string;
|
|
3
|
+
authorId: string;
|
|
4
|
+
bylineImage?: string;
|
|
5
|
+
authorPageUrl?: string;
|
|
6
|
+
followable: boolean;
|
|
7
|
+
followed?: boolean;
|
|
8
|
+
border?: boolean;
|
|
9
|
+
role: string;
|
|
10
|
+
}
|
|
11
|
+
interface BylineProps {
|
|
12
|
+
largeByline?: boolean;
|
|
13
|
+
bylineTitle: string;
|
|
14
|
+
bylines: BylineData[];
|
|
15
|
+
hideBylineImages?: boolean;
|
|
16
|
+
renderBylineModal?: boolean;
|
|
17
|
+
showNameAsLink?: boolean;
|
|
18
|
+
classNames?: string;
|
|
19
|
+
attributes?: object;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* - GitHub: [BonnierNews/dn-design-system/../web/src/components/byline](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/byline)
|
|
23
|
+
* - Storybook: [Byline](https://designsystem.dn.se/?path=/docs/article-byline--docs)
|
|
24
|
+
*
|
|
25
|
+
* The component will not include styling by itself. Make sure to include the right styles for the component. See example below:
|
|
26
|
+
* `@use '@bonniernews/dn-design-system-web/components/byline/byline.scss'`
|
|
27
|
+
*
|
|
28
|
+
* ### Javascript
|
|
29
|
+
*
|
|
30
|
+
* ```javascript
|
|
31
|
+
* import { initModalByline } from '@bonniernews/dn-design-system-web/components/byline/byline-interaction.js'
|
|
32
|
+
* const articleElement = document.querySelector('.some-article-class');
|
|
33
|
+
* initModalByline(articleElement);
|
|
34
|
+
* ```
|
|
35
|
+
*/
|
|
36
|
+
export declare const Byline: ({ bylines, bylineTitle, largeByline, hideBylineImages, renderBylineModal, showNameAsLink, classNames, attributes, }: BylineProps) => import("preact").JSX.Element;
|
|
37
|
+
export {};
|