@transferwise/components 43.11.5-beta-f1bf5451ad.0 → 43.11.6-beta-3fc6e97dc9.0

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 +1 @@
1
- import{Alert as DangerIcon,AlertCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import Avatar,{AvatarType}from"../avatar";import Body from"../body";import Button from"../button";import{ControlType,Priority,Size,Typography}from"../common";import Title from"../title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function CriticalCommsBanner(a){var b=a.title,c=a.subtitle,d=a.action,e=a.className,f=useTheme(),g=f.isModern;return/*#__PURE__*/_jsxs("div",{className:classNames("critical-comms",e),children:[/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.ICON,className:"m-r-1",backgroundColor:g?"var(--color-sentiment-negative)":"var(--color-background-negative)",children:g?/*#__PURE__*/_jsx(AlertCircleFill,{}):/*#__PURE__*/_jsx(DangerIcon,{size:24})}),/*#__PURE__*/_jsxs("div",{className:"critical-comms-content d-flex align-items-center flex-grow-1",children:[/*#__PURE__*/_jsxs("div",{className:classNames("flex-grow-1",{"p-x-2":!g}),children:[/*#__PURE__*/_jsx(Title,{type:g?Typography.TITLE_BODY:Typography.TITLE_GROUP,className:"critical-comms--title",children:b}),/*#__PURE__*/_jsx(Body,{className:"critical-comms--subtitle",children:c})]}),d?/*#__PURE__*/_jsx("div",{className:"critical-comms--cta",children:/*#__PURE__*/_jsx(Button,{block:g,size:g?Size.MEDIUM:Size.SMALL,type:ControlType.NEGATIVE,priority:g?Priority.SECONDARY:Priority.PRIMARY,className:"cta-btn",onClick:function onClick(){d&&(window.location.href=d.href)},children:d.label})}):null]})]})}export default CriticalCommsBanner;
1
+ import{Alert as DangerIcon,AlertCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import Avatar,{AvatarType}from"../avatar";import Body from"../body";import Button from"../button";import{ControlType,Priority,Size,Typography}from"../common";import Title from"../title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function CriticalCommsBanner(a){var b=a.title,c=a.subtitle,d=a.action,e=a.className,f=useTheme(),g=f.isModern;return/*#__PURE__*/_jsx("div",{className:classNames("critical-comms",e),children:/*#__PURE__*/_jsxs("div",{className:"critical-comms-body",children:[/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.ICON,className:classNames(g?"m-r-2":"m-r-1"),backgroundColor:g?"var(--color-sentiment-negative)":"var(--color-background-negative)",children:g?/*#__PURE__*/_jsx(AlertCircleFill,{}):/*#__PURE__*/_jsx(DangerIcon,{size:24})}),/*#__PURE__*/_jsxs("div",{className:"critical-comms-content d-flex align-items-center flex-grow-1",children:[/*#__PURE__*/_jsxs("div",{className:classNames("flex-grow-1",{"p-x-2":!g}),children:[/*#__PURE__*/_jsx(Title,{type:g?Typography.TITLE_BODY:Typography.TITLE_GROUP,className:"critical-comms--title",children:b}),/*#__PURE__*/_jsx(Body,{className:"critical-comms--subtitle",children:c})]}),d?/*#__PURE__*/_jsx("div",{className:"critical-comms--cta",children:/*#__PURE__*/_jsx(Button,{block:g,size:Size.SMALL,type:ControlType.NEGATIVE,priority:g?Priority.SECONDARY:Priority.PRIMARY,className:"cta-btn",onClick:function onClick(){d&&(window.location.href=d.href)},children:d.label})}):null]})]})})}export default CriticalCommsBanner;
@@ -1,4 +1,4 @@
1
- import classNames from"classnames";import{useCallback,useEffect,useRef}from"react";import CSSTransition from"react-transition-group/CSSTransition";import{ThemeProvider,useTheme}from"@wise/components-theming";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
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 +1 @@
1
- import{Alert as DangerIcon,AlertCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import Avatar,{AvatarType}from"../avatar";import Body from"../body";import Button from"../button";import{ControlType,Priority,Size,Typography}from"../common";import Title from"../title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function CriticalCommsBanner(a){var b=a.title,c=a.subtitle,d=a.action,e=a.className,f=useTheme(),g=f.isModern;return/*#__PURE__*/_jsxs("div",{className:classNames("critical-comms",e),children:[/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.ICON,className:"m-r-1",backgroundColor:g?"var(--color-sentiment-negative)":"var(--color-background-negative)",children:g?/*#__PURE__*/_jsx(AlertCircleFill,{}):/*#__PURE__*/_jsx(DangerIcon,{size:24})}),/*#__PURE__*/_jsxs("div",{className:"critical-comms-content d-flex align-items-center flex-grow-1",children:[/*#__PURE__*/_jsxs("div",{className:classNames("flex-grow-1",{"p-x-2":!g}),children:[/*#__PURE__*/_jsx(Title,{type:g?Typography.TITLE_BODY:Typography.TITLE_GROUP,className:"critical-comms--title",children:b}),/*#__PURE__*/_jsx(Body,{className:"critical-comms--subtitle",children:c})]}),d?/*#__PURE__*/_jsx("div",{className:"critical-comms--cta",children:/*#__PURE__*/_jsx(Button,{block:g,size:g?Size.MEDIUM:Size.SMALL,type:ControlType.NEGATIVE,priority:g?Priority.SECONDARY:Priority.PRIMARY,className:"cta-btn",onClick:function onClick(){d&&(window.location.href=d.href)},children:d.label})}):null]})]})}export default CriticalCommsBanner;
1
+ import{Alert as DangerIcon,AlertCircleFill}from"@transferwise/icons";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import Avatar,{AvatarType}from"../avatar";import Body from"../body";import Button from"../button";import{ControlType,Priority,Size,Typography}from"../common";import Title from"../title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function CriticalCommsBanner(a){var b=a.title,c=a.subtitle,d=a.action,e=a.className,f=useTheme(),g=f.isModern;return/*#__PURE__*/_jsx("div",{className:classNames("critical-comms",e),children:/*#__PURE__*/_jsxs("div",{className:"critical-comms-body",children:[/*#__PURE__*/_jsx(Avatar,{size:Size.MEDIUM,type:AvatarType.ICON,className:classNames(g?"m-r-2":"m-r-1"),backgroundColor:g?"var(--color-sentiment-negative)":"var(--color-background-negative)",children:g?/*#__PURE__*/_jsx(AlertCircleFill,{}):/*#__PURE__*/_jsx(DangerIcon,{size:24})}),/*#__PURE__*/_jsxs("div",{className:"critical-comms-content d-flex align-items-center flex-grow-1",children:[/*#__PURE__*/_jsxs("div",{className:classNames("flex-grow-1",{"p-x-2":!g}),children:[/*#__PURE__*/_jsx(Title,{type:g?Typography.TITLE_BODY:Typography.TITLE_GROUP,className:"critical-comms--title",children:b}),/*#__PURE__*/_jsx(Body,{className:"critical-comms--subtitle",children:c})]}),d?/*#__PURE__*/_jsx("div",{className:"critical-comms--cta",children:/*#__PURE__*/_jsx(Button,{block:g,size:Size.SMALL,type:ControlType.NEGATIVE,priority:g?Priority.SECONDARY:Priority.PRIMARY,className:"cta-btn",onClick:function onClick(){d&&(window.location.href=d.href)},children:d.label})}):null]})]})})}export default CriticalCommsBanner;
@@ -1,4 +1,4 @@
1
- import classNames from"classnames";import{useCallback,useEffect,useRef}from"react";import CSSTransition from"react-transition-group/CSSTransition";import{ThemeProvider,useTheme}from"@wise/components-theming";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
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.