@bonniernews/dn-design-system-web 3.0.0-alpha.57 → 3.0.0-alpha.58
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
|
@@ -3,6 +3,15 @@
|
|
|
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.58 (2023-05-15)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **web:** right now teaser ([#827](https://github.com/BonnierNews/dn-design-system/issues/827)) ([05bb4c7](https://github.com/BonnierNews/dn-design-system/commit/05bb4c731bc42c3b0cf1d976cf1fd59956c33c19))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## 3.0.0-alpha.57 (2023-05-10)
|
|
7
16
|
|
|
8
17
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-right-now](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-right-now)
|
|
2
|
+
- Storybook (PROD): [TeaserRightNow > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teaserrightnow-web--right-now)
|
|
3
|
+
- Storybook (LATEST): [TeaserRightNow > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teaserrightnow-web--right-now)
|
|
4
|
+
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
# teaser-right-now
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
|parameter | type | required | options | default | description |
|
|
12
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
+
|title | String | yes | | | Heading of the teaser |
|
|
14
|
+
|targetLink | String | yes | | | Target URL for the teaser |
|
|
15
|
+
|theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme-class to apply to the teaser |
|
|
16
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
17
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
18
|
+
|~forcePx~ | | | | | Not supported |
|
|
19
|
+
|
|
20
|
+
## Minimum requirement example
|
|
21
|
+
|
|
22
|
+
### Nunjucks
|
|
23
|
+
|
|
24
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-right-now/teaser-right-now.njk' import TeaserRightNow %}
|
|
28
|
+
|
|
29
|
+
{{ TeaserRightNow({
|
|
30
|
+
title: "Tågtrafiken avstängd mellan Malmö och Göteborg",
|
|
31
|
+
})}}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### SCSS
|
|
35
|
+
```scss
|
|
36
|
+
@use "@bonniernews/dn-design-system-web/components/teaser-right-now/teaser-right-now" as *;
|
|
37
|
+
```
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
2
|
+
|
|
3
|
+
{% macro TeaserRightNow(params) %}
|
|
4
|
+
{%- set componentClassName = "ds-teaser" %}
|
|
5
|
+
{%- set classNamePrefix = componentClassName + "--" %}
|
|
6
|
+
{%- set additionalClasses = ["ds-teaser--right-now"] %}
|
|
7
|
+
{%- set attributes = getAttributes(params.attributes) %}
|
|
8
|
+
|
|
9
|
+
{%- if params.classNames %}
|
|
10
|
+
{% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
|
|
11
|
+
{% endif%}
|
|
12
|
+
|
|
13
|
+
{%- if params.theme %}
|
|
14
|
+
{% set additionalClasses = (additionalClasses.push('ds-theme--' + params.theme), additionalClasses) %}
|
|
15
|
+
{% endif %}
|
|
16
|
+
|
|
17
|
+
{%- set classes = componentClassName + " " + additionalClasses | join(" ") %}
|
|
18
|
+
<a href="{{ params.targetLink }}"
|
|
19
|
+
class="{{ classes }}"
|
|
20
|
+
{{- attributes | safe }}>
|
|
21
|
+
|
|
22
|
+
<div class="{{ componentClassName + '__content'}}">
|
|
23
|
+
<h2 class="ds-teaser__title">
|
|
24
|
+
<span class="ds-teaser__right-now-sticker">Just nu:</span> {{ params.title | safe }}
|
|
25
|
+
</h2>
|
|
26
|
+
</div>
|
|
27
|
+
</a>
|
|
28
|
+
{% endmacro %}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
+
@use "../../assets/teaser/teaser.scss";
|
|
3
|
+
|
|
4
|
+
.ds-teaser.ds-teaser--right-now {
|
|
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__right-now-sticker {
|
|
14
|
+
color: $ds-theme-color;
|
|
15
|
+
}
|
|
16
|
+
}
|
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.58",
|
|
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",
|