react-focus-on 3.7.0 → 3.8.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.
package/dist/es2015/UI.js CHANGED
@@ -5,15 +5,16 @@ import ReactFocusLock from 'react-focus-lock/UI';
5
5
  import { effectCar } from './medium';
6
6
  export var FocusOn = React.forwardRef(function (props, parentRef) {
7
7
  var _a = React.useState(false), lockProps = _a[0], setLockProps = _a[1];
8
- var children = props.children, autoFocus = props.autoFocus, shards = props.shards, _b = props.enabled, enabled = _b === void 0 ? true : _b, _c = props.scrollLock, scrollLock = _c === void 0 ? true : _c, _d = props.focusLock, focusLock = _d === void 0 ? true : _d, _e = props.returnFocus, returnFocus = _e === void 0 ? true : _e, inert = props.inert, allowPinchZoom = props.allowPinchZoom, sideCar = props.sideCar, className = props.className, shouldIgnore = props.shouldIgnore, preventScrollOnFocus = props.preventScrollOnFocus, style = props.style, as = props.as, rest = __rest(props, ["children", "autoFocus", "shards", "enabled", "scrollLock", "focusLock", "returnFocus", "inert", "allowPinchZoom", "sideCar", "className", "shouldIgnore", "preventScrollOnFocus", "style", "as"]);
8
+ var children = props.children, autoFocus = props.autoFocus, shards = props.shards, _b = props.enabled, enabled = _b === void 0 ? true : _b, _c = props.scrollLock, scrollLock = _c === void 0 ? true : _c, _d = props.focusLock, focusLock = _d === void 0 ? true : _d, _e = props.returnFocus, returnFocus = _e === void 0 ? true : _e, inert = props.inert, allowPinchZoom = props.allowPinchZoom, sideCar = props.sideCar, className = props.className, shouldIgnore = props.shouldIgnore, preventScrollOnFocus = props.preventScrollOnFocus, style = props.style, as = props.as, gapMode = props.gapMode, rest = __rest(props, ["children", "autoFocus", "shards", "enabled", "scrollLock", "focusLock", "returnFocus", "inert", "allowPinchZoom", "sideCar", "className", "shouldIgnore", "preventScrollOnFocus", "style", "as", "gapMode"]);
9
9
  var SideCar = sideCar;
10
10
  var onActivation = lockProps.onActivation, onDeactivation = lockProps.onDeactivation, restProps = __rest(lockProps, ["onActivation", "onDeactivation"]);
11
- var appliedLockProps = __assign(__assign({}, restProps), { sideCar: sideCar,
11
+ var appliedLockProps = __assign(__assign({}, restProps), { as: as,
12
+ style: style,
13
+ sideCar: sideCar,
12
14
  shards: shards,
13
15
  allowPinchZoom: allowPinchZoom,
14
- as: as,
15
- inert: inert,
16
- style: style, enabled: enabled && scrollLock });
16
+ gapMode: gapMode,
17
+ inert: inert, enabled: enabled && scrollLock });
17
18
  return (React.createElement(React.Fragment, null,
18
19
  React.createElement(ReactFocusLock, { ref: parentRef, sideCar: sideCar, disabled: !(lockProps && enabled && focusLock), returnFocus: returnFocus, autoFocus: autoFocus, shards: shards, onActivation: onActivation, onDeactivation: onDeactivation, className: className, whiteList: shouldIgnore, lockProps: appliedLockProps, focusOptions: preventScrollOnFocus ? { preventScroll: true } : undefined, as: RemoveScroll }, children),
19
20
  enabled && (React.createElement(SideCar, __assign({}, rest, { sideCar: effectCar, setLockProps: setLockProps, shards: shards })))));
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import ReactFocusLock from 'react-focus-lock/UI';
3
3
  import { ComponentProps } from "react";
4
+ export declare type GapMode = 'padding' | 'margin';
4
5
  export interface LockProps {
5
6
  onMouseDown?: ((e: React.MouseEvent) => void) | undefined;
6
7
  onTouchStart?: ((e: React.TouchEvent) => void) | undefined;
@@ -42,6 +43,12 @@ export interface CommonProps {
42
43
  * @see https://github.com/theKashey/react-remove-scroll#usage
43
44
  */
44
45
  allowPinchZoom?: boolean | undefined;
46
+ /**
47
+ * [scroll-lock] Controls how body scroll removal is supported. Possible values - `margin` or `padding`
48
+ * @default 'margin'
49
+ * @see https://github.com/theKashey/react-remove-scroll-bar#gapmode
50
+ */
51
+ gapMode?: GapMode;
45
52
  /**
46
53
  * a list of elements which should be considered as a part of the lock
47
54
  */
package/dist/es5/UI.js CHANGED
@@ -8,15 +8,16 @@ var UI_2 = require("react-focus-lock/UI");
8
8
  var medium_1 = require("./medium");
9
9
  exports.FocusOn = React.forwardRef(function (props, parentRef) {
10
10
  var _a = React.useState(false), lockProps = _a[0], setLockProps = _a[1];
11
- var children = props.children, autoFocus = props.autoFocus, shards = props.shards, _b = props.enabled, enabled = _b === void 0 ? true : _b, _c = props.scrollLock, scrollLock = _c === void 0 ? true : _c, _d = props.focusLock, focusLock = _d === void 0 ? true : _d, _e = props.returnFocus, returnFocus = _e === void 0 ? true : _e, inert = props.inert, allowPinchZoom = props.allowPinchZoom, sideCar = props.sideCar, className = props.className, shouldIgnore = props.shouldIgnore, preventScrollOnFocus = props.preventScrollOnFocus, style = props.style, as = props.as, rest = tslib_1.__rest(props, ["children", "autoFocus", "shards", "enabled", "scrollLock", "focusLock", "returnFocus", "inert", "allowPinchZoom", "sideCar", "className", "shouldIgnore", "preventScrollOnFocus", "style", "as"]);
11
+ var children = props.children, autoFocus = props.autoFocus, shards = props.shards, _b = props.enabled, enabled = _b === void 0 ? true : _b, _c = props.scrollLock, scrollLock = _c === void 0 ? true : _c, _d = props.focusLock, focusLock = _d === void 0 ? true : _d, _e = props.returnFocus, returnFocus = _e === void 0 ? true : _e, inert = props.inert, allowPinchZoom = props.allowPinchZoom, sideCar = props.sideCar, className = props.className, shouldIgnore = props.shouldIgnore, preventScrollOnFocus = props.preventScrollOnFocus, style = props.style, as = props.as, gapMode = props.gapMode, rest = tslib_1.__rest(props, ["children", "autoFocus", "shards", "enabled", "scrollLock", "focusLock", "returnFocus", "inert", "allowPinchZoom", "sideCar", "className", "shouldIgnore", "preventScrollOnFocus", "style", "as", "gapMode"]);
12
12
  var SideCar = sideCar;
13
13
  var onActivation = lockProps.onActivation, onDeactivation = lockProps.onDeactivation, restProps = tslib_1.__rest(lockProps, ["onActivation", "onDeactivation"]);
14
- var appliedLockProps = tslib_1.__assign(tslib_1.__assign({}, restProps), { sideCar: sideCar,
14
+ var appliedLockProps = tslib_1.__assign(tslib_1.__assign({}, restProps), { as: as,
15
+ style: style,
16
+ sideCar: sideCar,
15
17
  shards: shards,
16
18
  allowPinchZoom: allowPinchZoom,
17
- as: as,
18
- inert: inert,
19
- style: style, enabled: enabled && scrollLock });
19
+ gapMode: gapMode,
20
+ inert: inert, enabled: enabled && scrollLock });
20
21
  return (React.createElement(React.Fragment, null,
21
22
  React.createElement(UI_2.default, { ref: parentRef, sideCar: sideCar, disabled: !(lockProps && enabled && focusLock), returnFocus: returnFocus, autoFocus: autoFocus, shards: shards, onActivation: onActivation, onDeactivation: onDeactivation, className: className, whiteList: shouldIgnore, lockProps: appliedLockProps, focusOptions: preventScrollOnFocus ? { preventScroll: true } : undefined, as: UI_1.RemoveScroll }, children),
22
23
  enabled && (React.createElement(SideCar, tslib_1.__assign({}, rest, { sideCar: medium_1.effectCar, setLockProps: setLockProps, shards: shards })))));
@@ -1,6 +1,7 @@
1
1
  import * as React from 'react';
2
2
  import ReactFocusLock from 'react-focus-lock/UI';
3
3
  import { ComponentProps } from "react";
4
+ export declare type GapMode = 'padding' | 'margin';
4
5
  export interface LockProps {
5
6
  onMouseDown?: ((e: React.MouseEvent) => void) | undefined;
6
7
  onTouchStart?: ((e: React.TouchEvent) => void) | undefined;
@@ -42,6 +43,12 @@ export interface CommonProps {
42
43
  * @see https://github.com/theKashey/react-remove-scroll#usage
43
44
  */
44
45
  allowPinchZoom?: boolean | undefined;
46
+ /**
47
+ * [scroll-lock] Controls how body scroll removal is supported. Possible values - `margin` or `padding`
48
+ * @default 'margin'
49
+ * @see https://github.com/theKashey/react-remove-scroll-bar#gapmode
50
+ */
51
+ gapMode?: GapMode;
45
52
  /**
46
53
  * a list of elements which should be considered as a part of the lock
47
54
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-focus-on",
3
- "version": "3.7.0",
3
+ "version": "3.8.1",
4
4
  "description": "The final solution for WAI ARIA compatible modal dialogs or full-screen tasks.",
5
5
  "main": "dist/es5/index.js",
6
6
  "scripts": {
@@ -46,7 +46,7 @@
46
46
  "dependencies": {
47
47
  "aria-hidden": "^1.2.2",
48
48
  "react-focus-lock": "^2.9.2",
49
- "react-remove-scroll": "^2.5.5",
49
+ "react-remove-scroll": "^2.5.6",
50
50
  "react-style-singleton": "^2.2.0",
51
51
  "tslib": "^2.3.1",
52
52
  "use-callback-ref": "^1.3.0",