diff --git a/package.json b/package.json index f59707140..57d0c5b37 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,7 @@ "dependencies": { "@babel/runtime": "^7.4.5", "@restart/hooks": "^0.3.12", - "dom-helpers": "^3.4.0", + "dom-helpers": "^5.0.1", "popper.js": "^1.15.0", "prop-types": "^15.7.2", "uncontrollable": "^7.0.0", diff --git a/src/Dropdown.js b/src/Dropdown.js index 856fcc93c..64da1ba23 100644 --- a/src/Dropdown.js +++ b/src/Dropdown.js @@ -1,5 +1,5 @@ -import matches from 'dom-helpers/query/matches'; -import qsa from 'dom-helpers/query/querySelectorAll'; +import matches from 'dom-helpers/matches'; +import qsa from 'dom-helpers/querySelectorAll'; import React, { useCallback, useRef, useEffect, useMemo } from 'react'; import PropTypes from 'prop-types'; import { useUncontrolled } from 'uncontrollable'; diff --git a/src/Modal.js b/src/Modal.js index 3139df81d..f58d31184 100644 --- a/src/Modal.js +++ b/src/Modal.js @@ -1,9 +1,9 @@ /* eslint-disable react/prop-types */ import activeElement from 'dom-helpers/activeElement'; -import contains from 'dom-helpers/query/contains'; -import canUseDom from 'dom-helpers/util/inDOM'; -import listen from 'dom-helpers/events/listen'; +import contains from 'dom-helpers/contains'; +import canUseDom from 'dom-helpers/canUseDom'; +import listen from 'dom-helpers/listen'; import PropTypes from 'prop-types'; import React from 'react'; import ReactDOM from 'react-dom'; diff --git a/src/ModalManager.js b/src/ModalManager.js index 2b7308ebb..5c1b59a7a 100644 --- a/src/ModalManager.js +++ b/src/ModalManager.js @@ -1,6 +1,7 @@ -import classes from 'dom-helpers/class'; -import css from 'dom-helpers/style'; -import getScrollbarSize from 'dom-helpers/util/scrollbarSize'; +import addClass from 'dom-helpers/addClass'; +import removeClass from 'dom-helpers/removeClass'; +import css from 'dom-helpers/css'; +import getScrollbarSize from 'dom-helpers/scrollbarSize'; import isOverflowing from './utils/isOverflowing'; import { @@ -109,7 +110,7 @@ class ModalManager { this.setContainerStyle(data, container); } - data.classes.forEach(classes.addClass.bind(null, container)); + data.classes.forEach(addClass.bind(null, container)); this.containers.push(container); this.data.push(data); @@ -135,7 +136,7 @@ class ModalManager { // if that was the last modal in a container, // clean up the container if (data.modals.length === 0) { - data.classes.forEach(classes.removeClass.bind(null, container)); + data.classes.forEach(removeClass.bind(null, container)); if (this.handleContainerOverflow) { this.removeContainerStyle(data, container); diff --git a/src/useRootClose.js b/src/useRootClose.js index 55b90fe6c..cadeb0636 100644 --- a/src/useRootClose.js +++ b/src/useRootClose.js @@ -1,5 +1,5 @@ -import contains from 'dom-helpers/query/contains'; -import listen from 'dom-helpers/events/listen'; +import contains from 'dom-helpers/contains'; +import listen from 'dom-helpers/listen'; import { useCallback, useEffect, useRef } from 'react'; import useEventCallback from '@restart/hooks/useEventCallback'; diff --git a/src/utils/isOverflowing.js b/src/utils/isOverflowing.js index 0374d5029..693db573d 100644 --- a/src/utils/isOverflowing.js +++ b/src/utils/isOverflowing.js @@ -1,4 +1,4 @@ -import isWindow from 'dom-helpers/query/isWindow'; +import isWindow from 'dom-helpers/isWindow'; import ownerDocument from 'dom-helpers/ownerDocument'; function isBody(node) { diff --git a/test/ModalManagerSpec.js b/test/ModalManagerSpec.js index 8133ecc3d..530115b3d 100644 --- a/test/ModalManagerSpec.js +++ b/test/ModalManagerSpec.js @@ -1,5 +1,5 @@ -import css from 'dom-helpers/style'; -import getScrollbarSize from 'dom-helpers/util/scrollbarSize'; +import css from 'dom-helpers/css'; +import getScrollbarSize from 'dom-helpers/scrollbarSize'; import ModalContainer from '../src/Modal'; import ModalManager from '../src/ModalManager'; diff --git a/yarn.lock b/yarn.lock index b4fe20736..2c2995b17 100644 --- a/yarn.lock +++ b/yarn.lock @@ -3076,7 +3076,7 @@ csso@^3.5.1: dependencies: css-tree "1.0.0-alpha.29" -csstype@^2.5.7: +csstype@^2.5.7, csstype@^2.6.6: version "2.6.6" resolved "https://registry.yarnpkg.com/csstype/-/csstype-2.6.6.tgz#c34f8226a94bbb10c32cc0d714afdf942291fc41" integrity sha512-RpFbQGUE74iyPgvr46U9t1xoQBM8T4BL8SxrN66Le2xYAPSaDJJKeztV3awugusb3g3G9iL8StmkBBXhcbbXhg== @@ -3374,6 +3374,14 @@ dom-helpers@^3.4.0: dependencies: "@babel/runtime" "^7.1.2" +dom-helpers@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/dom-helpers/-/dom-helpers-5.0.1.tgz#f419eec93625c0b56e5d7f7aa326238e26a81aee" + integrity sha512-+FoTEtqaob4YbwCFawRcvRvMeHe6ggNLRnHyh8EpTkcZHErX9PLZFBjT6kRHzzZNiRUDXbIHslJg7li45TM5Cw== + dependencies: + "@babel/runtime" "^7.5.5" + csstype "^2.6.6" + dom-iterator@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/dom-iterator/-/dom-iterator-1.0.0.tgz#9c09899846ec41c2d257adc4d6015e4759ef05ad"