@bonniernews/dn-design-system-web 32.7.48 → 33.0.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 +11 -0
- package/assets/types/teaser-props.ts +46 -27
- package/components/factbox/README.md +1 -1
- package/components/quote/README.md +1 -1
- package/components/tag-header/README.md +1 -1
- package/components/teaser-card/README.md +3 -3
- package/components/teaser-centered/README.md +6 -6
- package/components/teaser-counter/README.md +3 -3
- package/components/teaser-footer/README.md +5 -5
- package/components/teaser-list-swipe/README.md +2 -3
- package/components/teaser-list-vertical/README.md +1 -1
- package/components/teaser-longlife/README.md +3 -4
- package/components/teaser-onsite/README.md +5 -5
- package/components/teaser-package/README.md +2 -2
- package/components/teaser-right-now/README.md +5 -4
- package/components/teaser-slideshow/README.md +5 -5
- package/components/teaser-split/README.md +37 -0
- package/components/teaser-split/teaser-split.scss +2 -2
- package/components/teaser-split-container/README.md +44 -0
- package/components/teaser-standard/README.md +13 -16
- package/components/teaser-swipe-card/README.md +8 -20
- package/components/teaser-text-on-image/README.md +4 -5
- package/components/teaser-text-on-image/teaser-text-on-image.njk +1 -1
- package/components/teaser-text-on-image/teaser-text-on-image.scss +0 -4
- package/components/teaser-tipsa/README.md +3 -3
- package/package.json +1 -1
- package/preact/components/teaser-card/teaser-card.d.ts +5 -2
- package/preact/components/teaser-card/teaser-card.js.map +2 -2
- package/preact/components/teaser-centered/teaser-centered.d.ts +3 -4
- package/preact/components/teaser-centered/teaser-centered.js +5 -5
- package/preact/components/teaser-centered/teaser-centered.js.map +2 -2
- package/preact/components/teaser-counter/teaser-counter.d.ts +3 -3
- package/preact/components/teaser-counter/teaser-counter.js +2 -2
- package/preact/components/teaser-counter/teaser-counter.js.map +2 -2
- package/preact/components/teaser-footer/teaser-footer.d.ts +5 -9
- package/preact/components/teaser-footer/teaser-footer.js +5 -5
- package/preact/components/teaser-footer/teaser-footer.js.map +2 -2
- package/preact/components/teaser-large/teaser-large.d.ts +7 -2
- package/preact/components/teaser-large/teaser-large.js +20 -12
- package/preact/components/teaser-large/teaser-large.js.map +2 -2
- package/preact/components/teaser-list-swipe/teaser-list-swipe.d.ts +5 -8
- package/preact/components/teaser-list-swipe/teaser-list-swipe.js +1 -2
- package/preact/components/teaser-list-swipe/teaser-list-swipe.js.map +2 -2
- package/preact/components/teaser-list-vertical/teaser-list-vertical.d.ts +3 -2
- package/preact/components/teaser-list-vertical/teaser-list-vertical.js +6 -6
- package/preact/components/teaser-list-vertical/teaser-list-vertical.js.map +2 -2
- package/preact/components/teaser-longlife/teaser-longlife.d.ts +2 -2
- package/preact/components/teaser-longlife/teaser-longlife.js +2 -2
- package/preact/components/teaser-longlife/teaser-longlife.js.map +2 -2
- package/preact/components/teaser-native/teaser-native.d.ts +2 -3
- package/preact/components/teaser-native/teaser-native.js +5 -11
- package/preact/components/teaser-native/teaser-native.js.map +2 -2
- package/preact/components/teaser-onsite/teaser-onsite.d.ts +2 -3
- package/preact/components/teaser-onsite/teaser-onsite.js +3 -3
- package/preact/components/teaser-onsite/teaser-onsite.js.map +2 -2
- package/preact/components/teaser-package/teaser-package.d.ts +3 -3
- package/preact/components/teaser-package/teaser-package.js +9 -7
- package/preact/components/teaser-package/teaser-package.js.map +2 -2
- package/preact/components/teaser-right-now/teaser-right-now.d.ts +2 -3
- package/preact/components/teaser-right-now/teaser-right-now.js +1 -1
- package/preact/components/teaser-right-now/teaser-right-now.js.map +2 -2
- package/preact/components/teaser-slideshow/teaser-slideshow.d.ts +2 -4
- package/preact/components/teaser-slideshow/teaser-slideshow.js +3 -9
- package/preact/components/teaser-slideshow/teaser-slideshow.js.map +2 -2
- package/preact/components/teaser-split/teaser-split.d.ts +7 -11
- package/preact/components/teaser-split/teaser-split.js +10 -27
- package/preact/components/teaser-split/teaser-split.js.map +2 -2
- package/preact/components/teaser-split-container/teaser-split-container.d.ts +12 -0
- package/preact/components/teaser-split-container/teaser-split-container.js +186 -0
- package/preact/components/teaser-split-container/teaser-split-container.js.map +7 -0
- package/preact/components/teaser-standard/teaser-standard.d.ts +5 -2
- package/preact/components/teaser-standard/teaser-standard.js +20 -12
- package/preact/components/teaser-standard/teaser-standard.js.map +2 -2
- package/preact/components/teaser-swipe-card/teaser-swipe-card.d.ts +3 -2
- package/preact/components/teaser-swipe-card/teaser-swipe-card.js.map +2 -2
- package/preact/components/teaser-text-on-image/teaser-text-on-image.d.ts +3 -4
- package/preact/components/teaser-text-on-image/teaser-text-on-image.js +5 -6
- package/preact/components/teaser-text-on-image/teaser-text-on-image.js.map +2 -2
- package/preact/components/teaser-tipsa/teaser-tipsa.d.ts +2 -4
- package/preact/components/teaser-tipsa/teaser-tipsa.js +3 -10
- package/preact/components/teaser-tipsa/teaser-tipsa.js.map +2 -2
- /package/components/{teaser-split → teaser-split-container}/README-container-njk.md +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [33.0.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.48...@bonniernews/dn-design-system-web@33.0.0) (2025-08-20)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* **web:** teaser-props-cleanup (#1866)
|
|
13
|
+
|
|
14
|
+
### Maintenance
|
|
15
|
+
|
|
16
|
+
* **web:** teaser-props-cleanup ([#1866](https://github.com/BonnierNews/dn-design-system/issues/1866)) ([6eecff4](https://github.com/BonnierNews/dn-design-system/commit/6eecff413b68c40ff0d530e6ddd7eb5fe67d0d49))
|
|
17
|
+
|
|
7
18
|
## [32.7.48](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.47...@bonniernews/dn-design-system-web@32.7.48) (2025-08-18)
|
|
8
19
|
|
|
9
20
|
|
|
@@ -1,46 +1,65 @@
|
|
|
1
1
|
import { ComponentChild } from 'preact'
|
|
2
2
|
|
|
3
|
-
import type {
|
|
3
|
+
import type { TeaserCardProps } from '@bonniernews/dn-design-system-web/components/teaser-card/teaser-card.tsx'
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import { SharedProps } from './shared-props'
|
|
6
|
+
|
|
7
|
+
export interface TeaserBaseProps extends TeaserTitleProps, Omit<TeaserCardProps, 'children' | 'theme'> {}
|
|
8
|
+
|
|
9
|
+
export interface TeaserTitleProps {
|
|
6
10
|
/** Heading of the teaser */
|
|
7
11
|
title: string
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
areaType?: 'right' | 'bauta' | 'main'
|
|
14
|
-
/** The theme-class to apply to the teaser */
|
|
15
|
-
theme?: 'nyheter' | 'kultur'
|
|
16
|
-
/** Teaser subtext */
|
|
17
|
-
text?: string
|
|
18
|
-
/** Top text in the teaser */
|
|
19
|
-
vignette?: string
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface TeaserThemeProps extends Pick<TeaserCardProps, 'theme'> {}
|
|
15
|
+
|
|
16
|
+
export interface TeaserHighlightProps {
|
|
20
17
|
/** Text before the heading */
|
|
21
18
|
highlight?: string
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface TeaserItalicHeadlineProps {
|
|
22
|
+
/** If the headline should be italic */
|
|
23
|
+
isItalicHeadline?: boolean
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface TeaserVignetteProps {
|
|
27
|
+
/** Top text in the teaser */
|
|
28
|
+
vignette?: string
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
export interface TeaserVariantProps {
|
|
32
|
+
/** Variant of the teaser */
|
|
33
|
+
variant?: 'default' | 'podcast' | 'direkt' | 'insandare'
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface TeaserMediaProps {
|
|
24
37
|
/** Main image or other media */
|
|
25
38
|
media?: ComponentChild
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface TeaserBylineProps {
|
|
42
|
+
/** Byline image */
|
|
29
43
|
bylinePicture?: ComponentChild
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface TeaserTextProps {
|
|
47
|
+
/** Teaser subtext */
|
|
48
|
+
text?: string
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export interface TeaserBodyDecoratorsProps {
|
|
52
|
+
/** Red text before the text */
|
|
53
|
+
sticker?: string
|
|
34
54
|
/** If there should be a flashing ball before the text */
|
|
35
55
|
isFlashingDot?: boolean
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export interface TeaserFooterProps extends SharedProps {
|
|
36
59
|
/** Publication time text */
|
|
37
60
|
publicationTime?: string
|
|
38
61
|
/** Duration of podcast */
|
|
39
62
|
duration?: string
|
|
40
|
-
/** Byline aspect ratio */
|
|
41
|
-
bylineAspectRatio?: string
|
|
42
|
-
/** Byline HTML */
|
|
43
|
-
bylineHtml?: string
|
|
44
63
|
/** Shows in teaser footer */
|
|
45
64
|
sectionName?: string
|
|
46
65
|
}
|
|
@@ -12,7 +12,7 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
12
12
|
| titleHighlight | string | \- |
|
|
13
13
|
| titleImage | ComponentChild | \- |
|
|
14
14
|
| bodyParts\* | BodyPart\[\] | \- |
|
|
15
|
-
| theme | "
|
|
15
|
+
| theme | "kultur", "nyheter", "default" | \- |
|
|
16
16
|
| forceExpand | boolean | false |
|
|
17
17
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
18
18
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
@@ -9,7 +9,7 @@ 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
|
-
| theme | "
|
|
12
|
+
| theme | "kultur", "nyheter" | "nyheter" |
|
|
13
13
|
| forcePx | boolean | \- |
|
|
14
14
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
15
15
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
@@ -14,7 +14,7 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
14
14
|
| media | Main image<br />ComponentChild | \- |
|
|
15
15
|
| descriptionHtml | Intended use is text, links<br />string | \- |
|
|
16
16
|
| articleCount | Total articles on this list-page<br />number | \- |
|
|
17
|
-
| theme | The theme-class to apply to the vignette<br />"
|
|
17
|
+
| theme | The theme-class to apply to the vignette<br />"kultur", "nyheter" | \- |
|
|
18
18
|
| toggle | Show/hide toggle button<br />boolean | false |
|
|
19
19
|
| toggleText | `text` parameter to ToggleButton (only if `toggle` is enabled)<br />string | \- |
|
|
20
20
|
| toggleSelectedText | `selectedText` parameter to ToggleButton (only if `toggle` is enabled)<br />string | \- |
|
|
@@ -8,9 +8,9 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
8
8
|
|
|
9
9
|
| Name | Description | Default |
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
|
-
| areaType | "
|
|
12
|
-
| targetLink | string | \- |
|
|
13
|
-
| theme | "
|
|
11
|
+
| areaType | The area where the column is rendered<br />"main", "right", "bauta" | \- |
|
|
12
|
+
| targetLink | Target URL for the teaser<br />string | \- |
|
|
13
|
+
| theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | "nyheter" |
|
|
14
14
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
15
15
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
16
16
|
|
|
@@ -8,16 +8,16 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
8
8
|
|
|
9
9
|
| Name | Description | Default |
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
|
+
| areaType | The area where the column is rendered<br />"main", "bauta" | \- |
|
|
12
|
+
| title\* | Heading of the teaser<br />string | \- |
|
|
13
|
+
| targetLink | Target URL for the teaser<br />string | \- |
|
|
11
14
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
12
15
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
| title\* | Heading of the teaser<br />string | \- |
|
|
16
|
-
| text | Teaser subtext<br />string | \- |
|
|
16
|
+
| theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | "nyheter" |
|
|
17
|
+
| highlight | Text before the heading<br />string | \- |
|
|
17
18
|
| vignette | Top text in the teaser<br />string | \- |
|
|
18
19
|
| media | Main image or other media<br />ComponentChild | \- |
|
|
19
|
-
|
|
|
20
|
-
| theme | The theme-class to apply to the teaser<br />"nyheter", "kultur" | "nyheter" |
|
|
20
|
+
| text | Teaser subtext<br />string | \- |
|
|
21
21
|
|
|
22
22
|
```jsx
|
|
23
23
|
<TeaserCentered
|
|
@@ -8,14 +8,14 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
8
8
|
|
|
9
9
|
| Name | Description | Default |
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
|
+
| areaType | The area where the column is rendered<br />"main", "bauta" | \- |
|
|
11
12
|
| counterText\* | string | \- |
|
|
12
13
|
| counterNumber\* | number | \- |
|
|
13
14
|
| subtitle | string | \- |
|
|
15
|
+
| title\* | Heading of the teaser<br />string | \- |
|
|
16
|
+
| targetLink | Target URL for the teaser<br />string | \- |
|
|
14
17
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
15
18
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
16
|
-
| targetLink\* | Target URL for the teaser<br />string | \- |
|
|
17
|
-
| areaType | The area where the column is rendered<br />"right", "bauta", "main" | \- |
|
|
18
|
-
| title\* | Heading of the teaser<br />string | \- |
|
|
19
19
|
| media | Main image or other media<br />ComponentChild | \- |
|
|
20
20
|
|
|
21
21
|
```jsx
|
|
@@ -6,17 +6,17 @@ TeaserFooter
|
|
|
6
6
|
|
|
7
7
|
| Name | Description | Default |
|
|
8
8
|
|:--- | :--- | :--- |
|
|
9
|
-
|
|
|
10
|
-
| publicationTime | string | \- |
|
|
11
|
-
|
|
|
12
|
-
|
|
|
9
|
+
| footerVariant | "default", "podcast", "informationText" | \- |
|
|
10
|
+
| publicationTime | Publication time text<br />string | \- |
|
|
11
|
+
| duration | Duration of podcast<br />string | \- |
|
|
12
|
+
| sectionName | Shows in teaser footer<br />string | \- |
|
|
13
13
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
14
14
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
15
15
|
|
|
16
16
|
```jsx
|
|
17
17
|
<TeaserFooter
|
|
18
|
+
footerVariant="informationText"
|
|
18
19
|
publicationTime="10:15"
|
|
19
20
|
sectionName="Nyheter"
|
|
20
|
-
variant="informationText"
|
|
21
21
|
/>
|
|
22
22
|
```
|
|
@@ -8,11 +8,10 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
8
8
|
|
|
9
9
|
| Name | Description | Default |
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
|
-
| title\* |
|
|
11
|
+
| title\* | The header of the teaser list<br />string | \- |
|
|
12
|
+
| areaType | The area where the column is rendered<br />"main", "bauta" | \- |
|
|
12
13
|
| titleHref | Target URL for the header<br />string | \- |
|
|
13
|
-
| areaType | The area where the column is rendered<br />"right", "bauta", "main" | \- |
|
|
14
14
|
| arrowPosition | Determines where the scroll arrows are rendered<br />"floating", "header" | "header" |
|
|
15
|
-
| theme | The theme-class to apply to the teaser<br />"nyheter", "kultur" | \- |
|
|
16
15
|
| teasers | A list of arguments to TeaserSwipeCard<br />TeaserSwipeCardProps\[\] | \[\] |
|
|
17
16
|
| groupHeaderType | Type of group header<br />"link", "icon", "toggle", "arrows" | \- |
|
|
18
17
|
| groupHeaderToggleText | Text in toggle button<br />string | \- |
|
|
@@ -12,7 +12,7 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
12
12
|
| listLink | Ex. { text: "Alla nyheter", url: "#" }<br />ListLink | \- |
|
|
13
13
|
| flexible | If true, the list will be flexible<br />boolean | false |
|
|
14
14
|
| teasers\* | Array with teaser objects. Ex. \[ { title: 'Malmö var det enda rimliga valet för Eurovision', targetLink: '#', highlight: 'Hanna Fahl:', publicationTime: 'I GÅR 12:28', sectionName: 'Kultur', attributes: { "data-test": "list-item-test-data" }, showPlayButton: false } \]<br />ListTeaser\[\] | \- |
|
|
15
|
-
| theme | The theme-class to apply to _all_ teasers in the list.<br />"
|
|
15
|
+
| theme | The theme-class to apply to _all_ teasers in the list.<br />"kultur", "nyheter" | \- |
|
|
16
16
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
17
17
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
|
|
18
18
|
|
|
@@ -8,13 +8,12 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
8
8
|
|
|
9
9
|
| Name | Description | Default |
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
|
-
| targetLink
|
|
12
|
-
| title\* | Heading of the teaser<br />string | \- |
|
|
11
|
+
| targetLink | Target URL for the teaser<br />string | \- |
|
|
13
12
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
14
13
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
15
|
-
|
|
|
14
|
+
| title\* | Heading of the teaser<br />string | \- |
|
|
16
15
|
| media | Main image or other media<br />ComponentChild | \- |
|
|
17
|
-
|
|
|
16
|
+
| vignette | Top text in the teaser<br />string | \- |
|
|
18
17
|
|
|
19
18
|
```jsx
|
|
20
19
|
<TeaserLonglife
|
|
@@ -12,14 +12,14 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
12
12
|
|
|
13
13
|
| Name | Description | Default |
|
|
14
14
|
|:--- | :--- | :--- |
|
|
15
|
+
| title\* | Heading of the teaser<br />string | \- |
|
|
16
|
+
| targetLink | Target URL for the teaser<br />string | \- |
|
|
17
|
+
| areaType | The area where the column is rendered<br />"main", "right", "bauta" | \- |
|
|
15
18
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
16
19
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
17
|
-
|
|
|
18
|
-
| areaType | The area where the column is rendered<br />"right", "bauta", "main" | \- |
|
|
19
|
-
| title\* | Heading of the teaser<br />string | \- |
|
|
20
|
-
| text | Teaser subtext<br />string | \- |
|
|
20
|
+
| theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | "nyheter" |
|
|
21
21
|
| media | Main image or other media<br />ComponentChild | \- |
|
|
22
|
-
|
|
|
22
|
+
| text | Teaser subtext<br />string | \- |
|
|
23
23
|
|
|
24
24
|
```jsx
|
|
25
25
|
<TeaserOnSite
|
|
@@ -16,14 +16,14 @@ If you **only** want to include the styles for the teaser package, you can do so
|
|
|
16
16
|
|
|
17
17
|
| Name | Description | Default |
|
|
18
18
|
|:--- | :--- | :--- |
|
|
19
|
-
| areaType | "
|
|
19
|
+
| areaType | The area where the column is rendered<br />"main", "bauta" | \- |
|
|
20
20
|
| vignetteText | string | \- |
|
|
21
21
|
| vignetteTargetUrl | string | \- |
|
|
22
22
|
| vignetteIcon | ComponentChild | \- |
|
|
23
23
|
| teasers | ComponentChild | \- |
|
|
24
24
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
25
25
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
|
|
26
|
-
| theme | The theme-class to apply to the teaser<br />"
|
|
26
|
+
| theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | \- |
|
|
27
27
|
|
|
28
28
|
```jsx
|
|
29
29
|
<TeaserPackage
|
|
@@ -8,12 +8,13 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
8
8
|
|
|
9
9
|
| Name | Description | Default |
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
|
+
| title\* | Heading of the teaser<br />string | \- |
|
|
12
|
+
| targetLink | Target URL for the teaser<br />string | \- |
|
|
13
|
+
| areaType | The area where the column is rendered<br />"main", "right", "bauta" | \- |
|
|
11
14
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
12
15
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
| title\* | Heading of the teaser<br />string | \- |
|
|
16
|
-
| theme | The theme-class to apply to the teaser<br />"nyheter", "kultur" | "nyheter" |
|
|
16
|
+
| theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | "nyheter" |
|
|
17
|
+
| highlight | Text before the heading<br />string | \- |
|
|
17
18
|
|
|
18
19
|
```jsx
|
|
19
20
|
<TeaserRightNow
|
|
@@ -8,14 +8,14 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
8
8
|
|
|
9
9
|
| Name | Description | Default |
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
|
+
| title\* | Heading of the teaser<br />string | \- |
|
|
12
|
+
| targetLink | Target URL for the teaser<br />string | \- |
|
|
13
|
+
| areaType | The area where the column is rendered<br />"main", "right", "bauta" | \- |
|
|
11
14
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
12
15
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
|
|
13
|
-
|
|
|
14
|
-
| targetLink | string | \- |
|
|
15
|
-
| theme | "nyheter", "kultur" | \- |
|
|
16
|
-
| title\* | Heading of the teaser<br />string | \- |
|
|
17
|
-
| text | Teaser subtext<br />string | \- |
|
|
16
|
+
| theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | \- |
|
|
18
17
|
| media | Main image or other media<br />ComponentChild | \- |
|
|
18
|
+
| text | Teaser subtext<br />string | \- |
|
|
19
19
|
|
|
20
20
|
```jsx
|
|
21
21
|
<TeaserSlideshow
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
TeaserSplit
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
* GitHub: [BonnierNews/dn-design-system/web/src/components/teaser-split](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-split)
|
|
5
|
+
* Storybook: [TeaserSplit](https://designsystem.dn.se/?path=/docs/section-teasersplit--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/teaser-split/teaser-split.scss'`
|
|
8
|
+
|
|
9
|
+
| Name | Description | Default |
|
|
10
|
+
|:--- | :--- | :--- |
|
|
11
|
+
| title\* | Heading of the teaser<br />string | \- |
|
|
12
|
+
| areaType | The area where the column is rendered<br />"main", "bauta" | \- |
|
|
13
|
+
| variant | Variant of the teaser<br />"default", "podcast" | \- |
|
|
14
|
+
| targetLink | Target URL for the teaser<br />string | \- |
|
|
15
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
16
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
|
|
17
|
+
| theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | \- |
|
|
18
|
+
| highlight | Text before the heading<br />string | \- |
|
|
19
|
+
| vignette | Top text in the teaser<br />string | \- |
|
|
20
|
+
| media | Main image or other media<br />ComponentChild | \- |
|
|
21
|
+
| text | Teaser subtext<br />string | \- |
|
|
22
|
+
| sticker | Red text before the text<br />string | \- |
|
|
23
|
+
| isFlashingDot | If there should be a flashing ball before the text<br />boolean | \- |
|
|
24
|
+
| publicationTime | Publication time text<br />string | \- |
|
|
25
|
+
| duration | Duration of podcast<br />string | \- |
|
|
26
|
+
| sectionName | Shows in teaser footer<br />string | \- |
|
|
27
|
+
|
|
28
|
+
```jsx
|
|
29
|
+
<TeaserSplit
|
|
30
|
+
isFlashingDot
|
|
31
|
+
media={<TeaserImage byline="Foto: Pavel Bednyakov/Sputnik/AFP" image={<ExamplePicture alt="" className="picture picture--placeholder" src="https://cached-images.bonnier.news/gcs/bilder-lab/dn-mly/fd0abe35-9282-46ed-addc-8af0e471db74.jpeg" style={{aspectRatio: '16 / 9'}}/>}/>}
|
|
32
|
+
sticker="Live"
|
|
33
|
+
targetLink="https://www.dn.se/sverige/ryska-militarflyg-over-ostersjon/"
|
|
34
|
+
text="Flög utan transpondrar • Upptäcktes av tyska flygvapnet."
|
|
35
|
+
title="Ryska militärflyg över Östersjön"
|
|
36
|
+
/>
|
|
37
|
+
```
|
|
@@ -25,8 +25,9 @@
|
|
|
25
25
|
&.ds-split-container--bauta {
|
|
26
26
|
background-color: $ds-color-surface-breaking;
|
|
27
27
|
}
|
|
28
|
+
}
|
|
28
29
|
|
|
29
|
-
|
|
30
|
+
.ds-teaser--split {
|
|
30
31
|
box-sizing: content-box;
|
|
31
32
|
display: block;
|
|
32
33
|
position: relative;
|
|
@@ -99,4 +100,3 @@
|
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
|
-
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
TeaserSplitContainer
|
|
2
|
+
====================
|
|
3
|
+
|
|
4
|
+
* GitHub: [BonnierNews/dn-design-system/web/src/components/teaser-split](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-split-container)
|
|
5
|
+
* Storybook: [TeaserSplit](https://designsystem.dn.se/?path=/docs/section-teasersplit-teasersplitcontainer--docs)
|
|
6
|
+
|
|
7
|
+
| Name | Description | Default |
|
|
8
|
+
|:--- | :--- | :--- |
|
|
9
|
+
| areaType | The area where the column is rendered<br />"main", "bauta" | \- |
|
|
10
|
+
| teasers\* | TeaserSplitProps\[\] | \- |
|
|
11
|
+
| targetLink | Target URL for the teaser<br />string | \- |
|
|
12
|
+
| theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | \- |
|
|
13
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
14
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
15
|
+
|
|
16
|
+
```jsx
|
|
17
|
+
<TeaserSplitContainer
|
|
18
|
+
teasers={[
|
|
19
|
+
{
|
|
20
|
+
highlight: undefined,
|
|
21
|
+
media: <TeaserImage byline="Foto: Lars Schröder/TT" image={<ExamplePicture alt="" className="picture picture--placeholder" src="https://cached-images.bonnier.news/gcs/bilder-lab/dn-mly/9371897d-7150-4343-bc53-e6d37e25774a.jpeg" style={{aspectRatio: '16 / 9'}}/>}/>,
|
|
22
|
+
sticker: undefined,
|
|
23
|
+
targetLink: 'https://www.dn.se/kultur/omar-souleyman-far-dansgolvet-att-koka/',
|
|
24
|
+
text: 'Hans gubbtafatta dansrörelser är minst sagt älskvärda, skriver Saga Cavallin.',
|
|
25
|
+
theme: 'kultur',
|
|
26
|
+
title: 'Omar Souleyman får dansgolvet på Kulturhuset att koka',
|
|
27
|
+
variant: undefined,
|
|
28
|
+
vignette: 'MUSIK | RECENSION'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
highlight: undefined,
|
|
32
|
+
isFlashingDot: true,
|
|
33
|
+
media: <TeaserImage byline="Foto: Pavel Bednyakov/Sputnik/AFP" image={<ExamplePicture alt="" className="picture picture--placeholder" src="https://cached-images.bonnier.news/gcs/bilder-lab/dn-mly/fd0abe35-9282-46ed-addc-8af0e471db74.jpeg" style={{aspectRatio: '16 / 9'}}/>}/>,
|
|
34
|
+
sticker: 'Live',
|
|
35
|
+
targetLink: 'https://www.dn.se/sverige/ryska-militarflyg-over-ostersjon/',
|
|
36
|
+
text: 'Flög utan transpondrar • Upptäcktes av tyska flygvapnet.',
|
|
37
|
+
theme: undefined,
|
|
38
|
+
title: 'Ryska militärflyg över Östersjön',
|
|
39
|
+
variant: undefined,
|
|
40
|
+
vignette: undefined
|
|
41
|
+
}
|
|
42
|
+
]}
|
|
43
|
+
/>
|
|
44
|
+
```
|
|
@@ -25,29 +25,26 @@ const teaserStandardHtml = dsTeaserStandard(parameters);
|
|
|
25
25
|
|
|
26
26
|
| Name | Description | Default |
|
|
27
27
|
|:--- | :--- | :--- |
|
|
28
|
-
|
|
|
29
|
-
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
|
|
30
|
-
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
28
|
+
| isItalicHeadline | If the headline should be italic<br />boolean | \- |
|
|
31
29
|
| sectionName | Shows in teaser footer<br />string | \- |
|
|
32
|
-
| bylineHtml | Byline HTML<br />string | \- |
|
|
33
|
-
| bylineAspectRatio | Byline aspect ratio<br />string | \- |
|
|
34
30
|
| duration | Duration of podcast<br />string | \- |
|
|
35
31
|
| publicationTime | Publication time text<br />string | \- |
|
|
36
32
|
| isFlashingDot | If there should be a flashing ball before the text<br />boolean | false |
|
|
37
|
-
| isLargeHeadline | If the headline should be large (only if `isItalicHeadline` is true)<br />boolean | \- |
|
|
38
|
-
| isItalicHeadline | If the headline should be italic<br />boolean | \- |
|
|
39
|
-
| bylinePicture | Image of the author<br />ComponentChild | \- |
|
|
40
|
-
| isCompact | If the teaser should be compact<br />boolean | \- |
|
|
41
|
-
| media | Main image or other media<br />ComponentChild | \- |
|
|
42
33
|
| sticker | Red text before the text<br />string | \- |
|
|
43
|
-
| highlight | Text before the heading<br />string | \- |
|
|
44
|
-
| vignette | Top text in the teaser<br />string | \- |
|
|
45
34
|
| text | Teaser subtext<br />string | \- |
|
|
46
|
-
|
|
|
47
|
-
|
|
|
48
|
-
|
|
|
49
|
-
|
|
|
35
|
+
| bylinePicture | Byline image<br />ComponentChild | \- |
|
|
36
|
+
| media | Main image or other media<br />ComponentChild | \- |
|
|
37
|
+
| vignette | Top text in the teaser<br />string | \- |
|
|
38
|
+
| isCompact | If the teaser should be compact<br />boolean | \- |
|
|
39
|
+
| highlight | Text before the heading<br />string | \- |
|
|
40
|
+
| theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | \- |
|
|
41
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
|
|
42
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
43
|
+
| areaType | The area where the column is rendered<br />"main", "right", "bauta" | \- |
|
|
44
|
+
| targetLink | Target URL for the teaser<br />string | \- |
|
|
50
45
|
| title\* | Heading of the teaser<br />string | \- |
|
|
46
|
+
| isSquareImage | Flag so we can handle square teaser images<br />boolean | false |
|
|
47
|
+
| variant | Variant of the teaser<br />"default", "podcast" | \- |
|
|
51
48
|
|
|
52
49
|
```jsx
|
|
53
50
|
<TeaserStandard
|
|
@@ -8,29 +8,17 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
8
8
|
|
|
9
9
|
| Name | Description | Default |
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
|
-
|
|
|
12
|
-
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
13
|
-
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
14
|
-
| sectionName | Shows in teaser footer<br />string | \- |
|
|
15
|
-
| bylineHtml | Byline HTML<br />string | \- |
|
|
16
|
-
| bylineAspectRatio | Byline aspect ratio<br />string | \- |
|
|
17
|
-
| duration | Duration of podcast<br />string | \- |
|
|
18
|
-
| publicationTime | Publication time text<br />string | \- |
|
|
19
|
-
| isFlashingDot | If there should be a flashing ball before the text<br />boolean | \- |
|
|
20
|
-
| isLargeHeadline | If the headline should be large (only if `isItalicHeadline` is true)<br />boolean | \- |
|
|
21
|
-
| isItalicHeadline | If the headline should be italic<br />boolean | \- |
|
|
22
|
-
| bylinePicture | Image of the author<br />ComponentChild | \- |
|
|
11
|
+
| variant | Variant of the teaser<br />"default", "insandare", "direkt" | \- |
|
|
23
12
|
| time | The timestamp text of the teaser<br />string | \- |
|
|
24
|
-
|
|
|
25
|
-
|
|
|
13
|
+
| title\* | Heading of the teaser<br />string | \- |
|
|
14
|
+
| targetLink | Target URL for the teaser<br />string | \- |
|
|
15
|
+
| areaType | The area where the column is rendered<br />"main", "right", "bauta" | \- |
|
|
16
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
17
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
18
|
+
| theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | \- |
|
|
26
19
|
| highlight | Text before the heading<br />string | \- |
|
|
20
|
+
| media | Main image or other media<br />ComponentChild | \- |
|
|
27
21
|
| vignette | Top text in the teaser<br />string | \- |
|
|
28
|
-
| text | Teaser subtext<br />string | \- |
|
|
29
|
-
| theme | The theme-class to apply to the teaser<br />"nyheter", "kultur" | \- |
|
|
30
|
-
| areaType | The area where the column is rendered<br />"right", "bauta", "main" | \- |
|
|
31
|
-
| variant | Variant of the teaser<br />"default", "podcast", "insandare", "direkt" | \- |
|
|
32
|
-
| targetLink\* | Target URL for the teaser<br />string | \- |
|
|
33
|
-
| title\* | Heading of the teaser<br />string | \- |
|
|
34
22
|
|
|
35
23
|
```jsx
|
|
36
24
|
<TeaserSwipeCard
|
|
@@ -8,15 +8,14 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
8
8
|
|
|
9
9
|
| Name | Description | Default |
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
|
+
| title\* | Heading of the teaser<br />string | \- |
|
|
12
|
+
| targetLink | Target URL for the teaser<br />string | \- |
|
|
13
|
+
| areaType | The area where the column is rendered<br />"main", "right", "bauta" | \- |
|
|
11
14
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
12
15
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
13
|
-
| targetLink\* | Target URL for the teaser<br />string | \- |
|
|
14
|
-
| areaType | The area where the column is rendered<br />"right", "bauta", "main" | \- |
|
|
15
|
-
| title\* | Heading of the teaser<br />string | \- |
|
|
16
|
-
| text | Teaser subtext<br />string | \- |
|
|
17
16
|
| vignette | Top text in the teaser<br />string | \- |
|
|
18
17
|
| media | Main image or other media<br />ComponentChild | \- |
|
|
19
|
-
|
|
|
18
|
+
| text | Teaser subtext<br />string | \- |
|
|
20
19
|
|
|
21
20
|
```jsx
|
|
22
21
|
<TeaserTextOnImage
|
|
@@ -8,11 +8,11 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
8
8
|
|
|
9
9
|
| Name | Description | Default |
|
|
10
10
|
|:--- | :--- | :--- |
|
|
11
|
+
| title\* | Heading of the teaser<br />string | \- |
|
|
12
|
+
| targetLink | Target URL for the teaser<br />string | \- |
|
|
13
|
+
| areaType | The area where the column is rendered<br />"main", "right", "bauta" | \- |
|
|
11
14
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
12
15
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
|
|
13
|
-
| targetLink\* | Target URL for the teaser<br />string | \- |
|
|
14
|
-
| areaType | The area where the column is rendered<br />"right", "bauta", "main" | \- |
|
|
15
|
-
| title\* | Heading of the teaser<br />string | \- |
|
|
16
16
|
| text | Teaser subtext<br />string | \- |
|
|
17
17
|
|
|
18
18
|
```jsx
|
package/package.json
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import { ComponentChildren } from 'preact';
|
|
2
2
|
import type { SharedProps } from '@bonniernews/dn-design-system-web/assets/types/shared-props.ts';
|
|
3
|
-
export interface
|
|
3
|
+
export interface TeaserCardProps extends SharedProps {
|
|
4
|
+
/** The area where the column is rendered */
|
|
4
5
|
areaType?: 'main' | 'right' | 'bauta';
|
|
6
|
+
/** Target URL for the teaser */
|
|
5
7
|
targetLink?: string;
|
|
8
|
+
/** The theme-class to apply to the teaser */
|
|
6
9
|
theme?: 'kultur' | 'nyheter';
|
|
7
10
|
children?: ComponentChildren;
|
|
8
11
|
}
|
|
@@ -13,4 +16,4 @@ export interface TeaserCardsProps extends SharedProps {
|
|
|
13
16
|
* The component will not include styling by itself. Make sure to include the right styles for the component. See example below:
|
|
14
17
|
* `@use '@bonniernews/dn-design-system-web/assets/teaser/teaser.scss'`
|
|
15
18
|
*/
|
|
16
|
-
export declare const TeaserCard: ({ areaType, targetLink, theme, classNames, attributes, children, }:
|
|
19
|
+
export declare const TeaserCard: ({ areaType, targetLink, theme, classNames, attributes, children, }: TeaserCardProps) => import("preact").JSX.Element;
|