@bonniernews/dn-design-system-web 2.1.0-alpha.5 → 2.1.0-alpha.7

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,23 @@
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.7](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@2.1.0-alpha.6...@bonniernews/dn-design-system-web@2.1.0-alpha.7) (2023-02-20)
7
+
8
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
9
+
10
+
11
+
12
+
13
+
14
+ ## [2.1.0-alpha.6](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@2.1.0-alpha.5...@bonniernews/dn-design-system-web@2.1.0-alpha.6) (2023-02-20)
15
+
16
+
17
+ ### Features
18
+
19
+ * **web:** quote component for web ([#675](https://github.com/BonnierNews/dn-design-system/issues/675)) ([599c7d9](https://github.com/BonnierNews/dn-design-system/commit/599c7d9012b7a9677c31b42196189c6b8bba04e3))
20
+
21
+
22
+
6
23
  ## [2.1.0-alpha.5](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@2.1.0-alpha.4...@bonniernews/dn-design-system-web@2.1.0-alpha.5) (2023-02-20)
7
24
 
8
25
 
@@ -0,0 +1,36 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/quote](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/quote)
2
+ - Storybook: [Quote > Web](https://designsystem.dn.se/?path=/story/components-app-web-quote-web)
3
+
4
+ ----
5
+
6
+ # Quote
7
+
8
+ ## Parameters
9
+
10
+ |parameter | type | required | options | default | description |
11
+ |:--- | :--- | :--- | :--- | :--- | :--- |
12
+ |bodyHtml | HTML String | yes | | | |
13
+ |variant | String | no | standard, culture, sport, economy | standard | Design variant |
14
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
15
+ |classNames | String | no | | | Ex. "my-special-class" |
16
+ |forcePx | bool | no | true, false | false | Fixed pixel value is used for typography to prevent scaling based on html font-size |
17
+
18
+ ## Minimum requirement example
19
+
20
+ ### Nunjucks
21
+
22
+ These are copy paste friendly examples to quickliy get started using a component.
23
+
24
+ ```html
25
+ {% from '@bonniernews/dn-design-system-web/components/quote/quote.njk' import Quote %}
26
+
27
+ {{ Quote({
28
+ variant: "culture",
29
+ bodyHtml: ""
30
+ })}}
31
+ ```
32
+
33
+ ### SCSS
34
+ ```scss
35
+ @use "@bonniernews/dn-design-system-web/components/quote/quote";
36
+ ```
@@ -0,0 +1,29 @@
1
+ {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
+
3
+ {% macro Quote(params) %}
4
+ {% set componentClassName = "ds-quote" %}
5
+ {% set classNamePrefix = componentClassName + "--" %}
6
+ {% set variant = [] %}
7
+ {% set attributes = getAttributes(params.attributes) %}
8
+
9
+ {% if params.forcePx %}
10
+ {% set variant = (variant.push("ds-force-px"), variant) %}
11
+ {% endif %}
12
+
13
+ {% if params.variant %}
14
+ {% set variant = (variant.push(classNamePrefix + params.variant), variant) %}
15
+ {% else %}
16
+ {% set variant = (variant.push(classNamePrefix + "standard"), variant) %}
17
+ {% endif %}
18
+
19
+ {% if params.classNames %}
20
+ {% set variant = (variant.push(params.classNames), variant) %}
21
+ {% endif%}
22
+
23
+ {% set classes = componentClassName + " " + variant | join(" ") %}
24
+
25
+ <blockquote class="{{ classes }}" {{- attributes | safe }}>
26
+ <span class="{{ componentClassName + '__border'}}"></span>
27
+ {{ params.bodyHtml | safe }}
28
+ </blockquote>
29
+ {% endmacro %}
@@ -0,0 +1,33 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+
3
+ .ds-quote {
4
+ @include ds-typography($ds-typography-expressive-heading03bold);
5
+ color: $ds-color-text-primary;
6
+ margin: ds-spacing-layout(
7
+ gap-vertical-static-medium 0 gap-vertical-static-large
8
+ );
9
+ position: relative;
10
+
11
+ @at-root .ds-force-px#{&} {
12
+ @include ds-typography($ds-typography-expressive-heading03bold, true);
13
+ }
14
+
15
+ .ds-quote__border {
16
+ display: block;
17
+ width: 40px;
18
+ height: 8px;
19
+ color: $ds-color-component-brand;
20
+ background: currentColor;
21
+ margin: ds-spacing-component(0 0 x2);
22
+ }
23
+
24
+ &--culture .ds-quote__border {
25
+ color: $ds-color-static-kultur;
26
+ }
27
+ &--sport .ds-quote__border {
28
+ color: $ds-color-static-sport;
29
+ }
30
+ &--economy .ds-quote__border {
31
+ color: $ds-color-static-economy;
32
+ }
33
+ }
@@ -1,5 +1,5 @@
1
1
  - GitHub: [BonnierNews/dn-design-system/../web/src/components/thematic-break](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/thematic-break)
2
- - Storybook: [ThematicBreak > Web](https://designsystem.dn.se/?path=/story/components-app-web-thematicbreak-web)
2
+ - Storybook: [ThematicBreak > Web](https://designsystem.dn.se/?path=/story/components-app-web-article-components-thematicbreak-web--thematic-break)
3
3
 
4
4
  ----
5
5
 
@@ -1,16 +1,14 @@
1
+ {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
+
1
3
  {% macro ThematicBreak(params) %}
2
4
  {% set componentClassName = "ds-thematic-break" %}
3
5
  {% set additionalClasses = [] %}
4
- {% set attributes %}
5
- {% for attribute, value in params.attributes %}
6
- {{attribute}}="{{value}}"
7
- {% endfor %}
8
- {% endset %}
6
+ {% set attributes = getAttributes(params.attributes) %}
9
7
 
10
8
  {% if params.classNames %}
11
9
  {% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
12
10
  {% endif%}
13
11
 
14
12
  {% set classes = componentClassName + " " + additionalClasses | join(" ") %}
15
- <hr class="{{ classes }}" {{- attributes | safe }}></hr>
13
+ <hr class="{{ classes }}" {{- attributes | safe }}>
16
14
  {% endmacro %}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "2.1.0-alpha.5",
3
+ "version": "2.1.0-alpha.7",
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",