@bonniernews/dn-design-system-web 3.0.0-alpha.40 → 3.0.0-alpha.42

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,29 @@
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.42](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@3.0.0-alpha.41...@bonniernews/dn-design-system-web@3.0.0-alpha.42) (2023-05-03)
7
+
8
+
9
+ ### Features
10
+
11
+ * **web:** onsite teaser - dn på plats ([#783](https://github.com/BonnierNews/dn-design-system/issues/783)) ([42603af](https://github.com/BonnierNews/dn-design-system/commit/42603af21bd6511f858f2b7acc889067584cbf93))
12
+
13
+
14
+
15
+ ## [3.0.0-alpha.41](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@3.0.0-alpha.40...@bonniernews/dn-design-system-web@3.0.0-alpha.41) (2023-05-03)
16
+
17
+
18
+ ### Features
19
+
20
+ * **web:** tipsa teaser ([#780](https://github.com/BonnierNews/dn-design-system/issues/780)) ([cb2a263](https://github.com/BonnierNews/dn-design-system/commit/cb2a2636cdbc823f8584133b27a6730e9eddb973))
21
+
22
+
23
+ ### Bug Fixes
24
+
25
+ * **web:** teaserLarge should check params.targetId ([#789](https://github.com/BonnierNews/dn-design-system/issues/789)) ([4ea1838](https://github.com/BonnierNews/dn-design-system/commit/4ea18388286217e9171f1a851c3dad65c1eace0f))
26
+
27
+
28
+
6
29
  ## 3.0.0-alpha.40 (2023-05-03)
7
30
 
8
31
 
@@ -33,7 +33,7 @@
33
33
 
34
34
  <a href="{{ params.targetLink }}"
35
35
  class="{{ classes }}"
36
- {% if targetId %} data-id="{{ params.targetId }}" {% endif %}
36
+ {% if params.targetId %} data-id="{{ params.targetId }}" {% endif %}
37
37
  {{- attributes | safe }}>
38
38
 
39
39
  {% if params.mediaHtml %}
@@ -0,0 +1,45 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-onsite](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-onsite)
2
+ - Storybook (PROD): [TeaserOnSite > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teaseronsite-web)
3
+ - Storybook (LATEST): [TeaserOnSite > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teaseronsite-web)
4
+
5
+ ----
6
+
7
+ # teaser-onsite
8
+
9
+ Also known as "På Plats-puffen".
10
+
11
+ In the CMS title will be set to a location like "Kiev, Ukraina" or "USA" and text is usually set to some author names like "Jan Banan och Kalle Kula"
12
+
13
+ ## Parameters
14
+
15
+ |parameter | type | required | options | default | description |
16
+ |:--- | :--- | :--- | :--- | :--- | :--- |
17
+ |title | String | yes | | | Heading of the teaser |
18
+ |targetLink | String | yes | | | Target URL for the teaser |
19
+ |targetId | String | no | | | Target article ID |
20
+ |theme | String | no | nyheter, kultur, ekonomi, sport, sthlm | (empty) | The theme-class to apply to the teaser |
21
+ |text | String | no | | | Teaser subtext |
22
+ |mediaHtml | HTML String | no | | | Main image or other media |
23
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
24
+ |classNames | String | no | | | Ex. "my-special-class" |
25
+ |~forcePx~ | | | | | Not supported |
26
+
27
+ ## Minimum requirement example
28
+
29
+ ### Nunjucks
30
+
31
+ These are copy paste friendly examples to quickliy get started using a component.
32
+
33
+ ```html
34
+ {% from '@bonniernews/dn-design-system-web/components/teaser-onsite/teaser-onsite.njk' import TeaserOnSite %}
35
+
36
+ {{ TeaserOnSite({
37
+ title: 'Kiev, Ukraina',
38
+ text: 'Henrik Brandão Jönsson och Eduardo Leal'
39
+ })}}
40
+ ```
41
+
42
+ ### SCSS
43
+ ```scss
44
+ @use "@bonniernews/dn-design-system-web/components/teaser-onsite/teaser-onsite" as *;
45
+ ```
@@ -0,0 +1,42 @@
1
+ {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
+
3
+ {% macro TeaserOnSite(params) %}
4
+ {% set componentClassName = "ds-teaser" %}
5
+ {% set classNamePrefix = componentClassName + "--" %}
6
+ {% set additionalClasses = ["ds-teaser--onsite"] %}
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.classNames %}
14
+ {% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
15
+ {% endif%}
16
+
17
+ {% set classes = componentClassName + " " + additionalClasses | join(" ") %}
18
+
19
+ <a href="{{ params.targetLink }}"
20
+ class="{{ classes }}"
21
+ {% if targetId %} data-id="{{ params.targetId }}" {% endif %}
22
+ {{- attributes | safe }}>
23
+
24
+ {% if params.mediaHtml %}
25
+ <div class="{{ componentClassName + '__media'}}">
26
+ {{ params.mediaHtml }}
27
+ </div>
28
+ {% endif %}
29
+
30
+ <div class="{{ componentClassName + '__content'}}">
31
+ <h2 class="ds-teaser__title">
32
+ DN PÅ PLATS {{ params.title | safe }}
33
+ </h2>
34
+
35
+ {% if params.text %}
36
+ <p class="{{ componentClassName + '__text'}}">
37
+ {{ params.text | safe }}
38
+ </p>
39
+ {% endif %}
40
+ </div>
41
+ </a>
42
+ {% endmacro %}
@@ -0,0 +1,29 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../assets/teaser/teaser.scss" as *;
3
+
4
+ .ds-teaser.ds-teaser--onsite {
5
+ @include ds-spacing-layout($ds-sl-teaser-vertical $ds-sl-teaser-horizontal);
6
+ background-image: var(
7
+ --ds-onsite-background-image-url
8
+ ); //Set by parent context (like Storybook or Bang)
9
+ background-position: 100%;
10
+ background-repeat: no-repeat;
11
+ overflow: hidden;
12
+
13
+ .ds-teaser__title {
14
+ color: $ds-theme-color;
15
+ @include ds-typography($ds-typography-detailarticle-label);
16
+ }
17
+
18
+ .ds-teaser__text {
19
+ margin-top: 0;
20
+ @include ds-typography($ds-typography-functional-heading01bold);
21
+ }
22
+
23
+ .ds-teaser__media {
24
+ float: left;
25
+ margin-right: ds-spacing-component($ds-sc-x4);
26
+ width: 56px;
27
+ height: 56px;
28
+ }
29
+ }
@@ -1,7 +1,7 @@
1
1
  @use "../../foundations/helpers/forward.helpers.scss" as *;
2
2
  @use "../../assets/teaser/teaser.scss" as *;
3
3
 
4
- .ds-teaser--standard {
4
+ .ds-teaser.ds-teaser--standard {
5
5
  display: flex;
6
6
 
7
7
  @include ds-spacing-layout($ds-sl-teaser-vertical $ds-sl-teaser-horizontal);
@@ -0,0 +1,40 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/teaser-tipsa](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/teaser-tipsa)
2
+ - Storybook (PROD): [TeaserTipsa > Web](https://designsystem.dn.se/?path=/story/components-app-web-section-components-teasertipsa-web)
3
+ - Storybook (LATEST): [TeaserTipsa > Web](https://designsystem-latest.dn.se/?path=/story/components-app-web-section-components-teasertipsa-web)
4
+
5
+ ----
6
+
7
+ # teaser-tipsa
8
+
9
+ It's quite common to include a dot in the title string, like "• This is a title"
10
+
11
+ ## Parameters
12
+
13
+ |parameter | type | required | options | default | description |
14
+ |:--- | :--- | :--- | :--- | :--- | :--- |
15
+ |title | String | yes | | | Heading of the teaser |
16
+ |targetLink | String | yes | | | Target URL for the teaser |
17
+ |targetId | String | no | | | Target article ID |
18
+ |text | String | no | | | Teaser subtext |
19
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
20
+ |classNames | String | no | | | Ex. "my-special-class" |
21
+ |~forcePx~ | | | | | Not supported |
22
+
23
+ ## Minimum requirement example
24
+
25
+ ### Nunjucks
26
+
27
+ These are copy paste friendly examples to quickliy get started using a component.
28
+
29
+ ```html
30
+ {% from '@bonniernews/dn-design-system-web/components/teaser-tipsa/teaser-tipsa.njk' import TeaserTipsa %}
31
+
32
+ {{ TeaserTipsa({
33
+ title: "• Jessie Ware låter den fullödiga fullängdaren vänta på sig",
34
+ })}}
35
+ ```
36
+
37
+ ### SCSS
38
+ ```scss
39
+ @use "@bonniernews/dn-design-system-web/components/teaser-tipsa/teaser-tipsa" as *;
40
+ ```
@@ -0,0 +1,32 @@
1
+ {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
+
3
+ {% macro TeaserTipsa(params) %}
4
+ {% set componentClassName = "ds-teaser" %}
5
+ {% set classNamePrefix = componentClassName + "--" %}
6
+ {% set additionalClasses = ["ds-teaser--tipsa"] %}
7
+ {% set attributes = getAttributes(params.attributes) %}
8
+
9
+ {% if params.classNames %}
10
+ {% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
11
+ {% endif%}
12
+
13
+ {% set classes = componentClassName + " " + additionalClasses | join(" ") %}
14
+
15
+ <a href="{{ params.targetLink }}"
16
+ class="{{ classes }}"
17
+ {% if targetId %} data-id="{{ params.targetId }}" {% endif %}
18
+ {{- attributes | safe }}>
19
+
20
+ <div class="{{ componentClassName + '__content'}}">
21
+ <h2 class="ds-teaser__title">
22
+ {{ params.title | safe }}
23
+ </h2>
24
+
25
+ {% if params.text %}
26
+ <p class="{{ componentClassName + '__text'}}">
27
+ {{ params.text | safe }}
28
+ </p>
29
+ {% endif %}
30
+ </div>
31
+ </a>
32
+ {% endmacro %}
@@ -0,0 +1,17 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../assets/teaser/teaser.scss" as *;
3
+
4
+ .ds-teaser.ds-teaser--tipsa {
5
+ .ds-teaser__content {
6
+ @include ds-spacing-layout($ds-sl-teaser-vertical $ds-sl-teaser-horizontal);
7
+ }
8
+
9
+ .ds-teaser__title {
10
+ @include ds-typography($ds-typography-expressive-heading01bold);
11
+ }
12
+
13
+ .ds-teaser__text {
14
+ margin-top: 0;
15
+ @include ds-typography($ds-typography-functional-body02regular);
16
+ }
17
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "3.0.0-alpha.40",
3
+ "version": "3.0.0-alpha.42",
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",