@transferwise/components 0.0.0-experimental-6d78be5 → 0.0.0-experimental-287a9d4

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,5 +1,5 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["small","size","displayInstantly","classNames"];import classnames from"classnames";import{useEffect,useState}from"react";import{Size}from"../common";// TODO: We gracefully depracated xs, lg and xl -- remove these as part of a future breaking change to this component
2
- import{jsx as _jsx}from"react/jsx-runtime";/**
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["small","size","displayInstantly","classNames"];import{useTheme}from"@wise/components-theming";import classnames from"classnames";import{useEffect,useState}from"react";import{Size}from"../common";// TODO: We gracefully depracated xs, lg and xl -- remove these as part of a future breaking change to this component
2
+ import{Fragment as _Fragment}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";/**
3
3
  * Loader component
4
4
  *
5
5
  * Docs link: https://transferwise.github.io/neptune-web/components/progress/Loader
@@ -8,4 +8,4 @@ import{jsx as _jsx}from"react/jsx-runtime";/**
8
8
  * @param root0.small
9
9
  * @param root0.size
10
10
  * @param root0.classNames
11
- */var Loader=function(a){var b=a.small,c=a.size,d=void 0===c?Size.MEDIUM:c,e=a.displayInstantly,f=void 0!==e&&e,g=a.classNames,h=void 0===g?{}:g,i=_objectWithoutProperties(a,_excluded),j=useState(f),k=_slicedToArray(j,2),l=k[0],m=k[1];useEffect(function(){var a,b;return f||(b=setTimeout(function(){a||m(!0)},1e3)),function(){a=!0,clearTimeout(b)}},[]);var n=function(a){return h[a]||a},o=void 0!==b&&b?Size.SMALL:d,p=getSupportedSize(o);return/*#__PURE__*/_jsx("div",{className:classnames(n("tw-loader"),n("tw-loader--".concat(p)),{"tw-loader--visible":l}),"data-testid":i["data-testid"]})},getSupportedSize=function(a){switch(a){case Size.SMALL:case Size.EXTRA_SMALL:return Size.SMALL;case Size.EXTRA_LARGE:case Size.LARGE:case Size.MEDIUM:default:return Size.MEDIUM;}};export default Loader;
11
+ */var Loader=function(a){var b=a.small,c=a.size,d=void 0===c?Size.MEDIUM:c,e=a.displayInstantly,f=void 0!==e&&e,g=a.classNames,h=void 0===g?{}:g,i=_objectWithoutProperties(a,_excluded),j=useTheme(),k=j.isForestGreenTheme,l=useState(f),m=_slicedToArray(l,2),n=m[0],o=m[1];useEffect(function(){var a,b;return f||(b=setTimeout(function(){a||o(!0)},1e3)),function(){a=!0,clearTimeout(b)}},[]);var p=function(a){return h[a]||a},q=void 0!==b&&b?Size.SMALL:d,r=getSupportedSize(q);return k?(console.warn("Loader is forbidden to use with Forest Green theme. Check the https://wise.design/components/screen-loader for more info."),/*#__PURE__*/_jsx(_Fragment,{})):/*#__PURE__*/_jsx("div",{className:classnames(p("tw-loader"),p("tw-loader--".concat(r)),{"tw-loader--visible":n}),"data-testid":i["data-testid"]})},getSupportedSize=function(a){switch(a){case Size.SMALL:case Size.EXTRA_SMALL:return Size.SMALL;case Size.EXTRA_LARGE:case Size.LARGE:case Size.MEDIUM:default:return Size.MEDIUM;}};export default Loader;
@@ -1,5 +1,5 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["small","size","displayInstantly","classNames"];import"core-js/modules/es.string.small.js";import classnames from"classnames";import{useEffect,useState}from"react";import{Size}from"../common";// TODO: We gracefully depracated xs, lg and xl -- remove these as part of a future breaking change to this component
2
- import{jsx as _jsx}from"react/jsx-runtime";/**
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["small","size","displayInstantly","classNames"];import"core-js/modules/es.string.small.js";import{useTheme}from"@wise/components-theming";import classnames from"classnames";import{useEffect,useState}from"react";import{Size}from"../common";// TODO: We gracefully depracated xs, lg and xl -- remove these as part of a future breaking change to this component
2
+ import{Fragment as _Fragment}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";/**
3
3
  * Loader component
4
4
  *
5
5
  * Docs link: https://transferwise.github.io/neptune-web/components/progress/Loader
@@ -8,4 +8,4 @@ import{jsx as _jsx}from"react/jsx-runtime";/**
8
8
  * @param root0.small
9
9
  * @param root0.size
10
10
  * @param root0.classNames
11
- */var Loader=function(a){var b=a.small,c=a.size,d=void 0===c?Size.MEDIUM:c,e=a.displayInstantly,f=void 0!==e&&e,g=a.classNames,h=void 0===g?{}:g,i=_objectWithoutProperties(a,_excluded),j=useState(f),k=_slicedToArray(j,2),l=k[0],m=k[1];useEffect(function(){var a,b;return f||(b=setTimeout(function(){a||m(!0)},1e3)),function(){a=!0,clearTimeout(b)}},[]);var n=function(a){return h[a]||a},o=void 0!==b&&b?Size.SMALL:d,p=getSupportedSize(o);return/*#__PURE__*/_jsx("div",{className:classnames(n("tw-loader"),n("tw-loader--".concat(p)),{"tw-loader--visible":l}),"data-testid":i["data-testid"]})},getSupportedSize=function(a){switch(a){case Size.SMALL:case Size.EXTRA_SMALL:return Size.SMALL;case Size.EXTRA_LARGE:case Size.LARGE:case Size.MEDIUM:default:return Size.MEDIUM;}};export default Loader;
11
+ */var Loader=function(a){var b=a.small,c=a.size,d=void 0===c?Size.MEDIUM:c,e=a.displayInstantly,f=void 0!==e&&e,g=a.classNames,h=void 0===g?{}:g,i=_objectWithoutProperties(a,_excluded),j=useTheme(),k=j.isForestGreenTheme,l=useState(f),m=_slicedToArray(l,2),n=m[0],o=m[1];useEffect(function(){var a,b;return f||(b=setTimeout(function(){a||o(!0)},1e3)),function(){a=!0,clearTimeout(b)}},[]);var p=function(a){return h[a]||a},q=void 0!==b&&b?Size.SMALL:d,r=getSupportedSize(q);return k?(console.warn("Loader is forbidden to use with Forest Green theme. Check the https://wise.design/components/screen-loader for more info."),/*#__PURE__*/_jsx(_Fragment,{})):/*#__PURE__*/_jsx("div",{className:classnames(p("tw-loader"),p("tw-loader--".concat(r)),{"tw-loader--visible":n}),"data-testid":i["data-testid"]})},getSupportedSize=function(a){switch(a){case Size.SMALL:case Size.EXTRA_SMALL:return Size.SMALL;case Size.EXTRA_LARGE:case Size.LARGE:case Size.MEDIUM:default:return Size.MEDIUM;}};export default Loader;