@bonniernews/dn-design-system-web 15.2.10 → 15.2.12

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,26 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
4
4
 
5
5
 
6
6
 
7
+ ## [15.2.12](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@15.2.11...@bonniernews/dn-design-system-web@15.2.12) (2024-06-19)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **web:** group header image updates ([#1320](https://github.com/BonnierNews/dn-design-system/issues/1320)) ([2a684b5](https://github.com/BonnierNews/dn-design-system/commit/2a684b5d6a4aba737e3adb6fce78b0734e6f1d92))
13
+
14
+ ## [15.2.11](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@15.2.10...@bonniernews/dn-design-system-web@15.2.11) (2024-06-04)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **web:** add image to bauta ([#1315](https://github.com/BonnierNews/dn-design-system/issues/1315)) ([23e1091](https://github.com/BonnierNews/dn-design-system/commit/23e1091c4dbddf7ca206732a0fc0cb6f95e95bf5))
20
+
21
+
22
+ ### Maintenance
23
+
24
+ * **app:** change pressable onpress type ([#1313](https://github.com/BonnierNews/dn-design-system/issues/1313)) ([3ce69ee](https://github.com/BonnierNews/dn-design-system/commit/3ce69ee7fb7323ac62b35716d247a2d6f50e5b45))
25
+ * prerelease packages ([09c0dea](https://github.com/BonnierNews/dn-design-system/commit/09c0dea5706d48f1769d392eef3357b653a90928))
26
+
7
27
  ## [15.2.10](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@15.2.9...@bonniernews/dn-design-system-web@15.2.10) (2024-05-20)
8
28
 
9
29
 
@@ -11,22 +11,26 @@
11
11
  |parameter | type | required | options | default | description |
12
12
  |:--- | :--- | :--- | :--- | :--- | :--- |
13
13
  |title | string | yes | | | The title text |
14
- |variant | string | no | icon, link, toggle, arrows, image, bauta, bauataxl, image | icon | The variant to render |
14
+ |type | string | no | icon, link, toggle, arrows | icon | The type of interactive element added to the header |
15
+ |variant | string | no | bauta, bauataxl | | The design variant, if not bauta or bautaxl the group header will get the 'standard' design |
16
+ |mediaHtml | string | no | | | The image markup for the header |
15
17
  |href | string | no | | | If given, the title is rendered as a link |
16
- |linkText | string | no | | | The link text to render (only for variants `link` and `direkt`) |
18
+ |linkText | string | no | | | The link text to render (only for types `link` and `direkt`) |
17
19
  |showBottomBorder | boolean | no | | | If true there will be a bottom border |
18
- |toggleText | text | no | | | `text` parameter to ToggleButton (only for variant `toggle`) |
19
- |toggleSelectedText | text | no | | | `selectedText` parameter to ToggleButton (only for variant `toggle`) |
20
- |toggleSelected | boolean | no | | | `selected` parameter to ToggleButton (only for variant `toggle`) |
21
- |toggleLoading | boolean | no | | | `loading` parameter to ToggleButton (only for variant `toggle`) |
22
- |toggleClassNames | text | no | | | `classNames` parameter to ToggleButton (only for variant `toggle`) |
23
- |toggleAttributes | text | no | | | `attributes` parameter to ToggleButton (only for variant `toggle`) |
20
+ |toggleText | text | no | | | `text` parameter to ToggleButton (only for type `toggle`) |
21
+ |toggleSelectedText | text | no | | | `selectedText` parameter to ToggleButton (only for type `toggle`) |
22
+ |toggleSelected | boolean | no | | | `selected` parameter to ToggleButton (only for type `toggle`) |
23
+ |toggleLoading | boolean | no | | | `loading` parameter to ToggleButton (only for type `toggle`) |
24
+ |toggleClassNames | text | no | | | `classNames` parameter to ToggleButton (only for type `toggle`) |
25
+ |toggleAttributes | text | no | | | `attributes` parameter to ToggleButton (only for type `toggle`) |
24
26
  |classNames | String | no | | | Ex. "my-special-class" |
25
27
  |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
26
28
 
27
- NB: The `arrows` variant is only active in desktop environments. It is equivalent to `link` or `icon` in non-desktop environments, depending on if the `linkText` parameter is also given.
29
+ NB: The `arrows` type is only active in desktop environments. It is equivalent to `link` or `icon` in non-desktop environments, depending on if the `linkText` parameter is also given.
28
30
 
29
- Depending on variant, either the `toggle-*` or `linkText` parameters are allowed. In `icon` and `link` mode, the `href` parameter is required to show the ornament.
31
+ Depending on type, either the `toggle-*` or `linkText` parameters are allowed. In `icon` and `link` mode, the `href` parameter is required to show the ornament.
32
+
33
+ The type `toggle` is (currently) not allowed if variant is bauta or bautaxl.
30
34
 
31
35
  ## Minimum requirement example
32
36
 
@@ -49,4 +53,4 @@ These are copy paste friendly examples to quickliy get started using a component
49
53
  ```
50
54
 
51
55
  ### JS
52
- If you use the `toggle` variant, you might need to initiate that component, [as per the documentation](https://designsystem.dn.se/?path=/readmetab/basic-buttons-buttontoggle--docs).
56
+ If you use the `toggle` type, you might need to initiate that component, [as per the documentation](https://designsystem.dn.se/?path=/readmetab/basic-buttons-buttontoggle--docs).
@@ -10,28 +10,29 @@
10
10
 
11
11
  {%- set classes = [
12
12
  componentClassName,
13
- classNamePrefix + (params.variant or "icon"),
13
+ classNamePrefix + (params.type or "icon"),
14
+ classNamePrefix + params.variant if params.variant,
14
15
  classNamePrefix + 'bottom-border' if params.showBottomBorder,
15
16
  params.classNames if params.classNames
16
17
  ] | join(" ") %}
17
18
 
18
19
  {% set groupHeaderInner %}
19
- {% if params.variant == 'image' %}
20
+ {% if params.mediaHtml %}
20
21
  <div class="{{ componentClassName + '__image'}}">{{ params.mediaHtml | safe }}</div>
21
22
  {% endif %}
22
23
  <h2 class="{{ componentClassName + '__title'}}">{{ params.title }}</h2>
23
24
 
24
- {% if params.variant == 'link' and params.linkText and params.href %}
25
+ {% if params.type == 'link' and params.linkText and params.href %}
25
26
  <span class="{{ componentClassName + '__right-link' }}">
26
27
  {{ params.linkText }}
27
28
  </span>
28
- {% elif (params.variant == 'icon' or params.variant == 'bauta' or params.variant == 'image' or not params.variant) and params.href %}
29
+ {% elif (params.type == 'icon' or not params.type) and params.href %}
29
30
  {{ IconUse({ icon: "arrow_forward", classNames: componentClassName + '__icon' }) }}
30
- {% elif (params.variant == 'arrows') and params.href and params.linkText %}
31
+ {% elif (params.type == 'arrows') and params.href and params.linkText %}
31
32
  <span class="{{ componentClassName + '__right-link' }} hidden-desktop">
32
33
  {{ params.linkText }}
33
34
  </span>
34
- {% elif (params.variant == 'arrows') and params.href %}
35
+ {% elif (params.type == 'arrows') and params.href %}
35
36
  {{ IconUse({ icon: "arrow_forward", classNames: componentClassName + '__icon hidden-desktop' }) }}
36
37
  {% endif %}
37
38
  {% endset %}
@@ -44,9 +45,10 @@
44
45
  {% else %}
45
46
  {{ groupHeaderInner | safe }}
46
47
  {% endif %}
47
- {% if params.variant == 'toggle' %}
48
+ {# there is no static-white toggle btn so it is disabled for bauta/xl for now #}
49
+ {% if params.type == 'toggle' and not params.variant %}
48
50
  {{ ButtonToggle({
49
- variant: 'brand',
51
+ variant: "brand",
50
52
  size: 'small',
51
53
  text: params.toggleText,
52
54
  selectedText: params.toggleSelectedText,
@@ -55,10 +57,11 @@
55
57
  classNames: params.toggleClassNames,
56
58
  attributes: params.toggleAttributes
57
59
  }) }}
58
- {% elif (params.variant == 'arrows') %}
60
+ {% elif (params.type == 'arrows') %}
61
+ {% set buttonVariant = "staticWhite" if params.variant else "primary" %}
59
62
  <div class="{{ componentClassName + '__arrows' }} hidden-mobile hidden-tablet">
60
63
  {{ IconButton({
61
- variant: "primary",
64
+ variant: buttonVariant,
62
65
  emphasis: "outline",
63
66
  size: "small",
64
67
  iconName: "arrow_back",
@@ -66,7 +69,7 @@
66
69
  attributes: {"aria-label": "Föregående"}
67
70
  }) }}
68
71
  {{ IconButton({
69
- variant: "primary",
72
+ variant: buttonVariant,
70
73
  emphasis: "outline",
71
74
  size: "small",
72
75
  iconName: "arrow_forward",
@@ -28,6 +28,7 @@ $ds-group-header__icon-size: 24px;
28
28
  &--bautaxl {
29
29
  --group-header-background: #{$ds-color-static-black};
30
30
  --group-header-color: #{$ds-color-static-yellow};
31
+ --group-header-icon-color: #{$ds-color-icon-on-brand};
31
32
  }
32
33
 
33
34
  &--toggle,
@@ -42,11 +43,6 @@ $ds-group-header__icon-size: 24px;
42
43
  }
43
44
  }
44
45
 
45
- &--image {
46
- display: flex;
47
- align-items: center;
48
- }
49
-
50
46
  .ds-group-header__right-link,
51
47
  .ds-group-header__icon,
52
48
  .ds-btn--toggle {
@@ -73,6 +69,7 @@ $ds-group-header__icon-size: 24px;
73
69
  .ds-group-header__right-link {
74
70
  @include ds-typography($ds-typography-functional-body01regular);
75
71
  @include ds-link($ds-link-paragraph);
72
+ color: var(--group-header-icon-color);
76
73
  }
77
74
 
78
75
  .ds-group-header__icon {
@@ -122,10 +119,11 @@ $ds-group-header__icon-size: 24px;
122
119
 
123
120
  .ds-group-header__image {
124
121
  margin-left: ds-spacing($ds-s-100);
122
+ align-self: center;
125
123
 
126
124
  .picture,
127
125
  img {
128
- max-height: ds-px-to-rem($ds-group-header__icon-size);
126
+ height: ds-px-to-rem($ds-group-header__icon-size);
129
127
  }
130
128
 
131
129
  figure {
@@ -113,7 +113,7 @@ $ds-list-item__icon-size: 24px;
113
113
  .ds-list-item__image {
114
114
  .picture,
115
115
  img {
116
- max-height: ds-px-to-rem($ds-list-item__icon-size);
116
+ height: ds-px-to-rem($ds-list-item__icon-size);
117
117
  }
118
118
 
119
119
  @at-root .ds-force-px#{&} {
@@ -13,12 +13,12 @@
13
13
  params.classNames if params.classNames
14
14
  ] | join(" ") %}
15
15
 
16
- {% if params.groupHeaderVariant %}
17
- {% set variant = params.groupHeaderVariant %}
16
+ {% if params.groupHeaderType %}
17
+ {% set type = params.groupHeaderType %}
18
18
  {% elif arrowPosition === 'header' %}
19
- {% set variant = 'arrows' %}
19
+ {% set type = 'arrows' %}
20
20
  {% else %}
21
- {% set variant = 'link' %}
21
+ {% set type = 'link' %}
22
22
  {% endif %}
23
23
 
24
24
  {%- call TeaserCard({
@@ -30,7 +30,7 @@
30
30
  {{ GroupHeader({
31
31
  title: params.title,
32
32
  href: params.titleHref,
33
- variant: variant,
33
+ type: type,
34
34
  linkText: 'Visa alla'
35
35
  }) }}
36
36
  <div class="{{ componentClassName + '__carousel'}}">
@@ -12,18 +12,12 @@
12
12
  ] | join(" ") %}
13
13
  {%- set attributes = getAttributes(params.attributes) %}
14
14
 
15
- {% if params.vignetteIconHtml %}
16
- {% set variant = 'image' %}
17
- {% elif params.areaType === 'bauta' or params.areaType === 'bautaxl'%}
18
- {% set variant = params.areaType %}
19
- {% endif %}
20
-
21
15
  <div class="{{ classes }}">
22
16
  {% if params.vignetteText %}
23
17
  {{ GroupHeader({
24
18
  title: params.vignetteText,
25
19
  href: params.vignetteTargetUrl,
26
- variant: variant,
20
+ variant: params.areaType if params.areaType,
27
21
  mediaHtml: params.vignetteIconHtml if params.vignetteIconHtml
28
22
  }) }}
29
23
  {% endif %}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "15.2.10",
3
+ "version": "15.2.12",
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",