@bonniernews/dn-design-system-web 14.3.7 → 14.3.9

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
+ ## [14.3.9](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.8...@bonniernews/dn-design-system-web@14.3.9) (2024-03-20)
8
+
9
+
10
+ ### Bug Fixes
11
+
12
+ * **web:** minor fix for tooltip js ([#1257](https://github.com/BonnierNews/dn-design-system/issues/1257)) ([db6ddcf](https://github.com/BonnierNews/dn-design-system/commit/db6ddcf737188bef7b9fd2085e9de80d5f3418b9))
13
+
14
+ ## [14.3.8](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.7...@bonniernews/dn-design-system-web@14.3.8) (2024-03-20)
15
+
16
+
17
+ ### Bug Fixes
18
+
19
+ * **web:** export tooltip close function and add a toggle function ([#1253](https://github.com/BonnierNews/dn-design-system/issues/1253)) ([c032cbc](https://github.com/BonnierNews/dn-design-system/commit/c032cbc60f7084027d4965af1af0d4f193200ec6))
20
+
7
21
  ## [14.3.7](https://github.com/BonnierNews/dn-design-system/compare/@bonniernews/dn-design-system-web@14.3.6...@bonniernews/dn-design-system-web@14.3.7) (2024-03-20)
8
22
 
9
23
 
@@ -1,9 +1,13 @@
1
1
  export {
2
2
  initTooltip,
3
3
  openTooltip,
4
+ closeTooltip,
5
+ toggleTooltip,
4
6
  initTooltipStorybook
5
7
  }
6
8
 
9
+ const TOOLTIP_HIDDEN = "ds-tooltip--hidden";
10
+
7
11
  let setupTooltipClickListener = true;
8
12
 
9
13
  function initTooltip(tooltipEl) {
@@ -31,12 +35,19 @@ function initTooltip(tooltipEl) {
31
35
  });
32
36
  }
33
37
 
38
+ function toggleTooltip(tooltipEl, force) {
39
+ tooltipEl.classList.toggle(TOOLTIP_HIDDEN, !force);
40
+ return !tooltipEl.classList.contains(TOOLTIP_HIDDEN);
41
+ }
42
+
34
43
  function openTooltip(tooltipEl) {
35
- tooltipEl.classList.remove("ds-tooltip--hidden");
44
+ tooltipEl.classList.remove(TOOLTIP_HIDDEN);
45
+ return true;
36
46
  }
37
47
 
38
48
  function closeTooltip(tooltipEl) {
39
- tooltipEl.classList.add("ds-tooltip--hidden");
49
+ tooltipEl.classList.add(TOOLTIP_HIDDEN);
50
+ return false;
40
51
  }
41
52
 
42
53
  function initTooltipStorybook() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bonniernews/dn-design-system-web",
3
- "version": "14.3.7",
3
+ "version": "14.3.9",
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",