@bonniernews/dn-design-system-web 21.1.2 → 21.1.4
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/teaser/teaser.scss +6 -4
- package/components/badge/badge.scss +6 -5
- package/components/blocked-content/blocked-content.scss +8 -6
- package/components/buddy-menu/buddy-menu.scss +13 -10
- package/components/button/button.scss +29 -19
- package/components/checkbox/checkbox.scss +1 -1
- package/components/disclaimer/disclaimer.scss +6 -4
- package/components/divider/README-NJK.md +34 -0
- package/components/divider/README.md +7 -30
- package/components/divider/divider.tsx +7 -0
- package/components/empty-state/empty-state.scss +6 -4
- package/components/factbox/factbox.scss +6 -4
- package/components/footer/footer.scss +5 -6
- package/components/game-header/game-header.scss +6 -4
- package/components/group-header/group-header.scss +4 -3
- package/components/image-caption/image-caption.scss +3 -2
- package/components/link-box/link-box-item.scss +6 -4
- package/components/list-item/list-item.scss +22 -14
- package/components/modal/modal.scss +6 -4
- package/components/pagination/pagination.scss +3 -2
- package/components/profile-header/profile-header.scss +9 -6
- package/components/quote/README-NJK.md +36 -0
- package/components/quote/README.md +7 -32
- package/components/quote/quote.scss +3 -2
- package/components/quote/quote.tsx +7 -0
- package/components/radio-button/radio-button.scss +1 -1
- package/components/tag-header/tag-header.scss +13 -9
- package/components/teaser-card/README-NJK.md +41 -0
- package/components/teaser-card/README.md +13 -37
- package/components/teaser-card/teaser-card.tsx +7 -0
- package/components/teaser-footer/teaser-footer.scss +6 -4
- package/components/teaser-image/teaser-image.scss +3 -2
- package/components/teaser-list-vertical/teaser-list-vertical.scss +6 -4
- package/components/teaser-longlife/teaser-longlife.scss +1 -1
- package/components/teaser-native/teaser-native.scss +3 -3
- package/components/teaser-onsite/README-NJK.md +45 -0
- package/components/teaser-onsite/README.md +12 -37
- package/components/teaser-onsite/teaser-onsite.tsx +11 -0
- package/components/teaser-standard/teaser-standard.scss +0 -1
- package/components/teaser-swipe-card/teaser-swipe-card.scss +7 -5
- package/components/teaser-tipsa/teaser-tipsa.scss +1 -1
- package/components/text-button/text-button.scss +14 -13
- package/components/text-button-toggle/text-button-toggle.scss +6 -3
- package/components/text-input/text-input.scss +6 -5
- package/components/thematic-break/README-NJK.md +31 -0
- package/components/thematic-break/README.md +7 -27
- package/components/thematic-break/thematic-break.tsx +8 -0
- package/components/tooltip/tooltip.scss +1 -1
- package/components/video-caption/video-caption.scss +4 -3
- package/components/vip-badge/vip-badge.scss +3 -3
- package/foundations/helpers/links.scss +27 -22
- package/foundations/helpers/mediaQueries.scss +0 -2
- package/foundations/helpers/metrics.scss +1 -2
- package/foundations/helpers/shadows.scss +0 -2
- package/foundations/helpers/spacing.scss +4 -3
- package/foundations/helpers/typography.scss +14 -8
- package/foundations/helpers/utilities.scss +2 -1
- package/foundations/shadows.scss +3 -3
- package/foundations/spacing.scss +2 -2
- package/package.json +1 -1
- package/preact/components/divider/divider.d.ts +7 -0
- package/preact/components/quote/quote.d.ts +7 -0
- package/preact/components/teaser-card/teaser-card.d.ts +7 -0
- package/preact/components/teaser-onsite/teaser-onsite.d.ts +11 -0
- package/preact/components/thematic-break/thematic-break.d.ts +7 -0
- package/preact/components.cjs.map +2 -2
- package/preact/components.esm.js.map +2 -2
- package/react/components/divider/divider.d.ts +7 -0
- package/react/components/quote/quote.d.ts +7 -0
- package/react/components/teaser-card/teaser-card.d.ts +7 -0
- package/react/components/teaser-onsite/teaser-onsite.d.ts +11 -0
- package/react/components/thematic-break/thematic-break.d.ts +7 -0
- package/react/components.cjs.map +2 -2
- package/react/components.esm.js.map +2 -2
|
@@ -89,14 +89,16 @@ $ds-list-item__portrait-size--small: 36px;
|
|
|
89
89
|
overflow-wrap: anywhere;
|
|
90
90
|
|
|
91
91
|
.ds-list-item__title {
|
|
92
|
-
|
|
92
|
+
text-align: left;
|
|
93
|
+
@include ds-typography($ds-typography-functionalbody02, $lineHeight: $ds-lineheight-m) {
|
|
94
|
+
color: $ds-color-text-primary;
|
|
95
|
+
}
|
|
93
96
|
@at-root .ds-force-px#{&} {
|
|
94
|
-
@include ds-typography($ds-typography-functionalbody02, $lineHeight: $ds-lineheight-m, $forcePx: true)
|
|
97
|
+
@include ds-typography($ds-typography-functionalbody02, $lineHeight: $ds-lineheight-m, $forcePx: true) {
|
|
98
|
+
color: $ds-color-text-primary;
|
|
99
|
+
}
|
|
95
100
|
}
|
|
96
101
|
|
|
97
|
-
color: $ds-color-text-primary;
|
|
98
|
-
text-align: left;
|
|
99
|
-
|
|
100
102
|
&.ds-list-item__title--semibold {
|
|
101
103
|
@include ds-typography(
|
|
102
104
|
$ds-typography-functionalbody02,
|
|
@@ -137,22 +139,28 @@ $ds-list-item__portrait-size--small: 36px;
|
|
|
137
139
|
}
|
|
138
140
|
|
|
139
141
|
.ds-list-item__subtitle {
|
|
140
|
-
|
|
142
|
+
text-align: left;
|
|
143
|
+
@include ds-typography($ds-typography-functionalbody02) {
|
|
144
|
+
color: $ds-color-text-primary-02;
|
|
145
|
+
}
|
|
141
146
|
@at-root .ds-force-px#{&} {
|
|
142
|
-
@include ds-typography($ds-typography-functionalbody02, true)
|
|
147
|
+
@include ds-typography($ds-typography-functionalbody02, true) {
|
|
148
|
+
color: $ds-color-text-primary-02;
|
|
149
|
+
}
|
|
143
150
|
}
|
|
144
|
-
color: $ds-color-text-primary-02;
|
|
145
|
-
text-align: left;
|
|
146
151
|
}
|
|
147
152
|
}
|
|
148
153
|
|
|
149
154
|
.ds-list-item__meta {
|
|
150
|
-
|
|
155
|
+
text-align: right;
|
|
156
|
+
@include ds-typography($ds-typography-functionalbody01) {
|
|
157
|
+
color: $ds-color-text-primary-02;
|
|
158
|
+
}
|
|
151
159
|
@at-root .ds-force-px#{&} {
|
|
152
|
-
@include ds-typography($ds-typography-functionalbody01, true)
|
|
160
|
+
@include ds-typography($ds-typography-functionalbody01, true) {
|
|
161
|
+
color: $ds-color-text-primary-02;
|
|
162
|
+
}
|
|
153
163
|
}
|
|
154
|
-
color: $ds-color-text-primary-02;
|
|
155
|
-
text-align: right;
|
|
156
164
|
}
|
|
157
165
|
|
|
158
166
|
.ds-list-item__icon-left {
|
|
@@ -265,9 +273,9 @@ $ds-list-item__portrait-size--small: 36px;
|
|
|
265
273
|
|
|
266
274
|
.ds-list-item--toggle {
|
|
267
275
|
a {
|
|
268
|
-
@include ds-link($ds-link-list);
|
|
269
276
|
display: block;
|
|
270
277
|
width: 100%;
|
|
278
|
+
@include ds-link($ds-link-list);
|
|
271
279
|
}
|
|
272
280
|
}
|
|
273
281
|
|
|
@@ -85,17 +85,19 @@ body.no-scroll {
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
> h2 {
|
|
88
|
-
@include ds-typography($ds-typography-functionalheading03);
|
|
89
88
|
margin: ds-spacing(0 0 $ds-s-200);
|
|
90
|
-
color: $ds-color-text-primary;
|
|
91
89
|
text-align: center;
|
|
90
|
+
@include ds-typography($ds-typography-functionalheading03) {
|
|
91
|
+
color: $ds-color-text-primary;
|
|
92
|
+
}
|
|
92
93
|
}
|
|
93
94
|
|
|
94
95
|
> p {
|
|
95
|
-
@include ds-typography($ds-typography-functionalbody02);
|
|
96
96
|
margin: 0;
|
|
97
97
|
text-align: center;
|
|
98
|
-
|
|
98
|
+
@include ds-typography($ds-typography-functionalbody02) {
|
|
99
|
+
color: $ds-color-text-primary;
|
|
100
|
+
}
|
|
99
101
|
}
|
|
100
102
|
|
|
101
103
|
> .ds-modal__buttons {
|
|
@@ -19,14 +19,15 @@
|
|
|
19
19
|
display: flex;
|
|
20
20
|
}
|
|
21
21
|
&__page {
|
|
22
|
-
@include ds-typography($ds-typography-functionalbody02);
|
|
23
|
-
color: $ds-color-text-primary;
|
|
24
22
|
margin: ds-spacing($ds-s-050);
|
|
25
23
|
min-height: ds-px-to-rem(32);
|
|
26
24
|
min-width: ds-px-to-rem(32);
|
|
27
25
|
display: flex;
|
|
28
26
|
align-items: center;
|
|
29
27
|
justify-content: center;
|
|
28
|
+
@include ds-typography($ds-typography-functionalbody02) {
|
|
29
|
+
color: $ds-color-text-primary;
|
|
30
|
+
}
|
|
30
31
|
|
|
31
32
|
&--current {
|
|
32
33
|
color: $ds-color-text-secondary;
|
|
@@ -39,10 +39,11 @@
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
.ds-profile-header__title {
|
|
42
|
-
@include ds-typography($ds-typography-functionalheading03, $fontWeight: $ds-fontweight-bold);
|
|
43
|
-
color: $ds-color-text-primary;
|
|
44
42
|
margin: 0;
|
|
45
43
|
word-break: break-word;
|
|
44
|
+
@include ds-typography($ds-typography-functionalheading03, $fontWeight: $ds-fontweight-bold) {
|
|
45
|
+
color: $ds-color-text-primary;
|
|
46
|
+
}
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
.ds-profile-header__media {
|
|
@@ -56,15 +57,17 @@
|
|
|
56
57
|
.ds-profile-header__article-count {
|
|
57
58
|
margin: ds-spacing(0 $ds-s-100 0);
|
|
58
59
|
padding-top: ds-spacing($ds-s-050);
|
|
59
|
-
@include ds-typography($ds-typography-functionalbody02)
|
|
60
|
-
|
|
60
|
+
@include ds-typography($ds-typography-functionalbody02) {
|
|
61
|
+
color: $ds-color-text-primary-02;
|
|
62
|
+
}
|
|
61
63
|
}
|
|
62
64
|
|
|
63
65
|
.ds-profile-header__description {
|
|
64
|
-
@include ds-typography($ds-typography-functionalbody02);
|
|
65
|
-
color: $ds-color-text-primary;
|
|
66
66
|
margin: ds-spacing(0 $ds-s-100 0);
|
|
67
67
|
padding-top: ds-spacing($ds-s-100);
|
|
68
|
+
@include ds-typography($ds-typography-functionalbody02) {
|
|
69
|
+
color: $ds-color-text-primary;
|
|
70
|
+
}
|
|
68
71
|
|
|
69
72
|
a {
|
|
70
73
|
@include ds-link($ds-link-article-body);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/quote](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/quote)
|
|
2
|
+
- Storybook: [Quote](https://designsystem.dn.se/?path=/docs/article-quote--docs)
|
|
3
|
+
- Storybook (Latest): [Quote](https://designsystem-latest.dn.se/?path=/docs/article-quote--docs)
|
|
4
|
+
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
# Quote
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
|parameter | type | required | options | default | description |
|
|
12
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
+
|bodyHtml | HTML String | yes | | | |
|
|
14
|
+
|theme | String | no | default, kultur, nyheter, sport, ekonomi | | Design theme |
|
|
15
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
16
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
17
|
+
|forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size |
|
|
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/quote/quote.njk' import Quote %}
|
|
27
|
+
|
|
28
|
+
{{ Quote({
|
|
29
|
+
bodyHtml: ""
|
|
30
|
+
})}}
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### SCSS
|
|
34
|
+
```scss
|
|
35
|
+
@use "@bonniernews/dn-design-system-web/components/quote/quote";
|
|
36
|
+
```
|
|
@@ -1,36 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
- Storybook (Latest): [Quote](https://designsystem-latest.dn.se/?path=/docs/article-quote--docs)
|
|
1
|
+
Quote
|
|
2
|
+
=====
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
* GitHub: [BonnierNews/dn-design-system/../web/src/components/quote](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/quote)
|
|
5
|
+
* Storybook: [Quote](https://designsystem.dn.se/?path=/docs/article-quote--docs)
|
|
6
6
|
|
|
7
|
-
|
|
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/quote/quote.scss'`
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
<table class="docblock-argstable sb-unstyled css-v2ifgj"><thead class="docblock-argstable-head"><tr><th><span>Name</span></th><th><span>Description</span></th><th><span>Default</span></th></tr></thead><tbody class="docblock-argstable-body"><tr><td class="css-4lbn0a"><span class="css-in3yi3">bodyHtml</span><span title="Required" class="css-1ywjlcj">*</span></td><td><div class="css-1f9domv"><div class="css-13nzt7e"><span class="css-o1d7ko">string</span></div></div></td><td><span>-</span></td></tr><tr><td class="css-4lbn0a"><span class="css-in3yi3">theme</span></td><td><div class="css-1f9domv"><div class="css-13nzt7e"><span class="css-o1d7ko">"kultur"</span><span class="css-o1d7ko">"nyheter"</span><span class="css-o1d7ko">"sport"</span><span class="css-o1d7ko">"ekonomi"</span><span class="css-o1d7ko">"sthlm"</span></div></div></td><td><div class="css-13nzt7e"><span class="css-o1d7ko">"nyheter"</span></div></td></tr><tr><td class="css-4lbn0a"><span class="css-in3yi3">classNames</span></td><td><div class="css-1f9domv"><div class="css-13nzt7e"><span class="css-o1d7ko">string</span></div></div></td><td><span>-</span></td></tr><tr><td class="css-4lbn0a"><span class="css-in3yi3">attributes</span></td><td><div class="css-18pz2h2"><span>Ex. { target: "_blank", "data-test": "lorem ipsum" }</span></div><div class="css-1ije3e2"><div class="css-13nzt7e"><span class="css-o1d7ko">object</span></div></div></td><td><span>-</span></td></tr><tr><td class="css-4lbn0a"><span class="css-in3yi3">forcePx</span></td><td><div class="css-1f9domv"><div class="css-13nzt7e"><span class="css-o1d7ko">boolean</span></div></div></td><td><span>-</span></td></tr></tbody></table>
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
-
|bodyHtml | HTML String | yes | | | |
|
|
14
|
-
|theme | String | no | default, kultur, nyheter, sport, ekonomi | | Design theme |
|
|
15
|
-
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
16
|
-
|classNames | String | no | | | Ex. "my-special-class" |
|
|
17
|
-
|forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size |
|
|
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/quote/quote.njk' import Quote %}
|
|
27
|
-
|
|
28
|
-
{{ Quote({
|
|
29
|
-
bodyHtml: ""
|
|
30
|
-
})}}
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
### SCSS
|
|
34
|
-
```scss
|
|
35
|
-
@use "@bonniernews/dn-design-system-web/components/quote/quote";
|
|
36
|
-
```
|
|
11
|
+
<pre class="prismjs css-4zr3vl"><div class="language-jsx css-zye6j" style="white-space: pre;"><span class="token tag punctuation"><</span><span class="token tag class-name">Quote</span><span class="token tag"> </span><span class="token tag attr-name">bodyHtml</span><span class="token tag attr-value punctuation attr-equals">=</span><span class="token tag attr-value punctuation">"</span><span class="token tag attr-value"><p>Vi har blivit som Kuba. Vi lever inte. Vi överlever.</p></span><span class="token tag attr-value punctuation">"</span><span class="token tag"> </span><span class="token tag punctuation">/></span></div></pre>
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
2
|
|
|
3
3
|
.ds-quote {
|
|
4
|
-
@include ds-typography($ds-typography-detailarticle-quote);
|
|
5
|
-
color: $ds-color-text-primary;
|
|
6
4
|
margin: 0;
|
|
7
5
|
padding: ds-spacing($ds-s-100 0 $ds-s-200);
|
|
8
6
|
position: relative;
|
|
7
|
+
@include ds-typography($ds-typography-detailarticle-quote) {
|
|
8
|
+
color: $ds-color-text-primary;
|
|
9
|
+
}
|
|
9
10
|
|
|
10
11
|
@at-root .ds-force-px#{&} {
|
|
11
12
|
@include ds-typography($ds-typography-detailarticle-quote, true);
|
|
@@ -9,6 +9,13 @@ export interface QuoteProps {
|
|
|
9
9
|
forcePx?: boolean;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* - GitHub: [BonnierNews/dn-design-system/../web/src/components/quote](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/quote)
|
|
14
|
+
* - Storybook: [Quote](https://designsystem.dn.se/?path=/docs/article-quote--docs)
|
|
15
|
+
*
|
|
16
|
+
* The component will not include styling by itself. Make sure to include the right styles for the component. See example below:
|
|
17
|
+
* `@use '@bonniernews/dn-design-system-web/components/quote/quote.scss'`
|
|
18
|
+
*/
|
|
12
19
|
export const Quote = ({ bodyHtml, theme = 'nyheter', classNames, attributes, forcePx }: QuoteProps) => {
|
|
13
20
|
const componentClassName = 'ds-quote';
|
|
14
21
|
|
|
@@ -40,8 +40,8 @@ $ds-radio-btn__icon-size: 24px;
|
|
|
40
40
|
margin: ds-spacing(0 0 0 $ds-s-050, rem);
|
|
41
41
|
@include ds-typography($ds-typography-functionalbody02);
|
|
42
42
|
@at-root .ds-force-px#{&} {
|
|
43
|
-
@include ds-typography($ds-typography-functionalbody02, true);
|
|
44
43
|
margin: ds-spacing(0 0 0 $ds-s-050);
|
|
44
|
+
@include ds-typography($ds-typography-functionalbody02, true);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -50,21 +50,23 @@
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.ds-tag-header__vignette {
|
|
53
|
-
@include ds-typography($ds-typography-functionallabel01);
|
|
54
|
-
color: $ds-theme-color;
|
|
55
53
|
margin-bottom: ds-spacing($ds-s-025);
|
|
56
54
|
display: block;
|
|
57
55
|
text-decoration: none;
|
|
56
|
+
@include ds-typography($ds-typography-functionallabel01) {
|
|
57
|
+
color: $ds-theme-color;
|
|
58
|
+
}
|
|
58
59
|
&:hover {
|
|
59
60
|
text-decoration: none;
|
|
60
61
|
}
|
|
61
62
|
}
|
|
62
63
|
|
|
63
64
|
.ds-tag-header__title {
|
|
64
|
-
@include ds-typography($ds-typography-functionalheading03, $fontWeight: $ds-fontweight-bold);
|
|
65
|
-
color: $ds-color-text-primary;
|
|
66
|
-
margin: 0;
|
|
67
65
|
word-break: break-word;
|
|
66
|
+
margin: 0;
|
|
67
|
+
@include ds-typography($ds-typography-functionalheading03, $fontWeight: $ds-fontweight-bold) {
|
|
68
|
+
color: $ds-color-text-primary;
|
|
69
|
+
}
|
|
68
70
|
}
|
|
69
71
|
|
|
70
72
|
.ds-tag-header__media {
|
|
@@ -84,15 +86,17 @@
|
|
|
84
86
|
.ds-tag-header__article-count {
|
|
85
87
|
margin: ds-spacing(0 $ds-s-100 0);
|
|
86
88
|
padding-top: ds-spacing($ds-s-050);
|
|
87
|
-
@include ds-typography($ds-typography-functionalbody02)
|
|
88
|
-
|
|
89
|
+
@include ds-typography($ds-typography-functionalbody02) {
|
|
90
|
+
color: $ds-color-text-primary-02;
|
|
91
|
+
}
|
|
89
92
|
}
|
|
90
93
|
|
|
91
94
|
.ds-tag-header__description {
|
|
92
|
-
@include ds-typography($ds-typography-functionalbody02);
|
|
93
|
-
color: $ds-color-text-primary;
|
|
94
95
|
margin: ds-spacing(0 $ds-s-100 0);
|
|
95
96
|
padding-top: ds-spacing($ds-s-100);
|
|
97
|
+
@include ds-typography($ds-typography-functionalbody02) {
|
|
98
|
+
color: $ds-color-text-primary;
|
|
99
|
+
}
|
|
96
100
|
|
|
97
101
|
a {
|
|
98
102
|
@include ds-link($ds-link-article-body);
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-card](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-card)
|
|
2
|
+
- Storybook: [Subcomponents > TeaserCard](https://designsystem.dn.se/?path=/docs/section-subcomponents-teaserdot--docs)
|
|
3
|
+
- Storybook (Latest): [Subcomponents > TeaserCard](https://designsystem-latest.dn.se/?path=/docs/section-subcomponents-teaserdot--docs)
|
|
4
|
+
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
# TeaserCard
|
|
8
|
+
|
|
9
|
+
This component is the basis for all Teasers. While it does not render much itself, it brings a common styling base for its children.
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
|parameter | type | required | options | default | description |
|
|
14
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
15
|
+
|targetLink | String | no | | | If given, the card will render as a link |
|
|
16
|
+
|areaType | String | no | '', 'right', 'bauta', 'bautaxl' | '' | The area the teaser will be rendered in |
|
|
17
|
+
|theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme-class to apply to the teaser |
|
|
18
|
+
|classNames | String | no | | | Ex. "ds-teaser--large" |
|
|
19
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
20
|
+
|~forcePx~ | | | | | Not supported |
|
|
21
|
+
|
|
22
|
+
## Minimum requirement example
|
|
23
|
+
|
|
24
|
+
### Nunjucks
|
|
25
|
+
|
|
26
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-card/teaser-card.njk' import TeaserCard %}
|
|
30
|
+
|
|
31
|
+
{% call TeaserCard({
|
|
32
|
+
targetLink: 'https://www.dn.se/',
|
|
33
|
+
}) %}
|
|
34
|
+
(content)
|
|
35
|
+
{% endcall %}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### SCSS
|
|
39
|
+
```scss
|
|
40
|
+
@use "@bonniernews/dn-design-system-web/assets/teaser/teaser";
|
|
41
|
+
```
|
|
@@ -1,41 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
- Storybook (Latest): [Subcomponents > TeaserCard](https://designsystem-latest.dn.se/?path=/docs/section-subcomponents-teaserdot--docs)
|
|
1
|
+
TeaserCard
|
|
2
|
+
==========
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
* GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-card](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-card)
|
|
5
|
+
* Storybook: [Subcomponents > TeaserCard](https://designsystem.dn.se/?path=/docs/section-subcomponents-teaserdot--docs)
|
|
6
6
|
|
|
7
|
-
|
|
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/assets/teaser/teaser.scss'`
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
<table class="docblock-argstable sb-unstyled css-v2ifgj"><thead class="docblock-argstable-head"><tr><th><span>Name</span></th><th><span>Description</span></th><th><span>Default</span></th></tr></thead><tbody class="docblock-argstable-body"><tr><td class="css-4lbn0a"><span class="css-in3yi3">areaType</span></td><td><div class="css-1f9domv"><div class="css-13nzt7e"><span class="css-o1d7ko">"right"</span><span class="css-o1d7ko">"bauta"</span><span class="css-o1d7ko">"bautaxl"</span></div></div></td><td><span>-</span></td></tr><tr><td class="css-4lbn0a"><span class="css-in3yi3">targetLink</span></td><td><div class="css-1f9domv"><div class="css-13nzt7e"><span class="css-o1d7ko">string</span></div></div></td><td><span>-</span></td></tr><tr><td class="css-4lbn0a"><span class="css-in3yi3">theme</span></td><td><div class="css-1f9domv"><div class="css-13nzt7e"><span class="css-o1d7ko">"kultur"</span><span class="css-o1d7ko">"nyheter"</span><span class="css-o1d7ko">"sport"</span><span class="css-o1d7ko">"ekonomi"</span><span class="css-o1d7ko">"sthlm"</span></div></div></td><td><div class="css-13nzt7e"><span class="css-o1d7ko">"nyheter"</span></div></td></tr><tr><td class="css-4lbn0a"><span class="css-in3yi3">classes</span></td><td><div class="css-1f9domv"><div class="css-13nzt7e"><span class="css-o1d7ko">string</span></div></div></td><td><span>-</span></td></tr><tr><td class="css-4lbn0a"><span class="css-in3yi3">attributes</span></td><td><div class="css-18pz2h2"><span>Ex. { target: "_blank", "data-test": "lorem ipsum" }</span></div><div class="css-1ije3e2"><div class="css-13nzt7e"><span class="css-o1d7ko">object</span></div></div></td><td><span>-</span></td></tr></tbody></table>
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|classNames | String | no | | | Ex. "ds-teaser--large" |
|
|
19
|
-
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
20
|
-
|~forcePx~ | | | | | Not supported |
|
|
21
|
-
|
|
22
|
-
## Minimum requirement example
|
|
23
|
-
|
|
24
|
-
### Nunjucks
|
|
25
|
-
|
|
26
|
-
These are copy paste friendly examples to quickliy get started using a component.
|
|
27
|
-
|
|
28
|
-
```html
|
|
29
|
-
{% from '@bonniernews/dn-design-system-web/components/teaser-card/teaser-card.njk' import TeaserCard %}
|
|
30
|
-
|
|
31
|
-
{% call TeaserCard({
|
|
32
|
-
targetLink: 'https://www.dn.se/',
|
|
33
|
-
}) %}
|
|
34
|
-
(content)
|
|
35
|
-
{% endcall %}
|
|
36
|
-
```
|
|
37
|
-
|
|
38
|
-
### SCSS
|
|
39
|
-
```scss
|
|
40
|
-
@use "@bonniernews/dn-design-system-web/assets/teaser/teaser";
|
|
41
|
-
```
|
|
11
|
+
<pre class="prismjs css-4zr3vl"><div class="language-jsx css-zye6j" style="white-space: pre;"><span class="token tag punctuation"><</span><span class="token tag class-name">TeaserCard</span><span class="token tag punctuation">></span><span class="token plain-text">
|
|
12
|
+
</span><span class="token plain-text"> </span><span class="token tag punctuation"><</span><span class="token tag">div</span><span class="token tag">
|
|
13
|
+
</span><span class="token tag"> </span><span class="token tag attr-name">style</span><span class="token tag script language-javascript script-punctuation punctuation">=</span><span class="token tag script language-javascript punctuation">{</span><span class="token tag script language-javascript punctuation">{</span><span class="token tag script language-javascript">
|
|
14
|
+
</span><span class="token tag script language-javascript"> </span><span class="token tag script language-javascript literal-property property">height</span><span class="token tag script language-javascript operator">:</span><span class="token tag script language-javascript"> </span><span class="token tag script language-javascript string">'48px'</span><span class="token tag script language-javascript">
|
|
15
|
+
</span><span class="token tag script language-javascript"> </span><span class="token tag script language-javascript punctuation">}</span><span class="token tag script language-javascript punctuation">}</span><span class="token tag">
|
|
16
|
+
</span><span class="token tag"> </span><span class="token tag punctuation">/></span><span class="token plain-text">
|
|
17
|
+
</span><span class="token plain-text"></span><span class="token tag punctuation"></</span><span class="token tag class-name">TeaserCard</span><span class="token tag punctuation">></span></div></pre>
|
|
@@ -10,6 +10,13 @@ export interface TeaserCardsProps {
|
|
|
10
10
|
children: any;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
|
+
/**
|
|
14
|
+
* - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-card](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-card)
|
|
15
|
+
* - Storybook: [Subcomponents > TeaserCard](https://designsystem.dn.se/?path=/docs/section-subcomponents-teaserdot--docs)
|
|
16
|
+
*
|
|
17
|
+
* The component will not include styling by itself. Make sure to include the right styles for the component. See example below:
|
|
18
|
+
* `@use '@bonniernews/dn-design-system-web/assets/teaser/teaser.scss'`
|
|
19
|
+
*/
|
|
13
20
|
export const TeaserCard = ({ areaType, targetLink, theme = 'nyheter', classes, attributes, children }: TeaserCardsProps) => {
|
|
14
21
|
const componentClassName = 'ds-teaser';
|
|
15
22
|
|
|
@@ -9,9 +9,10 @@
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
.ds-teaser-footer__notes {
|
|
12
|
-
@include ds-typography($ds-typography-functionalmeta02);
|
|
13
12
|
display: block;
|
|
14
|
-
|
|
13
|
+
@include ds-typography($ds-typography-functionalmeta02) {
|
|
14
|
+
color: $ds-color-text-primary-02;
|
|
15
|
+
}
|
|
15
16
|
}
|
|
16
17
|
|
|
17
18
|
.ds-teaser-footer--podcast {
|
|
@@ -21,8 +22,9 @@
|
|
|
21
22
|
margin-top: ds-spacing($ds-s-050);
|
|
22
23
|
|
|
23
24
|
.ds-teaser-footer__title {
|
|
24
|
-
@include ds-typography($ds-typography-functionalbody01, $fontWeight: $ds-fontweight-semibold)
|
|
25
|
-
|
|
25
|
+
@include ds-typography($ds-typography-functionalbody01, $fontWeight: $ds-fontweight-semibold) {
|
|
26
|
+
color: $ds-color-text-primary;
|
|
27
|
+
}
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
.ds-teaser-footer__notes {
|
|
@@ -7,15 +7,16 @@
|
|
|
7
7
|
margin: 0;
|
|
8
8
|
|
|
9
9
|
.ds-teaser-image__byline {
|
|
10
|
-
@include ds-typography($ds-typography-functionalmeta01, $lineHeight: $ds-lineheight-l);
|
|
11
10
|
position: absolute;
|
|
12
11
|
bottom: 0;
|
|
13
12
|
right: 0;
|
|
14
13
|
padding: ds-spacing(0 $ds-s-025);
|
|
15
14
|
margin-left: ds-spacing($ds-s-050);
|
|
16
|
-
color: $ds-color-static-white;
|
|
17
15
|
background-color: $ds-color-static-transparent-black;
|
|
18
16
|
z-index: 5;
|
|
17
|
+
@include ds-typography($ds-typography-functionalmeta01, $lineHeight: $ds-lineheight-l) {
|
|
18
|
+
color: $ds-color-static-white;
|
|
19
|
+
}
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
&--mask {
|
|
@@ -63,15 +63,17 @@ $ds-teaser-list-vertical-media-icon-size: 20px;
|
|
|
63
63
|
|
|
64
64
|
.ds-teaser-list-vertical__item-vignette {
|
|
65
65
|
display: block;
|
|
66
|
-
@include ds-typography($ds-typography-functionallabel01);
|
|
67
|
-
color: $ds-theme-color;
|
|
68
66
|
margin-bottom: ds-spacing($ds-s-025);
|
|
67
|
+
@include ds-typography($ds-typography-functionallabel01) {
|
|
68
|
+
color: $ds-theme-color;
|
|
69
|
+
}
|
|
69
70
|
}
|
|
70
71
|
|
|
71
72
|
.ds-teaser-list-vertical__item-title {
|
|
72
|
-
@include ds-typography($ds-typography-expressiveheading01);
|
|
73
|
-
color: $ds-color-text-primary;
|
|
74
73
|
word-break: break-word;
|
|
74
|
+
@include ds-typography($ds-typography-expressiveheading01) {
|
|
75
|
+
color: $ds-color-text-primary;
|
|
76
|
+
}
|
|
75
77
|
|
|
76
78
|
.ds-teaser-list-vertical__item-highlight {
|
|
77
79
|
color: $ds-theme-color;
|
|
@@ -52,12 +52,12 @@
|
|
|
52
52
|
|
|
53
53
|
.ds-teaser__vignette {
|
|
54
54
|
color: currentColor;
|
|
55
|
+
margin: 0;
|
|
55
56
|
@include ds-typography(
|
|
56
57
|
$ds-typography-functionallabel01,
|
|
57
58
|
$lineHeight: $ds-lineheight-l,
|
|
58
59
|
$letterSpacing: $ds-letterspacing-none
|
|
59
60
|
);
|
|
60
|
-
margin: 0;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
63
|
.ds-teaser__title {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
2
|
@use "../../assets/teaser/teaser.scss" as *;
|
|
3
|
-
@use "sass:math";
|
|
4
3
|
|
|
5
4
|
.ds-teaser.ds-teaser--native {
|
|
6
5
|
overflow: hidden;
|
|
@@ -24,8 +23,9 @@
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
.ds-teaser__title {
|
|
27
|
-
@include ds-typography($ds-typography-expressiveheading02)
|
|
28
|
-
|
|
26
|
+
@include ds-typography($ds-typography-expressiveheading02) {
|
|
27
|
+
font-family: $ds-font--arial !important; /* stylelint-disable-line declaration-no-important */
|
|
28
|
+
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
&::after {
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-onsite](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-onsite)
|
|
2
|
+
- Storybook: [TeaserOnSite](https://designsystem.dn.se/?path=/docs/section-teaseronsite--docs)
|
|
3
|
+
- Storybook (Latest): [TeaserOnSite](https://designsystem-latest.dn.se/?path=/docs/section-teaseronsite--docs)
|
|
4
|
+
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
# teaser-onsite
|
|
8
|
+
|
|
9
|
+
Also known as "På Plats-puffen".
|
|
10
|
+
|
|
11
|
+
In the CMS title will be set to a location like "Kiev, Ukraina" or "USA" and text is usually set to some author names like "Jan Banan och Kalle Kula"
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
|parameter | type | required | options | default | description |
|
|
16
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
17
|
+
|title | String | yes | | | Heading of the teaser |
|
|
18
|
+
|targetLink | String | yes | | | Target URL for the teaser |
|
|
19
|
+
|areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
|
|
20
|
+
|theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme-class to apply to the teaser |
|
|
21
|
+
|text | String | no | | | Teaser subtext |
|
|
22
|
+
|mediaHtml | HTML String | no | | | Main image or other media |
|
|
23
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
24
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
25
|
+
|~forcePx~ | | | | | Not supported |
|
|
26
|
+
|
|
27
|
+
## Minimum requirement example
|
|
28
|
+
|
|
29
|
+
### Nunjucks
|
|
30
|
+
|
|
31
|
+
These are copy paste friendly examples to quickly get started using a component.
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-onsite/teaser-onsite.njk' import TeaserOnSite %}
|
|
35
|
+
|
|
36
|
+
{{ TeaserOnSite({
|
|
37
|
+
title: 'Kiev, Ukraina',
|
|
38
|
+
text: 'Henrik Brandão Jönsson och Eduardo Leal'
|
|
39
|
+
})}}
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### SCSS
|
|
43
|
+
```scss
|
|
44
|
+
@use "@bonniernews/dn-design-system-web/components/teaser-onsite/teaser-onsite";
|
|
45
|
+
```
|