@workday/canvas-kit-react 11.2.6 → 11.2.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.
@@ -1 +1 @@
1
- {"version":3,"file":"useDisableBodyScroll.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useDisableBodyScroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;MAwB/B,CAAC"}
1
+ {"version":3,"file":"useDisableBodyScroll.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useDisableBodyScroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;MAgB/B,CAAC"}
@@ -6,7 +6,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.useDisableBodyScroll = void 0;
7
7
  const react_1 = __importDefault(require("react"));
8
8
  const common_1 = require("@workday/canvas-kit-react/common");
9
+ const canvas_kit_styling_1 = require("@workday/canvas-kit-styling");
9
10
  const usePopupModel_1 = require("./usePopupModel");
11
+ const disableBodyScrollStyles = canvas_kit_styling_1.createStyles({ name: "806269", styles: "overflow:hidden !important;" });
10
12
  /**
11
13
  * Disables body scroll by adding `overflow: hidden` to the body element. This effectively prevents
12
14
  * page scrolling while the popup is visible.
@@ -20,16 +22,9 @@ exports.useDisableBodyScroll = common_1.createElemPropsHook(usePopupModel_1.useP
20
22
  if (!visible) {
21
23
  return;
22
24
  }
23
- const overflowY = document.body.style.overflowY;
24
- const overflowX = document.body.style.overflowX;
25
- const overflow = document.body.style.overflow;
26
- document.body.style.overflow = 'hidden';
27
- document.body.style.overflowY = 'hidden';
28
- document.body.style.overflowX = 'hidden';
25
+ document.body.classList.add(disableBodyScrollStyles);
29
26
  return () => {
30
- document.body.style.overflow = overflow;
31
- document.body.style.overflowY = overflowY;
32
- document.body.style.overflowX = overflowX;
27
+ document.body.classList.remove(disableBodyScrollStyles);
33
28
  };
34
29
  }, [visible]);
35
30
  return {};
@@ -1 +1 @@
1
- {"version":3,"file":"useDisableBodyScroll.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useDisableBodyScroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAM1B;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;MAwB/B,CAAC"}
1
+ {"version":3,"file":"useDisableBodyScroll.d.ts","sourceRoot":"","sources":["../../../../../popup/lib/hooks/useDisableBodyScroll.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;MAgB/B,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import React from 'react';
2
2
  import { createElemPropsHook } from '@workday/canvas-kit-react/common';
3
+ import { createStyles } from '@workday/canvas-kit-styling';
3
4
  import { usePopupModel } from './usePopupModel';
5
+ const disableBodyScrollStyles = createStyles({ name: "806269", styles: "overflow:hidden !important;" });
4
6
  /**
5
7
  * Disables body scroll by adding `overflow: hidden` to the body element. This effectively prevents
6
8
  * page scrolling while the popup is visible.
@@ -14,16 +16,9 @@ export const useDisableBodyScroll = createElemPropsHook(usePopupModel)(model =>
14
16
  if (!visible) {
15
17
  return;
16
18
  }
17
- const overflowY = document.body.style.overflowY;
18
- const overflowX = document.body.style.overflowX;
19
- const overflow = document.body.style.overflow;
20
- document.body.style.overflow = 'hidden';
21
- document.body.style.overflowY = 'hidden';
22
- document.body.style.overflowX = 'hidden';
19
+ document.body.classList.add(disableBodyScrollStyles);
23
20
  return () => {
24
- document.body.style.overflow = overflow;
25
- document.body.style.overflowY = overflowY;
26
- document.body.style.overflowX = overflowX;
21
+ document.body.classList.remove(disableBodyScrollStyles);
27
22
  };
28
23
  }, [visible]);
29
24
  return {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@workday/canvas-kit-react",
3
- "version": "11.2.6",
3
+ "version": "11.2.7",
4
4
  "description": "The parent module that contains all Workday Canvas Kit React components",
5
5
  "author": "Workday, Inc. (https://www.workday.com)",
6
6
  "license": "Apache-2.0",
@@ -49,8 +49,8 @@
49
49
  "@emotion/styled": "^11.6.0",
50
50
  "@popperjs/core": "^2.5.4",
51
51
  "@workday/canvas-colors-web": "^2.0.0",
52
- "@workday/canvas-kit-popup-stack": "^11.2.6",
53
- "@workday/canvas-kit-styling": "^11.2.6",
52
+ "@workday/canvas-kit-popup-stack": "^11.2.7",
53
+ "@workday/canvas-kit-styling": "^11.2.7",
54
54
  "@workday/canvas-system-icons-web": "^3.0.0",
55
55
  "@workday/canvas-tokens-web": "^2.0.0",
56
56
  "@workday/design-assets-types": "^0.2.8",
@@ -67,5 +67,5 @@
67
67
  "@workday/canvas-accent-icons-web": "^3.0.0",
68
68
  "@workday/canvas-applet-icons-web": "^2.0.0"
69
69
  },
70
- "gitHead": "91fe31790985359550880acd17a09a6294b0fe86"
70
+ "gitHead": "1fe7f1c6d942986cb0a604fb5b053ef29a14a40b"
71
71
  }
@@ -1,9 +1,14 @@
1
1
  import React from 'react';
2
2
 
3
3
  import {createElemPropsHook} from '@workday/canvas-kit-react/common';
4
+ import {createStyles} from '@workday/canvas-kit-styling';
4
5
 
5
6
  import {usePopupModel} from './usePopupModel';
6
7
 
8
+ const disableBodyScrollStyles = createStyles({
9
+ overflow: 'hidden !important',
10
+ });
11
+
7
12
  /**
8
13
  * Disables body scroll by adding `overflow: hidden` to the body element. This effectively prevents
9
14
  * page scrolling while the popup is visible.
@@ -19,18 +24,10 @@ export const useDisableBodyScroll = createElemPropsHook(usePopupModel)(model =>
19
24
  return;
20
25
  }
21
26
 
22
- const overflowY = document.body.style.overflowY;
23
- const overflowX = document.body.style.overflowX;
24
- const overflow = document.body.style.overflow;
25
-
26
- document.body.style.overflow = 'hidden';
27
- document.body.style.overflowY = 'hidden';
28
- document.body.style.overflowX = 'hidden';
27
+ document.body.classList.add(disableBodyScrollStyles);
29
28
 
30
29
  return () => {
31
- document.body.style.overflow = overflow;
32
- document.body.style.overflowY = overflowY;
33
- document.body.style.overflowX = overflowX;
30
+ document.body.classList.remove(disableBodyScrollStyles);
34
31
  };
35
32
  }, [visible]);
36
33