@bonniernews/dn-design-system-web 3.0.0-alpha.50 → 3.0.0-alpha.52
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 +17 -0
- package/assets/teaser/teaser.scss +6 -1
- package/components/teaser-dot/README.md +34 -0
- package/components/teaser-dot/teaser-dot.njk +24 -0
- package/components/teaser-dot/teaser-dot.scss +39 -0
- package/components/teaser-large/teaser-large.njk +4 -5
- package/components/teaser-split/teaser-split.njk +3 -4
- package/components/teaser-standard/teaser-standard.njk +4 -5
- package/foundations/variables/colorsCssVariables.scss +1 -0
- package/foundations/variables/colorsDnDarkTokens.scss +1 -0
- package/foundations/variables/colorsDnLightTokens.scss +1 -0
- package/package.json +1 -1
- package/tokens/colors-css-variables.json +1 -0
- package/assets/teaser/sticker.scss +0 -31
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,23 @@
|
|
|
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.52](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@3.0.0-alpha.51...@bonniernews/dn-design-system-web@3.0.0-alpha.52) (2023-05-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **web:** implement the flashing dot as a component, and use the component in teasers ([#799](https://github.com/BonnierNews/dn-design-system/issues/799)) ([634186b](https://github.com/BonnierNews/dn-design-system/commit/634186b726d43521c8e85d697af6a665256f8a63))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## [3.0.0-alpha.51](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@3.0.0-alpha.50...@bonniernews/dn-design-system-web@3.0.0-alpha.51) (2023-05-09)
|
|
16
|
+
|
|
17
|
+
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
6
23
|
## [3.0.0-alpha.50](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@3.0.0-alpha.49...@bonniernews/dn-design-system-web@3.0.0-alpha.50) (2023-05-09)
|
|
7
24
|
|
|
8
25
|
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
@use "../../foundations/icons/icon.scss";
|
|
3
3
|
@use "../../components/vip-badge/vip-badge.scss";
|
|
4
4
|
@use "../../components/teaser-image/teaser-image.scss";
|
|
5
|
-
@use "./sticker.scss";
|
|
6
5
|
|
|
7
6
|
.ds-teaser {
|
|
8
7
|
display: block;
|
|
@@ -39,6 +38,12 @@
|
|
|
39
38
|
margin: ds-spacing-component($ds-sc-x2 0 0);
|
|
40
39
|
}
|
|
41
40
|
|
|
41
|
+
.ds-teaser__sticker {
|
|
42
|
+
display: inline;
|
|
43
|
+
color: $ds-theme-color;
|
|
44
|
+
@include ds-typography($ds-typography-detailarticle-label);
|
|
45
|
+
}
|
|
46
|
+
|
|
42
47
|
.ds-teaser__media {
|
|
43
48
|
width: 100%;
|
|
44
49
|
position: relative;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-dot](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-dot)
|
|
2
|
+
- Storybook: [TeaserDot > Web](https://designsystem.dn.se/?path=/story/components-app-web-teaser-dot-web)
|
|
3
|
+
|
|
4
|
+
----
|
|
5
|
+
|
|
6
|
+
# TeaserDot
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
|parameter | type | required | options | default | description |
|
|
11
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
12
|
+
|flashing | boolean | no | true, false | false | If the dot should be flashing |
|
|
13
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
14
|
+
|forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size |
|
|
15
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
16
|
+
|
|
17
|
+
## Minimum requirement example
|
|
18
|
+
|
|
19
|
+
### Nunjucks
|
|
20
|
+
|
|
21
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-dot/teaser-dot.njk' import TeaserDot %}
|
|
25
|
+
|
|
26
|
+
{{ TeaserDot({
|
|
27
|
+
flashing: false
|
|
28
|
+
})}}
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
### SCSS
|
|
32
|
+
```scss
|
|
33
|
+
@use "@bonniernews/dn-design-system-web/components/teaser-dot/teaser-dot";
|
|
34
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
2
|
+
|
|
3
|
+
{% macro TeaserDot(params) %}
|
|
4
|
+
{% set componentClassName = "ds-teaser-dot" %}
|
|
5
|
+
{% set classNamePrefix = componentClassName + "--" %}
|
|
6
|
+
{% set variant = [] %}
|
|
7
|
+
{% set attributes = getAttributes(params.attributes) %}
|
|
8
|
+
|
|
9
|
+
{% if params.classNames %}
|
|
10
|
+
{% set variant = (variant.push(params.classNames), variant) %}
|
|
11
|
+
{% endif%}
|
|
12
|
+
|
|
13
|
+
{% if params.forcePx %}
|
|
14
|
+
{% set variant = (variant.push("ds-force-px"), variant) %}
|
|
15
|
+
{% endif %}
|
|
16
|
+
|
|
17
|
+
{% if params.flashing %}
|
|
18
|
+
{% set variant = (variant.push(classNamePrefix + "flashing"), variant) %}
|
|
19
|
+
{% endif %}
|
|
20
|
+
|
|
21
|
+
{% set classes = componentClassName + " " + variant | join(" ") %}
|
|
22
|
+
|
|
23
|
+
<span class="{{ classes }}" {{ attributes | safe }}></span>
|
|
24
|
+
{% endmacro %}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
+
|
|
3
|
+
$ds-teaser-dot-size: 10px;
|
|
4
|
+
|
|
5
|
+
.ds-teaser-dot {
|
|
6
|
+
display: inline-flex;
|
|
7
|
+
box-sizing: border-box;
|
|
8
|
+
background-color: $ds-theme-color;
|
|
9
|
+
border-radius: 50%;
|
|
10
|
+
height: ds-px-to-rem($ds-teaser-dot-size);
|
|
11
|
+
width: ds-px-to-rem($ds-teaser-dot-size);
|
|
12
|
+
margin-right: ds-px-to-rem(1px);
|
|
13
|
+
|
|
14
|
+
@at-root .ds-force-px#{&} {
|
|
15
|
+
height: $ds-teaser-dot-size;
|
|
16
|
+
width: $ds-teaser-dot-size;
|
|
17
|
+
margin-right: 1px;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
@media (prefers-reduced-motion: no-preference) {
|
|
21
|
+
&.ds-teaser-dot--flashing {
|
|
22
|
+
animation: pulse 1.25s ease-in-out infinite;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
@keyframes pulse {
|
|
28
|
+
0% {
|
|
29
|
+
opacity: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
50% {
|
|
33
|
+
opacity: 1;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
100% {
|
|
37
|
+
opacity: 0;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
2
2
|
{% from '@bonniernews/dn-design-system-web/components/vip-badge/vip-badge.njk' import VipBadge %}
|
|
3
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-dot/teaser-dot.njk' import TeaserDot %}
|
|
3
4
|
|
|
4
5
|
{% macro TeaserLarge(params) %}
|
|
5
6
|
{% set componentClassName = "ds-teaser" %}
|
|
@@ -73,12 +74,10 @@
|
|
|
73
74
|
</h2>
|
|
74
75
|
|
|
75
76
|
{% if params.text and params.areaType !== "right" %}
|
|
76
|
-
<p class="{{ componentClassName + '__text'}}">
|
|
77
|
-
{
|
|
78
|
-
<span class="ds-sticker__flashing-dot"></span>
|
|
79
|
-
{% endif %}
|
|
77
|
+
<p class="{{ componentClassName + '__text' }}">
|
|
78
|
+
{{ TeaserDot({ flashing: params.isFlashingDot }) }}
|
|
80
79
|
{% if params.sticker %}
|
|
81
|
-
<span class="ds-
|
|
80
|
+
<span class="ds-teaser__sticker">
|
|
82
81
|
{{ params.sticker }}
|
|
83
82
|
</span>
|
|
84
83
|
{% endif %}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
2
2
|
{% from '@bonniernews/dn-design-system-web/components/vip-badge/vip-badge.njk' import VipBadge %}
|
|
3
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-dot/teaser-dot.njk' import TeaserDot %}
|
|
3
4
|
|
|
4
5
|
{% macro TeaserSplit(params) %}
|
|
5
6
|
{% set componentClassName = "ds-teaser" %}
|
|
@@ -56,11 +57,9 @@
|
|
|
56
57
|
|
|
57
58
|
{% if params.text %}
|
|
58
59
|
<p class="{{ componentClassName + '__text'}}">
|
|
59
|
-
{
|
|
60
|
-
<span class="ds-sticker__flashing-dot"></span>
|
|
61
|
-
{% endif %}
|
|
60
|
+
{{ TeaserDot({ flashing: params.isFlashingDot }) }}
|
|
62
61
|
{% if params.sticker %}
|
|
63
|
-
<span class="ds-
|
|
62
|
+
<span class="ds-teaser__sticker">
|
|
64
63
|
{{ params.sticker }}
|
|
65
64
|
</span>
|
|
66
65
|
{% endif %}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
2
2
|
{% from '@bonniernews/dn-design-system-web/components/vip-badge/vip-badge.njk' import VipBadge %}
|
|
3
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-dot/teaser-dot.njk' import TeaserDot %}
|
|
3
4
|
|
|
4
5
|
{% macro TeaserStandard(params) %}
|
|
5
6
|
{% set componentClassName = "ds-teaser" %}
|
|
@@ -54,12 +55,10 @@
|
|
|
54
55
|
</h2>
|
|
55
56
|
|
|
56
57
|
{% if params.text and params.areaType !== "right" %}
|
|
57
|
-
<p class="{{ componentClassName + '__text'}}">
|
|
58
|
-
{
|
|
59
|
-
<span class="ds-sticker__flashing-dot"></span>
|
|
60
|
-
{% endif %}
|
|
58
|
+
<p class="{{ componentClassName + '__text' }}">
|
|
59
|
+
{{ TeaserDot({ flashing: params.isFlashingDot }) }}
|
|
61
60
|
{% if params.sticker %}
|
|
62
|
-
<span class="ds-
|
|
61
|
+
<span class="ds-teaser__sticker">
|
|
63
62
|
{{ params.sticker }}
|
|
64
63
|
</span>
|
|
65
64
|
{% endif %}
|
|
@@ -65,6 +65,7 @@ $ds-color-static-sthlm: var(--ds-color-static-sthlm);
|
|
|
65
65
|
$ds-color-static-ad-yellow: var(--ds-color-static-ad-yellow);
|
|
66
66
|
$ds-color-static-neutral-100: var(--ds-color-static-neutral-100);
|
|
67
67
|
$ds-color-static-neutral-500: var(--ds-color-static-neutral-500);
|
|
68
|
+
$ds-color-static-red-500: var(--ds-color-static-red-500);
|
|
68
69
|
$ds-color-gradient-content-fade-left: var(--ds-color-gradient-content-fade-left);
|
|
69
70
|
$ds-color-gradient-content-fade-right: var(--ds-color-gradient-content-fade-right);
|
|
70
71
|
$ds-color-gradient-content-fade-up: var(--ds-color-gradient-content-fade-up);
|
|
@@ -65,6 +65,7 @@ $ds-hex-static-sthlm: #FF589B;
|
|
|
65
65
|
$ds-hex-static-ad-yellow: #FFEAC2;
|
|
66
66
|
$ds-hex-static-neutral-100: #EDEDED;
|
|
67
67
|
$ds-hex-static-neutral-500: #9E9E9E;
|
|
68
|
+
$ds-hex-static-red-500: #DA000D;
|
|
68
69
|
$ds-hex-gradient-content-fade-left: linear-gradient(90deg, #ffffff00 0%, #ffffff 100%);
|
|
69
70
|
$ds-hex-gradient-content-fade-right: linear-gradient(-90deg, #ffffff00 0%, #ffffff 100%);
|
|
70
71
|
$ds-hex-gradient-content-fade-up: linear-gradient(180deg, #ffffff00 0%, #ffffff 100%);
|
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.52",
|
|
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",
|
|
@@ -66,6 +66,7 @@
|
|
|
66
66
|
"static-ad-yellow": "var(--ds-color-static-ad-yellow)",
|
|
67
67
|
"static-neutral-100": "var(--ds-color-static-neutral-100)",
|
|
68
68
|
"static-neutral-500": "var(--ds-color-static-neutral-500)",
|
|
69
|
+
"static-red-500": "var(--ds-color-static-red-500)",
|
|
69
70
|
"gradient-content-fade-left": "var(--ds-color-gradient-content-fade-left)",
|
|
70
71
|
"gradient-content-fade-right": "var(--ds-color-gradient-content-fade-right)",
|
|
71
72
|
"gradient-content-fade-up": "var(--ds-color-gradient-content-fade-up)",
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
-
|
|
3
|
-
.ds-sticker {
|
|
4
|
-
display: inline;
|
|
5
|
-
color: $ds-theme-color;
|
|
6
|
-
@include ds-typography($ds-typography-detailarticle-label);
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
.ds-sticker__flashing-dot {
|
|
10
|
-
border-radius: 50%;
|
|
11
|
-
background-color: $ds-theme-color;
|
|
12
|
-
display: inline-block;
|
|
13
|
-
width: ds-px-to-rem(10px);
|
|
14
|
-
height: ds-px-to-rem(10px);
|
|
15
|
-
margin-right: ds-px-to-rem(1px);
|
|
16
|
-
animation: pulse 1.25s ease-in-out infinite;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
@keyframes pulse {
|
|
20
|
-
0% {
|
|
21
|
-
opacity: 0;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
50% {
|
|
25
|
-
opacity: 1;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
100% {
|
|
29
|
-
opacity: 0;
|
|
30
|
-
}
|
|
31
|
-
}
|