@charcoal-ui/react 2.0.0 → 2.0.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.
@@ -10,7 +10,7 @@ import { useToggleState, useSelectState, Item, useRadioGroupState } from 'react-
10
10
  import { useTextField } from '@react-aria/textfield';
11
11
  import { useVisuallyHidden } from '@react-aria/visually-hidden';
12
12
  import '@charcoal-ui/icons';
13
- import { useOverlay, usePreventScroll, useModal, OverlayContainer, DismissButton } from '@react-aria/overlays';
13
+ import { useOverlay, usePreventScroll, useModalOverlay, Overlay, DismissButton } from '@react-aria/overlays';
14
14
  import { FocusScope, focusSafely, getFocusableTreeWalker, useFocusRing } from '@react-aria/focus';
15
15
  import { useDialog } from '@react-aria/dialog';
16
16
  import { animated, useTransition, easings } from 'react-spring';
@@ -1077,7 +1077,6 @@ function Modal(_ref) {
1077
1077
  var children = _ref.children,
1078
1078
  _ref$zIndex = _ref.zIndex,
1079
1079
  zIndex = _ref$zIndex === void 0 ? DEFAULT_Z_INDEX : _ref$zIndex,
1080
- portalContainer = _ref.portalContainer,
1081
1080
  props = _objectWithoutPropertiesLoose(_ref, _excluded$5);
1082
1081
 
1083
1082
  var title = props.title,
@@ -1097,8 +1096,19 @@ function Modal(_ref) {
1097
1096
 
1098
1097
  usePreventScroll();
1099
1098
 
1100
- var _useModal = useModal(),
1101
- modalProps = _useModal.modalProps;
1099
+ var _useModalOverlay = useModalOverlay(props, {
1100
+ close: onClose,
1101
+ isOpen: isOpen,
1102
+ // these props are not used actually.
1103
+ // https://github.com/adobe/react-spectrum/blob/df14e3fb129b94b310f0397a701b83f006b51dfe/packages/%40react-aria/overlays/src/useModalOverlay.ts
1104
+ open: function open() {// nope
1105
+ },
1106
+ setOpen: function setOpen() {// nope
1107
+ },
1108
+ toggle: function toggle() {// nope
1109
+ }
1110
+ }, ref),
1111
+ modalProps = _useModalOverlay.modalProps;
1102
1112
 
1103
1113
  var _useDialog = useDialog(props, ref),
1104
1114
  dialogProps = _useDialog.dialogProps,
@@ -1131,9 +1141,7 @@ function Modal(_ref) {
1131
1141
  return transition(function (_ref2, item) {
1132
1142
  var backgroundColor = _ref2.backgroundColor,
1133
1143
  transform = _ref2.transform;
1134
- return item && /*#__PURE__*/React.createElement(OverlayContainer, {
1135
- portalContainer: portalContainer
1136
- }, /*#__PURE__*/React.createElement(ModalBackground, _extends({
1144
+ return item && /*#__PURE__*/React.createElement(Overlay, null, /*#__PURE__*/React.createElement(ModalBackground, _extends({
1137
1145
  zIndex: zIndex
1138
1146
  }, underlayProps, {
1139
1147
  style: transitionEnabled ? {