@bonniernews/dn-design-system-web 32.7.9 → 32.7.11
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/components/article-body-image/README.md +1 -1
- package/components/byline/README.md +13 -3
- package/components/byline-list/README.md +2 -2
- package/components/group-header/README-njk.md +56 -0
- package/components/group-header/README.md +29 -56
- package/components/mask/README-NJK.md +36 -0
- package/components/mask/README.md +21 -36
- package/components/profile-header/README.md +1 -1
- package/components/teaser-image/README-NJK.md +39 -0
- package/components/teaser-image/README.md +24 -39
- package/components/text-input/README.md +1 -1
- package/package.json +1 -1
- package/preact/components/group-header/group-header.d.ts +40 -0
- package/preact/components/group-header/group-header.js +313 -0
- package/preact/components/group-header/group-header.js.map +7 -0
- package/preact/components/mask/mask.d.ts +14 -0
- package/preact/components/mask/mask.js +23 -0
- package/preact/components/mask/mask.js.map +7 -0
- package/preact/components/teaser-footer/teaser-footer.js.map +2 -2
- package/preact/components/teaser-image/teaser-image.d.ts +17 -0
- package/preact/components/teaser-image/teaser-image.js +38 -0
- package/preact/components/teaser-image/teaser-image.js.map +7 -0
- package/components/mask/README-UXD.md +0 -0
- package/components/teaser-image/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.11](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.10...@bonniernews/dn-design-system-web@32.7.11) (2025-07-07)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* **web:** group header tsx ([#1809](https://github.com/BonnierNews/dn-design-system/issues/1809)) ([d1cd7aa](https://github.com/BonnierNews/dn-design-system/commit/d1cd7aadf28c734674e2b9a6267801f27c8446f0))
|
|
13
|
+
|
|
14
|
+
## [32.7.10](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.9...@bonniernews/dn-design-system-web@32.7.10) (2025-07-04)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **web:** tsx teaserimage and mask ([#1802](https://github.com/BonnierNews/dn-design-system/issues/1802)) ([4b1e264](https://github.com/BonnierNews/dn-design-system/commit/4b1e264f7134ee2eade79fb60330d90a0d9bf390))
|
|
20
|
+
|
|
7
21
|
## [32.7.9](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@32.7.8...@bonniernews/dn-design-system-web@32.7.9) (2025-07-03)
|
|
8
22
|
|
|
9
23
|
|
|
@@ -21,7 +21,7 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
21
21
|
<ArticleBodyImage
|
|
22
22
|
author="Paul Hansen"
|
|
23
23
|
caption="Detta är en bildtext"
|
|
24
|
-
image={<ExamplePicture 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'}}/>}
|
|
24
|
+
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'}}/>}
|
|
25
25
|
imageType="Foto"
|
|
26
26
|
/>
|
|
27
27
|
```
|
|
@@ -27,8 +27,18 @@ initModalByline(articleElement);
|
|
|
27
27
|
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
28
28
|
|
|
29
29
|
```jsx
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
<Byline
|
|
31
|
+
bylineTitle="Text"
|
|
32
|
+
bylines={[
|
|
33
|
+
{
|
|
34
|
+
authorId: '123',
|
|
35
|
+
authorPageUrl: 'https://www.dn.se/av/peter-wolodarski',
|
|
36
|
+
bylineImage: <ExamplePicture alt="Wolo" sizes="44px" src="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80" srcSet="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80 44w, https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=88:88&output-quality=60 88w" style={{aspectRatio: '1 / 1'}}/>,
|
|
37
|
+
followable: true,
|
|
38
|
+
name: 'Peter Wolodarski',
|
|
39
|
+
role: 'Text',
|
|
40
|
+
variant: 'link'
|
|
41
|
+
}
|
|
42
|
+
]}
|
|
33
43
|
/>
|
|
34
44
|
```
|
|
@@ -24,7 +24,7 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
24
24
|
{
|
|
25
25
|
authorId: '1',
|
|
26
26
|
authorPageUrl: 'https://www.dn.se/av/peter-wolodarski',
|
|
27
|
-
bylineImage: <ExamplePicture src="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80" srcSet="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80 44w, https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=88:88&output-quality=60 88w" style={{aspectRatio: '1 / 1'}}/>,
|
|
27
|
+
bylineImage: <ExamplePicture alt="Wolo" sizes="44px" src="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80" srcSet="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80 44w, https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=88:88&output-quality=60 88w" style={{aspectRatio: '1 / 1'}}/>,
|
|
28
28
|
followable: false,
|
|
29
29
|
name: 'Byline link',
|
|
30
30
|
role: 'Grafik'
|
|
@@ -32,7 +32,7 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
32
32
|
{
|
|
33
33
|
authorId: '123',
|
|
34
34
|
authorPageUrl: 'https://www.dn.se/av/peter-wolodarski',
|
|
35
|
-
bylineImage: <ExamplePicture src="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80" srcSet="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80 44w, https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=88:88&output-quality=60 88w" style={{aspectRatio: '1 / 1'}}/>,
|
|
35
|
+
bylineImage: <ExamplePicture alt="Wolo" sizes="44px" src="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80" srcSet="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=44:44&output-quality=80 44w, https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&crop=261:261;81,2&resize=88:88&output-quality=60 88w" style={{aspectRatio: '1 / 1'}}/>,
|
|
36
36
|
followable: true,
|
|
37
37
|
name: 'Test Testsson',
|
|
38
38
|
role: 'Text'
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/group-header](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/group-header)
|
|
2
|
+
- Storybook: [GroupHeader](https://designsystem.dn.se/?path=/docs/basic-groupheader--docs)
|
|
3
|
+
- Storybook (Latest): [GroupHeader](https://designsystem.dn.se/?path=/docs/basic-groupheader--docs)
|
|
4
|
+
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
# GroupHeader
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
|parameter | type | required | options | default | description |
|
|
12
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
+
|title | string | yes | | | The title text |
|
|
14
|
+
|type | string | no | icon, link, toggle, arrows | icon | The type of interactive element added to the header |
|
|
15
|
+
|variant | string | no | bauta, bauataxl | | The design variant, if not bauta or bautaxl the group header will get the 'standard' design |
|
|
16
|
+
|mediaHtml | string | no | | | The image markup for the header |
|
|
17
|
+
|href | string | no | | | If given, the title is rendered as a link |
|
|
18
|
+
|linkText | string | no | | | The link text to render (only for types `link` and `direkt`) |
|
|
19
|
+
|showBottomBorder | boolean | no | | | If true there will be a bottom border |
|
|
20
|
+
|toggleText | text | no | | | `text` parameter to ToggleButton (only for type `toggle`) |
|
|
21
|
+
|toggleSelectedText | text | no | | | `selectedText` parameter to ToggleButton (only for type `toggle`) |
|
|
22
|
+
|toggleSelected | boolean | no | | | `selected` parameter to ToggleButton (only for type `toggle`) |
|
|
23
|
+
|toggleLoading | boolean | no | | | `loading` parameter to ToggleButton (only for type `toggle`) |
|
|
24
|
+
|toggleClassNames | text | no | | | `classNames` parameter to ToggleButton (only for type `toggle`) |
|
|
25
|
+
|toggleAttributes | text | no | | | `attributes` parameter to ToggleButton (only for type `toggle`) |
|
|
26
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
27
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
28
|
+
|
|
29
|
+
NB: The `arrows` type is only active in desktop environments. It is equivalent to `link` or `icon` in non-desktop environments, depending on if the `linkText` parameter is also given.
|
|
30
|
+
|
|
31
|
+
Depending on type, either the `toggle-*` or `linkText` parameters are allowed. In `icon` and `link` mode, the `href` parameter is required to show the ornament.
|
|
32
|
+
|
|
33
|
+
The type `toggle` is (currently) not allowed if variant is bauta or bautaxl.
|
|
34
|
+
|
|
35
|
+
## Minimum requirement example
|
|
36
|
+
|
|
37
|
+
### Nunjucks
|
|
38
|
+
|
|
39
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
40
|
+
|
|
41
|
+
```html
|
|
42
|
+
{% from '@bonniernews/dn-design-system-web/components/group-header/group-header.njk' import GroupHeader %}
|
|
43
|
+
|
|
44
|
+
{{ GroupHeader({
|
|
45
|
+
title: "Dagens Nyheter",
|
|
46
|
+
href: "https://www.dn.se/"
|
|
47
|
+
}) }}
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### SCSS
|
|
51
|
+
```scss
|
|
52
|
+
@use "@bonniernews/dn-design-system-web/components/group-header/group-header";
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### JS
|
|
56
|
+
If you use the `toggle` type, you might need to initiate that component, [as per the documentation](https://designsystem.dn.se/?path=/readmetab/basic-buttons-buttontoggle--docs).
|
|
@@ -1,56 +1,29 @@
|
|
|
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
|
-
Depending on type, either the `toggle-*` or `linkText` parameters are allowed. In `icon` and `link` mode, the `href` parameter is required to show the ornament.
|
|
32
|
-
|
|
33
|
-
The type `toggle` is (currently) not allowed if variant is bauta or bautaxl.
|
|
34
|
-
|
|
35
|
-
## Minimum requirement example
|
|
36
|
-
|
|
37
|
-
### Nunjucks
|
|
38
|
-
|
|
39
|
-
These are copy paste friendly examples to quickliy get started using a component.
|
|
40
|
-
|
|
41
|
-
```html
|
|
42
|
-
{% from '@bonniernews/dn-design-system-web/components/group-header/group-header.njk' import GroupHeader %}
|
|
43
|
-
|
|
44
|
-
{{ GroupHeader({
|
|
45
|
-
title: "Dagens Nyheter",
|
|
46
|
-
href: "https://www.dn.se/"
|
|
47
|
-
}) }}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
### SCSS
|
|
51
|
-
```scss
|
|
52
|
-
@use "@bonniernews/dn-design-system-web/components/group-header/group-header";
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
### JS
|
|
56
|
-
If you use the `toggle` type, you might need to initiate that component, [as per the documentation](https://designsystem.dn.se/?path=/readmetab/basic-buttons-buttontoggle--docs).
|
|
1
|
+
GroupHeader
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
* GitHub: [BonnierNews/dn-design-system/../web/src/components/group-header](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/group-header)
|
|
5
|
+
* Storybook: [GroupHeader](https://designsystem.dn.se/?path=/docs/basic-groupheader--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/group-header/group-header.scss'`
|
|
8
|
+
|
|
9
|
+
| Name | Description | Default |
|
|
10
|
+
|:--- | :--- | :--- |
|
|
11
|
+
| title\* | The title text<br />string | \- |
|
|
12
|
+
| type | The type of interactive element added to the header<br />"toggle", "link", "icon", "arrows" | "icon" |
|
|
13
|
+
| variant | The design variant, if not bauta or bautaxl the group header will get the 'standard' design<br />"bauta", "bauataxl" | \- |
|
|
14
|
+
| media | The image element for the header<br />ComponentChild | \- |
|
|
15
|
+
| href | If given, the title is rendered as a link<br />string | \- |
|
|
16
|
+
| linkText | The link text to render (only for types `link` and `arrows`)<br />string | \- |
|
|
17
|
+
| showBottomBorder | If true there will be a bottom border<br />boolean | false |
|
|
18
|
+
| toggleText | `text` parameter to ToggleButton (only for type `toggle`)<br />string | \- |
|
|
19
|
+
| toggleSelectedText | `selectedText` parameter to ToggleButton (only for type `toggle`)<br />string | \- |
|
|
20
|
+
| toggleSelected | `selected` parameter to ToggleButton (only for type `toggle`)<br />boolean | false |
|
|
21
|
+
| toggleLoading | `loading` parameter to ToggleButton (only for type `toggle`)<br />boolean | false |
|
|
22
|
+
| toggleClassNames | `classNames` parameter to ToggleButton (only for type `toggle`)<br />string | \- |
|
|
23
|
+
| toggleAttributes | `attributes` parameter to ToggleButton (only for type `toggle`)<br />{ \[key: string\]: string; } | { } |
|
|
24
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
25
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | { } |
|
|
26
|
+
|
|
27
|
+
```jsx
|
|
28
|
+
<GroupHeader title="Dn granskar" />
|
|
29
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/mask](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/mask)
|
|
2
|
+
- Storybook: [Subcomponents > Mask](https://designsystem.dn.se/?path=/docs/section-subcomponents-mask--docs)
|
|
3
|
+
- Storybook (Latest): [Subcomponents > Mask](https://designsystem-latest.dn.se/?path=/docs/section-subcomponents-mask--docs)
|
|
4
|
+
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
# Mask
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
|parameter | type | required | options | default | description |
|
|
12
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
+
|imageHtml | HTML String | yes | | | The img element or equivalent to mask |
|
|
14
|
+
|variant | String | yes | quiz-mask | quiz-mask | Mask variant |
|
|
15
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
16
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
17
|
+
|
|
18
|
+
## Minimum requirement example
|
|
19
|
+
|
|
20
|
+
### Nunjucks
|
|
21
|
+
|
|
22
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
23
|
+
|
|
24
|
+
```html
|
|
25
|
+
{% from '@bonniernews/dn-design-system-web/components/mask/mask.njk' import Mask %}
|
|
26
|
+
|
|
27
|
+
{{ Mask({
|
|
28
|
+
variant: "quiz-mask",
|
|
29
|
+
imageHtml: "<img src='cool-pic.jpg'>"
|
|
30
|
+
})}}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### SCSS
|
|
34
|
+
```scss
|
|
35
|
+
@use "@bonniernews/dn-design-system-web/components/mask/mask";
|
|
36
|
+
```
|
|
@@ -1,36 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
|
12
|
-
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
These are copy paste friendly examples to quickliy get started using a component.
|
|
23
|
-
|
|
24
|
-
```html
|
|
25
|
-
{% from '@bonniernews/dn-design-system-web/components/mask/mask.njk' import Mask %}
|
|
26
|
-
|
|
27
|
-
{{ Mask({
|
|
28
|
-
variant: "quiz-mask",
|
|
29
|
-
imageHtml: "<img src='cool-pic.jpg'>"
|
|
30
|
-
})}}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### SCSS
|
|
34
|
-
```scss
|
|
35
|
-
@use "@bonniernews/dn-design-system-web/components/mask/mask";
|
|
36
|
-
```
|
|
1
|
+
Mask
|
|
2
|
+
====
|
|
3
|
+
|
|
4
|
+
* GitHub: [BonnierNews/dn-design-system/../web/src/components/mask](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/mask)
|
|
5
|
+
* Storybook: [Mask](https://designsystem.dn.se/?path=/docs/section-subcomponents-mask--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/mask/mask.scss'`
|
|
8
|
+
|
|
9
|
+
| Name | Description | Default |
|
|
10
|
+
|:--- | :--- | :--- |
|
|
11
|
+
| image\* | ComponentChild | \- |
|
|
12
|
+
| variant\* | "quiz-mask" | \- |
|
|
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
|
+
<Mask
|
|
18
|
+
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'}}/>}
|
|
19
|
+
variant="quiz-mask"
|
|
20
|
+
/>
|
|
21
|
+
```
|
|
@@ -27,7 +27,7 @@ The component will not include styling by itself. Make sure to include the right
|
|
|
27
27
|
<ProfileHeader
|
|
28
28
|
articleCount={400}
|
|
29
29
|
descriptionHtml="<p>Peter Wolodarski är chefredaktör och ansvarig utgivare för Dagens Nyheter.</p>"
|
|
30
|
-
media={<ExamplePicture className="picture" src="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&downsize=120:*&output-quality=80" srcSet="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&downsize=240:*&output-quality=60 240w, https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&downsize=480:*&output-quality=60 480w" style={{aspectRatio: '450 / 1020'}}/>}
|
|
30
|
+
media={<ExamplePicture className="picture" sizes="120px" src="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&downsize=120:*&output-quality=80" srcSet="https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&downsize=240:*&output-quality=60 240w, https://cached-images.bonnier.news/gcs/bilder/dn-author/i3v3p74rhqjfaaz5bh55j7plztzslpgpr3go52zr4q4dzdtyit3q-450x1020.png?interpolation=lanczos-none&downsize=480:*&output-quality=60 480w" style={{aspectRatio: '450 / 1020'}}/>}
|
|
31
31
|
subtitleHtml="<a href='mailto:peter.wolodarski@dn.se'>peter.wolodarski@dn.se</a>"
|
|
32
32
|
title="Peter Wolodarski"
|
|
33
33
|
toggle
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-image](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-image)
|
|
2
|
+
- Storybook: [Subcomponents > TeaserImage](https://designsystem.dn.se/?path=/docs/section-subcomponents-teaserimage--docs)
|
|
3
|
+
- Storybook (Latest): [Subcomponents > TeaserImage](https://designsystem-latest.dn.se/?path=/docs/section-subcomponents-teaserimage--docs)
|
|
4
|
+
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
# teaser-image
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
|parameter | type | required | options | default | description |
|
|
12
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
+
|imageHtml | HTML String | yes | | | The img element or equivalent |
|
|
14
|
+
|byline | String | no | | | Media credit text |
|
|
15
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
16
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
17
|
+
|~forcePx~ | | | | | Always applied |
|
|
18
|
+
|
|
19
|
+
## Minimum requirement example
|
|
20
|
+
|
|
21
|
+
### Nunjucks
|
|
22
|
+
|
|
23
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-image/teaser-image.njk' import TeaserImage %}
|
|
27
|
+
|
|
28
|
+
{{ TeaserImage({
|
|
29
|
+
imageHtml: "<img src='??'>",
|
|
30
|
+
byline: "Foto: Paul Hansen"
|
|
31
|
+
})}}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### SCSS
|
|
35
|
+
```scss
|
|
36
|
+
@use "@bonniernews/dn-design-system-web/components/teaser-image/teaser-image" as *;
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
This scss is already included in `teaser.scss`.
|
|
@@ -1,39 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
|
12
|
-
|:--- | :--- | :--- |
|
|
13
|
-
|
|
|
14
|
-
|byline |
|
|
15
|
-
|
|
|
16
|
-
|classNames |
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```html
|
|
26
|
-
{% from '@bonniernews/dn-design-system-web/components/teaser-image/teaser-image.njk' import TeaserImage %}
|
|
27
|
-
|
|
28
|
-
{{ TeaserImage({
|
|
29
|
-
imageHtml: "<img src='??'>",
|
|
30
|
-
byline: "Foto: Paul Hansen"
|
|
31
|
-
})}}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### SCSS
|
|
35
|
-
```scss
|
|
36
|
-
@use "@bonniernews/dn-design-system-web/components/teaser-image/teaser-image" as *;
|
|
37
|
-
```
|
|
38
|
-
|
|
39
|
-
This scss is already included in `teaser.scss`.
|
|
1
|
+
TeaserImage
|
|
2
|
+
===========
|
|
3
|
+
|
|
4
|
+
* GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-image](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-image)
|
|
5
|
+
* Storybook: [TeaserImage](https://designsystem.dn.se/?path=/docs/section-subcomponents-teaserimage--docs)
|
|
6
|
+
|
|
7
|
+
Image caption will never scale (forcePx is always true)
|
|
8
|
+
|
|
9
|
+
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-image/teaser-image.scss'`
|
|
10
|
+
|
|
11
|
+
| Name | Description | Default |
|
|
12
|
+
|:--- | :--- | :--- |
|
|
13
|
+
| image\* | ComponentChild | \- |
|
|
14
|
+
| byline | string | \- |
|
|
15
|
+
| mask | "quiz-mask" | \- |
|
|
16
|
+
| classNames | Ex. "my-special-class"<br />string | \- |
|
|
17
|
+
| attributes | Ex. { target: "\_blank", "data-test": "lorem ipsum" }<br />Record<string, unknown> | \- |
|
|
18
|
+
|
|
19
|
+
```jsx
|
|
20
|
+
<TeaserImage
|
|
21
|
+
byline="Foto: Paul Hansen"
|
|
22
|
+
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'}}/>}
|
|
23
|
+
/>
|
|
24
|
+
```
|
|
@@ -17,7 +17,7 @@ import textInput from '@bonniernews/dn-design-system-web/components/text-input/t
|
|
|
17
17
|
| Name | Description | Default |
|
|
18
18
|
|:--- | :--- | :--- |
|
|
19
19
|
| name\* | It's used as name and id<br />string | \- |
|
|
20
|
-
| type | text, password, email, etc<br />"number", "text", "search", "
|
|
20
|
+
| type | text, password, email, etc<br />"number", "text", "search", "image", "color", "date", "datetime-local", "email" | "text" |
|
|
21
21
|
| label\* | A label for the input<br />string | \- |
|
|
22
22
|
| error | Used if error state shoud be set on load<br />boolean | \- |
|
|
23
23
|
| errorMessage | What error message that should be displayed<br />string | \- |
|
package/package.json
CHANGED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { ComponentChild } from 'preact';
|
|
2
|
+
import { SharedProps } from '../../assets/types/shared-props';
|
|
3
|
+
export interface GroupHeaderProps extends SharedProps {
|
|
4
|
+
/** The title text */
|
|
5
|
+
title: string;
|
|
6
|
+
/** The type of interactive element added to the header */
|
|
7
|
+
type?: 'icon' | 'link' | 'toggle' | 'arrows';
|
|
8
|
+
/** The design variant, if not bauta or bautaxl the group header will get the 'standard' design */
|
|
9
|
+
variant?: 'bauta' | 'bauataxl';
|
|
10
|
+
/** The image element for the header */
|
|
11
|
+
media?: ComponentChild;
|
|
12
|
+
/** If given, the title is rendered as a link */
|
|
13
|
+
href?: string;
|
|
14
|
+
/** The link text to render (only for types `link` and `arrows`) */
|
|
15
|
+
linkText?: string;
|
|
16
|
+
/** If true there will be a bottom border */
|
|
17
|
+
showBottomBorder?: boolean;
|
|
18
|
+
/** `text` parameter to ToggleButton (only for type `toggle`) */
|
|
19
|
+
toggleText?: string;
|
|
20
|
+
/** `selectedText` parameter to ToggleButton (only for type `toggle`) */
|
|
21
|
+
toggleSelectedText?: string;
|
|
22
|
+
/** `selected` parameter to ToggleButton (only for type `toggle`) */
|
|
23
|
+
toggleSelected?: boolean;
|
|
24
|
+
/** `loading` parameter to ToggleButton (only for type `toggle`) */
|
|
25
|
+
toggleLoading?: boolean;
|
|
26
|
+
/** `classNames` parameter to ToggleButton (only for type `toggle`) */
|
|
27
|
+
toggleClassNames?: string;
|
|
28
|
+
/** `attributes` parameter to ToggleButton (only for type `toggle`) */
|
|
29
|
+
toggleAttributes?: {
|
|
30
|
+
[key: string]: string;
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* - GitHub: [BonnierNews/dn-design-system/../web/src/components/group-header](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/group-header)
|
|
35
|
+
* - Storybook: [GroupHeader](https://designsystem.dn.se/?path=/docs/basic-groupheader--docs)
|
|
36
|
+
*
|
|
37
|
+
* The component will not include styling by itself. Make sure to include the right styles for the component. See example below:
|
|
38
|
+
* `@use '@bonniernews/dn-design-system-web/components/group-header/group-header.scss'`
|
|
39
|
+
*/
|
|
40
|
+
export declare function GroupHeader({ title, type, variant, media, href, linkText, showBottomBorder, toggleText, toggleSelectedText, toggleSelected, toggleLoading, toggleClassNames, toggleAttributes, classNames, attributes, }: GroupHeaderProps): import("preact").JSX.Element;
|