@bonniernews/dn-design-system-web 8.7.0 → 8.8.1-beta.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/.release-it.js ADDED
@@ -0,0 +1,39 @@
1
+ const version = '${version}';
2
+ const packageName = process.env.npm_package_name;
3
+
4
+ module.exports = {
5
+ plugins: {
6
+ '@release-it/conventional-changelog': {
7
+ path: '.',
8
+ infile: 'CHANGELOG.md',
9
+ header: `# Changelog\n\nAll changes to @bonniernews/dn-design-system-web will be documented in this file.\n\n`,
10
+ preset: {
11
+ name: 'conventionalcommits',
12
+ types: [
13
+ { type: "feat", "section": "Features" },
14
+ { type: "fix", "section": "Bug Fixes" },
15
+ { type: "chore", "section": "Maintenance", "hidden": false },
16
+ { type: "docs", "section": "Maintenance", "hidden": false },
17
+ { type: "style", "section": "Maintenance", "hidden": false },
18
+ { type: "refactor", "section": "Maintenance", "hidden": false },
19
+ { type: "perf", "section": "Maintenance", "hidden": false },
20
+ { type: "test", "section": "Maintenance", "hidden": false }
21
+ ]
22
+ },
23
+ },
24
+ },
25
+ git: {
26
+ push: true,
27
+ tagName: `@bonniernews/dn-design-system-web@${version}`,
28
+ commitsPath: '.',
29
+ commitMessage: `chore(web): released version v${version}`,
30
+ requireCommits: false
31
+ },
32
+ github: {
33
+ "tokenRef": "GITHUB_TOKEN"
34
+ },
35
+ npm: {
36
+ publish: false,
37
+ versionArgs: ['--workspaces false'],
38
+ }
39
+ };
package/CHANGELOG.md CHANGED
@@ -1,68 +1,75 @@
1
- # Change Log
1
+ # Changelog
2
2
 
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
3
+ All changes to @bonniernews/dn-design-system-web will be documented in this file.
5
4
 
6
- ## 8.7.0 (2023-11-24)
7
5
 
8
6
 
9
- ### Features
7
+ ## [8.8.1-beta.6](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@8.8.1-beta.5...@bonniernews/dn-design-system-web@8.8.1-beta.6) (2023-11-29)
10
8
 
11
- * **web:** add Direkt circle as DS component and use it in new group header variant "Direkt" ([#1112](https://github.com/BonnierNews/dn-design-system/issues/1112)) ([a0e6f8b](https://github.com/BonnierNews/dn-design-system/commit/a0e6f8b765b270bf6b0708a034b323809abc6266))
9
+ ## [8.8.1-beta.5](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@8.8.1-beta.4...@bonniernews/dn-design-system-web@8.8.1-beta.5) (2023-11-29)
12
10
 
11
+ ## [8.8.1-beta.4](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@8.8.1-beta.3...@bonniernews/dn-design-system-web@8.8.1-beta.4) (2023-11-29)
13
12
 
13
+ ## [8.8.1-beta.3](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@8.8.1-beta.2...@bonniernews/dn-design-system-web@8.8.1-beta.3) (2023-11-29)
14
14
 
15
- ## 8.6.1 (2023-11-23)
16
15
 
17
- **Note:** Version bump only for package @bonniernews/dn-design-system-web
16
+ ### Maintenance
18
17
 
18
+ * **web:** release it config 13? ([1cd1ca5](https://github.com/BonnierNews/dn-design-system/commit/1cd1ca5e7e3d3c678228216ee2ae4fe3e4f91aa0))
19
19
 
20
+ ## [8.8.1-beta.2](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@8.8.1-beta.1...@bonniernews/dn-design-system-web@8.8.1-beta.2) (2023-11-28)
20
21
 
22
+ ## [8.8.1-beta.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@8.8.1-beta.0...@bonniernews/dn-design-system-web@8.8.1-beta.1) (2023-11-28)
21
23
 
22
-
23
- ## 8.6.0 (2023-11-22)
24
+ ## [8.8.1-beta.0](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@8.8.0...@bonniernews/dn-design-system-web@8.8.1-beta.0) (2023-11-28)
24
25
 
25
26
 
26
- ### Features
27
+ ### Maintenance
27
28
 
28
- * **web:** add quiz header component ([#1102](https://github.com/BonnierNews/dn-design-system/issues/1102)) ([4f8b2f2](https://github.com/BonnierNews/dn-design-system/commit/4f8b2f2e1d9c7987ed0291645d5c4595d2332007))
29
+ * **web:** release it config ([082d6f5](https://github.com/BonnierNews/dn-design-system/commit/082d6f55140bd53a866b933ae822afc5dcc92b4e))
29
30
 
31
+ ## 8.8.0 (2023-11-27)
30
32
 
33
+ ### Features
31
34
 
32
- ## 8.5.0 (2023-11-22)
35
+ * **web:** link box component ([#1115](https://github.com/BonnierNews/dn-design-system/issues/1115)) ([e062369](https://github.com/BonnierNews/dn-design-system/commit/e0623692ab5292d96c83cae29c0b60eb138926f5))
33
36
 
37
+ ## 8.7.0 (2023-11-24)
34
38
 
35
39
  ### Features
36
40
 
37
- * **web:** implement compact version of standard teaser ([#1100](https://github.com/BonnierNews/dn-design-system/issues/1100)) ([8c66b69](https://github.com/BonnierNews/dn-design-system/commit/8c66b695c7f2fac54bfdd819a62fc8014b30ce83))
41
+ * **web:** add Direkt circle as DS component and use it in new group header variant "Direkt" ([#1112](https://github.com/BonnierNews/dn-design-system/issues/1112)) ([a0e6f8b](https://github.com/BonnierNews/dn-design-system/commit/a0e6f8b765b270bf6b0708a034b323809abc6266))
38
42
 
43
+ ## 8.6.1 (2023-11-23)
39
44
 
45
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
40
46
 
41
- ## 8.4.6 (2023-11-21)
47
+ ## 8.6.0 (2023-11-22)
42
48
 
43
- **Note:** Version bump only for package @bonniernews/dn-design-system-web
49
+ ### Features
44
50
 
51
+ * **web:** add quiz header component ([#1102](https://github.com/BonnierNews/dn-design-system/issues/1102)) ([4f8b2f2](https://github.com/BonnierNews/dn-design-system/commit/4f8b2f2e1d9c7987ed0291645d5c4595d2332007))
45
52
 
53
+ ## 8.5.0 (2023-11-22)
46
54
 
55
+ ### Features
47
56
 
57
+ * **web:** implement compact version of standard teaser ([#1100](https://github.com/BonnierNews/dn-design-system/issues/1100)) ([8c66b69](https://github.com/BonnierNews/dn-design-system/commit/8c66b695c7f2fac54bfdd819a62fc8014b30ce83))
48
58
 
49
- ## 8.4.5 (2023-11-20)
59
+ ## 8.4.6 (2023-11-21)
50
60
 
61
+ **Note:** Version bump only for package @bonniernews/dn-design-system-web
62
+
63
+ ## 8.4.5 (2023-11-20)
51
64
 
52
65
  ### Bug Fixes
53
66
 
54
67
  * **web:** remove bumped fonts ([#1109](https://github.com/BonnierNews/dn-design-system/issues/1109)) ([1a5b50a](https://github.com/BonnierNews/dn-design-system/commit/1a5b50a8e3df4732e029fd4ca0fd24287cc7e98b))
55
68
 
56
-
57
-
58
69
  ## 8.4.4 (2023-11-20)
59
70
 
60
71
  **Note:** Version bump only for package @bonniernews/dn-design-system-web
61
72
 
62
-
63
-
64
-
65
-
66
73
  ## 8.4.3 (2023-11-20)
67
74
 
68
75
 
@@ -318,7 +325,7 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
318
325
 
319
326
  ### ⚠ BREAKING CHANGES
320
327
 
321
- * **web:** Fonts now depend on css variables, if you do not load the base file it's required to load the file cssVariables.scss. This file replaces colors.scss and shadows.scss.
328
+ * **web:** Fonts now depend on css variables, if you do not load the base file it's required to load the file cssVariables.scss. This file replaces colors.scss and shadows.scss.
322
329
 
323
330
  ### Code Refactoring
324
331
 
@@ -0,0 +1,41 @@
1
+ - GitHub: [BonnierNews/dn-design-system/../web/src/components/link-box](https://github.com/BonnierNews/dn-design-system/tree/main/web/src/components/link-box)
2
+ - Storybook: [LinkBox](https://designsystem.dn.se/?path=/docs/section-linkbox--docs)
3
+ - Storybook (Latest): [LinkBox](https://designsystem-latest.dn.se/?path=/docs/section-linkbox--docs)
4
+
5
+ ----
6
+
7
+ # link-box
8
+
9
+ ## Parameters
10
+
11
+ |parameter | type | required | options | default | description |
12
+ |:--- | :--- | :--- | :--- | :--- | :--- |
13
+ |linkBoxItems | Array | yes | | | Array with link objects. Ex. [ { label: 'Sverige runt', link: '#', mediaHtml: "", layout: 'quiz', attributes: { "data-test": "list-item-test-data" } } ] |
14
+ |vignetteText | String | no | | | Heading of the link box |
15
+ |vignetteTargetUrl | String | no | | | Target URL for the header |
16
+ |attributes | Object | no | | | Ex. { target: "_blank", "data-test": "lorem ipsum" } |
17
+ |classNames | String | no | | | Ex. "my-special-class" |
18
+ |~forcePx~ | | | | | Not supported |
19
+
20
+ ## Minimum requirement example
21
+
22
+ ### Nunjucks
23
+
24
+ These are copy paste friendly examples to quickliy get started using a component.
25
+
26
+ ```html
27
+ {% from '@bonniernews/dn-design-system-web/components/link-box/link-box.njk' import LinkBox %}
28
+
29
+ {{ LinkBox({
30
+ vignetteText: "Välj kategori – massor av quiz väntar",
31
+ linkBoxItems: [
32
+ { label: 'Sverige runt', link: '#', mediaHtml: "", layout: 'quiz', attributes: { "data-test": "list-item-test-data" } },
33
+ { label: 'Film & TV', link: '#', mediaHtml: "", layout: 'quiz' }
34
+ ],
35
+ })}}
36
+ ```
37
+
38
+ ### SCSS
39
+ ```scss
40
+ @use "@bonniernews/dn-design-system-web/components/link-box/link-box" as *;
41
+ ```
@@ -0,0 +1,23 @@
1
+ {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
+
3
+ {% macro LinkBoxItem(params) %}
4
+ {% set componentClassName = "ds-link-box-item" %}
5
+ {% set classNamePrefix = componentClassName + "--" %}
6
+ {%- set classes = [
7
+ componentClassName,
8
+ params.classNames if params.classNames,
9
+ classNamePrefix + params.layout if params.layout
10
+ ] | join(" ") %}
11
+ {%- set attributes = getAttributes(params.attributes) %}
12
+ <a class="{{ classes }}" href="{{ params.link }}" {{- attributes | safe }}>
13
+ {% if params.mediaHtml %}
14
+ <div class="{{ componentClassName + '__media'}}">
15
+ {{ params.mediaHtml | safe }}
16
+ </div>
17
+ {% endif %}
18
+
19
+ {% if params.label %}
20
+ <span class="{{ componentClassName + '__label'}}">{{ params.label }}</span>
21
+ {% endif %}
22
+ </a>
23
+ {% endmacro %}
@@ -0,0 +1,51 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+
3
+ .ds-link-box-item {
4
+ padding: ds-spacing($ds-s-100);
5
+ background-color: $ds-color-surface-background;
6
+ border: ds-border-width(x1) solid $ds-color-border-primary;
7
+ border-radius: ds-border-radius(x2);
8
+ text-decoration: none;
9
+ display: flex;
10
+ flex-direction: column;
11
+ align-items: center;
12
+ justify-content: center;
13
+
14
+ &:focus-visible {
15
+ outline: none;
16
+
17
+ .ds-link-box-item__label {
18
+ @include ds-focus(2px, false);
19
+ }
20
+ }
21
+
22
+ @include ds-hover(true) {
23
+ > .ds-link-box-item__label {
24
+ @include ds-underline();
25
+ }
26
+ }
27
+
28
+ .ds-link-box-item__label {
29
+ color: $ds-color-text-primary;
30
+ @include ds-typography($ds-typography-functional-body01semibold);
31
+ text-align: center;
32
+ }
33
+
34
+ .ds-link-box-item__media + .ds-link-box-item__label {
35
+ margin-top: ds-spacing($ds-s-050);
36
+ }
37
+
38
+ .ds-link-box-item__media {
39
+ font-size: 0;
40
+ }
41
+
42
+ // Just sample css, replace with actual when design is available
43
+ &.ds-link-box-item--pod {
44
+ .ds-link-box-item__media {
45
+ &,
46
+ & img {
47
+ width: 100%;
48
+ }
49
+ }
50
+ }
51
+ }
@@ -0,0 +1,26 @@
1
+ {% from '@bonniernews/dn-design-system-web/njk-helpers/attributes.njk' import getAttributes %}
2
+ {% from '@bonniernews/dn-design-system-web/components/group-header/group-header.njk' import GroupHeader %}
3
+ {% from '@bonniernews/dn-design-system-web/components/link-box/link-box-item.njk' import LinkBoxItem %}
4
+
5
+ {% macro LinkBox(params) %}
6
+ {%- set componentClassName = "ds-link-box" %}
7
+ {%- set classNamePrefix = componentClassName + "--" %}
8
+ {%- set classes = [
9
+ componentClassName,
10
+ params.classNames if params.classNames
11
+ ] | join(" ") %}
12
+ {%- set attributes = getAttributes(params.attributes) %}
13
+ <div class="{{ classes }}" {{- attributes | safe }}>
14
+ {% if params.vignetteText %}
15
+ {{ GroupHeader({
16
+ title: params.vignetteText,
17
+ href: params.vignetteTargetUrl
18
+ }) }}
19
+ {% endif %}
20
+ <div class="{{ componentClassName + '__grid' }}">
21
+ {% for item in params.linkBoxItems %}
22
+ {{ LinkBoxItem(item) | safe }}
23
+ {% endfor %}
24
+ </div>
25
+ </div>
26
+ {% endmacro %}
@@ -0,0 +1,32 @@
1
+ @use "../../foundations/helpers/forward.helpers.scss" as *;
2
+ @use "../../components/group-header/group-header";
3
+ @use "./link-box-item";
4
+
5
+ $ds-link-box-grid-gap: ds-spacing($ds-s-050);
6
+
7
+ .ds-link-box {
8
+ background-color: $ds-color-surface-background;
9
+
10
+ .ds-link-box__grid {
11
+ padding: ds-spacing($ds-s-075);
12
+ display: grid;
13
+ grid-column-gap: $ds-link-box-grid-gap;
14
+ row-gap: $ds-link-box-grid-gap;
15
+
16
+ @include ds-mq-only-breakpoint(mobile) {
17
+ grid-template-columns: 1fr 1fr;
18
+ }
19
+
20
+ @include ds-mq-only-breakpoint(tablet) {
21
+ grid-template-columns: 1fr 1fr 1fr;
22
+ }
23
+
24
+ @include ds-mq-only-breakpoint(desktop) {
25
+ grid-template-columns: 1fr 1fr 1fr 1fr;
26
+ }
27
+ }
28
+
29
+ .ds-group-header + .ds-link-box__grid {
30
+ padding-top: 0;
31
+ }
32
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "8.7.0",
3
+ "version": "8.8.1-beta.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",
@@ -15,7 +15,12 @@
15
15
  "url": "https://github.com/BonnierNews/dn-design-system/issues"
16
16
  },
17
17
  "devDependencies": {
18
+ "@commitlint/cli": "^18.4.3",
19
+ "@commitlint/config-conventional": "^18.4.3",
20
+ "@release-it/conventional-changelog": "^8.0.1",
21
+ "conventional-changelog-conventionalcommits": "^6.1.0",
18
22
  "postcss": "8.4.31",
23
+ "release-it": "^17.0.0",
19
24
  "stylelint": "^15.11.0",
20
25
  "stylelint-config-recommended-scss": "^13.1.0",
21
26
  "stylelint-prettier": "^4.0.2",
@@ -23,6 +28,8 @@
23
28
  "stylelint-selector-bem-pattern": "^2.1.1"
24
29
  },
25
30
  "scripts": {
26
- "lint:styles": "yarn stylelint \"**/*.scss\" \"!node_modules/\""
31
+ "lint:styles": "yarn stylelint \"**/*.scss\" \"!node_modules/\"",
32
+ "release:web": "release-it --ci --vv",
33
+ "prerelease:web": "release-it --preRelease=beta --ci --vv"
27
34
  }
28
35
  }