@bonniernews/dn-design-system-web 2.1.0-alpha.4 → 2.1.0-alpha.6

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
+ ## [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)
7
+
8
+
9
+ ### Features
10
+
11
+ * **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))
12
+
13
+
14
+
15
+ ## [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)
16
+
17
+
18
+ ### Features
19
+
20
+ * **web:** thematic break ([#673](https://github.com/BonnierNews/dn-design-system/issues/673)) ([6a48aac](https://github.com/BonnierNews/dn-design-system/commit/6a48aac61f29243afcc5980f6e4ba70e3ee7b1c1))
21
+
22
+
23
+
6
24
  ## [2.1.0-alpha.4](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@2.1.0-alpha.3...@bonniernews/dn-design-system-web@2.1.0-alpha.4) (2023-02-20)
7
25
 
8
26
 
@@ -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
+ }
@@ -0,0 +1,30 @@
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)
3
+
4
+ ----
5
+
6
+ # ThematicBreak
7
+
8
+ ## Parameters
9
+
10
+ |parameter | type | required | options | default | description |
11
+ |:--- | :--- | :--- | :--- | :--- | :--- |
12
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
13
+ |classNames | String | no | | | Ex. "my-special-class" |
14
+
15
+ ## Minimum requirement example
16
+
17
+ ### Nunjucks
18
+
19
+ These are copy paste friendly examples to quickliy get started using a component.
20
+
21
+ ```html
22
+ {% from '@bonniernews/dn-design-system-web/components/thematic-break/thematic-break.njk' import ThematicBreak %}
23
+
24
+ {{ ThematicBreak() }}
25
+ ```
26
+
27
+ ### SCSS
28
+ ```scss
29
+ @use "@bonniernews/dn-design-system-web/components/thematic-break/thematic-break";
30
+ ```
@@ -0,0 +1,16 @@
1
+ {% macro ThematicBreak(params) %}
2
+ {% set componentClassName = "ds-thematic-break" %}
3
+ {% set additionalClasses = [] %}
4
+ {% set attributes %}
5
+ {% for attribute, value in params.attributes %}
6
+ {{attribute}}="{{value}}"
7
+ {% endfor %}
8
+ {% endset %}
9
+
10
+ {% if params.classNames %}
11
+ {% set additionalClasses = (additionalClasses.push(params.classNames), additionalClasses) %}
12
+ {% endif%}
13
+
14
+ {% set classes = componentClassName + " " + additionalClasses | join(" ") %}
15
+ <hr class="{{ classes }}" {{- attributes | safe }}></hr>
16
+ {% endmacro %}
@@ -0,0 +1,10 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+
3
+ .ds-thematic-break {
4
+ width: 128px;
5
+ height: 4px;
6
+ margin: ds-spacing-layout(gap-vertical-static-medium) auto
7
+ ds-spacing-layout(gap-vertical-static-large);
8
+ background-color: $ds-color-border-primary;
9
+ border: none;
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "2.1.0-alpha.4",
3
+ "version": "2.1.0-alpha.6",
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",