import * as React from 'react'; import { RemoveScroll } from 'react-remove-scroll/UI'; import ReactFocusLock from 'react-focus-lock/UI'; var extractRef = function (ref) { return (('current' in ref) ? ref.current : ref); }; export function ReactFocusOn(props) { var _a = React.useState(null), lockProps = _a[0], setLockProps = _a[1]; var _b = this.props, children = _b.children, autoFocus = _b.autoFocus, shards = _b.shards, _c = _b.enabled, enabled = _c === void 0 ? true : _c, _d = _b.scrollLock, scrollLock = _d === void 0 ? true : _d, _e = _b.focusLock, focusLock = _e === void 0 ? true : _e, sideCar = _b.sideCar; return (React.createElement(React.Fragment, null, React.createElement(RemoveScroll, { sideCar: enabled && sideCar, enabled: enabled && scrollLock, shards: shards }, enabled && React.createElement(Effect, null), React.createElement(ReactFocusLock, { sideCar: enabled && sideCar, disabled: !(this.state.lockProps && enabled && focusLock), returnFocus: true, autoFocus: autoFocus, onActivation: this.onActivation, onDeactivation: this.onDeactivation, shards: shards, lockProps: lockProps }, children)))); }