@charcoal-ui/react 3.9.0 → 3.9.1

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.
@@ -16,5 +16,6 @@ export declare const Default: StoryObj<typeof Modal>;
16
16
  export declare const FullBottomSheet: StoryObj<typeof Modal>;
17
17
  export declare const BottomSheet: StoryObj<typeof Modal>;
18
18
  export declare const NotDismmissableStory: StoryObj<typeof Modal>;
19
+ export declare const BackgroundScroll: StoryObj<typeof Modal>;
19
20
  export { InternalScrollStory as InternalScroll } from './__stories__/InternalScrollStory';
20
21
  //# sourceMappingURL=index.story.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,GAAG,CAAA;AAezD,OAAO,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;;;;;;;;;;;;AAEjD,wBAuCuB;AA6DvB,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,OAAO,KAAK,CAAM,CAAA;AAEjD,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,OAAO,KAAK,CAuDlD,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,OAAO,KAAK,CAqC9C,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,OAAO,KAAK,CA4BvD,CAAA;AAED,OAAO,EAAE,mBAAmB,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA"}
1
+ {"version":3,"file":"index.story.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/index.story.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyC,MAAM,GAAG,CAAA;AAezD,OAAO,EAAQ,QAAQ,EAAE,MAAM,kBAAkB,CAAA;;;;;;;;;;;;AAEjD,wBAuCuB;AA6DvB,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,OAAO,KAAK,CAAM,CAAA;AAEjD,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,OAAO,KAAK,CAuDlD,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,OAAO,KAAK,CAqC9C,CAAA;AAED,eAAO,MAAM,oBAAoB,EAAE,QAAQ,CAAC,OAAO,KAAK,CA4BvD,CAAA;AAED,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,OAAO,KAAK,CAqBnD,CAAA;AAED,OAAO,EAAE,mBAAmB,IAAI,cAAc,EAAE,MAAM,mCAAmC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"useCustomModalOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/useCustomModalOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAIjB,MAAM,sBAAsB,CAAA;AAE7B;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,qBAAqB,EAC5B,KAAK,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,EAC/C,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAChC,gBAAgB,CAuBlB"}
1
+ {"version":3,"file":"useCustomModalOverlay.d.ts","sourceRoot":"","sources":["../../../src/components/Modal/useCustomModalOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EACL,qBAAqB,EACrB,gBAAgB,EAKjB,MAAM,sBAAsB,CAAA;AAE7B;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,qBAAqB,EAC5B,KAAK,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,EAC/C,GAAG,EAAE,KAAK,CAAC,SAAS,CAAC,WAAW,CAAC,GAChC,gBAAgB,CA2BlB"}
package/dist/index.cjs.js CHANGED
@@ -950,6 +950,9 @@ function useCharcoalModalOverlay(props, state, ref) {
950
950
  onClose: state.onClose,
951
951
  shouldCloseOnInteractOutside: () => false
952
952
  }, ref);
953
+ (0, import_overlays2.usePreventScroll)({
954
+ isDisabled: !state.isOpen
955
+ });
953
956
  (0, import_overlays2.useOverlayFocusContain)();
954
957
  React9.useEffect(() => {
955
958
  if (state.isOpen && ref.current) {
@@ -1160,7 +1163,7 @@ var import_styled_components15 = __toESM(require("styled-components"));
1160
1163
 
1161
1164
  // src/components/DropdownSelector/Popover/usePreventScroll.tsx
1162
1165
  var import_react15 = require("react");
1163
- function usePreventScroll(element, isOpen) {
1166
+ function usePreventScroll2(element, isOpen) {
1164
1167
  (0, import_react15.useEffect)(() => {
1165
1168
  if (isOpen && element) {
1166
1169
  const defaultPaddingRight = element.style.paddingRight;
@@ -1196,7 +1199,7 @@ function Popover(props) {
1196
1199
  toggle: _empty
1197
1200
  });
1198
1201
  const modalBackground = (0, import_react16.useContext)(ModalBackgroundContext);
1199
- usePreventScroll(modalBackground, props.isOpen);
1202
+ usePreventScroll2(modalBackground, props.isOpen);
1200
1203
  if (!props.isOpen)
1201
1204
  return null;
1202
1205
  return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_overlays4.Overlay, { portalContainer: document.body, children: [