@bonniernews/dn-design-system-web 10.0.1 → 10.0.3

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
@@ -4,6 +4,20 @@ All changes to @bonniernews/dn-design-system-web will be documented in this file
4
4
 
5
5
 
6
6
 
7
+ ## [10.0.3](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@10.0.2...@bonniernews/dn-design-system-web@10.0.3) (2024-01-16)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **web:** no scroll when dialog is open ([#1169](https://github.com/BonnierNews/dn-design-system/issues/1169)) ([9054857](https://github.com/BonnierNews/dn-design-system/commit/9054857723940c9014ae30f096e8d80140726e6b))
13
+
14
+ ## [10.0.2](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@10.0.1...@bonniernews/dn-design-system-web@10.0.2) (2024-01-16)
15
+
16
+
17
+ ### Maintenance
18
+
19
+ * **web:** update spacing on modal ([#1168](https://github.com/BonnierNews/dn-design-system/issues/1168)) ([5bde79c](https://github.com/BonnierNews/dn-design-system/commit/5bde79c1ec76eb57c131e09b0358973ffd27c4b2))
20
+
7
21
  ## [10.0.1](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@10.0.0...@bonniernews/dn-design-system-web@10.0.1) (2024-01-15)
8
22
 
9
23
 
@@ -20,6 +20,7 @@ function initModal(modalEl) {
20
20
  fallbackDiv.setAttribute("aria-modal", "true");
21
21
  fallbackDiv.innerHTML = modalElInner.innerHTML;
22
22
  modalEl.replaceChild(fallbackDiv, modalElInner);
23
+ document.body.classList.add("no-scroll");
23
24
  }
24
25
 
25
26
  modalEl.addEventListener("click", (e) => {
@@ -49,6 +50,7 @@ function closeModal(modalEl, isDialogSupported) {
49
50
  modalElInner.close();
50
51
  } else {
51
52
  modalEl.classList.add("ds-modal--hidden");
53
+ document.body.classList.remove("no-scroll");
52
54
  }
53
55
  }
54
56
 
@@ -3,6 +3,12 @@
3
3
  @use "../../components/button/button.scss";
4
4
  @use "../../components/icon-button/icon-button.scss";
5
5
 
6
+ body:has(dialog[open]),
7
+ body.no-scroll {
8
+ overflow: hidden;
9
+ touch-action: none;
10
+ }
11
+
6
12
  .ds-modal {
7
13
  &--fallback.ds-modal--hidden {
8
14
  display: none;
@@ -73,15 +79,22 @@
73
79
  }
74
80
 
75
81
  .ds-modal__content {
76
- padding: ds-spacing($ds-s-400 $ds-s-300 $ds-s-300);
77
82
  background-color: $ds-color-surface-background;
78
83
  position: relative;
79
84
  z-index: 15;
80
85
 
86
+ @include ds-mq-only-breakpoint(mobile) {
87
+ padding: ds-spacing($ds-s-400 $ds-s-150 $ds-s-150);
88
+ }
89
+
90
+ @include ds-mq-smallest-breakpoint(tablet) {
91
+ padding: ds-spacing($ds-s-400 $ds-s-300 $ds-s-300);
92
+ }
93
+
81
94
  .ds-icon-btn.ds-modal__close {
82
95
  position: absolute;
83
- top: ds-spacing($ds-s-150);
84
- right: ds-spacing($ds-s-150);
96
+ top: ds-spacing($ds-s-100);
97
+ right: ds-spacing($ds-s-100);
85
98
  }
86
99
 
87
100
  > h2 {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "10.0.1",
3
+ "version": "10.0.3",
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",