@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.
Files changed (75) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/assets/teaser/teaser.scss +6 -4
  3. package/components/badge/badge.scss +6 -5
  4. package/components/blocked-content/blocked-content.scss +8 -6
  5. package/components/buddy-menu/buddy-menu.scss +13 -10
  6. package/components/button/button.scss +29 -19
  7. package/components/checkbox/checkbox.scss +1 -1
  8. package/components/disclaimer/disclaimer.scss +6 -4
  9. package/components/divider/README-NJK.md +34 -0
  10. package/components/divider/README.md +7 -30
  11. package/components/divider/divider.tsx +7 -0
  12. package/components/empty-state/empty-state.scss +6 -4
  13. package/components/factbox/factbox.scss +6 -4
  14. package/components/footer/footer.scss +5 -6
  15. package/components/game-header/game-header.scss +6 -4
  16. package/components/group-header/group-header.scss +4 -3
  17. package/components/image-caption/image-caption.scss +3 -2
  18. package/components/link-box/link-box-item.scss +6 -4
  19. package/components/list-item/list-item.scss +22 -14
  20. package/components/modal/modal.scss +6 -4
  21. package/components/pagination/pagination.scss +3 -2
  22. package/components/profile-header/profile-header.scss +9 -6
  23. package/components/quote/README-NJK.md +36 -0
  24. package/components/quote/README.md +7 -32
  25. package/components/quote/quote.scss +3 -2
  26. package/components/quote/quote.tsx +7 -0
  27. package/components/radio-button/radio-button.scss +1 -1
  28. package/components/tag-header/tag-header.scss +13 -9
  29. package/components/teaser-card/README-NJK.md +41 -0
  30. package/components/teaser-card/README.md +13 -37
  31. package/components/teaser-card/teaser-card.tsx +7 -0
  32. package/components/teaser-footer/teaser-footer.scss +6 -4
  33. package/components/teaser-image/teaser-image.scss +3 -2
  34. package/components/teaser-list-vertical/teaser-list-vertical.scss +6 -4
  35. package/components/teaser-longlife/teaser-longlife.scss +1 -1
  36. package/components/teaser-native/teaser-native.scss +3 -3
  37. package/components/teaser-onsite/README-NJK.md +45 -0
  38. package/components/teaser-onsite/README.md +12 -37
  39. package/components/teaser-onsite/teaser-onsite.tsx +11 -0
  40. package/components/teaser-standard/teaser-standard.scss +0 -1
  41. package/components/teaser-swipe-card/teaser-swipe-card.scss +7 -5
  42. package/components/teaser-tipsa/teaser-tipsa.scss +1 -1
  43. package/components/text-button/text-button.scss +14 -13
  44. package/components/text-button-toggle/text-button-toggle.scss +6 -3
  45. package/components/text-input/text-input.scss +6 -5
  46. package/components/thematic-break/README-NJK.md +31 -0
  47. package/components/thematic-break/README.md +7 -27
  48. package/components/thematic-break/thematic-break.tsx +8 -0
  49. package/components/tooltip/tooltip.scss +1 -1
  50. package/components/video-caption/video-caption.scss +4 -3
  51. package/components/vip-badge/vip-badge.scss +3 -3
  52. package/foundations/helpers/links.scss +27 -22
  53. package/foundations/helpers/mediaQueries.scss +0 -2
  54. package/foundations/helpers/metrics.scss +1 -2
  55. package/foundations/helpers/shadows.scss +0 -2
  56. package/foundations/helpers/spacing.scss +4 -3
  57. package/foundations/helpers/typography.scss +14 -8
  58. package/foundations/helpers/utilities.scss +2 -1
  59. package/foundations/shadows.scss +3 -3
  60. package/foundations/spacing.scss +2 -2
  61. package/package.json +1 -1
  62. package/preact/components/divider/divider.d.ts +7 -0
  63. package/preact/components/quote/quote.d.ts +7 -0
  64. package/preact/components/teaser-card/teaser-card.d.ts +7 -0
  65. package/preact/components/teaser-onsite/teaser-onsite.d.ts +11 -0
  66. package/preact/components/thematic-break/thematic-break.d.ts +7 -0
  67. package/preact/components.cjs.map +2 -2
  68. package/preact/components.esm.js.map +2 -2
  69. package/react/components/divider/divider.d.ts +7 -0
  70. package/react/components/quote/quote.d.ts +7 -0
  71. package/react/components/teaser-card/teaser-card.d.ts +7 -0
  72. package/react/components/teaser-onsite/teaser-onsite.d.ts +11 -0
  73. package/react/components/thematic-break/thematic-break.d.ts +7 -0
  74. package/react/components.cjs.map +2 -2
  75. package/react/components.esm.js.map +2 -2
@@ -1,45 +1,20 @@
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
1
+ TeaserOnsite
2
+ ============
8
3
 
9
4
  Also known as "På Plats-puffen".
10
5
 
11
6
  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
7
 
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.
8
+ * GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-onsite](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-onsite)
9
+ * Storybook: [TeaserOnSite](https://designsystem.dn.se/?path=/docs/section-teaseronsite--docs)
32
10
 
33
- ```html
34
- {% from '@bonniernews/dn-design-system-web/components/teaser-onsite/teaser-onsite.njk' import TeaserOnSite %}
11
+ 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-onsite/teaser-onsite.scss'`
35
12
 
36
- {{ TeaserOnSite({
37
- title: 'Kiev, Ukraina',
38
- text: 'Henrik Brandão Jönsson och Eduardo Leal'
39
- })}}
40
- ```
13
+ <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">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">mediaHtml</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">title</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">text</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></tbody></table>
41
14
 
42
- ### SCSS
43
- ```scss
44
- @use "@bonniernews/dn-design-system-web/components/teaser-onsite/teaser-onsite";
45
- ```
15
+ <pre class="prismjs css-4zr3vl"><div class="language-jsx css-zye6j" style="white-space: pre;"><span class="token tag punctuation">&lt;</span><span class="token tag class-name">TeaserOnSite</span><span class="token tag">
16
+ </span><span class="token tag"> </span><span class="token tag attr-name">mediaHtml="&lt;figure</span><span class="token tag"> </span><span class="token tag attr-name">class</span><span class="token tag attr-value punctuation attr-equals">=</span><span class="token tag attr-value entity named-entity">&amp;quot;</span><span class="token tag attr-value">ds-teaser-image</span><span class="token tag attr-value entity named-entity">&amp;quot;</span><span class="token tag punctuation">&gt;</span><span class="token tag attr-name">&lt;div</span><span class="token tag"> </span><span class="token tag attr-name">class</span><span class="token tag attr-value punctuation attr-equals">=</span><span class="token tag attr-value entity named-entity">&amp;quot;</span><span class="token tag attr-value">picture</span><span class="token tag"> </span><span class="token tag attr-name">picture--placeholder&amp;quot;</span><span class="token tag"> </span><span class="token tag special-attr attr-name">style</span><span class="token tag special-attr attr-value punctuation attr-equals">=</span><span class="token tag special-attr attr-value value css language-css">&amp;quot</span><span class="token tag special-attr attr-value value css language-css punctuation">;</span><span class="token tag special-attr attr-value value css language-css property">aspect-ratio</span><span class="token tag special-attr attr-value value css language-css punctuation">:</span><span class="token tag"> </span><span class="token tag attr-name">1</span><span class="token tag"> / </span><span class="token tag attr-name">1;&amp;quot;</span><span class="token tag punctuation">&gt;</span><span class="token tag attr-name">&lt;img</span><span class="token tag"> </span><span class="token tag attr-name">class</span><span class="token tag attr-value punctuation attr-equals">=</span><span class="token tag attr-value entity named-entity">&amp;quot;</span><span class="token tag attr-value">picture__img</span><span class="token tag attr-value entity named-entity">&amp;quot;</span><span class="token tag"> </span><span class="token tag attr-name">src</span><span class="token tag attr-value punctuation attr-equals">=</span><span class="token tag attr-value entity named-entity">&amp;quot;</span><span class="token tag attr-value">https://cached-images.bonnier.news/gcs/bilder-lab/dn-mly/d5e4cd87-61a5-40fc-8060-c4ad5019a9f3.jpeg?interpolation=lanczos-none</span><span class="token tag attr-value entity named-entity">&amp;amp;</span><span class="token tag attr-value">fit=around%7C56:56</span><span class="token tag attr-value entity named-entity">&amp;amp;</span><span class="token tag attr-value">crop=56:h;center,top</span><span class="token tag attr-value entity named-entity">&amp;amp;</span><span class="token tag attr-value">output-quality=80</span><span class="token tag attr-value entity named-entity">&amp;quot;</span><span class="token tag"> </span><span class="token tag attr-name">alt</span><span class="token tag attr-value punctuation attr-equals">=</span><span class="token tag attr-value entity named-entity">&amp;quot;</span><span class="token tag attr-value entity named-entity">&amp;quot;</span><span class="token tag"> </span><span class="token tag attr-name">aria-hidden</span><span class="token tag attr-value punctuation attr-equals">=</span><span class="token tag attr-value entity named-entity">&amp;quot;</span><span class="token tag attr-value">true</span><span class="token tag attr-value entity named-entity">&amp;quot;</span><span class="token tag punctuation">&gt;</span><span class="token tag attr-name">&lt;</span><span class="token tag">/</span><span class="token tag attr-name">div</span><span class="token tag punctuation">&gt;</span><span class="token tag attr-name">&lt;</span><span class="token tag">/</span><span class="token tag attr-name">figure</span><span class="token tag punctuation">&gt;</span><span class="token tag attr-name">"</span><span class="token tag">
17
+ </span><span class="token tag"> </span><span class="token tag attr-name">targetLink</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">https://www.dn.se/varlden/har-forvarades-atombomber-under-kalla-kriget-nu-ar-flygbasen-pa-azorerna-ater-het-for-stormakterna/</span><span class="token tag attr-value punctuation">"</span><span class="token tag">
18
+ </span><span class="token tag"> </span><span class="token tag attr-name">text</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">Henrik Brandão Jönsson och Eduardo Leal</span><span class="token tag attr-value punctuation">"</span><span class="token tag">
19
+ </span><span class="token tag"> </span><span class="token tag attr-name">title</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">Azorerna</span><span class="token tag attr-value punctuation">"</span><span class="token tag">
20
+ </span><span class="token tag"></span><span class="token tag punctuation">/&gt;</span></div></pre>
@@ -13,6 +13,17 @@ export interface TeaserOnSiteProps {
13
13
  text?: string;
14
14
  }
15
15
 
16
+ /**
17
+ * Also known as "På Plats-puffen".
18
+ *
19
+ * 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"
20
+ *
21
+ * - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-onsite](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-onsite)
22
+ * - Storybook: [TeaserOnSite](https://designsystem.dn.se/?path=/docs/section-teaseronsite--docs)
23
+ *
24
+ * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:
25
+ * `@use '@bonniernews/dn-design-system-web/components/teaser-onsite/teaser-onsite.scss'`
26
+ */
16
27
  export const TeaserOnSite = ({ areaType, targetLink, theme = 'nyheter', classNames, attributes, mediaHtml, title, text }: TeaserOnSiteProps) => {
17
28
 
18
29
  const classes = formatClassString([
@@ -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--standard {
6
5
  padding: ds-spacing($ds-s-075 $ds-s-100 0);
@@ -44,14 +44,15 @@
44
44
  }
45
45
 
46
46
  .ds-teaser-swipe-card__time {
47
- @include ds-typography($ds-typography-functionalmeta02, $lineHeight: $ds-lineheight-l);
48
- color: $ds-color-text-primary-02;
47
+ @include ds-typography($ds-typography-functionalmeta02, $lineHeight: $ds-lineheight-l) {
48
+ color: $ds-color-text-primary-02;
49
+ }
49
50
  }
50
51
 
51
52
  .ds-teaser__title {
52
- @include ds-typography($ds-typography-expressiveheading01);
53
53
  margin-bottom: ds-spacing($ds-s-050);
54
54
  flex: 1;
55
+ @include ds-typography($ds-typography-expressiveheading01);
55
56
  }
56
57
 
57
58
  @include ds-hover(true) {
@@ -89,10 +90,11 @@
89
90
 
90
91
  .ds-teaser-swipe-card__time {
91
92
  display: flex;
92
- @include ds-typography($ds-typography-functionalbody01, $fontWeight: $ds-fontweight-semibold);
93
- color: $ds-theme-color;
94
93
  align-items: center;
95
94
  margin-bottom: ds-spacing($ds-s-025);
95
+ @include ds-typography($ds-typography-functionalbody01, $fontWeight: $ds-fontweight-semibold) {
96
+ color: $ds-theme-color;
97
+ }
96
98
 
97
99
  &::before {
98
100
  content: "";
@@ -17,7 +17,7 @@
17
17
  }
18
18
 
19
19
  .ds-teaser__text {
20
- @include ds-typography($ds-typography-functionalbody02);
21
20
  margin-top: ds-spacing($ds-s-050);
21
+ @include ds-typography($ds-typography-functionalbody02);
22
22
  }
23
23
  }
@@ -7,6 +7,17 @@ $ds-text-btn__underline-offset: 2px;
7
7
  .ds-text-btn {
8
8
  --ds-text-btn__icon-size: #{ds-px-to-rem(24px)};
9
9
 
10
+ cursor: pointer;
11
+ background-color: transparent;
12
+ border: 0;
13
+ display: inline-flex;
14
+ align-items: center;
15
+ justify-content: center;
16
+ border-radius: ds-border-radius(x1);
17
+ padding: 0;
18
+ position: relative;
19
+ text-decoration: none;
20
+
10
21
  &.ds-force-px {
11
22
  --ds-text-btn__icon-size: 24px;
12
23
  }
@@ -47,17 +58,6 @@ $ds-text-btn__underline-offset: 2px;
47
58
  }
48
59
  }
49
60
 
50
- cursor: pointer;
51
- background-color: transparent;
52
- border: 0;
53
- display: inline-flex;
54
- align-items: center;
55
- justify-content: center;
56
- border-radius: ds-border-radius(x1);
57
- padding: 0;
58
- position: relative;
59
- text-decoration: none;
60
-
61
61
  &::before {
62
62
  content: "";
63
63
  border-radius: inherit;
@@ -86,9 +86,10 @@ $ds-text-btn__underline-offset: 2px;
86
86
  }
87
87
 
88
88
  .ds-text-btn__text {
89
- @include ds-typography-with-force-px($ds-typography-functionalbody02);
90
89
  text-underline-offset: $ds-text-btn__underline-offset;
91
- color: $ds-color-text-primary;
90
+ @include ds-typography-with-force-px($ds-typography-functionalbody02) {
91
+ color: $ds-color-text-primary;
92
+ }
92
93
  }
93
94
 
94
95
  &:not(:disabled) .ds-text-btn__text {
@@ -69,11 +69,14 @@ $ds-text-btn-toggle__icon-size: 24px;
69
69
  }
70
70
 
71
71
  .ds-text-btn-toggle__text {
72
- @include ds-typography($ds-typography-functionalbody02);
72
+ @include ds-typography($ds-typography-functionalbody02) {
73
+ color: $ds-color-text-primary;
74
+ }
73
75
  @at-root .ds-force-px#{&} {
74
- @include ds-typography($ds-typography-functionalbody02, true);
76
+ @include ds-typography($ds-typography-functionalbody02, true) {
77
+ color: $ds-color-text-primary;
78
+ }
75
79
  }
76
- color: $ds-color-text-primary;
77
80
  }
78
81
 
79
82
  .ds-text-btn-toggle__off {
@@ -21,13 +21,14 @@ $ds-text-input-toggle-btn__area: ($ds-text-input-toggle-btn__width + ds-spacing(
21
21
  .ds-text-input__input {
22
22
  box-sizing: border-box;
23
23
  width: 100%;
24
- color: $ds-color-text-primary;
25
24
  background-color: $ds-color-component-secondary;
26
- @include ds-typography($ds-typography-functionalbody02);
27
25
  padding: ds-px-to-rem(ds-spacing($ds-s-100) - ds-border-width(x1)) ds-spacing($ds-s-100) - ds-border-width(x1);
28
26
  border: solid ds-border-width(x1) $ds-color-border-primary-02;
29
27
  border-radius: ds-border-radius(x1);
30
28
  margin: 0;
29
+ @include ds-typography($ds-typography-functionalbody02) {
30
+ color: $ds-color-text-primary;
31
+ }
31
32
 
32
33
  &.password-toggle {
33
34
  padding-right: ds-px-to-rem($ds-text-input-toggle-btn__area);
@@ -39,8 +40,8 @@ $ds-text-input-toggle-btn__area: ($ds-text-input-toggle-btn__width + ds-spacing(
39
40
  &:focus,
40
41
  &:not(:placeholder-shown) {
41
42
  + .ds-text-input__label {
42
- @include ds-typography($ds-typography-functionalmeta02);
43
43
  top: 0;
44
+ @include ds-typography($ds-typography-functionalmeta02);
44
45
 
45
46
  &::before {
46
47
  background-color: $ds-color-component-secondary;
@@ -111,8 +112,8 @@ $ds-text-input-toggle-btn__area: ($ds-text-input-toggle-btn__width + ds-spacing(
111
112
  }
112
113
 
113
114
  .ds-text-input__input {
114
- @include ds-typography($ds-typography-functionalbody02, true);
115
115
  padding: ds-spacing($ds-s-100) - ds-border-width(x1);
116
+ @include ds-typography($ds-typography-functionalbody02, true);
116
117
 
117
118
  &.password-toggle {
118
119
  padding-right: $ds-text-input-toggle-btn__area;
@@ -134,8 +135,8 @@ $ds-text-input-toggle-btn__area: ($ds-text-input-toggle-btn__width + ds-spacing(
134
135
  }
135
136
 
136
137
  .ds-text-input__label {
137
- @include ds-typography($ds-typography-functionalbody02, true);
138
138
  top: ds-spacing($ds-s-150);
139
+ @include ds-typography($ds-typography-functionalbody02, true);
139
140
  &::before {
140
141
  top: ds-spacing($ds-s-050);
141
142
  }
@@ -0,0 +1,31 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/thematic-break](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/thematic-break)
2
+ - Storybook: [ThematicBreak](https://designsystem.dn.se/?path=/docs/article-thematicbreak--docs)
3
+ - Storybook (Latest): [ThematicBreak](https://designsystem-latest.dn.se/?path=/docs/article-thematicbreak--docs)
4
+
5
+ ----
6
+
7
+ # ThematicBreak
8
+
9
+ ## Parameters
10
+
11
+ |parameter | type | required | options | default | description |
12
+ |:--- | :--- | :--- | :--- | :--- | :--- |
13
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
14
+ |classNames | String | no | | | Ex. "my-special-class" |
15
+
16
+ ## Minimum requirement example
17
+
18
+ ### Nunjucks
19
+
20
+ These are copy paste friendly examples to quickliy get started using a component.
21
+
22
+ ```html
23
+ {% from '@bonniernews/dn-design-system-web/components/thematic-break/thematic-break.njk' import ThematicBreak %}
24
+
25
+ {{ ThematicBreak() }}
26
+ ```
27
+
28
+ ### SCSS
29
+ ```scss
30
+ @use "@bonniernews/dn-design-system-web/components/thematic-break/thematic-break";
31
+ ```
@@ -1,31 +1,11 @@
1
- - GitHub: [BonnierNews/dn-design-system/../web/src/components/thematic-break](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/thematic-break)
2
- - Storybook: [ThematicBreak](https://designsystem.dn.se/?path=/docs/article-thematicbreak--docs)
3
- - Storybook (Latest): [ThematicBreak](https://designsystem-latest.dn.se/?path=/docs/article-thematicbreak--docs)
1
+ ThematicBreak
2
+ =============
4
3
 
5
- ----
4
+ * GitHub: [BonnierNews/dn-design-system/../web/src/components/thematic-break](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/thematic-break)
5
+ * Storybook: [ThematicBreak](https://designsystem.dn.se/?path=/docs/article-thematicbreak--docs)
6
6
 
7
- # ThematicBreak
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/thematic-break/thematic-break.scss'`
8
8
 
9
- ## Parameters
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">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-1f9domv"><div class="css-13nzt7e"><span class="css-o1d7ko">object</span></div></div></td><td><span>-</span></td></tr></tbody></table>
10
10
 
11
- |parameter | type | required | options | default | description |
12
- |:--- | :--- | :--- | :--- | :--- | :--- |
13
- |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
14
- |classNames | String | no | | | Ex. "my-special-class" |
15
-
16
- ## Minimum requirement example
17
-
18
- ### Nunjucks
19
-
20
- These are copy paste friendly examples to quickliy get started using a component.
21
-
22
- ```html
23
- {% from '@bonniernews/dn-design-system-web/components/thematic-break/thematic-break.njk' import ThematicBreak %}
24
-
25
- {{ ThematicBreak() }}
26
- ```
27
-
28
- ### SCSS
29
- ```scss
30
- @use "@bonniernews/dn-design-system-web/components/thematic-break/thematic-break";
31
- ```
11
+ <pre class="prismjs css-4zr3vl"><div class="language-jsx css-zye6j" style="white-space: pre;"><span class="token tag punctuation">&lt;</span><span class="token tag class-name">ThematicBreak</span><span class="token tag"> </span><span class="token tag punctuation">/&gt;</span></div></pre>
@@ -5,6 +5,14 @@ export interface ThematicBreakProps {
5
5
  attributes?: object;
6
6
  }
7
7
 
8
+ /**
9
+ * - GitHub: [BonnierNews/dn-design-system/../web/src/components/thematic-break](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/thematic-break)
10
+ * - Storybook: [ThematicBreak](https://designsystem.dn.se/?path=/docs/article-thematicbreak--docs)
11
+ *
12
+ * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:
13
+ * `@use '@bonniernews/dn-design-system-web/components/thematic-break/thematic-break.scss'`
14
+ */
15
+
8
16
  export const ThematicBreak = ({ classNames, attributes }: ThematicBreakProps) => {
9
17
  const classes = formatClassString([
10
18
  'ds-thematic-break',
@@ -48,8 +48,8 @@
48
48
  @include ds-typography($ds-typography-functionalbody01);
49
49
 
50
50
  h2 {
51
- @include ds-typography($ds-typography-functionalbody02, $fontWeight: $ds-fontweight-semibold);
52
51
  margin: 0;
52
+ @include ds-typography($ds-typography-functionalbody02, $fontWeight: $ds-fontweight-semibold);
53
53
 
54
54
  + p {
55
55
  margin-top: 0;
@@ -1,12 +1,13 @@
1
1
  @use "../../foundations/helpers/forward.helpers.scss" as *;
2
2
 
3
3
  .ds-video-caption {
4
- @include ds-typography($ds-typography-functionalbody01);
5
- color: $ds-color-text-primary;
4
+ @include ds-typography($ds-typography-functionalbody01) {
5
+ color: $ds-color-text-primary;
6
+ }
6
7
 
7
8
  .ds-video-caption__duration {
8
- @include ds-typography($ds-typography-functionalbody01, $fontWeight: $ds-fontweight-bold);
9
9
  margin-right: ds-spacing($ds-s-025);
10
+ @include ds-typography($ds-typography-functionalbody01, $fontWeight: $ds-fontweight-bold);
10
11
  }
11
12
 
12
13
  @at-root .ds-force-px#{&} {
@@ -12,22 +12,22 @@ $ds-vip-badge__icon-size: 16px;
12
12
  background-color: $ds-color-component-business;
13
13
  color: $ds-color-static-white;
14
14
  fill: $ds-color-static-white;
15
+ padding: ds-spacing($ds-s-025, rem);
15
16
  @include ds-typography(
16
17
  $ds-typography-functionalmeta01,
17
18
  $lineHeight: $ds-lineheight-l,
18
19
  $letterSpacing: $ds-letterspacing-none
19
20
  );
20
- padding: ds-spacing($ds-s-025, rem);
21
21
 
22
22
  @at-root .ds-force-px#{&} {
23
+ border-radius: ds-border-radius(x1) 0 ds-border-radius(x1) ds-border-radius(x1);
24
+ padding: ds-spacing($ds-s-025);
23
25
  @include ds-typography(
24
26
  $ds-typography-functionalmeta01,
25
27
  $forcePx: true,
26
28
  $lineHeight: $ds-lineheight-l,
27
29
  $letterSpacing: $ds-letterspacing-none
28
30
  );
29
- border-radius: ds-border-radius(x1) 0 ds-border-radius(x1) ds-border-radius(x1);
30
- padding: ds-spacing($ds-s-025);
31
31
  }
32
32
 
33
33
  // bang class indicating that the user has premium access
@@ -1,3 +1,5 @@
1
+ @use "../variables/colorsCssVariables";
2
+
1
3
  @use "colors.scss" as *;
2
4
  @use "../variables/decorations.scss" as *;
3
5
  @use "utilities.scss" as *;
@@ -7,34 +9,37 @@ $ds-link-paragraph: "paragraph";
7
9
  $ds-link-article-body: "article-body";
8
10
 
9
11
  @mixin ds-link($type: paragraph) {
10
- color: inherit;
11
- @include ds-underline(2px, 1px);
12
12
  &:focus-visible {
13
13
  outline-color: $ds-color-border-focus-02;
14
14
  }
15
15
 
16
- @if ($type == $ds-link-list) {
17
- text-decoration-line: none;
18
- &:hover {
19
- text-decoration-line: $ds-text-decoration-link-underline;
20
- }
21
- } @else if ($type == $ds-link-paragraph) {
22
- text-decoration-line: $ds-text-decoration-link-underline;
23
- &:hover {
16
+ & {
17
+ color: inherit;
18
+ @include ds-underline(2px, 1px);
19
+ @if ($type == $ds-link-list) {
24
20
  text-decoration-line: none;
21
+ &:hover {
22
+ text-decoration-line: $ds-text-decoration-link-underline;
23
+ }
24
+ } @else if ($type == $ds-link-paragraph) {
25
+ text-decoration-line: $ds-text-decoration-link-underline;
26
+ &:hover {
27
+ text-decoration-line: none;
28
+ }
29
+ &:visited {
30
+ color: $ds-color-text-primary-02;
31
+ }
32
+ } @else if ($type == $ds-link-article-body) {
33
+ text-decoration-line: $ds-text-decoration-link-underline;
34
+ color: $ds-color-text-body-link;
35
+ &:hover {
36
+ text-decoration-line: none;
37
+ }
38
+ &:visited {
39
+ color: $ds-color-text-body-link-visited;
40
+ }
25
41
  }
26
- &:visited {
27
- color: $ds-color-text-primary-02;
28
- }
29
- } @else if ($type == $ds-link-article-body) {
30
- text-decoration-line: $ds-text-decoration-link-underline;
31
- color: $ds-color-text-body-link;
32
- &:hover {
33
- text-decoration-line: none;
34
- }
35
- &:visited {
36
- color: $ds-color-text-body-link-visited;
37
- }
42
+ @content;
38
43
  }
39
44
  }
40
45
 
@@ -1,6 +1,4 @@
1
- @use "sass:list";
2
1
  @use "sass:map";
3
- @use "sass:string";
4
2
 
5
3
  $ds-mq-min-width--desktop: 1025;
6
4
  $ds-mq-min-width--tablet: 768;
@@ -1,5 +1,4 @@
1
1
  @use "sass:list";
2
- @use "sass:math";
3
2
  @use "sass:map";
4
3
  @use "../variables/metrics.scss" as *;
5
4
 
@@ -35,7 +34,7 @@ $dsBorderWidth: map.get($metrics, "border-width");
35
34
  $values: list.append($values, $value);
36
35
  }
37
36
 
38
- @if length($values) == 1 {
37
+ @if list.length($values) == 1 {
39
38
  @return list.nth($values, 1);
40
39
  }
41
40
 
@@ -1,6 +1,4 @@
1
- @use "sass:meta";
2
1
  @use "sass:map";
3
- @use "sass:string";
4
2
  @use "utilities.scss" as *;
5
3
  @use "../variables/shadowsDnLightTokens.scss" as *;
6
4
  @use "../variables/shadowsDnDarkTokens.scss" as *;
@@ -1,3 +1,4 @@
1
+ @use "sass:meta";
1
2
  @use "sass:list";
2
3
  @use "sass:math";
3
4
  @use "sass:map";
@@ -27,7 +28,7 @@
27
28
 
28
29
  @if ($value == 0) {
29
30
  $value: 0 * 1;
30
- } @else if ($value and type-of($value) == "number") {
31
+ } @else if ($value and meta.type-of($value) == "number") {
31
32
  @if ($sizeUnit == "rem") {
32
33
  $value: (math.div($value, 16)) * 1rem;
33
34
  } @else {
@@ -37,13 +38,13 @@
37
38
  $value: $value * -1;
38
39
  }
39
40
  }
40
- @if (type-of($value) == "number" or $value == "auto") {
41
+ @if (meta.type-of($value) == "number" or $value == "auto") {
41
42
  $values: list.append($values, $value);
42
43
  }
43
44
  }
44
45
  }
45
46
 
46
- @if length($values) == 1 {
47
+ @if list.length($values) == 1 {
47
48
  @return list.nth($values, 1);
48
49
  }
49
50
 
@@ -1,4 +1,3 @@
1
- @use "sass:meta";
2
1
  @use "sass:map";
3
2
  @use "sass:string";
4
3
  @use "sass:math";
@@ -71,7 +70,7 @@ $dsSerifWeights: (
71
70
  @if $tmpMap {
72
71
  @include ds-mq-largest-breakpoint(mobile) {
73
72
  @include _ds-normalize-letter-spacing($tmpMap);
74
- @each $key in map-keys($tmpMap) {
73
+ @each $key in map.keys($tmpMap) {
75
74
  $value: _ds-get-override-value($key, $fontWeight, $letterSpacing, $lineHeight, $fontStyle);
76
75
  @include _ds-typography-get-property($tmpMap, $key, $forcePx, "small", $value);
77
76
  }
@@ -81,7 +80,7 @@ $dsSerifWeights: (
81
80
  @if $tmpMapScreenLarge {
82
81
  @include ds-mq-only-breakpoint(tablet) {
83
82
  @include _ds-normalize-letter-spacing($tmpMapScreenLarge);
84
- @each $key in map-keys($tmpMapScreenLarge) {
83
+ @each $key in map.keys($tmpMapScreenLarge) {
85
84
  $value: _ds-get-override-value($key, $fontWeight, $letterSpacing, $lineHeight, $fontStyle);
86
85
  @include _ds-typography-get-property($tmpMapScreenLarge, $key, $forcePx, "large", $value);
87
86
  }
@@ -91,12 +90,16 @@ $dsSerifWeights: (
91
90
  @if $tmpMapScreenExtraLarge {
92
91
  @include ds-mq-smallest-breakpoint(desktop) {
93
92
  @include _ds-normalize-letter-spacing($tmpMapScreenExtraLarge);
94
- @each $key in map-keys($tmpMapScreenExtraLarge) {
93
+ @each $key in map.keys($tmpMapScreenExtraLarge) {
95
94
  $value: _ds-get-override-value($key, $fontWeight, $letterSpacing, $lineHeight, $fontStyle);
96
95
  @include _ds-typography-get-property($tmpMapScreenExtraLarge, $key, $forcePx, "extraLarge", $value);
97
96
  }
98
97
  }
99
98
  }
99
+
100
+ & {
101
+ @content;
102
+ }
100
103
  }
101
104
 
102
105
  @mixin ds-typography-without-mq(
@@ -130,7 +133,7 @@ $dsSerifWeights: (
130
133
 
131
134
  @if $tmpMap {
132
135
  @include _ds-normalize-letter-spacing($tmpMap);
133
- @each $key in map-keys($tmpMap) {
136
+ @each $key in map.keys($tmpMap) {
134
137
  $value: _ds-get-override-value($key, $fontWeight, $letterSpacing, $lineHeight, $fontStyle);
135
138
  @include _ds-typography-get-property($tmpMap, $key, $forcePx, $scaling, $value);
136
139
  }
@@ -156,7 +159,7 @@ $dsSerifWeights: (
156
159
  letterSpacing: $letterSpacing,
157
160
  );
158
161
  $forcePx: $scaling == false;
159
- @each $key in map-keys($dsTypographyKeys) {
162
+ @each $key in map.keys($dsTypographyKeys) {
160
163
  @include _ds-typography-get-property($dsTypographyKeys, $key, $forcePx, $scaling);
161
164
  }
162
165
  }
@@ -178,7 +181,7 @@ $dsSerifWeights: (
178
181
  }
179
182
  } @else if $key == "fontWeight" {
180
183
  $value: string.to-lower-case($value);
181
- @if map-has-key($fontWeights, $value) {
184
+ @if map.has-key($fontWeights, $value) {
182
185
  $value: map.get($fontWeights, $value);
183
186
  }
184
187
  font-weight: #{$value};
@@ -204,7 +207,7 @@ $dsSerifWeights: (
204
207
  letter-spacing: ds-px-to-rem($value);
205
208
  }
206
209
  }
207
- } @else if index(map-keys($dsTypographyKeys), $key) {
210
+ } @else if list.index(map.keys($dsTypographyKeys), $key) {
208
211
  #{map.get($dsTypographyKeys, $key)}: $value;
209
212
  }
210
213
  }
@@ -249,6 +252,9 @@ $dsSerifWeights: (
249
252
  @at-root .ds-force-px#{&} {
250
253
  @include ds-typography($token, true);
251
254
  }
255
+ & {
256
+ @content;
257
+ }
252
258
  }
253
259
 
254
260
  @function _ds-get-override-value($key, $fontWeight, $letterSpacing, $lineHeight, $fontStyle) {
@@ -1,3 +1,4 @@
1
+ @use "sass:meta";
1
2
  @use "sass:math";
2
3
 
3
4
  $ds-btn__min-clickable-area: 48px;
@@ -7,7 +8,7 @@ $ds-btn__min-clickable-area: 48px;
7
8
  }
8
9
 
9
10
  @function ds-strip-unit($number) {
10
- @if type-of($number) == "number" and not unitless($number) {
11
+ @if meta.type-of($number) == "number" and not math.is-unitless($number) {
11
12
  @return math.div($number, ($number * 0 + 1));
12
13
  }
13
14