@transferwise/components 37.9.2-beta-2ffb6cde65.0 → 37.9.2

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.
Files changed (90) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/build/es/no-polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
  3. package/build/es/no-polyfill/actionOption/ActionOption.story.js +1 -1
  4. package/build/es/no-polyfill/card/Card.js +2 -1
  5. package/build/es/no-polyfill/common/Option/Option.js +1 -1
  6. package/build/es/no-polyfill/common/Option/OptionDocumentation.js +1 -0
  7. package/build/es/no-polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
  8. package/build/es/no-polyfill/dateLookup/header/Header.js +1 -0
  9. package/build/es/no-polyfill/dateLookup/header/index.js +1 -0
  10. package/build/es/no-polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
  11. package/build/es/no-polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
  12. package/build/es/no-polyfill/dimmer/Dimmer.js +2 -2
  13. package/build/es/no-polyfill/flowNavigation/FlowNavigation.js +2 -2
  14. package/build/es/no-polyfill/header/Header.js +1 -5
  15. package/build/es/no-polyfill/index.js +1 -1
  16. package/build/es/no-polyfill/navigationOption/NavigationOption.js +1 -1
  17. package/build/es/no-polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
  18. package/build/es/no-polyfill/nudge/Nudge.js +1 -1
  19. package/build/es/no-polyfill/overlayHeader/OverlayHeader.js +1 -1
  20. package/build/es/no-polyfill/switchOption/SwitchOption.story.js +1 -1
  21. package/build/es/polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
  22. package/build/es/polyfill/actionOption/ActionOption.story.js +1 -1
  23. package/build/es/polyfill/card/Card.js +2 -1
  24. package/build/es/polyfill/common/Option/Option.js +1 -1
  25. package/build/es/polyfill/common/Option/OptionDocumentation.js +1 -0
  26. package/build/es/polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
  27. package/build/es/polyfill/dateLookup/header/Header.js +1 -0
  28. package/build/es/polyfill/dateLookup/header/index.js +1 -0
  29. package/build/es/polyfill/dateLookup/monthCalendar/MonthCalendar.js +1 -1
  30. package/build/es/polyfill/dateLookup/yearCalendar/YearCalendar.js +1 -1
  31. package/build/es/polyfill/dimmer/Dimmer.js +2 -2
  32. package/build/es/polyfill/flowNavigation/FlowNavigation.js +2 -2
  33. package/build/es/polyfill/header/Header.js +1 -5
  34. package/build/es/polyfill/index.js +1 -1
  35. package/build/es/polyfill/navigationOption/NavigationOption.js +1 -1
  36. package/build/es/polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
  37. package/build/es/polyfill/nudge/Nudge.js +1 -1
  38. package/build/es/polyfill/overlayHeader/OverlayHeader.js +1 -1
  39. package/build/es/polyfill/switchOption/SwitchOption.story.js +1 -1
  40. package/build/main.css +1 -1
  41. package/build/styles/accordion/Accordion.css +1 -1
  42. package/build/styles/card/Card.css +1 -1
  43. package/build/styles/common/Option/Option.css +1 -1
  44. package/build/styles/flowNavigation/FlowNavigation.css +1 -1
  45. package/build/styles/main.css +1 -1
  46. package/build/styles/navigationOption/NavigationOption.css +1 -1
  47. package/build/styles/navigationOptionsList/NavigationOptionsList.css +1 -1
  48. package/build/types/actionOption/ActionOption.story.d.ts +0 -1
  49. package/build/types/common/bottomSheet/BottomSheet.d.ts +1 -0
  50. package/build/types/common/commonProps.d.ts +0 -4
  51. package/build/types/dateLookup/{dateHeader/DateHeader.d.ts → header/Header.d.ts} +3 -3
  52. package/build/types/dateLookup/header/index.d.ts +1 -0
  53. package/build/types/header/Header.d.ts +1 -27
  54. package/build/types/header/index.d.ts +1 -1
  55. package/build/types/index.d.ts +45 -47
  56. package/build/types/switchOption/SwitchOption.story.d.ts +0 -1
  57. package/build/umd/no-polyfill/main.js +1 -1
  58. package/build/umd/polyfill/main.js +1 -1
  59. package/package.json +3 -3
  60. package/build/es/no-polyfill/common/flowHeader/FlowHeader.js +0 -1
  61. package/build/es/no-polyfill/common/flowHeader/index.js +0 -1
  62. package/build/es/no-polyfill/dateLookup/dateHeader/DateHeader.js +0 -1
  63. package/build/es/no-polyfill/dateLookup/dateHeader/index.js +0 -1
  64. package/build/es/no-polyfill/header/Header.spec.js +0 -1
  65. package/build/es/no-polyfill/header/Header.story.js +0 -1
  66. package/build/es/no-polyfill/section/Section.js +0 -5
  67. package/build/es/no-polyfill/section/Section.spec.js +0 -1
  68. package/build/es/no-polyfill/section/Section.story.js +0 -1
  69. package/build/es/no-polyfill/section/index.js +0 -1
  70. package/build/es/polyfill/common/flowHeader/FlowHeader.js +0 -1
  71. package/build/es/polyfill/common/flowHeader/index.js +0 -1
  72. package/build/es/polyfill/dateLookup/dateHeader/DateHeader.js +0 -1
  73. package/build/es/polyfill/dateLookup/dateHeader/index.js +0 -1
  74. package/build/es/polyfill/header/Header.spec.js +0 -1
  75. package/build/es/polyfill/header/Header.story.js +0 -1
  76. package/build/es/polyfill/section/Section.js +0 -5
  77. package/build/es/polyfill/section/Section.spec.js +0 -1
  78. package/build/es/polyfill/section/Section.story.js +0 -1
  79. package/build/es/polyfill/section/index.js +0 -1
  80. package/build/styles/header/Header.css +0 -1
  81. package/build/styles/section/Section.css +0 -1
  82. package/build/types/common/flowHeader/FlowHeader.d.ts +0 -2
  83. package/build/types/common/flowHeader/index.d.ts +0 -1
  84. package/build/types/dateLookup/dateHeader/index.d.ts +0 -1
  85. package/build/types/header/Header.spec.d.ts +0 -1
  86. package/build/types/header/Header.story.d.ts +0 -9
  87. package/build/types/section/Section.d.ts +0 -10
  88. package/build/types/section/Section.spec.d.ts +0 -1
  89. package/build/types/section/Section.story.d.ts +0 -14
  90. package/build/types/section/index.d.ts +0 -1
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [37.9.2](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.9.1...@transferwise/components@37.9.2) (2021-10-26)
7
+
8
+
9
+ ### Bug Fixes
10
+
11
+ * use classList instead of className for dimmer check ([#1197](https://github.com/transferwise/neptune-web/issues/1197)) ([11cadb3](https://github.com/transferwise/neptune-web/commit/11cadb33c461e6713effd3ec36be052664f83cb3))
12
+
13
+
14
+
15
+
16
+
6
17
  ## [37.9.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@37.9.0...@transferwise/components@37.9.1) (2021-10-21)
7
18
 
8
19
 
@@ -1 +1 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Chevron from"../../chevron";import{Position,Theme}from"../../common";import Option from"../../common/Option";import{useDirection}from"../../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function(a){var b=a.id,c=a.title,d=a.content,e=a.onClick,f=a.open,g=a.icon,h=a.theme,i=g?/*#__PURE__*/cloneElement(g,{size:24}):null,j=useDirection(),k=j.isRTL;return/*#__PURE__*/_jsxs("div",{id:b,className:classNames("np-accordion-item","np-accordion-item--".concat(h),{"np-accordion-item--open":f}),children:[/*#__PURE__*/_jsx(Option,{as:"button",media:i,title:c,button:/*#__PURE__*/_jsx(Chevron,{orientation:f?Position.TOP:Position.DOWN}),inverseMediaCircle:!1,onClick:e}),f&&/*#__PURE__*/_jsx("div",{className:classNames("np-accordion-item__content",{"icon-right":g&&k,"icon-left":g}),children:d})]})};AccordionItem.propTypes={content:PropTypes.node.isRequired,icon:PropTypes.node,id:PropTypes.string,open:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired,title:PropTypes.node.isRequired,theme:PropTypes.oneOf(["light","dark"])},AccordionItem.defaultProps={icon:null,id:null,theme:Theme.LIGHT};export default AccordionItem;
1
+ import{isString}from"@transferwise/neptune-validation";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Chevron from"../../chevron";import{Position,Theme}from"../../common";import{useDirection}from"../../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function(a){var b=a.id,c=a.title,d=a.content,e=a.onClick,f=a.open,g=a.icon,h=a.theme,i=g?/*#__PURE__*/cloneElement(g,{size:24}):null,j=useDirection(),k=j.isRTL;return/*#__PURE__*/_jsxs("div",{id:b,className:classNames("tw-accordion-item decision p-a-0","tw-accordion-item--".concat(h),{closed:!f}),children:[/*#__PURE__*/_jsx("button",{type:"button","aria-expanded":f,className:classNames("tw-accordion-item btn btn-link p-x-0 text-no-decoration p-t-3",{"p-b-3":!f,"p-b-2":f}),onClick:e,children:/*#__PURE__*/_jsxs("div",{className:"media",children:[g&&/*#__PURE__*/_jsx("div",{className:classNames("hidden-xs hidden-sm",{"media-left":!k,"media-right":k,"p-r-2":!k,"p-l-2":k}),children:i}),/*#__PURE__*/_jsx("div",{className:classNames("media-body title",{"text-xs-left":!k,"text-xs-right":k}),children:isString(c)?/*#__PURE__*/_jsx("span",{className:"h5 tw-accordion-item__title",children:c}):c}),/*#__PURE__*/_jsx("div",{className:classNames("d-flex align-items-center",{"media-right":!k,"media-left":k}),children:/*#__PURE__*/_jsx(Chevron,{orientation:f?Position.TOP:Position.BOTTOM})})]})}),/*#__PURE__*/_jsx("div",{className:"accordion-content media",children:/*#__PURE__*/_jsx("div",{className:classNames("media-body p-b-3",{"m-l-5":g||k,"m-r-5":g}),"aria-hidden":!f,children:d})})]})};AccordionItem.propTypes={content:PropTypes.node.isRequired,icon:PropTypes.node,id:PropTypes.string,open:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired,title:PropTypes.node.isRequired,theme:PropTypes.oneOf(["light","dark"])},AccordionItem.defaultProps={icon:null,id:null,theme:Theme.LIGHT};export default AccordionItem;
@@ -1 +1 @@
1
- import{action}from"@storybook/addon-actions";import{text,boolean}from"@storybook/addon-knobs";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import ActionOption from"./ActionOption";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:ActionOption,title:"ActionOption"};var Template=function(){var a=text("title","Action option"),b=text("content","Normally, the button and icon are vertically centered."),c=text("action","Action"),d=boolean("disabled",!1),e=boolean("showMediaAtAllSizes",!1);return/*#__PURE__*/_jsx(ActionOption,{action:c,media:/*#__PURE__*/_jsx(FastFlagIcon,{}),title:a,content:b,complex:!1,disabled:d,showMediaAtAllSizes:e,onClick:action("Button Clicked")})};export var Basic=function(){return/*#__PURE__*/_jsx(Template,{})};export var Multiple=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{})]})};
1
+ import{action}from"@storybook/addon-actions";import{text,boolean}from"@storybook/addon-knobs";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import ActionOption from"./ActionOption";import{jsx as _jsx}from"react/jsx-runtime";export default{component:ActionOption,title:"ActionOption"};export var Basic=function(){var a=text("title","Action option"),b=text("content","Normally, the button and icon are vertically centered."),c=text("action","Action"),d=boolean("disabled",!1),e=boolean("showMediaAtAllSizes",!1);return/*#__PURE__*/_jsx(ActionOption,{action:c,media:/*#__PURE__*/_jsx(FastFlagIcon,{}),title:a,content:b,complex:!1,disabled:d,showMediaAtAllSizes:e,onClick:action("Button Clicked")})};
@@ -1 +1,2 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","isExpanded","title","details","children","onClick","icon","id","className"];import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import requiredIf from"react-required-if";import Chevron from"../chevron";import{Position}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Card=/*#__PURE__*/forwardRef(function(a,b){var c=a.as,d=a.isExpanded,e=a.title,f=a.details,g=a.children,h=a.onClick,i=a.icon,j=a.id,k=a.className,l=_objectWithoutProperties(a,_excluded),m=!!(d&&g);return/*#__PURE__*/_jsxs(c,{ref:b,className:classNames("np-card",k,{"np-card--expanded":m,"np-card--inactive":!g}),id:j,"data-testid":l["data-testid"],children:[/*#__PURE__*/_jsx(Option,{as:g?"button":"div",className:classNames("np-card__button"),media:i,title:e,content:f,button:g&&/*#__PURE__*/_jsx(Chevron,{orientation:m?Position.TOP:Position.BOTTOM}),onClick:function onClick(){return g&&h(!d)}}),/*#__PURE__*/_jsx("div",{className:classNames("np-card__divider",{"np-card__divider--expanded":m})}),m&&/*#__PURE__*/_jsx("div",{className:"np-card__content",children:g})]})}),hasChildren=function(a){var b=a.children;return b};Card.propTypes={as:PropTypes.string,isExpanded:requiredIf(PropTypes.bool,hasChildren),title:PropTypes.node.isRequired,details:PropTypes.node.isRequired,onClick:requiredIf(PropTypes.func,hasChildren),icon:PropTypes.node.isRequired,children:PropTypes.node,id:PropTypes.string,className:PropTypes.string,"data-testid":PropTypes.string},Card.defaultProps={as:"div",children:null,id:null,className:null,"data-testid":null};export default Card;
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","isExpanded","title","details","children","onClick","icon","id","className"];import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import requiredIf from"react-required-if";import Chevron from"../chevron";import{Position,Key}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Card=/*#__PURE__*/forwardRef(function(a,b){var c=a.as,d=a.isExpanded,e=a.title,f=a.details,g=a.children,h=a.onClick,i=a.icon,j=a.id,k=a.className,l=_objectWithoutProperties(a,_excluded),m=!!(d&&g),n=new Set([Key.ENTER].concat(_toConsumableArray(Key.SPACE)));return/*#__PURE__*/_jsxs(c,{ref:b,className:classNames("tw-card list-group-item p-a-0",k,{active:m}),id:j,"data-testid":l["data-testid"],children:[/*#__PURE__*/_jsx("div",{"aria-expanded":d,className:classNames("p-a-panel tw-card__panel",{"tw-card__panel--inactive":!g}),role:g?"button":null,tabIndex:g?0:void 0,onClick:function onClick(){return g&&h(!d)}// TODO: Consider renaming to onExpand as Card can be expanded with keyboard
2
+ ,onKeyDown:function onKeyDown(a){n.has(a.key)&&g&&(a.preventDefault(),h(!d))},children:/*#__PURE__*/_jsx(Option,{as:"div",media:i,title:e,content:f,decision:!1,button:g&&/*#__PURE__*/_jsx(Chevron,{orientation:m?Position.TOP:Position.DOWN}),inverseMediaCircle:m})}),m&&/*#__PURE__*/_jsx("div",{className:"p-l-panel p-r-panel p-b-panel tw-card__content",children:/*#__PURE__*/_jsxs("div",{className:"media",children:[/*#__PURE__*/_jsx("div",{className:"media-left",children:/*#__PURE__*/_jsx("div",{className:"circle circle-sm circle-inverse circle-responsive invisible"})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("hr",{className:"m-t-0 hidden-xs hidden-sm"}),/*#__PURE__*/_jsx("div",{children:g})]})]})})]})}),hasChildren=function(a){var b=a.children;return b};Card.propTypes={as:PropTypes.string,isExpanded:requiredIf(PropTypes.bool,hasChildren),title:PropTypes.node.isRequired,details:PropTypes.node.isRequired,onClick:requiredIf(PropTypes.func,hasChildren),icon:PropTypes.node.isRequired,children:PropTypes.node,id:PropTypes.string,className:PropTypes.string,"data-testid":PropTypes.string},Card.defaultProps={as:"div",children:null,id:null,className:null,"data-testid":null};export default Card;
@@ -1 +1 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import requiredIf from"react-required-if";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Option=function(a){var b=a.as,c=a.href,d=a.target,e=a.media,f=a.title,g=a.content,h=a.onClick,i=a.htmlFor,j=a.disabled,k=a.button,l=a.decision,m=a.complex,n=a.className,o=a.inverseMediaCircle,p=a.showMediaAtAllSizes,q=a.showMediaCircle;return/*#__PURE__*/_jsx(b,{className:classNames("np-option",n,{"decision-complex":m,decision:l,disabled:j,"np-option__sm-media":p}),href:c,htmlFor:i,target:d,disabled:j&&"button"===b,"aria-label":f,onClick:h,children:/*#__PURE__*/_jsxs("div",{className:"media",children:[e&&/*#__PURE__*/_jsx("div",{className:"media-left",children:q?/*#__PURE__*/_jsx("div",{className:classNames("circle circle-sm text-primary",{"circle-inverse":o}),children:e}):/*#__PURE__*/_jsx("div",{className:"np-option__no-media-circle",children:e})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("div",{className:"h5",children:f}),g]}),/*#__PURE__*/_jsx("div",{className:"media-right",children:k})]})})};Option.propTypes={media:PropTypes.node,htmlFor:PropTypes.string,title:PropTypes.node.isRequired,content:PropTypes.node,onClick:PropTypes.func,href:requiredIf(PropTypes.string,function(a){return"a"===a.as}),target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),as:PropTypes.string,disabled:PropTypes.bool,button:PropTypes.node,decision:PropTypes.bool,complex:PropTypes.bool,inverseMediaCircle:PropTypes.bool,className:PropTypes.string,showMediaAtAllSizes:PropTypes.bool,showMediaCircle:PropTypes.bool},Option.defaultProps={as:"label",media:"",content:null,htmlFor:null,disabled:!1,button:null,onClick:null,href:null,target:void 0,decision:!0,complex:!1,inverseMediaCircle:!0,className:null,showMediaAtAllSizes:!1,showMediaCircle:!0};export default Option;
1
+ import classNames from"classnames";import PropTypes from"prop-types";import requiredIf from"react-required-if";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Option=function(a){var b=a.as,c=a.href,d=a.target,e=a.media,f=a.title,g=a.content,h=a.onClick,i=a.htmlFor,j=a.disabled,k=a.button,l=a.decision,m=a.complex,n=a.className,o=a.inverseMediaCircle,p=a.showMediaAtAllSizes,q=a.showMediaCircle;return/*#__PURE__*/_jsxs(b,{className:classNames(n,"media",{"decision-complex":m,decision:l,disabled:j,"tw-option__sm-media":p}),href:c,htmlFor:i,target:d,disabled:j&&"button"===b,onClick:h,children:[e&&/*#__PURE__*/_jsx("div",{className:"media-left",children:q?/*#__PURE__*/_jsx("div",{className:classNames("circle circle-sm text-primary",{"circle-inverse":o}),children:e}):/*#__PURE__*/_jsx("div",{className:"tw-option__no-media-circle",children:e})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("div",{className:"h5",children:f}),g&&/*#__PURE__*/_jsx("div",{className:"decision__content",children:g})]}),/*#__PURE__*/_jsx("div",{className:"media-right",children:k})]})};Option.propTypes={media:PropTypes.node,htmlFor:PropTypes.string,title:PropTypes.node.isRequired,content:PropTypes.node,onClick:PropTypes.func,href:requiredIf(PropTypes.string,function(a){return"a"===a.as}),target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),as:PropTypes.string,disabled:PropTypes.bool,button:PropTypes.node,decision:PropTypes.bool,complex:PropTypes.bool,inverseMediaCircle:PropTypes.bool,className:PropTypes.string,showMediaAtAllSizes:PropTypes.bool,showMediaCircle:PropTypes.bool},Option.defaultProps={as:"label",media:"",content:null,htmlFor:null,disabled:!1,button:null,onClick:null,href:null,target:void 0,decision:!0,complex:!1,inverseMediaCircle:!0,className:null,showMediaAtAllSizes:!1,showMediaCircle:!0};export default Option;
@@ -0,0 +1 @@
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";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}function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import{FastFlag as FastFlagIcon}from"@transferwise/icons";import PropTypes from"prop-types";import{Component}from"react";import{Checkbox}from"../..";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var OptionDocumentation=/*#__PURE__*/function(a){function b(){var a;return _classCallCheck(this,b),a=c.call(this),a.state={complex:!1,disabled:!1,hasMedia:!0},a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"createStateLink",value:function createStateLink(a){var b=this;return function(c){return b.setState(_defineProperty({},a,c))}}},{key:"render",value:function render(){var a,b=this.props,c=b.type,d=b.Option,e=b.name,f=b.callbackName,g=b.callback,h=b.callbackString,i=b.propName,j=b.propValue,k=b.title,l=b.content,m=b.extra,n=this.state,o=n.complex,p=n.disabled,q=n.hasMedia;return/*#__PURE__*/_jsx("div",{className:"container",id:"".concat(c,"-option-docs"),children:/*#__PURE__*/_jsxs("div",{className:"section",children:[/*#__PURE__*/_jsxs("div",{className:"row",children:[/*#__PURE__*/_jsxs("div",{className:"col-md-6",children:[/*#__PURE__*/_jsx("h2",{children:k}),/*#__PURE__*/_jsx("p",{children:l})]}),/*#__PURE__*/_jsx("div",{className:"col-md-6",children:/*#__PURE__*/_jsx(d,_objectSpread({id:"".concat(c,"-option"),name:"".concat(c,"-option"),title:k,content:getContentForComplexState(o),complex:o,disabled:p,media:q?/*#__PURE__*/_jsx(FastFlagIcon,{}):void 0},(a={},_defineProperty(a,i,j),_defineProperty(a,f,g),a)))})]}),/*#__PURE__*/_jsxs("div",{className:"row m-t-5",children:[/*#__PURE__*/_jsxs("div",{className:"col-md-6",children:[/*#__PURE__*/_jsx(function Code(){return/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx("pre",{className:"tw-docs-code",children:"<".concat(e,"\n id=\"").concat(c,"-option\"\n name=\"").concat(c,"-option\"\n title=\"").concat(k,"\"\n content=\"").concat(getContentForComplexState(o),"\"").concat(boolProperty(i,j)).concat(boolProperty("complex",o)).concat(boolProperty("disabled",p),"\n ").concat(f,"={").concat(h,"}").concat(q?"\n media={<FastFlagIcon />}":"","\n/>")})})},{}),m]}),/*#__PURE__*/_jsxs("div",{className:"col-md-6",children:[/*#__PURE__*/_jsxs("div",{className:"row",children:[/*#__PURE__*/_jsx("div",{className:"col-md-6",children:/*#__PURE__*/_jsx(Checkbox,{id:"".concat(c,"-option-complex"),label:"Complex",checked:o,onChange:this.createStateLink("complex")})}),/*#__PURE__*/_jsx("div",{className:"col-md-6 m-b-0",children:/*#__PURE__*/_jsx(Checkbox,{id:"".concat(c,"-option-disabled"),label:"Disabled",checked:p,onChange:this.createStateLink("disabled")})})]}),/*#__PURE__*/_jsx("div",{className:"row m-t-2",children:/*#__PURE__*/_jsx("div",{className:"col-md-6",children:/*#__PURE__*/_jsx(Checkbox,{id:"".concat(c,"-option-media"),label:"Has media",checked:q,onChange:this.createStateLink("hasMedia")})})})]})]})]})})}}]),b}(Component);function getContentForComplexState(a){return a?"Complex items should be used for items with long descriptions. Their button and media will be aligned to the top.":"Normally, the button and icon are vertically centered."}function boolProperty(a,b){return b?"\n ".concat(a):""}OptionDocumentation.propTypes={type:PropTypes.string.isRequired,Option:PropTypes.func.isRequired,name:PropTypes.string.isRequired,callbackName:PropTypes.string.isRequired,callback:PropTypes.func.isRequired,callbackString:PropTypes.string.isRequired,propName:PropTypes.string,propValue:PropTypes.bool,title:PropTypes.string.isRequired,content:PropTypes.string.isRequired,extra:PropTypes.string},OptionDocumentation.defaultProps={propName:null,propValue:!1,extra:""};export default OptionDocumentation;
@@ -1 +1 @@
1
- import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import{MonthFormat}from"../../common";import DateHeader from"../dateHeader";import DayCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var DayCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"selectPreviousMonth",function(){var b=a.props,c=b.viewMonth,d=b.viewYear;a.props.onViewDateUpdate({month:0>=c?11:c-1,year:0>=c?d-1:d})}),_defineProperty(_assertThisInitialized(a),"selectNextMonth",function(){var b=a.props,c=b.viewMonth,d=b.viewYear;a.props.onViewDateUpdate({month:11<=c?0:c+1,year:11<=c?d+1:d})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewMonth,f=a.viewYear,g=a.intl.locale,h=a.monthFormat,i=a.onLabelClick,j=a.onSelect;return/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(DateHeader,{label:formatDate(new Date(f,e),g,{month:h,year:"numeric"}),onLabelClick:i,onPreviousClick:this.selectPreviousMonth,onNextClick:this.selectNextMonth}),/*#__PURE__*/_jsx(DayCalendarTable,{selectedDate:b,min:c,max:d,viewMonth:e,viewYear:f,onSelect:j})]})}}]),b}(PureComponent);DayCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewMonth:PropTypes.number.isRequired,viewYear:PropTypes.number.isRequired,monthFormat:PropTypes.oneOf([MonthFormat.LONG,MonthFormat.SHORT]).isRequired,onSelect:PropTypes.func.isRequired,onLabelClick:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},DayCalendar.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(DayCalendar);
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import{MonthFormat}from"../../common";import Header from"../header";import DayCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var DayCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"selectPreviousMonth",function(){var b=a.props,c=b.viewMonth,d=b.viewYear;a.props.onViewDateUpdate({month:0>=c?11:c-1,year:0>=c?d-1:d})}),_defineProperty(_assertThisInitialized(a),"selectNextMonth",function(){var b=a.props,c=b.viewMonth,d=b.viewYear;a.props.onViewDateUpdate({month:11<=c?0:c+1,year:11<=c?d+1:d})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewMonth,f=a.viewYear,g=a.intl.locale,h=a.monthFormat,i=a.onLabelClick,j=a.onSelect;return/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Header,{label:formatDate(new Date(f,e),g,{month:h,year:"numeric"}),onLabelClick:i,onPreviousClick:this.selectPreviousMonth,onNextClick:this.selectNextMonth}),/*#__PURE__*/_jsx(DayCalendarTable,{selectedDate:b,min:c,max:d,viewMonth:e,viewYear:f,onSelect:j})]})}}]),b}(PureComponent);DayCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewMonth:PropTypes.number.isRequired,viewYear:PropTypes.number.isRequired,monthFormat:PropTypes.oneOf([MonthFormat.LONG,MonthFormat.SHORT]).isRequired,onSelect:PropTypes.func.isRequired,onLabelClick:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},DayCalendar.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(DayCalendar);
@@ -0,0 +1 @@
1
+ import PropTypes from"prop-types";import Chevron from"../../chevron";import{Position,Size}from"../../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var buttonClasses="btn-link p-a-0 text-no-decoration font-weight-bold",Header=function(a){var b=a.label,c=a.onLabelClick,d=a.onPreviousClick,e=a.onNextClick;return/*#__PURE__*/_jsxs("div",{className:"text-xs-center p-t-1 p-b-2 clearfix",children:[/*#__PURE__*/_jsx("div",{className:"pull-xs-left",children:/*#__PURE__*/_jsx("button",{type:"button",className:buttonClasses,onClick:d,children:/*#__PURE__*/_jsx(Chevron,{orientation:Position.LEFT,size:Size.MEDIUM})})}),b&&/*#__PURE__*/_jsx("button",{type:"button",className:"tw-date-lookup-header-current ".concat(buttonClasses),onClick:c,children:b}),/*#__PURE__*/_jsx("div",{className:"pull-xs-right",children:/*#__PURE__*/_jsx("button",{type:"button",className:buttonClasses,onClick:e,children:/*#__PURE__*/_jsx(Chevron,{orientation:Position.RIGHT,size:Size.MEDIUM})})})]})};Header.propTypes={label:PropTypes.string,onLabelClick:PropTypes.func,onPreviousClick:PropTypes.func.isRequired,onNextClick:PropTypes.func.isRequired},Header.defaultProps={label:null,onLabelClick:function onLabelClick(){}};export default Header;
@@ -0,0 +1 @@
1
+ export{default}from"./Header";
@@ -1 +1 @@
1
- import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import DateHeader from"../dateHeader";import MonthCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var MonthCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"onMonthSelect",function(b){a.props.onViewDateUpdate({month:b}),a.props.onSelect()}),_defineProperty(_assertThisInitialized(a),"selectPreviousYear",function(){a.props.onViewDateUpdate({year:a.props.viewYear-1})}),_defineProperty(_assertThisInitialized(a),"selectNextYear",function(){a.props.onViewDateUpdate({year:a.props.viewYear+1})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewYear,f=a.intl.locale,g=a.placeholder,h=a.onLabelClick;return/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(DateHeader,{label:formatDate(new Date(e,0),f,{year:"numeric"}),onLabelClick:h,onPreviousClick:this.selectPreviousYear,onNextClick:this.selectNextYear}),/*#__PURE__*/_jsx(MonthCalendarTable,{selectedDate:b,min:c,max:d,viewYear:e,placeholder:g,onSelect:this.onMonthSelect})]})}}]),b}(PureComponent);MonthCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired,onLabelClick:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},MonthCalendar.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(MonthCalendar);
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import Header from"../header";import MonthCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var MonthCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"onMonthSelect",function(b){a.props.onViewDateUpdate({month:b}),a.props.onSelect()}),_defineProperty(_assertThisInitialized(a),"selectPreviousYear",function(){a.props.onViewDateUpdate({year:a.props.viewYear-1})}),_defineProperty(_assertThisInitialized(a),"selectNextYear",function(){a.props.onViewDateUpdate({year:a.props.viewYear+1})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewYear,f=a.intl.locale,g=a.placeholder,h=a.onLabelClick;return/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Header,{label:formatDate(new Date(e,0),f,{year:"numeric"}),onLabelClick:h,onPreviousClick:this.selectPreviousYear,onNextClick:this.selectNextYear}),/*#__PURE__*/_jsx(MonthCalendarTable,{selectedDate:b,min:c,max:d,viewYear:e,placeholder:g,onSelect:this.onMonthSelect})]})}}]),b}(PureComponent);MonthCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired,onLabelClick:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},MonthCalendar.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(MonthCalendar);
@@ -1 +1 @@
1
- import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import PropTypes from"prop-types";import{PureComponent}from"react";import DateHeader from"../dateHeader";import YearCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var YearCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"onYearSelect",function(b){a.props.onViewDateUpdate({year:b}),a.props.onSelect()}),_defineProperty(_assertThisInitialized(a),"selectPreviousYears",function(){a.props.onViewDateUpdate({year:a.props.viewYear-20})}),_defineProperty(_assertThisInitialized(a),"selectNextYears",function(){a.props.onViewDateUpdate({year:a.props.viewYear+20})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewYear,f=a.placeholder;return/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(DateHeader,{onPreviousClick:this.selectPreviousYears,onNextClick:this.selectNextYears}),/*#__PURE__*/_jsx(YearCalendarTable,{selectedDate:b,min:c,max:d,viewYear:e,placeholder:f,onSelect:this.onYearSelect})]})}}]),b}(PureComponent);YearCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},YearCalendar.defaultProps={selectedDate:null,min:null,max:null};export default YearCalendar;
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import PropTypes from"prop-types";import{PureComponent}from"react";import Header from"../header";import YearCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var YearCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"onYearSelect",function(b){a.props.onViewDateUpdate({year:b}),a.props.onSelect()}),_defineProperty(_assertThisInitialized(a),"selectPreviousYears",function(){a.props.onViewDateUpdate({year:a.props.viewYear-20})}),_defineProperty(_assertThisInitialized(a),"selectNextYears",function(){a.props.onViewDateUpdate({year:a.props.viewYear+20})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewYear,f=a.placeholder;return/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Header,{onPreviousClick:this.selectPreviousYears,onNextClick:this.selectNextYears}),/*#__PURE__*/_jsx(YearCalendarTable,{selectedDate:b,min:c,max:d,viewYear:e,placeholder:f,onSelect:this.onYearSelect})]})}}]),b}(PureComponent);YearCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},YearCalendar.defaultProps={selectedDate:null,min:null,max:null};export default YearCalendar;
@@ -1,5 +1,5 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import{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,handleTouchMove=function(a){var b=a.target.className.startsWith("dimmer");// disable scroll on iOS devices for Dimmer area
1
+ import classNames from"classnames";import PropTypes from"prop-types";import{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
- isIosDevice()&&b&&(a.stopPropagation(),a.preventDefault())},Dimmer=function(a){var b=a.children,c=a.className,d=a.disableClickToClose,e=a.fadeContentOnEnter,f=a.fadeContentOnExit,g=a.transparent,h=a.onClose,i=a.open,j=a.scrollable,k=useRef(),l=!d&&h?function closeOnClick(a){a.target===k.current&&h(a)}:void 0,m=function(a){"Escape"!==a.key||(a.stopPropagation(),h&&dimmerManager.isTop(k)&&h(a))};return useEffect(function(){return i&&(document.addEventListener("keydown",m),k.current&&k.current.addEventListener("touchmove",handleTouchMove)),function(){document.removeEventListener("keydown",m),k.current&&k.current.removeEventListener("touchmove",handleTouchMove)}},[i]),/*#__PURE__*/_jsx(CSSTransition,{in:i,appear:!0// Wait for animation to finish before unmount.
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=a.fadeContentOnExit,g=a.transparent,h=a.onClose,i=a.open,j=a.scrollable,k=useRef(),l=!d&&h?function closeOnClick(a){a.target===k.current&&h(a)}:void 0,m=function(a){"Escape"!==a.key||(a.stopPropagation(),h&&dimmerManager.isTop(k)&&h(a))};return useEffect(function(){return i&&(document.addEventListener("keydown",m),k.current&&k.current.addEventListener("touchmove",handleTouchMove)),function(){document.removeEventListener("keydown",m),k.current&&k.current.removeEventListener("touchmove",handleTouchMove)}},[i]),/*#__PURE__*/_jsx(CSSTransition,{in:i,appear:!0// Wait for animation to finish before unmount.
5
5
  ,timeout:{enter:0,exit:EXIT_ANIMATION},classNames:{enter:classNames({"dimmer--enter-fade":e}),enterDone:classNames("dimmer--enter-done",{"dimmer--enter-fade":e}),exit:classNames("dimmer--exit",{"dimmer--exit-fade":f})},unmountOnExit:!0,onEnter:function onEnter(){return dimmerManager.add(k)},onExited:function onExited(){return dimmerManager.remove(k)},children:/*#__PURE__*/_jsx(DimmerContentWrapper,{scrollBody:!g,children:/*#__PURE__*/_jsx("div",{ref:k,className:classNames("dimmer",{"dimmer--scrollable":j,"dimmer--transparent":g},c),role:"presentation",onClick:l,children:/*#__PURE__*/_jsx(FocusBoundary,{children:b})})})})};export var DimmerContentWrapper=function(a){var b=a.children,c=a.scrollBody;return useEffect(function(){return c&&addNoScrollBodyClass(),function(){c&&removeNoScrollBodyClass()}},[]),b};Dimmer.propTypes={children:PropTypes.node,className:PropTypes.string,disableClickToClose:PropTypes.bool,fadeContentOnEnter:PropTypes.bool,fadeContentOnExit:PropTypes.bool,/** Sets the background to transparent and prevents body scroll locking */transparent:PropTypes.bool,onClose:PropTypes.func,open:PropTypes.bool,scrollable:PropTypes.bool},Dimmer.defaultProps={children:null,className:void 0,disableClickToClose:!1,fadeContentOnEnter:!1,fadeContentOnExit:!1,transparent:!1,onClose:void 0,open:!1,scrollable:!1};export{Dimmer};export default withNextPortal(Dimmer);
@@ -1,2 +1,2 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import classNames from"classnames";import PropTypes from"prop-types";import{useRef}from"react";import{Breakpoint,Layout}from"../common";import CloseButton from"../common/closeButton";import FlowHeader from"../common/flowHeader";import{useClientWidth}from"../common/hooks";import Logo from"../logo";import Stepper from"../stepper";import AnimatedLabel from"./animatedLabel";import BackButton from"./backButton";// Size switches on parent container which may or may not have the same size as the window.
2
- import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var containerBreakpoints={"np-flow-navigation--sm":Breakpoint.SMALL,"np-flow-navigation--lg":Breakpoint.LARGE},FlowNavigation=function(a){var b=a.activeStep,c=a.avatar,d=a.logo,e=a.onClose,f=a.onGoBack,g=a.done,h=a.steps,i=useRef(null),j=useClientWidth({ref:i}),k=_slicedToArray(j,1),l=k[0],m=e&&/*#__PURE__*/_jsx(CloseButton,{onClick:e}),n=l<Breakpoint.SMALL,o=g?null:c;return/*#__PURE__*/_jsx("div",{ref:i,className:classNames("np-flow-navigation d-flex align-items-center justify-content-center p-y-3",{"np-flow-navigation--border-bottom":!g}),children:/*#__PURE__*/_jsx(FlowHeader,{className:classNames("np-flow-navigation__content p-x-3",{"np-flow-navigation--hidden":!l,"np-flow-navigation--xs-max":n},Object.keys(containerBreakpoints).filter(function(a){return l>=containerBreakpoints[a]})),leftContent:n?function getLeftContentSmall(){return/*#__PURE__*/_jsx(_Fragment,{children:f&&0<b?/*#__PURE__*/_jsx(BackButton,{label:/*#__PURE__*/_jsx(AnimatedLabel,{className:"m-x-1",labels:h.map(function(a){return a.label}),activeLabel:b-1}),onClick:f}):d})}():d,rightContent:/*#__PURE__*/_jsxs(_Fragment,{children:[o,o&&m&&/*#__PURE__*/_jsx("span",{className:"separator"}),m]}),bottomContent:!g&&/*#__PURE__*/_jsx(Stepper,{activeStep:b,steps:h,className:classNames("np-flow-navigation__stepper")}),layout:l<Breakpoint.LARGE?Layout.VERTICAL:Layout.HORIZONTAL})})};FlowNavigation.defaultProps={activeStep:0,avatar:void 0,logo:/*#__PURE__*/_jsx(Logo,{}),onGoBack:void 0,onClose:void 0,done:!1},FlowNavigation.propTypes={activeStep:PropTypes.number,/** An Avatar */avatar:PropTypes.element,logo:PropTypes.node,/** Called when the close button is clicked. If not provided the close button won't show */onClose:PropTypes.func,/** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */onGoBack:PropTypes.func,done:PropTypes.bool,/** Steps to be displayed in stepper. If you don't need the stepper, please use OverlayHeader instead */steps:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.node.isRequired,onClick:PropTypes.func,hoverLabel:PropTypes.node})).isRequired};export default FlowNavigation;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import classNames from"classnames";import PropTypes from"prop-types";import{useRef}from"react";import{Breakpoint,Layout}from"../common";import CloseButton from"../common/closeButton";import{useClientWidth}from"../common/hooks";import Header from"../header";import Logo from"../logo";import Stepper from"../stepper";import AnimatedLabel from"./animatedLabel";import BackButton from"./backButton";// Size switches on parent container which may or may not have the same size as the window.
2
+ import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var containerBreakpoints={"np-flow-navigation--sm":Breakpoint.SMALL,"np-flow-navigation--lg":Breakpoint.LARGE},FlowNavigation=function(a){var b=a.activeStep,c=a.avatar,d=a.logo,e=a.onClose,f=a.onGoBack,g=a.done,h=a.steps,i=useRef(null),j=useClientWidth({ref:i}),k=_slicedToArray(j,1),l=k[0],m=e&&/*#__PURE__*/_jsx(CloseButton,{onClick:e}),n=l<Breakpoint.SMALL,o=g?null:c;return/*#__PURE__*/_jsx("div",{ref:i,className:classNames("np-flow-navigation d-flex align-items-center justify-content-center p-y-3",{"np-flow-navigation--border-bottom":!g}),children:/*#__PURE__*/_jsx(Header,{className:classNames("np-flow-navigation__content p-x-3",{"np-flow-navigation--hidden":!l,"np-flow-navigation--xs-max":n},Object.keys(containerBreakpoints).filter(function(a){return l>=containerBreakpoints[a]})),leftContent:n?function getLeftContentSmall(){return/*#__PURE__*/_jsx(_Fragment,{children:f&&0<b?/*#__PURE__*/_jsx(BackButton,{label:/*#__PURE__*/_jsx(AnimatedLabel,{className:"m-x-1",labels:h.map(function(a){return a.label}),activeLabel:b-1}),onClick:f}):d})}():d,rightContent:/*#__PURE__*/_jsxs(_Fragment,{children:[o,o&&m&&/*#__PURE__*/_jsx("span",{className:"separator"}),m]}),bottomContent:!g&&/*#__PURE__*/_jsx(Stepper,{activeStep:b,steps:h,className:classNames("np-flow-navigation__stepper")}),layout:l<Breakpoint.LARGE?Layout.VERTICAL:Layout.HORIZONTAL})})};FlowNavigation.defaultProps={activeStep:0,avatar:void 0,logo:/*#__PURE__*/_jsx(Logo,{}),onGoBack:void 0,onClose:void 0,done:!1},FlowNavigation.propTypes={activeStep:PropTypes.number,/** An Avatar */avatar:PropTypes.element,logo:PropTypes.node,/** Called when the close button is clicked. If not provided the close button won't show */onClose:PropTypes.func,/** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */onGoBack:PropTypes.func,done:PropTypes.bool,/** Steps to be displayed in stepper. If you don't need the stepper, please use OverlayHeader instead */steps:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.node.isRequired,onClick:PropTypes.func,hoverLabel:PropTypes.node})).isRequired};export default FlowNavigation;
@@ -1,5 +1 @@
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 classNames from"classnames";import{Link}from"..";import Button from"../button";import{Priority}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var HeaderAction=function(a){var b=a.action,c={"aria-label":b["aria-label"],className:"np-header__action"};return"href"in b?/*#__PURE__*/_jsx(Link,_objectSpread(_objectSpread({href:b.href,target:b.target},c),{},{children:b.text})):/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({priority:Priority.TERTIARY,onClick:b.onClick},c),{},{children:b.text}))};/**
2
- *
3
- * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header
4
- *
5
- */export var Header=function(a){var b=a.action,c=a.as,d=void 0===c?"span":c,e=a.title,f=a.className;return/*#__PURE__*/_jsxs("div",{className:classNames("np-header",f),children:[/*#__PURE__*/_jsx(d,{className:"h5 np-header__title",children:e}),b&&/*#__PURE__*/_jsx(HeaderAction,{action:b})]})};export default Header;
1
+ import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import{Layout}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Header=/*#__PURE__*/forwardRef(function(a,b){var c=a.bottomContent,d=a.className,e=a.layout,f=a.leftContent,g=a.rightContent,h=e===Layout.VERTICAL;return/*#__PURE__*/_jsxs("div",{ref:b,className:classNames("np-header","d-flex","flex-wrap",d),children:[/*#__PURE__*/_jsx("div",{className:classNames("align-items-center","np-header__left","d-flex",{"flex__item--8":h}),children:f}),/*#__PURE__*/_jsx("div",{className:classNames("align-items-center","d-flex","np-header__right","justify-content-end",{"flex__item--4 ":h,"order-2":!h}),children:g}),/*#__PURE__*/_jsx("div",{className:classNames("align-items-center","d-flex","justify-content-center",{"flex__item--12":h,"order-1 flex-grow-1":!h}),children:c})]})});Header.defaultProps={bottomContent:void 0,className:void 0,layout:Layout.HORIZONTAL,leftContent:void 0,rightContent:void 0},Header.propTypes={bottomContent:PropTypes.node,className:PropTypes.string,layout:PropTypes.oneOf(["HORIZONTAL","VERTICAL"]),leftContent:PropTypes.node,rightContent:PropTypes.node};export default Header;
@@ -2,7 +2,7 @@
2
2
  * Types
3
3
  */ /**
4
4
  * Components
5
- */export{default as Accordion}from"./accordion";export{default as ActionOption}from"./actionOption";export{default as Alert}from"./alert";export{default as Avatar}from"./avatar";export{default as AvatarWrapper}from"./avatarWrapper";export{default as Badge}from"./badge";export{default as BottomSheet}from"./common/bottomSheet";export{default as Button}from"./button";export{default as Card}from"./card";export{default as Checkbox}from"./checkbox";export{default as CheckboxButton}from"./checkboxButton";export{default as CheckboxOption}from"./checkboxOption";export{default as Chevron}from"./chevron";export{default as Chips,Chip}from"./chips";export{default as CircularButton}from"./circularButton";export{default as DateInput}from"./dateInput";export{default as DateLookup}from"./dateLookup";export{default as Decision}from"./decision";export{default as DefinitionList}from"./definitionList";export{default as Dimmer}from"./dimmer";export{default as Drawer}from"./drawer";export{default as DynamicFieldDefinitionList}from"./dynamicFieldDefinitionList";export{default as Emphasis}from"./emphasis";export{default as FlowNavigation}from"./flowNavigation";export{default as Header}from"./header";export{default as Image}from"./image";export{default as Info}from"./info";export{default as InlineAlert}from"./inlineAlert";export{default as InputWithDisplayFormat}from"./inputWithDisplayFormat";export{default as InstructionsList}from"./instructionsList";export{default as Link}from"./link";export{default as Loader}from"./loader";export{default as Logo}from"./logo";export{default as Markdown}from"./markdown";export{default as Modal}from"./modal";export{default as Money}from"./money";export{default as MoneyInput}from"./moneyInput";export{default as NavigationOption}from"./navigationOption";export{default as NavigationOptionsList}from"./navigationOptionsList";export{default as Nudge}from"./nudge";export{default as OverlayHeader}from"./overlayHeader";export{default as PhoneNumberInput}from"./phoneNumberInput";export{default as Popover}from"./popover";export{default as ProcessIndicator}from"./processIndicator";export{default as Provider}from"./provider";export{default as Radio}from"./radio";export{default as RadioGroup}from"./radioGroup";export{default as RadioOption}from"./radioOption";export{default as Section}from"./section";export{default as Select}from"./select";export{default as SlidingPanel}from"./slidingPanel";export{default as SnackbarPortal}from"./snackbar/Snackbar";export{default as SnackbarProvider}from"./snackbar/SnackbarProvider";export{default as Stepper}from"./stepper";export{default as Sticky}from"./sticky";export{default as Summary}from"./summary";export{default as Switch}from"./switch";export{default as SwitchOption}from"./switchOption";export{default as Tabs}from"./tabs";export{default as TextareaWithDisplayFormat}from"./textareaWithDisplayFormat";export{default as Tooltip}from"./tooltip";export{default as Typeahead}from"./typeahead";export{default as Upload}from"./upload";export{default as UploadInput}from"./uploadInput";export{SnackbarConsumer,SnackbarContext}from"./snackbar/SnackbarContext";/**
5
+ */export{default as Provider}from"./provider";export{default as Badge}from"./badge";export{default as Checkbox}from"./checkbox";export{default as CheckboxButton}from"./checkboxButton";export{default as Chips,Chip}from"./chips";export{default as Loader}from"./loader";export{default as Radio}from"./radio";export{default as Select}from"./select";export{default as MoneyInput}from"./moneyInput";export{default as Tooltip}from"./tooltip";export{default as Stepper}from"./stepper";export{default as FlowNavigation}from"./flowNavigation";export{default as Popover}from"./popover";export{default as Money}from"./money";export{default as Modal}from"./modal";export{default as RadioOption}from"./radioOption";export{default as CheckboxOption}from"./checkboxOption";export{default as NavigationOption}from"./navigationOption";export{default as NavigationOptionsList}from"./navigationOptionsList";export{default as DateLookup}from"./dateLookup";export{default as PhoneNumberInput}from"./phoneNumberInput";export{default as DateInput}from"./dateInput";export{default as InstructionsList}from"./instructionsList";export{default as ProcessIndicator}from"./processIndicator";export{default as Upload}from"./upload";export{default as DefinitionList}from"./definitionList";export{default as DynamicFieldDefinitionList}from"./dynamicFieldDefinitionList";export{default as Emphasis}from"./emphasis";export{default as Avatar}from"./avatar";export{default as Button}from"./button";export{default as CircularButton}from"./circularButton";export{default as RadioGroup}from"./radioGroup";export{default as Alert}from"./alert";export{default as InputWithDisplayFormat}from"./inputWithDisplayFormat";export{default as TextareaWithDisplayFormat}from"./textareaWithDisplayFormat";export{default as Chevron}from"./chevron";export{default as Accordion}from"./accordion";export{default as Dimmer}from"./dimmer";export{default as SlidingPanel}from"./slidingPanel";export{default as Drawer}from"./drawer";export{default as Sticky}from"./sticky";export{default as Typeahead}from"./typeahead";export{default as SnackbarPortal}from"./snackbar/Snackbar";export{default as SnackbarProvider}from"./snackbar/SnackbarProvider";export{SnackbarConsumer,SnackbarContext}from"./snackbar/SnackbarContext";export{default as Tabs}from"./tabs";export{default as OverlayHeader}from"./overlayHeader";export{default as Image}from"./image";export{default as Markdown}from"./markdown";export{default as Card}from"./card";export{default as Summary}from"./summary";export{default as Switch}from"./switch";export{default as SwitchOption}from"./switchOption";export{default as Decision}from"./decision";export{default as Nudge}from"./nudge";export{default as InlineAlert}from"./inlineAlert";export{default as AvatarWrapper}from"./avatarWrapper";export{default as Info}from"./info";export{default as Logo}from"./logo";export{default as BottomSheet}from"./common/bottomSheet";export{default as ActionOption}from"./actionOption";export{default as Link}from"./link";export{default as UploadInput}from"./uploadInput";/**
6
6
  * Hooks
7
7
  */export{default as useSnackbar}from"./snackbar/useSnackbar";/**
8
8
  * Enums
@@ -1 +1 @@
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}/* eslint-disable jsx-a11y/control-has-associated-label */import classNames from"classnames";import PropTypes from"prop-types";import requiredIf from"react-required-if";import Chevron from"../chevron";import{Position}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";var NavigationOption=function(a){var b=a.as,c=a.media,d=a.href,e=a.target,f=a.title,g=a.content,h=a.onClick,i=a.complex,j=a.disabled,k=a.showMediaAtAllSizes,l=a.showMediaCircle,m=a.className,n={as:b,media:c,href:d,target:e,title:f,content:g,complex:i,disabled:j,showMediaAtAllSizes:k,showMediaCircle:l,className:classNames("np-navigation-option",m)};return d&&(n.as="a"),/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},n),{},{button:/*#__PURE__*/_jsx(Chevron,{orientation:Position.RIGHT,disabled:j,className:"d-block"}),onClick:function onClick(a){return j?void a.preventDefault():void h(a)}}))};NavigationOption.propTypes={as:PropTypes.string,media:PropTypes.node,title:PropTypes.node.isRequired,content:PropTypes.node,onClick:PropTypes.func,href:requiredIf(PropTypes.string,function(a){return"a"===a.as}),target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),complex:PropTypes.bool,disabled:PropTypes.bool,showMediaAtAllSizes:PropTypes.bool,showMediaCircle:PropTypes.bool,className:PropTypes.string},NavigationOption.defaultProps={as:"button",media:null,content:null,complex:!1,onClick:null,href:void 0,target:void 0,disabled:!1,showMediaAtAllSizes:!1,showMediaCircle:!0,className:null};export default NavigationOption;
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}/* eslint-disable jsx-a11y/control-has-associated-label */import classNames from"classnames";import PropTypes from"prop-types";import requiredIf from"react-required-if";import Chevron from"../chevron";import{Position}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";var NavigationOption=function(a){var b=a.as,c=a.media,d=a.href,e=a.target,f=a.title,g=a.content,h=a.onClick,i=a.complex,j=a.disabled,k=a.showMediaAtAllSizes,l=a.showMediaCircle,m=a.className,n={as:b,media:c,href:d,target:e,title:f,content:g,complex:i,disabled:j,showMediaAtAllSizes:k,showMediaCircle:l,className:classNames("tw-navigation-option",m)};return d&&(n.as="a"),/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},n),{},{button:/*#__PURE__*/_jsx(Chevron,{orientation:Position.RIGHT,disabled:j,className:"d-block"}),onClick:function onClick(a){j||h(a)}}))};NavigationOption.propTypes={as:PropTypes.string,media:PropTypes.node,title:PropTypes.node.isRequired,content:PropTypes.node,onClick:PropTypes.func,href:requiredIf(PropTypes.string,function(a){return"a"===a.as}),target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),complex:PropTypes.bool,disabled:PropTypes.bool,showMediaAtAllSizes:PropTypes.bool,showMediaCircle:PropTypes.bool,className:PropTypes.string},NavigationOption.defaultProps={as:"button",media:null,content:null,complex:!1,onClick:null,href:void 0,target:void 0,disabled:!1,showMediaAtAllSizes:!1,showMediaCircle:!0,className:null};export default NavigationOption;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import{Children}from"react";import{jsx as _jsx}from"react/jsx-runtime";var NavigationOptionList=function(a){var b=a.children;return/*#__PURE__*/_jsx("ul",{className:"np-navigation-options-list",children:Children.map(b,function(a){return/*#__PURE__*/_jsx("li",{className:"np-navigation-options-list__item",children:a},a.key)})})};NavigationOptionList.propTypes={children:PropTypes.node.isRequired};export default NavigationOptionList;
1
+ import PropTypes from"prop-types";import{Children}from"react";import{jsx as _jsx}from"react/jsx-runtime";var NavigationOptionList=function(a){var b=a.children;return/*#__PURE__*/_jsx("ul",{className:"tw-navigation-options-list",children:Children.map(b,function(a){return/*#__PURE__*/_jsx("li",{className:"tw-navigation-options-list__item",children:a},a.key)})})};NavigationOptionList.propTypes={children:PropTypes.node.isRequired};export default NavigationOptionList;
@@ -1 +1 @@
1
- import{Cross as CrossIcon}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{useDirection}from"../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Nudge=function(a){var b=a.media,c=a.title,d=a.link,e=a.href,f=a.onClick,g=a.onDismiss,h=a.id,i=a.className,j=useDirection(),k=j.isRTL;return/*#__PURE__*/_jsxs("div",{className:classNames("tw-nudge media",i),id:h,children:[/*#__PURE__*/_jsx("div",{className:classNames({"media-left":!k,"media-right":k}),children:b}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("div",{className:"tw-nudge__title media-heading h5",children:c}),/*#__PURE__*/_jsx("a",{href:e,className:"tw-nudge__link",onClick:f,children:d})]}),/*#__PURE__*/_jsx("div",{className:classNames("align-self-start",{"media-right":!k,"media-left":k}),children:/*#__PURE__*/_jsx("button",{type:"button",className:"close","aria-label":"close",onClick:g,children:/*#__PURE__*/_jsx(CrossIcon,{})})})]})};Nudge.propTypes={media:PropTypes.node.isRequired,title:PropTypes.node.isRequired,link:PropTypes.node.isRequired,href:PropTypes.string.isRequired,onClick:PropTypes.func,onDismiss:PropTypes.func.isRequired,id:PropTypes.string,className:PropTypes.string},Nudge.defaultProps={id:null,className:null,onClick:void 0};export default Nudge;
1
+ import{Cross as CrossIcon}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{useDirection}from"../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Nudge=function(a){var b=a.media,c=a.title,d=a.link,e=a.href,f=a.onClick,g=a.onDismiss,h=a.id,i=a.className,j=useDirection(),k=j.isRTL;return/*#__PURE__*/_jsxs("div",{className:classNames("tw-nudge media",i),id:h,children:[/*#__PURE__*/_jsx("div",{className:classNames({"media-left":!k,"media-right":k}),children:b}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("div",{className:"tw-nudge__title media-heading h5",children:c}),/*#__PURE__*/_jsx("a",{href:e,className:"tw-nudge__link",onClick:f,children:d})]}),/*#__PURE__*/_jsx("div",{className:classNames({"media-right":!k,"media-left":k}),children:/*#__PURE__*/_jsx("button",{type:"button",className:"close","aria-label":"close",onClick:g,children:/*#__PURE__*/_jsx(CrossIcon,{})})})]})};Nudge.propTypes={media:PropTypes.node.isRequired,title:PropTypes.node.isRequired,link:PropTypes.node.isRequired,href:PropTypes.string.isRequired,onClick:PropTypes.func,onDismiss:PropTypes.func.isRequired,id:PropTypes.string,className:PropTypes.string},Nudge.defaultProps={id:null,className:null,onClick:void 0};export default Nudge;
@@ -1 +1 @@
1
- import PropTypes from"prop-types";import CloseButton from"../common/closeButton";import FlowHeader from"../common/flowHeader";import Logo from"../logo";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var OverlayHeader=function(a){var b=a.avatar,c=a.onClose,d=a.logo,e=c&&/*#__PURE__*/_jsx(CloseButton,{onClick:c});return/*#__PURE__*/_jsx(FlowHeader,{className:"np-overlay-header p-a-3",leftContent:d,rightContent:/*#__PURE__*/_jsxs(_Fragment,{children:[b,b&&e&&/*#__PURE__*/_jsx("span",{className:"separator"}),e]})})};OverlayHeader.defaultProps={avatar:null,logo:/*#__PURE__*/_jsx(Logo,{}),onClose:null},OverlayHeader.propTypes={/** An Avatar */avatar:PropTypes.element,logo:PropTypes.node,/** Function called when the close is clicked */onClose:PropTypes.func};export default OverlayHeader;
1
+ import PropTypes from"prop-types";import CloseButton from"../common/closeButton";import Header from"../header";import Logo from"../logo";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var OverlayHeader=function(a){var b=a.avatar,c=a.onClose,d=a.logo,e=c&&/*#__PURE__*/_jsx(CloseButton,{onClick:c});return/*#__PURE__*/_jsx(Header,{className:"np-overlay-header p-a-3",leftContent:d,rightContent:/*#__PURE__*/_jsxs(_Fragment,{children:[b,b&&e&&/*#__PURE__*/_jsx("span",{className:"separator"}),e]})})};OverlayHeader.defaultProps={avatar:null,logo:/*#__PURE__*/_jsx(Logo,{}),onClose:null},OverlayHeader.propTypes={/** An Avatar */avatar:PropTypes.element,logo:PropTypes.node,/** Function called when the close is clicked */onClose:PropTypes.func};export default OverlayHeader;
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{text,boolean}from"@storybook/addon-knobs";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{useState}from"react";import SwitchOption from"./SwitchOption";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:SwitchOption,title:"SwitchOption"};var Template=function(){var a=useState(!1),b=_slicedToArray(a,2),c=b[0],d=b[1],e=text("title","Switch option"),f=text("content","Normally, the button and icon are vertically centered."),g=boolean("disabled",!1),h=boolean("showMediaAtAllSizes",!1);return/*#__PURE__*/_jsx(SwitchOption,{media:/*#__PURE__*/_jsx(FastFlagIcon,{}),title:e,content:f,id:"id",checked:c,complex:!1,disabled:g,showMediaAtAllSizes:h,"aria-label":e,onChange:d})};export var Basic=function(){return/*#__PURE__*/_jsx(Template,{})};export var Multiple=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{})]})};
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{text,boolean}from"@storybook/addon-knobs";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import{useState}from"react";import SwitchOption from"./SwitchOption";import{jsx as _jsx}from"react/jsx-runtime";export default{component:SwitchOption,title:"SwitchOption"};export var Basic=function(){var a=useState(!1),b=_slicedToArray(a,2),c=b[0],d=b[1],e=text("title","Switch option"),f=text("content","Normally, the button and icon are vertically centered."),g=boolean("disabled",!1),h=boolean("showMediaAtAllSizes",!1);return/*#__PURE__*/_jsx(SwitchOption,{media:/*#__PURE__*/_jsx(FastFlagIcon,{}),title:e,content:f,id:"id",checked:c,complex:!1,disabled:g,showMediaAtAllSizes:h,"aria-label":e,onChange:d})};
@@ -1 +1 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Chevron from"../../chevron";import{Position,Theme}from"../../common";import Option from"../../common/Option";import{useDirection}from"../../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function(a){var b=a.id,c=a.title,d=a.content,e=a.onClick,f=a.open,g=a.icon,h=a.theme,i=g?/*#__PURE__*/cloneElement(g,{size:24}):null,j=useDirection(),k=j.isRTL;return/*#__PURE__*/_jsxs("div",{id:b,className:classNames("np-accordion-item","np-accordion-item--".concat(h),{"np-accordion-item--open":f}),children:[/*#__PURE__*/_jsx(Option,{as:"button",media:i,title:c,button:/*#__PURE__*/_jsx(Chevron,{orientation:f?Position.TOP:Position.DOWN}),inverseMediaCircle:!1,onClick:e}),f&&/*#__PURE__*/_jsx("div",{className:classNames("np-accordion-item__content",{"icon-right":g&&k,"icon-left":g}),children:d})]})};AccordionItem.propTypes={content:PropTypes.node.isRequired,icon:PropTypes.node,id:PropTypes.string,open:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired,title:PropTypes.node.isRequired,theme:PropTypes.oneOf(["light","dark"])},AccordionItem.defaultProps={icon:null,id:null,theme:Theme.LIGHT};export default AccordionItem;
1
+ import{isString}from"@transferwise/neptune-validation";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Chevron from"../../chevron";import{Position,Theme}from"../../common";import{useDirection}from"../../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function(a){var b=a.id,c=a.title,d=a.content,e=a.onClick,f=a.open,g=a.icon,h=a.theme,i=g?/*#__PURE__*/cloneElement(g,{size:24}):null,j=useDirection(),k=j.isRTL;return/*#__PURE__*/_jsxs("div",{id:b,className:classNames("tw-accordion-item decision p-a-0","tw-accordion-item--".concat(h),{closed:!f}),children:[/*#__PURE__*/_jsx("button",{type:"button","aria-expanded":f,className:classNames("tw-accordion-item btn btn-link p-x-0 text-no-decoration p-t-3",{"p-b-3":!f,"p-b-2":f}),onClick:e,children:/*#__PURE__*/_jsxs("div",{className:"media",children:[g&&/*#__PURE__*/_jsx("div",{className:classNames("hidden-xs hidden-sm",{"media-left":!k,"media-right":k,"p-r-2":!k,"p-l-2":k}),children:i}),/*#__PURE__*/_jsx("div",{className:classNames("media-body title",{"text-xs-left":!k,"text-xs-right":k}),children:isString(c)?/*#__PURE__*/_jsx("span",{className:"h5 tw-accordion-item__title",children:c}):c}),/*#__PURE__*/_jsx("div",{className:classNames("d-flex align-items-center",{"media-right":!k,"media-left":k}),children:/*#__PURE__*/_jsx(Chevron,{orientation:f?Position.TOP:Position.BOTTOM})})]})}),/*#__PURE__*/_jsx("div",{className:"accordion-content media",children:/*#__PURE__*/_jsx("div",{className:classNames("media-body p-b-3",{"m-l-5":g||k,"m-r-5":g}),"aria-hidden":!f,children:d})})]})};AccordionItem.propTypes={content:PropTypes.node.isRequired,icon:PropTypes.node,id:PropTypes.string,open:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired,title:PropTypes.node.isRequired,theme:PropTypes.oneOf(["light","dark"])},AccordionItem.defaultProps={icon:null,id:null,theme:Theme.LIGHT};export default AccordionItem;
@@ -1 +1 @@
1
- import{action}from"@storybook/addon-actions";import{text,boolean}from"@storybook/addon-knobs";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import ActionOption from"./ActionOption";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:ActionOption,title:"ActionOption"};var Template=function(){var a=text("title","Action option"),b=text("content","Normally, the button and icon are vertically centered."),c=text("action","Action"),d=boolean("disabled",!1),e=boolean("showMediaAtAllSizes",!1);return/*#__PURE__*/_jsx(ActionOption,{action:c,media:/*#__PURE__*/_jsx(FastFlagIcon,{}),title:a,content:b,complex:!1,disabled:d,showMediaAtAllSizes:e,onClick:action("Button Clicked")})};export var Basic=function(){return/*#__PURE__*/_jsx(Template,{})};export var Multiple=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{}),/*#__PURE__*/_jsx(Template,{})]})};
1
+ import{action}from"@storybook/addon-actions";import{text,boolean}from"@storybook/addon-knobs";import{FastFlag as FastFlagIcon}from"@transferwise/icons";import ActionOption from"./ActionOption";import{jsx as _jsx}from"react/jsx-runtime";export default{component:ActionOption,title:"ActionOption"};export var Basic=function(){var a=text("title","Action option"),b=text("content","Normally, the button and icon are vertically centered."),c=text("action","Action"),d=boolean("disabled",!1),e=boolean("showMediaAtAllSizes",!1);return/*#__PURE__*/_jsx(ActionOption,{action:c,media:/*#__PURE__*/_jsx(FastFlagIcon,{}),title:a,content:b,complex:!1,disabled:d,showMediaAtAllSizes:e,onClick:action("Button Clicked")})};
@@ -1 +1,2 @@
1
- import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","isExpanded","title","details","children","onClick","icon","id","className"];import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import requiredIf from"react-required-if";import Chevron from"../chevron";import{Position}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Card=/*#__PURE__*/forwardRef(function(a,b){var c=a.as,d=a.isExpanded,e=a.title,f=a.details,g=a.children,h=a.onClick,i=a.icon,j=a.id,k=a.className,l=_objectWithoutProperties(a,_excluded),m=!!(d&&g);return/*#__PURE__*/_jsxs(c,{ref:b,className:classNames("np-card",k,{"np-card--expanded":m,"np-card--inactive":!g}),id:j,"data-testid":l["data-testid"],children:[/*#__PURE__*/_jsx(Option,{as:g?"button":"div",className:classNames("np-card__button"),media:i,title:e,content:f,button:g&&/*#__PURE__*/_jsx(Chevron,{orientation:m?Position.TOP:Position.BOTTOM}),onClick:function onClick(){return g&&h(!d)}}),/*#__PURE__*/_jsx("div",{className:classNames("np-card__divider",{"np-card__divider--expanded":m})}),m&&/*#__PURE__*/_jsx("div",{className:"np-card__content",children:g})]})}),hasChildren=function(a){var b=a.children;return b};Card.propTypes={as:PropTypes.string,isExpanded:requiredIf(PropTypes.bool,hasChildren),title:PropTypes.node.isRequired,details:PropTypes.node.isRequired,onClick:requiredIf(PropTypes.func,hasChildren),icon:PropTypes.node.isRequired,children:PropTypes.node,id:PropTypes.string,className:PropTypes.string,"data-testid":PropTypes.string},Card.defaultProps={as:"div",children:null,id:null,className:null,"data-testid":null};export default Card;
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","isExpanded","title","details","children","onClick","icon","id","className"];import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.concat.js";import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import requiredIf from"react-required-if";import Chevron from"../chevron";import{Position,Key}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Card=/*#__PURE__*/forwardRef(function(a,b){var c=a.as,d=a.isExpanded,e=a.title,f=a.details,g=a.children,h=a.onClick,i=a.icon,j=a.id,k=a.className,l=_objectWithoutProperties(a,_excluded),m=!!(d&&g),n=new Set([Key.ENTER].concat(_toConsumableArray(Key.SPACE)));return/*#__PURE__*/_jsxs(c,{ref:b,className:classNames("tw-card list-group-item p-a-0",k,{active:m}),id:j,"data-testid":l["data-testid"],children:[/*#__PURE__*/_jsx("div",{"aria-expanded":d,className:classNames("p-a-panel tw-card__panel",{"tw-card__panel--inactive":!g}),role:g?"button":null,tabIndex:g?0:void 0,onClick:function onClick(){return g&&h(!d)}// TODO: Consider renaming to onExpand as Card can be expanded with keyboard
2
+ ,onKeyDown:function onKeyDown(a){n.has(a.key)&&g&&(a.preventDefault(),h(!d))},children:/*#__PURE__*/_jsx(Option,{as:"div",media:i,title:e,content:f,decision:!1,button:g&&/*#__PURE__*/_jsx(Chevron,{orientation:m?Position.TOP:Position.DOWN}),inverseMediaCircle:m})}),m&&/*#__PURE__*/_jsx("div",{className:"p-l-panel p-r-panel p-b-panel tw-card__content",children:/*#__PURE__*/_jsxs("div",{className:"media",children:[/*#__PURE__*/_jsx("div",{className:"media-left",children:/*#__PURE__*/_jsx("div",{className:"circle circle-sm circle-inverse circle-responsive invisible"})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("hr",{className:"m-t-0 hidden-xs hidden-sm"}),/*#__PURE__*/_jsx("div",{children:g})]})]})})]})}),hasChildren=function(a){var b=a.children;return b};Card.propTypes={as:PropTypes.string,isExpanded:requiredIf(PropTypes.bool,hasChildren),title:PropTypes.node.isRequired,details:PropTypes.node.isRequired,onClick:requiredIf(PropTypes.func,hasChildren),icon:PropTypes.node.isRequired,children:PropTypes.node,id:PropTypes.string,className:PropTypes.string,"data-testid":PropTypes.string},Card.defaultProps={as:"div",children:null,id:null,className:null,"data-testid":null};export default Card;
@@ -1 +1 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import requiredIf from"react-required-if";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Option=function(a){var b=a.as,c=a.href,d=a.target,e=a.media,f=a.title,g=a.content,h=a.onClick,i=a.htmlFor,j=a.disabled,k=a.button,l=a.decision,m=a.complex,n=a.className,o=a.inverseMediaCircle,p=a.showMediaAtAllSizes,q=a.showMediaCircle;return/*#__PURE__*/_jsx(b,{className:classNames("np-option",n,{"decision-complex":m,decision:l,disabled:j,"np-option__sm-media":p}),href:c,htmlFor:i,target:d,disabled:j&&"button"===b,"aria-label":f,onClick:h,children:/*#__PURE__*/_jsxs("div",{className:"media",children:[e&&/*#__PURE__*/_jsx("div",{className:"media-left",children:q?/*#__PURE__*/_jsx("div",{className:classNames("circle circle-sm text-primary",{"circle-inverse":o}),children:e}):/*#__PURE__*/_jsx("div",{className:"np-option__no-media-circle",children:e})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("div",{className:"h5",children:f}),g]}),/*#__PURE__*/_jsx("div",{className:"media-right",children:k})]})})};Option.propTypes={media:PropTypes.node,htmlFor:PropTypes.string,title:PropTypes.node.isRequired,content:PropTypes.node,onClick:PropTypes.func,href:requiredIf(PropTypes.string,function(a){return"a"===a.as}),target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),as:PropTypes.string,disabled:PropTypes.bool,button:PropTypes.node,decision:PropTypes.bool,complex:PropTypes.bool,inverseMediaCircle:PropTypes.bool,className:PropTypes.string,showMediaAtAllSizes:PropTypes.bool,showMediaCircle:PropTypes.bool},Option.defaultProps={as:"label",media:"",content:null,htmlFor:null,disabled:!1,button:null,onClick:null,href:null,target:void 0,decision:!0,complex:!1,inverseMediaCircle:!0,className:null,showMediaAtAllSizes:!1,showMediaCircle:!0};export default Option;
1
+ import classNames from"classnames";import PropTypes from"prop-types";import requiredIf from"react-required-if";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Option=function(a){var b=a.as,c=a.href,d=a.target,e=a.media,f=a.title,g=a.content,h=a.onClick,i=a.htmlFor,j=a.disabled,k=a.button,l=a.decision,m=a.complex,n=a.className,o=a.inverseMediaCircle,p=a.showMediaAtAllSizes,q=a.showMediaCircle;return/*#__PURE__*/_jsxs(b,{className:classNames(n,"media",{"decision-complex":m,decision:l,disabled:j,"tw-option__sm-media":p}),href:c,htmlFor:i,target:d,disabled:j&&"button"===b,onClick:h,children:[e&&/*#__PURE__*/_jsx("div",{className:"media-left",children:q?/*#__PURE__*/_jsx("div",{className:classNames("circle circle-sm text-primary",{"circle-inverse":o}),children:e}):/*#__PURE__*/_jsx("div",{className:"tw-option__no-media-circle",children:e})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("div",{className:"h5",children:f}),g&&/*#__PURE__*/_jsx("div",{className:"decision__content",children:g})]}),/*#__PURE__*/_jsx("div",{className:"media-right",children:k})]})};Option.propTypes={media:PropTypes.node,htmlFor:PropTypes.string,title:PropTypes.node.isRequired,content:PropTypes.node,onClick:PropTypes.func,href:requiredIf(PropTypes.string,function(a){return"a"===a.as}),target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),as:PropTypes.string,disabled:PropTypes.bool,button:PropTypes.node,decision:PropTypes.bool,complex:PropTypes.bool,inverseMediaCircle:PropTypes.bool,className:PropTypes.string,showMediaAtAllSizes:PropTypes.bool,showMediaCircle:PropTypes.bool},Option.defaultProps={as:"label",media:"",content:null,htmlFor:null,disabled:!1,button:null,onClick:null,href:null,target:void 0,decision:!0,complex:!1,inverseMediaCircle:!0,className:null,showMediaAtAllSizes:!1,showMediaCircle:!0};export default Option;
@@ -0,0 +1 @@
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import"core-js/modules/es.reflect.construct.js";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.function.name.js";import"core-js/modules/es.array.concat.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import{FastFlag as FastFlagIcon}from"@transferwise/icons";import PropTypes from"prop-types";import{Component}from"react";import{Checkbox}from"../..";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var OptionDocumentation=/*#__PURE__*/function(a){function b(){var a;return _classCallCheck(this,b),a=c.call(this),a.state={complex:!1,disabled:!1,hasMedia:!0},a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"createStateLink",value:function createStateLink(a){var b=this;return function(c){return b.setState(_defineProperty({},a,c))}}},{key:"render",value:function render(){var a,b=this.props,c=b.type,d=b.Option,e=b.name,f=b.callbackName,g=b.callback,h=b.callbackString,i=b.propName,j=b.propValue,k=b.title,l=b.content,m=b.extra,n=this.state,o=n.complex,p=n.disabled,q=n.hasMedia;return/*#__PURE__*/_jsx("div",{className:"container",id:"".concat(c,"-option-docs"),children:/*#__PURE__*/_jsxs("div",{className:"section",children:[/*#__PURE__*/_jsxs("div",{className:"row",children:[/*#__PURE__*/_jsxs("div",{className:"col-md-6",children:[/*#__PURE__*/_jsx("h2",{children:k}),/*#__PURE__*/_jsx("p",{children:l})]}),/*#__PURE__*/_jsx("div",{className:"col-md-6",children:/*#__PURE__*/_jsx(d,_objectSpread({id:"".concat(c,"-option"),name:"".concat(c,"-option"),title:k,content:getContentForComplexState(o),complex:o,disabled:p,media:q?/*#__PURE__*/_jsx(FastFlagIcon,{}):void 0},(a={},_defineProperty(a,i,j),_defineProperty(a,f,g),a)))})]}),/*#__PURE__*/_jsxs("div",{className:"row m-t-5",children:[/*#__PURE__*/_jsxs("div",{className:"col-md-6",children:[/*#__PURE__*/_jsx(function Code(){return/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx("pre",{className:"tw-docs-code",children:"<".concat(e,"\n id=\"").concat(c,"-option\"\n name=\"").concat(c,"-option\"\n title=\"").concat(k,"\"\n content=\"").concat(getContentForComplexState(o),"\"").concat(boolProperty(i,j)).concat(boolProperty("complex",o)).concat(boolProperty("disabled",p),"\n ").concat(f,"={").concat(h,"}").concat(q?"\n media={<FastFlagIcon />}":"","\n/>")})})},{}),m]}),/*#__PURE__*/_jsxs("div",{className:"col-md-6",children:[/*#__PURE__*/_jsxs("div",{className:"row",children:[/*#__PURE__*/_jsx("div",{className:"col-md-6",children:/*#__PURE__*/_jsx(Checkbox,{id:"".concat(c,"-option-complex"),label:"Complex",checked:o,onChange:this.createStateLink("complex")})}),/*#__PURE__*/_jsx("div",{className:"col-md-6 m-b-0",children:/*#__PURE__*/_jsx(Checkbox,{id:"".concat(c,"-option-disabled"),label:"Disabled",checked:p,onChange:this.createStateLink("disabled")})})]}),/*#__PURE__*/_jsx("div",{className:"row m-t-2",children:/*#__PURE__*/_jsx("div",{className:"col-md-6",children:/*#__PURE__*/_jsx(Checkbox,{id:"".concat(c,"-option-media"),label:"Has media",checked:q,onChange:this.createStateLink("hasMedia")})})})]})]})]})})}}]),b}(Component);function getContentForComplexState(a){return a?"Complex items should be used for items with long descriptions. Their button and media will be aligned to the top.":"Normally, the button and icon are vertically centered."}function boolProperty(a,b){return b?"\n ".concat(a):""}OptionDocumentation.propTypes={type:PropTypes.string.isRequired,Option:PropTypes.func.isRequired,name:PropTypes.string.isRequired,callbackName:PropTypes.string.isRequired,callback:PropTypes.func.isRequired,callbackString:PropTypes.string.isRequired,propName:PropTypes.string,propValue:PropTypes.bool,title:PropTypes.string.isRequired,content:PropTypes.string.isRequired,extra:PropTypes.string},OptionDocumentation.defaultProps={propName:null,propValue:!1,extra:""};export default OptionDocumentation;
@@ -1 +1 @@
1
- import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.array.concat.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import{MonthFormat}from"../../common";import DateHeader from"../dateHeader";import DayCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var DayCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"selectPreviousMonth",function(){var b=a.props,c=b.viewMonth,d=b.viewYear;a.props.onViewDateUpdate({month:0>=c?11:c-1,year:0>=c?d-1:d})}),_defineProperty(_assertThisInitialized(a),"selectNextMonth",function(){var b=a.props,c=b.viewMonth,d=b.viewYear;a.props.onViewDateUpdate({month:11<=c?0:c+1,year:11<=c?d+1:d})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewMonth,f=a.viewYear,g=a.intl.locale,h=a.monthFormat,i=a.onLabelClick,j=a.onSelect;return/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(DateHeader,{label:formatDate(new Date(f,e),g,{month:h,year:"numeric"}),onLabelClick:i,onPreviousClick:this.selectPreviousMonth,onNextClick:this.selectNextMonth}),/*#__PURE__*/_jsx(DayCalendarTable,{selectedDate:b,min:c,max:d,viewMonth:e,viewYear:f,onSelect:j})]})}}]),b}(PureComponent);DayCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewMonth:PropTypes.number.isRequired,viewYear:PropTypes.number.isRequired,monthFormat:PropTypes.oneOf([MonthFormat.LONG,MonthFormat.SHORT]).isRequired,onSelect:PropTypes.func.isRequired,onLabelClick:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},DayCalendar.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(DayCalendar);
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.array.concat.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import{MonthFormat}from"../../common";import Header from"../header";import DayCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var DayCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"selectPreviousMonth",function(){var b=a.props,c=b.viewMonth,d=b.viewYear;a.props.onViewDateUpdate({month:0>=c?11:c-1,year:0>=c?d-1:d})}),_defineProperty(_assertThisInitialized(a),"selectNextMonth",function(){var b=a.props,c=b.viewMonth,d=b.viewYear;a.props.onViewDateUpdate({month:11<=c?0:c+1,year:11<=c?d+1:d})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewMonth,f=a.viewYear,g=a.intl.locale,h=a.monthFormat,i=a.onLabelClick,j=a.onSelect;return/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Header,{label:formatDate(new Date(f,e),g,{month:h,year:"numeric"}),onLabelClick:i,onPreviousClick:this.selectPreviousMonth,onNextClick:this.selectNextMonth}),/*#__PURE__*/_jsx(DayCalendarTable,{selectedDate:b,min:c,max:d,viewMonth:e,viewYear:f,onSelect:j})]})}}]),b}(PureComponent);DayCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewMonth:PropTypes.number.isRequired,viewYear:PropTypes.number.isRequired,monthFormat:PropTypes.oneOf([MonthFormat.LONG,MonthFormat.SHORT]).isRequired,onSelect:PropTypes.func.isRequired,onLabelClick:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},DayCalendar.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(DayCalendar);
@@ -0,0 +1 @@
1
+ import PropTypes from"prop-types";import Chevron from"../../chevron";import{Position,Size}from"../../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var buttonClasses="btn-link p-a-0 text-no-decoration font-weight-bold",Header=function(a){var b=a.label,c=a.onLabelClick,d=a.onPreviousClick,e=a.onNextClick;return/*#__PURE__*/_jsxs("div",{className:"text-xs-center p-t-1 p-b-2 clearfix",children:[/*#__PURE__*/_jsx("div",{className:"pull-xs-left",children:/*#__PURE__*/_jsx("button",{type:"button",className:buttonClasses,onClick:d,children:/*#__PURE__*/_jsx(Chevron,{orientation:Position.LEFT,size:Size.MEDIUM})})}),b&&/*#__PURE__*/_jsx("button",{type:"button",className:"tw-date-lookup-header-current ".concat(buttonClasses),onClick:c,children:b}),/*#__PURE__*/_jsx("div",{className:"pull-xs-right",children:/*#__PURE__*/_jsx("button",{type:"button",className:buttonClasses,onClick:e,children:/*#__PURE__*/_jsx(Chevron,{orientation:Position.RIGHT,size:Size.MEDIUM})})})]})};Header.propTypes={label:PropTypes.string,onLabelClick:PropTypes.func,onPreviousClick:PropTypes.func.isRequired,onNextClick:PropTypes.func.isRequired},Header.defaultProps={label:null,onLabelClick:function onLabelClick(){}};export default Header;
@@ -0,0 +1 @@
1
+ export{default}from"./Header";
@@ -1 +1 @@
1
- import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.array.concat.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import DateHeader from"../dateHeader";import MonthCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var MonthCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"onMonthSelect",function(b){a.props.onViewDateUpdate({month:b}),a.props.onSelect()}),_defineProperty(_assertThisInitialized(a),"selectPreviousYear",function(){a.props.onViewDateUpdate({year:a.props.viewYear-1})}),_defineProperty(_assertThisInitialized(a),"selectNextYear",function(){a.props.onViewDateUpdate({year:a.props.viewYear+1})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewYear,f=a.intl.locale,g=a.placeholder,h=a.onLabelClick;return/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(DateHeader,{label:formatDate(new Date(e,0),f,{year:"numeric"}),onLabelClick:h,onPreviousClick:this.selectPreviousYear,onNextClick:this.selectNextYear}),/*#__PURE__*/_jsx(MonthCalendarTable,{selectedDate:b,min:c,max:d,viewYear:e,placeholder:g,onSelect:this.onMonthSelect})]})}}]),b}(PureComponent);MonthCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired,onLabelClick:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},MonthCalendar.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(MonthCalendar);
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.array.concat.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import Header from"../header";import MonthCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var MonthCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"onMonthSelect",function(b){a.props.onViewDateUpdate({month:b}),a.props.onSelect()}),_defineProperty(_assertThisInitialized(a),"selectPreviousYear",function(){a.props.onViewDateUpdate({year:a.props.viewYear-1})}),_defineProperty(_assertThisInitialized(a),"selectNextYear",function(){a.props.onViewDateUpdate({year:a.props.viewYear+1})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewYear,f=a.intl.locale,g=a.placeholder,h=a.onLabelClick;return/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Header,{label:formatDate(new Date(e,0),f,{year:"numeric"}),onLabelClick:h,onPreviousClick:this.selectPreviousYear,onNextClick:this.selectNextYear}),/*#__PURE__*/_jsx(MonthCalendarTable,{selectedDate:b,min:c,max:d,viewYear:e,placeholder:g,onSelect:this.onMonthSelect})]})}}]),b}(PureComponent);MonthCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired,onLabelClick:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},MonthCalendar.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(MonthCalendar);
@@ -1 +1 @@
1
- import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.array.concat.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import PropTypes from"prop-types";import{PureComponent}from"react";import DateHeader from"../dateHeader";import YearCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var YearCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"onYearSelect",function(b){a.props.onViewDateUpdate({year:b}),a.props.onSelect()}),_defineProperty(_assertThisInitialized(a),"selectPreviousYears",function(){a.props.onViewDateUpdate({year:a.props.viewYear-20})}),_defineProperty(_assertThisInitialized(a),"selectNextYears",function(){a.props.onViewDateUpdate({year:a.props.viewYear+20})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewYear,f=a.placeholder;return/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(DateHeader,{onPreviousClick:this.selectPreviousYears,onNextClick:this.selectNextYears}),/*#__PURE__*/_jsx(YearCalendarTable,{selectedDate:b,min:c,max:d,viewYear:e,placeholder:f,onSelect:this.onYearSelect})]})}}]),b}(PureComponent);YearCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},YearCalendar.defaultProps={selectedDate:null,min:null,max:null};export default YearCalendar;
1
+ import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.array.concat.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import PropTypes from"prop-types";import{PureComponent}from"react";import Header from"../header";import YearCalendarTable from"./table";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var YearCalendar=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"onYearSelect",function(b){a.props.onViewDateUpdate({year:b}),a.props.onSelect()}),_defineProperty(_assertThisInitialized(a),"selectPreviousYears",function(){a.props.onViewDateUpdate({year:a.props.viewYear-20})}),_defineProperty(_assertThisInitialized(a),"selectNextYears",function(){a.props.onViewDateUpdate({year:a.props.viewYear+20})}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.selectedDate,c=a.min,d=a.max,e=a.viewYear,f=a.placeholder;return/*#__PURE__*/_jsxs("div",{children:[/*#__PURE__*/_jsx(Header,{onPreviousClick:this.selectPreviousYears,onNextClick:this.selectNextYears}),/*#__PURE__*/_jsx(YearCalendarTable,{selectedDate:b,min:c,max:d,viewYear:e,placeholder:f,onSelect:this.onYearSelect})]})}}]),b}(PureComponent);YearCalendar.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired,onViewDateUpdate:PropTypes.func.isRequired},YearCalendar.defaultProps={selectedDate:null,min:null,max:null};export default YearCalendar;
@@ -1,5 +1,5 @@
1
- import"core-js/modules/es.string.starts-with.js";import classNames from"classnames";import PropTypes from"prop-types";import{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,handleTouchMove=function(a){var b=a.target.className.startsWith("dimmer");// disable scroll on iOS devices for Dimmer area
1
+ import classNames from"classnames";import PropTypes from"prop-types";import{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
- isIosDevice()&&b&&(a.stopPropagation(),a.preventDefault())},Dimmer=function(a){var b=a.children,c=a.className,d=a.disableClickToClose,e=a.fadeContentOnEnter,f=a.fadeContentOnExit,g=a.transparent,h=a.onClose,i=a.open,j=a.scrollable,k=useRef(),l=!d&&h?function closeOnClick(a){a.target===k.current&&h(a)}:void 0,m=function(a){"Escape"!==a.key||(a.stopPropagation(),h&&dimmerManager.isTop(k)&&h(a))};return useEffect(function(){return i&&(document.addEventListener("keydown",m),k.current&&k.current.addEventListener("touchmove",handleTouchMove)),function(){document.removeEventListener("keydown",m),k.current&&k.current.removeEventListener("touchmove",handleTouchMove)}},[i]),/*#__PURE__*/_jsx(CSSTransition,{in:i,appear:!0// Wait for animation to finish before unmount.
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=a.fadeContentOnExit,g=a.transparent,h=a.onClose,i=a.open,j=a.scrollable,k=useRef(),l=!d&&h?function closeOnClick(a){a.target===k.current&&h(a)}:void 0,m=function(a){"Escape"!==a.key||(a.stopPropagation(),h&&dimmerManager.isTop(k)&&h(a))};return useEffect(function(){return i&&(document.addEventListener("keydown",m),k.current&&k.current.addEventListener("touchmove",handleTouchMove)),function(){document.removeEventListener("keydown",m),k.current&&k.current.removeEventListener("touchmove",handleTouchMove)}},[i]),/*#__PURE__*/_jsx(CSSTransition,{in:i,appear:!0// Wait for animation to finish before unmount.
5
5
  ,timeout:{enter:0,exit:EXIT_ANIMATION},classNames:{enter:classNames({"dimmer--enter-fade":e}),enterDone:classNames("dimmer--enter-done",{"dimmer--enter-fade":e}),exit:classNames("dimmer--exit",{"dimmer--exit-fade":f})},unmountOnExit:!0,onEnter:function onEnter(){return dimmerManager.add(k)},onExited:function onExited(){return dimmerManager.remove(k)},children:/*#__PURE__*/_jsx(DimmerContentWrapper,{scrollBody:!g,children:/*#__PURE__*/_jsx("div",{ref:k,className:classNames("dimmer",{"dimmer--scrollable":j,"dimmer--transparent":g},c),role:"presentation",onClick:l,children:/*#__PURE__*/_jsx(FocusBoundary,{children:b})})})})};export var DimmerContentWrapper=function(a){var b=a.children,c=a.scrollBody;return useEffect(function(){return c&&addNoScrollBodyClass(),function(){c&&removeNoScrollBodyClass()}},[]),b};Dimmer.propTypes={children:PropTypes.node,className:PropTypes.string,disableClickToClose:PropTypes.bool,fadeContentOnEnter:PropTypes.bool,fadeContentOnExit:PropTypes.bool,/** Sets the background to transparent and prevents body scroll locking */transparent:PropTypes.bool,onClose:PropTypes.func,open:PropTypes.bool,scrollable:PropTypes.bool},Dimmer.defaultProps={children:null,className:void 0,disableClickToClose:!1,fadeContentOnEnter:!1,fadeContentOnExit:!1,transparent:!1,onClose:void 0,open:!1,scrollable:!1};export{Dimmer};export default withNextPortal(Dimmer);
@@ -1,2 +1,2 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.keys.js";import classNames from"classnames";import PropTypes from"prop-types";import{useRef}from"react";import{Breakpoint,Layout}from"../common";import CloseButton from"../common/closeButton";import FlowHeader from"../common/flowHeader";import{useClientWidth}from"../common/hooks";import Logo from"../logo";import Stepper from"../stepper";import AnimatedLabel from"./animatedLabel";import BackButton from"./backButton";// Size switches on parent container which may or may not have the same size as the window.
2
- import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var containerBreakpoints={"np-flow-navigation--sm":Breakpoint.SMALL,"np-flow-navigation--lg":Breakpoint.LARGE},FlowNavigation=function(a){var b=a.activeStep,c=a.avatar,d=a.logo,e=a.onClose,f=a.onGoBack,g=a.done,h=a.steps,i=useRef(null),j=useClientWidth({ref:i}),k=_slicedToArray(j,1),l=k[0],m=e&&/*#__PURE__*/_jsx(CloseButton,{onClick:e}),n=l<Breakpoint.SMALL,o=g?null:c;return/*#__PURE__*/_jsx("div",{ref:i,className:classNames("np-flow-navigation d-flex align-items-center justify-content-center p-y-3",{"np-flow-navigation--border-bottom":!g}),children:/*#__PURE__*/_jsx(FlowHeader,{className:classNames("np-flow-navigation__content p-x-3",{"np-flow-navigation--hidden":!l,"np-flow-navigation--xs-max":n},Object.keys(containerBreakpoints).filter(function(a){return l>=containerBreakpoints[a]})),leftContent:n?function getLeftContentSmall(){return/*#__PURE__*/_jsx(_Fragment,{children:f&&0<b?/*#__PURE__*/_jsx(BackButton,{label:/*#__PURE__*/_jsx(AnimatedLabel,{className:"m-x-1",labels:h.map(function(a){return a.label}),activeLabel:b-1}),onClick:f}):d})}():d,rightContent:/*#__PURE__*/_jsxs(_Fragment,{children:[o,o&&m&&/*#__PURE__*/_jsx("span",{className:"separator"}),m]}),bottomContent:!g&&/*#__PURE__*/_jsx(Stepper,{activeStep:b,steps:h,className:classNames("np-flow-navigation__stepper")}),layout:l<Breakpoint.LARGE?Layout.VERTICAL:Layout.HORIZONTAL})})};FlowNavigation.defaultProps={activeStep:0,avatar:void 0,logo:/*#__PURE__*/_jsx(Logo,{}),onGoBack:void 0,onClose:void 0,done:!1},FlowNavigation.propTypes={activeStep:PropTypes.number,/** An Avatar */avatar:PropTypes.element,logo:PropTypes.node,/** Called when the close button is clicked. If not provided the close button won't show */onClose:PropTypes.func,/** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */onGoBack:PropTypes.func,done:PropTypes.bool,/** Steps to be displayed in stepper. If you don't need the stepper, please use OverlayHeader instead */steps:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.node.isRequired,onClick:PropTypes.func,hoverLabel:PropTypes.node})).isRequired};export default FlowNavigation;
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.keys.js";import classNames from"classnames";import PropTypes from"prop-types";import{useRef}from"react";import{Breakpoint,Layout}from"../common";import CloseButton from"../common/closeButton";import{useClientWidth}from"../common/hooks";import Header from"../header";import Logo from"../logo";import Stepper from"../stepper";import AnimatedLabel from"./animatedLabel";import BackButton from"./backButton";// Size switches on parent container which may or may not have the same size as the window.
2
+ import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var containerBreakpoints={"np-flow-navigation--sm":Breakpoint.SMALL,"np-flow-navigation--lg":Breakpoint.LARGE},FlowNavigation=function(a){var b=a.activeStep,c=a.avatar,d=a.logo,e=a.onClose,f=a.onGoBack,g=a.done,h=a.steps,i=useRef(null),j=useClientWidth({ref:i}),k=_slicedToArray(j,1),l=k[0],m=e&&/*#__PURE__*/_jsx(CloseButton,{onClick:e}),n=l<Breakpoint.SMALL,o=g?null:c;return/*#__PURE__*/_jsx("div",{ref:i,className:classNames("np-flow-navigation d-flex align-items-center justify-content-center p-y-3",{"np-flow-navigation--border-bottom":!g}),children:/*#__PURE__*/_jsx(Header,{className:classNames("np-flow-navigation__content p-x-3",{"np-flow-navigation--hidden":!l,"np-flow-navigation--xs-max":n},Object.keys(containerBreakpoints).filter(function(a){return l>=containerBreakpoints[a]})),leftContent:n?function getLeftContentSmall(){return/*#__PURE__*/_jsx(_Fragment,{children:f&&0<b?/*#__PURE__*/_jsx(BackButton,{label:/*#__PURE__*/_jsx(AnimatedLabel,{className:"m-x-1",labels:h.map(function(a){return a.label}),activeLabel:b-1}),onClick:f}):d})}():d,rightContent:/*#__PURE__*/_jsxs(_Fragment,{children:[o,o&&m&&/*#__PURE__*/_jsx("span",{className:"separator"}),m]}),bottomContent:!g&&/*#__PURE__*/_jsx(Stepper,{activeStep:b,steps:h,className:classNames("np-flow-navigation__stepper")}),layout:l<Breakpoint.LARGE?Layout.VERTICAL:Layout.HORIZONTAL})})};FlowNavigation.defaultProps={activeStep:0,avatar:void 0,logo:/*#__PURE__*/_jsx(Logo,{}),onGoBack:void 0,onClose:void 0,done:!1},FlowNavigation.propTypes={activeStep:PropTypes.number,/** An Avatar */avatar:PropTypes.element,logo:PropTypes.node,/** Called when the close button is clicked. If not provided the close button won't show */onClose:PropTypes.func,/** Called when the back button is clicked. If not provided the back button won't show. The back button only shows on small screens */onGoBack:PropTypes.func,done:PropTypes.bool,/** Steps to be displayed in stepper. If you don't need the stepper, please use OverlayHeader instead */steps:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.node.isRequired,onClick:PropTypes.func,hoverLabel:PropTypes.node})).isRequired};export default FlowNavigation;
@@ -1,5 +1 @@
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 classNames from"classnames";import{Link}from"..";import Button from"../button";import{Priority}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var HeaderAction=function(a){var b=a.action,c={"aria-label":b["aria-label"],className:"np-header__action"};return"href"in b?/*#__PURE__*/_jsx(Link,_objectSpread(_objectSpread({href:b.href,target:b.target},c),{},{children:b.text})):/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({priority:Priority.TERTIARY,onClick:b.onClick},c),{},{children:b.text}))};/**
2
- *
3
- * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header
4
- *
5
- */export var Header=function(a){var b=a.action,c=a.as,d=void 0===c?"span":c,e=a.title,f=a.className;return/*#__PURE__*/_jsxs("div",{className:classNames("np-header",f),children:[/*#__PURE__*/_jsx(d,{className:"h5 np-header__title",children:e}),b&&/*#__PURE__*/_jsx(HeaderAction,{action:b})]})};export default Header;
1
+ import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import{Layout}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Header=/*#__PURE__*/forwardRef(function(a,b){var c=a.bottomContent,d=a.className,e=a.layout,f=a.leftContent,g=a.rightContent,h=e===Layout.VERTICAL;return/*#__PURE__*/_jsxs("div",{ref:b,className:classNames("np-header","d-flex","flex-wrap",d),children:[/*#__PURE__*/_jsx("div",{className:classNames("align-items-center","np-header__left","d-flex",{"flex__item--8":h}),children:f}),/*#__PURE__*/_jsx("div",{className:classNames("align-items-center","d-flex","np-header__right","justify-content-end",{"flex__item--4 ":h,"order-2":!h}),children:g}),/*#__PURE__*/_jsx("div",{className:classNames("align-items-center","d-flex","justify-content-center",{"flex__item--12":h,"order-1 flex-grow-1":!h}),children:c})]})});Header.defaultProps={bottomContent:void 0,className:void 0,layout:Layout.HORIZONTAL,leftContent:void 0,rightContent:void 0},Header.propTypes={bottomContent:PropTypes.node,className:PropTypes.string,layout:PropTypes.oneOf(["HORIZONTAL","VERTICAL"]),leftContent:PropTypes.node,rightContent:PropTypes.node};export default Header;
@@ -2,7 +2,7 @@
2
2
  * Types
3
3
  */ /**
4
4
  * Components
5
- */export{default as Accordion}from"./accordion";export{default as ActionOption}from"./actionOption";export{default as Alert}from"./alert";export{default as Avatar}from"./avatar";export{default as AvatarWrapper}from"./avatarWrapper";export{default as Badge}from"./badge";export{default as BottomSheet}from"./common/bottomSheet";export{default as Button}from"./button";export{default as Card}from"./card";export{default as Checkbox}from"./checkbox";export{default as CheckboxButton}from"./checkboxButton";export{default as CheckboxOption}from"./checkboxOption";export{default as Chevron}from"./chevron";export{default as Chips,Chip}from"./chips";export{default as CircularButton}from"./circularButton";export{default as DateInput}from"./dateInput";export{default as DateLookup}from"./dateLookup";export{default as Decision}from"./decision";export{default as DefinitionList}from"./definitionList";export{default as Dimmer}from"./dimmer";export{default as Drawer}from"./drawer";export{default as DynamicFieldDefinitionList}from"./dynamicFieldDefinitionList";export{default as Emphasis}from"./emphasis";export{default as FlowNavigation}from"./flowNavigation";export{default as Header}from"./header";export{default as Image}from"./image";export{default as Info}from"./info";export{default as InlineAlert}from"./inlineAlert";export{default as InputWithDisplayFormat}from"./inputWithDisplayFormat";export{default as InstructionsList}from"./instructionsList";export{default as Link}from"./link";export{default as Loader}from"./loader";export{default as Logo}from"./logo";export{default as Markdown}from"./markdown";export{default as Modal}from"./modal";export{default as Money}from"./money";export{default as MoneyInput}from"./moneyInput";export{default as NavigationOption}from"./navigationOption";export{default as NavigationOptionsList}from"./navigationOptionsList";export{default as Nudge}from"./nudge";export{default as OverlayHeader}from"./overlayHeader";export{default as PhoneNumberInput}from"./phoneNumberInput";export{default as Popover}from"./popover";export{default as ProcessIndicator}from"./processIndicator";export{default as Provider}from"./provider";export{default as Radio}from"./radio";export{default as RadioGroup}from"./radioGroup";export{default as RadioOption}from"./radioOption";export{default as Section}from"./section";export{default as Select}from"./select";export{default as SlidingPanel}from"./slidingPanel";export{default as SnackbarPortal}from"./snackbar/Snackbar";export{default as SnackbarProvider}from"./snackbar/SnackbarProvider";export{default as Stepper}from"./stepper";export{default as Sticky}from"./sticky";export{default as Summary}from"./summary";export{default as Switch}from"./switch";export{default as SwitchOption}from"./switchOption";export{default as Tabs}from"./tabs";export{default as TextareaWithDisplayFormat}from"./textareaWithDisplayFormat";export{default as Tooltip}from"./tooltip";export{default as Typeahead}from"./typeahead";export{default as Upload}from"./upload";export{default as UploadInput}from"./uploadInput";export{SnackbarConsumer,SnackbarContext}from"./snackbar/SnackbarContext";/**
5
+ */export{default as Provider}from"./provider";export{default as Badge}from"./badge";export{default as Checkbox}from"./checkbox";export{default as CheckboxButton}from"./checkboxButton";export{default as Chips,Chip}from"./chips";export{default as Loader}from"./loader";export{default as Radio}from"./radio";export{default as Select}from"./select";export{default as MoneyInput}from"./moneyInput";export{default as Tooltip}from"./tooltip";export{default as Stepper}from"./stepper";export{default as FlowNavigation}from"./flowNavigation";export{default as Popover}from"./popover";export{default as Money}from"./money";export{default as Modal}from"./modal";export{default as RadioOption}from"./radioOption";export{default as CheckboxOption}from"./checkboxOption";export{default as NavigationOption}from"./navigationOption";export{default as NavigationOptionsList}from"./navigationOptionsList";export{default as DateLookup}from"./dateLookup";export{default as PhoneNumberInput}from"./phoneNumberInput";export{default as DateInput}from"./dateInput";export{default as InstructionsList}from"./instructionsList";export{default as ProcessIndicator}from"./processIndicator";export{default as Upload}from"./upload";export{default as DefinitionList}from"./definitionList";export{default as DynamicFieldDefinitionList}from"./dynamicFieldDefinitionList";export{default as Emphasis}from"./emphasis";export{default as Avatar}from"./avatar";export{default as Button}from"./button";export{default as CircularButton}from"./circularButton";export{default as RadioGroup}from"./radioGroup";export{default as Alert}from"./alert";export{default as InputWithDisplayFormat}from"./inputWithDisplayFormat";export{default as TextareaWithDisplayFormat}from"./textareaWithDisplayFormat";export{default as Chevron}from"./chevron";export{default as Accordion}from"./accordion";export{default as Dimmer}from"./dimmer";export{default as SlidingPanel}from"./slidingPanel";export{default as Drawer}from"./drawer";export{default as Sticky}from"./sticky";export{default as Typeahead}from"./typeahead";export{default as SnackbarPortal}from"./snackbar/Snackbar";export{default as SnackbarProvider}from"./snackbar/SnackbarProvider";export{SnackbarConsumer,SnackbarContext}from"./snackbar/SnackbarContext";export{default as Tabs}from"./tabs";export{default as OverlayHeader}from"./overlayHeader";export{default as Image}from"./image";export{default as Markdown}from"./markdown";export{default as Card}from"./card";export{default as Summary}from"./summary";export{default as Switch}from"./switch";export{default as SwitchOption}from"./switchOption";export{default as Decision}from"./decision";export{default as Nudge}from"./nudge";export{default as InlineAlert}from"./inlineAlert";export{default as AvatarWrapper}from"./avatarWrapper";export{default as Info}from"./info";export{default as Logo}from"./logo";export{default as BottomSheet}from"./common/bottomSheet";export{default as ActionOption}from"./actionOption";export{default as Link}from"./link";export{default as UploadInput}from"./uploadInput";/**
6
6
  * Hooks
7
7
  */export{default as useSnackbar}from"./snackbar/useSnackbar";/**
8
8
  * Enums
@@ -1 +1 @@
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}/* eslint-disable jsx-a11y/control-has-associated-label */import classNames from"classnames";import PropTypes from"prop-types";import requiredIf from"react-required-if";import Chevron from"../chevron";import{Position}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";var NavigationOption=function(a){var b=a.as,c=a.media,d=a.href,e=a.target,f=a.title,g=a.content,h=a.onClick,i=a.complex,j=a.disabled,k=a.showMediaAtAllSizes,l=a.showMediaCircle,m=a.className,n={as:b,media:c,href:d,target:e,title:f,content:g,complex:i,disabled:j,showMediaAtAllSizes:k,showMediaCircle:l,className:classNames("np-navigation-option",m)};return d&&(n.as="a"),/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},n),{},{button:/*#__PURE__*/_jsx(Chevron,{orientation:Position.RIGHT,disabled:j,className:"d-block"}),onClick:function onClick(a){return j?void a.preventDefault():void h(a)}}))};NavigationOption.propTypes={as:PropTypes.string,media:PropTypes.node,title:PropTypes.node.isRequired,content:PropTypes.node,onClick:PropTypes.func,href:requiredIf(PropTypes.string,function(a){return"a"===a.as}),target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),complex:PropTypes.bool,disabled:PropTypes.bool,showMediaAtAllSizes:PropTypes.bool,showMediaCircle:PropTypes.bool,className:PropTypes.string},NavigationOption.defaultProps={as:"button",media:null,content:null,complex:!1,onClick:null,href:void 0,target:void 0,disabled:!1,showMediaAtAllSizes:!1,showMediaCircle:!0,className:null};export default NavigationOption;
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}/* eslint-disable jsx-a11y/control-has-associated-label */import classNames from"classnames";import PropTypes from"prop-types";import requiredIf from"react-required-if";import Chevron from"../chevron";import{Position}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";var NavigationOption=function(a){var b=a.as,c=a.media,d=a.href,e=a.target,f=a.title,g=a.content,h=a.onClick,i=a.complex,j=a.disabled,k=a.showMediaAtAllSizes,l=a.showMediaCircle,m=a.className,n={as:b,media:c,href:d,target:e,title:f,content:g,complex:i,disabled:j,showMediaAtAllSizes:k,showMediaCircle:l,className:classNames("tw-navigation-option",m)};return d&&(n.as="a"),/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},n),{},{button:/*#__PURE__*/_jsx(Chevron,{orientation:Position.RIGHT,disabled:j,className:"d-block"}),onClick:function onClick(a){j||h(a)}}))};NavigationOption.propTypes={as:PropTypes.string,media:PropTypes.node,title:PropTypes.node.isRequired,content:PropTypes.node,onClick:PropTypes.func,href:requiredIf(PropTypes.string,function(a){return"a"===a.as}),target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),complex:PropTypes.bool,disabled:PropTypes.bool,showMediaAtAllSizes:PropTypes.bool,showMediaCircle:PropTypes.bool,className:PropTypes.string},NavigationOption.defaultProps={as:"button",media:null,content:null,complex:!1,onClick:null,href:void 0,target:void 0,disabled:!1,showMediaAtAllSizes:!1,showMediaCircle:!0,className:null};export default NavigationOption;
@@ -1 +1 @@
1
- import"core-js/modules/es.array.map.js";import PropTypes from"prop-types";import{Children}from"react";import{jsx as _jsx}from"react/jsx-runtime";var NavigationOptionList=function(a){var b=a.children;return/*#__PURE__*/_jsx("ul",{className:"np-navigation-options-list",children:Children.map(b,function(a){return/*#__PURE__*/_jsx("li",{className:"np-navigation-options-list__item",children:a},a.key)})})};NavigationOptionList.propTypes={children:PropTypes.node.isRequired};export default NavigationOptionList;
1
+ import"core-js/modules/es.array.map.js";import PropTypes from"prop-types";import{Children}from"react";import{jsx as _jsx}from"react/jsx-runtime";var NavigationOptionList=function(a){var b=a.children;return/*#__PURE__*/_jsx("ul",{className:"tw-navigation-options-list",children:Children.map(b,function(a){return/*#__PURE__*/_jsx("li",{className:"tw-navigation-options-list__item",children:a},a.key)})})};NavigationOptionList.propTypes={children:PropTypes.node.isRequired};export default NavigationOptionList;
@@ -1 +1 @@
1
- import"core-js/modules/es.string.link.js";import{Cross as CrossIcon}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{useDirection}from"../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Nudge=function(a){var b=a.media,c=a.title,d=a.link,e=a.href,f=a.onClick,g=a.onDismiss,h=a.id,i=a.className,j=useDirection(),k=j.isRTL;return/*#__PURE__*/_jsxs("div",{className:classNames("tw-nudge media",i),id:h,children:[/*#__PURE__*/_jsx("div",{className:classNames({"media-left":!k,"media-right":k}),children:b}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("div",{className:"tw-nudge__title media-heading h5",children:c}),/*#__PURE__*/_jsx("a",{href:e,className:"tw-nudge__link",onClick:f,children:d})]}),/*#__PURE__*/_jsx("div",{className:classNames("align-self-start",{"media-right":!k,"media-left":k}),children:/*#__PURE__*/_jsx("button",{type:"button",className:"close","aria-label":"close",onClick:g,children:/*#__PURE__*/_jsx(CrossIcon,{})})})]})};Nudge.propTypes={media:PropTypes.node.isRequired,title:PropTypes.node.isRequired,link:PropTypes.node.isRequired,href:PropTypes.string.isRequired,onClick:PropTypes.func,onDismiss:PropTypes.func.isRequired,id:PropTypes.string,className:PropTypes.string},Nudge.defaultProps={id:null,className:null,onClick:void 0};export default Nudge;
1
+ import"core-js/modules/es.string.link.js";import{Cross as CrossIcon}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{useDirection}from"../common/hooks";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Nudge=function(a){var b=a.media,c=a.title,d=a.link,e=a.href,f=a.onClick,g=a.onDismiss,h=a.id,i=a.className,j=useDirection(),k=j.isRTL;return/*#__PURE__*/_jsxs("div",{className:classNames("tw-nudge media",i),id:h,children:[/*#__PURE__*/_jsx("div",{className:classNames({"media-left":!k,"media-right":k}),children:b}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("div",{className:"tw-nudge__title media-heading h5",children:c}),/*#__PURE__*/_jsx("a",{href:e,className:"tw-nudge__link",onClick:f,children:d})]}),/*#__PURE__*/_jsx("div",{className:classNames({"media-right":!k,"media-left":k}),children:/*#__PURE__*/_jsx("button",{type:"button",className:"close","aria-label":"close",onClick:g,children:/*#__PURE__*/_jsx(CrossIcon,{})})})]})};Nudge.propTypes={media:PropTypes.node.isRequired,title:PropTypes.node.isRequired,link:PropTypes.node.isRequired,href:PropTypes.string.isRequired,onClick:PropTypes.func,onDismiss:PropTypes.func.isRequired,id:PropTypes.string,className:PropTypes.string},Nudge.defaultProps={id:null,className:null,onClick:void 0};export default Nudge;