@bonniernews/dn-design-system-web 3.0.0-alpha.63 → 3.0.0-alpha.65

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 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
+ ## 3.0.0-alpha.65 (2023-05-24)
7
+
8
+
9
+ ### Features
10
+
11
+ * **web:** slideshow teaser ([#831](https://github.com/BonnierNews/dn-design-system/issues/831)) ([7ad7183](https://github.com/BonnierNews/dn-design-system/commit/7ad7183857d8cea9782e0997c25d3ae399f5f782))
12
+
13
+
14
+
15
+ ## 3.0.0-alpha.64 (2023-05-24)
16
+
17
+
18
+ ### Bug Fixes
19
+
20
+ * **web:** change byline images to be 156px wide ([#838](https://github.com/BonnierNews/dn-design-system/issues/838)) ([339c361](https://github.com/BonnierNews/dn-design-system/commit/339c361d78c2151e37d39a9a449db3e65245c184))
21
+
22
+
23
+
6
24
  ## [3.0.0-alpha.63](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@3.0.0-alpha.62...@bonniernews/dn-design-system-web@3.0.0-alpha.63) (2023-05-23)
7
25
 
8
26
  **Note:** Version bump only for package @bonniernews/dn-design-system-web
@@ -115,7 +115,7 @@
115
115
  }
116
116
 
117
117
  @include ds-mq-smallest-breakpoint(tablet) {
118
- width: 168px;
118
+ width: 156px;
119
119
  // En bylinebild bör va lika hög som en "grekisk byst" - man ska se lite skjortkrage!
120
120
  min-height: 110px;
121
121
  }
@@ -0,0 +1,42 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-slideshow](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-slideshow)
2
+ - Storybook (PROD): [TeaserSlideshow > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teaserslideshow-web)
3
+ - Storybook (LATEST): [TeaserSlideshow > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teaserslideshow-web)
4
+
5
+ ----
6
+
7
+ # teaser-slideshow
8
+
9
+ ## Parameters
10
+
11
+ |parameter | type | required | options | default | description |
12
+ |:--- | :--- | :--- | :--- | :--- | :--- |
13
+ |title | String | yes | | | Heading of the teaser |
14
+ |text | String | no | | | Teaser subtext |
15
+ |areaType | String | no | "right" or "bauta" or "bautaxl" | | The area where the column is rendered |
16
+ |theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme-class to apply to the teaser |
17
+ |mediaHtml | HTML String | no | | | Gallery html |
18
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
19
+ |classNames | String | no | | | Ex. "my-special-class" |
20
+ |~forcePx~ | | | | | Not supported |
21
+
22
+ NB: this component does not render a link. If a link element is desired, it needs to be inserted through the `mediaHtml` property.
23
+
24
+ ## Minimum requirement example
25
+
26
+ ### Nunjucks
27
+
28
+ These are copy paste friendly examples to quickliy get started using a component.
29
+
30
+ ```html
31
+ {% from '@bonniernews/dn-design-system-web/components/teaser-slideshow/teaser-slideshow.njk' import TeaserSlideshow %}
32
+
33
+ {{ TeaserSlideshow({
34
+ title: 'Nyårsafton 2023',
35
+ text: 'Kolla på alla fina bilder från festen!'
36
+ })}}
37
+ ```
38
+
39
+ ### SCSS
40
+ ```scss
41
+ @use "@bonniernews/dn-design-system-web/components/teaser-slideshow/teaser-slideshow" as *;
42
+ ```
@@ -0,0 +1,38 @@
1
+ {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
+
3
+ {% macro TeaserSlideshow(params) %}
4
+ {% set componentClassName = "ds-teaser" %}
5
+ {% set classNamePrefix = componentClassName + "--" %}
6
+ {% set additionalClasses = ["ds-teaser--slideshow"] %}
7
+ {% set attributes = getAttributes(params.attributes) %}
8
+
9
+ {% if params.theme %}
10
+ {% set additionalClasses = (additionalClasses.push('ds-theme--' + params.theme), additionalClasses) %}
11
+ {% endif %}
12
+
13
+ {% if params.areaType %}
14
+ {% set additionalClasses = (additionalClasses.push(classNamePrefix + params.areaType), additionalClasses) %}
15
+ {% endif %}
16
+
17
+ {% if params.classNames %}
18
+ {% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
19
+ {% endif%}
20
+
21
+ {% set classes = componentClassName + " " + additionalClasses | join(" ") %}
22
+
23
+ <div class="{{ classes }}" {{ attributes | safe }}>
24
+ <div class="{{ componentClassName + '__content'}}">
25
+ <h2 class="ds-teaser__title">
26
+ {{ params.title | safe }}
27
+ </h2>
28
+ {% if params.text %}
29
+ <span class="{{ componentClassName + '__text'}}">
30
+ {{ params.text | safe }}
31
+ </span>
32
+ {% endif %}
33
+ </div>
34
+ {% if params.mediaHtml %}
35
+ {{ params.mediaHtml }}
36
+ {% endif %}
37
+ </div>
38
+ {% endmacro %}
@@ -0,0 +1,35 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../assets/teaser/teaser.scss" as *;
3
+
4
+ .ds-teaser.ds-teaser--slideshow {
5
+ background-color: $ds-color-background-primary;
6
+ overflow: hidden;
7
+ max-height: 230px;
8
+ box-sizing: border-box;
9
+
10
+ &.ds-teaser--right {
11
+ max-width: 300px;
12
+ }
13
+
14
+ .ds-teaser__content {
15
+ @include ds-spacing-layout($ds-sl-teaser-vertical $ds-sl-teaser-horizontal);
16
+ display: block;
17
+ color: $ds-color-text-primary;
18
+
19
+ .ds-teaser__title {
20
+ display: inline;
21
+ @include ds-typography($ds-typography-functional-heading01bold);
22
+ }
23
+
24
+ .ds-teaser__text {
25
+ display: inline;
26
+ @include ds-typography($ds-typography-functional-heading01regular);
27
+ }
28
+ }
29
+
30
+ @include ds-hover {
31
+ &:hover .ds-teaser__title {
32
+ text-decoration: none;
33
+ }
34
+ }
35
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "3.0.0-alpha.63",
3
+ "version": "3.0.0-alpha.65",
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",