@bonniernews/dn-design-system-web 32.7.7 → 32.7.9
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/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/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 +2 -2
- 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.md +2 -2
- package/components/quote/README.md +2 -2
- package/components/radio-button/README.md +2 -2
- package/components/spinner/README.md +2 -2
- 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-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/assets/types/shared-props.d.ts +6 -0
- 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 +2 -3
- package/preact/components/profile-header/profile-header.js.map +2 -2
- 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-footer/teaser-footer.d.ts +8 -0
- package/preact/components/teaser-footer/teaser-footer.js +53 -0
- package/preact/components/teaser-footer/teaser-footer.js.map +7 -0
- 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/components/teaser-footer/{README.md → README-njk.md} +0 -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.9](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.8...@bonniernews/dn-design-system-web@32.7.9) (2025-07-03)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **web:** teaser footer tsx ([#1805](https://github.com/BonnierNews/dn-design-system/issues/1805)) ([3f0beb4](https://github.com/BonnierNews/dn-design-system/commit/3f0beb44dcad5a4f193b12b789979a4d28804314))
|
|
13
|
+
|
|
14
|
+
## [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)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **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))
|
|
20
|
+
|
|
7
21
|
## [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)
|
|
8
22
|
|
|
9
23
|
|
|
@@ -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
|
|
@@ -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
|
|
@@ -11,8 +11,8 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
11
11
|
| bodyHtml\* | string | \- |
|
|
12
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
|
|
@@ -20,8 +20,8 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
20
20
|
| toggleLoading | boolean | false |
|
|
21
21
|
| toggleClassNames | string | ", " |
|
|
22
22
|
| toggleAttributes | { \[key: string\]: string; } | { } |
|
|
23
|
-
| classNames | string | \- |
|
|
24
|
-
| attributes |
|
|
23
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
24
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
25
25
|
|
|
26
26
|
```jsx
|
|
27
27
|
<ProfileHeader
|
|
@@ -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
|
|
@@ -11,8 +11,8 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
11
11
|
| variant | "brand", "secondary", "primary", "onBrand", "onBusiness", "staticBlack", "staticWhite" | "primary" |
|
|
12
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
|
|
@@ -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.9",
|
|
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;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../helpers/formatClassString.ts", "../../../components/image-caption/image-caption.tsx", "../../../assets/article-image/article-image.tsx", "../../../components/article-body-image/article-body-image.tsx"],
|
|
4
|
-
"sourcesContent": ["export const formatClassString = (classesArray: (string|undefined|false)[]): string => {\n return classesArray.filter(x => !!x).join(' ');\n}\n", "import { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts';\n\nexport interface ImageCaptionProps {\n /** Ex \"Detta \u00E4r en bildtext\" */\n caption?: string;\n /** Ex \"Paul Hansen\" */\n author?: string;\n /** Type of image. Ex \"Foto\" or \"Illustration\" */\n imageType?: string;\n /**
|
|
5
|
-
"mappings": ";AAAO,IAAM,oBAAoB,CAAC,iBAAqD;AACrF,SAAO,aAAa,OAAO,OAAK,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG;AAC/C;;;
|
|
4
|
+
"sourcesContent": ["export const formatClassString = (classesArray: (string|undefined|false)[]): string => {\n return classesArray.filter(x => !!x).join(' ');\n}\n", "import type { SharedProps } from \"@bonniernews/dn-design-system-web/assets/types/shared-props.ts\";\nimport { formatClassString } from '@bonniernews/dn-design-system-web/helpers/formatClassString.ts';\n\nexport interface ImageCaptionProps extends SharedProps {\n /** Ex \"Detta \u00E4r en bildtext\" */\n caption?: string;\n /** Ex \"Paul Hansen\" */\n author?: string;\n /** Type of image. Ex \"Foto\" or \"Illustration\" */\n imageType?: string;\n /** Fixed pixel value is used for typography to prevent scaling based on html font-size */\n forcePx?: boolean;\n}\n\n/**\n * - GitHub: [BonnierNews/dn-design-system/../web/src/components/image-caption](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/image-caption)\n * - Storybook: [ImageCaption](https://designsystem.dn.se/?path=/docs/article-image-caption--docs)\n *\n * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:\n * `@use '@bonniernews/dn-design-system-web/components/image-caption/image-caption.scss'`\n */\nexport const ImageCaption = ({caption, author, imageType, classNames, attributes, forcePx}: ImageCaptionProps) => {\n const classes = formatClassString([\n 'ds-image-caption',\n forcePx && 'ds-force-px',\n classNames,\n ]);\n\n const authorText = imageType && author ? `${imageType.charAt(0).toUpperCase() + imageType.slice(1)}: ${author}` : author;\n\n const authorClasses = [\n 'ds-article-image__credits',\n authorText && authorText.length >= 27 && authorText.length < 60 // Low estimate of how much will fit on tablet/desktop\n ? 'ds-article-image__credits--nowrap-bigscreen' : authorText && authorText.length < 27 // Low estimate of how much will fit on 320px mobile\n ? 'ds-article-image__credits--nowrap' : null,\n ].filter(Boolean).join(' ');\n\n return (\n <figcaption className={classes} aria-hidden='true' {...attributes} >\n {/* This needs to be on the same line to maintain a space between the caption-span and author-span */}\n {caption && <span>{caption}</span>} {authorText && <span className={authorClasses}>{authorText}</span>}\n </figcaption>\n );\n};\n", "import { ComponentChild } from 'preact'\nimport type { SharedProps } from \"@bonniernews/dn-design-system-web/assets/types/shared-props.ts\";\nimport { ImageCaption } from '../../components/image-caption/image-caption'\nimport { formatClassString } from '../../helpers/formatClassString'\n\nexport interface ArticleImageProps extends SharedProps {\n image: ComponentChild\n caption?: string\n author?: string\n imageType?: string\n fullWidth?: boolean\n forcePx?: boolean\n}\n\nexport const ArticleImage = ({\n image,\n caption = '',\n author = '',\n imageType = '',\n fullWidth,\n forcePx,\n classNames,\n attributes,\n}: ArticleImageProps) => {\n const componentClassName = 'ds-article-image'\n const classes = formatClassString([componentClassName, forcePx && 'ds-force-px', classNames])\n const showCaption = !!caption || !!author\n\n return (\n <figure className={classes} {...attributes}>\n {fullWidth ? (\n <div className='ds-full-width-element'>{image}</div>\n ) : (\n image\n )}\n {showCaption && <ImageCaption caption={caption} author={author} imageType={imageType} forcePx={forcePx} />}\n </figure>\n )\n}\n", "import { ArticleImage, ArticleImageProps } from '../../assets/article-image/article-image'\nimport { formatClassString } from '../../helpers/formatClassString'\n\n/**\n * - GitHub: [BonnierNews/dn-design-system/../web/src/components/article-body-image](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/article-body-image)\n * - Storybook: [ArticleBodyImage](https://designsystem.dn.se/?path=/docs/article-articlebodyimage--docs)\n *\n * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:\n * `@use '@bonniernews/dn-design-system-web/components/article-body-image/article-body-image.scss'`\n */\nexport const ArticleBodyImage = ({\n image,\n caption = '',\n author = '',\n imageType = '',\n fullWidth,\n forcePx,\n classNames,\n attributes,\n}: ArticleImageProps) => {\n const componentClassName = 'ds-article-image--body'\n const classes = formatClassString([componentClassName, classNames])\n\n return (\n <ArticleImage\n image={image}\n caption={caption}\n author={author}\n imageType={imageType}\n fullWidth={fullWidth}\n forcePx={forcePx}\n classNames={classes}\n attributes={attributes}\n />\n )\n}\n"],
|
|
5
|
+
"mappings": ";AAAO,IAAM,oBAAoB,CAAC,iBAAqD;AACrF,SAAO,aAAa,OAAO,OAAK,CAAC,CAAC,CAAC,EAAE,KAAK,GAAG;AAC/C;;;ACoCI,SAEc,KAFd;AAjBG,IAAM,eAAe,CAAC,EAAC,SAAS,QAAQ,WAAW,YAAY,YAAY,QAAO,MAAyB;AAChH,QAAM,UAAU,kBAAkB;AAAA,IAChC;AAAA,IACA,WAAW;AAAA,IACX;AAAA,EACF,CAAC;AAED,QAAM,aAAa,aAAa,SAAS,GAAG,UAAU,OAAO,CAAC,EAAE,YAAY,IAAI,UAAU,MAAM,CAAC,CAAC,KAAK,MAAM,KAAK;AAElH,QAAM,gBAAgB;AAAA,IACpB;AAAA,IACA,cAAc,WAAW,UAAU,MAAM,WAAW,SAAS,KACzD,gDAAgD,cAAc,WAAW,SAAS,KAClF,sCAAsC;AAAA,EAC5C,EAAE,OAAO,OAAO,EAAE,KAAK,GAAG;AAE1B,SACE,qBAAC,gBAAW,WAAW,SAAS,eAAY,QAAQ,GAAG,YAEpD;AAAA,eAAW,oBAAC,UAAM,mBAAQ;AAAA,IAAQ;AAAA,IAAE,cAAc,oBAAC,UAAK,WAAW,eAAgB,sBAAW;AAAA,KACjG;AAEJ;;;ACdI,SAEI,OAAAA,MAFJ,QAAAC,aAAA;AAfG,IAAM,eAAe,CAAC;AAAA,EAC3B;AAAA,EACA,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyB;AACvB,QAAM,qBAAqB;AAC3B,QAAM,UAAU,kBAAkB,CAAC,oBAAoB,WAAW,eAAe,UAAU,CAAC;AAC5F,QAAM,cAAc,CAAC,CAAC,WAAW,CAAC,CAAC;AAEnC,SACE,gBAAAA,MAAC,YAAO,WAAW,SAAU,GAAG,YAC7B;AAAA,gBACC,gBAAAD,KAAC,SAAI,WAAU,yBAAyB,iBAAM,IAE9C;AAAA,IAED,eAAe,gBAAAA,KAAC,gBAAa,SAAkB,QAAgB,WAAsB,SAAkB;AAAA,KAC1G;AAEJ;;;ACdI,gBAAAE,YAAA;AAdG,IAAM,mBAAmB,CAAC;AAAA,EAC/B;AAAA,EACA,UAAU;AAAA,EACV,SAAS;AAAA,EACT,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAyB;AACvB,QAAM,qBAAqB;AAC3B,QAAM,UAAU,kBAAkB,CAAC,oBAAoB,UAAU,CAAC;AAElE,SACE,gBAAAA;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,YAAY;AAAA,MACZ;AAAA;AAAA,EACF;AAEJ;",
|
|
6
6
|
"names": ["jsx", "jsxs", "jsx"]
|
|
7
7
|
}
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import type { SharedProps } from "@bonniernews/dn-design-system-web/assets/types/shared-props.ts";
|
|
2
|
+
export interface BlockedContentProps extends SharedProps {
|
|
2
3
|
title: string;
|
|
3
4
|
body: string;
|
|
4
5
|
link: string;
|
|
5
6
|
forcePx?: boolean;
|
|
6
|
-
classNames?: string;
|
|
7
|
-
attributes?: object;
|
|
8
7
|
elementAttributes?: {
|
|
9
8
|
[key: string]: string;
|
|
10
9
|
};
|