@bonniernews/dn-design-system-web 32.7.37 → 32.7.39

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.
Files changed (45) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/assets/types/teaser-props.ts +2 -0
  3. package/components/quote/README.md +1 -1
  4. package/components/tag-header/README.md +1 -1
  5. package/components/teaser-card/README.md +2 -2
  6. package/components/teaser-large/README.md +2 -1
  7. package/components/teaser-list-swipe/README.md +2 -2
  8. package/components/teaser-list-vertical/README.md +1 -1
  9. package/components/teaser-longlife/README.md +2 -2
  10. package/components/teaser-onsite/README.md +1 -1
  11. package/components/teaser-right-now/README.md +1 -1
  12. package/components/teaser-standard/README-njk.md +68 -0
  13. package/components/teaser-standard/README.md +42 -68
  14. package/components/teaser-swipe-card/README.md +3 -2
  15. package/components/teaser-tipsa/README.md +4 -5
  16. package/package.json +1 -1
  17. package/preact/assets/types/teaser-props.d.ts +2 -0
  18. package/preact/components/teaser-counter/teaser-counter.js +6 -2
  19. package/preact/components/teaser-counter/teaser-counter.js.map +2 -2
  20. package/preact/components/teaser-large/teaser-large.js +8 -4
  21. package/preact/components/teaser-large/teaser-large.js.map +2 -2
  22. package/preact/components/teaser-list-swipe/teaser-list-swipe.js +2 -2
  23. package/preact/components/teaser-list-swipe/teaser-list-swipe.js.map +2 -2
  24. package/preact/components/teaser-longlife/teaser-longlife.js +8 -4
  25. package/preact/components/teaser-longlife/teaser-longlife.js.map +2 -2
  26. package/preact/components/teaser-native/teaser-native.js +8 -4
  27. package/preact/components/teaser-native/teaser-native.js.map +2 -2
  28. package/preact/components/teaser-onsite/teaser-onsite.js +8 -4
  29. package/preact/components/teaser-onsite/teaser-onsite.js.map +2 -2
  30. package/preact/components/teaser-right-now/teaser-right-now.js +2 -2
  31. package/preact/components/teaser-right-now/teaser-right-now.js.map +2 -2
  32. package/preact/components/teaser-slideshow/teaser-slideshow.js +8 -4
  33. package/preact/components/teaser-slideshow/teaser-slideshow.js.map +2 -2
  34. package/preact/components/teaser-split/teaser-split.js +8 -4
  35. package/preact/components/teaser-split/teaser-split.js.map +2 -2
  36. package/preact/components/teaser-standard/teaser-standard.d.ts +13 -0
  37. package/preact/components/teaser-standard/teaser-standard.js +177 -0
  38. package/preact/components/teaser-standard/teaser-standard.js.map +7 -0
  39. package/preact/components/teaser-swipe-card/teaser-swipe-card.js +2 -2
  40. package/preact/components/teaser-swipe-card/teaser-swipe-card.js.map +2 -2
  41. package/preact/components/teaser-tipsa/teaser-tipsa.d.ts +2 -4
  42. package/preact/components/teaser-tipsa/teaser-tipsa.js +2 -2
  43. package/preact/components/teaser-tipsa/teaser-tipsa.js.map +2 -2
  44. package/preact/helpers/teaser.d.ts +4 -4
  45. package/components/teaser-standard/README-UXD.md +0 -0
package/CHANGELOG.md CHANGED
@@ -4,6 +4,36 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
4
4
 
5
5
 
6
6
 
7
+ ## [32.7.39](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.38...@bonniernews/dn-design-system-web@32.7.39) (2025-07-29)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **web:** teaser props on tipsa ([#1846](https://github.com/BonnierNews/dn-design-system/issues/1846)) ([4286997](https://github.com/BonnierNews/dn-design-system/commit/428699737527d2cf2aeb51ae0157b22d7d9c735f))
13
+
14
+
15
+ ### Maintenance
16
+
17
+ * **deps-dev:** bump axios from 1.10.0 to 1.11.0 ([#1840](https://github.com/BonnierNews/dn-design-system/issues/1840)) ([27ebfed](https://github.com/BonnierNews/dn-design-system/commit/27ebfed1e15b98e0399b022eef1d969564be22dd))
18
+
19
+ ## [32.7.38](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.37...@bonniernews/dn-design-system-web@32.7.38) (2025-07-18)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * **web:** teaser standard tsx ([#1838](https://github.com/BonnierNews/dn-design-system/issues/1838)) ([b490e9b](https://github.com/BonnierNews/dn-design-system/commit/b490e9b6835d585fd9d7d7928018b9e7897ab3bb))
25
+
26
+
27
+ ### Maintenance
28
+
29
+ * **deps-dev:** bump @react-native/babel-preset from 0.75.2 to 0.80.1 ([#1808](https://github.com/BonnierNews/dn-design-system/issues/1808)) ([45be5ae](https://github.com/BonnierNews/dn-design-system/commit/45be5aed0a32046ddcf483940332dea685107b3c))
30
+ * **deps-dev:** bump @react-native/metro-config from 0.79.1 to 0.80.1 ([#1797](https://github.com/BonnierNews/dn-design-system/issues/1797)) ([a282a9b](https://github.com/BonnierNews/dn-design-system/commit/a282a9b8113e21cec1085db91dc62931c3dec85e))
31
+ * **deps:** bump @react-native-community/datetimepicker from 8.4.1 to 8.4.2 ([#1789](https://github.com/BonnierNews/dn-design-system/issues/1789)) ([b67f703](https://github.com/BonnierNews/dn-design-system/commit/b67f70383d20031b6ae48601c5acd231b1dde491))
32
+ * **deps:** bump @react-native/typescript-config from 0.75.2 to 0.80.1 ([#1799](https://github.com/BonnierNews/dn-design-system/issues/1799)) ([8c4eb5e](https://github.com/BonnierNews/dn-design-system/commit/8c4eb5e7c5f34b077e22ef24b2bbd1b11bce1e1d))
33
+ * **deps:** bump brace-expansion from 1.1.11 to 1.1.12 in /server ([#1837](https://github.com/BonnierNews/dn-design-system/issues/1837)) ([3c86ccd](https://github.com/BonnierNews/dn-design-system/commit/3c86ccd7a2d5381b197e49c11a0def6fec94835b))
34
+ * prerelease packages ([75deb71](https://github.com/BonnierNews/dn-design-system/commit/75deb71018f14f60f1f6b25fbf9f752a3f58791f))
35
+ * prerelease packages ([427ad11](https://github.com/BonnierNews/dn-design-system/commit/427ad11fc5ff365d19fe488939f7842b384b28be))
36
+
7
37
  ## [32.7.37](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.36...@bonniernews/dn-design-system-web@32.7.37) (2025-07-18)
8
38
 
9
39
 
@@ -22,6 +22,8 @@ export interface TeaserProps extends SharedProps {
22
22
  sticker?: string;
23
23
  /** Main image or other media */
24
24
  media?: ComponentChild;
25
+ /** Flag so we can handle square teaser images */
26
+ isSquareImage?: boolean
25
27
  /** Image of the author */
26
28
  bylinePicture?: ComponentChild;
27
29
  /** If the headline should be italic */
@@ -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 | "kultur", "nyheter" | "nyheter" |
12
+ | theme | "nyheter", "kultur" | "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 />"kultur", "nyheter" | \- |
17
+ | theme | The theme-class to apply to the vignette<br />"nyheter", "kultur" | \- |
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 | "main", "right", "bauta", "bautaxl" | \- |
11
+ | areaType | "right", "bauta", "bautaxl", "main" | \- |
12
12
  | targetLink | string | \- |
13
- | theme | "kultur", "nyheter" | "nyheter" |
13
+ | theme | "nyheter", "kultur" | "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
 
@@ -20,12 +20,13 @@ The component will not include styling by itself. Make sure to include the right
20
20
  | isLargeHeadline | If the headline should be large (only if `isItalicHeadline` is true)<br />boolean | false |
21
21
  | isItalicHeadline | If the headline should be italic<br />boolean | false |
22
22
  | title\* | Heading of the teaser<br />string | \- |
23
+ | isSquareImage | Flag so we can handle square teaser images<br />boolean | \- |
23
24
  | media | Main image or other media<br />ComponentChild | \- |
24
25
  | sticker | Red text before the text<br />string | \- |
25
26
  | highlight | Text before the heading<br />string | \- |
26
27
  | vignette | Top text in the teaser<br />string | \- |
27
28
  | text | Teaser subtext<br />string | \- |
28
- | theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | \- |
29
+ | theme | The theme-class to apply to the teaser<br />"nyheter", "kultur" | \- |
29
30
  | areaType | The area where the column is rendered<br />"right", "bauta", "bautaxl" | \- |
30
31
  | variant | Variant of the teaser<br />"default", "podcast", "insandare", "direkt" | "default" |
31
32
  | targetLink\* | Target URL for the teaser<br />string | \- |
@@ -10,9 +10,9 @@ The component will not include styling by itself. Make sure to include the right
10
10
  |:--- | :--- | :--- |
11
11
  | title\* | Heading of the teaser<br />string | \- |
12
12
  | titleHref | Target URL for the header<br />string | \- |
13
- | areaType | The area where the column is rendered<br />"main", "right", "bauta", "bautaxl" | \- |
13
+ | areaType | The area where the column is rendered<br />"right", "bauta", "bautaxl", "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 />"kultur", "nyheter" | \- |
15
+ | theme | The theme-class to apply to the teaser<br />"nyheter", "kultur" | \- |
16
16
  | teasers | A list of arguments to TeaserSwipeCard<br />TeaserSwipeCardProps\[\] | \[\] |
17
17
  | groupHeaderType | Type of group header<br />"link", "icon", "toggle", "arrows" | \- |
18
18
  | 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 />"kultur", "nyheter" | \- |
15
+ | theme | The theme-class to apply to _all_ teasers in the list.<br />"nyheter", "kultur" | \- |
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
 
@@ -12,9 +12,9 @@ The component will not include styling by itself. Make sure to include the right
12
12
  | title\* | Heading of the teaser<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
- | theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | \- |
16
- | vignette | Top text in the teaser<br />string | \- |
15
+ | theme | The theme-class to apply to the teaser<br />"nyheter", "kultur" | \- |
17
16
  | media | Main image or other media<br />ComponentChild | \- |
17
+ | vignette | Top text in the teaser<br />string | \- |
18
18
 
19
19
  ```jsx
20
20
  <TeaserLonglife
@@ -18,7 +18,7 @@ The component will not include styling by itself. Make sure to include the right
18
18
  | areaType | The area where the column is rendered<br />"right", "bauta", "bautaxl" | \- |
19
19
  | title\* | Heading of the teaser<br />string | \- |
20
20
  | text | Teaser subtext<br />string | \- |
21
- | theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | "nyheter" |
21
+ | theme | The theme-class to apply to the teaser<br />"nyheter", "kultur" | "nyheter" |
22
22
  | media | Main image or other media<br />ComponentChild | \- |
23
23
 
24
24
  ```jsx
@@ -13,7 +13,7 @@ The component will not include styling by itself. Make sure to include the right
13
13
  | targetLink\* | Target URL for the teaser<br />string | \- |
14
14
  | areaType | The area where the column is rendered<br />"right", "bauta", "bautaxl" | \- |
15
15
  | title\* | Heading of the teaser<br />string | \- |
16
- | theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | "nyheter" |
16
+ | theme | The theme-class to apply to the teaser<br />"nyheter", "kultur" | "nyheter" |
17
17
 
18
18
  ```jsx
19
19
  <TeaserRightNow
@@ -0,0 +1,68 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-standard](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-standard)
2
+ - Storybook: [TeaserStandard](https://designsystem.dn.se/?path=/docs/section-teaserstandard--docs)
3
+ - Storybook (Latest): [TeaserStandard](https://designsystem-latest.dn.se/?path=/docs/section-teaserstandard--docs)
4
+
5
+ ----
6
+
7
+ # teaser-standard
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
+ |isCompact | bool | no | true, false | false | If the headline should be compact |
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
+ |isSquareImage | boolean | no | | false | Flag so we can handle square teaser images |
30
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
31
+ |classNames | String | no | | | Ex. "my-special-class" |
32
+ |~forcePx~ | | | | | Not supported |
33
+
34
+ ## Minimum requirement example
35
+ These are copy paste friendly examples to quickliy get started using a component.
36
+
37
+ ### Nunjucks
38
+ ```html
39
+ {% from '@bonniernews/dn-design-system-web/components/teaser-standard/teaser-standard.njk' import TeaserStandard %}
40
+
41
+ {{ TeaserStandard({
42
+ title: "Upp på börsen",
43
+ text: "Det ser ganska normalt ut på Stockholmsbörsen.",
44
+ highlight: "Ekonominytt:"
45
+ })}}
46
+ ```
47
+
48
+ ### SCSS
49
+ ```scss
50
+ @use "@bonniernews/dn-design-system-web/components/teaser-standard/teaser-standard" as *;
51
+ ```
52
+
53
+ ### Javascript
54
+ This version is rarely used to render a teaser dynamically in the browser. For example, it is used to render reserv-teasers in failover. This version **ONLY** supports the `title`, `text`, `targetLink`, `classNames` and `attributes` parameters.
55
+
56
+ ```javascript
57
+ import { dsTeaserStandard } from "@bonniernews/dn-design-system-web/components/teaser-standard/teaser-standard";
58
+
59
+ // NB: javascript only supports a subset of all parameters
60
+ const parameters = {
61
+ title: "Upp på börsen",
62
+ text: "Det ser ganska normalt ut på Stockholmsbörsen",
63
+ targetLink: "https://www.dn.se/ekonomi/",
64
+ attributes: { "data-test" : "test-value" }
65
+ }
66
+
67
+ const teaserStandardHtml = dsTeaserStandard(parameters);
68
+ ```
@@ -1,68 +1,42 @@
1
- - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-standard](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-standard)
2
- - Storybook: [TeaserStandard](https://designsystem.dn.se/?path=/docs/section-teaserstandard--docs)
3
- - Storybook (Latest): [TeaserStandard](https://designsystem-latest.dn.se/?path=/docs/section-teaserstandard--docs)
4
-
5
- ----
6
-
7
- # teaser-standard
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
- |isCompact | bool | no | true, false | false | If the headline should be compact |
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
- |isSquareImage | boolean | no | | false | Flag so we can handle square teaser images |
30
- |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
31
- |classNames | String | no | | | Ex. "my-special-class" |
32
- |~forcePx~ | | | | | Not supported |
33
-
34
- ## Minimum requirement example
35
- These are copy paste friendly examples to quickliy get started using a component.
36
-
37
- ### Nunjucks
38
- ```html
39
- {% from '@bonniernews/dn-design-system-web/components/teaser-standard/teaser-standard.njk' import TeaserStandard %}
40
-
41
- {{ TeaserStandard({
42
- title: "Upp på börsen",
43
- text: "Det ser ganska normalt ut på Stockholmsbörsen.",
44
- highlight: "Ekonominytt:"
45
- })}}
46
- ```
47
-
48
- ### SCSS
49
- ```scss
50
- @use "@bonniernews/dn-design-system-web/components/teaser-standard/teaser-standard" as *;
51
- ```
52
-
53
- ### Javascript
54
- This version is rarely used to render a teaser dynamically in the browser. For example, it is used to render reserv-teasers in failover. This version **ONLY** supports the `title`, `text`, `targetLink`, `classNames` and `attributes` parameters.
55
-
56
- ```javascript
57
- import { dsTeaserStandard } from "@bonniernews/dn-design-system-web/components/teaser-standard/teaser-standard";
58
-
59
- // NB: javascript only supports a subset of all parameters
60
- const parameters = {
61
- title: "Upp på börsen",
62
- text: "Det ser ganska normalt ut på Stockholmsbörsen",
63
- targetLink: "https://www.dn.se/ekonomi/",
64
- attributes: { "data-test" : "test-value" }
65
- }
66
-
67
- const teaserStandardHtml = dsTeaserStandard(parameters);
68
- ```
1
+ TeaserStandard
2
+ ==============
3
+
4
+ * GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-standard](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-standard)
5
+ * Storybook: [TeaserStandard](https://designsystem.dn.se/?path=/docs/section-teaserstandard--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-standard/teaser-standard.scss'`
8
+
9
+ | Name | Description | Default |
10
+ |:--- | :--- | :--- |
11
+ | isSquareImage | Flag so we can handle square teaser images<br />boolean | false |
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 | \- |
21
+ | isItalicHeadline | If the headline should be italic<br />boolean | \- |
22
+ | bylinePicture | Image of the author<br />ComponentChild | \- |
23
+ | isCompact | If the teaser should be compact<br />boolean | \- |
24
+ | media | Main image or other media<br />ComponentChild | \- |
25
+ | sticker | Red text before the text<br />string | \- |
26
+ | highlight | Text before the heading<br />string | \- |
27
+ | 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", "bautaxl" | \- |
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
+
35
+ ```jsx
36
+ <TeaserStandard
37
+ media={<TeaserImage byline="Foto: Paul Hansen" image={<ExamplePicture alt="" className="picture picture--placeholder" sizes="(min-width: 1340px) 1010px, (min-width: 1100px) calc(100vw - 330px), 100vw" src="https://cached-images.bonnier.news/gcs/bilder/dn-mly/752e4f6d-7c66-4d24-81b1-4b24b12771a9.jpeg" srcSet="https://cached-images.bonnier.news/gcs/bilder/dn-mly/752e4f6d-7c66-4d24-81b1-4b24b12771a9.jpeg?interpolation=lanczos-none&amp;fit=around%7C770:434&amp;crop=770:h;center,top&amp;output-quality=80 770w, https://cached-images.bonnier.news/gcs/bilder/dn-mly/752e4f6d-7c66-4d24-81b1-4b24b12771a9.jpeg?interpolation=lanczos-none&amp;fit=around%7C1010:569&amp;crop=1010:h;center,top&amp;output-quality=80 1010w, https://cached-images.bonnier.news/gcs/bilder/dn-mly/752e4f6d-7c66-4d24-81b1-4b24b12771a9.jpeg?interpolation=lanczos-none&amp;fit=around%7C1540:867&amp;crop=1540:h;center,top&amp;output-quality=60 1540w, https://cached-images.bonnier.news/gcs/bilder/dn-mly/752e4f6d-7c66-4d24-81b1-4b24b12771a9.jpeg?interpolation=lanczos-none&amp;fit=around%7C2020:1137&amp;crop=2020:h;center,top&amp;output-quality=60 2020w" style={{aspectRatio: '16 / 9'}}/>}/>}
38
+ targetLink="https://www.dn.se/sverige/ryska-militarflyg-over-ostersjon/"
39
+ text=" Flög utan transpondrar Upptäcktes av tyska flygvapnet."
40
+ title="Ryska militärflyg över Östersjön"
41
+ />
42
+ ```
@@ -8,7 +8,7 @@ The component will not include styling by itself. Make sure to include the right
8
8
 
9
9
  | Name | Description | Default |
10
10
  |:--- | :--- | :--- |
11
- | bylinePicture | Image of the author<br />ComponentChild | \- |
11
+ | isSquareImage | Flag so we can handle square teaser images<br />boolean | \- |
12
12
  | attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
13
13
  | classNames | Ex. "my-special-class"<br />string | \- |
14
14
  | sectionName | Shows in teaser footer<br />string | \- |
@@ -19,13 +19,14 @@ The component will not include styling by itself. Make sure to include the right
19
19
  | isFlashingDot | If there should be a flashing ball before the text<br />boolean | \- |
20
20
  | isLargeHeadline | If the headline should be large (only if `isItalicHeadline` is true)<br />boolean | \- |
21
21
  | isItalicHeadline | If the headline should be italic<br />boolean | \- |
22
+ | bylinePicture | Image of the author<br />ComponentChild | \- |
22
23
  | time | The timestamp text of the teaser<br />string | \- |
23
24
  | media | Main image or other media<br />ComponentChild | \- |
24
25
  | sticker | Red text before the text<br />string | \- |
25
26
  | highlight | Text before the heading<br />string | \- |
26
27
  | vignette | Top text in the teaser<br />string | \- |
27
28
  | text | Teaser subtext<br />string | \- |
28
- | theme | The theme-class to apply to the teaser<br />"kultur", "nyheter" | \- |
29
+ | theme | The theme-class to apply to the teaser<br />"nyheter", "kultur" | \- |
29
30
  | areaType | The area where the column is rendered<br />"right", "bauta", "bautaxl" | \- |
30
31
  | variant | Variant of the teaser<br />"default", "podcast", "insandare", "direkt" | \- |
31
32
  | targetLink\* | Target URL for the teaser<br />string | \- |
@@ -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
- | title\* | string | \- |
12
- | text | string | \- |
13
11
  | classNames | Ex. "my-special-class"<br />string | \- |
14
12
  | attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
15
- | areaType | "main", "right", "bauta", "bautaxl" | \- |
16
- | targetLink | string | \- |
17
- | theme | "kultur", "nyheter" | \- |
13
+ | targetLink\* | Target URL for the teaser<br />string | \- |
14
+ | areaType | The area where the column is rendered<br />"right", "bauta", "bautaxl" | \- |
15
+ | title\* | Heading of the teaser<br />string | \- |
16
+ | text | Teaser subtext<br />string | \- |
18
17
 
19
18
  ```jsx
20
19
  <TeaserTipsa
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "32.7.37",
3
+ "version": "32.7.39",
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",
@@ -21,6 +21,8 @@ export interface TeaserProps extends SharedProps {
21
21
  sticker?: string;
22
22
  /** Main image or other media */
23
23
  media?: ComponentChild;
24
+ /** Flag so we can handle square teaser images */
25
+ isSquareImage?: boolean;
24
26
  /** Image of the author */
25
27
  bylinePicture?: ComponentChild;
26
28
  /** If the headline should be italic */
@@ -32,8 +32,12 @@ import { jsx as jsx4 } from "preact/jsx-runtime";
32
32
 
33
33
  // ../src/helpers/teaser.tsx
34
34
  import { Fragment, jsx as jsx5, jsxs as jsxs2 } from "preact/jsx-runtime";
35
- var Media = ({ media, rounded }) => {
36
- const classNames = "ds-teaser__media" + (rounded ? " ds-teaser__media--rounded" : "");
35
+ var Media = ({ media, rounded, isSquareImage }) => {
36
+ const classNames = formatClassString([
37
+ "ds-teaser__media",
38
+ rounded && "ds-teaser__media--rounded",
39
+ isSquareImage && "ds-teaser__media--square-image"
40
+ ]);
37
41
  return media ? /* @__PURE__ */ jsx5("div", { className: classNames, children: media }) : null;
38
42
  };
39
43
  var Content = ({ children, bylinePicture }) => {