@bonniernews/dn-design-system-web 11.1.3 → 11.2.0
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,13 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [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)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **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))
|
|
13
|
+
|
|
7
14
|
## [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
15
|
|
|
9
16
|
|
|
@@ -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
|
-
|
|
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 %}
|
|
@@ -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
|
-
|
|
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