@bonniernews/dn-design-system-web 32.7.23 → 32.7.25
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/teaser-props.ts +44 -0
- package/components/group-header/README.md +1 -1
- package/components/tag-header/README-njk.md +52 -0
- package/components/tag-header/README.md +38 -52
- package/components/teaser-counter/README.md +5 -5
- package/components/teaser-counter/teaser-counter.njk +26 -24
- package/components/teaser-counter/teaser-counter.scss +2 -1
- package/components/teaser-footer/README.md +2 -2
- package/components/teaser-large/README-NJK.md +52 -0
- package/components/teaser-large/README.md +44 -52
- package/components/teaser-large/teaser-large.njk +1 -1
- package/components/teaser-onsite/README.md +7 -7
- package/package.json +1 -1
- package/preact/assets/types/teaser-props.d.ts +42 -0
- package/preact/components/tag-header/tag-header.d.ts +41 -0
- package/preact/components/tag-header/tag-header.js +250 -0
- package/preact/components/tag-header/tag-header.js.map +7 -0
- package/preact/components/teaser-counter/teaser-counter.d.ts +4 -6
- package/preact/components/teaser-counter/teaser-counter.js +28 -15
- package/preact/components/teaser-counter/teaser-counter.js.map +4 -4
- package/preact/components/teaser-footer/teaser-footer.d.ts +2 -4
- package/preact/components/teaser-footer/teaser-footer.js +9 -6
- package/preact/components/teaser-footer/teaser-footer.js.map +2 -2
- package/preact/components/teaser-large/teaser-large.d.ts +9 -0
- package/preact/components/teaser-large/teaser-large.js +177 -0
- package/preact/components/teaser-large/teaser-large.js.map +7 -0
- package/preact/components/teaser-onsite/teaser-onsite.d.ts +4 -8
- package/preact/components/teaser-onsite/teaser-onsite.js +60 -16
- package/preact/components/teaser-onsite/teaser-onsite.js.map +4 -4
- package/components/tag-header/README-UXD.md +0 -0
- package/components/teaser-large/README-UXD.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.25](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.24...@bonniernews/dn-design-system-web@32.7.25) (2025-07-10)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **web:** teaser large as tsx ([#1821](https://github.com/BonnierNews/dn-design-system/issues/1821)) ([d106246](https://github.com/BonnierNews/dn-design-system/commit/d106246f2e9a2e3b3a65d5d7171b19270c396c13))
|
|
13
|
+
|
|
14
|
+
## [32.7.24](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.23...@bonniernews/dn-design-system-web@32.7.24) (2025-07-09)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **web:** tag header tsx ([#1826](https://github.com/BonnierNews/dn-design-system/issues/1826)) ([08b70e3](https://github.com/BonnierNews/dn-design-system/commit/08b70e3d56705253a4774bccd51f60c0a650e37c))
|
|
20
|
+
|
|
7
21
|
## [32.7.23](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.22...@bonniernews/dn-design-system-web@32.7.23) (2025-07-09)
|
|
8
22
|
|
|
9
23
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ComponentChild } from 'preact'
|
|
2
|
+
import type { SharedProps } from '@bonniernews/dn-design-system-web/assets/types/shared-props.ts'
|
|
3
|
+
|
|
4
|
+
export interface TeaserProps extends SharedProps {
|
|
5
|
+
/** Heading of the teaser */
|
|
6
|
+
title: string;
|
|
7
|
+
/** Target URL for the teaser */
|
|
8
|
+
targetLink: string;
|
|
9
|
+
/** Variant of the teaser */
|
|
10
|
+
variant?: "default" | "podcast";
|
|
11
|
+
/** The area where the column is rendered */
|
|
12
|
+
areaType?: "right" | "bauta" | "bautaxl";
|
|
13
|
+
/** The theme-class to apply to the teaser */
|
|
14
|
+
theme?: "nyheter" | "kultur";
|
|
15
|
+
/** Teaser subtext */
|
|
16
|
+
text?: string;
|
|
17
|
+
/** Top text in the teaser */
|
|
18
|
+
vignette?: string;
|
|
19
|
+
/** Text before the heading */
|
|
20
|
+
highlight?: string;
|
|
21
|
+
/** Red text before the text */
|
|
22
|
+
sticker?: string;
|
|
23
|
+
/** Main image or other media */
|
|
24
|
+
media?: ComponentChild;
|
|
25
|
+
/** Image of the author */
|
|
26
|
+
bylinePicture?: ComponentChild;
|
|
27
|
+
/** If the headline should be italic */
|
|
28
|
+
isItalicHeadline?: boolean;
|
|
29
|
+
/** If the headline should be large (only if `isItalicHeadline` is true) */
|
|
30
|
+
isLargeHeadline?: boolean;
|
|
31
|
+
/** If there should be a flashing ball before the text */
|
|
32
|
+
isFlashingDot?: boolean;
|
|
33
|
+
/** Publication time text */
|
|
34
|
+
publicationTime?: string;
|
|
35
|
+
/** Duration of podcast */
|
|
36
|
+
duration?: string;
|
|
37
|
+
/** Byline aspect ratio */
|
|
38
|
+
bylineAspectRatio?: string;
|
|
39
|
+
/** Byline HTML */
|
|
40
|
+
bylineHtml?: string;
|
|
41
|
+
/** Shows in teaser footer */
|
|
42
|
+
sectionName?: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
@@ -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
|
| title\* | The title text<br />string | \- |
|
|
12
|
-
| type | The type of interactive element added to the header<br />"
|
|
12
|
+
| type | The type of interactive element added to the header<br />"link", "toggle", "icon", "arrows" | "icon" |
|
|
13
13
|
| variant | The design variant, if not bauta or bautaxl the group header will get the 'standard' design<br />"bauta", "bauataxl" | \- |
|
|
14
14
|
| media | The image element for the header<br />ComponentChild | \- |
|
|
15
15
|
| href | If given, the title is rendered as a link<br />string | \- |
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/tag-header](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/tag-header)
|
|
2
|
+
- Storybook: [TagHeader](https://designsystem.dn.se/?path=/docs/section-Tagheader--docs)
|
|
3
|
+
- Storybook (Latest): [TagHeader](https://designsystem-latest.dn.se/?path=/docs/section-Tagheader--docs)
|
|
4
|
+
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
# Tag header
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
|parameter | type | required | options | default | description |
|
|
12
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
+
|title | String | yes | | | H1 Title |
|
|
14
|
+
|vignetteText | String | no | | | Heading of the link box |
|
|
15
|
+
|vignetteTargetUrl | String | no | | | Target URL for the vignette |
|
|
16
|
+
|mediaHtml | String | no | | | Main image |
|
|
17
|
+
|descriptionHtml | String | no | | | Intended use is text, links |
|
|
18
|
+
|articleCount | int | no | | | Total articles on this list-page |
|
|
19
|
+
|theme | String | no | nyheter, kultur | (empty) | The theme-class to apply to the vignette |
|
|
20
|
+
|toggle | Bool | no | true, false | false | Show/hide toggle button |
|
|
21
|
+
|toggleText | text | no | | | `text` parameter to ToggleButton (only if `toggle` is enabled) |
|
|
22
|
+
|toggleSelectedText | text | no | | | `selectedText` parameter to ToggleButton (only if `toggle` is enabled) |
|
|
23
|
+
|toggleSelected | boolean | no | | | `selected` parameter to ToggleButton (only if `toggle` is enabled) |
|
|
24
|
+
|toggleLoading | boolean | no | | | `loading` parameter to ToggleButton (only if `toggle` is enabled) |
|
|
25
|
+
|toggleClassNames | text | no | | | `classNames` parameter to ToggleButton (only if `toggle` is enabled) |
|
|
26
|
+
|toggleAttributes | text | no | | | `attributes` parameter to ToggleButton (only if `toggle` is enabled) |
|
|
27
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
28
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
29
|
+
|~forcePx~ | | | | | Not supported |
|
|
30
|
+
|
|
31
|
+
## Minimum requirement example
|
|
32
|
+
|
|
33
|
+
### Nunjucks
|
|
34
|
+
|
|
35
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
{% from '@bonniernews/dn-design-system-web/components/tag-header/tag-header.njk' import TagHeader %}
|
|
39
|
+
|
|
40
|
+
{{ TagHeader(
|
|
41
|
+
{
|
|
42
|
+
vignette: "SPEL",
|
|
43
|
+
title: "Quiz",
|
|
44
|
+
descriptionHtml: "<p>Utmana dig själv med smarta quiz av DN:s medarbetare. Välj mellan olika kategorier och svårighetsgrad.</p>"
|
|
45
|
+
}
|
|
46
|
+
)}}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### SCSS
|
|
50
|
+
```scss
|
|
51
|
+
@use "@bonniernews/dn-design-system-web/components/tag-header/tag-header" as *;
|
|
52
|
+
```
|
|
@@ -1,52 +1,38 @@
|
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
{{ TagHeader(
|
|
41
|
-
{
|
|
42
|
-
vignette: "SPEL",
|
|
43
|
-
title: "Quiz",
|
|
44
|
-
descriptionHtml: "<p>Utmana dig själv med smarta quiz av DN:s medarbetare. Välj mellan olika kategorier och svårighetsgrad.</p>"
|
|
45
|
-
}
|
|
46
|
-
)}}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### SCSS
|
|
50
|
-
```scss
|
|
51
|
-
@use "@bonniernews/dn-design-system-web/components/tag-header/tag-header" as *;
|
|
52
|
-
```
|
|
1
|
+
TagHeader
|
|
2
|
+
=========
|
|
3
|
+
|
|
4
|
+
* GitHub: [BonnierNews/dn-design-system/../web/src/components/tag-header](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/tag-header)
|
|
5
|
+
* Storybook: [TagHeader](https://designsystem.dn.se/?path=/docs/section-tagheader--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/tag-header/tag-header.scss'`
|
|
8
|
+
|
|
9
|
+
| Name | Description | Default |
|
|
10
|
+
|:--- | :--- | :--- |
|
|
11
|
+
| title\* | * H1 Title<br />string | \- |
|
|
12
|
+
| vignetteText | Heading of the link box<br />string | \- |
|
|
13
|
+
| vignetteTargetUrl | Target URL for the vignette<br />string | \- |
|
|
14
|
+
| media | Main image<br />ComponentChild | \- |
|
|
15
|
+
| descriptionHtml | Intended use is text, links<br />string | \- |
|
|
16
|
+
| articleCount | Total articles on this list-page<br />number | \- |
|
|
17
|
+
| theme | The theme-class to apply to the vignette<br />"kultur", "nyheter" | \- |
|
|
18
|
+
| toggle | Show/hide toggle button<br />boolean | false |
|
|
19
|
+
| toggleText | `text` parameter to ToggleButton (only if `toggle` is enabled)<br />string | \- |
|
|
20
|
+
| toggleSelectedText | `selectedText` parameter to ToggleButton (only if `toggle` is enabled)<br />string | \- |
|
|
21
|
+
| toggleSelected | `selected` parameter to ToggleButton (only if `toggle` is enabled)<br />boolean | false |
|
|
22
|
+
| toggleLoading | `loading` parameter to ToggleButton (only if `toggle` is enabled)<br />boolean | false |
|
|
23
|
+
| toggleClassNames | `classNames` parameter to ToggleButton (only if `toggle` is enabled)<br />string | \- |
|
|
24
|
+
| toggleAttributes | `attributes` parameter to ToggleButton (only if `toggle` is enabled)<br />Record<string, unknown> | \- |
|
|
25
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
26
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
|
|
27
|
+
|
|
28
|
+
```jsx
|
|
29
|
+
<TagHeader
|
|
30
|
+
articleCount={123}
|
|
31
|
+
descriptionHtml="<p>Här samlas alla DN:s skivrecensioner – från Claude Debussy till Cannibal Corpse.</p>"
|
|
32
|
+
media={<TeaserImage byline="Foto: Alexander Mahmoud" image={<ExamplePicture alt="Strumpor på torklina" className="picture picture--placeholder" src="https://cached-images.bonnier.news/gcs/bilder/dn-mly/015275ed-234c-4762-b5aa-d61bf5ac6c94.jpeg?interpolation=lanczos-none&downsize=480:*&output-quality=80" srcSet="https://cached-images.bonnier.news/gcs/bilder/dn-mly/015275ed-234c-4762-b5aa-d61bf5ac6c94.jpeg?interpolation=lanczos-none&downsize=750:*&output-quality=60 750w, https://cached-images.bonnier.news/gcs/bilder/dn-mly/015275ed-234c-4762-b5aa-d61bf5ac6c94.jpeg?interpolation=lanczos-none&downsize=960:*&output-quality=60 960w" style={{aspectRatio: '16 / 9'}}/>}/>}
|
|
33
|
+
title="Skivrecensioner"
|
|
34
|
+
toggle
|
|
35
|
+
toggleSelectedText="Följer"
|
|
36
|
+
toggleText="Följ"
|
|
37
|
+
/>
|
|
38
|
+
```
|
|
@@ -8,22 +8,22 @@ 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\* | string | \- |
|
|
12
11
|
| counterText\* | string | \- |
|
|
13
12
|
| counterNumber\* | number | \- |
|
|
14
13
|
| subtitle | string | \- |
|
|
15
|
-
| areaType | "right", "bauta" | \- |
|
|
16
|
-
| targetLink | string | \- |
|
|
17
|
-
| mediaHtml | string | \- |
|
|
18
14
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
19
15
|
| 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", "bautaxl" | \- |
|
|
18
|
+
| title\* | Heading of the teaser<br />string | \- |
|
|
19
|
+
| media | Main image or other media<br />ComponentChild | \- |
|
|
20
20
|
|
|
21
21
|
```jsx
|
|
22
22
|
<TeaserCounter
|
|
23
23
|
classNames="test-class"
|
|
24
24
|
counterNumber={124}
|
|
25
25
|
counterText="DAGAR I <br> FÄNGELSE"
|
|
26
|
-
|
|
26
|
+
media={<ExamplePicture className="picture picture--placeholder" src="https://dev.static.bonniernews.se/gcs/patron/2025/05/afa4321ec1db2abce9d2c85d5d8176d4431faeb8-1747137466945.jpg?io=1&crop=3:4,smart&height=184" style={{aspectRatio: '3 / 4'}}/>}
|
|
27
27
|
subtitle="fängslad i Turkiet för sin journalistik"
|
|
28
28
|
title="Joakim Medin"
|
|
29
29
|
/>
|
|
@@ -16,32 +16,34 @@
|
|
|
16
16
|
classNames: extraClasses
|
|
17
17
|
}) %}
|
|
18
18
|
<div class="ds-teaser__content">
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
<div class="ds-teaser__content-inner">
|
|
20
|
+
{% if params.title %}
|
|
21
|
+
<h2 class="{{ componentClassName + '__title' }}">
|
|
22
|
+
<span class="{{ componentClassName + '__title--highlighted' }}">{{ params.title }}</span>
|
|
23
|
+
{% if params.subtitle %}
|
|
24
|
+
– {{ params.subtitle }}
|
|
25
|
+
{% endif %}
|
|
26
|
+
</h2>
|
|
27
|
+
{% endif %}
|
|
27
28
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
29
|
+
{% if params.counterNumber is not null or params.counterText %}
|
|
30
|
+
<div class="{{ componentClassName + '__counter-wrapper' }}">
|
|
31
|
+
{% if params.counterNumber is not null %}
|
|
32
|
+
<ul class="{{ componentClassName + '__list' }}">
|
|
33
|
+
{% for digit in params.counterNumber | string %}
|
|
34
|
+
<li class="{{ componentClassName + '__item' }}">{{ digit }}</li>
|
|
35
|
+
{% endfor %}
|
|
36
|
+
</ul>
|
|
37
|
+
{% endif %}
|
|
37
38
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
39
|
+
{% if params.counterText %}
|
|
40
|
+
<p class="{{ componentClassName + '__counter-text' }}">
|
|
41
|
+
{{ params.counterText | safe }}
|
|
42
|
+
</p>
|
|
43
|
+
{% endif %}
|
|
44
|
+
</div>
|
|
45
|
+
{% endif %}
|
|
46
|
+
</div>
|
|
45
47
|
</div>
|
|
46
48
|
|
|
47
49
|
{% if params.countdown %}
|
|
@@ -11,10 +11,11 @@ a.ds-teaser--counter.ds-teaser {
|
|
|
11
11
|
gap: ds-spacing($ds-s-075);
|
|
12
12
|
padding: ds-spacing($ds-s-075);
|
|
13
13
|
|
|
14
|
-
.ds-teaser__content {
|
|
14
|
+
.ds-teaser__content-inner {
|
|
15
15
|
display: flex;
|
|
16
16
|
flex-direction: column;
|
|
17
17
|
gap: ds-spacing($ds-s-100);
|
|
18
|
+
height: 100%;
|
|
18
19
|
justify-content: space-between;
|
|
19
20
|
}
|
|
20
21
|
|
|
@@ -6,8 +6,8 @@ TeaserFooter
|
|
|
6
6
|
|
|
7
7
|
| Name | Description | Default |
|
|
8
8
|
|:--- | :--- | :--- |
|
|
9
|
-
| variant\* |
|
|
10
|
-
| publicationTime |
|
|
9
|
+
| variant\* | "default", "podcast", "informationText" | \- |
|
|
10
|
+
| publicationTime | string | \- |
|
|
11
11
|
| sectionName | Name of section the teaser is connected to<br />string | \- |
|
|
12
12
|
| duration | The length of the podcast<br />string | \- |
|
|
13
13
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-large](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-large)
|
|
2
|
+
- Storybook: [TeaserLarge](https://designsystem.dn.se/?path=/docs/section-teaserlarge--docs)
|
|
3
|
+
- Storybook (Latest): [TeaserLarge](https://designsystem-latest.dn.se/?path=/docs/section-teaserlarge--docs)
|
|
4
|
+
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
# teaser-large
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
|parameter | type | required | options | default | description |
|
|
12
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
+
|title | String | yes | | | Heading of the teaser |
|
|
14
|
+
|targetLink | String | yes | | | Target URL for the teaser |
|
|
15
|
+
|variant | String | no | "default" or "podcast" | "default" | |
|
|
16
|
+
|areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
|
|
17
|
+
|theme | String | no | nyheter, kultur | (empty) | The theme-class to apply to the teaser |
|
|
18
|
+
|text | String | no | | | Teaser subtext |
|
|
19
|
+
|vignette | String | no | | | Top text in the teaser |
|
|
20
|
+
|highlight | String | no | | | Text before the heading |
|
|
21
|
+
|sticker | String | no | | | Red text before the text |
|
|
22
|
+
|mediaHtml | HTML String | no | | | Main image or other media |
|
|
23
|
+
|bylineHtml | HTML String | no | | | Side image of the author |
|
|
24
|
+
|isItalicHeadline | bool | no | true, false | false | If the headline should be italic |
|
|
25
|
+
|isLargeHeadline | bool | no | true, false | false | If the headline should be large. Only has an effect if `isItalicHeadline` is true. |
|
|
26
|
+
|isFlashingDot | bool | no | true, false | false | If there should be a flashing ball before the text |
|
|
27
|
+
|publicationTime | string | no | | null | Publication time text. |
|
|
28
|
+
|duration | string | no | | null | Duration of podcast. |
|
|
29
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
30
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
31
|
+
|~forcePx~ | | | | | Not supported |
|
|
32
|
+
|
|
33
|
+
## Minimum requirement example
|
|
34
|
+
|
|
35
|
+
### Nunjucks
|
|
36
|
+
|
|
37
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
38
|
+
|
|
39
|
+
```html
|
|
40
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-large/teaser-large.njk' import TeaserLarge %}
|
|
41
|
+
|
|
42
|
+
{{ TeaserLarge({
|
|
43
|
+
title: "Upp på börsen",
|
|
44
|
+
text: "Det ser ganska normalt ut på Stockholmsbörsen.",
|
|
45
|
+
highlight: "Ekonominytt:"
|
|
46
|
+
})}}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### SCSS
|
|
50
|
+
```scss
|
|
51
|
+
@use "@bonniernews/dn-design-system-web/components/teaser-large/teaser-large" as *;
|
|
52
|
+
```
|
|
@@ -1,52 +1,44 @@
|
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
highlight: "Ekonominytt:"
|
|
46
|
-
})}}
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### SCSS
|
|
50
|
-
```scss
|
|
51
|
-
@use "@bonniernews/dn-design-system-web/components/teaser-large/teaser-large" as *;
|
|
52
|
-
```
|
|
1
|
+
TeaserLarge
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
* GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-large](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-large)
|
|
5
|
+
* Storybook: [TeaserLarge](https://designsystem.dn.se/?path=/docs/section-teaserlarge--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-large/teaser-large.scss'`
|
|
8
|
+
|
|
9
|
+
| Name | Description | Default |
|
|
10
|
+
|:--- | :--- | :--- |
|
|
11
|
+
| bylinePicture | Image of the author<br />ComponentChild | \- |
|
|
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 | false |
|
|
20
|
+
| isLargeHeadline | If the headline should be large (only if `isItalicHeadline` is true)<br />boolean | false |
|
|
21
|
+
| isItalicHeadline | If the headline should be italic<br />boolean | false |
|
|
22
|
+
| title\* | Heading of the teaser<br />string | \- |
|
|
23
|
+
| media | Main image or other media<br />ComponentChild | \- |
|
|
24
|
+
| sticker | Red text before the text<br />string | \- |
|
|
25
|
+
| highlight | Text before the heading<br />string | \- |
|
|
26
|
+
| vignette | Top text in the teaser<br />string | \- |
|
|
27
|
+
| text | Teaser subtext<br />string | \- |
|
|
28
|
+
| theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | \- |
|
|
29
|
+
| areaType | The area where the column is rendered<br />"right", "bauta", "bautaxl" | \- |
|
|
30
|
+
| variant | Variant of the teaser<br />"default", "podcast" | "default" |
|
|
31
|
+
| targetLink\* | Target URL for the teaser<br />string | \- |
|
|
32
|
+
|
|
33
|
+
```jsx
|
|
34
|
+
<TeaserLarge
|
|
35
|
+
highlight="Large:"
|
|
36
|
+
isLargeHeadline
|
|
37
|
+
media={<TeaserImage byline="Foto: Alexander Mahmoud" image={<ExamplePicture alt="Strumpor på torklina" className="picture picture--placeholder" src="https://cached-images.bonnier.news/gcs/bilder/dn-mly/708402b6-f6cb-4317-a750-d68bef6db08c.jpeg?interpolation=lanczos-none&fit=around%7C300:169&crop=300:h;center,top&output-quality=80" srcSet="https://cached-images.bonnier.news/gcs/bilder/dn-mly/708402b6-f6cb-4317-a750-d68bef6db08c.jpeg?interpolation=lanczos-none&fit=around%7C227:128&crop=227:h;center,top&output-quality=80 227w, https://cached-images.bonnier.news/gcs/bilder/dn-mly/708402b6-f6cb-4317-a750-d68bef6db08c.jpeg?interpolation=lanczos-none&fit=around%7C300:169&crop=300:h;center,top&output-quality=80 300w, https://cached-images.bonnier.news/gcs/bilder/dn-mly/708402b6-f6cb-4317-a750-d68bef6db08c.jpeg?interpolation=lanczos-none&fit=around%7C454:256&crop=454:h;center,top&output-quality=60 454w, https://cached-images.bonnier.news/gcs/bilder/dn-mly/708402b6-f6cb-4317-a750-d68bef6db08c.jpeg?interpolation=lanczos-none&fit=around%7C600:338&crop=600:h;center,top&output-quality=60 600w" style={{aspectRatio: '16 / 9'}}/>}/>}
|
|
38
|
+
sticker="TV"
|
|
39
|
+
targetLink="https://www.dn.se/krigets-svallvagor/"
|
|
40
|
+
text="Rysslandsexperten: Därför anföll han Ukraina • Så har invasionen förändrat världen."
|
|
41
|
+
title="”I kriget kunde Putin ge efter för sina instinkter”"
|
|
42
|
+
vignette="EN PUFF MED ALLT"
|
|
43
|
+
/>
|
|
44
|
+
```
|
|
@@ -12,18 +12,18 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
12
12
|
|
|
13
13
|
| Name | Description | Default |
|
|
14
14
|
|:--- | :--- | :--- |
|
|
15
|
-
| areaType | "right", "bauta", "bautaxl" | \- |
|
|
16
|
-
| targetLink | string | \- |
|
|
17
|
-
| theme | "kultur", "nyheter" | "nyheter" |
|
|
18
|
-
| mediaHtml | string | \- |
|
|
19
|
-
| title | string | \- |
|
|
20
|
-
| text | string | \- |
|
|
21
15
|
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
22
16
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
17
|
+
| targetLink\* | Target URL for the teaser<br />string | \- |
|
|
18
|
+
| areaType | The area where the column is rendered<br />"right", "bauta", "bautaxl" | \- |
|
|
19
|
+
| title\* | Heading of the teaser<br />string | \- |
|
|
20
|
+
| text | Teaser subtext<br />string | \- |
|
|
21
|
+
| theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | "nyheter" |
|
|
22
|
+
| media | Main image or other media<br />ComponentChild | \- |
|
|
23
23
|
|
|
24
24
|
```jsx
|
|
25
25
|
<TeaserOnSite
|
|
26
|
-
|
|
26
|
+
media={<TeaserImage image={<ExamplePicture className="picture picture--placeholder" src="https://cached-images.bonnier.news/gcs/bilder-lab/dn-mly/d5e4cd87-61a5-40fc-8060-c4ad5019a9f3.jpeg?interpolation=lanczos-none&fit=around%7C56:56&crop=56:h;center,top&output-quality=80" style={{aspectRatio: '1 / 1'}}/>} />}
|
|
27
27
|
targetLink="https://www.dn.se/varlden/har-forvarades-atombomber-under-kalla-kriget-nu-ar-flygbasen-pa-azorerna-ater-het-for-stormakterna/"
|
|
28
28
|
text="Henrik Brandão Jönsson och Eduardo Leal"
|
|
29
29
|
title="Azorerna"
|
package/package.json
CHANGED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { ComponentChild } from 'preact';
|
|
2
|
+
import type { SharedProps } from '@bonniernews/dn-design-system-web/assets/types/shared-props.ts';
|
|
3
|
+
export interface TeaserProps extends SharedProps {
|
|
4
|
+
/** Heading of the teaser */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Target URL for the teaser */
|
|
7
|
+
targetLink: string;
|
|
8
|
+
/** Variant of the teaser */
|
|
9
|
+
variant?: "default" | "podcast";
|
|
10
|
+
/** The area where the column is rendered */
|
|
11
|
+
areaType?: "right" | "bauta" | "bautaxl";
|
|
12
|
+
/** The theme-class to apply to the teaser */
|
|
13
|
+
theme?: "nyheter" | "kultur";
|
|
14
|
+
/** Teaser subtext */
|
|
15
|
+
text?: string;
|
|
16
|
+
/** Top text in the teaser */
|
|
17
|
+
vignette?: string;
|
|
18
|
+
/** Text before the heading */
|
|
19
|
+
highlight?: string;
|
|
20
|
+
/** Red text before the text */
|
|
21
|
+
sticker?: string;
|
|
22
|
+
/** Main image or other media */
|
|
23
|
+
media?: ComponentChild;
|
|
24
|
+
/** Image of the author */
|
|
25
|
+
bylinePicture?: ComponentChild;
|
|
26
|
+
/** If the headline should be italic */
|
|
27
|
+
isItalicHeadline?: boolean;
|
|
28
|
+
/** If the headline should be large (only if `isItalicHeadline` is true) */
|
|
29
|
+
isLargeHeadline?: boolean;
|
|
30
|
+
/** If there should be a flashing ball before the text */
|
|
31
|
+
isFlashingDot?: boolean;
|
|
32
|
+
/** Publication time text */
|
|
33
|
+
publicationTime?: string;
|
|
34
|
+
/** Duration of podcast */
|
|
35
|
+
duration?: string;
|
|
36
|
+
/** Byline aspect ratio */
|
|
37
|
+
bylineAspectRatio?: string;
|
|
38
|
+
/** Byline HTML */
|
|
39
|
+
bylineHtml?: string;
|
|
40
|
+
/** Shows in teaser footer */
|
|
41
|
+
sectionName?: string;
|
|
42
|
+
}
|