@bonniernews/dn-design-system-web 3.0.0-alpha.40 → 3.0.0-alpha.41
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 +14 -0
- package/components/teaser-large/teaser-large.njk +1 -1
- package/components/teaser-standard/teaser-standard.scss +1 -1
- package/components/teaser-tipsa/README.md +40 -0
- package/components/teaser-tipsa/teaser-tipsa.njk +32 -0
- package/components/teaser-tipsa/teaser-tipsa.scss +17 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,20 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
## [3.0.0-alpha.41](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@3.0.0-alpha.40...@bonniernews/dn-design-system-web@3.0.0-alpha.41) (2023-05-03)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **web:** tipsa teaser ([#780](https://github.com/BonnierNews/dn-design-system/issues/780)) ([cb2a263](https://github.com/BonnierNews/dn-design-system/commit/cb2a2636cdbc823f8584133b27a6730e9eddb973))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* **web:** teaserLarge should check params.targetId ([#789](https://github.com/BonnierNews/dn-design-system/issues/789)) ([4ea1838](https://github.com/BonnierNews/dn-design-system/commit/4ea18388286217e9171f1a851c3dad65c1eace0f))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
6
20
|
## 3.0.0-alpha.40 (2023-05-03)
|
|
7
21
|
|
|
8
22
|
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
|
|
34
34
|
<a href="{{ params.targetLink }}"
|
|
35
35
|
class="{{ classes }}"
|
|
36
|
-
{% if targetId %} data-id="{{ params.targetId }}" {% endif %}
|
|
36
|
+
{% if params.targetId %} data-id="{{ params.targetId }}" {% endif %}
|
|
37
37
|
{{- attributes | safe }}>
|
|
38
38
|
|
|
39
39
|
{% if params.mediaHtml %}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
2
|
@use "../../assets/teaser/teaser.scss" as *;
|
|
3
3
|
|
|
4
|
-
.ds-teaser--standard {
|
|
4
|
+
.ds-teaser.ds-teaser--standard {
|
|
5
5
|
display: flex;
|
|
6
6
|
|
|
7
7
|
@include ds-spacing-layout($ds-sl-teaser-vertical $ds-sl-teaser-horizontal);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-tipsa](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-tipsa)
|
|
2
|
+
- Storybook (PROD): [TeaserTipsa > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teasertipsa-web)
|
|
3
|
+
- Storybook (LATEST): [TeaserTipsa > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teasertipsa-web)
|
|
4
|
+
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
# teaser-tipsa
|
|
8
|
+
|
|
9
|
+
It's quite common to include a dot in the title string, like "• This is a title"
|
|
10
|
+
|
|
11
|
+
## Parameters
|
|
12
|
+
|
|
13
|
+
|parameter | type | required | options | default | description |
|
|
14
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
15
|
+
|title | String | yes | | | Heading of the teaser |
|
|
16
|
+
|targetLink | String | yes | | | Target URL for the teaser |
|
|
17
|
+
|targetId | String | no | | | Target article ID |
|
|
18
|
+
|text | String | no | | | Teaser subtext |
|
|
19
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
20
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
21
|
+
|~forcePx~ | | | | | Not supported |
|
|
22
|
+
|
|
23
|
+
## Minimum requirement example
|
|
24
|
+
|
|
25
|
+
### Nunjucks
|
|
26
|
+
|
|
27
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-tipsa/teaser-tipsa.njk' import TeaserTipsa %}
|
|
31
|
+
|
|
32
|
+
{{ TeaserTipsa({
|
|
33
|
+
title: "• Jessie Ware låter den fullödiga fullängdaren vänta på sig",
|
|
34
|
+
})}}
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### SCSS
|
|
38
|
+
```scss
|
|
39
|
+
@use "@bonniernews/dn-design-system-web/components/teaser-tipsa/teaser-tipsa" as *;
|
|
40
|
+
```
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
2
|
+
|
|
3
|
+
{% macro TeaserTipsa(params) %}
|
|
4
|
+
{% set componentClassName = "ds-teaser" %}
|
|
5
|
+
{% set classNamePrefix = componentClassName + "--" %}
|
|
6
|
+
{% set additionalClasses = ["ds-teaser--tipsa"] %}
|
|
7
|
+
{% set attributes = getAttributes(params.attributes) %}
|
|
8
|
+
|
|
9
|
+
{% if params.classNames %}
|
|
10
|
+
{% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
|
|
11
|
+
{% endif%}
|
|
12
|
+
|
|
13
|
+
{% set classes = componentClassName + " " + additionalClasses | join(" ") %}
|
|
14
|
+
|
|
15
|
+
<a href="{{ params.targetLink }}"
|
|
16
|
+
class="{{ classes }}"
|
|
17
|
+
{% if targetId %} data-id="{{ params.targetId }}" {% endif %}
|
|
18
|
+
{{- attributes | safe }}>
|
|
19
|
+
|
|
20
|
+
<div class="{{ componentClassName + '__content'}}">
|
|
21
|
+
<h2 class="ds-teaser__title">
|
|
22
|
+
{{ params.title | safe }}
|
|
23
|
+
</h2>
|
|
24
|
+
|
|
25
|
+
{% if params.text %}
|
|
26
|
+
<p class="{{ componentClassName + '__text'}}">
|
|
27
|
+
{{ params.text | safe }}
|
|
28
|
+
</p>
|
|
29
|
+
{% endif %}
|
|
30
|
+
</div>
|
|
31
|
+
</a>
|
|
32
|
+
{% endmacro %}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
+
@use "../../assets/teaser/teaser.scss" as *;
|
|
3
|
+
|
|
4
|
+
.ds-teaser.ds-teaser--tipsa {
|
|
5
|
+
.ds-teaser__content {
|
|
6
|
+
@include ds-spacing-layout($ds-sl-teaser-vertical $ds-sl-teaser-horizontal);
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
.ds-teaser__title {
|
|
10
|
+
@include ds-typography($ds-typography-expressive-heading01bold);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
.ds-teaser__text {
|
|
14
|
+
margin-top: 0;
|
|
15
|
+
@include ds-typography($ds-typography-functional-body02regular);
|
|
16
|
+
}
|
|
17
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bonniernews/dn-design-system-web",
|
|
3
|
-
"version": "3.0.0-alpha.
|
|
3
|
+
"version": "3.0.0-alpha.41",
|
|
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",
|