@bonniernews/dn-design-system-web 32.7.6 → 32.7.8
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/assets/types/shared-props.ts +6 -0
- package/components/article-body-image/README.md +2 -2
- package/components/blocked-content/README.md +2 -2
- package/components/buddy-menu/README.md +2 -2
- package/components/button/README.md +2 -2
- package/components/button-toggle/README.md +2 -2
- package/components/byline/README.md +2 -2
- package/components/byline-list/README.md +2 -2
- package/components/checkbox/README.md +2 -2
- package/components/direkt-circle/README.md +2 -2
- package/components/direkt-header/README.md +2 -2
- package/components/disclaimer/README.md +3 -3
- package/components/divider/README.md +2 -2
- package/components/footer/README.md +2 -2
- package/components/game-header/README.md +2 -2
- package/components/image-caption/README.md +2 -2
- package/components/pill/README.md +2 -2
- package/components/profile-header/README-njk.md +49 -0
- package/components/profile-header/README.md +37 -49
- package/components/quote/README.md +2 -2
- package/components/radio-button/README.md +2 -2
- package/components/spinner/README.md +3 -3
- package/components/switch/README.md +2 -2
- package/components/teaser-card/README.md +2 -2
- package/components/teaser-counter/README.md +2 -2
- package/components/teaser-onsite/README.md +2 -2
- package/components/text-button/README.md +1 -1
- package/components/text-input/README.md +2 -2
- package/components/thematic-break/README.md +2 -2
- package/components/video-caption/README.md +3 -3
- package/package.json +2 -1
- package/preact/assets/article-image/article-image.d.ts +2 -3
- package/preact/components/article-body-image/article-body-image.js.map +2 -2
- package/preact/components/blocked-content/blocked-content.d.ts +2 -3
- package/preact/components/blocked-content/blocked-content.js.map +2 -2
- package/preact/components/buddy-menu/buddy-menu.d.ts +2 -4
- package/preact/components/buddy-menu/buddy-menu.js.map +2 -2
- package/preact/components/button/button-base.js.map +2 -2
- package/preact/components/button/button.js.map +2 -2
- package/preact/components/button-toggle/button-toggle.js.map +2 -2
- package/preact/components/byline/byline.d.ts +2 -3
- package/preact/components/byline/byline.js.map +2 -2
- package/preact/components/byline-list/byline-list.d.ts +2 -5
- package/preact/components/byline-list/byline-list.js.map +2 -2
- package/preact/components/checkbox/checkbox.d.ts +2 -3
- package/preact/components/checkbox/checkbox.js.map +2 -2
- package/preact/components/direkt-circle/direkt-circle.d.ts +2 -3
- package/preact/components/direkt-circle/direkt-circle.js.map +2 -2
- package/preact/components/direkt-header/direkt-header.d.ts +2 -4
- package/preact/components/direkt-header/direkt-header.js.map +2 -2
- package/preact/components/disclaimer/disclaimer.d.ts +2 -3
- package/preact/components/disclaimer/disclaimer.js.map +2 -2
- package/preact/components/divider/divider.d.ts +2 -3
- package/preact/components/divider/divider.js.map +2 -2
- package/preact/components/footer/footer.d.ts +4 -9
- package/preact/components/footer/footer.js.map +2 -2
- package/preact/components/game-header/game-header.d.ts +2 -4
- package/preact/components/game-header/game-header.js.map +2 -2
- package/preact/components/icon-sprite/icon-sprite.d.ts +3 -4
- package/preact/components/icon-sprite/icon-sprite.js.map +2 -2
- package/preact/components/icon-with-wrapper/icon-with-wrapper.d.ts +4 -5
- package/preact/components/icon-with-wrapper/icon-with-wrapper.js.map +2 -2
- package/preact/components/image-caption/image-caption.d.ts +2 -5
- package/preact/components/image-caption/image-caption.js.map +2 -2
- package/preact/components/list-item/list-item.js.map +2 -2
- package/preact/components/modal/modal.js.map +2 -2
- package/preact/components/pictogram/pictogram.js.map +2 -2
- package/preact/components/pill/pill.d.ts +2 -4
- package/preact/components/pill/pill.js.map +2 -2
- package/preact/components/profile-header/profile-header.d.ts +26 -0
- package/preact/components/profile-header/profile-header.js +251 -0
- package/preact/components/profile-header/profile-header.js.map +7 -0
- package/preact/components/quote/quote.d.ts +2 -4
- package/preact/components/quote/quote.js.map +2 -2
- package/preact/components/radio-button/radio-button.d.ts +2 -3
- package/preact/components/radio-button/radio-button.js.map +2 -2
- package/preact/components/spinner/spinner.d.ts +2 -3
- package/preact/components/spinner/spinner.js.map +2 -2
- package/preact/components/switch/switch.d.ts +2 -3
- package/preact/components/switch/switch.js.map +2 -2
- package/preact/components/teaser-card/teaser-card.d.ts +3 -5
- package/preact/components/teaser-card/teaser-card.js +5 -5
- package/preact/components/teaser-card/teaser-card.js.map +2 -2
- package/preact/components/teaser-counter/teaser-counter.d.ts +2 -4
- package/preact/components/teaser-counter/teaser-counter.js +6 -6
- package/preact/components/teaser-counter/teaser-counter.js.map +2 -2
- package/preact/components/teaser-onsite/teaser-onsite.d.ts +2 -4
- package/preact/components/teaser-onsite/teaser-onsite.js +6 -6
- package/preact/components/teaser-onsite/teaser-onsite.js.map +2 -2
- package/preact/components/text-button/text-button.js.map +2 -2
- package/preact/components/text-input/text-input.d.ts +2 -5
- package/preact/components/text-input/text-input.js.map +2 -2
- package/preact/components/thematic-break/thematic-break.d.ts +2 -3
- package/preact/components/thematic-break/thematic-break.js.map +2 -2
- package/preact/components/video-caption/video-caption.d.ts +2 -6
- package/preact/components/video-caption/video-caption.js.map +2 -2
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
|
+
## [32.7.8](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.7...@bonniernews/dn-design-system-web@32.7.8) (2025-07-03)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **web:** use shared props type ([#1806](https://github.com/BonnierNews/dn-design-system/issues/1806)) ([03f6e3a](https://github.com/BonnierNews/dn-design-system/commit/03f6e3a88d292828c965cfa918aec689d6be7d99))
|
|
13
|
+
|
|
14
|
+
## [32.7.7](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.6...@bonniernews/dn-design-system-web@32.7.7) (2025-07-03)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **web:** tsx profile header component ([#1801](https://github.com/BonnierNews/dn-design-system/issues/1801)) ([92561e6](https://github.com/BonnierNews/dn-design-system/commit/92561e6ff1f91494c82867bf2b74fdf1232f10e0))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Maintenance
|
|
23
|
+
|
|
24
|
+
* **deps-dev:** bump @babel/preset-env from 7.27.2 to 7.28.0 ([#1804](https://github.com/BonnierNews/dn-design-system/issues/1804)) ([8c21649](https://github.com/BonnierNews/dn-design-system/commit/8c21649c7d60920eabd5c54ca3959ad3b1288190))
|
|
25
|
+
* **deps-dev:** bump axios from 1.9.0 to 1.10.0 ([#1791](https://github.com/BonnierNews/dn-design-system/issues/1791)) ([10c02e7](https://github.com/BonnierNews/dn-design-system/commit/10c02e7e8bf850f25f3a7619c1e2caeac4363d25))
|
|
26
|
+
|
|
7
27
|
## [32.7.6](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.5...@bonniernews/dn-design-system-web@32.7.6) (2025-07-02)
|
|
8
28
|
|
|
9
29
|
|
|
@@ -14,8 +14,8 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
14
14
|
| imageType | string | ", " |
|
|
15
15
|
| fullWidth | boolean | \- |
|
|
16
16
|
| forcePx | boolean | \- |
|
|
17
|
-
| classNames | string | \- |
|
|
18
|
-
| attributes |
|
|
17
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
18
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
19
19
|
|
|
20
20
|
```jsx
|
|
21
21
|
<ArticleBodyImage
|
|
@@ -12,9 +12,9 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
12
12
|
| body\* | string | \- |
|
|
13
13
|
| link\* | string | \- |
|
|
14
14
|
| forcePx | boolean | false |
|
|
15
|
-
| classNames | string | ", " |
|
|
16
|
-
| attributes | object | { } |
|
|
17
15
|
| elementAttributes | { \[key: string\]: string; } | { } |
|
|
16
|
+
| classNames | Ex. "my-special-class"<br />string | ", " |
|
|
17
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
|
|
18
18
|
|
|
19
19
|
```jsx
|
|
20
20
|
<BlockedContent
|
|
@@ -33,9 +33,9 @@ dsListItem(listElements);s
|
|
|
33
33
|
| addons | Ex. \[{ title: 'Annonsfri', href: "[https://id.dn.se/konto/?nextUrl=/vanliga-fragor/dn/#Annonsfritt](https://id.dn.se/konto/?nextUrl=/vanliga-fragor/dn/#Annonsfritt)" }\]<br />{ title: string; href?: string; classNames?: string; }\[\] | \- |
|
|
34
34
|
| addonsClassNames | string | \- |
|
|
35
35
|
| isDnSkola | boolean | false |
|
|
36
|
-
| classNames | string | \- |
|
|
37
|
-
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />object | \- |
|
|
38
36
|
| forcePx | Fixed pixel value is used for typography to prevent scaling based on html font-size<br />boolean | \- |
|
|
37
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
38
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
39
39
|
|
|
40
40
|
```jsx
|
|
41
41
|
<BuddyMenu
|
|
@@ -10,7 +10,7 @@ Button
|
|
|
10
10
|
| Name | Description | Default |
|
|
11
11
|
|:--- | :--- | :--- |
|
|
12
12
|
| isIconButton | boolean | false |
|
|
13
|
-
| iconName | add, arrow\_back, arrow\_forward etc | | For all available icons see: [https://designsystem.dn.se/?path=/story/foundations-icons--all-icons](https://designsystem.dn.se/?path=/story/foundations-icons--all-icons)<br />"add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay"
|
|
13
|
+
| iconName | add, arrow\_back, arrow\_forward etc | | For all available icons see: [https://designsystem.dn.se/?path=/story/foundations-icons--all-icons](https://designsystem.dn.se/?path=/story/foundations-icons--all-icons)<br />"search", "link", "add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay" | \- |
|
|
14
14
|
| variant | Design variant<br />"primary", "staticWhite", "primaryBlack", "secondaryFilled", "secondaryOutline", "transparent" | "primary" |
|
|
15
15
|
| text | Note: only works on button-tag, not on a-tag<br />string | \- |
|
|
16
16
|
| disabled | boolean | false |
|
|
@@ -20,8 +20,8 @@ Button
|
|
|
20
20
|
| forcePx | Fixed pixel value is used for typography to prevent scaling based on html font-size<br />boolean | false |
|
|
21
21
|
| size | "sm", "lg", "md", "xl" | "md" |
|
|
22
22
|
| loading | boolean | false |
|
|
23
|
-
| href | If href is set the button will be rendered as an a-tag<br />string | \- |
|
|
24
23
|
| mobileFullWidth | Button will only full width on mobile<br />boolean | false |
|
|
24
|
+
| href | If href is set the button will be rendered as an a-tag<br />string | \- |
|
|
25
25
|
| type | "button", "submit" | "button" |
|
|
26
26
|
| iconPosition | "right", "none", "left" | "none" |
|
|
27
27
|
|
|
@@ -21,7 +21,7 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
21
21
|
| variant | Design variant<br />"primary", "staticWhite", "primaryBlack", "secondaryFilled", "secondaryOutline", "transparent" | "primary" |
|
|
22
22
|
| text | Note: only works on button-tag, not on a-tag<br />string | \- |
|
|
23
23
|
| disabled | boolean | false |
|
|
24
|
-
| iconName | add, arrow\_back, arrow\_forward etc | | For all available icons see: [https://designsystem.dn.se/?path=/story/foundations-icons--all-icons](https://designsystem.dn.se/?path=/story/foundations-icons--all-icons)<br />"add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay"
|
|
24
|
+
| iconName | add, arrow\_back, arrow\_forward etc | | For all available icons see: [https://designsystem.dn.se/?path=/story/foundations-icons--all-icons](https://designsystem.dn.se/?path=/story/foundations-icons--all-icons)<br />"search", "link", "add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay" | \- |
|
|
25
25
|
| fullWidth | Button will be full width on both desktop and mobile<br />boolean | false |
|
|
26
26
|
| classNames | string | \- |
|
|
27
27
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />{ \[key: string\]: string; } | { } |
|
|
@@ -29,7 +29,7 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
29
29
|
| size | "sm", "lg", "md", "xl" | "md" |
|
|
30
30
|
| loading | boolean | false |
|
|
31
31
|
| selected | boolean | false |
|
|
32
|
-
| selectedIconName | "add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay"
|
|
32
|
+
| selectedIconName | "search", "link", "add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay" | \- |
|
|
33
33
|
| mobileFullWidth | Button will only full width on mobile<br />boolean | false |
|
|
34
34
|
|
|
35
35
|
```jsx
|
|
@@ -23,8 +23,8 @@ initModalByline(articleElement);
|
|
|
23
23
|
| hideBorder | boolean | false |
|
|
24
24
|
| renderBylineModal | boolean | false |
|
|
25
25
|
| showNameAsLink | boolean | false |
|
|
26
|
-
| classNames | string | \- |
|
|
27
|
-
| attributes |
|
|
26
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
27
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
28
28
|
|
|
29
29
|
```jsx
|
|
30
30
|
<RunComponentJs
|
|
@@ -13,10 +13,10 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
13
13
|
| Name | Description | Default |
|
|
14
14
|
|:--- | :--- | :--- |
|
|
15
15
|
| bylines\* | BylineData\[\] | \- |
|
|
16
|
-
| attributes | { \[key: string\]: string; } | \- |
|
|
17
16
|
| showBorderOnLastItem | boolean | false |
|
|
18
17
|
| forcePx | boolean | \- |
|
|
19
|
-
| classNames | string | \- |
|
|
18
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
19
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
20
20
|
|
|
21
21
|
```jsx
|
|
22
22
|
<BylineList
|
|
@@ -17,9 +17,9 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
17
17
|
| disabled | boolean | \- |
|
|
18
18
|
| name | string | "ds-checkbox" |
|
|
19
19
|
| validation | string | \- |
|
|
20
|
-
| classNames | string | \- |
|
|
21
20
|
| forcePx | boolean | \- |
|
|
22
|
-
|
|
|
21
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
22
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
23
23
|
|
|
24
24
|
```jsx
|
|
25
25
|
<Checkbox name="ds-checkbox" />
|
|
@@ -8,9 +8,9 @@ DirektCircle
|
|
|
8
8
|
| Name | Description | Default |
|
|
9
9
|
|:--- | :--- | :--- |
|
|
10
10
|
| circleColor | Hex code or supported color name<br />string | "white" |
|
|
11
|
-
| classNames | string | \- |
|
|
12
11
|
| isAnimated | boolean | false |
|
|
13
|
-
|
|
|
12
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
13
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
|
|
14
14
|
|
|
15
15
|
```jsx
|
|
16
16
|
<DirektCircle />
|
|
@@ -13,8 +13,8 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
13
13
|
| pretitle | string | "Direkt" |
|
|
14
14
|
| isAnimated | boolean | true |
|
|
15
15
|
| renderAsH2 | boolean | false |
|
|
16
|
-
| classNames | string | \- |
|
|
17
|
-
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />
|
|
16
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
17
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
|
|
18
18
|
|
|
19
19
|
```jsx
|
|
20
20
|
<DirektHeader
|
|
@@ -9,10 +9,10 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
9
9
|
| Name | Description | Default |
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
11
|
| bodyHtml\* | string | \- |
|
|
12
|
-
| iconName | "add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay"
|
|
12
|
+
| iconName | "search", "link", "add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay" | \- |
|
|
13
13
|
| variant | "default", "native" | "default" |
|
|
14
|
-
| classNames | string | \- |
|
|
15
|
-
| attributes |
|
|
14
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
15
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
16
16
|
|
|
17
17
|
```jsx
|
|
18
18
|
<Disclaimer bodyHtml="Detta är en text publicerad på Dagens Nyheters ledarsidor. Ledarredaktionens politiska hållning är oberoende liberal. <a href='www.dn.se'>länk</a>" />
|
|
@@ -9,8 +9,8 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
9
9
|
| Name | Description | Default |
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
11
|
| variant | "soft", "medium", "hard" | "soft" |
|
|
12
|
-
| classNames | string | \- |
|
|
13
|
-
| attributes |
|
|
12
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
13
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
14
14
|
|
|
15
15
|
```jsx
|
|
16
16
|
<Divider variant="soft" />
|
|
@@ -13,9 +13,9 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
13
13
|
| linkGroups | FooterLinkList\[\] | \- |
|
|
14
14
|
| rudolf\* | { imgUrl: string; text: string; } | \- |
|
|
15
15
|
| buttons | Footerbutton\[\] | \- |
|
|
16
|
-
| classNames | string | \- |
|
|
17
|
-
| attributes | object | \- |
|
|
18
16
|
| forcePx | boolean | \- |
|
|
17
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
18
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
19
19
|
|
|
20
20
|
```jsx
|
|
21
21
|
<Footer
|
|
@@ -13,8 +13,8 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
13
13
|
| descriptionHtml | string | \- |
|
|
14
14
|
| textColor | string | \- |
|
|
15
15
|
| backgroundColor | string | \- |
|
|
16
|
-
| classNames | string | \- |
|
|
17
|
-
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />
|
|
16
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
17
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
18
18
|
|
|
19
19
|
```jsx
|
|
20
20
|
<GameHeader
|
|
@@ -11,9 +11,9 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
11
11
|
| caption | Ex "Detta är en bildtext"<br />string | \- |
|
|
12
12
|
| author | Ex "Paul Hansen"<br />string | \- |
|
|
13
13
|
| imageType | Type of image. Ex "Foto" or "Illustration"<br />string | \- |
|
|
14
|
-
| classNames | Ex. "my-special-class another-class"<br />string | \- |
|
|
15
|
-
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />object | \- |
|
|
16
14
|
| forcePx | Fixed pixel value is used for typography to prevent scaling based on html font-size<br />boolean | \- |
|
|
15
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
16
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
17
17
|
|
|
18
18
|
```jsx
|
|
19
19
|
<ImageCaption
|
|
@@ -12,8 +12,8 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
12
12
|
| variant | "link" | link |
|
|
13
13
|
| size | "sm", "lg" | "lg" |
|
|
14
14
|
| href\* | string | \- |
|
|
15
|
-
| classNames | string | \- |
|
|
16
|
-
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />
|
|
15
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
16
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
|
|
17
17
|
|
|
18
18
|
```jsx
|
|
19
19
|
<Pill
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/profile-header](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/profile-header)
|
|
2
|
+
- Storybook: [ProfileHeader](https://designsystem.dn.se/?path=/docs/section-Profileheader--docs)
|
|
3
|
+
- Storybook (Latest): [ProfileHeader](https://designsystem-latest.dn.se/?path=/docs/section-Profileheader--docs)
|
|
4
|
+
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
# Profile header
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
|parameter | type | required | options | default | description |
|
|
12
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
+
|title | String | yes | | | H1 Title |
|
|
14
|
+
|subtitleHtml | String | yes | | | Subtitle (email) |
|
|
15
|
+
|mediaHtml | String | no | | | Main image |
|
|
16
|
+
|descriptionHtml | String | no | | | Intended use is text, links |
|
|
17
|
+
|articleCount | int | no | | | Total articles on this list-page |
|
|
18
|
+
|toggle | Bool | no | true, false | false | Show/hide toggle button |
|
|
19
|
+
|toggleText | text | no | | | `text` parameter to ToggleButton (only if `toggle` is enabled) |
|
|
20
|
+
|toggleSelectedText | text | no | | | `selectedText` parameter to ToggleButton (only if `toggle` is enabled) |
|
|
21
|
+
|toggleSelected | boolean | no | | | `selected` parameter to ToggleButton (only if `toggle` is enabled) |
|
|
22
|
+
|toggleLoading | boolean | no | | | `loading` parameter to ToggleButton (only if `toggle` is enabled) |
|
|
23
|
+
|toggleClassNames | text | no | | | `classNames` parameter to ToggleButton (only if `toggle` is enabled) |
|
|
24
|
+
|toggleAttributes | text | no | | | `attributes` parameter to ToggleButton (only if `toggle` is enabled) |
|
|
25
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
26
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
27
|
+
|~forcePx~ | | | | | Not supported |
|
|
28
|
+
|
|
29
|
+
## Minimum requirement example
|
|
30
|
+
|
|
31
|
+
### Nunjucks
|
|
32
|
+
|
|
33
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
{% from '@bonniernews/dn-design-system-web/components/profile-header/profile-header.njk' import ProfileHeader %}
|
|
37
|
+
|
|
38
|
+
{{ ProfileHeader(
|
|
39
|
+
{
|
|
40
|
+
title: "Johan Croneman",
|
|
41
|
+
descriptionHtml: "<p>Johan Croneman är journalist på Dagens Nyheter.</p>"
|
|
42
|
+
}
|
|
43
|
+
)}}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### SCSS
|
|
47
|
+
```scss
|
|
48
|
+
@use "@bonniernews/dn-design-system-web/components/profile-header/profile-header" as *;
|
|
49
|
+
```
|
|
@@ -1,49 +1,37 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
|
12
|
-
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
19
|
-
|
|
|
20
|
-
|
|
|
21
|
-
|
|
|
22
|
-
|
|
|
23
|
-
|
|
|
24
|
-
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
{{ ProfileHeader(
|
|
39
|
-
{
|
|
40
|
-
title: "Johan Croneman",
|
|
41
|
-
descriptionHtml: "<p>Johan Croneman är journalist på Dagens Nyheter.</p>"
|
|
42
|
-
}
|
|
43
|
-
)}}
|
|
44
|
-
```
|
|
45
|
-
|
|
46
|
-
### SCSS
|
|
47
|
-
```scss
|
|
48
|
-
@use "@bonniernews/dn-design-system-web/components/profile-header/profile-header" as *;
|
|
49
|
-
```
|
|
1
|
+
ProfileHeader
|
|
2
|
+
=============
|
|
3
|
+
|
|
4
|
+
* GitHub: [BonnierNews/dn-design-system/../web/src/components/profile-header](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/profile-header)
|
|
5
|
+
* Storybook: [ProfileHeader](https://designsystem.dn.se/?path=/docs/section-profileheader--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/profile-header/profile-header.scss'`
|
|
8
|
+
|
|
9
|
+
| Name | Description | Default |
|
|
10
|
+
|:--- | :--- | :--- |
|
|
11
|
+
| title\* | string | \- |
|
|
12
|
+
| subtitleHtml | string | \- |
|
|
13
|
+
| media | ComponentChild | \- |
|
|
14
|
+
| descriptionHtml | string | \- |
|
|
15
|
+
| articleCount | number | \- |
|
|
16
|
+
| toggle | boolean | \- |
|
|
17
|
+
| toggleText | string | \- |
|
|
18
|
+
| toggleSelectedText | string | \- |
|
|
19
|
+
| toggleSelected | boolean | false |
|
|
20
|
+
| toggleLoading | boolean | false |
|
|
21
|
+
| toggleClassNames | string | ", " |
|
|
22
|
+
| toggleAttributes | { \[key: string\]: string; } | { } |
|
|
23
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
24
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
25
|
+
|
|
26
|
+
```jsx
|
|
27
|
+
<ProfileHeader
|
|
28
|
+
articleCount={400}
|
|
29
|
+
descriptionHtml="<p>Peter Wolodarski är chefredaktör och ansvarig utgivare för Dagens Nyheter.</p>"
|
|
30
|
+
media={<ExamplePicture className="picture" src="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&downsize=120:*&output-quality=80" srcSet="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&downsize=240:*&output-quality=60 240w, https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&downsize=480:*&output-quality=60 480w" style={{aspectRatio: '450 / 1020'}}/>}
|
|
31
|
+
subtitleHtml="<a href='mailto:peter.wolodarski@dn.se'>peter.wolodarski@dn.se</a>"
|
|
32
|
+
title="Peter Wolodarski"
|
|
33
|
+
toggle
|
|
34
|
+
toggleSelectedText="Följer"
|
|
35
|
+
toggleText="Följ"
|
|
36
|
+
/>
|
|
37
|
+
```
|
|
@@ -10,9 +10,9 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
11
|
| bodyHtml\* | string | \- |
|
|
12
12
|
| theme | "kultur", "nyheter" | "nyheter" |
|
|
13
|
-
| classNames | string | \- |
|
|
14
|
-
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />object | \- |
|
|
15
13
|
| forcePx | boolean | \- |
|
|
14
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
15
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
16
16
|
|
|
17
17
|
```jsx
|
|
18
18
|
<Quote bodyHtml="<p>Vi har blivit som Kuba. Vi lever inte. Vi överlever.</p>" />
|
|
@@ -17,9 +17,9 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
17
17
|
| stripLabel | boolean | \- |
|
|
18
18
|
| disabled | boolean | \- |
|
|
19
19
|
| validation | string | \- |
|
|
20
|
-
| classNames | string | \- |
|
|
21
20
|
| forcePx | boolean | \- |
|
|
22
|
-
|
|
|
21
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
22
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
23
23
|
|
|
24
24
|
```jsx
|
|
25
25
|
<RadioButton
|
|
@@ -9,10 +9,10 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
9
9
|
| Name | Description | Default |
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
11
|
| variant | "brand", "secondary", "primary", "onBrand", "onBusiness", "staticBlack", "staticWhite" | "primary" |
|
|
12
|
-
| size | "
|
|
12
|
+
| size | "small", "large", "xsmall" | "large" |
|
|
13
13
|
| forcePx | boolean | \- |
|
|
14
|
-
| classNames | string | \- |
|
|
15
|
-
| attributes |
|
|
14
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
15
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
16
16
|
|
|
17
17
|
```jsx
|
|
18
18
|
<Spinner
|
|
@@ -17,9 +17,9 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
17
17
|
| required | boolean | \- |
|
|
18
18
|
| disabled | boolean | \- |
|
|
19
19
|
| validation | string | \- |
|
|
20
|
-
| classNames | string | \- |
|
|
21
20
|
| forcePx | boolean | \- |
|
|
22
|
-
|
|
|
21
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
22
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
23
23
|
|
|
24
24
|
```jsx
|
|
25
25
|
<Switch
|
|
@@ -11,8 +11,8 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
11
11
|
| areaType | "right", "bauta", "bautaxl" | \- |
|
|
12
12
|
| targetLink | string | \- |
|
|
13
13
|
| theme | "kultur", "nyheter" | "nyheter" |
|
|
14
|
-
|
|
|
15
|
-
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />
|
|
14
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
15
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
16
16
|
|
|
17
17
|
```jsx
|
|
18
18
|
<TeaserCard>
|
|
@@ -15,8 +15,8 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
15
15
|
| areaType | "right", "bauta" | \- |
|
|
16
16
|
| targetLink | string | \- |
|
|
17
17
|
| mediaHtml | string | \- |
|
|
18
|
-
| classNames | string | \- |
|
|
19
|
-
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />
|
|
18
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
19
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
20
20
|
|
|
21
21
|
```jsx
|
|
22
22
|
<TeaserCounter
|
|
@@ -15,11 +15,11 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
15
15
|
| areaType | "right", "bauta", "bautaxl" | \- |
|
|
16
16
|
| targetLink | string | \- |
|
|
17
17
|
| theme | "kultur", "nyheter" | "nyheter" |
|
|
18
|
-
| classNames | string | \- |
|
|
19
|
-
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />object | \- |
|
|
20
18
|
| mediaHtml | string | \- |
|
|
21
19
|
| title | string | \- |
|
|
22
20
|
| text | string | \- |
|
|
21
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
22
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
23
23
|
|
|
24
24
|
```jsx
|
|
25
25
|
<TeaserOnSite
|
|
@@ -12,7 +12,7 @@ TextButton
|
|
|
12
12
|
| disabled | boolean | false |
|
|
13
13
|
| fullWidth | boolean | false |
|
|
14
14
|
| mobileFullWidth | Button will only full width on mobile<br />boolean | false |
|
|
15
|
-
| iconName | add, arrow\_back, arrow\_forward etc | | For all available icons see: [https://designsystem.dn.se/?path=/story/foundations-icons--all-icons](https://designsystem.dn.se/?path=/story/foundations-icons--all-icons)<br />"add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay"
|
|
15
|
+
| iconName | add, arrow\_back, arrow\_forward etc | | For all available icons see: [https://designsystem.dn.se/?path=/story/foundations-icons--all-icons](https://designsystem.dn.se/?path=/story/foundations-icons--all-icons)<br />"search", "link", "add", "arrow\_back", "arrow\_forward", "arrow\_outward", "arrow\_upward", "autoplay" | \- |
|
|
16
16
|
| iconPosition | "right", "none", "left" | "none" |
|
|
17
17
|
| hideTextOnMobile | boolean | false |
|
|
18
18
|
| size | "sm", "lg" | \- |
|
|
@@ -25,10 +25,10 @@ import textInput from '@bonniernews/dn-design-system-web/components/text-input/t
|
|
|
25
25
|
| disabled | Set to true if the field should be disabled<br />boolean | \- |
|
|
26
26
|
| validation | To use with the sites validation, some example values for dn-web: required, password, email<br />string | \- |
|
|
27
27
|
| helpText | A helptext for the field if needed<br />string | \- |
|
|
28
|
-
| classNames | Ex. "my-special-class"<br />string | ", " |
|
|
29
28
|
| forcePx | Fixed pixel value is used for typography to prevent scaling based on html font-size<br />boolean | \- |
|
|
30
29
|
| autofocus | Set to true if field should have focus when loaded<br />boolean | \- |
|
|
31
|
-
|
|
|
30
|
+
| classNames | Ex. "my-special-class"<br />string | ", " |
|
|
31
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
32
32
|
|
|
33
33
|
```jsx
|
|
34
34
|
<TextInput
|
|
@@ -8,8 +8,8 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
8
8
|
|
|
9
9
|
| Name | Description | Default |
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
|
-
| classNames | string | \- |
|
|
12
|
-
| attributes |
|
|
11
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
12
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
13
13
|
|
|
14
14
|
```jsx
|
|
15
15
|
<ThematicBreak />
|
|
@@ -10,9 +10,9 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
11
|
| caption | Ex: "Detta är en bildtext"<br />string | \- |
|
|
12
12
|
| duration | Ex: "01:23"<br />string | \- |
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
13
|
+
| forcePx | boolean | \- |
|
|
14
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
15
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
16
16
|
|
|
17
17
|
```jsx
|
|
18
18
|
<VideoCaption
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonniernews/dn-design-system-web",
|
|
3
|
-
"version": "32.7.
|
|
3
|
+
"version": "32.7.8",
|
|
4
4
|
"description": "DN design system for web.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"homepage": "https://github.com/BonnierNews/dn-design-system/tree/main/web/src#readme",
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
"exports": {
|
|
18
18
|
"./preact/*": "./preact/*",
|
|
19
19
|
"./assets/*.tsx": "./assets/*.tsx",
|
|
20
|
+
"./assets/*.ts": "./assets/*.ts",
|
|
20
21
|
"./assets/*.njk": "./assets/*.njk",
|
|
21
22
|
"./assets/*.scss": "./assets/*.scss",
|
|
22
23
|
"./components/*": "./components/*",
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { ComponentChild } from 'preact';
|
|
2
|
-
|
|
2
|
+
import type { SharedProps } from "@bonniernews/dn-design-system-web/assets/types/shared-props.ts";
|
|
3
|
+
export interface ArticleImageProps extends SharedProps {
|
|
3
4
|
image: ComponentChild;
|
|
4
5
|
caption?: string;
|
|
5
6
|
author?: string;
|
|
6
7
|
imageType?: string;
|
|
7
8
|
fullWidth?: boolean;
|
|
8
9
|
forcePx?: boolean;
|
|
9
|
-
classNames?: string;
|
|
10
|
-
attributes?: object;
|
|
11
10
|
}
|
|
12
11
|
export declare const ArticleImage: ({ image, caption, author, imageType, fullWidth, forcePx, classNames, attributes, }: ArticleImageProps) => import("preact").JSX.Element;
|