@bonniernews/dn-design-system-web 29.0.1 → 29.1.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 +15 -0
- package/assets/teaser/teaser.scss +0 -14
- package/components/teaser-centered/README.md +0 -2
- package/components/teaser-large/README.md +0 -1
- package/components/teaser-large/teaser-large.njk +0 -12
- package/components/teaser-longlife/README.md +0 -1
- package/components/teaser-longlife/teaser-longlife.njk +0 -6
- package/components/teaser-split/README.md +0 -1
- package/components/teaser-split/teaser-split.njk +0 -6
- package/components/teaser-standard/README.md +0 -1
- package/components/teaser-standard/teaser-standard.njk +0 -15
- package/package.json +1 -1
- package/components/vip-badge/README-UXD.md +0 -0
- package/components/vip-badge/README.md +0 -35
- package/components/vip-badge/vip-badge.njk +0 -18
- package/components/vip-badge/vip-badge.scss +0 -60
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
|
+
## [29.1.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@29.0.1...@bonniernews/dn-design-system-web@29.1.0) (2025-02-20)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **app:** pill design updates ([#1625](https://github.com/BonnierNews/dn-design-system/issues/1625)) ([b8b9bbf](https://github.com/BonnierNews/dn-design-system/commit/b8b9bbfd4c88502b6b8a09a1e8f2c56b5af91cc4))
|
|
13
|
+
* **web:** remove vip badge ([#1624](https://github.com/BonnierNews/dn-design-system/issues/1624)) ([aac7e6d](https://github.com/BonnierNews/dn-design-system/commit/aac7e6d5dbffb764bb04a013de68f96114e43457))
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
### Maintenance
|
|
17
|
+
|
|
18
|
+
* **deps:** bump @storybook/addon-react-native-web from 0.0.26 to 0.0.27 ([#1610](https://github.com/BonnierNews/dn-design-system/issues/1610)) ([48d5745](https://github.com/BonnierNews/dn-design-system/commit/48d5745614d69e8033e5700ac14981eed3eaf358))
|
|
19
|
+
* prerelease packages ([9944780](https://github.com/BonnierNews/dn-design-system/commit/9944780246dedc02db91c00fd4ed8f8d98f7e9c8))
|
|
20
|
+
* prerelease packages ([81cddbc](https://github.com/BonnierNews/dn-design-system/commit/81cddbca67a0298c7b912499852d50b51ae284f7))
|
|
21
|
+
|
|
7
22
|
## [29.0.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@29.0.0...@bonniernews/dn-design-system-web@29.0.1) (2025-02-17)
|
|
8
23
|
|
|
9
24
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
2
|
@use "../../components/icon-sprite/icon-sprite.scss";
|
|
3
|
-
@use "../../components/vip-badge/vip-badge.scss";
|
|
4
3
|
@use "../../components/teaser-image/teaser-image.scss";
|
|
5
4
|
@use "../../components/teaser-dot/teaser-dot.scss";
|
|
6
5
|
@use "../../components/teaser-footer/teaser-footer.scss";
|
|
@@ -82,19 +81,6 @@ $ds-teaser-standard-image-width-desktop: 196px;
|
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
|
|
85
|
-
.ds-vip-badge {
|
|
86
|
-
position: absolute;
|
|
87
|
-
top: 0;
|
|
88
|
-
right: 0;
|
|
89
|
-
z-index: 5;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
&.ds-teaser--quote-badge {
|
|
93
|
-
.ds-teaser__title {
|
|
94
|
-
padding-right: ds-spacing($ds-s-075);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
84
|
&--podcast {
|
|
99
85
|
.ds-teaser__vignette {
|
|
100
86
|
display: flex;
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
|isItalicHeadline | bool | no | true, false | false | If the headline should be italic |
|
|
25
25
|
|isLargeHeadline | bool | no | true, false | false | If the headline should be large. Only has an effect if `isItalicHeadline` is true. |
|
|
26
26
|
|isFlashingDot | bool | no | true, false | false | If there should be a flashing ball before the text |
|
|
27
|
-
|isLocked | bool | no | true, false | false | If the paywall indicator should be shown. It is only shown if the teaser has an image. |
|
|
28
27
|
|publicationTime | string | no | | null | Publication time text. |
|
|
29
28
|
|duration | string | no | | null | Duration of podcast. |
|
|
30
29
|
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
{% from '@bonniernews/dn-design-system-web/components/teaser-card/teaser-card.njk' import TeaserCard %}
|
|
2
|
-
{% from '@bonniernews/dn-design-system-web/components/vip-badge/vip-badge.njk' import VipBadge %}
|
|
3
2
|
{% from '@bonniernews/dn-design-system-web/components/teaser-dot/teaser-dot.njk' import TeaserDot %}
|
|
4
3
|
{% from '@bonniernews/dn-design-system-web/components/teaser-footer/teaser-footer.njk' import TeaserFooter %}
|
|
5
4
|
{% from '@bonniernews/dn-design-system-web/components/icon-sprite/icon-sprite.njk' import IconUse %}
|
|
@@ -8,7 +7,6 @@
|
|
|
8
7
|
{% set componentClassName = "ds-teaser" %}
|
|
9
8
|
{% set classNamePrefix = componentClassName + "--" %}
|
|
10
9
|
|
|
11
|
-
{% set isQuoteBadge = params.isLocked and not params.mediaHtml and not params.bylineHtml and params.isItalicHeadline %}
|
|
12
10
|
{% if params.isItalicHeadline %}
|
|
13
11
|
{% set italicsClass = "ds-teaser--large-big-italic" if params.isLargeHeadline and params.areaType !== "right" else "ds-teaser--large-italic" %}
|
|
14
12
|
{% endif %}
|
|
@@ -16,7 +14,6 @@
|
|
|
16
14
|
{% set extraClasses = [
|
|
17
15
|
"ds-teaser--large",
|
|
18
16
|
classNamePrefix + params.variant if params.variant,
|
|
19
|
-
classNamePrefix + "quote-badge" if isQuoteBadge,
|
|
20
17
|
classNamePrefix + 'hide-top-border' if params.mediaHtml,
|
|
21
18
|
italicsClass if italicsClass,
|
|
22
19
|
params.classNames if params.classNames
|
|
@@ -35,16 +32,7 @@
|
|
|
35
32
|
] | join(" ") %}
|
|
36
33
|
<div class="{{ mediaClass }}">
|
|
37
34
|
{{ params.mediaHtml }}
|
|
38
|
-
{% if params.isLocked %}
|
|
39
|
-
{{ VipBadge({
|
|
40
|
-
showText: true
|
|
41
|
-
}) }}
|
|
42
|
-
{% endif %}
|
|
43
35
|
</div>
|
|
44
|
-
{% elif params.isItalicHeadline and params.isLocked %}
|
|
45
|
-
{{ VipBadge({
|
|
46
|
-
showText: false
|
|
47
|
-
}) }}
|
|
48
36
|
{% endif %}
|
|
49
37
|
|
|
50
38
|
<div class="{{ componentClassName + '__content'}}">
|
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
|targetLink | String | yes | | | Target URL for the teaser |
|
|
15
15
|
|vignette | String | no | | | Top text in the teaser |
|
|
16
16
|
|mediaHtml | HTML String | no | | | Main image or other media |
|
|
17
|
-
|isLocked | bool | no | true, false | false | If the paywall indicator should be shown. It is only shown if the teaser has an image. |
|
|
18
17
|
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
19
18
|
|classNames | String | no | | | Ex. "my-special-class" |
|
|
20
19
|
|~forcePx~ | | | | | Not supported |
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
{% from '@bonniernews/dn-design-system-web/components/teaser-card/teaser-card.njk' import TeaserCard %}
|
|
2
|
-
{% from '@bonniernews/dn-design-system-web/components/vip-badge/vip-badge.njk' import VipBadge %}
|
|
3
2
|
|
|
4
3
|
{% macro TeaserLonglife(params) %}
|
|
5
4
|
{%- set extraClasses = [
|
|
@@ -16,11 +15,6 @@
|
|
|
16
15
|
|
|
17
16
|
{% if params.mediaHtml %}
|
|
18
17
|
{{ params.mediaHtml }}
|
|
19
|
-
{% if params.isLocked %}
|
|
20
|
-
{{ VipBadge({
|
|
21
|
-
showText: false
|
|
22
|
-
}) }}
|
|
23
|
-
{% endif %}
|
|
24
18
|
{% endif %}
|
|
25
19
|
|
|
26
20
|
<div class="ds-teaser__content">
|
|
@@ -21,7 +21,6 @@
|
|
|
21
21
|
|sticker | String | no | | | Red text before the text |
|
|
22
22
|
|mediaHtml | HTML String | no | | | Main image or other media |
|
|
23
23
|
|isFlashingDot | bool | no | true, false | false | If there should be a flashing ball before the text |
|
|
24
|
-
|isLocked | bool | no | true, false | false | If the paywall indicator should be shown. It is only shown if the teaser has an image. |
|
|
25
24
|
|publicationTime | string | no | | null | Publication time text. |
|
|
26
25
|
|duration | string | no | | null | Duration of podcast. |
|
|
27
26
|
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
2
2
|
{% from '@bonniernews/dn-design-system-web/components/teaser-card/teaser-card.njk' import TeaserCard %}
|
|
3
|
-
{% from '@bonniernews/dn-design-system-web/components/vip-badge/vip-badge.njk' import VipBadge %}
|
|
4
3
|
{% from '@bonniernews/dn-design-system-web/components/teaser-dot/teaser-dot.njk' import TeaserDot %}
|
|
5
4
|
{% from '@bonniernews/dn-design-system-web/components/teaser-footer/teaser-footer.njk' import TeaserFooter %}
|
|
6
5
|
{% from '@bonniernews/dn-design-system-web/components/icon-sprite/icon-sprite.njk' import IconUse %}
|
|
@@ -29,11 +28,6 @@
|
|
|
29
28
|
] | join(" ") %}
|
|
30
29
|
<div class="{{ mediaClass }}">
|
|
31
30
|
{{ params.mediaHtml }}
|
|
32
|
-
{% if params.isLocked %}
|
|
33
|
-
{{ VipBadge({
|
|
34
|
-
showText: false
|
|
35
|
-
}) }}
|
|
36
|
-
{% endif %}
|
|
37
31
|
</div>
|
|
38
32
|
{% endif %}
|
|
39
33
|
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
|isItalicHeadline | bool | no | true, false | false | If the headline should be italic |
|
|
24
24
|
|isCompact | bool | no | true, false | false | If the headline should be compact |
|
|
25
25
|
|isFlashingDot | bool | no | true, false | false | If there should be a flashing ball before the text |
|
|
26
|
-
|isLocked | bool | no | true, false | false | If the paywall indicator should be shown. It is only shown if the teaser has an image. |
|
|
27
26
|
|publicationTime | string | no | | null | Publication time text. |
|
|
28
27
|
|duration | string | no | | null | Duration of podcast. |
|
|
29
28
|
|isSquareImage | boolean | no | | false | Flag so we can handle square teaser images |
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
{% from '@bonniernews/dn-design-system-web/components/teaser-card/teaser-card.njk' import TeaserCard %}
|
|
2
|
-
{% from '@bonniernews/dn-design-system-web/components/vip-badge/vip-badge.njk' import VipBadge %}
|
|
3
2
|
{% from '@bonniernews/dn-design-system-web/components/teaser-dot/teaser-dot.njk' import TeaserDot %}
|
|
4
3
|
{% from '@bonniernews/dn-design-system-web/components/teaser-footer/teaser-footer.njk' import TeaserFooter %}
|
|
5
4
|
{% from '@bonniernews/dn-design-system-web/components/icon-sprite/icon-sprite.njk' import IconUse %}
|
|
@@ -8,12 +7,10 @@
|
|
|
8
7
|
{% set componentClassName = "ds-teaser" %}
|
|
9
8
|
{% set classNamePrefix = componentClassName + "--" %}
|
|
10
9
|
|
|
11
|
-
{% set hasQuoteBadge = params.isLocked and not params.mediaHtml and params.isItalicHeadline %}
|
|
12
10
|
{% set extraClasses = [
|
|
13
11
|
"ds-teaser--standard",
|
|
14
12
|
classNamePrefix + params.variant if params.variant,
|
|
15
13
|
classNamePrefix + "compact" if params.isCompact,
|
|
16
|
-
classNamePrefix + "quote-badge" if hasQuoteBadge,
|
|
17
14
|
params.classNames if params.classNames
|
|
18
15
|
] | join(" ") %}
|
|
19
16
|
|
|
@@ -24,13 +21,6 @@
|
|
|
24
21
|
attributes: params.attributes,
|
|
25
22
|
classNames: extraClasses
|
|
26
23
|
}) %}
|
|
27
|
-
|
|
28
|
-
{% if params.isLocked and not params.mediaHtml and params.isItalicHeadline %}
|
|
29
|
-
{{ VipBadge({
|
|
30
|
-
showText: false
|
|
31
|
-
}) }}
|
|
32
|
-
{% endif %}
|
|
33
|
-
|
|
34
24
|
<div class="{{ componentClassName + '__content'}}">
|
|
35
25
|
{% if params.mediaHtml %}
|
|
36
26
|
{% set mediaClass = [
|
|
@@ -40,11 +30,6 @@
|
|
|
40
30
|
] | join(" ") %}
|
|
41
31
|
<div class="{{ mediaClass }}">
|
|
42
32
|
{{ params.mediaHtml }}
|
|
43
|
-
{% if params.isLocked %}
|
|
44
|
-
{{ VipBadge({
|
|
45
|
-
showText: false
|
|
46
|
-
}) }}
|
|
47
|
-
{% endif %}
|
|
48
33
|
</div>
|
|
49
34
|
{% endif %}
|
|
50
35
|
|
package/package.json
CHANGED
|
File without changes
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
- GitHub: [BonnierNews/dn-design-system/../web/src/components/vip-badge](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/vip-badge)
|
|
2
|
-
- Storybook: [Subcomponents > Vip Badge](https://designsystem.dn.se/?path=/docs/section-subcomponents-vipbadge--docs)
|
|
3
|
-
- Storybook (Latest): [Subcomponents > Vip Badge](https://designsystem-latest.dn.se/?path=/docs/section-subcomponents-vipbadge--docs)
|
|
4
|
-
|
|
5
|
-
----
|
|
6
|
-
|
|
7
|
-
# VipBadge
|
|
8
|
-
|
|
9
|
-
## Parameters
|
|
10
|
-
|
|
11
|
-
|parameter | type | required | options | default | description |
|
|
12
|
-
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
-
|showText | bool | no | | false | By default only icon is shown |
|
|
14
|
-
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
15
|
-
|classNames | String | no | | | Ex. "my-special-class" |
|
|
16
|
-
|forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size |
|
|
17
|
-
|
|
18
|
-
## Minimum requirement example
|
|
19
|
-
|
|
20
|
-
### Nunjucks
|
|
21
|
-
|
|
22
|
-
These are copy paste friendly examples to quickliy get started using a component.
|
|
23
|
-
|
|
24
|
-
```html
|
|
25
|
-
{% from '@bonniernews/dn-design-system-web/components/vip-badge/vip-badge.njk' import VipBadge %}
|
|
26
|
-
|
|
27
|
-
{{ VipBadge({
|
|
28
|
-
showText: true
|
|
29
|
-
})}}
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### SCSS
|
|
33
|
-
```scss
|
|
34
|
-
@use "@bonniernews/dn-design-system-web/components/vip-badge/vip-badge" as *;
|
|
35
|
-
```
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{% from '@bonniernews/dn-design-system-web/components/icon-sprite/icon-sprite.njk' import IconUse %}
|
|
2
|
-
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
3
|
-
|
|
4
|
-
{% macro VipBadge(params) %}
|
|
5
|
-
{%- set componentClassName = "ds-vip-badge" %}
|
|
6
|
-
{%- set classNamePrefix = componentClassName + "--" %}
|
|
7
|
-
{%- set classes = [
|
|
8
|
-
componentClassName,
|
|
9
|
-
classNamePrefix + "text" if params.showText,
|
|
10
|
-
"ds-force-px" if params.forcePx,
|
|
11
|
-
params.classNames if params.classNames
|
|
12
|
-
] | join(" ") %}
|
|
13
|
-
{%- set attributes = getAttributes(params.attributes) %}
|
|
14
|
-
<div class="{{ classes }}" {{- attributes | safe }} aria-hidden="true">
|
|
15
|
-
{{ IconUse({ icon: 'vip' | safe }) }}
|
|
16
|
-
{{ "För dig som prenumererar" if params.showText else "" }}
|
|
17
|
-
</div>
|
|
18
|
-
{% endmacro %}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
-
@use "../icon-sprite/icon-sprite.scss";
|
|
3
|
-
|
|
4
|
-
$ds-vip-badge__icon-size: 16px;
|
|
5
|
-
|
|
6
|
-
.ds-vip-badge {
|
|
7
|
-
display: none;
|
|
8
|
-
align-items: center;
|
|
9
|
-
box-sizing: content-box;
|
|
10
|
-
border-radius: ds-px-to-rem(ds-border-radius(012)) 0 ds-px-to-rem(ds-border-radius(012))
|
|
11
|
-
ds-px-to-rem(ds-border-radius(012));
|
|
12
|
-
background-color: $ds-color-business;
|
|
13
|
-
color: $ds-color-neutral-white;
|
|
14
|
-
fill: $ds-color-neutral-white;
|
|
15
|
-
padding: ds-spacing($ds-s-025, rem);
|
|
16
|
-
@include ds-typography(
|
|
17
|
-
$ds-typography-functional-meta-sm,
|
|
18
|
-
$lineHeight: $ds-lineheight-lg,
|
|
19
|
-
$letterSpacing: $ds-letterspacing-none
|
|
20
|
-
);
|
|
21
|
-
|
|
22
|
-
@at-root .ds-force-px#{&} {
|
|
23
|
-
border-radius: ds-border-radius(012) 0 ds-border-radius(012) ds-border-radius(012);
|
|
24
|
-
padding: ds-spacing($ds-s-025);
|
|
25
|
-
@include ds-typography(
|
|
26
|
-
$ds-typography-functional-meta-sm,
|
|
27
|
-
$forcePx: true,
|
|
28
|
-
$lineHeight: $ds-lineheight-lg,
|
|
29
|
-
$letterSpacing: $ds-letterspacing-none
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
// bang class indicating that the user has premium access
|
|
34
|
-
.dn-premium & {
|
|
35
|
-
display: inline-flex;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
.ds-icon {
|
|
39
|
-
height: ds-px-to-rem($ds-vip-badge__icon-size);
|
|
40
|
-
width: ds-px-to-rem($ds-vip-badge__icon-size);
|
|
41
|
-
@at-root .ds-force-px#{&} {
|
|
42
|
-
height: $ds-vip-badge__icon-size;
|
|
43
|
-
width: $ds-vip-badge__icon-size;
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
.ds-vip-badge--text {
|
|
49
|
-
padding: ds-spacing($ds-s-025 $ds-s-050, rem);
|
|
50
|
-
@at-root .ds-force-px#{&} {
|
|
51
|
-
padding: ds-spacing($ds-s-025 $ds-s-050);
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
.ds-icon {
|
|
55
|
-
margin-right: ds-spacing($ds-s-025, rem);
|
|
56
|
-
@at-root .ds-force-px#{&} {
|
|
57
|
-
margin-right: ds-spacing($ds-s-025);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|