@bonniernews/dn-design-system-web 8.4.6 → 8.6.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 +18 -0
- package/components/game-header/README.md +39 -0
- package/components/game-header/game-header.njk +33 -0
- package/components/game-header/game-header.scss +51 -0
- package/components/teaser-standard/teaser-standard.njk +1 -0
- package/components/teaser-standard/teaser-standard.scss +10 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,24 @@
|
|
|
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
|
+
## 8.6.0 (2023-11-22)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **web:** add quiz header component ([#1102](https://github.com/BonnierNews/dn-design-system/issues/1102)) ([4f8b2f2](https://github.com/BonnierNews/dn-design-system/commit/4f8b2f2e1d9c7987ed0291645d5c4595d2332007))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 8.5.0 (2023-11-22)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Features
|
|
19
|
+
|
|
20
|
+
* **web:** implement compact version of standard teaser ([#1100](https://github.com/BonnierNews/dn-design-system/issues/1100)) ([8c66b69](https://github.com/BonnierNews/dn-design-system/commit/8c66b695c7f2fac54bfdd819a62fc8014b30ce83))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## 8.4.6 (2023-11-21)
|
|
7
25
|
|
|
8
26
|
**Note:** Version bump only for package @bonniernews/dn-design-system-web
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/game-header](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/game-header)
|
|
2
|
+
- Storybook: [GameHeader](https://designsystem.dn.se/?path=/docs/section-Gameheader--docs)
|
|
3
|
+
- Storybook (Latest): [GameHeader](https://designsystem-latest.dn.se/?path=/docs/section-Gameheader--docs)
|
|
4
|
+
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
# Game header
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
|parameter | type | required | options | default | description |
|
|
12
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
+
|title | String | yes | | | Text displayed on the header |
|
|
14
|
+
|media | String | no | | | URL to icon displayed on the header |
|
|
15
|
+
|descriptionHtml | String | no | | | Intended use is text, links and inlined icons |
|
|
16
|
+
|backgroundColor | String | no | | | Hex code or supported color name |
|
|
17
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
18
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
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/game-header/game-header.njk' import GameHeader %}
|
|
28
|
+
|
|
29
|
+
{{ GameHeader(
|
|
30
|
+
{
|
|
31
|
+
title: "Quiz"
|
|
32
|
+
}
|
|
33
|
+
)}}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### SCSS
|
|
37
|
+
```scss
|
|
38
|
+
@use "@bonniernews/dn-design-system-web/components/game-header/game-header" as *;
|
|
39
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
2
|
+
|
|
3
|
+
{% macro GameHeader(params) %}
|
|
4
|
+
{%- set componentClassName = "ds-game-header" %}
|
|
5
|
+
{% set attributes = getAttributes(params.attributes) %}
|
|
6
|
+
|
|
7
|
+
{%- set classes = [
|
|
8
|
+
componentClassName,
|
|
9
|
+
params.classNames if params.classNames
|
|
10
|
+
] | join(" ") %}
|
|
11
|
+
|
|
12
|
+
<div class="{{ classes }}" {{- attributes | safe }}>
|
|
13
|
+
<div class="{{ componentClassName }}__top ds-light" style="backgroundColor: {{params.backgroundColor}}">
|
|
14
|
+
<div class="{{ componentClassName }}__top-content">
|
|
15
|
+
<h2 class="{{ componentClassName }}__title">{{ params.title}}</h2>
|
|
16
|
+
|
|
17
|
+
{% if params.media %}
|
|
18
|
+
<div class="{{ componentClassName + '__media'}}">
|
|
19
|
+
{{ params.media | safe }}
|
|
20
|
+
</div>
|
|
21
|
+
{% endif %}
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
{% if params.descriptionHtml %}
|
|
26
|
+
<div class="{{ componentClassName }}__description">
|
|
27
|
+
<div class="{{ componentClassName }}__description-content">
|
|
28
|
+
{{ params.descriptionHtml | safe }}
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
|
+
{% endif %}
|
|
32
|
+
</div>
|
|
33
|
+
{% endmacro %}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
+
@use "../../assets/teaser/teaser.scss" as *;
|
|
3
|
+
|
|
4
|
+
.ds-game-header {
|
|
5
|
+
width: 100%;
|
|
6
|
+
|
|
7
|
+
.ds-game-header__top {
|
|
8
|
+
background-color: $ds-color-surface-background;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
.ds-game-header__top-content {
|
|
12
|
+
display: flex;
|
|
13
|
+
align-items: baseline;
|
|
14
|
+
justify-content: space-between;
|
|
15
|
+
padding: ds-spacing($ds-s-100);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ds-game-header__top-content,
|
|
19
|
+
.ds-game-header__description-content {
|
|
20
|
+
max-width: var(--ds-game-header-content-width, 100%);
|
|
21
|
+
margin: 0 auto;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
.ds-game-header__title {
|
|
25
|
+
@include ds-typography($ds-typography-functional-heading03bold);
|
|
26
|
+
color: $ds-color-text-primary;
|
|
27
|
+
margin: 0;
|
|
28
|
+
}
|
|
29
|
+
.ds-game-header__media {
|
|
30
|
+
margin-right: ds-spacing($ds-s-100);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.ds-game-header__description {
|
|
34
|
+
background-color: $ds-color-surface-background;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.ds-game-header__description-content {
|
|
38
|
+
@include ds-typography($ds-typography-functional-body02regular);
|
|
39
|
+
padding: ds-spacing($ds-s-025 $ds-s-100);
|
|
40
|
+
color: $ds-color-text-primary;
|
|
41
|
+
|
|
42
|
+
a {
|
|
43
|
+
@include ds-link($ds-link-article-body);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
b,
|
|
47
|
+
strong {
|
|
48
|
+
@include ds-typography($ds-typography-functional-body02semibold);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
{% set extraClasses = [
|
|
12
12
|
"ds-teaser--standard",
|
|
13
13
|
classNamePrefix + params.variant if params.variant,
|
|
14
|
+
classNamePrefix + "compact" if params.compact,
|
|
14
15
|
classNamePrefix + "quote-badge" if hasQuoteBadge,
|
|
15
16
|
params.classNames if params.classNames
|
|
16
17
|
] | join(" ") %}
|
|
@@ -14,6 +14,16 @@
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
+
&.ds-teaser--compact {
|
|
18
|
+
.ds-teaser__title {
|
|
19
|
+
@include ds-typography($ds-typography-detailteaser-standard-compact);
|
|
20
|
+
|
|
21
|
+
&--italic {
|
|
22
|
+
@include ds-typography($ds-typography-detailteaser-standard-compact-opinion);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
17
27
|
.ds-teaser__media,
|
|
18
28
|
.ds-teaser__content {
|
|
19
29
|
margin-bottom: ds-spacing($ds-s-teaser-vertical-medium);
|
package/package.json
CHANGED