@bonniernews/dn-design-system-web 11.0.4 → 11.1.1

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 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
+ ## [11.1.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@11.1.0...@bonniernews/dn-design-system-web@11.1.1) (2024-02-02)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **web:** correct height on byline toggle ([#1184](https://github.com/BonnierNews/dn-design-system/issues/1184)) ([2464ece](https://github.com/BonnierNews/dn-design-system/commit/2464ece0c6c0bacbf6f3a0b90787372bfd61c079))
13
+
14
+ ## [11.1.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@11.0.4...@bonniernews/dn-design-system-web@11.1.0) (2024-02-01)
15
+
16
+
17
+ ### Features
18
+
19
+ * **web:** redesign linkbox ([#1183](https://github.com/BonnierNews/dn-design-system/issues/1183)) ([3657ac0](https://github.com/BonnierNews/dn-design-system/commit/3657ac0f48688475452702e4ac64a26044df1a3d))
20
+
7
21
  ## [11.0.4](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@11.0.3...@bonniernews/dn-design-system-web@11.0.4) (2024-01-30)
8
22
 
9
23
 
@@ -55,6 +55,7 @@ $ds-btn-toggle__icon-size-xsmall: 20px;
55
55
  display: inline-flex;
56
56
  align-items: center;
57
57
  justify-content: center;
58
+ flex-shrink: 0;
58
59
  border: $ds-btn-toggle-outlined__border-width solid var(--ds-btn-toggle__border-color);
59
60
  border-radius: 100px;
60
61
  position: relative;
@@ -21,6 +21,7 @@ The byline is a list item and should be wrapped in a list.
21
21
  |email | String | no | | | email will be displayed instead of role for variant:follow |
22
22
  |authorPageUrl | String | no | | | For variant:button an inner link can be used in combination with a button, for other variants an outer link is used |
23
23
  |followable | Boolean | no | true, false | true | If true the toggle button to follow will be shown when using variant:follow. |
24
+ |followed | Boolean | no | true, false | false | If true the toggle button will be in "selected" state. Depends on followable parameter. |
24
25
  |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
25
26
  |elementAttributes | Object | no | | | Sets attributes on actual toggle element and not byline list item. Same structure as attributes above, for accessability reasons it's important to send in "aria-label": "Följ " + byline.name |
26
27
  |classNames | String | no | | | Ex. "my-special-class" |
@@ -27,6 +27,7 @@
27
27
  {{ ButtonToggle({
28
28
  text: "Följ",
29
29
  selectedText: "Följer",
30
+ selected: params.followed,
30
31
  variant: "secondaryFilled",
31
32
  size: "xsmall",
32
33
  attributes: params.elementAttributes,
@@ -52,21 +52,6 @@ $ds-byline__image-size--direkt: 36px;
52
52
  bottom: 0;
53
53
  right: 0;
54
54
  }
55
-
56
- .ds-icon {
57
- position: relative;
58
- display: flex;
59
- height: ds-px-to-rem($ds-byline__icon-size);
60
- width: ds-px-to-rem($ds-byline__icon-size);
61
- margin: 0;
62
- @at-root .ds-force-px#{&} {
63
- height: $ds-byline__icon-size;
64
- width: $ds-byline__icon-size;
65
- }
66
- svg {
67
- fill: currentColor;
68
- }
69
- }
70
55
  }
71
56
 
72
57
  .ds-byline__content-wrapper {
@@ -122,11 +107,24 @@ $ds-byline__image-size--direkt: 36px;
122
107
  color: $ds-color-icon-primary;
123
108
  display: inline-flex;
124
109
  margin-left: ds-spacing($ds-s-100);
110
+
111
+ .ds-icon {
112
+ position: relative;
113
+ display: flex;
114
+ height: ds-px-to-rem($ds-byline__icon-size);
115
+ width: ds-px-to-rem($ds-byline__icon-size);
116
+ margin: 0;
117
+ @at-root .ds-force-px#{&} {
118
+ height: $ds-byline__icon-size;
119
+ width: $ds-byline__icon-size;
120
+ }
121
+ svg {
122
+ fill: currentColor;
123
+ }
124
+ }
125
125
  }
126
126
 
127
127
  .ds-byline__btn-toggle {
128
- min-height: $ds-byline__icon-size;
129
- min-width: 48px;
130
128
  margin-left: ds-spacing($ds-s-100);
131
129
  }
132
130
 
@@ -10,7 +10,7 @@
10
10
 
11
11
  |parameter | type | required | options | default | description |
12
12
  |:--- | :--- | :--- | :--- | :--- | :--- |
13
- |linkBoxItems | Array | yes | | | Array with link objects. Ex. [ { label: 'Sverige runt', link: '#', mediaHtml: "", layout: 'quiz', attributes: { "data-test": "list-item-test-data" } } ] |
13
+ |linkBoxItems | Array | yes | | | Array with link objects. Ex. [ { label: 'Sverige runt', text: '42 avsnitt', link: '#', mediaHtml: "", layout: 'quiz', attributes: { "data-test": "list-item-test-data" } } ] |
14
14
  |vignetteText | String | no | | | Heading of the link box |
15
15
  |vignetteTargetUrl | String | no | | | Target URL for the header |
16
16
  |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
@@ -15,9 +15,13 @@
15
15
  {{ params.mediaHtml | safe }}
16
16
  </div>
17
17
  {% endif %}
18
-
19
- {% if params.label %}
20
- <span class="{{ componentClassName + '__label'}}">{{ params.label }}</span>
21
- {% endif %}
18
+ <div class="{{ componentClassName + '__content'}}">
19
+ {% if params.label %}
20
+ <span class="{{ componentClassName + '__label'}}">{{ params.label }}</span>
21
+ {% endif %}
22
+ {% if params.text %}
23
+ <span class="{{ componentClassName + '__text'}}">{{ params.text }}</span>
24
+ {% endif %}
25
+ </div>
22
26
  </a>
23
27
  {% endmacro %}
@@ -1,26 +1,24 @@
1
1
  @use "../../foundations/helpers/forward.helpers.scss" as *;
2
2
 
3
3
  .ds-link-box-item {
4
- padding: ds-spacing($ds-s-100);
4
+ padding: 0;
5
5
  background-color: $ds-color-surface-background;
6
- border: ds-border-width(x1) solid $ds-color-border-primary;
7
- border-radius: ds-border-radius(x2);
8
6
  text-decoration: none;
9
7
  display: flex;
10
8
  flex-direction: column;
11
- align-items: center;
9
+ align-items: flex-start;
12
10
  justify-content: flex-start;
13
11
 
14
12
  &:focus-visible {
15
13
  outline: none;
16
14
 
17
- .ds-link-box-item__label {
15
+ .ds-link-box-item__content {
18
16
  @include ds-focus(2px, false);
19
17
  }
20
18
  }
21
19
 
22
20
  @include ds-hover(true) {
23
- > .ds-link-box-item__label {
21
+ .ds-link-box-item__label {
24
22
  @include ds-underline();
25
23
  }
26
24
  }
@@ -28,30 +26,30 @@
28
26
  .ds-link-box-item__label {
29
27
  color: $ds-color-text-primary;
30
28
  @include ds-typography($ds-typography-functional-body01semibold);
31
- text-align: center;
29
+ word-break: break-word;
30
+ display: block;
32
31
  }
33
32
 
34
- .ds-link-box-item__media + .ds-link-box-item__label {
35
- margin-top: ds-spacing($ds-s-050);
33
+ .ds-link-box-item__text {
34
+ color: $ds-color-text-primary-02;
35
+ @include ds-typography($ds-typography-functional-body01regular);
36
+ display: block;
36
37
  }
37
38
 
38
- .ds-link-box-item__media {
39
- font-size: 0;
39
+ .ds-link-box-item__content {
40
+ width: 100%;
40
41
  }
41
42
 
42
- &.ds-link-box-item--quiz {
43
- .ds-link-box-item__media {
44
- width: 48px;
45
- }
43
+ .ds-link-box-item__media + .ds-link-box-item__content {
44
+ margin-top: ds-spacing($ds-s-050);
46
45
  }
47
46
 
48
- // Just sample css, replace with actual when design is available
49
- &.ds-link-box-item--pod {
50
- .ds-link-box-item__media {
51
- &,
52
- & img {
53
- width: 100%;
54
- }
47
+ .ds-link-box-item__media {
48
+ font-size: 0;
49
+ width: 100%;
50
+ & img {
51
+ width: 100%;
52
+ height: auto;
55
53
  }
56
54
  }
57
55
  }
@@ -2,23 +2,20 @@
2
2
  @use "../../components/group-header/group-header";
3
3
  @use "./link-box-item";
4
4
 
5
- $ds-link-box-grid-gap: ds-spacing($ds-s-050);
6
-
7
5
  .ds-link-box {
8
6
  background-color: $ds-color-surface-background;
9
7
 
10
8
  .ds-link-box__grid {
11
- padding: ds-spacing($ds-s-075);
9
+ padding: ds-spacing($ds-s-100);
12
10
  display: grid;
13
- grid-column-gap: $ds-link-box-grid-gap;
14
- row-gap: $ds-link-box-grid-gap;
11
+ gap: ds-spacing($ds-s-100 $ds-s-050);
15
12
 
16
13
  @include ds-mq-only-breakpoint(mobile) {
17
- grid-template-columns: 1fr 1fr;
14
+ grid-template-columns: repeat(2, minmax(0, 1fr));
18
15
  }
19
16
 
20
17
  @include ds-mq-smallest-breakpoint(tablet) {
21
- grid-template-columns: 1fr 1fr 1fr 1fr;
18
+ grid-template-columns: repeat(4, minmax(0, 1fr));
22
19
  }
23
20
  }
24
21
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "11.0.4",
3
+ "version": "11.1.1",
4
4
  "description": "DN design system for web.",
5
5
  "main": "index.js",
6
6
  "homepage": "https://github.com/BonnierNews/dn-design-system/tree/main/web/src#readme",