@transferwise/components 44.1.2 → 45.0.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.
- package/build/es/no-polyfill/actionButton/ActionButton.story.js +1 -1
- package/build/es/no-polyfill/actionOption/ActionOption.story.js +1 -1
- package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.js +2 -1
- package/build/es/no-polyfill/body/Body.story.js +1 -1
- package/build/es/no-polyfill/button/Button.js +1 -1
- package/build/es/no-polyfill/checkboxButton/CheckboxButton.story.js +1 -1
- package/build/es/no-polyfill/checkboxOption/CheckboxOption.story.js +1 -1
- package/build/es/no-polyfill/chips/Chips.story.js +1 -1
- package/build/es/no-polyfill/common/bottomSheet/BottomSheet.js +21 -1
- package/build/es/no-polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -1
- package/build/es/no-polyfill/common/requirements.js +19 -1
- package/build/es/no-polyfill/dateInput/DateInput.js +7 -1
- package/build/es/no-polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
- package/build/es/no-polyfill/dimmer/dimmerManager/DimmerManager.js +2 -2
- package/build/es/no-polyfill/emphasis/EmphasisHtmlTransformer.js +1 -1
- package/build/es/no-polyfill/i18n/en.json +0 -3
- package/build/es/no-polyfill/modal/Modal.js +2 -1
- package/build/es/no-polyfill/modal/Modal.story.js +1 -1
- package/build/es/no-polyfill/progressBar/ProgressBar.story.js +1 -1
- package/build/es/no-polyfill/section/Section.story.js +1 -1
- package/build/es/no-polyfill/select/Select.js +3 -3
- package/build/es/no-polyfill/slidingPanel/SlidingPanel.js +1 -1
- package/build/es/no-polyfill/switchOption/SwitchOption.story.js +1 -1
- package/build/es/no-polyfill/tabs/Tabs.js +6 -1
- package/build/es/no-polyfill/tooltip/Tooltip.story.js +1 -1
- package/build/es/no-polyfill/upload/Upload.js +3 -3
- package/build/es/no-polyfill/upload/steps/processingStep/processingStep.js +1 -1
- package/build/es/no-polyfill/uploadInput/UploadInput.story.js +1 -1
- package/build/es/no-polyfill/withDisplayFormat/WithDisplayFormat.js +2 -1
- package/build/es/polyfill/actionButton/ActionButton.story.js +1 -1
- package/build/es/polyfill/actionOption/ActionOption.story.js +1 -1
- package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +2 -1
- package/build/es/polyfill/body/Body.story.js +1 -1
- package/build/es/polyfill/button/Button.js +1 -1
- package/build/es/polyfill/checkboxButton/CheckboxButton.story.js +1 -1
- package/build/es/polyfill/checkboxOption/CheckboxOption.story.js +1 -1
- package/build/es/polyfill/chips/Chips.story.js +1 -1
- package/build/es/polyfill/common/bottomSheet/BottomSheet.js +21 -1
- package/build/es/polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -1
- package/build/es/polyfill/common/requirements.js +19 -1
- package/build/es/polyfill/dateInput/DateInput.js +7 -1
- package/build/es/polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
- package/build/es/polyfill/dimmer/dimmerManager/DimmerManager.js +2 -2
- package/build/es/polyfill/emphasis/EmphasisHtmlTransformer.js +1 -1
- package/build/es/polyfill/i18n/en.json +0 -3
- package/build/es/polyfill/modal/Modal.js +2 -1
- package/build/es/polyfill/modal/Modal.story.js +1 -1
- package/build/es/polyfill/progressBar/ProgressBar.story.js +1 -1
- package/build/es/polyfill/section/Section.story.js +1 -1
- package/build/es/polyfill/select/Select.js +3 -3
- package/build/es/polyfill/slidingPanel/SlidingPanel.js +1 -1
- package/build/es/polyfill/switchOption/SwitchOption.story.js +1 -1
- package/build/es/polyfill/tabs/Tabs.js +6 -1
- package/build/es/polyfill/tooltip/Tooltip.story.js +1 -1
- package/build/es/polyfill/upload/Upload.js +3 -3
- package/build/es/polyfill/upload/steps/processingStep/processingStep.js +1 -1
- package/build/es/polyfill/uploadInput/UploadInput.story.js +1 -1
- package/build/es/polyfill/withDisplayFormat/WithDisplayFormat.js +2 -1
- package/build/i18n/en.json +0 -3
- package/build/main.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/types/actionButton/ActionButton.story.d.ts +4 -3
- package/build/types/actionOption/ActionOption.story.d.ts +12 -15
- package/build/types/body/Body.story.d.ts +2 -1
- package/build/types/checkboxButton/CheckboxButton.story.d.ts +1 -4
- package/build/types/checkboxOption/CheckboxOption.story.d.ts +4 -7
- package/build/types/chips/Chips.story.d.ts +13 -6
- package/build/types/modal/Modal.story.d.ts +2 -1
- package/build/types/progressBar/ProgressBar.story.d.ts +5 -7
- package/build/types/test-utils/GlobalsDecorator.d.ts +5 -0
- package/build/types/test-utils/fake-data.d.ts +5 -0
- package/build/types/test-utils/index.d.ts +2 -6
- package/build/types/test-utils/story-config.d.ts +54 -0
- package/build/types/tooltip/Tooltip.story.d.ts +8 -1
- package/build/types/upload/Upload.d.ts +1 -0
- package/build/types/upload/steps/processingStep/processingStep.d.ts +1 -0
- package/build/types/uploadInput/UploadInput.story.d.ts +35 -18
- package/build/umd/no-polyfill/main.js +1 -1
- package/build/umd/polyfill/main.js +1 -1
- package/package.json +4 -8
- package/build/es/no-polyfill/lab/index.js +0 -1
- package/build/es/no-polyfill/lab/mobileNav/MobileNav.js +0 -9
- package/build/es/no-polyfill/lab/mobileNav/index.js +0 -1
- package/build/es/no-polyfill/lab/mobileNav/utils/index.js +0 -1
- package/build/es/no-polyfill/lab/mobileNav/utils/isIpadOsSafari/index.js +0 -1
- package/build/es/no-polyfill/lab/mobileNav/utils/isIpadOsSafari/isIpadOsSafari.js +0 -1
- package/build/es/no-polyfill/lab/mobileNav/utils/isMobileSafari/index.js +0 -1
- package/build/es/no-polyfill/lab/mobileNav/utils/isMobileSafari/isMobileSafari.js +0 -1
- package/build/es/no-polyfill/lab/pagination/Pagination.js +0 -1
- package/build/es/no-polyfill/lab/pagination/Pagination.messages.js +0 -1
- package/build/es/no-polyfill/lab/pagination/index.js +0 -1
- package/build/es/no-polyfill/lab/pagination/paginationLink/PaginationLink.js +0 -1
- package/build/es/no-polyfill/lab/pagination/paginationLink/PaginationLink.messages.js +0 -1
- package/build/es/no-polyfill/lab/pagination/paginationLink/index.js +0 -1
- package/build/es/no-polyfill/withNormaliser/WithNormalizer.js +0 -7
- package/build/es/no-polyfill/withNormaliser/index.js +0 -1
- package/build/es/no-polyfill/withNormaliser/validation/event-utilities/index.js +0 -1
- package/build/es/polyfill/lab/index.js +0 -1
- package/build/es/polyfill/lab/mobileNav/MobileNav.js +0 -9
- package/build/es/polyfill/lab/mobileNav/index.js +0 -1
- package/build/es/polyfill/lab/mobileNav/utils/index.js +0 -1
- package/build/es/polyfill/lab/mobileNav/utils/isIpadOsSafari/index.js +0 -1
- package/build/es/polyfill/lab/mobileNav/utils/isIpadOsSafari/isIpadOsSafari.js +0 -1
- package/build/es/polyfill/lab/mobileNav/utils/isMobileSafari/index.js +0 -1
- package/build/es/polyfill/lab/mobileNav/utils/isMobileSafari/isMobileSafari.js +0 -1
- package/build/es/polyfill/lab/pagination/Pagination.js +0 -1
- package/build/es/polyfill/lab/pagination/Pagination.messages.js +0 -1
- package/build/es/polyfill/lab/pagination/index.js +0 -1
- package/build/es/polyfill/lab/pagination/paginationLink/PaginationLink.js +0 -1
- package/build/es/polyfill/lab/pagination/paginationLink/PaginationLink.messages.js +0 -1
- package/build/es/polyfill/lab/pagination/paginationLink/index.js +0 -1
- package/build/es/polyfill/withNormaliser/WithNormalizer.js +0 -7
- package/build/es/polyfill/withNormaliser/index.js +0 -1
- package/build/es/polyfill/withNormaliser/validation/event-utilities/index.js +0 -1
- package/build/styles/lab/mobileNav/MobileNav.css +0 -1
- package/build/styles/lab/pagination/Pagination.css +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "45.0.0",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "./build/umd/polyfill/main.js",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"scripts": {
|
|
24
24
|
"dev": "npm-run-all --parallel dev:*",
|
|
25
25
|
"dev:watch-less": "gulp watchLess --dest=src",
|
|
26
|
-
"dev:storybook": "
|
|
26
|
+
"dev:storybook": "storybook dev -p 3001",
|
|
27
27
|
"dev:translations": "npx npm-watch",
|
|
28
28
|
"build": "npm-run-all build:*",
|
|
29
29
|
"build:clean": "rm -rf lib build",
|
|
@@ -41,17 +41,14 @@
|
|
|
41
41
|
"test": "jest --env=jsdom --maxWorkers=4 --config=../../node_modules/@transferwise/test-config/jest.config.js",
|
|
42
42
|
"test:watch": "jest --watch --env=jsdom --config=../../node_modules/@transferwise/test-config/jest.config.js",
|
|
43
43
|
"lint": "jest --maxWorkers=4 --config ../../node_modules/@transferwise/test-config/test/jest.lint.js",
|
|
44
|
-
"test:visual": "build-storybook && percy storybook ./storybook-static",
|
|
45
44
|
"lint:fix": "eslint 'src/**/*.{js,ts,tsx}' --fix",
|
|
46
|
-
"build-storybook": "build
|
|
45
|
+
"build-storybook": "storybook build"
|
|
47
46
|
},
|
|
48
47
|
"bin": {
|
|
49
48
|
"neptune-upgrade-util": "scripts/neptune-upgrader.js"
|
|
50
49
|
},
|
|
51
50
|
"devDependencies": {
|
|
52
51
|
"@formatjs/cli": "^4.8.3",
|
|
53
|
-
"@percy/cli": "^1.1.0",
|
|
54
|
-
"@percy/storybook": "^4.2.0",
|
|
55
52
|
"@rollup/plugin-babel": "^5.2.2",
|
|
56
53
|
"@rollup/plugin-commonjs": "^11.0.2",
|
|
57
54
|
"@rollup/plugin-image": "^3.0.1",
|
|
@@ -65,7 +62,7 @@
|
|
|
65
62
|
"@types/jest": "^26.0.20",
|
|
66
63
|
"@types/jscodeshift": "^0.11.0",
|
|
67
64
|
"@types/node": "^14.14.31",
|
|
68
|
-
"@types/react-transition-group": "4.4.
|
|
65
|
+
"@types/react-transition-group": "4.4.2",
|
|
69
66
|
"@wise/art": "^2.0.1",
|
|
70
67
|
"@wise/components-theming": "^0.7.4",
|
|
71
68
|
"babel-plugin-inline-react-svg": "^2.0.1",
|
|
@@ -102,7 +99,6 @@
|
|
|
102
99
|
"@react-spring/web": "~9.6.1",
|
|
103
100
|
"@transferwise/formatting": "^2.1.0",
|
|
104
101
|
"@transferwise/neptune-validation": "^3.0.12",
|
|
105
|
-
"@types/react-transition-group": "4.4.5",
|
|
106
102
|
"classnames": "^2.2.6",
|
|
107
103
|
"commonmark": "0.29.1",
|
|
108
104
|
"core-js": "^3.8.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default as MobileNav}from"./mobileNav";export{default as Pagination,PaginationType}from"./pagination";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import classNames from"classnames";import PropTypes from"prop-types";import{useEffect,useCallback,useState}from"react";import{isIpadOsSafari,isMobileSafari}from"./utils";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function useMobileNavReference(){var a=useState(null),b=_slicedToArray(a,2),c=b[0],d=b[1],e=useCallback(function(a){null!==a&&d(a)},[]);return[c,e]}var mobileNavType={CALL_TO_ACTION:"call-to-action"},MobileNav=function(a){var b=a.items,c=a.activeItemPath,d=useState(!1),e=_slicedToArray(d,2),f=e[0],g=e[1],h=useMobileNavReference(),i=_slicedToArray(h,2),j=i[0],k=i[1];return useEffect(function(){/**
|
|
2
|
-
* This attempts to reposition the Mobile Nav when iOS Safari "Open in App" Banner is visible.
|
|
3
|
-
* The Banner appears due to Universal Links. https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html
|
|
4
|
-
* Essentially when a path matches in https://wise.com/.well-known/apple-app-site-association the banner is shown.
|
|
5
|
-
* The banner isn't injected into the page yet pushes the page frame down and thus the mobile nav is not visible due to its fixed positioning.
|
|
6
|
-
* Luckily window.innerHeight changes when the banner is in view so we use this to calculate if we need to adjust the mobile nav positioning.
|
|
7
|
-
*/var a,b=function(){a&&window.cancelAnimationFrame(a),a=window.requestAnimationFrame(function(){// Banner only possible at top of page or at negative page scroll
|
|
8
|
-
if(0<window.scrollY)return void g(!1);var a=j.getBoundingClientRect(),b=a.bottom,c=f?44:0,d=Math.floor(b)+c+window.scrollY>window.innerHeight;// measure position of mobile nav relative to the viewport
|
|
9
|
-
d?0===window.scrollY&&g(!0):g(!1)})},c=window.innerHeight,d=function(){document.hidden?c=window.innerHeight:(c!==window.innerHeight&&g(!1),b())};return(isMobileSafari()||isIpadOsSafari())&&null!==j&&(b(),window.addEventListener("resize",b),window.addEventListener("scroll",b),document.addEventListener("visibilitychange",d)),function(){window.removeEventListener("resize",b),window.removeEventListener("scroll",b),document.removeEventListener("visibilitychange",d)}},[j,f]),/*#__PURE__*/_jsx("div",{ref:k,className:classNames("mobileNav",{"mobileNav--with-open-in-app-banner":f}),children:/*#__PURE__*/_jsx("ul",{className:"mobileNav__items",children:b.map(function(a){return/*#__PURE__*/_jsx("li",{className:classNames("mobileNavItem",{"mobileNavItem--call-to-action":a.type===mobileNavType.CALL_TO_ACTION,"mobileNavItem--active":c===a.path}),children:a.path&&/*#__PURE__*/_jsxs("a",{className:"mobileNavItem__link",href:a.path,onClick:a.onClick,children:[/*#__PURE__*/_jsx("span",{className:"mobileNavItem__icon",children:a.icon}),/*#__PURE__*/_jsx("span",{className:"mobileNavItem__label",children:a.label})]})},a.path)})})})};MobileNav.mobileNavType=mobileNavType,MobileNav.propTypes={activeItemPath:PropTypes.string,items:PropTypes.arrayOf(PropTypes.shape({icon:PropTypes.node.isRequired,label:PropTypes.string.isRequired,path:PropTypes.string.isRequired,type:PropTypes.oneOf([mobileNavType.CALL_TO_ACTION]),hidden:PropTypes.bool})).isRequired},MobileNav.defaultProps={activeItemPath:null};export default MobileNav;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./MobileNav";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default as isIpadOsSafari}from"./isIpadOsSafari";export{default as isMobileSafari}from"./isMobileSafari";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./isIpadOsSafari";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var isIpadOsSafari=function(){if("undefined"==typeof window||"undefined"==typeof window.navigator)return!1;var a=window,b=a.navigator;return b.maxTouchPoints&&2<b.maxTouchPoints&&/WebKit/i.test(b.userAgent)&&/Safari/i.test(b.userAgent)&&/MacIntel/.test(b.platform)};export default isIpadOsSafari;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./isMobileSafari";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
var isMobileSafari=function(){if("undefined"==typeof window||"undefined"==typeof window.navigator)return!1;var a=window,b=a.navigator.userAgent;return /iP(ad|od|hone)/i.test(b)&&/WebKit/i.test(b)&&!/(CriOS|FxiOS|OPiOS|mercury)/i.test(b)};export default isMobileSafari;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{ChevronLeft,ChevronRight}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{useIntl}from"react-intl";import messages from"./Pagination.messages";import PaginationLink from"./paginationLink";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Type={NUMBERS_ONLY:"numbersOnly",ARROWS_ONLY:"arrowsOnly",FULL:"full"},Pagination=function(a){var b=a.type,c=a.numberOfPages,d=a.currentPageIndex,e=a.onClick,f=a.canFetchMorePages,g=a.className,h=b!==Type.NUMBERS_ONLY,i=[];if(b!==Type.ARROWS_ONLY){switch(d){case 0:i.push({index:0,active:!0}),1<c&&i.push({index:1}),2<c&&i.push({index:2});break;case c-1:2<c&&i.push({index:c-3}),1<c&&i.push({index:c-2}),i.push({index:c-1,active:!0});break;default:i.push({index:d-1},{index:d,active:!0},{index:d+1});}var j=i[0].index;0<j&&(2<j?i.unshift({label:"...",index:j-1}):2===j&&i.unshift({index:1}),i.unshift({index:0}));var k=i[i.length-1].index;k<c-1&&(k<c-3?i.push({label:"...",index:k+1}):k===c-3&&i.push({index:c-2}),i.push({index:c-1})),f&&i.push({label:"...",index:c})}var l=useIntl();return/*#__PURE__*/_jsx("nav",{role:"navigation","aria-label":l.formatMessage(messages.ariaLabel),children:/*#__PURE__*/_jsxs("ul",{className:classNames("tw-pagination",g),children:[h&&/*#__PURE__*/_jsx(PaginationLink,{pageNumber:d-1,disabled:0===d,onClick:e,children:/*#__PURE__*/_jsx(ChevronLeft,{})}),i.map(function(a){var b=a.label||a.index+1;return/*#__PURE__*/_jsx(PaginationLink,{pageNumber:a.index,active:a.active,onClick:e,children:b},a.index)}),h&&/*#__PURE__*/_jsx(PaginationLink,{pageNumber:d+1,disabled:!f&&d===c-1,onClick:e,children:/*#__PURE__*/_jsx(ChevronRight,{})})]})})};Pagination.propTypes={type:PropTypes.oneOf(["numbersOnly","arrowsOnly","full"]),numberOfPages:PropTypes.number.isRequired,currentPageIndex:PropTypes.number.isRequired,onClick:PropTypes.func.isRequired,canFetchMorePages:PropTypes.bool,className:PropTypes.string},Pagination.defaultProps={type:Type.FULL,canFetchMorePages:!1,className:void 0};export{Type as PaginationType};export default Pagination;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{defineMessages}from"react-intl";export default defineMessages({ariaLabel:{id:"neptune.Pagination.ariaLabel"}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default,PaginationType}from"./Pagination";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import{useIntl}from"react-intl";import messages from"./PaginationLink.messages";import{jsx as _jsx}from"react/jsx-runtime";var PaginationLink=function(a){var b=a.disabled,c=a.active,d=a.pageNumber,e=a.onClick,f=a.children,g=useIntl(),h=function(a){a.preventDefault(),b||c||e(d)},i=g.formatMessage(c?messages.ariaLabelActive:messages.ariaLabelInactive,{pageNumber:d});return/*#__PURE__*/_jsx("li",{children:/*#__PURE__*/_jsx("a",{href:"/","aria-label":i,"aria-current":c,className:classNames({disabled:b,active:c}),onClick:h,onKeyDown:function handleKeyDown(a){"Enter"===a.key&&h(a)},children:f})})};PaginationLink.propTypes={disabled:PropTypes.bool,active:PropTypes.bool,onClick:PropTypes.func.isRequired,pageNumber:PropTypes.number.isRequired,children:PropTypes.node.isRequired},PaginationLink.defaultProps={disabled:!1,active:!1};export default PaginationLink;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{defineMessages}from"react-intl";export default defineMessages({ariaLabelActive:{id:"neptune.PaginationLink.ariaLabel.active"},ariaLabelInactive:{id:"neptune.PaginationLink.ariaLabel.inactive"}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./PaginationLink";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{cloneElement}from"react";import{normalizeEvent}from"./validation/event-utilities";var methodsToExtend=["onChange","onBlur","onFocus","onSuccess","onFailure"],WithNormaliser=function(a){var b=a.children,c=function(a){return function(c){var d=normalizeEvent(c,b.props.type);a(d)}},d={};return methodsToExtend.forEach(function(a){b.props[a]&&(d[a]=c(b.props[a]))}),/*#__PURE__*/cloneElement(b,_objectSpread({},d))};/**
|
|
2
|
-
*
|
|
3
|
-
* This function is a temporary function used to normalize the returned values from our form related components. Please DO NOT USE THIS COMPONENT.
|
|
4
|
-
*
|
|
5
|
-
* @param root0
|
|
6
|
-
* @param root0.children
|
|
7
|
-
*/export default WithNormaliser;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./WithNormalizer";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{isNull,isNumber,isUndefined}from"@transferwise/neptune-validation";function isSyntheticEvent(a){return!isNull(a)&&!isUndefined(a)&&!!a.nativeEvent&&a.nativeEvent instanceof Event}var normalizeEvent=function(a,b){var c=a;return a&&(isSyntheticEvent(a)?c="number"===b?parseFloat(a.target.value):a.target.value:(isNumber(a.value)||!isUndefined(a.value))&&(c=a.value)),c};export{isSyntheticEvent,normalizeEvent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default as MobileNav}from"./mobileNav";export{default as Pagination,PaginationType}from"./pagination";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"core-js/modules/es.array.map.js";import classNames from"classnames";import PropTypes from"prop-types";import{useEffect,useCallback,useState}from"react";import{isIpadOsSafari,isMobileSafari}from"./utils";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function useMobileNavReference(){var a=useState(null),b=_slicedToArray(a,2),c=b[0],d=b[1],e=useCallback(function(a){null!==a&&d(a)},[]);return[c,e]}var mobileNavType={CALL_TO_ACTION:"call-to-action"},MobileNav=function(a){var b=a.items,c=a.activeItemPath,d=useState(!1),e=_slicedToArray(d,2),f=e[0],g=e[1],h=useMobileNavReference(),i=_slicedToArray(h,2),j=i[0],k=i[1];return useEffect(function(){/**
|
|
2
|
-
* This attempts to reposition the Mobile Nav when iOS Safari "Open in App" Banner is visible.
|
|
3
|
-
* The Banner appears due to Universal Links. https://developer.apple.com/library/archive/documentation/General/Conceptual/AppSearch/UniversalLinks.html
|
|
4
|
-
* Essentially when a path matches in https://wise.com/.well-known/apple-app-site-association the banner is shown.
|
|
5
|
-
* The banner isn't injected into the page yet pushes the page frame down and thus the mobile nav is not visible due to its fixed positioning.
|
|
6
|
-
* Luckily window.innerHeight changes when the banner is in view so we use this to calculate if we need to adjust the mobile nav positioning.
|
|
7
|
-
*/var a,b=function(){a&&window.cancelAnimationFrame(a),a=window.requestAnimationFrame(function(){// Banner only possible at top of page or at negative page scroll
|
|
8
|
-
if(0<window.scrollY)return void g(!1);var a=j.getBoundingClientRect(),b=a.bottom,c=f?44:0,d=Math.floor(b)+c+window.scrollY>window.innerHeight;// measure position of mobile nav relative to the viewport
|
|
9
|
-
d?0===window.scrollY&&g(!0):g(!1)})},c=window.innerHeight,d=function(){document.hidden?c=window.innerHeight:(c!==window.innerHeight&&g(!1),b())};return(isMobileSafari()||isIpadOsSafari())&&null!==j&&(b(),window.addEventListener("resize",b),window.addEventListener("scroll",b),document.addEventListener("visibilitychange",d)),function(){window.removeEventListener("resize",b),window.removeEventListener("scroll",b),document.removeEventListener("visibilitychange",d)}},[j,f]),/*#__PURE__*/_jsx("div",{ref:k,className:classNames("mobileNav",{"mobileNav--with-open-in-app-banner":f}),children:/*#__PURE__*/_jsx("ul",{className:"mobileNav__items",children:b.map(function(a){return/*#__PURE__*/_jsx("li",{className:classNames("mobileNavItem",{"mobileNavItem--call-to-action":a.type===mobileNavType.CALL_TO_ACTION,"mobileNavItem--active":c===a.path}),children:a.path&&/*#__PURE__*/_jsxs("a",{className:"mobileNavItem__link",href:a.path,onClick:a.onClick,children:[/*#__PURE__*/_jsx("span",{className:"mobileNavItem__icon",children:a.icon}),/*#__PURE__*/_jsx("span",{className:"mobileNavItem__label",children:a.label})]})},a.path)})})})};MobileNav.mobileNavType=mobileNavType,MobileNav.propTypes={activeItemPath:PropTypes.string,items:PropTypes.arrayOf(PropTypes.shape({icon:PropTypes.node.isRequired,label:PropTypes.string.isRequired,path:PropTypes.string.isRequired,type:PropTypes.oneOf([mobileNavType.CALL_TO_ACTION]),hidden:PropTypes.bool})).isRequired},MobileNav.defaultProps={activeItemPath:null};export default MobileNav;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./MobileNav";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default as isIpadOsSafari}from"./isIpadOsSafari";export{default as isMobileSafari}from"./isMobileSafari";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./isIpadOsSafari";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"core-js/modules/es.regexp.exec.js";var isIpadOsSafari=function(){if("undefined"==typeof window||"undefined"==typeof window.navigator)return!1;var a=window,b=a.navigator;return b.maxTouchPoints&&2<b.maxTouchPoints&&/WebKit/i.test(b.userAgent)&&/Safari/i.test(b.userAgent)&&/MacIntel/.test(b.platform)};export default isIpadOsSafari;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./isMobileSafari";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"core-js/modules/es.regexp.exec.js";var isMobileSafari=function(){if("undefined"==typeof window||"undefined"==typeof window.navigator)return!1;var a=window,b=a.navigator.userAgent;return /iP(ad|od|hone)/i.test(b)&&/WebKit/i.test(b)&&!/(CriOS|FxiOS|OPiOS|mercury)/i.test(b)};export default isMobileSafari;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"core-js/modules/es.array.map.js";import{ChevronLeft,ChevronRight}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{useIntl}from"react-intl";import messages from"./Pagination.messages";import PaginationLink from"./paginationLink";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Type={NUMBERS_ONLY:"numbersOnly",ARROWS_ONLY:"arrowsOnly",FULL:"full"},Pagination=function(a){var b=a.type,c=a.numberOfPages,d=a.currentPageIndex,e=a.onClick,f=a.canFetchMorePages,g=a.className,h=b!==Type.NUMBERS_ONLY,i=[];if(b!==Type.ARROWS_ONLY){switch(d){case 0:i.push({index:0,active:!0}),1<c&&i.push({index:1}),2<c&&i.push({index:2});break;case c-1:2<c&&i.push({index:c-3}),1<c&&i.push({index:c-2}),i.push({index:c-1,active:!0});break;default:i.push({index:d-1},{index:d,active:!0},{index:d+1});}var j=i[0].index;0<j&&(2<j?i.unshift({label:"...",index:j-1}):2===j&&i.unshift({index:1}),i.unshift({index:0}));var k=i[i.length-1].index;k<c-1&&(k<c-3?i.push({label:"...",index:k+1}):k===c-3&&i.push({index:c-2}),i.push({index:c-1})),f&&i.push({label:"...",index:c})}var l=useIntl();return/*#__PURE__*/_jsx("nav",{role:"navigation","aria-label":l.formatMessage(messages.ariaLabel),children:/*#__PURE__*/_jsxs("ul",{className:classNames("tw-pagination",g),children:[h&&/*#__PURE__*/_jsx(PaginationLink,{pageNumber:d-1,disabled:0===d,onClick:e,children:/*#__PURE__*/_jsx(ChevronLeft,{})}),i.map(function(a){var b=a.label||a.index+1;return/*#__PURE__*/_jsx(PaginationLink,{pageNumber:a.index,active:a.active,onClick:e,children:b},a.index)}),h&&/*#__PURE__*/_jsx(PaginationLink,{pageNumber:d+1,disabled:!f&&d===c-1,onClick:e,children:/*#__PURE__*/_jsx(ChevronRight,{})})]})})};Pagination.propTypes={type:PropTypes.oneOf(["numbersOnly","arrowsOnly","full"]),numberOfPages:PropTypes.number.isRequired,currentPageIndex:PropTypes.number.isRequired,onClick:PropTypes.func.isRequired,canFetchMorePages:PropTypes.bool,className:PropTypes.string},Pagination.defaultProps={type:Type.FULL,canFetchMorePages:!1,className:void 0};export{Type as PaginationType};export default Pagination;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{defineMessages}from"react-intl";export default defineMessages({ariaLabel:{id:"neptune.Pagination.ariaLabel"}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default,PaginationType}from"./Pagination";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import{useIntl}from"react-intl";import messages from"./PaginationLink.messages";import{jsx as _jsx}from"react/jsx-runtime";var PaginationLink=function(a){var b=a.disabled,c=a.active,d=a.pageNumber,e=a.onClick,f=a.children,g=useIntl(),h=function(a){a.preventDefault(),b||c||e(d)},i=g.formatMessage(c?messages.ariaLabelActive:messages.ariaLabelInactive,{pageNumber:d});return/*#__PURE__*/_jsx("li",{children:/*#__PURE__*/_jsx("a",{href:"/","aria-label":i,"aria-current":c,className:classNames({disabled:b,active:c}),onClick:h,onKeyDown:function handleKeyDown(a){"Enter"===a.key&&h(a)},children:f})})};PaginationLink.propTypes={disabled:PropTypes.bool,active:PropTypes.bool,onClick:PropTypes.func.isRequired,pageNumber:PropTypes.number.isRequired,children:PropTypes.node.isRequired},PaginationLink.defaultProps={disabled:!1,active:!1};export default PaginationLink;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{defineMessages}from"react-intl";export default defineMessages({ariaLabelActive:{id:"neptune.PaginationLink.ariaLabel.active"},ariaLabelInactive:{id:"neptune.PaginationLink.ariaLabel.inactive"}});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./PaginationLink";
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.object.to-string.js";import{cloneElement}from"react";import{normalizeEvent}from"./validation/event-utilities";var methodsToExtend=["onChange","onBlur","onFocus","onSuccess","onFailure"],WithNormaliser=function(a){var b=a.children,c=function(a){return function(c){var d=normalizeEvent(c,b.props.type);a(d)}},d={};return methodsToExtend.forEach(function(a){b.props[a]&&(d[a]=c(b.props[a]))}),/*#__PURE__*/cloneElement(b,_objectSpread({},d))};/**
|
|
2
|
-
*
|
|
3
|
-
* This function is a temporary function used to normalize the returned values from our form related components. Please DO NOT USE THIS COMPONENT.
|
|
4
|
-
*
|
|
5
|
-
* @param root0
|
|
6
|
-
* @param root0.children
|
|
7
|
-
*/export default WithNormaliser;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export{default}from"./WithNormalizer";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import"core-js/modules/es.parse-float.js";import{isNull,isNumber,isUndefined}from"@transferwise/neptune-validation";function isSyntheticEvent(a){return!isNull(a)&&!isUndefined(a)&&!!a.nativeEvent&&a.nativeEvent instanceof Event}var normalizeEvent=function(a,b){var c=a;return a&&(isSyntheticEvent(a)?c="number"===b?parseFloat(a.target.value):a.target.value:(isNumber(a.value)||!isUndefined(a.value))&&(c=a.value)),c};export{isSyntheticEvent,normalizeEvent};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.mobileNav{background:#fff;background:var(--color-background-screen);border-top:1px solid #0000001a;border-top:1px solid var(--color-border-neutral);bottom:0;display:flex;height:48px;justify-content:center;left:0;margin-top:21px;position:fixed;right:0;transition:transform .08s linear .12s;width:100%;z-index:8}[dir=rtl] .mobileNav{left:auto;left:0;right:0;right:auto}@supports (transform:translate3d(0,calc(env(safe-area-inset-bottom) * -1),0)){.mobileNav{transform:translate3d(0,calc(env(safe-area-inset-bottom)*-1),0)}}.mobileNav:after{background:#fff;background:var(--color-background-screen);content:"";display:block;height:150px;left:0;position:absolute;right:0;top:47px;width:100%;z-index:0}[dir=rtl] .mobileNav:after{left:auto;left:0;right:0;right:auto}@media (min-width:769px){.mobileNav{display:none}}.mobileNav--with-open-in-app-banner{transform:translate3d(0,-44px,0)}@supports (transform:translate3d(0,calc(-44px + env(safe-area-inset-bottom) * -1),0)){.mobileNav--with-open-in-app-banner{transform:translate3d(0,calc(-44px + env(safe-area-inset-bottom)*-1),0)}}.mobileNav__items{display:flex;flex:0 1 414px;justify-content:center;list-style-type:none;margin:0;padding:0;z-index:1}[dir=rtl] .mobileNav__items{padding:0}.mobileNavItem{align-items:center;background:#fff;background:var(--color-background-screen);display:flex;flex:0 1 82px;justify-content:center}.mobileNavItem.mobileNavItem--active .mobileNavItem__link{color:#0097c7;color:var(--color-content-accent)}.mobileNavItem.mobileNavItem--call-to-action .mobileNavItem__link{box-sizing:border-box}.mobileNavItem.mobileNavItem--call-to-action .mobileNavItem__link:before{background:#fff;background:var(--color-background-screen);border:1px solid #0000001a;border:1px solid var(--color-border-neutral);border-bottom:0;border-radius:24px 24px 0 0;box-sizing:content-box;content:"";height:24px;left:0;min-height:24px;position:relative;top:-23px;width:48px}[dir=rtl] .mobileNavItem.mobileNavItem--call-to-action .mobileNavItem__link:before{left:auto;right:0}.mobileNavItem.mobileNavItem--call-to-action .mobileNavItem__link:after{background:#fff;background:var(--color-background-screen);content:"";height:6px;left:0;position:absolute;top:0;width:100%}[dir=rtl] .mobileNavItem.mobileNavItem--call-to-action .mobileNavItem__link:after{left:auto;right:0}.mobileNavItem.mobileNavItem--call-to-action .mobileNavItem__icon{color:#fff;color:var(--color-background-screen);margin:-45px 0 0;padding:10px;z-index:2}.mobileNavItem.mobileNavItem--call-to-action .mobileNavItem__icon:before{background:#2ead4b;background:var(--color-interactive-positive);border-radius:50%;content:"";display:block;height:40px;left:calc(50% - 20px);position:absolute;top:-13px;width:40px;z-index:1}[dir=rtl] .mobileNavItem.mobileNavItem--call-to-action .mobileNavItem__icon:before{left:auto;right:calc(50% - 20px)}.mobileNavItem.mobileNavItem--call-to-action:hover .mobileNavItem__icon:before{background:#069939;background:var(--color-interactive-positive-hover)}.mobileNavItem__icon{align-items:center;display:flex;justify-content:center;width:100%}.mobileNavItem__icon .tw-icon{position:relative;z-index:2}.mobileNavItem__link{align-items:center;color:#37517e;color:var(--color-content-primary);display:flex;flex:0 0 100%;flex-direction:column;justify-content:center;padding-top:5px;position:relative;text-decoration:none}.mobileNavItem__label{display:inline-block;flex:0 0 auto;font-family:Inter,Helvetica,Arial,sans-serif;font-family:var(--font-family-regular);font-size:10px;font-style:normal;font-weight:400;letter-spacing:.24px;line-height:16px;padding-top:2px;text-align:center;width:100%}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
.tw-pagination{display:inline-block;margin-bottom:24px;margin-bottom:var(--size-24);padding-left:0}[dir=rtl] .tw-pagination{padding-left:0;padding-right:0}.tw-pagination li{display:inline}.tw-pagination li:first-child>a{margin-left:0}[dir=rtl] .tw-pagination li:first-child>a{margin-left:0;margin-right:0}.tw-pagination li:last-child>a{margin-right:0}[dir=rtl] .tw-pagination li:last-child>a{margin-left:0;margin-right:0}.tw-pagination a{border-radius:50%;color:#37517e;color:var(--color-content-primary);float:left;font-weight:400;line-height:48px;line-height:var(--size-48);margin:0 4px;margin:0 var(--size-4);text-align:center;text-decoration:none;width:48px;width:var(--size-48)}[dir=rtl] .tw-pagination a{float:right}.tw-pagination a:not(.disabled,:disabled):focus-visible,.tw-pagination a:not(.disabled,:disabled):hover{background-color:#86a7bd1a;background-color:var(--color-background-neutral)}.tw-pagination a:not(.disabled,:disabled).active{background-color:#86a7bd1a;background-color:var(--color-background-neutral);cursor:not-allowed;font-weight:800;font-weight:var(--font-weight-bold)}.tw-pagination svg{margin:16px;margin:var(--size-16)}[dir=rtl] .tw-pagination svg{transform:rotate(180deg)}.np-theme-personal .tw-pagination .tw-icon-chevron-left,.np-theme-personal .tw-pagination .tw-icon-chevron-right{color:var(--color-interactive-primary)}
|