@transferwise/components 43.11.5-beta-f1bf5451ad.0 → 43.11.5
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import classNames from"classnames";import{useCallback,useEffect,useRef}from"react";import CSSTransition from"react-transition-group/CSSTransition";import{
|
|
1
|
+
import{ThemeProvider,useTheme}from"@wise/components-theming";import classNames from"classnames";import{useCallback,useEffect,useRef}from"react";import CSSTransition from"react-transition-group/CSSTransition";import{addNoScrollBodyClass,removeNoScrollBodyClass}from"../common";import{isIosDevice}from"../common/deviceDetection";import FocusBoundary from"../common/focusBoundary";import withNextPortal from"../withNextPortal/withNextPortal";import DimmerManager from"./dimmerManager";import{jsx as _jsx}from"react/jsx-runtime";export var EXIT_ANIMATION=350;var dimmerManager=new DimmerManager;export var handleTouchMove=function(a){var b=a.target.classList.contains("dimmer");// disable scroll on iOS devices for Dimmer area
|
|
2
2
|
// this is because of bug in WebKit https://bugs.webkit.org/show_bug.cgi?id=220908
|
|
3
3
|
// note: scrolling still works for children(s) as expected
|
|
4
4
|
isIosDevice()&&b&&(a.stopPropagation(),a.preventDefault())};var Dimmer=function(a){var b=a.children,c=a.className,d=a.disableClickToClose,e=a.fadeContentOnEnter,f=void 0!==e&&e,g=a.fadeContentOnExit,h=a.open,i=void 0!==h&&h,j=a.scrollable,k=a.transparent,l=void 0!==k&&k,m=a.onClose,n=useTheme(),o=n.screenMode,p=n.theme,q=useRef(null),r=function(a){a.target===q.current&&(null===m||void 0===m?void 0:m(a))},s=useCallback(function(a){"Escape"!==a.key||(a.stopPropagation(),m&&q.current&&dimmerManager.isTop(q.current)&&m(a))},[m]);return useEffect(function(){var a=q.current;return i&&(document.addEventListener("keydown",s),null===a||void 0===a?void 0:a.addEventListener("touchmove",handleTouchMove,{passive:!0})),function(){document.removeEventListener("keydown",s),null===a||void 0===a?void 0:a.removeEventListener("touchmove",handleTouchMove)}},[s,i]),/*#__PURE__*/_jsx(ThemeProvider,{theme:p,screenMode:o,children:/*#__PURE__*/_jsx(CSSTransition,{in:i,appear:!0// Wait for animation to finish before unmount.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import classNames from"classnames";import{useCallback,useEffect,useRef}from"react";import CSSTransition from"react-transition-group/CSSTransition";import{
|
|
1
|
+
import{ThemeProvider,useTheme}from"@wise/components-theming";import classNames from"classnames";import{useCallback,useEffect,useRef}from"react";import CSSTransition from"react-transition-group/CSSTransition";import{addNoScrollBodyClass,removeNoScrollBodyClass}from"../common";import{isIosDevice}from"../common/deviceDetection";import FocusBoundary from"../common/focusBoundary";import withNextPortal from"../withNextPortal/withNextPortal";import DimmerManager from"./dimmerManager";import{jsx as _jsx}from"react/jsx-runtime";export var EXIT_ANIMATION=350;var dimmerManager=new DimmerManager;export var handleTouchMove=function(a){var b=a.target.classList.contains("dimmer");// disable scroll on iOS devices for Dimmer area
|
|
2
2
|
// this is because of bug in WebKit https://bugs.webkit.org/show_bug.cgi?id=220908
|
|
3
3
|
// note: scrolling still works for children(s) as expected
|
|
4
4
|
isIosDevice()&&b&&(a.stopPropagation(),a.preventDefault())};var Dimmer=function(a){var b=a.children,c=a.className,d=a.disableClickToClose,e=a.fadeContentOnEnter,f=void 0!==e&&e,g=a.fadeContentOnExit,h=a.open,i=void 0!==h&&h,j=a.scrollable,k=a.transparent,l=void 0!==k&&k,m=a.onClose,n=useTheme(),o=n.screenMode,p=n.theme,q=useRef(null),r=function(a){a.target===q.current&&(null===m||void 0===m?void 0:m(a))},s=useCallback(function(a){"Escape"!==a.key||(a.stopPropagation(),m&&q.current&&dimmerManager.isTop(q.current)&&m(a))},[m]);return useEffect(function(){var a=q.current;return i&&(document.addEventListener("keydown",s),null===a||void 0===a?void 0:a.addEventListener("touchmove",handleTouchMove,{passive:!0})),function(){document.removeEventListener("keydown",s),null===a||void 0===a?void 0:a.removeEventListener("touchmove",handleTouchMove)}},[s,i]),/*#__PURE__*/_jsx(ThemeProvider,{theme:p,screenMode:o,children:/*#__PURE__*/_jsx(CSSTransition,{in:i,appear:!0// Wait for animation to finish before unmount.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "43.11.5
|
|
3
|
+
"version": "43.11.5",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/umd/polyfill/main.js",
|
|
@@ -134,5 +134,5 @@
|
|
|
134
134
|
"**/chokidar/glob-parent": "5.1.2",
|
|
135
135
|
"**/fast-glob/glob-parent": "5.1.2"
|
|
136
136
|
},
|
|
137
|
-
"gitHead": "
|
|
137
|
+
"gitHead": "15ef78b0d960fadd145370430b4caffd7b529fc6"
|
|
138
138
|
}
|