@bonniernews/dn-design-system-web 2.1.0-alpha.1 → 2.1.0-alpha.3
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/button/README.md +1 -0
- package/components/button/button.njk +4 -0
- package/components/button/button.scss +23 -18
- package/components/factbox/README.md +52 -0
- package/components/factbox/factbox.js +42 -0
- package/components/factbox/factbox.njk +83 -0
- package/components/factbox/factbox.scss +150 -0
- package/foundations/helpers/spacing.scss +4 -2
- package/foundations/icons/grade-icon.njk +18 -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
|
+
## [2.1.0-alpha.3](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@2.1.0-alpha.2...@bonniernews/dn-design-system-web@2.1.0-alpha.3) (2023-02-17)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **web:** factbox component ([#672](https://github.com/BonnierNews/dn-design-system/issues/672)) ([310447e](https://github.com/BonnierNews/dn-design-system/commit/310447e35638aa7a289db613ee9e754098ed9718))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## 2.1.0-alpha.2 (2023-02-17)
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
### Bug Fixes
|
|
19
|
+
|
|
20
|
+
* **web:** support auto in spacing helper ([#677](https://github.com/BonnierNews/dn-design-system/issues/677)) ([c6b3a2d](https://github.com/BonnierNews/dn-design-system/commit/c6b3a2dfca50033ff80917e44eadbb772357696b))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
6
24
|
## [2.1.0-alpha.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@2.1.0-alpha.0...@bonniernews/dn-design-system-web@2.1.0-alpha.1) (2023-02-15)
|
|
7
25
|
|
|
8
26
|
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
|size| String | no | default, small | default | |
|
|
16
16
|
|fullWidth | bool | no | true, false | false | Button will be full width on both desktop and mobile |
|
|
17
17
|
|mobile.fullWidth | bool | no | true, false | false | Ex mobile: { fullWidth: true } |
|
|
18
|
+
|condensed | bool | no | true, false | false | Condensed reduces spacing to a bare minimum, use with care since this might make touch target area smaller than recommended size |
|
|
18
19
|
|iconPosition | String | no | none, left, right | none | |
|
|
19
20
|
|iconName | String | no | add, arrow_back, arrow_forward etc | | For all available icons see: https://designsystem.dn.se/?path=/story/foundations-icon-web--all |
|
|
20
21
|
|loading | bool | no | true, false | false | |
|
|
@@ -30,6 +30,10 @@
|
|
|
30
30
|
{% set variant = (variant.push("ds-force-px"), variant) %}
|
|
31
31
|
{% endif %}
|
|
32
32
|
|
|
33
|
+
{% if params.condensed %}
|
|
34
|
+
{% set variant = (variant.push(classNamePrefix + "condensed"), variant) %}
|
|
35
|
+
{% endif %}
|
|
36
|
+
|
|
33
37
|
{% if params.size and params.size != "default" %}
|
|
34
38
|
{% set variant = (variant.push(classNamePrefix + params.size), variant) %}
|
|
35
39
|
{% endif %}
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
@use "sass:math";
|
|
2
|
-
@use "../../foundations/helpers/
|
|
3
|
-
@use "../../foundations/helpers/typography.scss" as *;
|
|
4
|
-
@use "../../foundations/helpers/mediaQueries.scss" as *;
|
|
5
|
-
@use "../../foundations/helpers/metrics.scss" as *;
|
|
6
|
-
@use "../../foundations/helpers/utilities.scss" as *;
|
|
7
|
-
@use "../../foundations/helpers/colors.scss" as *;
|
|
8
|
-
@use "../../foundations/helpers/loading.scss" as *;
|
|
2
|
+
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
9
3
|
@use "../../foundations/icons/icon.scss" as *;
|
|
10
4
|
@use "../spinner/spinner.scss" as *;
|
|
11
5
|
|
|
@@ -17,14 +11,17 @@ $ds-btn__icon-size: 24px;
|
|
|
17
11
|
cursor: pointer;
|
|
18
12
|
background-color: transparent;
|
|
19
13
|
border: none;
|
|
20
|
-
min-width: $ds-btn__min-clickable-area;
|
|
21
|
-
min-height: $ds-btn__min-clickable-area;
|
|
22
14
|
display: inline-flex;
|
|
23
15
|
align-items: center;
|
|
24
16
|
justify-content: center;
|
|
25
17
|
padding: 0;
|
|
26
18
|
position: relative;
|
|
27
19
|
|
|
20
|
+
&:not(.ds-btn--condensed) {
|
|
21
|
+
min-width: $ds-btn__min-clickable-area;
|
|
22
|
+
min-height: $ds-btn__min-clickable-area;
|
|
23
|
+
}
|
|
24
|
+
|
|
28
25
|
&:focus-visible {
|
|
29
26
|
outline: none;
|
|
30
27
|
.ds-btn__inner {
|
|
@@ -62,8 +59,10 @@ $ds-btn__icon-size: 24px;
|
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
61
|
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
@include ds-hover() {
|
|
63
|
+
&:hover:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
|
|
64
|
+
background-color: $ds-color-component-primary-overlay;
|
|
65
|
+
}
|
|
67
66
|
}
|
|
68
67
|
&:active:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
|
|
69
68
|
background-color: $ds-color-component-primary-overlay-02;
|
|
@@ -172,8 +171,10 @@ $ds-btn__icon-size: 24px;
|
|
|
172
171
|
&:focus-visible .ds-btn__inner {
|
|
173
172
|
outline-color: $ds-color-border-focus-02;
|
|
174
173
|
}
|
|
175
|
-
|
|
176
|
-
|
|
174
|
+
@include ds-hover() {
|
|
175
|
+
&:hover:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
|
|
176
|
+
background-color: $ds-color-component-secondary-overlay;
|
|
177
|
+
}
|
|
177
178
|
}
|
|
178
179
|
&:active:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
|
|
179
180
|
background-color: $ds-color-component-secondary-overlay-02;
|
|
@@ -225,8 +226,10 @@ $ds-btn__icon-size: 24px;
|
|
|
225
226
|
&:focus-visible .ds-btn__inner {
|
|
226
227
|
outline-color: $ds-color-border-focus-02;
|
|
227
228
|
}
|
|
228
|
-
|
|
229
|
-
|
|
229
|
+
@include ds-hover() {
|
|
230
|
+
&:hover:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
|
|
231
|
+
background-color: #0808081a; // static version of lightmode component-secondary-overlay
|
|
232
|
+
}
|
|
230
233
|
}
|
|
231
234
|
&:active:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
|
|
232
235
|
background-color: #08080833; // static version of lightmode component-secondary-overlay-2
|
|
@@ -245,9 +248,11 @@ $ds-btn__icon-size: 24px;
|
|
|
245
248
|
&:focus-visible .ds-btn__inner {
|
|
246
249
|
outline-color: $ds-color-static-white;
|
|
247
250
|
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
+
@include ds-hover() {
|
|
252
|
+
&:hover:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
|
|
253
|
+
background-color: rgba(255, 255, 255, 0.101960784);
|
|
254
|
+
// static version of darkmode component-secondary-overlay
|
|
255
|
+
}
|
|
251
256
|
}
|
|
252
257
|
&:active:not(:disabled):not(.ds-loading) .ds-btn__inner::before {
|
|
253
258
|
background-color: rgba(255, 255, 255, 0.2);
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
- GitHub: [BonnierNews/dn-design-system/../web/src/components/factbox](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/factbox)
|
|
2
|
+
- Storybook: [Factbox > Web](https://designsystem.dn.se/?path=/story/components-web-factbox-web--factbox)
|
|
3
|
+
|
|
4
|
+
----
|
|
5
|
+
|
|
6
|
+
# Factbox
|
|
7
|
+
|
|
8
|
+
## Parameters
|
|
9
|
+
|
|
10
|
+
|parameter | type | required | options | default | description |
|
|
11
|
+
|:--- | :--- | :--- | :--- | :--- | :--- |
|
|
12
|
+
|vignetteHtml | HTML String | no | | | |
|
|
13
|
+
|titleHtml | HTML String | yes | | | |
|
|
14
|
+
|bodyHtml | HTML String | yes | | | |
|
|
15
|
+
|variant | String | yes | standard, culture, sport, economy | standard | Design variant |
|
|
16
|
+
|grade | String | no | | | zero, one, two, three, four, five, none |
|
|
17
|
+
|attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
|
|
18
|
+
|classNames | String | no | | | Ex. "my-special-class" |
|
|
19
|
+
|forceExpanded | bool | no | true, false | false | Full factbox is shown regardless of height and no control buttons are shown|
|
|
20
|
+
|forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size |
|
|
21
|
+
|
|
22
|
+
## Minimum requirement example
|
|
23
|
+
|
|
24
|
+
### Nunjucks
|
|
25
|
+
|
|
26
|
+
These are copy paste friendly examples to quickliy get started using a component.
|
|
27
|
+
|
|
28
|
+
```html
|
|
29
|
+
{% from '@bonniernews/dn-design-system-web/components/factbox/factbox.njk' import Factbox %}
|
|
30
|
+
|
|
31
|
+
{{ Factbox({
|
|
32
|
+
vignetteHtml: "",
|
|
33
|
+
titleHtml: "Drama",
|
|
34
|
+
bodyHtml: "<p>”Irrational man”<br />Regi och manus: Woody Allen<br />I rollerna: Joaquin Phoenix, Emma Stone, Parker Posey m fl.<br />Längd: 1 tim 35 min (från 11 år.)</p>",
|
|
35
|
+
variant: "culture",
|
|
36
|
+
grade: "two",
|
|
37
|
+
forcePx: true
|
|
38
|
+
})}}
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### SCSS
|
|
42
|
+
```scss
|
|
43
|
+
@use "@bonniernews/dn-design-system-web/components/factbox/factbox" as *;
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
### Javascript
|
|
47
|
+
|
|
48
|
+
```javascript
|
|
49
|
+
import dsFactbox from '@bonniernews/dn-design-system-web/components/factbox/factbox.js'
|
|
50
|
+
const factboxElements = Array.from(document.getElementsByClassName("ds-factbox"));
|
|
51
|
+
dsFactbox(factboxElements);
|
|
52
|
+
```
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export {
|
|
2
|
+
dsFactbox,
|
|
3
|
+
dsFactboxAll
|
|
4
|
+
};
|
|
5
|
+
|
|
6
|
+
const selector = "ds-factbox";
|
|
7
|
+
const expandedClass = `${selector}--expanded`;
|
|
8
|
+
const maxHeight = 468; // this has to match max-height in factbox.scss
|
|
9
|
+
|
|
10
|
+
function dsFactbox(factboxElements) {
|
|
11
|
+
if (!factboxElements.length) return;
|
|
12
|
+
factboxElements.forEach((factboxEl) => {
|
|
13
|
+
if (factboxEl.classList.contains(expandedClass)) return;
|
|
14
|
+
|
|
15
|
+
const contentEl = factboxEl.getElementsByClassName(`${selector}__content`)[0];
|
|
16
|
+
if (contentEl.getBoundingClientRect().height <= maxHeight) {
|
|
17
|
+
factboxEl.classList.add(expandedClass);
|
|
18
|
+
return;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const showMoreEl = factboxEl.getElementsByClassName(`${selector}__show-more`)[0];
|
|
22
|
+
showMoreEl.classList.add(`${selector}__show-more--collapsable`);
|
|
23
|
+
|
|
24
|
+
const expandMoreBtn = factboxEl.getElementsByClassName(`${selector}__expand-more`)[0];
|
|
25
|
+
const expandLessBtn = factboxEl.getElementsByClassName(`${selector}__expand-less`)[0];
|
|
26
|
+
|
|
27
|
+
expandMoreBtn.addEventListener("click", () => {
|
|
28
|
+
factboxEl.classList.add(expandedClass);
|
|
29
|
+
showMoreEl.setAttribute("data-factbox-expanded", "");
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
expandLessBtn.addEventListener("click", () => {
|
|
33
|
+
factboxEl.classList.remove(expandedClass);
|
|
34
|
+
showMoreEl.removeAttribute("data-factbox-expanded");
|
|
35
|
+
});
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function dsFactboxAll() {
|
|
40
|
+
const factboxElements = Array.from(document.getElementsByClassName(`${selector}`));
|
|
41
|
+
dsFactbox(factboxElements);
|
|
42
|
+
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
{% from '@bonniernews/dn-design-system-web/foundations/icons/grade-icon.njk' import GradeIcon %}
|
|
2
|
+
{% from '@bonniernews/dn-design-system-web/components/button/button.njk' import Button %}
|
|
3
|
+
|
|
4
|
+
{% macro Factbox(params) %}
|
|
5
|
+
{% set componentClassName = "ds-factbox" %}
|
|
6
|
+
{% set classNamePrefix = componentClassName + "--" %}
|
|
7
|
+
{% set variant = [] %}
|
|
8
|
+
{% set grades = ["zero", "one", "two", "three", "four", "five"] %}
|
|
9
|
+
{% set activeGrade = params.grade | default("") | string %}
|
|
10
|
+
|
|
11
|
+
{% set attributes %}
|
|
12
|
+
{% for attribute, value in params.attributes %}
|
|
13
|
+
{{attribute}}="{{value}}"
|
|
14
|
+
{% endfor %}
|
|
15
|
+
{% endset %}
|
|
16
|
+
|
|
17
|
+
{% if params.variant %}
|
|
18
|
+
{% set variant = (variant.push(classNamePrefix + params.variant), variant) %}
|
|
19
|
+
{% else %}
|
|
20
|
+
{% set variant = (variant.push(classNamePrefix + "standard"), variant) %}
|
|
21
|
+
{% endif %}
|
|
22
|
+
|
|
23
|
+
{% if params.forcePx %}
|
|
24
|
+
{% set variant = (variant.push("ds-force-px"), variant) %}
|
|
25
|
+
{% endif %}
|
|
26
|
+
|
|
27
|
+
{% if params.forceExpand %}
|
|
28
|
+
{% set variant = (variant.push(classNamePrefix + "expanded"), variant) %}
|
|
29
|
+
{% endif %}
|
|
30
|
+
|
|
31
|
+
{% if params.classNames %}
|
|
32
|
+
{% set variant = (variant.push(params.classNames), variant) %}
|
|
33
|
+
{% endif%}
|
|
34
|
+
|
|
35
|
+
{% set classes = componentClassName + " " + variant | join(" ") %}
|
|
36
|
+
|
|
37
|
+
<div class="{{ classes }}" {{- attributes | safe }}>
|
|
38
|
+
<div class="{{ componentClassName + '__inner'}}">
|
|
39
|
+
<div class="{{ componentClassName + '__content'}}">
|
|
40
|
+
<h2 class="{{ componentClassName + '__title'}}">
|
|
41
|
+
{%- if params.vignetteHtml %}<span class="{{ componentClassName + '__vignette'}}">{{ params.vignetteHtml | safe }}</span>{%- endif %}
|
|
42
|
+
{{- params.titleHtml | safe -}}
|
|
43
|
+
</h2>
|
|
44
|
+
{% if activeGrade and activeGrade in grades %}
|
|
45
|
+
<div class="{{ componentClassName + '__grades'}}">
|
|
46
|
+
{% for grade in grades %}
|
|
47
|
+
{% if grade == activeGrade %}
|
|
48
|
+
<span class="{{ componentClassName + '__grade'}}" data-active-grade>{{- GradeIcon({ icon: grade }) | safe }}</span>
|
|
49
|
+
{% else %}
|
|
50
|
+
<span class="{{ componentClassName + '__grade'}}">{{- GradeIcon({ icon: grade }) | safe }}</span>
|
|
51
|
+
{% endif %}
|
|
52
|
+
{% endfor %}
|
|
53
|
+
</div>
|
|
54
|
+
{% endif%}
|
|
55
|
+
<div class="{{ componentClassName + '__body'}}">{{ params.bodyHtml | safe }}</div>
|
|
56
|
+
</div>
|
|
57
|
+
<div class="{{ componentClassName + '__show-more'}}">
|
|
58
|
+
{{ Button({
|
|
59
|
+
text: 'Visa mer',
|
|
60
|
+
variant: 'secondaryFilled',
|
|
61
|
+
size: 'small',
|
|
62
|
+
iconPosition: 'right',
|
|
63
|
+
iconName: 'expand_more',
|
|
64
|
+
classNames: 'ds-factbox__expand-more',
|
|
65
|
+
fullWidth: true,
|
|
66
|
+
forcePx: params.forcePx,
|
|
67
|
+
condensed: true
|
|
68
|
+
})}}
|
|
69
|
+
{{ Button({
|
|
70
|
+
text: 'Visa mindre',
|
|
71
|
+
variant: 'secondaryFilled',
|
|
72
|
+
size: 'small',
|
|
73
|
+
iconPosition: 'right',
|
|
74
|
+
iconName: 'expand_less',
|
|
75
|
+
classNames: 'ds-factbox__expand-less',
|
|
76
|
+
fullWidth: true,
|
|
77
|
+
forcePx: params.forcePx,
|
|
78
|
+
condensed: true
|
|
79
|
+
})}}
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
</div>
|
|
83
|
+
{% endmacro %}
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
@use "../../foundations/helpers/forward.helpers.scss" as *;
|
|
2
|
+
@use "../button/button.scss" as *;
|
|
3
|
+
|
|
4
|
+
$ds-factbox__grade-size: 32px;
|
|
5
|
+
$ds-factbox__show-more-fade-height: 48px;
|
|
6
|
+
$ds-factbox__padding: ds-spacing-component(x4);
|
|
7
|
+
$ds-factbox__max-height: 500px - ($ds-factbox__padding * 2); // @todo verify max-height (this is current max-height in bang)
|
|
8
|
+
|
|
9
|
+
.ds-factbox {
|
|
10
|
+
background-color: $ds-color-surface-background;
|
|
11
|
+
padding: $ds-factbox__padding;
|
|
12
|
+
padding-left: $ds-factbox__padding - ds-metrics-border-width(x2);
|
|
13
|
+
padding-top: $ds-factbox__padding - ds-metrics-border-width(x1);
|
|
14
|
+
border-top: ds-metrics-border-width(x1) solid $ds-color-border-primary;
|
|
15
|
+
border-left: ds-metrics-border-width(x2) solid $ds-color-component-brand;
|
|
16
|
+
margin: ds-spacing-layout(
|
|
17
|
+
gap-vertical-static-medium 0 gap-vertical-static-large
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
.ds-factbox__inner {
|
|
21
|
+
max-height: ds-px-to-rem($ds-factbox__max-height);
|
|
22
|
+
overflow: hidden;
|
|
23
|
+
position: relative;
|
|
24
|
+
|
|
25
|
+
@at-root .ds-force-px#{&} {
|
|
26
|
+
max-height: $ds-factbox__max-height;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
&--expanded .ds-factbox__inner,
|
|
31
|
+
&--expanded.ds-force-px .ds-factbox__inner {
|
|
32
|
+
max-height: none;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.ds-factbox__body {
|
|
36
|
+
overflow: hidden;
|
|
37
|
+
@include ds-typography($ds-typography-functional-body02regular);
|
|
38
|
+
color: $ds-color-text-primary;
|
|
39
|
+
@at-root .ds-force-px#{&} {
|
|
40
|
+
@include ds-typography($ds-typography-functional-body02regular, true);
|
|
41
|
+
}
|
|
42
|
+
p {
|
|
43
|
+
margin: 0 0 ds-spacing-component(x4);
|
|
44
|
+
}
|
|
45
|
+
p:last-child {
|
|
46
|
+
margin-bottom: 0;
|
|
47
|
+
}
|
|
48
|
+
a {
|
|
49
|
+
@include ds-link($ds-link-article-body);
|
|
50
|
+
}
|
|
51
|
+
strong {
|
|
52
|
+
@include ds-typography($ds-typography-functional-body02medium);
|
|
53
|
+
@at-root .ds-force-px#{&} {
|
|
54
|
+
@include ds-typography($ds-typography-functional-body02medium, true);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
img {
|
|
58
|
+
max-width: 100%;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
.ds-factbox__title {
|
|
62
|
+
@include ds-typography($ds-typography-functional-heading01bold);
|
|
63
|
+
color: $ds-color-text-primary;
|
|
64
|
+
margin: 0 0 ds-spacing-component(x4);
|
|
65
|
+
@at-root .ds-force-px#{&} {
|
|
66
|
+
@include ds-typography($ds-typography-functional-heading01bold, true);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
.ds-factbox__vignette {
|
|
70
|
+
color: $ds-color-component-brand;
|
|
71
|
+
margin-right: ds-spacing-component(x1);
|
|
72
|
+
}
|
|
73
|
+
.ds-factbox__grades {
|
|
74
|
+
margin: 0 0 ds-spacing-component(x4);
|
|
75
|
+
display: flex;
|
|
76
|
+
}
|
|
77
|
+
.ds-factbox__grade {
|
|
78
|
+
display: inline-flex;
|
|
79
|
+
margin: ds-spacing-component(0 0 0 x1);
|
|
80
|
+
color: $ds-color-icon-primary;
|
|
81
|
+
width: ds-px-to-rem($ds-factbox__grade-size);
|
|
82
|
+
height: ds-px-to-rem($ds-factbox__grade-size);
|
|
83
|
+
&:not([data-active-grade]) {
|
|
84
|
+
opacity: $ds-opacity-component-disabled;
|
|
85
|
+
}
|
|
86
|
+
&:first-child {
|
|
87
|
+
margin: 0;
|
|
88
|
+
}
|
|
89
|
+
@at-root .ds-force-px#{&} {
|
|
90
|
+
width: $ds-factbox__grade-size;
|
|
91
|
+
height: $ds-factbox__grade-size;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
.ds-factbox__show-more--collapsable::before {
|
|
95
|
+
content: "";
|
|
96
|
+
background: $ds-color-gradient-content-fade-up;
|
|
97
|
+
height: ds-px-to-rem($ds-factbox__show-more-fade-height);
|
|
98
|
+
width: 100%;
|
|
99
|
+
position: absolute;
|
|
100
|
+
top: -#{ds-px-to-rem($ds-factbox__show-more-fade-height)};
|
|
101
|
+
|
|
102
|
+
@at-root .ds-force-px#{&} {
|
|
103
|
+
height: $ds-factbox__show-more-fade-height;
|
|
104
|
+
top: -#{$ds-factbox__show-more-fade-height};
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
.ds-factbox__show-more {
|
|
108
|
+
display: none;
|
|
109
|
+
}
|
|
110
|
+
.ds-factbox__show-more--collapsable {
|
|
111
|
+
background-color: $ds-color-surface-background;
|
|
112
|
+
width: 100%;
|
|
113
|
+
button {
|
|
114
|
+
margin: ds-spacing-component(x4 0 0);
|
|
115
|
+
}
|
|
116
|
+
&,
|
|
117
|
+
&:not([data-factbox-expanded]) .ds-factbox__expand-more,
|
|
118
|
+
&[data-factbox-expanded] .ds-factbox__expand-less {
|
|
119
|
+
display: block;
|
|
120
|
+
}
|
|
121
|
+
&:not([data-factbox-expanded]) .ds-factbox__expand-less,
|
|
122
|
+
&[data-factbox-expanded] .ds-factbox__expand-more,
|
|
123
|
+
&[data-factbox-expanded]::before {
|
|
124
|
+
display: none;
|
|
125
|
+
}
|
|
126
|
+
&:not([data-factbox-expanded]) {
|
|
127
|
+
position: absolute;
|
|
128
|
+
bottom: 0;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
&--culture {
|
|
133
|
+
border-left-color: $ds-color-static-kultur;
|
|
134
|
+
.ds-factbox__vignette {
|
|
135
|
+
color: $ds-color-static-kultur;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
&--sport {
|
|
139
|
+
border-left-color: $ds-color-static-sport;
|
|
140
|
+
.ds-factbox__vignette {
|
|
141
|
+
color: $ds-color-static-sport;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
&--economy {
|
|
145
|
+
border-left-color: $ds-color-static-economy;
|
|
146
|
+
.ds-factbox__vignette {
|
|
147
|
+
color: $ds-color-static-economy;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
@@ -25,7 +25,9 @@
|
|
|
25
25
|
|
|
26
26
|
@each $unit in $units {
|
|
27
27
|
$value: map.get($map, $unit);
|
|
28
|
-
@if ($unit ==
|
|
28
|
+
@if ($unit == "auto") {
|
|
29
|
+
$value: auto;
|
|
30
|
+
} @else if ($unit == 0) {
|
|
29
31
|
$value: 0 * 1;
|
|
30
32
|
} @else if ($value and type-of($value) == "number") {
|
|
31
33
|
@if ($sizeUnit == "rem") {
|
|
@@ -36,7 +38,7 @@
|
|
|
36
38
|
$value: $value * 1px;
|
|
37
39
|
}
|
|
38
40
|
}
|
|
39
|
-
@if (type-of($value) == "number") {
|
|
41
|
+
@if (type-of($value) == "number" or $value == "auto") {
|
|
40
42
|
$values: list.append($values, $value);
|
|
41
43
|
}
|
|
42
44
|
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{% macro GradeIcon(params) %}
|
|
2
|
+
{% set iconName = params.icon | lower %}
|
|
3
|
+
<i class="ds-icon ds-icon--grade-{{ iconName }}">
|
|
4
|
+
{% if iconName == "zero" %}
|
|
5
|
+
<svg viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M43 22C43 33.598 33.598 43 22 43C10.402 43 1 33.598 1 22C1 10.402 10.402 1 22 1C33.598 1 43 10.402 43 22ZM44 22C44 34.1503 34.1503 44 22 44C9.84974 44 0 34.1503 0 22C0 9.84974 9.84974 0 22 0C34.1503 0 44 9.84974 44 22ZM14.5 20.9719C14.5 15.4966 17.0479 12 21.3034 12C25.559 12 28.134 15.4966 28.134 20.9719C28.134 26.4471 25.559 29.9708 21.3034 29.9708C17.0479 29.9708 14.5 26.4471 14.5 20.9719ZM20.0295 27.8024C20.0295 28.8595 20.4632 29.4016 21.3034 29.4016C22.1708 29.4016 22.6045 28.8595 22.6045 27.8024V14.1684C22.6045 13.1113 22.1708 12.5963 21.3034 12.5963C20.4632 12.5963 20.0295 13.1113 20.0295 14.1684V27.8024ZM33.5 27.5043C33.5 29.1035 32.5513 29.9708 31.3587 29.9708C30.166 29.9708 29.2174 29.1035 29.2174 27.5043C29.2174 25.9321 30.166 25.0377 31.3587 25.0377C32.5513 25.0377 33.5 25.9321 33.5 27.5043Z"/></svg>
|
|
6
|
+
{% elif iconName == "one" %}
|
|
7
|
+
<svg viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M43 22C43 33.598 33.598 43 22 43C10.402 43 1 33.598 1 22C1 10.402 10.402 1 22 1C33.598 1 43 10.402 43 22ZM44 22C44 34.1503 34.1503 44 22 44C9.84974 44 0 34.1503 0 22C0 9.84974 9.84974 0 22 0C34.1503 0 44 9.84974 44 22ZM15 14.464C15 14.464 18.276 15.08 19.928 12H23.008V27.764C23.008 29.416 23.4 29.612 23.876 29.612H25.108V29.976H15.42V29.612H16.652C17.1 29.612 17.52 29.416 17.52 27.764V14.688C16.652 15.08 15 14.94 15 14.94V14.464ZM30.6448 28.016C30.6448 29.668 29.6648 30.564 28.4328 30.564C27.2008 30.564 26.2208 29.668 26.2208 28.016C26.2208 26.392 27.2008 25.468 28.4328 25.468C29.6648 25.468 30.6448 26.392 30.6448 28.016Z"/></svg>
|
|
8
|
+
{% elif iconName == "two" %}
|
|
9
|
+
<svg viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M43 22C43 33.598 33.598 43 22 43C10.402 43 1 33.598 1 22C1 10.402 10.402 1 22 1C33.598 1 43 10.402 43 22ZM44 22C44 34.1503 34.1503 44 22 44C9.84974 44 0 34.1503 0 22C0 9.84974 9.84974 0 22 0C34.1503 0 44 9.84974 44 22ZM24.452 25.356C24.956 25.356 26.16 24.852 26.16 22.892H26.496V30.312H13V29.668C13 29.668 17.9 25.244 19.776 22.584L19.8072 22.5376C20.0626 22.1588 20.756 21.1303 20.756 19.28V14.296C20.756 13.204 19.944 12.644 19.076 12.644C16.416 12.644 16.36 14.38 16.36 14.38C18.796 14.38 19.216 16.228 19.216 16.816C19.216 16.956 19.16 19.448 16.444 19.448C15.016 19.448 13.588 18.496 13.588 16.424C13.588 14.296 15.716 12 19.076 12C24.312 12 26.468 14.632 26.468 17.46C26.468 21.212 20.98 24.124 18.404 25.356H24.452ZM32.0529 28.016C32.0529 29.668 31.0729 30.564 29.8409 30.564C28.6089 30.564 27.6289 29.668 27.6289 28.016C27.6289 26.392 28.6089 25.468 29.8409 25.468C31.0729 25.468 32.0529 26.392 32.0529 28.016Z"/></svg>
|
|
10
|
+
{% elif iconName == "three" %}
|
|
11
|
+
<svg viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M43 22C43 33.598 33.598 43 22 43C10.402 43 1 33.598 1 22C1 10.402 10.402 1 22 1C33.598 1 43 10.402 43 22ZM44 22C44 34.1503 34.1503 44 22 44C9.84974 44 0 34.1503 0 22C0 9.84974 9.84974 0 22 0C34.1503 0 44 9.84974 44 22ZM26.236 16.368C26.236 18.636 24.388 19.532 22.876 19.896C26.012 20.708 27.188 22.724 27.188 24.908C27.188 27.736 25.032 30.564 19.796 30.564C15.736 30.564 14 28.268 14 26.14C14 24.068 15.456 23.116 16.884 23.116C19.6 23.116 19.628 25.608 19.628 25.72C19.628 26.336 19.236 28.184 16.8 28.184C16.8 28.184 16.436 29.92 19.796 29.92C20.664 29.92 21.476 29.36 21.476 28.268V22.052C21.476 20.932 20.776 20.344 19.908 20.344H18.172V19.756H19.936C21.4361 19.756 21.4273 17.8762 21.4208 16.4878C21.4204 16.399 21.42 16.3122 21.42 16.228V14.072C21.42 13.092 20.692 12.588 19.908 12.588C16.884 12.588 17.024 14.156 17.024 14.156C19.236 14.156 19.6 15.808 19.6 16.34C19.6 16.48 19.544 18.692 17.108 18.692C15.82 18.692 14.532 17.852 14.532 16.004C14.532 14.1 16.212 12.056 19.824 12C22.344 12 26.236 12.7 26.236 16.368ZM31.9592 28.016C31.9592 29.668 30.9792 30.564 29.7472 30.564C28.5152 30.564 27.5352 29.668 27.5352 28.016C27.5352 26.392 28.5152 25.468 29.7472 25.468C30.9792 25.468 31.9592 26.392 31.9592 28.016Z"/></svg>
|
|
12
|
+
{% elif iconName == "four" %}
|
|
13
|
+
<svg viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M43 22C43 33.598 33.598 43 22 43C10.402 43 1 33.598 1 22C1 10.402 10.402 1 22 1C33.598 1 43 10.402 43 22ZM44 22C44 34.1503 34.1503 44 22 44C9.84974 44 0 34.1503 0 22C0 9.84974 9.84974 0 22 0C34.1503 0 44 9.84974 44 22ZM24.844 28.128C24.844 29.78 25.264 29.948 25.712 29.948H26.944V30.312H17.256V29.948H18.488C18.964 29.948 19.356 29.78 19.356 28.128V26.336H13V25.412L20.56 12H24.844V25.188H27.112V26.336H24.844V28.128ZM19.356 15.276L13.84 25.188H19.356V15.276ZM32.6545 28.016C32.6545 29.668 31.6745 30.564 30.4425 30.564C29.2105 30.564 28.2305 29.668 28.2305 28.016C28.2305 26.392 29.2105 25.468 30.4425 25.468C31.6745 25.468 32.6545 26.392 32.6545 28.016Z"/></svg>
|
|
14
|
+
{% elif iconName == "five" %}
|
|
15
|
+
<svg viewBox="0 0 44 44" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M43 22C43 33.598 33.598 43 22 43C10.402 43 1 33.598 1 22C1 10.402 10.402 1 22 1C33.598 1 43 10.402 43 22ZM44 22C44 34.1503 34.1503 44 22 44C9.84974 44 0 34.1503 0 22C0 9.84974 9.84974 0 22 0C34.1503 0 44 9.84974 44 22ZM16.744 20.24C16.744 20.24 18.284 19.372 20.216 19.372C25.536 19.372 27.384 22.34 27.384 25.084C27.384 27.912 25.228 30.656 19.992 30.656C15.904 30.656 14 28.388 14 26.232C14 24.16 15.456 23.236 16.884 23.236C19.6 23.236 19.628 25.7 19.628 25.84C19.628 26.456 19.236 28.304 16.8 28.304C16.8 28.304 16.632 30.012 19.992 30.012C20.86 30.012 21.644 29.48 21.644 28.388V21.668C21.644 20.548 20.972 19.96 20.104 19.96L20.0703 19.9599C19.6886 19.9579 18.0658 19.9497 16.548 21.332L16.1 21.136L16.128 12.092H24.36C25.9 12.092 26.292 11 26.292 11L26.656 11.056L25.032 16.852H16.744V20.24ZM32.424 28.108C32.424 29.76 31.444 30.656 30.212 30.656C28.98 30.656 28 29.76 28 28.108C28 26.484 28.98 25.56 30.212 25.56C31.444 25.56 32.424 26.484 32.424 28.108Z"/></svg>
|
|
16
|
+
{% endif %}
|
|
17
|
+
</i>
|
|
18
|
+
{% endmacro %}
|
package/package.json
CHANGED