@bonniernews/dn-design-system-web 3.0.0-alpha.9 → 3.0.0-alpha.90
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 +720 -0
- package/assets/article-image/article-image.njk +11 -10
- package/assets/article-image/article-image.scss +1 -15
- package/assets/form-field/form-field.njk +2 -2
- package/assets/form-field/form-field.scss +2 -6
- package/assets/teaser/dot-or-grade.njk +7 -0
- package/assets/teaser/teaser.scss +96 -0
- package/components/article-body-image/README.md +2 -2
- package/components/article-body-image/article-body-image.njk +1 -5
- package/components/article-top-image/README.md +2 -2
- package/components/article-top-image/article-top-image.njk +1 -5
- package/components/article-top-image/article-top-image.scss +1 -1
- package/components/badge/badge.scss +1 -5
- package/components/buddy-menu/buddy-menu.scss +1 -8
- package/components/button/button.njk +38 -43
- package/components/button/button.scss +6 -1
- package/components/button-toggle/button-toggle.js +2 -0
- package/components/button-toggle/button-toggle.njk +36 -36
- package/components/button-toggle/button-toggle.scss +6 -1
- package/components/byline/byline.njk +2 -2
- package/components/byline/byline.scss +1 -3
- package/components/checkbox/checkbox.njk +3 -3
- package/components/checkbox/checkbox.scss +8 -9
- package/components/disclaimer/disclaimer.njk +2 -2
- package/components/disclaimer/disclaimer.scss +23 -10
- package/components/factbox/README.md +2 -2
- package/components/factbox/factbox.njk +12 -24
- package/components/factbox/factbox.scss +16 -51
- package/components/footer/footer.scss +2 -8
- package/components/icon-button/README.md +2 -1
- package/components/icon-button/icon-button.njk +4 -4
- package/components/icon-button/icon-button.scss +5 -2
- package/components/icon-button-toggle/icon-button-toggle.js +2 -0
- package/components/icon-button-toggle/icon-button-toggle.njk +28 -36
- package/components/icon-button-toggle/icon-button-toggle.scss +5 -2
- package/components/icon-sprite/README.md +51 -0
- package/components/icon-sprite/icon-sprite.njk +12 -0
- package/components/icon-sprite/icon-sprite.scss +12 -0
- package/components/icon-with-wrapper/README.md +9 -2
- package/components/icon-with-wrapper/icon-with-wrapper.njk +2 -2
- package/components/icon-with-wrapper/icon-with-wrapper.scss +2 -1
- package/components/image-caption/README.md +38 -0
- package/components/image-caption/image-caption.njk +36 -0
- package/components/image-caption/image-caption.scss +25 -0
- package/components/list-item/list-item.njk +5 -5
- package/components/list-item/list-item.scss +1 -3
- package/components/pictogram/README.md +39 -0
- package/components/pictogram/pictogram.njk +30 -0
- package/components/pictogram/pictogram.scss +54 -0
- package/components/quote/README.md +1 -2
- package/components/quote/quote.njk +6 -8
- package/components/quote/quote.scss +1 -14
- package/components/radio-button/radio-button.njk +3 -3
- package/components/radio-button/radio-button.scss +8 -10
- package/components/spinner/spinner.njk +19 -23
- package/components/spinner/spinner.scss +4 -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-image/README.md +40 -0
- package/components/teaser-image/teaser-image.njk +21 -0
- package/components/teaser-image/teaser-image.scss +21 -0
- package/components/teaser-large/README.md +52 -0
- package/components/teaser-large/teaser-large.njk +96 -0
- package/components/teaser-large/teaser-large.scss +139 -0
- package/components/teaser-onsite/README.md +45 -0
- package/components/teaser-onsite/teaser-onsite.njk +45 -0
- package/components/teaser-onsite/teaser-onsite.scss +33 -0
- package/components/teaser-package/README.md +42 -0
- package/components/teaser-package/teaser-package.njk +39 -0
- package/components/teaser-package/teaser-package.scss +114 -0
- package/components/teaser-right-now/README.md +37 -0
- package/components/teaser-right-now/teaser-right-now.njk +29 -0
- package/components/teaser-right-now/teaser-right-now.scss +57 -0
- package/components/teaser-slideshow/README.md +42 -0
- package/components/teaser-slideshow/teaser-slideshow.njk +38 -0
- package/components/teaser-slideshow/teaser-slideshow.scss +37 -0
- package/components/teaser-split/README-container.md +40 -0
- package/components/teaser-split/README.md +49 -0
- package/components/teaser-split/teaser-split.njk +93 -0
- package/components/teaser-split/teaser-split.scss +85 -0
- package/components/teaser-standard/README.md +50 -0
- package/components/teaser-standard/teaser-standard.njk +81 -0
- package/components/teaser-standard/teaser-standard.scss +38 -0
- package/components/teaser-tipsa/README.md +41 -0
- package/components/teaser-tipsa/teaser-tipsa.njk +31 -0
- package/components/teaser-tipsa/teaser-tipsa.scss +22 -0
- package/components/text-button/text-button.njk +34 -37
- package/components/text-button/text-button.scss +12 -10
- package/components/text-button-toggle/text-button-toggle.js +2 -0
- package/components/text-button-toggle/text-button-toggle.njk +30 -33
- package/components/text-button-toggle/text-button-toggle.scss +10 -10
- package/components/text-input/text-input.scss +3 -8
- package/components/video-caption/README.md +1 -1
- package/components/video-caption/video-caption.njk +12 -6
- package/components/vip-badge/README.md +35 -0
- package/components/vip-badge/vip-badge.njk +23 -0
- package/components/vip-badge/vip-badge.scss +54 -0
- package/foundations/colors.scss +31 -0
- package/foundations/helpers/README-links.md +1 -1
- package/foundations/helpers/colors.scss +2 -0
- package/foundations/helpers/hover.scss +14 -0
- package/foundations/helpers/links.scss +15 -7
- package/foundations/helpers/typography.scss +22 -2
- package/foundations/icons/grade-icon.njk +50 -11
- package/foundations/icons/icon.njk +172 -143
- package/foundations/icons/sprite.njk +1 -0
- package/foundations/icons/sprite.svg +1 -0
- package/foundations/icons/svg/download.svg +3 -0
- package/foundations/icons/svg/filter_list.svg +3 -0
- package/foundations/icons/svg/pause.svg +3 -0
- package/foundations/icons/svg/system_update.svg +3 -0
- package/foundations/icons/svg/vip.svg +3 -0
- package/foundations/typography/fontDefinitions.scss +82 -67
- package/foundations/variables/colorsCssVariables.scss +6 -0
- package/foundations/variables/colorsDnDarkTokens.scss +7 -1
- package/foundations/variables/colorsDnLightTokens.scss +8 -2
- package/foundations/variables/spacingLayout.scss +6 -1
- package/foundations/variables/spacingLayoutLargeScreen.scss +5 -0
- package/foundations/variables/spacingLayoutList.scss +5 -0
- package/foundations/variables/typographyTokensList.scss +5 -0
- package/foundations/variables/typographyTokensScreenExtraLarge.scss +571 -0
- package/foundations/variables/typographyTokensScreenLarge.scss +133 -100
- package/foundations/variables/typographyTokensScreenSmall.scss +147 -114
- package/package.json +2 -2
- package/tokens/colors-css-variables.json +6 -0
- package/tokens/spacing-layout-list.json +6 -1
- package/foundations/icons/icon-sprite.svg +0 -2
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/image-caption](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/image-caption)
|
|
2
|
+
- Storybook: [ImageCaption > Web](https://designsystem.dn.se/?path=/story/components-app-web-article-components-image-imagecaption-web--image-caption)
|
|
3
|
+
|
|
4
|
+
----
|
|
5
|
+
|
|
6
|
+
# ImageCaption
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
|parameter | type | required | options | default | description |
|
|
11
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
12
|
+
|caption | String | no | | | Ex "Detta är en bildtext" |
|
|
13
|
+
|imageType | String | no | | | Type of image. Ex "Foto" |
|
|
14
|
+
|author | String | no | | | Ex "Paul Hansen" |
|
|
15
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
16
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
17
|
+
|forcePx | Bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size
|
|
18
|
+
|
|
19
|
+
## Minimum requirement example
|
|
20
|
+
|
|
21
|
+
### Nunjucks
|
|
22
|
+
|
|
23
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
{% from '@bonniernews/dn-design-system-web/components/image-caption/image-caption.njk' import ImageCaption %}
|
|
27
|
+
|
|
28
|
+
{{ ImageCaption({
|
|
29
|
+
caption: "En bildtext",
|
|
30
|
+
imageType: "Foto",
|
|
31
|
+
author: "Paul Hansen"
|
|
32
|
+
})}}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### SCSS
|
|
36
|
+
```scss
|
|
37
|
+
@use "@bonniernews/dn-design-system-web/components/image-caption/image-caption";
|
|
38
|
+
```
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{% macro ImageCaption(params) %}
|
|
2
|
+
{% set macroClassName = "ds-image-caption" %}
|
|
3
|
+
{% set additionalClasses = [] %}
|
|
4
|
+
|
|
5
|
+
{% if params.classNames %}
|
|
6
|
+
{% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
|
|
7
|
+
{% endif %}
|
|
8
|
+
|
|
9
|
+
{% if params.forcePx %}
|
|
10
|
+
{% set additionalClasses = (additionalClasses.push("ds-force-px"), additionalClasses) %}
|
|
11
|
+
{% endif %}
|
|
12
|
+
|
|
13
|
+
{% set classes = macroClassName + " " + additionalClasses | join(" ") %}
|
|
14
|
+
|
|
15
|
+
<figcaption class="{{ classes }}" {{- params.attributes | safe }}>
|
|
16
|
+
{% if params.caption %}
|
|
17
|
+
<span aria-hidden="true">{{ params.caption | safe }}</span>
|
|
18
|
+
{% endif %}
|
|
19
|
+
{% if params.author %}
|
|
20
|
+
{% set authorText = ((params.imageType | capitalize) + ": " + params.author) if params.imageType else params.author %}
|
|
21
|
+
|
|
22
|
+
{% set authorClasses = [ "ds-article-image__credits" ] %}
|
|
23
|
+
{# Low estimate of how much will fit on tablet/desktop #}
|
|
24
|
+
{% if (authorText | length) >= 27 and (authorText | length) < 60 %}
|
|
25
|
+
{% set authorClasses = (authorClasses.push("ds-article-image__credits--nowrap-bigscreen"), authorClasses) %}
|
|
26
|
+
{# Low estimate of how much will fit on iphone4 #}
|
|
27
|
+
{% elif (authorText | length) < 27 %}
|
|
28
|
+
{% set authorClasses = (authorClasses.push("ds-article-image__credits--nowrap"), authorClasses) %}
|
|
29
|
+
{% endif %}
|
|
30
|
+
|
|
31
|
+
<span class="{{ authorClasses | join(" ") }}">
|
|
32
|
+
{{- authorText -}}
|
|
33
|
+
</span>
|
|
34
|
+
{% endif %}
|
|
35
|
+
</figcaption>
|
|
36
|
+
{% endmacro %}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
+
|
|
3
|
+
.ds-image-caption {
|
|
4
|
+
@include ds-typography($ds-typography-functional-body01regular);
|
|
5
|
+
margin-top: ds-spacing-component($ds-sc-x2);
|
|
6
|
+
color: $ds-color-text-primary;
|
|
7
|
+
|
|
8
|
+
@at-root .ds-force-px#{&} {
|
|
9
|
+
@include ds-typography($ds-typography-functional-body01regular, true);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
> .ds-article-image__credits {
|
|
13
|
+
color: $ds-color-text-primary-02;
|
|
14
|
+
|
|
15
|
+
&.ds-article-image__credits--nowrap {
|
|
16
|
+
white-space: nowrap;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&.ds-article-image__credits--nowrap-bigscreen {
|
|
20
|
+
@include ds-mq-smallest-breakpoint(tablet) {
|
|
21
|
+
white-space: nowrap;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{% from '@bonniernews/dn-design-system-web/
|
|
1
|
+
{% from '@bonniernews/dn-design-system-web/components/icon-sprite/icon-sprite.njk' import IconUse %}
|
|
2
2
|
{% from '@bonniernews/dn-design-system-web/components/switch/switch.njk' import Switch %}
|
|
3
3
|
{% from '@bonniernews/dn-design-system-web/components/checkbox/checkbox.njk' import Checkbox %}
|
|
4
4
|
{% from '@bonniernews/dn-design-system-web/components/radio-button/radio-button.njk' import RadioButton %}
|
|
@@ -63,11 +63,11 @@
|
|
|
63
63
|
{% endif %}
|
|
64
64
|
|
|
65
65
|
{% if params.leadingIcon %}
|
|
66
|
-
{% set iconLeftSvg =
|
|
66
|
+
{% set iconLeftSvg = IconUse({ icon: params.leadingIcon }) %}
|
|
67
67
|
{% endif %}
|
|
68
68
|
|
|
69
69
|
{% if params.trailingIcon %}
|
|
70
|
-
{% set iconRightSvg =
|
|
70
|
+
{% set iconRightSvg = IconUse({ icon: params.trailingIcon }) %}
|
|
71
71
|
{% endif %}
|
|
72
72
|
|
|
73
73
|
{% if params.listItemType == "standard" or not params.listItemType %}
|
|
@@ -137,8 +137,8 @@
|
|
|
137
137
|
</div>
|
|
138
138
|
{% elif element == 'accordion' %}
|
|
139
139
|
{% set iconRightSvg %}
|
|
140
|
-
{{
|
|
141
|
-
{{
|
|
140
|
+
{{ IconUse({ icon: "expand_less" }) }}
|
|
141
|
+
{{ IconUse({ icon: "expand_more" }) }}
|
|
142
142
|
{% endset %}
|
|
143
143
|
<button class="{{ classes }}" {{ "disabled" if params.disabled }} {{- attributes | safe }}>
|
|
144
144
|
{{ caller() if caller }}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
-
@use "
|
|
2
|
+
@use "../icon-sprite/icon-sprite.scss";
|
|
3
3
|
@use "../checkbox/checkbox.scss" as *;
|
|
4
4
|
@use "../switch/switch.scss" as *;
|
|
5
5
|
@use "../radio-button/radio-button.scss" as *;
|
|
@@ -27,7 +27,6 @@ $ds-list-item__icon-size: 24px;
|
|
|
27
27
|
.ds-list-item__inner {
|
|
28
28
|
box-sizing: border-box;
|
|
29
29
|
border-radius: 0;
|
|
30
|
-
transition: background-color 50ms ease-out;
|
|
31
30
|
margin: 0;
|
|
32
31
|
display: flex;
|
|
33
32
|
align-items: center;
|
|
@@ -45,7 +44,6 @@ $ds-list-item__icon-size: 24px;
|
|
|
45
44
|
left: 0;
|
|
46
45
|
bottom: 0;
|
|
47
46
|
right: 0;
|
|
48
|
-
transition: background-color 500ms ease;
|
|
49
47
|
}
|
|
50
48
|
|
|
51
49
|
.ds-icon {
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/pictogram](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/pictogram)
|
|
2
|
+
- Storybook: [Pictogram > Web](https://designsystem.dn.se/?path=/story/components-app-web-pictogram-web)
|
|
3
|
+
|
|
4
|
+
----
|
|
5
|
+
|
|
6
|
+
# Pictogram
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
|parameter | type | required | options | default | description |
|
|
11
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
12
|
+
|variant| String | yes | brand, business | brand | Design variant |
|
|
13
|
+
|iconName | String | yes | add, arrow_back, arrow_forward etc | | For all available icons see: https://designsystem.dn.se/?path=/story/foundations-icon-web--all |
|
|
14
|
+
|size| String | yes | small, large | small | |
|
|
15
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
16
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
17
|
+
|forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size |
|
|
18
|
+
|
|
19
|
+
## Minimum requirement example
|
|
20
|
+
|
|
21
|
+
### Nunjucks
|
|
22
|
+
|
|
23
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
{% from '@bonniernews/dn-design-system-web/components/pictogram/pictogram.njk' import Pictogram %}
|
|
27
|
+
|
|
28
|
+
{{ Pictogram({
|
|
29
|
+
variant: "business",
|
|
30
|
+
size: "small",
|
|
31
|
+
iconName: "lock",
|
|
32
|
+
attributes: { "aria-label": "Låst innehåll"}
|
|
33
|
+
})}}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### SCSS
|
|
37
|
+
```scss
|
|
38
|
+
@use "@bonniernews/dn-design-system-web/components/pictogram/pictogram";
|
|
39
|
+
```
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
2
|
+
{% from '@bonniernews/dn-design-system-web/components/icon-sprite/icon-sprite.njk' import IconUse %}
|
|
3
|
+
|
|
4
|
+
{% macro Pictogram(params) %}
|
|
5
|
+
{%- set componentClassName = "ds-pictogram" %}
|
|
6
|
+
{%- set classNamePrefix = componentClassName + "--" %}
|
|
7
|
+
{%- set additionalClasses = [] %}
|
|
8
|
+
{%- set attributes = getAttributes(params.attributes) %}
|
|
9
|
+
|
|
10
|
+
{%- if params.forcePx %}
|
|
11
|
+
{% set additionalClasses = (additionalClasses.push("ds-force-px"), additionalClasses) %}
|
|
12
|
+
{% endif %}
|
|
13
|
+
|
|
14
|
+
{%- if params.variant and params.variant != "brand" %}
|
|
15
|
+
{% set additionalClasses = (additionalClasses.push(classNamePrefix + params.variant), additionalClasses) %}
|
|
16
|
+
{% endif %}
|
|
17
|
+
|
|
18
|
+
{%- if params.size and params.size != "small" %}
|
|
19
|
+
{% set additionalClasses = (additionalClasses.push(classNamePrefix + params.size), additionalClasses) %}
|
|
20
|
+
{% endif %}
|
|
21
|
+
|
|
22
|
+
{%- if params.classNames %}
|
|
23
|
+
{% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
|
|
24
|
+
{% endif%}
|
|
25
|
+
|
|
26
|
+
{%- set classes = componentClassName + " " + additionalClasses | join(" ") %}
|
|
27
|
+
<div class="{{ classes }}" {{- attributes | safe }}>
|
|
28
|
+
{{ IconUse({ icon: params.iconName, attributs: { "aria-hidden": "true" } }) }}
|
|
29
|
+
</div>
|
|
30
|
+
{% endmacro %}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
+
@use "../icon-sprite/icon-sprite.scss";
|
|
3
|
+
|
|
4
|
+
$ds-pictogram__size: 40px;
|
|
5
|
+
$ds-pictogram__size--large: 64px;
|
|
6
|
+
$ds-pictogram__icon-size: 24px;
|
|
7
|
+
$ds-pictogram__icon-size--large: 40px;
|
|
8
|
+
|
|
9
|
+
.ds-pictogram {
|
|
10
|
+
display: flex;
|
|
11
|
+
align-items: center;
|
|
12
|
+
justify-content: center;
|
|
13
|
+
border-radius: 50%;
|
|
14
|
+
background-color: $ds-color-static-red-200;
|
|
15
|
+
height: ds-px-to-rem($ds-pictogram__size);
|
|
16
|
+
width: ds-px-to-rem($ds-pictogram__size);
|
|
17
|
+
@at-root .ds-force-px#{&} {
|
|
18
|
+
height: $ds-pictogram__size;
|
|
19
|
+
width: $ds-pictogram__size;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ds-icon {
|
|
23
|
+
fill: $ds-color-static-black;
|
|
24
|
+
display: flex;
|
|
25
|
+
height: ds-px-to-rem($ds-pictogram__icon-size);
|
|
26
|
+
width: ds-px-to-rem($ds-pictogram__icon-size);
|
|
27
|
+
@at-root .ds-force-px#{&} {
|
|
28
|
+
height: $ds-pictogram__icon-size;
|
|
29
|
+
width: $ds-pictogram__icon-size;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&.ds-pictogram--business {
|
|
34
|
+
background-color: $ds-color-static-green-100;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
&.ds-pictogram--large {
|
|
38
|
+
height: ds-px-to-rem($ds-pictogram__size--large);
|
|
39
|
+
width: ds-px-to-rem($ds-pictogram__size--large);
|
|
40
|
+
@at-root .ds-force-px#{&} {
|
|
41
|
+
height: $ds-pictogram__size--large;
|
|
42
|
+
width: $ds-pictogram__size--large;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.ds-icon {
|
|
46
|
+
height: ds-px-to-rem($ds-pictogram__icon-size--large);
|
|
47
|
+
width: ds-px-to-rem($ds-pictogram__icon-size--large);
|
|
48
|
+
@at-root .ds-force-px#{&} {
|
|
49
|
+
height: $ds-pictogram__icon-size--large;
|
|
50
|
+
width: $ds-pictogram__icon-size--large;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|parameter | type | required | options | default | description |
|
|
11
11
|
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
12
12
|
|bodyHtml | HTML String | yes | | | |
|
|
13
|
-
|
|
|
13
|
+
|theme | String | no | default, kultur, nyheter, sport, ekonomi | | Design theme |
|
|
14
14
|
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
15
15
|
|classNames | String | no | | | Ex. "my-special-class" |
|
|
16
16
|
|forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size |
|
|
@@ -25,7 +25,6 @@ These are copy paste friendly examples to quickliy get started using a component
|
|
|
25
25
|
{% from '@bonniernews/dn-design-system-web/components/quote/quote.njk' import Quote %}
|
|
26
26
|
|
|
27
27
|
{{ Quote({
|
|
28
|
-
variant: "culture",
|
|
29
28
|
bodyHtml: ""
|
|
30
29
|
})}}
|
|
31
30
|
```
|
|
@@ -3,24 +3,22 @@
|
|
|
3
3
|
{% macro Quote(params) %}
|
|
4
4
|
{% set componentClassName = "ds-quote" %}
|
|
5
5
|
{% set classNamePrefix = componentClassName + "--" %}
|
|
6
|
-
{% set
|
|
6
|
+
{% set additionalClasses = [] %}
|
|
7
7
|
{% set attributes = getAttributes(params.attributes) %}
|
|
8
8
|
|
|
9
9
|
{% if params.forcePx %}
|
|
10
|
-
{% set
|
|
10
|
+
{% set additionalClasses = (additionalClasses.push("ds-force-px"), additionalClasses) %}
|
|
11
11
|
{% endif %}
|
|
12
12
|
|
|
13
|
-
{% if params.
|
|
14
|
-
{% set
|
|
15
|
-
{% else %}
|
|
16
|
-
{% set variant = (variant.push(classNamePrefix + "standard"), variant) %}
|
|
13
|
+
{% if params.theme %}
|
|
14
|
+
{% set additionalClasses = (additionalClasses.push('ds-theme--' + params.theme), additionalClasses) %}
|
|
17
15
|
{% endif %}
|
|
18
16
|
|
|
19
17
|
{% if params.classNames %}
|
|
20
|
-
{% set
|
|
18
|
+
{% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
|
|
21
19
|
{% endif%}
|
|
22
20
|
|
|
23
|
-
{% set classes = componentClassName + " " +
|
|
21
|
+
{% set classes = componentClassName + " " + additionalClasses | join(" ") %}
|
|
24
22
|
|
|
25
23
|
<blockquote class="{{ classes }}" {{- attributes | safe }}>
|
|
26
24
|
<span class="{{ componentClassName + '__border'}}"></span>
|
|
@@ -17,21 +17,8 @@
|
|
|
17
17
|
display: block;
|
|
18
18
|
width: 40px;
|
|
19
19
|
height: 8px;
|
|
20
|
-
color: $ds-color
|
|
20
|
+
color: $ds-theme-color;
|
|
21
21
|
background: currentColor;
|
|
22
22
|
margin: ds-spacing-component(0 0 $ds-sc-x2);
|
|
23
23
|
}
|
|
24
|
-
|
|
25
|
-
&--culture .ds-quote__border {
|
|
26
|
-
color: $ds-color-static-kultur;
|
|
27
|
-
}
|
|
28
|
-
&--sport .ds-quote__border {
|
|
29
|
-
color: $ds-color-static-sport;
|
|
30
|
-
}
|
|
31
|
-
&--economy .ds-quote__border {
|
|
32
|
-
color: $ds-color-static-economy;
|
|
33
|
-
}
|
|
34
|
-
&--sthlm .ds-quote__border {
|
|
35
|
-
color: $ds-color-static-sthlm;
|
|
36
|
-
}
|
|
37
24
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
{% from '@bonniernews/dn-design-system-web/
|
|
1
|
+
{% from '@bonniernews/dn-design-system-web/components/icon-sprite/icon-sprite.njk' import IconUse %}
|
|
2
2
|
{% from '@bonniernews/dn-design-system-web/assets/form-field/form-field.njk' import FormField %}
|
|
3
3
|
|
|
4
4
|
{# Internal helper macro - not intended for use outside of this file #}
|
|
5
5
|
{% macro RadioButtonIcons(componentClassName) %}
|
|
6
6
|
<span class="{{ componentClassName + '__icon'}}">
|
|
7
|
-
{{
|
|
8
|
-
{{
|
|
7
|
+
{{ IconUse({ icon: "radio_button_unchecked" }) }}
|
|
8
|
+
{{ IconUse({ icon: "radio_button_checked" }) }}
|
|
9
9
|
</span>
|
|
10
10
|
{% endmacro %}
|
|
11
11
|
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
@use "../../foundations/helpers/
|
|
2
|
-
@use "
|
|
3
|
-
@use "../../foundations/helpers/mediaQueries.scss" as *;
|
|
4
|
-
@use "../../foundations/helpers/metrics.scss" as *;
|
|
5
|
-
@use "../../foundations/helpers/utilities.scss" as *;
|
|
6
|
-
@use "../../foundations/helpers/colors.scss" as *;
|
|
7
|
-
@use "../../foundations/icons/icon.scss" as *;
|
|
1
|
+
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
+
@use "../icon-sprite/icon-sprite.scss";
|
|
8
3
|
@use "../../assets/form-field/form-field.scss" as *;
|
|
9
4
|
|
|
10
5
|
$ds-radio-btn__icon-size: 24px;
|
|
@@ -65,9 +60,12 @@ $ds-radio-btn__icon-size: 24px;
|
|
|
65
60
|
}
|
|
66
61
|
}
|
|
67
62
|
|
|
68
|
-
&:
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
&:active::before {
|
|
64
|
+
background-color: $ds-color-component-primary-overlay;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
@include ds-hover() {
|
|
68
|
+
&:hover::before {
|
|
71
69
|
background-color: $ds-color-component-primary-overlay;
|
|
72
70
|
}
|
|
73
71
|
}
|
|
@@ -1,33 +1,29 @@
|
|
|
1
|
-
{%
|
|
2
|
-
{% set componentClassName = "ds-spinner" %}
|
|
3
|
-
{% set classNamePrefix = componentClassName + "--" %}
|
|
4
|
-
{% set variant = [] %}
|
|
5
|
-
{% set size = params.size | default("large") %}
|
|
6
|
-
{% set attributes %}
|
|
7
|
-
{% for attribute, value in params.attributes %}
|
|
8
|
-
{{attribute}}="{{value}}"
|
|
9
|
-
{% endfor %}
|
|
10
|
-
{% endset %}
|
|
1
|
+
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
11
2
|
|
|
12
|
-
|
|
3
|
+
{% macro Spinner(params) %}
|
|
4
|
+
{%- set componentClassName = "ds-spinner" %}
|
|
5
|
+
{%- set classNamePrefix = componentClassName + "--" %}
|
|
6
|
+
{%- set additionalClasses = [] %}
|
|
7
|
+
{%- set size = params.size | default("large") %}
|
|
8
|
+
{%- set attributes = getAttributes(params.attributes) %}
|
|
9
|
+
{%- set additionalClasses = (additionalClasses.push(classNamePrefix + size), additionalClasses) %}
|
|
13
10
|
|
|
14
|
-
{
|
|
15
|
-
{% set
|
|
11
|
+
{%- if params.forcePx %}
|
|
12
|
+
{% set additionalClasses = (additionalClasses.push("ds-force-px"), additionalClasses) %}
|
|
16
13
|
{% endif %}
|
|
17
14
|
|
|
18
|
-
{
|
|
19
|
-
{% set
|
|
15
|
+
{%- if params.classNames %}
|
|
16
|
+
{% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
|
|
20
17
|
{% endif%}
|
|
21
18
|
|
|
22
|
-
{
|
|
23
|
-
{% set
|
|
19
|
+
{%- if params.variant %}
|
|
20
|
+
{% set additionalClasses = (additionalClasses.push(classNamePrefix + params.variant), additionalClasses) %}
|
|
24
21
|
{% else %}
|
|
25
|
-
{% set
|
|
22
|
+
{% set additionalClasses = (additionalClasses.push(classNamePrefix + "primary"), additionalClasses) %}
|
|
26
23
|
{% endif %}
|
|
27
24
|
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
</div>
|
|
25
|
+
{%- set classes = componentClassName + " " + additionalClasses | join(" ") %}
|
|
26
|
+
<span class="{{ classes }}" {{- attributes | safe }}>
|
|
27
|
+
<span class="{{ componentClassName + '__inner'}}"></span>
|
|
28
|
+
</span>
|
|
33
29
|
{% endmacro %}
|
|
@@ -12,18 +12,21 @@ $ds-spinner__shadow-border-opacity: 0.2;
|
|
|
12
12
|
|
|
13
13
|
.ds-spinner {
|
|
14
14
|
.ds-spinner__inner {
|
|
15
|
+
display: block;
|
|
15
16
|
border-radius: $ds-spinner__border-radius;
|
|
16
17
|
animation: ds-spinner-animation 1s linear infinite;
|
|
17
18
|
border-style: solid;
|
|
18
19
|
border-color: transparent;
|
|
19
20
|
position: relative;
|
|
21
|
+
box-sizing: border-box;
|
|
20
22
|
|
|
21
|
-
|
|
23
|
+
&::before {
|
|
22
24
|
content: "";
|
|
23
25
|
position: absolute;
|
|
24
26
|
opacity: $ds-spinner__shadow-border-opacity;
|
|
25
27
|
border-radius: $ds-spinner__border-radius;
|
|
26
28
|
border-style: solid;
|
|
29
|
+
box-sizing: border-box;
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-image](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-image)
|
|
2
|
+
- Storybook (PROD): [TeaserImage > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teaserimage-web--teaser-image)
|
|
3
|
+
- Storybook (LATEST): [TeaserImage > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teaserimage-web--teaser-image)
|
|
4
|
+
|
|
5
|
+
----
|
|
6
|
+
|
|
7
|
+
# teaser-image
|
|
8
|
+
|
|
9
|
+
## Parameters
|
|
10
|
+
|
|
11
|
+
|parameter | type | required | options | default | description |
|
|
12
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
13
|
+
|imageHtml | HTML String | yes | | | The img element or equivalent |
|
|
14
|
+
|byline | String | no | | | Media credit text |
|
|
15
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
16
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
17
|
+
|~forcePx~ | | | | | Always applied |
|
|
18
|
+
|
|
19
|
+
## Minimum requirement example
|
|
20
|
+
|
|
21
|
+
### Nunjucks
|
|
22
|
+
|
|
23
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
{% from '@bonniernews/dn-design-system-web/components/teaser-image/teaser-image.njk' import TeaserImage %}
|
|
27
|
+
|
|
28
|
+
{{ TeaserImage({
|
|
29
|
+
imageHtml: "<img src='??'>",
|
|
30
|
+
byline: "Foto: Paul Hansen"
|
|
31
|
+
})}}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
### SCSS
|
|
35
|
+
```scss
|
|
36
|
+
@use "@bonniernews/dn-design-system-web/components/teaser-image/teaser-image" as *;
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
This scss is already included in `teaser.scss`.
|
|
40
|
+
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
|
|
2
|
+
|
|
3
|
+
{% macro TeaserImage(params) %}
|
|
4
|
+
{% set macroClassName = "ds-teaser-image" %}
|
|
5
|
+
{% set additionalClasses = [] %}
|
|
6
|
+
{% set attributes = getAttributes(params.attributes) %}
|
|
7
|
+
|
|
8
|
+
{% if params.classNames %}
|
|
9
|
+
{% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
|
|
10
|
+
{% endif %}
|
|
11
|
+
|
|
12
|
+
{% set classes = macroClassName + " " + additionalClasses | join(" ") %}
|
|
13
|
+
|
|
14
|
+
<figure class="{{ classes }}" {{- attributes | safe }}>
|
|
15
|
+
{{ params.imageHtml | safe }}
|
|
16
|
+
|
|
17
|
+
{% if params.byline %}
|
|
18
|
+
<figcaption class={{ macroClassName + "__byline" }}>{{ params.byline }}</figcaption>
|
|
19
|
+
{% endif %}
|
|
20
|
+
</figure>
|
|
21
|
+
{% endmacro %}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
+
|
|
3
|
+
.ds-teaser-image {
|
|
4
|
+
position: relative;
|
|
5
|
+
width: 100%;
|
|
6
|
+
margin: 0;
|
|
7
|
+
|
|
8
|
+
.ds-teaser-image__byline {
|
|
9
|
+
position: absolute;
|
|
10
|
+
bottom: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
padding: ds-spacing-component($ds-sc-x1 $ds-sc-x2);
|
|
13
|
+
margin-left: ds-spacing-component($ds-sc-x2);
|
|
14
|
+
|
|
15
|
+
@include ds-typography($ds-typography-functional-meta01regular, true);
|
|
16
|
+
color: $ds-color-static-white;
|
|
17
|
+
|
|
18
|
+
background-color: $ds-color-static-transparent-black;
|
|
19
|
+
z-index: 5;
|
|
20
|
+
}
|
|
21
|
+
}
|