@interop-ui/react-lock
Advanced tools
Comparing version 0.0.1-3 to 0.0.1-4
import * as React from "react"; | ||
type FocusableTarget = HTMLElement | { | ||
focus(): void; | ||
}; | ||
export type LockProps = { | ||
children: React.ReactNode | ((ref: React.RefObject<HTMLElement | undefined>) => React.ReactNode); | ||
children: React.ReactNode; | ||
/** | ||
* Whether the Lock is currently active | ||
* (defaut: false) | ||
*/ | ||
isActive?: boolean; | ||
/** | ||
* A function called when the Lock is deactivated from the inside (escape / outslide click) | ||
*/ | ||
onDeactivate?(): void; | ||
onDeactivate?: () => void; | ||
/** | ||
@@ -18,3 +16,3 @@ * A ref to an element to focus on inside the Lock after it is activated. | ||
*/ | ||
refToFocusOnActivation?: React.RefObject<HTMLElement | null | undefined>; | ||
refToFocusOnActivation?: React.RefObject<FocusableTarget | null | undefined>; | ||
/** | ||
@@ -25,3 +23,3 @@ * A ref to an element to focus on outside the Lock after it is deactivated. | ||
*/ | ||
refToFocusOnDeactivation?: React.RefObject<HTMLElement | null | undefined>; | ||
refToFocusOnDeactivation?: React.RefObject<FocusableTarget | null | undefined>; | ||
/** Whether pressing the escape key should deactivate the Lock */ | ||
@@ -31,10 +29,10 @@ shouldDeactivateOnEscape?: boolean; | ||
shouldDeactivateOnOutsideClick?: boolean | ((event: MouseEvent | TouchEvent) => boolean); | ||
/** Whether pointer events happening outside the locked container should be blocked */ | ||
shouldBlockOutsideClick: boolean; | ||
/** Whether pointer events happening outside the locked container should be prevented */ | ||
shouldPreventOutsideClick?: boolean; | ||
}; | ||
export function Lock({ children, isActive, onDeactivate, refToFocusOnActivation, refToFocusOnDeactivation, shouldDeactivateOnEscape, shouldDeactivateOnOutsideClick, shouldBlockOutsideClick, }: LockProps): JSX.Element; | ||
export function Lock({ children, ...props }: LockProps): JSX.Element | null; | ||
export function useLockContext(): { | ||
lockContainerRef: React.RefObject<HTMLElement | null>; | ||
lockContainerRef: React.RefObject<HTMLElement>; | ||
}; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@interop-ui/react-lock", | ||
"version": "0.0.1-3", | ||
"version": "0.0.1-4", | ||
"license": "MIT", | ||
@@ -14,12 +14,12 @@ "source": "src/index.ts", | ||
"scripts": { | ||
"build": "parcel build src/index.ts", | ||
"build": "parcel build src/index.ts --no-cache", | ||
"clean": "rm -rf dist", | ||
"bump": "yarn version --deferred", | ||
"version": "yarn version", | ||
"prepublish": "yarn clean && yarn build" | ||
}, | ||
"dependencies": { | ||
"@interop-ui/react-debug-context": "0.0.1-3", | ||
"@interop-ui/react-utils": "0.0.1-3", | ||
"@interop-ui/tabbable": "0.0.1-2", | ||
"@interop-ui/utils": "0.0.1-2", | ||
"@interop-ui/react-debug-context": "0.0.1-4", | ||
"@interop-ui/react-utils": "0.0.1-4", | ||
"@interop-ui/tabbable": "0.0.1-3", | ||
"@interop-ui/utils": "0.0.1-3", | ||
"aria-hidden": "^1.1.1" | ||
@@ -26,0 +26,0 @@ }, |
Sorry, the diff of this file is not supported yet
94035
96
+ Added@interop-ui/react-debug-context@0.0.1-4(transitive)
+ Added@interop-ui/react-utils@0.0.1-4(transitive)
+ Added@interop-ui/tabbable@0.0.1-3(transitive)
+ Added@interop-ui/utils@0.0.1-3(transitive)
- Removed@interop-ui/react-debug-context@0.0.1-3(transitive)
- Removed@interop-ui/react-utils@0.0.1-3(transitive)
- Removed@interop-ui/tabbable@0.0.1-2(transitive)
- Removed@interop-ui/utils@0.0.1-2(transitive)
Updated@interop-ui/tabbable@0.0.1-3
Updated@interop-ui/utils@0.0.1-3