@bonniernews/dn-design-system-web 11.1.3 → 11.2.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.2.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@11.2.0...@bonniernews/dn-design-system-web@11.2.1) (2024-02-07)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **web:** footer should take attributes ([#1190](https://github.com/BonnierNews/dn-design-system/issues/1190)) ([6dc0d2b](https://github.com/BonnierNews/dn-design-system/commit/6dc0d2b64c224c41c8759111d6de497c69a57f44))
13
+
14
+ ## [11.2.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@11.1.3...@bonniernews/dn-design-system-web@11.2.0) (2024-02-07)
15
+
16
+
17
+ ### Features
18
+
19
+ * **web:** add linkattributes to byline and toggle list item ([#1188](https://github.com/BonnierNews/dn-design-system/issues/1188)) ([e4ae0ce](https://github.com/BonnierNews/dn-design-system/commit/e4ae0ce217b07ddee78efad6d7641df166b0732c))
20
+
7
21
  ## [11.1.3](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@11.1.2...@bonniernews/dn-design-system-web@11.1.3) (2024-02-06)
8
22
 
9
23
 
@@ -24,6 +24,7 @@ The byline is a list item and should be wrapped in a list.
24
24
  |followed | Boolean | no | true, false | false | If true the toggle button will be in "selected" state. Depends on followable parameter. |
25
25
  |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
26
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 |
27
+ |linkAttributes | Object | no | | | Sets attributes on the link element. |
27
28
  |classNames | String | no | | | Ex. "my-special-class" |
28
29
  |elementClassNames | String | no | | | Sets classes on actual toggle element and not byline list item. Same structure as classNames above |
29
30
  |forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size
@@ -52,8 +52,9 @@
52
52
 
53
53
  {# This inner link can exist in combination with a button. It's been decided that it should only be used for authorPageUrls, not for email #}
54
54
  {% if not useOuterAnchorElement and params.authorPageUrl %}
55
+ {% set linkAttributes = getAttributes(params.linkAttributes) %}
55
56
  {%- set ariaLabel = 'aria-label="Läs mer från ' + params.authorName + '"' %}
56
- <a href="{{params.authorPageUrl}}" {{ ariaLabel | safe if not params.email }} class="{{ componentClassName + '__content-wrapper'}}">
57
+ <a href="{{params.authorPageUrl}}" {{- linkAttributes | safe }} {{ ariaLabel | safe if not params.email }} class="{{ componentClassName + '__content-wrapper'}}">
57
58
  {{ caller() if caller }}
58
59
  </a>
59
60
  {% else %}
@@ -90,7 +91,8 @@
90
91
  {% endif %}
91
92
 
92
93
  {% if useOuterAnchorElement %}
93
- <a href="{{ params.authorPageUrl }}" aria-label="Läs mer från {{ params.authorName }}" class="{{ classes }}" {{- attributes | safe }}>
94
+ {% set linkAttributes = getAttributes(params.linkAttributes) %}
95
+ <a href="{{ params.authorPageUrl }}" aria-label="Läs mer från {{ params.authorName }}" class="{{ classes }}" {{- attributes | safe }} {{- linkAttributes | safe }}>
94
96
  {{ caller() if caller }}
95
97
  </a>
96
98
  {% else %}
@@ -16,6 +16,7 @@
16
16
  |rudolf | Object | yes | | | Ex. { imgUrl: "images/rudolf.png", text: "Punkten efter Dagens Nyheter har funnits med.." } |
17
17
  |channels | Array > Object | no | | | Ex. [{ href: "?channel=mobile", text: "Mobil", classNames: "hidden-mobile", attributes: {rel: "nofollow"} }] |
18
18
  |classNames | String | no | | | Ex. "my-special-class" |
19
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
19
20
  |forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size
20
21
 
21
22
  ## Minimum requirement example
@@ -7,8 +7,8 @@
7
7
  "ds-force-px" if params.forcePx,
8
8
  params.classNames if params.classNames
9
9
  ] | join(" ") %}
10
-
11
- <footer class="{{ classes }}">
10
+ {%- set attributes = getAttributes(params.attributes) %}
11
+ <footer class="{{ classes }}" {{- attributes | safe }}>
12
12
  <div class="{{ componentClassName + '__inner'}}">
13
13
  <div class="{{ componentClassName + '__link-grid'}}">
14
14
  {% for group in params.linkGroups %}
@@ -21,6 +21,7 @@
21
21
  |border | bool | no | true, false | false | |
22
22
  |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
23
23
  |elementAttributes | Object | no | | | Sets attributes on actual toggle element and not list item. Same structure as attributes above |
24
+ |linkAttributes | Object | no | | | Set attributes on the title link. Ex. { target: "_blank", "data-test": "lorem ipsum" } |
24
25
  |classNames | String | no | | | Ex. "my-special-class" |
25
26
  |forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size
26
27
 
@@ -17,7 +17,8 @@
17
17
  {% if params.title %}
18
18
  <div class="{{ componentClassName + '__titles'}}">
19
19
  {% if params.titleHref and not params.disabled %}
20
- <a class="{{ componentClassName + '__title'}}" href="{{ params.titleHref }}">{{ params.title }}</a>
20
+ {% set linkAttributes = getAttributes(params.linkAttributes) %}
21
+ <a class="{{ componentClassName + '__title'}}" href="{{ params.titleHref }}" {{ linkAttributes | safe }}>{{ params.title }}</a>
21
22
  {% else %}
22
23
  <span class="{{ componentClassName + '__title'}}">{{ params.title }}</span>
23
24
  {% endif %}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "11.1.3",
3
+ "version": "11.2.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",