@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
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
+ ## [21.1.4](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@21.1.3...@bonniernews/dn-design-system-web@21.1.4) (2024-11-15)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **web:** refactor deprecated sass ([#1498](https://github.com/BonnierNews/dn-design-system/issues/1498)) ([390dac7](https://github.com/BonnierNews/dn-design-system/commit/390dac7f47444978276124aa396c9cccfd2aeef1))
13
+
14
+ ## [21.1.3](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@21.1.2...@bonniernews/dn-design-system-web@21.1.3) (2024-11-15)
15
+
16
+
17
+ ### Maintenance
18
+
19
+ * **web:** generate readme files based on storybook stories ([#1493](https://github.com/BonnierNews/dn-design-system/issues/1493)) ([253fa95](https://github.com/BonnierNews/dn-design-system/commit/253fa9592f35cb8f80faeafc2de9ba1d7da3ea3f))
20
+
7
21
  ## [21.1.2](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@21.1.1...@bonniernews/dn-design-system-web@21.1.2) (2024-11-15)
8
22
 
9
23
 
@@ -32,9 +32,10 @@ $grade-size: ds-px-to-rem(34px);
32
32
 
33
33
  .ds-teaser__vignette {
34
34
  display: block;
35
- @include ds-typography($ds-typography-functionallabel01);
36
- color: $ds-theme-color;
37
35
  margin-bottom: ds-spacing($ds-s-025);
36
+ @include ds-typography($ds-typography-functionallabel01) {
37
+ color: $ds-theme-color;
38
+ }
38
39
  }
39
40
 
40
41
  .ds-teaser__title {
@@ -56,10 +57,11 @@ $grade-size: ds-px-to-rem(34px);
56
57
  }
57
58
 
58
59
  .ds-teaser__text {
59
- @include ds-typography($ds-typography-detailmedryckare);
60
- color: $ds-color-text-primary;
61
60
  // Should be replaced with dynamic spacing layout token when available
62
61
  margin: ds-spacing($ds-s-050 0 0);
62
+ @include ds-typography($ds-typography-detailmedryckare) {
63
+ color: $ds-color-text-primary;
64
+ }
63
65
  @include ds-mq-smallest-breakpoint(tablet) {
64
66
  margin-top: ds-spacing($ds-s-075);
65
67
  }
@@ -7,8 +7,6 @@ $ds-badge__min-size: 8px;
7
7
  box-sizing: content-box;
8
8
 
9
9
  .ds-badge__inner {
10
- @include ds-typography($ds-typography-functionalmeta02, $lineHeight: 0, $fontWeight: $ds-fontweight-semibold);
11
- color: $ds-color-static-white;
12
10
  background-color: $ds-color-component-brand;
13
11
  border: $ds-color-border-secondary ds-border-width(x2) solid;
14
12
  border-radius: 100px;
@@ -18,16 +16,19 @@ $ds-badge__min-size: 8px;
18
16
  min-height: ds-px-to-rem($ds-badge__min-size);
19
17
  min-width: ds-px-to-rem($ds-badge__min-size);
20
18
  padding: ds-spacing($ds-s-025, rem);
19
+ @include ds-typography($ds-typography-functionalmeta02, $lineHeight: 0, $fontWeight: $ds-fontweight-semibold) {
20
+ color: $ds-color-static-white;
21
+ }
21
22
  @at-root .ds-force-px#{&} {
23
+ min-height: $ds-badge__min-size;
24
+ min-width: $ds-badge__min-size;
25
+ padding: ds-spacing($ds-s-025);
22
26
  @include ds-typography(
23
27
  $ds-typography-functionalmeta02,
24
28
  $forcePx: true,
25
29
  $lineHeight: 0,
26
30
  $fontWeight: $ds-fontweight-semibold
27
31
  );
28
- min-height: $ds-badge__min-size;
29
- min-width: $ds-badge__min-size;
30
- padding: ds-spacing($ds-s-025);
31
32
  }
32
33
  }
33
34
 
@@ -15,28 +15,30 @@
15
15
 
16
16
  .ds-blocked-content__body {
17
17
  margin: ds-spacing(0 0 $ds-s-200);
18
- @include ds-typography($ds-typography-functionalbody02);
19
- color: $ds-color-text-primary;
18
+ @include ds-typography($ds-typography-functionalbody02) {
19
+ color: $ds-color-text-primary;
20
+ }
20
21
  @at-root .ds-force-px#{&} {
21
22
  @include ds-typography($ds-typography-functionalbody02, true);
22
23
  }
23
24
  }
24
25
 
25
26
  .ds-blocked-content__link {
26
- @include ds-link($ds-link-paragraph);
27
27
  display: inline-block;
28
28
  margin-top: ds-spacing($ds-s-050);
29
29
  word-break: break-word;
30
+ @include ds-link($ds-link-paragraph);
30
31
  }
31
32
 
32
33
  .ds-blocked-content__title {
34
+ margin: ds-spacing(0 0 $ds-s-050);
33
35
  @include ds-typography(
34
36
  $ds-typography-functionalheading01,
35
37
  $lineHeight: $ds-lineheight-m,
36
38
  $fontWeight: $ds-fontweight-semibold
37
- );
38
- color: $ds-color-text-primary;
39
- margin: ds-spacing(0 0 $ds-s-050);
39
+ ) {
40
+ color: $ds-color-text-primary;
41
+ }
40
42
  @at-root .ds-force-px#{&} {
41
43
  @include ds-typography(
42
44
  $ds-typography-functionalheading01,
@@ -48,37 +48,40 @@
48
48
  top: ds-spacing($ds-s-075);
49
49
  }
50
50
  .ds-buddy-menu__greeting {
51
- @include ds-typography($ds-typography-functionalheading03);
52
- color: $ds-color-text-primary;
53
51
  margin: ds-spacing(0 0 $ds-s-100);
54
52
  display: block;
53
+ @include ds-typography($ds-typography-functionalheading03) {
54
+ color: $ds-color-text-primary;
55
+ }
55
56
  }
56
57
  .ds-buddy-menu__account-title,
57
58
  .ds-buddy-menu__addons-title,
58
59
  .ds-buddy-menu__links-title {
59
- @include ds-typography($ds-typography-functionalbody02, $fontWeight: $ds-fontweight-semibold);
60
- color: $ds-color-text-primary;
61
60
  margin: ds-spacing(0 0 $ds-s-025);
61
+ @include ds-typography($ds-typography-functionalbody02, $fontWeight: $ds-fontweight-semibold) {
62
+ color: $ds-color-text-primary;
63
+ }
62
64
  }
63
65
  .ds-buddy-menu__links-title {
64
66
  padding: ds-spacing(0 $ds-s-100);
65
67
  }
66
68
  .ds-buddy-menu__addons-list {
67
69
  padding: 0;
68
- margin: ds-spacing(0 0 $ds-s-100);
69
70
  list-style: none;
71
+ margin: ds-spacing(0 0 $ds-s-100);
70
72
  a {
71
73
  @include ds-link($ds-link-list);
72
- @include ds-typography($ds-typography-functionalbody02);
73
- color: $ds-color-text-primary-02;
74
- margin: ds-spacing(0 0 $ds-s-100);
74
+ @include ds-typography($ds-typography-functionalbody02) {
75
+ color: $ds-color-text-primary-02;
76
+ }
75
77
  }
76
78
  }
77
79
  .ds-buddy-menu__account-level {
78
- @include ds-typography($ds-typography-functionalbody02);
79
- color: $ds-color-text-primary-02;
80
80
  margin: ds-spacing(0 0 $ds-s-100);
81
81
  display: block;
82
+ @include ds-typography($ds-typography-functionalbody02) {
83
+ color: $ds-color-text-primary-02;
84
+ }
82
85
  }
83
86
  .ds-buddy-menu__links-list {
84
87
  border-bottom-left-radius: ds-border-radius(x2);
@@ -1,4 +1,3 @@
1
- @use "sass:math";
2
1
  @use "../../foundations/helpers/forward.helpers.scss" as *;
3
2
  @use "../icon-sprite/icon-sprite.scss";
4
3
  @use "../spinner/spinner.scss" as *;
@@ -17,6 +16,17 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
17
16
  --ds-btn__border-color: transparent;
18
17
  --ds-btn__outline-color: #{$ds-color-border-focus-02};
19
18
  --ds-btn__icon-size: #{ds-px-to-rem(24px)};
19
+
20
+ cursor: pointer;
21
+ border: $ds-btn-outlined__border-width solid var(--ds-btn__border-color);
22
+ border-radius: ds-border-radius(x1);
23
+ position: relative;
24
+ background-color: var(--ds-btn__background-color);
25
+ color: var(--ds-btn__color);
26
+ display: inline-flex;
27
+ align-items: center;
28
+ justify-content: center;
29
+
20
30
  @at-root .ds-force-px#{&} {
21
31
  --ds-btn__icon-size: 24px;
22
32
  }
@@ -35,6 +45,7 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
35
45
  --ds-btn__color: #{$ds-color-text-primary};
36
46
  }
37
47
  }
48
+
38
49
  &.ds-btn--secondary {
39
50
  &.ds-btn--default,
40
51
  &.ds-btn--elevated {
@@ -49,6 +60,7 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
49
60
  --ds-btn__color: #{$ds-color-text-primary};
50
61
  }
51
62
  }
63
+
52
64
  &.ds-btn--brand {
53
65
  --ds-btn__outline-color: #{$ds-color-border-focus};
54
66
  &.ds-btn--default,
@@ -64,6 +76,7 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
64
76
  --ds-btn__color: #{$ds-color-text-brand};
65
77
  }
66
78
  }
79
+
67
80
  &.ds-btn--staticWhite {
68
81
  --ds-btn__outline-color: #{$ds-color-static-white};
69
82
  &.ds-btn--default,
@@ -90,68 +103,64 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
90
103
  &.ds-btn--transparent {
91
104
  --ds-btn__background-color: transparent;
92
105
  }
106
+
93
107
  &.ds-btn--rounded {
94
108
  border-radius: 100px;
95
109
  }
110
+
96
111
  &.ds-btn--elevated {
97
112
  box-shadow: ds-shadow-get-box-shadow($ds-shadow-elevation-m);
98
113
  }
99
114
 
100
115
  &.ds-btn--small {
101
- @include ds-typography($ds-typography-detailstandard-button-small);
102
116
  --ds-btn__icon-size: #{ds-px-to-rem(20px)};
103
117
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-050), true)};
104
118
  padding: _btn-brdr(ds-spacing($ds-s-025), true) _btn-brdr(ds-spacing($ds-s-075), true);
119
+ @include ds-typography($ds-typography-detailstandard-button-small);
105
120
  @at-root .ds-force-px#{&} {
106
- @include ds-typography($ds-typography-detailstandard-button-small, true);
107
121
  --ds-btn__icon-size: 20px;
108
122
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-050))};
109
123
  padding: _btn-brdr(ds-spacing($ds-s-025)) _btn-brdr(ds-spacing($ds-s-075));
124
+ @include ds-typography($ds-typography-detailstandard-button-small, true);
110
125
  }
111
126
  }
127
+
112
128
  &.ds-btn--medium {
113
- @include ds-typography($ds-typography-detailstandard-button);
114
129
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-100), true)};
115
130
  padding: _btn-brdr(ds-spacing($ds-s-050), true) _btn-brdr(ds-spacing($ds-s-125), true);
131
+ @include ds-typography($ds-typography-detailstandard-button);
116
132
  @at-root .ds-force-px#{&} {
117
133
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-100))};
118
- @include ds-typography($ds-typography-detailstandard-button, true);
119
134
  padding: _btn-brdr(ds-spacing($ds-s-050)) _btn-brdr(ds-spacing($ds-s-125));
135
+ @include ds-typography($ds-typography-detailstandard-button, true);
120
136
  }
121
137
  }
138
+
122
139
  &.ds-btn--large {
123
- @include ds-typography($ds-typography-detailstandard-button);
124
140
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-125), true)};
125
141
  padding: _btn-brdr(ds-spacing($ds-s-075), true) _btn-brdr(ds-spacing($ds-s-150), true);
142
+ @include ds-typography($ds-typography-detailstandard-button);
143
+
126
144
  @at-root .ds-force-px#{&} {
127
- @include ds-typography($ds-typography-detailstandard-button, true);
128
145
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-125))};
129
146
  padding: _btn-brdr(ds-spacing($ds-s-075)) _btn-brdr(ds-spacing($ds-s-150));
147
+ @include ds-typography($ds-typography-detailstandard-button, true);
130
148
  }
131
149
  }
150
+
132
151
  &.ds-btn--xlarge {
133
- @include ds-typography($ds-typography-detailstandard-button-xlarge);
134
152
  --ds-btn__icon-size: #{ds-px-to-rem(32px)};
135
153
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-200), true) - ds-px-to-rem(4px)};
136
154
  padding: _btn-brdr(ds-spacing($ds-s-075), true) _btn-brdr(ds-spacing($ds-s-200), true);
155
+ @include ds-typography($ds-typography-detailstandard-button-xlarge);
137
156
  @at-root .ds-force-px#{&} {
138
- @include ds-typography($ds-typography-detailstandard-button-xlarge, true);
139
157
  --ds-btn__icon-size: 32px;
140
158
  --ds-btn__icon-padding: #{_btn-brdr(ds-spacing($ds-s-200)) - 4px};
141
159
  padding: _btn-brdr(ds-spacing($ds-s-075)) _btn-brdr(ds-spacing($ds-s-200));
160
+ @include ds-typography($ds-typography-detailstandard-button-xlarge, true);
142
161
  }
143
162
  }
144
163
 
145
- cursor: pointer;
146
- border: $ds-btn-outlined__border-width solid var(--ds-btn__border-color);
147
- border-radius: ds-border-radius(x1);
148
- position: relative;
149
- background-color: var(--ds-btn__background-color);
150
- color: var(--ds-btn__color);
151
- display: inline-flex;
152
- align-items: center;
153
- justify-content: center;
154
-
155
164
  span {
156
165
  pointer-events: none;
157
166
  }
@@ -196,6 +205,7 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
196
205
  opacity: $ds-opacity-component-hover-pressed;
197
206
  }
198
207
  }
208
+
199
209
  &:active:not(:disabled):not(.ds-loading)::before {
200
210
  opacity: $ds-opacity-component-hover-pressed;
201
211
  }
@@ -41,8 +41,8 @@ $ds-checkbox__icon-size: 24px;
41
41
  @include ds-typography($ds-typography-functionalbody02);
42
42
 
43
43
  @at-root .ds-force-px#{&} {
44
- @include ds-typography($ds-typography-functionalbody02, true);
45
44
  margin: ds-spacing(0 0 0 $ds-s-050);
45
+ @include ds-typography($ds-typography-functionalbody02, true);
46
46
  }
47
47
  }
48
48
 
@@ -20,10 +20,11 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
20
20
  }
21
21
 
22
22
  .ds-disclaimer__body-html {
23
- @include ds-typography($ds-typography-functionalbody01);
24
23
  margin: 0;
25
- color: $ds-color-text-primary-02;
26
24
  flex-grow: 1;
25
+ @include ds-typography($ds-typography-functionalbody01) {
26
+ color: $ds-color-text-primary-02;
27
+ }
27
28
 
28
29
  @at-root .ds-force-px#{&} {
29
30
  @include ds-typography($ds-typography-functionalbody01, true);
@@ -34,8 +35,9 @@ $ds-btn-outlined__border-width: ds-border-width(x1);
34
35
  }
35
36
  b,
36
37
  strong {
37
- @include ds-typography($ds-typography-functionalbody01, $fontWeight: $ds-fontweight-semibold);
38
- color: $ds-color-text-primary;
38
+ @include ds-typography($ds-typography-functionalbody01, $fontWeight: $ds-fontweight-semibold) {
39
+ color: $ds-color-text-primary;
40
+ }
39
41
  @at-root .ds-force-px#{&} {
40
42
  @include ds-typography($ds-typography-functionalbody01, $forcePx: true, $fontWeight: $ds-fontweight-semibold);
41
43
  }
@@ -0,0 +1,34 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/divider](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/divider)
2
+ - Storybook: [Divider](https://designsystem.dn.se/?path=/docs/basic-divider--docs)
3
+ - Storybook (Latest): [Divider](https://designsystem-latest.dn.se/?path=/docs/basic-divider--docs)
4
+
5
+ ----
6
+
7
+ # Divider
8
+
9
+ ## Parameters
10
+
11
+ |parameter | type | required | options | default | description |
12
+ |:--- | :--- | :--- | :--- | :--- | :--- |
13
+ |variant | String | no | soft, medium, strong | soft | |
14
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
15
+ |classNames | String | no | | | Ex. "my-special-class" |
16
+
17
+ ## Minimum requirement example
18
+
19
+ ### Nunjucks
20
+
21
+ These are copy paste friendly examples to quickliy get started using a component.
22
+
23
+ ```html
24
+ {% from '@bonniernews/dn-design-system-web/components/divider/divider.njk' import Divider %}
25
+
26
+ {{ Divider({
27
+ variant: "soft"
28
+ })}}
29
+ ```
30
+
31
+ ### SCSS
32
+ ```scss
33
+ @use "@bonniernews/dn-design-system-web/components/divider/divider";
34
+ ```
@@ -1,34 +1,11 @@
1
- - GitHub: [BonnierNews/dn-design-system/../web/src/components/divider](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/divider)
2
- - Storybook: [Divider](https://designsystem.dn.se/?path=/docs/basic-divider--docs)
3
- - Storybook (Latest): [Divider](https://designsystem-latest.dn.se/?path=/docs/basic-divider--docs)
1
+ Divider
2
+ =======
4
3
 
5
- ----
4
+ * GitHub: [BonnierNews/dn-design-system/../web/src/components/divider](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/divider)
5
+ * Storybook: [Divider](https://designsystem.dn.se/?path=/docs/basic-divider--docs)
6
6
 
7
- # Divider
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/divider/divider.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">variant</span></td><td><div class="css-1f9domv"><div class="css-13nzt7e"><span class="css-o1d7ko">"soft"</span><span class="css-o1d7ko">"medium"</span><span class="css-o1d7ko">"hard"</span></div></div></td><td><div class="css-13nzt7e"><span class="css-o1d7ko">"soft"</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-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
- |variant | String | no | soft, medium, strong | soft | |
14
- |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
15
- |classNames | String | no | | | Ex. "my-special-class" |
16
-
17
- ## Minimum requirement example
18
-
19
- ### Nunjucks
20
-
21
- These are copy paste friendly examples to quickliy get started using a component.
22
-
23
- ```html
24
- {% from '@bonniernews/dn-design-system-web/components/divider/divider.njk' import Divider %}
25
-
26
- {{ Divider({
27
- variant: "soft"
28
- })}}
29
- ```
30
-
31
- ### SCSS
32
- ```scss
33
- @use "@bonniernews/dn-design-system-web/components/divider/divider";
34
- ```
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">Divider</span><span class="token tag"> </span><span class="token tag attr-name">variant</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">soft</span><span class="token tag attr-value punctuation">"</span><span class="token tag"> </span><span class="token tag punctuation">/&gt;</span></div></pre>
@@ -6,6 +6,13 @@ export interface DividerProps {
6
6
  attributes?: object;
7
7
  }
8
8
 
9
+ /**
10
+ * - GitHub: [BonnierNews/dn-design-system/../web/src/components/divider](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/divider)
11
+ * - Storybook: [Divider](https://designsystem.dn.se/?path=/docs/basic-divider--docs)
12
+ *
13
+ * The component will not include styling by itself. Make sure to include the right styles for the component. See example below:
14
+ * `@use '@bonniernews/dn-design-system-web/components/divider/divider.scss'`
15
+ */
9
16
  export const Divider = ({ variant = 'soft', classNames, attributes }: DividerProps) => {
10
17
  const classes = formatClassString([
11
18
  'ds-divider',
@@ -12,16 +12,18 @@
12
12
  margin-top: ds-spacing($ds-s-100);
13
13
 
14
14
  h2 {
15
- @include ds-typography($ds-typography-functionalheading03);
16
- color: $ds-color-text-primary;
17
15
  margin: 0;
16
+ @include ds-typography($ds-typography-functionalheading03) {
17
+ color: $ds-color-text-primary;
18
+ }
18
19
  }
19
20
 
20
21
  .ds-empty-state__body {
21
- @include ds-typography($ds-typography-functionalbody02);
22
22
  display: block;
23
- color: $ds-color-text-primary-02;
24
23
  margin-top: ds-spacing($ds-s-025);
24
+ @include ds-typography($ds-typography-functionalbody02) {
25
+ color: $ds-color-text-primary-02;
26
+ }
25
27
  }
26
28
  }
27
29
 
@@ -36,8 +36,9 @@ $ds-factbox__max-height: 500px; // includes top/bottom spacing
36
36
 
37
37
  .ds-factbox__body {
38
38
  overflow: hidden;
39
- @include ds-typography($ds-typography-functionalbody02);
40
- color: $ds-color-text-primary;
39
+ @include ds-typography($ds-typography-functionalbody02) {
40
+ color: $ds-color-text-primary;
41
+ }
41
42
  @at-root .ds-force-px#{&} {
42
43
  @include ds-typography($ds-typography-functionalbody02, true);
43
44
  }
@@ -65,9 +66,10 @@ $ds-factbox__max-height: 500px; // includes top/bottom spacing
65
66
  }
66
67
  }
67
68
  .ds-factbox__title {
68
- @include ds-typography($ds-typography-functionalheading01, $lineHeight: $ds-lineheight-m);
69
- color: $ds-color-text-primary;
70
69
  margin: ds-spacing(0 0 $ds-s-100);
70
+ @include ds-typography($ds-typography-functionalheading01, $lineHeight: $ds-lineheight-m) {
71
+ color: $ds-color-text-primary;
72
+ }
71
73
  @at-root .ds-force-px#{&} {
72
74
  @include ds-typography($ds-typography-functionalheading01, $forcePx: true, $lineHeight: $ds-lineheight-m);
73
75
  }
@@ -96,15 +96,15 @@ $ds-footer-column-gap: ds-spacing($ds-s-400);
96
96
  }
97
97
 
98
98
  h2 {
99
- @include ds-typography($ds-typography-functionalheading01, $lineHeight: $ds-lineheight-l);
100
99
  margin: ds-spacing(0 0 $ds-s-100);
100
+ @include ds-typography($ds-typography-functionalheading01, $lineHeight: $ds-lineheight-l);
101
101
  }
102
102
 
103
103
  ul {
104
- @include ds-typography($ds-typography-functionalbody02, $lineHeight: $ds-lineheight-l);
105
104
  list-style: none;
106
105
  margin: 0;
107
106
  padding: 0;
107
+ @include ds-typography($ds-typography-functionalbody02, $lineHeight: $ds-lineheight-l);
108
108
 
109
109
  li:not(:last-of-type) {
110
110
  margin: ds-spacing(0 0 $ds-s-050);
@@ -122,15 +122,14 @@ $ds-footer-column-gap: ds-spacing($ds-s-400);
122
122
  }
123
123
 
124
124
  &__channels {
125
- @include ds-typography($ds-typography-functionalbody01, $lineHeight: $ds-lineheight-l);
126
125
  margin-top: ds-spacing($ds-footer-row-gap-spacing-token);
126
+ @include ds-typography($ds-typography-functionalbody01, $lineHeight: $ds-lineheight-l);
127
127
 
128
128
  a {
129
- @include ds-link($ds-link-list);
130
- @include ds-focus($offset: 2px, $color: $ds-color-static-white);
131
129
  margin: ds-spacing($ds-s-100 $ds-s-100 0 0);
132
130
  display: inline-block;
133
-
131
+ @include ds-link($ds-link-list);
132
+ @include ds-focus($offset: 2px, $color: $ds-color-static-white);
134
133
  @include ds-mq-smallest-breakpoint(tablet) {
135
134
  margin: ds-spacing($ds-s-100 $ds-s-150 0 0);
136
135
  }
@@ -25,9 +25,10 @@ $ds-game-header__icon-size: 105px;
25
25
  }
26
26
 
27
27
  .ds-game-header__title {
28
- @include ds-typography($ds-typography-functionalheading05);
29
- color: inherit;
30
28
  margin: 0;
29
+ @include ds-typography($ds-typography-functionalheading05) {
30
+ color: inherit;
31
+ }
31
32
  }
32
33
 
33
34
  .ds-game-header__media {
@@ -44,9 +45,10 @@ $ds-game-header__icon-size: 105px;
44
45
  }
45
46
 
46
47
  .ds-game-header__description-content {
47
- @include ds-typography($ds-typography-functionalbody02);
48
48
  padding: ds-spacing($ds-s-100);
49
- color: $ds-color-text-primary;
49
+ @include ds-typography($ds-typography-functionalbody02) {
50
+ color: $ds-color-text-primary;
51
+ }
50
52
 
51
53
  @include ds-mq-only-breakpoint(mobile) {
52
54
  padding-top: ds-spacing($ds-s-050);
@@ -63,8 +63,9 @@ $ds-group-header__icon-size: 24px;
63
63
 
64
64
  .ds-group-header__right-link {
65
65
  @include ds-typography($ds-typography-functionalbody01);
66
- @include ds-link($ds-link-paragraph);
67
- color: var(--group-header-icon-color);
66
+ @include ds-link($ds-link-paragraph) {
67
+ color: var(--group-header-icon-color);
68
+ }
68
69
  }
69
70
 
70
71
  .ds-group-header__icon {
@@ -100,8 +101,8 @@ $ds-group-header__icon-size: 24px;
100
101
  .ds-group-header__title {
101
102
  padding: ds-spacing($ds-s-075 $ds-s-100);
102
103
  flex: 1;
103
- @include ds-typography($ds-typography-functionalheading01, $lineHeight: $ds-lineheight-l);
104
104
  margin: 0;
105
+ @include ds-typography($ds-typography-functionalheading01, $lineHeight: $ds-lineheight-l);
105
106
  }
106
107
 
107
108
  &--bottom-border .ds-group-header__title {
@@ -1,9 +1,10 @@
1
1
  @use "../../foundations/helpers/forward.helpers.scss" as *;
2
2
 
3
3
  .ds-image-caption {
4
- @include ds-typography($ds-typography-functionalbody01);
5
4
  margin-top: ds-spacing($ds-s-050);
6
- color: $ds-color-text-primary;
5
+ @include ds-typography($ds-typography-functionalbody01) {
6
+ color: $ds-color-text-primary;
7
+ }
7
8
 
8
9
  @at-root .ds-force-px#{&} {
9
10
  @include ds-typography($ds-typography-functionalbody01, true);
@@ -24,16 +24,18 @@
24
24
  }
25
25
 
26
26
  .ds-link-box-item__label {
27
- color: $ds-color-text-primary;
28
- @include ds-typography($ds-typography-functionalbody01, $fontWeight: $ds-fontweight-semibold);
29
27
  word-break: break-word;
30
28
  display: block;
29
+ @include ds-typography($ds-typography-functionalbody01, $fontWeight: $ds-fontweight-semibold) {
30
+ color: $ds-color-text-primary;
31
+ }
31
32
  }
32
33
 
33
34
  .ds-link-box-item__text {
34
- color: $ds-color-text-primary-02;
35
- @include ds-typography($ds-typography-functionalbody01);
36
35
  display: block;
36
+ @include ds-typography($ds-typography-functionalbody01) {
37
+ color: $ds-color-text-primary-02;
38
+ }
37
39
  }
38
40
 
39
41
  .ds-link-box-item__content {