@transferwise/components 45.4.0 → 45.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (80) hide show
  1. package/build/es/no-polyfill/actionButton/ActionButton.js +1 -1
  2. package/build/es/no-polyfill/actionButton/ActionButton.spec.js +1 -1
  3. package/build/es/no-polyfill/actionButton/ActionButton.story.js +1 -1
  4. package/build/es/no-polyfill/circularButton/CircularButton.js +1 -1
  5. package/build/es/no-polyfill/common/flowHeader/FlowHeader.js +1 -1
  6. package/build/es/no-polyfill/common/hooks/index.js +1 -1
  7. package/build/es/no-polyfill/common/hooks/useClientWidth/useClientWidth.js +1 -1
  8. package/build/es/no-polyfill/common/hooks/useLayout/useLayout.js +1 -1
  9. package/build/es/no-polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
  10. package/build/es/no-polyfill/decision/Decision.js +2 -2
  11. package/build/es/no-polyfill/definitionList/DefinitionList.js +1 -1
  12. package/build/es/no-polyfill/flowNavigation/FlowNavigation.js +2 -2
  13. package/build/es/no-polyfill/flowNavigation/backButton/BackButton.js +1 -1
  14. package/build/es/no-polyfill/index.js +1 -1
  15. package/build/es/no-polyfill/overlayHeader/OverlayHeader.js +1 -1
  16. package/build/es/no-polyfill/phoneNumberInput/data/countries.js +1 -1
  17. package/build/es/no-polyfill/snackbar/Snackbar.js +1 -1
  18. package/build/es/no-polyfill/stepper/Stepper.js +1 -1
  19. package/build/es/no-polyfill/tile/Tile.js +1 -1
  20. package/build/es/polyfill/actionButton/ActionButton.js +1 -1
  21. package/build/es/polyfill/actionButton/ActionButton.spec.js +1 -1
  22. package/build/es/polyfill/actionButton/ActionButton.story.js +1 -1
  23. package/build/es/polyfill/circularButton/CircularButton.js +1 -1
  24. package/build/es/polyfill/common/flowHeader/FlowHeader.js +1 -1
  25. package/build/es/polyfill/common/hooks/index.js +1 -1
  26. package/build/es/polyfill/common/hooks/useClientWidth/useClientWidth.js +1 -1
  27. package/build/es/polyfill/common/hooks/useLayout/useLayout.js +1 -1
  28. package/build/es/polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
  29. package/build/es/polyfill/decision/Decision.js +2 -2
  30. package/build/es/polyfill/definitionList/DefinitionList.js +1 -1
  31. package/build/es/polyfill/flowNavigation/FlowNavigation.js +2 -2
  32. package/build/es/polyfill/flowNavigation/backButton/BackButton.js +1 -1
  33. package/build/es/polyfill/index.js +1 -1
  34. package/build/es/polyfill/overlayHeader/OverlayHeader.js +1 -1
  35. package/build/es/polyfill/phoneNumberInput/data/countries.js +1 -1
  36. package/build/es/polyfill/snackbar/Snackbar.js +1 -1
  37. package/build/es/polyfill/stepper/Stepper.js +1 -1
  38. package/build/es/polyfill/tile/Tile.js +1 -1
  39. package/build/main.css +1 -1
  40. package/build/styles/actionButton/ActionButton.css +1 -1
  41. package/build/styles/main.css +1 -1
  42. package/build/styles/popover/Popover.css +1 -1
  43. package/build/styles/select/Select.css +1 -1
  44. package/build/styles/snackbar/Snackbar.css +1 -1
  45. package/build/styles/stepper/Stepper.css +1 -1
  46. package/build/types/actionButton/ActionButton.d.ts +3 -0
  47. package/build/types/actionButton/ActionButton.story.d.ts +1 -1
  48. package/build/types/button/Button.story.d.ts +24 -24
  49. package/build/types/circularButton/CircularButton.d.ts +1 -1
  50. package/build/types/common/flowHeader/FlowHeader.d.ts +10 -1
  51. package/build/types/common/hooks/index.d.ts +1 -1
  52. package/build/types/common/hooks/useClientWidth/useClientWidth.d.ts +9 -8
  53. package/build/types/decision/Decision.d.ts +1 -1
  54. package/build/types/definitionList/DefinitionList.d.ts +1 -1
  55. package/build/types/flowNavigation/FlowNavigation.d.ts +16 -34
  56. package/build/types/index.d.ts +2 -2
  57. package/build/types/listItem/ListItem.d.ts +1 -1
  58. package/build/types/listItem/ListItem.story.d.ts +1 -1
  59. package/build/types/snackbar/Snackbar.d.ts +1 -1
  60. package/build/types/stepper/Stepper.d.ts +13 -18
  61. package/build/umd/no-polyfill/main.js +1 -1
  62. package/build/umd/polyfill/main.js +1 -1
  63. package/package.json +5 -12
  64. package/scripts/generate-type-declarations.js +0 -2
  65. package/build/es/no-polyfill/common/flowHeader/index.js +0 -1
  66. package/build/es/no-polyfill/common/hooks/useClientWidth/index.js +0 -1
  67. package/build/es/no-polyfill/flowNavigation/index.js +0 -1
  68. package/build/es/no-polyfill/stepper/index.js +0 -1
  69. package/build/es/polyfill/common/flowHeader/index.js +0 -1
  70. package/build/es/polyfill/common/hooks/useClientWidth/index.js +0 -1
  71. package/build/es/polyfill/flowNavigation/index.js +0 -1
  72. package/build/es/polyfill/stepper/index.js +0 -1
  73. package/build/types/common/flowHeader/index.d.ts +0 -1
  74. package/build/types/common/hooks/useClientWidth/index.d.ts +0 -1
  75. package/build/types/flowNavigation/index.d.ts +0 -1
  76. package/build/types/stepper/index.d.ts +0 -2
  77. package/scripts/neptune-upgrader.js +0 -114
  78. package/upgrades/2021-02-v34-35.js +0 -193
  79. package/upgrades/2021-04-v35-36-typescript-support.js +0 -290
  80. package/upgrades/utils/index.js +0 -17
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["disabled","className","onClick","text","children"];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{forwardRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";var ActionButton=/*#__PURE__*/forwardRef(function(a,b){var c=a.disabled,d=a.className,e=void 0===d?void 0:d,f=a.onClick,g=a.text,h=a.children,i=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx("button",_objectSpread(_objectSpread({ref:b,type:"button",className:classNames("np-action-btn","np-text-body-default-bold",e),disabled:void 0!==c&&c,onClick:f},i),{},{children:h||g}))});export default ActionButton;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["disabled","className","onClick","priority","text","children"];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{forwardRef}from"react";import{Priority}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var ActionButton=/*#__PURE__*/forwardRef(function(a,b){var c=a.disabled,d=a.className,e=void 0===d?void 0:d,f=a.onClick,g=a.priority,h=void 0===g?Priority.PRIMARY:g,i=a.text,j=a.children,k=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx("button",_objectSpread(_objectSpread({ref:b,type:"button",className:classNames("np-action-btn","np-text-body-default-bold",h===Priority.SECONDARY?"btn-priority-2":"btn-priority-1",e),disabled:void 0!==c&&c,onClick:f},k),{},{children:j||i}))});export default ActionButton;
@@ -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}import"@testing-library/jest-dom";import{render,screen,userEvent}from"../test-utils";import ActionButton from".";import{jsx as _jsx}from"react/jsx-runtime";describe("ActionButton",function(){var a={children:"Personal profile",onClick:jest.fn()};describe("by default",function(){beforeEach(function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread({},a)))}),it("renders the text",function(){expect(screen.getByText("Personal profile")).toBeInTheDocument()}),it("is not disabled",function(){expect(screen.getByRole("button")).toBeEnabled()}),it("renders the button",function(){expect(render(/*#__PURE__*/_jsx(ActionButton,_objectSpread({},a))).container).toMatchSnapshot()})}),describe("button attributes",function(){it("disables the button if disabled",function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{disabled:!0}))),expect(screen.getByRole("button")).toBeDisabled()}),it("passes through custom classes if set",function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{className:"catsarethebest"}))),expect(screen.getByRole("button")).toHaveClass("catsarethebest")})}),describe("onClick",function(){it("calls onClick when clicked",function(){var b=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{onClick:b}))),userEvent.click(screen.getByRole("button")),expect(b).toHaveBeenCalledTimes(1)}),it("does not call onClick when clicked if disabled",function(){var b=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{disabled:!0,onClick:b}))),userEvent.click(screen.getByRole("button")),expect(b).toHaveBeenCalledTimes(0)})}),describe("deprecated",function(){it("text prop",function(){var a=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,{disabled:!0,text:"Text prop",onClick:a})),expect(screen.getByText("Text prop")).toBeInTheDocument()})})});
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"@testing-library/jest-dom";import{render,screen,userEvent}from"../test-utils";import ActionButton from".";import{jsx as _jsx}from"react/jsx-runtime";describe("ActionButton",function(){var a={children:"Personal profile",onClick:jest.fn()};describe("by default",function(){beforeEach(function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread({},a)))}),it("renders the text",function(){expect(screen.getByText("Personal profile")).toBeInTheDocument()}),it("is not disabled",function(){expect(screen.getByRole("button")).toBeEnabled()}),it("renders the button",function(){expect(render(/*#__PURE__*/_jsx(ActionButton,_objectSpread({},a))).container).toMatchSnapshot()})}),describe("button attributes",function(){it("disables the button if disabled",function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{disabled:!0}))),expect(screen.getByRole("button")).toBeDisabled()}),it("passes through custom classes if set",function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{className:"catsarethebest"}))),expect(screen.getByRole("button")).toHaveClass("catsarethebest")})}),describe("onClick",function(){it("calls onClick when clicked",function(){var b=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{onClick:b}))),userEvent.click(screen.getByRole("button")),expect(b).toHaveBeenCalledTimes(1)}),it("does not call onClick when clicked if disabled",function(){var b=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{disabled:!0,onClick:b}))),userEvent.click(screen.getByRole("button")),expect(b).toHaveBeenCalledTimes(0)})}),describe("deprecated",function(){it("text prop",function(){var a=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,{disabled:!0,text:"Text prop",onClick:a})),expect(screen.getByText("Text prop")).toBeInTheDocument()})}),describe("priority",function(){it("is rendered for primary",function(){render(/*#__PURE__*/_jsx(ActionButton,{priority:"primary"})),expect(screen.getByRole("button")).toHaveClass("btn-priority-1")}),it("is rendered for secondary",function(){render(/*#__PURE__*/_jsx(ActionButton,{priority:"secondary"})),expect(screen.getByRole("button")).toHaveClass("btn-priority-2")}),it("is backwards compatible if nothing is passed in",function(){render(/*#__PURE__*/_jsx(ActionButton,{})),expect(screen.getByRole("button")).toHaveClass("btn-priority-1")})})});
@@ -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}import{Settings}from"@transferwise/icons";import{storyConfig}from"../test-utils/story-config";import ActionButton from"./ActionButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:ActionButton,title:"Actions/ActionButton",tags:["autodocs"]};export var Basic={render:function render(a){return/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{children:"Button label"}))})}};export var WithIcon={render:function render(a){return/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsxs(ActionButton,_objectSpread(_objectSpread({},a),{},{children:[/*#__PURE__*/_jsx(Settings,{className:"m-r-1"}),"Button label"]}))})}};export var Disabled=storyConfig({render:WithIcon.render,args:{disabled:!0}},{variants:["default","dark","rtl","mobile"]});
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{Settings}from"@transferwise/icons";import{storyConfig}from"../test-utils/story-config";import ActionButton from"./ActionButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:ActionButton,title:"Actions/ActionButton",tags:["autodocs"]};export var Basic=storyConfig({render:function render(a){return/*#__PURE__*/_jsxs("div",{style:{display:"flex",gap:"0.4rem",flexWrap:"wrap"},children:[/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({priority:"primary"},a),{},{children:"Primary label"})),/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({priority:"secondary"},a),{},{children:"Secondary label"})),/*#__PURE__*/_jsxs(ActionButton,_objectSpread(_objectSpread({priority:"primary"},a),{},{style:{display:"flex",gap:"0.4rem"},children:[/*#__PURE__*/_jsx(Settings,{}),"Primary label"]})),/*#__PURE__*/_jsxs(ActionButton,_objectSpread(_objectSpread({priority:"secondary"},a),{},{style:{display:"flex",gap:"0.4rem"},children:[/*#__PURE__*/_jsx(Settings,{}),"Secondary label"]}))]})}},{variants:["default","dark","rtl","mobile"]});export var Disabled=storyConfig({render:Basic.render,args:{disabled:!0}},{variants:["default","dark","rtl","mobile"]});
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","children","disabled","icon","priority","type"];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 PropTypes from"prop-types";import{cloneElement}from"react";import Body from"../body/Body";import{typeClassMap,priorityClassMap}from"../button/classMap";import{ControlType,Priority}from"../common";import{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CircularButton=function(a){var b=a.className,c=a.children,d=a.disabled,e=a.icon,f=a.priority,g=a.type,h=_objectWithoutProperties(a,_excluded),i=classNames("btn np-btn",typeClassMap[g],priorityClassMap[f]),j=24===e.props.size?e:/*#__PURE__*/cloneElement(e,{size:24});return/*#__PURE__*/_jsxs("label",{className:classNames("np-circular-btn",f,g,d?"disabled":"",b),children:[/*#__PURE__*/_jsx("input",_objectSpread({type:"button","aria-label":c,className:i,disabled:d},h)),j,/*#__PURE__*/_jsx(Body,{as:"span",className:"np-circular-btn__label",type:Typography.BODY_DEFAULT_BOLD,children:c})]})};CircularButton.propTypes={className:PropTypes.string,children:PropTypes.string.isRequired,disabled:PropTypes.bool,icon:PropTypes.element.isRequired,onClick:PropTypes.func.isRequired,priority:PropTypes.oneOf(["primary","secondary"]),type:PropTypes.oneOf(["accent","positive","negative"])},CircularButton.defaultProps={className:void 0,disabled:!1,priority:Priority.PRIMARY,type:ControlType.ACCENT};export default CircularButton;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","children","disabled","icon","priority","type"];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 PropTypes from"prop-types";import{cloneElement}from"react";import Body from"../body/Body";import{typeClassMap,priorityClassMap}from"../button/classMap";import{ControlType,Priority}from"../common";import{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CircularButton=function(a){var b=a.className,c=a.children,d=a.disabled,e=a.icon,f=a.priority,g=a.type,h=_objectWithoutProperties(a,_excluded),i=classNames("btn np-btn",typeClassMap[g],priorityClassMap[f]),j=24===e.props.size?e:/*#__PURE__*/cloneElement(e,{size:24});return/*#__PURE__*/_jsxs("label",{className:classNames("np-circular-btn",f,g,d?"disabled":"",b),children:[/*#__PURE__*/_jsx("input",_objectSpread({type:"button","aria-label":c,className:i,disabled:d},h)),j,/*#__PURE__*/_jsx(Body,{as:"span",className:"np-circular-btn__label",type:Typography.BODY_DEFAULT_BOLD,children:c})]})};CircularButton.propTypes={className:PropTypes.string,children:PropTypes.string.isRequired,disabled:PropTypes.bool,icon:PropTypes.element.isRequired,onClick:PropTypes.func,priority:PropTypes.oneOf(["primary","secondary"]),type:PropTypes.oneOf(["accent","positive","negative"])},CircularButton.defaultProps={className:void 0,disabled:!1,priority:Priority.PRIMARY,type:ControlType.ACCENT};export default CircularButton;
@@ -1 +1 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import{Layout}from"../propsValues/layouts";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var FlowHeader=/*#__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-flow-header","d-flex","flex-wrap","align-items-center",d),children:[/*#__PURE__*/_jsx("div",{className:classNames("np-flow-header__left",{"flex__item--8":h}),children:f}),/*#__PURE__*/_jsx("div",{className:classNames("align-items-center","d-flex","np-flow-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})]})});FlowHeader.defaultProps={bottomContent:void 0,className:void 0,layout:Layout.HORIZONTAL,leftContent:void 0,rightContent:void 0},FlowHeader.propTypes={bottomContent:PropTypes.node,className:PropTypes.string,layout:PropTypes.oneOf(["HORIZONTAL","VERTICAL"]),leftContent:PropTypes.node,rightContent:PropTypes.node};export default FlowHeader;
1
+ import classNames from"classnames";import*as React from"react";import{Layout}from"../propsValues/layouts";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var FlowHeader=/*#__PURE__*/React.forwardRef(function(a,b){var c=a.bottomContent,d=a.className,e=a.layout,f=void 0===e?Layout.HORIZONTAL:e,g=a.leftContent,h=a.rightContent,i=f===Layout.VERTICAL;return/*#__PURE__*/_jsxs("div",{ref:b,className:classNames("np-flow-header","d-flex","flex-wrap","align-items-center",d),children:[/*#__PURE__*/_jsx("div",{className:classNames("np-flow-header__left",{"flex__item--8":i}),children:g}),/*#__PURE__*/_jsx("div",{className:classNames("align-items-center","d-flex","np-flow-header__right","justify-content-end",{"flex__item--4 ":i,"order-2":!i}),children:h}),/*#__PURE__*/_jsx("div",{className:classNames("align-items-center","d-flex","justify-content-center",{"flex__item--12":i,"order-1 flex-grow-1":!i}),children:c})]})});export default FlowHeader;
@@ -1 +1 @@
1
- export{default as useClientWidth}from"./useClientWidth";export{default as useConditionalListener}from"./useConditionalListener";export{default as useDirection}from"./useDirection";export{default as useHasIntersected}from"./useHasIntersected";export{default as useLayout}from"./useLayout";
1
+ export{useClientWidth}from"./useClientWidth/useClientWidth";export{default as useConditionalListener}from"./useConditionalListener";export{default as useDirection}from"./useDirection";export{default as useHasIntersected}from"./useHasIntersected";export{default as useLayout}from"./useLayout";
@@ -1,5 +1,5 @@
1
1
  import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import throttle from"lodash.throttle";import{useLayoutEffect,useState,useEffect}from"react";var THROTTLE_MS=100,useIsomorphicLayoutEffect="undefined"==typeof window?useEffect:useLayoutEffect;export var useClientWidth=function(a){var b=a.ref,c=a.throttleMs,d=void 0===c?THROTTLE_MS:c,e=useState(null),f=_slicedToArray(e,2),g=f[0],h=f[1];return useIsomorphicLayoutEffect(function(){// eslint-disable-next-line unicorn/consistent-function-scoping
2
- var a=function(){b&&(b.innerWidth?h(b.innerWidth):b.current&&h(b.current.clientWidth))},c=throttle(a,d);// This assignment saves a reference to the function so it will be the same passed to both addEventListener removeEventListener.
2
+ var a=function(){b&&("innerWidth"in b?h(b.innerWidth):b.current&&h(b.current.clientWidth))},c=throttle(a,d);// This assignment saves a reference to the function so it will be the same passed to both addEventListener removeEventListener.
3
3
  // If throttle gets passed directly to both add and removeEventListenet the results will be that the event
4
4
  // won't get removed even if the component is unmounted.
5
5
  return window.addEventListener("resize",c,!0),window.requestAnimationFrame(a),function(){return window.removeEventListener("resize",c,!0)}},[]),[g]};useClientWidth.THROTTLE_MS=100;
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{useEffect,useState}from"react";import{Breakpoint}from"../../propsValues/breakpoint";import useClientWidth from"../useClientWidth";export var useLayout=function(){var a="undefined"==typeof window?void 0:window,b=useState(),c=_slicedToArray(b,2),d=c[0],e=c[1],f=useClientWidth({ref:a}),g=_slicedToArray(f,1),h=g[0];return useEffect(function(){return h?h<=Breakpoint.EXTRA_SMALL?void e(Breakpoint.EXTRA_SMALL):Breakpoint.EXTRA_SMALL<h&&h<=Breakpoint.SMALL?void e(Breakpoint.SMALL):Breakpoint.SMALL<h&&h<=Breakpoint.MEDIUM?void e(Breakpoint.MEDIUM):Breakpoint.MEDIUM<h&&h<=Breakpoint.LARGE?void e(Breakpoint.LARGE):void(Breakpoint.LARGE<h&&e(Breakpoint.EXTRA_LARGE)):void 0},[h]),{isMobile:!!d&&[Breakpoint.EXTRA_SMALL,Breakpoint.SMALL].includes(d),isExtraSmall:d===Breakpoint.EXTRA_SMALL,isSmall:d===Breakpoint.SMALL,isMedium:d===Breakpoint.MEDIUM,isLarge:d===Breakpoint.LARGE,isExtraLarge:d===Breakpoint.EXTRA_LARGE}};
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{useEffect,useState}from"react";import{Breakpoint}from"../../propsValues/breakpoint";import{useClientWidth}from"../useClientWidth/useClientWidth";export var useLayout=function(){var a="undefined"==typeof window?void 0:window,b=useState(),c=_slicedToArray(b,2),d=c[0],e=c[1],f=useClientWidth({ref:a}),g=_slicedToArray(f,1),h=g[0];return useEffect(function(){return h?h<=Breakpoint.EXTRA_SMALL?void e(Breakpoint.EXTRA_SMALL):Breakpoint.EXTRA_SMALL<h&&h<=Breakpoint.SMALL?void e(Breakpoint.SMALL):Breakpoint.SMALL<h&&h<=Breakpoint.MEDIUM?void e(Breakpoint.MEDIUM):Breakpoint.MEDIUM<h&&h<=Breakpoint.LARGE?void e(Breakpoint.LARGE):void(Breakpoint.LARGE<h&&e(Breakpoint.EXTRA_LARGE)):void 0},[h]),{isMobile:!!d&&[Breakpoint.EXTRA_SMALL,Breakpoint.SMALL].includes(d),isExtraSmall:d===Breakpoint.EXTRA_SMALL,isSmall:d===Breakpoint.SMALL,isMedium:d===Breakpoint.MEDIUM,isLarge:d===Breakpoint.LARGE,isExtraLarge:d===Breakpoint.EXTRA_LARGE}};
@@ -1 +1 @@
1
- import{formatDate}from"@transferwise/formatting";import{isKey}from"@transferwise/neptune-validation";import{useTheme}from"@wise/components-theming";import PropTypes from"prop-types";import{useIntl}from"react-intl";import Chevron from"../../chevron";import{Size,Position}from"../../common";import{CloseButton}from"../../common/closeButton/CloseButton";import messages from"./DateTrigger.messages";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var DateTrigger=function(a){var b=a.selectedDate,c=a.size,d=a.placeholder,e=a.label,f=a.monthFormat,g=a.disabled,h=a.onClick,i=a.onClear,j=useTheme(),k=j.isModern,l=useIntl(),m=l.locale,n=l.formatMessage;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("button",{className:"btn btn-".concat(c," btn-input np-date-trigger"),disabled:g,type:"button",onClick:h,children:[e&&/*#__PURE__*/_jsx("span",{className:"control-label small m-r-1",children:e}),b?/*#__PURE__*/_jsx("span",{className:"font-weight-normal",children:formatDate(b,m,{day:"numeric",month:f,year:"numeric"})}):/*#__PURE__*/_jsx("span",{className:"form-control-placeholder visible-xs-inline visible-sm-inline visible-md-inline visible-lg-inline visible-xl-inline",children:d}),i?null:/*#__PURE__*/_jsx(Chevron,{orientation:Position.BOTTOM,disabled:g})]}),i?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("div",{className:"clearfix"}),/*#__PURE__*/_jsx("span",{className:"input-group-addon",children:/*#__PURE__*/_jsx(CloseButton,{className:"clear-btn clear-btn--".concat(c),"aria-label":n(messages.ariaLabel),size:Size.SMALL,onClick:function(a){a.stopPropagation(),a.preventDefault(),i()},onKeyPress:function handleKeyDown(a){(isKey({keyType:"Space",event:a})||isKey({keyType:"Enter",event:a}))&&(a.stopPropagation(),a.preventDefault(),i())}})})]}):null]})};DateTrigger.propTypes={selectedDate:PropTypes.instanceOf(Date),size:PropTypes.oneOf(["sm","md","lg"]),placeholder:PropTypes.string.isRequired,label:PropTypes.string.isRequired,monthFormat:PropTypes.oneOf(["short","long"]).isRequired,disabled:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired,onClear:PropTypes.func},DateTrigger.defaultProps={selectedDate:null,size:Size.MEDIUM,onClear:void 0};export default DateTrigger;
1
+ import{formatDate}from"@transferwise/formatting";import{isKey}from"@transferwise/neptune-validation";import PropTypes from"prop-types";import{useIntl}from"react-intl";import Chevron from"../../chevron";import{Size,Position}from"../../common";import{CloseButton}from"../../common/closeButton/CloseButton";import messages from"./DateTrigger.messages";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var DateTrigger=function(a){var b=a.selectedDate,c=a.size,d=a.placeholder,e=a.label,f=a.monthFormat,g=a.disabled,h=a.onClick,i=a.onClear,j=useIntl(),k=j.locale,l=j.formatMessage;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("button",{className:"btn btn-".concat(c," btn-input np-date-trigger"),disabled:g,type:"button",onClick:h,children:[e&&/*#__PURE__*/_jsx("span",{className:"control-label small m-r-1",children:e}),b?/*#__PURE__*/_jsx("span",{className:"font-weight-normal",children:formatDate(b,k,{day:"numeric",month:f,year:"numeric"})}):/*#__PURE__*/_jsx("span",{className:"form-control-placeholder visible-xs-inline visible-sm-inline visible-md-inline visible-lg-inline visible-xl-inline",children:d}),i?null:/*#__PURE__*/_jsx(Chevron,{orientation:Position.BOTTOM,disabled:g})]}),i?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("div",{className:"clearfix"}),/*#__PURE__*/_jsx("span",{className:"input-group-addon",children:/*#__PURE__*/_jsx(CloseButton,{className:"clear-btn clear-btn--".concat(c),"aria-label":l(messages.ariaLabel),size:Size.SMALL,onClick:function(a){a.stopPropagation(),a.preventDefault(),i()},onKeyPress:function handleKeyDown(a){(isKey({keyType:"Space",event:a})||isKey({keyType:"Enter",event:a}))&&(a.stopPropagation(),a.preventDefault(),i())}})})]}):null]})};DateTrigger.propTypes={selectedDate:PropTypes.instanceOf(Date),size:PropTypes.oneOf(["sm","md","lg"]),placeholder:PropTypes.string.isRequired,label:PropTypes.string.isRequired,monthFormat:PropTypes.oneOf(["short","long"]).isRequired,disabled:PropTypes.bool.isRequired,onClick:PropTypes.func,onClear:PropTypes.func},DateTrigger.defaultProps={selectedDate:null,size:Size.MEDIUM,onClear:void 0};export default DateTrigger;
@@ -1,5 +1,5 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import requiredIf from"react-required-if";import{Size,Breakpoint}from"../common";import NavigationOption from"../navigationOption";import SizeSwapper from"../sizeSwapper";import Tile from"../tile";import{Presentation,Type}from"./decisionEnums";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var Decision=function(a){var b=a.options,c=a.presentation,d=a.type,e=a.showMediaCircleInList,f=a.isContainerAligned,g=a.size;if(d===Type.NAVIGATION){var h=Presentation.LIST_BLOCK,i=Presentation.LIST_BLOCK_GRID;if(c===h||c===i){var j=g===Size.SMALL,k=c===i,l=[{items:[],layout:SizeSwapper.Layout.COLUMN},{items:[],breakpoint:j?Breakpoint.EXTRA_SMALL:Breakpoint.SMALL,wrap:k}];return b.forEach(function(a,b){var c=a.description,d=a.disabled,g=a.href,h=a.target,i=a.media,m=i.block,n=i.list,o=a.onClick,p=a.title;l[0].items.push(/*#__PURE__*/_jsx(NavigationOption// eslint-disable-next-line react/no-array-index-key
1
+ import classNames from"classnames";import PropTypes from"prop-types";import{Size,Breakpoint}from"../common";import NavigationOption from"../navigationOption";import SizeSwapper from"../sizeSwapper";import Tile from"../tile";import{Presentation,Type}from"./decisionEnums";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var Decision=function(a){var b=a.options,c=a.presentation,d=a.type,e=a.showMediaCircleInList,f=a.isContainerAligned,g=a.size;if(d===Type.NAVIGATION){var h=Presentation.LIST_BLOCK,i=Presentation.LIST_BLOCK_GRID;if(c===h||c===i){var j=g===Size.SMALL,k=c===i,l=[{items:[],layout:SizeSwapper.Layout.COLUMN},{items:[],breakpoint:j?Breakpoint.EXTRA_SMALL:Breakpoint.SMALL,wrap:k}];return b.forEach(function(a,b){var c=a.description,d=a.disabled,g=a.href,h=a.target,i=a.media,m=i.block,n=i.list,o=a.onClick,p=a.title;l[0].items.push(/*#__PURE__*/_jsx(NavigationOption// eslint-disable-next-line react/no-array-index-key
2
2
  ,{complex:!1,content:c,disabled:d,href:g,target:h,media:n,showMediaAtAllSizes:!0,showMediaCircle:e,isContainerAligned:f,title:p,onClick:o},"nav-".concat(b))),l[1].items.push(/*#__PURE__*/_jsx(Tile// eslint-disable-next-line react/no-array-index-key
3
3
  ,{className:classNames("np-decision__tile".concat(j?"--small":""),{"np-decision__tile--fixed-width":k}),description:c,disabled:d,href:g,target:h,media:m,size:j?Size.SMALL:Size.MEDIUM,title:p,onClick:o},"tile-".concat(b)))}),/*#__PURE__*/_jsx("div",{className:classNames("np-decision",{"np-decision--small":j,"np-decision--grid":k}),children:/*#__PURE__*/_jsx(SizeSwapper,{items:l})})}// LIST
4
4
  return b.map(function(a,b){var c=a.title,d=a.description,g=a.disabled,h=a.href,i=a.target,j=a.media.list,k=a.onClick;return/*#__PURE__*/_jsx(NavigationOption// eslint-disable-next-line react/no-array-index-key
5
- ,{complex:!1,content:d,disabled:g,href:h,target:i,media:j,showMediaAtAllSizes:!0,showMediaCircle:e,isContainerAligned:f,title:c,onClick:k},"nav-".concat(b))})}return/*#__PURE__*/_jsx(_Fragment,{})};Decision.propTypes={/** A list of elements to be rendered */options:PropTypes.arrayOf(PropTypes.shape({description:PropTypes.node,disabled:PropTypes.bool,href:requiredIf(PropTypes.string,function(a){return a.type===Type.NAVIGATION}),target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),media:PropTypes.shape({block:PropTypes.node.isRequired,list:PropTypes.node.isRequired}),onClick:PropTypes.func,title:PropTypes.node.isRequired})).isRequired,/** Handles the display mode of the component */presentation:PropTypes.oneOf(["LIST","LIST_BLOCK","LIST_BLOCK_GRID"]),/** Size currently affects only Tile dimension */size:PropTypes.oneOf(["sm","md"]),/** Decide which kind of element type needs to be rendered ex: Navigation Options or in the future Radio or Checkbox Options */type:PropTypes.oneOf(["NAVIGATION"]),/** Display media in a circle in list presentation */showMediaCircleInList:PropTypes.bool,/** Sets navigation options to be aligned with the parent container */isContainerAligned:PropTypes.bool},Decision.defaultProps={presentation:Presentation.LIST,size:Size.MEDIUM,type:Type.NAVIGATION,showMediaCircleInList:!0,isContainerAligned:!1};export default Decision;
5
+ ,{complex:!1,content:d,disabled:g,href:h,target:i,media:j,showMediaAtAllSizes:!0,showMediaCircle:e,isContainerAligned:f,title:c,onClick:k},"nav-".concat(b))})}return/*#__PURE__*/_jsx(_Fragment,{})};Decision.propTypes={/** A list of elements to be rendered */options:PropTypes.arrayOf(PropTypes.shape({description:PropTypes.node,disabled:PropTypes.bool,href:PropTypes.string,target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),media:PropTypes.shape({block:PropTypes.node.isRequired,list:PropTypes.node.isRequired}),onClick:PropTypes.func,title:PropTypes.node.isRequired})).isRequired,/** Handles the display mode of the component */presentation:PropTypes.oneOf(["LIST","LIST_BLOCK","LIST_BLOCK_GRID"]),/** Size currently affects only Tile dimension */size:PropTypes.oneOf(["sm","md"]),/** Decide which kind of element type needs to be rendered ex: Navigation Options or in the future Radio or Checkbox Options */type:PropTypes.oneOf(["NAVIGATION"]),/** Display media in a circle in list presentation */showMediaCircleInList:PropTypes.bool,/** Sets navigation options to be aligned with the parent container */isContainerAligned:PropTypes.bool},Decision.defaultProps={presentation:Presentation.LIST,size:Size.MEDIUM,type:Type.NAVIGATION,showMediaCircleInList:!0,isContainerAligned:!1};export default Decision;
@@ -1 +1 @@
1
- import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import classNames from"classnames";import PropTypes from"prop-types";import ActionButton from"../actionButton";import{Layout}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var isLayoutHorizontal=function(a){return[Layout.HORIZONTAL_LEFT_ALIGNED,Layout.HORIZONTAL_RIGHT_ALIGNED,Layout.HORIZONTAL_JUSTIFIED].includes(a)},getAlignmentClasses=function(a,b){var c=["d-flex"];return b&&(isLayoutHorizontal(a)?c.push("align-items-center"):c.push("align-items-start")),a===Layout.HORIZONTAL_RIGHT_ALIGNED?c.push("text-sm-right tw-definition-list--right-aligned-desktop"):c.push("justify-content-between"),a===Layout.HORIZONTAL_JUSTIFIED&&c.push("text-sm-justify"),c},DefinitionList=function(a){var b=a.definitions,c=a.layout,d=a.muted;return/*#__PURE__*/_jsx("dl",{className:classNames("tw-definition-list d-flex ",{"text-muted":d,"flex-column":c===Layout.VERTICAL_ONE_COLUMN,"tw-definition-list--columns flex-column flex-row--sm":c===Layout.VERTICAL_TWO_COLUMN,"tw-definition-list--horizontal flex-column":isLayoutHorizontal(c)}),children:b.filter(function(a){return a}).map(function(a){var b=a.action,d=a.title,e=a.value,f=a.key;return/*#__PURE__*/_jsxs("div",{className:"tw-definition-list__item",children:[/*#__PURE__*/_jsx("dt",{children:d}),/*#__PURE__*/_jsxs("dd",{className:classNames.apply(void 0,_toConsumableArray(getAlignmentClasses(c,b))),children:[/*#__PURE__*/_jsx("div",{children:e}),b?/*#__PURE__*/_jsx("div",{className:classNames(isLayoutHorizontal(c)?"p-l-2":"p-x-2","tw-definition-list__action"),children:/*#__PURE__*/_jsx(ActionButton,{className:"tw-definition-list__button",onClick:b.onClick,children:b.label})}):null]})]},f)})})};DefinitionList.propTypes={definitions:PropTypes.arrayOf(PropTypes.shape({action:PropTypes.shape({label:PropTypes.string.isRequired,onClick:PropTypes.func.isRequired}),title:PropTypes.node.isRequired,value:PropTypes.node.isRequired,key:PropTypes.string.isRequired})),layout:PropTypes.oneOf(["VERTICAL_TWO_COLUMN","VERTICAL_ONE_COLUMN","HORIZONTAL_JUSTIFIED","HORIZONTAL_LEFT_ALIGNED","HORIZONTAL_RIGHT_ALIGNED"]),muted:PropTypes.bool},DefinitionList.defaultProps={definitions:[],layout:Layout.VERTICAL_TWO_COLUMN,muted:!1};export default DefinitionList;
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import classNames from"classnames";import PropTypes from"prop-types";import ActionButton from"../actionButton";import{Layout}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var isLayoutHorizontal=function(a){return[Layout.HORIZONTAL_LEFT_ALIGNED,Layout.HORIZONTAL_RIGHT_ALIGNED,Layout.HORIZONTAL_JUSTIFIED].includes(a)},getAlignmentClasses=function(a,b){var c=["d-flex"];return b&&(isLayoutHorizontal(a)?c.push("align-items-center"):c.push("align-items-start")),a===Layout.HORIZONTAL_RIGHT_ALIGNED?c.push("text-sm-right tw-definition-list--right-aligned-desktop"):c.push("justify-content-between"),a===Layout.HORIZONTAL_JUSTIFIED&&c.push("text-sm-justify"),c},DefinitionList=function(a){var b=a.definitions,c=a.layout,d=a.muted;return/*#__PURE__*/_jsx("dl",{className:classNames("tw-definition-list d-flex ",{"text-muted":d,"flex-column":c===Layout.VERTICAL_ONE_COLUMN,"tw-definition-list--columns flex-column flex-row--sm":c===Layout.VERTICAL_TWO_COLUMN,"tw-definition-list--horizontal flex-column":isLayoutHorizontal(c)}),children:b.filter(function(a){return a}).map(function(a){var b=a.action,d=a.title,e=a.value,f=a.key;return/*#__PURE__*/_jsxs("div",{className:"tw-definition-list__item",children:[/*#__PURE__*/_jsx("dt",{children:d}),/*#__PURE__*/_jsxs("dd",{className:classNames.apply(void 0,_toConsumableArray(getAlignmentClasses(c,b))),children:[/*#__PURE__*/_jsx("div",{children:e}),b?/*#__PURE__*/_jsx("div",{className:classNames(isLayoutHorizontal(c)?"p-l-2":"p-x-2","tw-definition-list__action"),children:/*#__PURE__*/_jsx(ActionButton,{className:"tw-definition-list__button",onClick:b.onClick,children:b.label})}):null]})]},f)})})};DefinitionList.propTypes={definitions:PropTypes.arrayOf(PropTypes.shape({action:PropTypes.shape({label:PropTypes.string.isRequired,onClick:PropTypes.func}),title:PropTypes.node.isRequired,value:PropTypes.node.isRequired,key:PropTypes.string.isRequired})),layout:PropTypes.oneOf(["VERTICAL_TWO_COLUMN","VERTICAL_ONE_COLUMN","HORIZONTAL_JUSTIFIED","HORIZONTAL_LEFT_ALIGNED","HORIZONTAL_RIGHT_ALIGNED"]),muted:PropTypes.bool},DefinitionList.defaultProps={definitions:[],layout:Layout.VERTICAL_TWO_COLUMN,muted:!1};export default DefinitionList;
@@ -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,{size:"lg",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{useRef}from"react";import React from"react";import{Breakpoint,Layout}from"../common";import{CloseButton}from"../common/closeButton";import FlowHeader from"../common/flowHeader/FlowHeader";import{useClientWidth}from"../common/hooks";import Logo from"../logo";import Stepper from"../stepper/Stepper";import AnimatedLabel from"./animatedLabel";import BackButton from"./backButton";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 FlowNavigation=function(a){var b=a.activeStep,c=void 0===b?0:b,d=a.avatar,e=a.logo,f=void 0===e?/*#__PURE__*/_jsx(Logo,{}):e,g=a.done,h=void 0!==g&&g,i=a.onClose,j=a.onGoBack,k=a.steps,l=useRef(null),m=useClientWidth({ref:l}),n=_slicedToArray(m,1),o=n[0],p=null!=i&&/*#__PURE__*/_jsx(CloseButton,{size:"lg",onClick:i}),q=null!=o&&o<Breakpoint.SMALL,r=h?null:d;return/*#__PURE__*/_jsx("div",{ref:l,className:classNames("np-flow-navigation d-flex align-items-center justify-content-center p-y-3",{"np-flow-navigation--border-bottom":!h}),children:/*#__PURE__*/_jsx(FlowHeader,{className:classNames("np-flow-navigation__content p-x-3",{"np-flow-navigation--hidden":!o,"np-flow-navigation--xs-max":q,// Size switches on parent container which may or may not have the same size as the window.
2
+ "np-flow-navigation--sm":null!=o&&o>=Breakpoint.SMALL,"np-flow-navigation--lg":null!=o&&o>=Breakpoint.LARGE}),leftContent:q?function getLeftContentSmall(){return/*#__PURE__*/_jsx(_Fragment,{children:null!=j&&0<c?/*#__PURE__*/_jsx(BackButton,{label:/*#__PURE__*/_jsx(AnimatedLabel,{className:"m-x-1",labels:k.map(function(a){return a.label}),activeLabel:c-1}),onClick:j}):f})}():f,rightContent:/*#__PURE__*/_jsxs(_Fragment,{children:[r,r&&p&&/*#__PURE__*/_jsx("span",{className:"separator"}),p]}),bottomContent:!h&&/*#__PURE__*/_jsx(Stepper,{activeStep:c,steps:k,className:classNames("np-flow-navigation__stepper")}),layout:null!=o&&o<Breakpoint.LARGE?Layout.VERTICAL:Layout.HORIZONTAL})})};export default FlowNavigation;
@@ -1 +1 @@
1
- import{ArrowLeft as ArrowLeftIcon}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var BackButton=function(a){var b=a.label,c=a.className,d=a.onClick;return/*#__PURE__*/_jsxs("button",{type:"button",className:classNames("np-back-button","align-items-center","btn-unstyled",c),onClick:d,children:[/*#__PURE__*/_jsx(ArrowLeftIcon,{size:24}),b]})};BackButton.propTypes={className:PropTypes.string,label:PropTypes.element,onClick:PropTypes.func.isRequired},BackButton.defaultProps={className:void 0,label:void 0};export default BackButton;
1
+ import{ArrowLeft as ArrowLeftIcon}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var BackButton=function(a){var b=a.label,c=a.className,d=a.onClick;return/*#__PURE__*/_jsxs("button",{type:"button",className:classNames("np-back-button","align-items-center","btn-unstyled",c),onClick:d,children:[/*#__PURE__*/_jsx(ArrowLeftIcon,{size:24}),b]})};BackButton.propTypes={className:PropTypes.string,label:PropTypes.element,onClick:PropTypes.func},BackButton.defaultProps={className:void 0,label:void 0};export default BackButton;
@@ -2,7 +2,7 @@
2
2
  * Types
3
3
  */ /**
4
4
  * Components
5
- */export{default as Title}from"./title";export{default as Body}from"./body";export{default as Accordion}from"./accordion";export{default as ActionButton}from"./actionButton";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 Display}from"./display";export{default as Drawer}from"./drawer";export{default as DropFade}from"./dropFade";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{Input}from"./inputs/Input";export{TextArea}from"./inputs/TextArea";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 Option}from"./common/Option";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 ProgressBar}from"./progressBar";export{default as Progress}from"./progress";export{default as Provider,DirectionProvider,LanguageProvider}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 StatusIcon}from"./statusIcon/StatusIcon";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";export{default as CriticalCommsBanner}from"./criticalBanner";export{default as ListItem}from"./listItem";/**
5
+ */export{default as Title}from"./title";export{default as Body}from"./body";export{default as Accordion}from"./accordion";export{default as ActionButton}from"./actionButton";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 Display}from"./display";export{default as Drawer}from"./drawer";export{default as DropFade}from"./dropFade";export{default as DynamicFieldDefinitionList}from"./dynamicFieldDefinitionList";export{default as Emphasis}from"./emphasis";export{default as FlowNavigation}from"./flowNavigation/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{Input}from"./inputs/Input";export{TextArea}from"./inputs/TextArea";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 Option}from"./common/Option";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 ProgressBar}from"./progressBar";export{default as Progress}from"./progress";export{default as Provider,DirectionProvider,LanguageProvider}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 StatusIcon}from"./statusIcon/StatusIcon";export{default as Stepper}from"./stepper/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";export{default as CriticalCommsBanner}from"./criticalBanner";export{default as ListItem}from"./listItem";/**
6
6
  * Hooks
7
7
  */export{default as useSnackbar}from"./snackbar/useSnackbar";export{useDirection,useLayout}from"./common/hooks";/**
8
8
  * Enums
@@ -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("div",{className:"np-overlay-header d-flex justify-content-center",children:/*#__PURE__*/_jsx(FlowHeader,{className:"np-overlay-header__content 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 FlowHeader from"../common/flowHeader/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("div",{className:"np-overlay-header d-flex justify-content-center",children:/*#__PURE__*/_jsx(FlowHeader,{className:"np-overlay-header__content 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
- var countries=[{name:"Afghanistan",iso2:"AF",iso3:"AFG",phone:"+93"},{name:"\xC5land Islands",iso2:"AX",iso3:"ALA",phone:"+358"},{name:"Albania",iso2:"AL",iso3:"ALB",phone:"+355"},{name:"Algeria",iso2:"DZ",iso3:"DZA",phone:"+213"},{name:"American Samoa",iso2:"AS",iso3:"ASM",phone:"+1684"},{name:"Andorra",iso2:"AD",iso3:"AND",phone:"+376"},{name:"Angola",iso2:"AO",iso3:"AGO",phone:"+244"},{name:"Anguilla",iso2:"AI",iso3:"AIA",phone:"+1264"},{name:"Antarctica",iso2:"AQ",iso3:"ATA",phone:"+672"},{name:"Antigua",iso2:"AG",iso3:"ATG",phone:"+1268"},{name:"Argentina",iso2:"AR",iso3:"ARG",phone:"+54"},{name:"Armenia",iso2:"AM",iso3:"ARM",phone:"+374"},{name:"Aruba",iso2:"AW",iso3:"ABW",phone:"+297"},{name:"Ascension Island",iso2:"SH",iso3:"SHN",phone:"+247"},{name:"Australia",iso2:"AU",iso3:"AUS",phone:"+61"},{name:"Australian Antarctic Territory",iso2:"AQ",iso3:"ATA",phone:"+672"},{name:"Austria",iso2:"AT",iso3:"AUT",phone:"+43"},{name:"Azerbaijan",iso2:"AZ",iso3:"AZE",phone:"+994"},{name:"Bahamas",iso2:"BS",iso3:"BHS",phone:"+1242"},{name:"Bahrain",iso2:"BH",iso3:"BHR",phone:"+973"},{name:"Bangladesh",iso2:"BD",iso3:"BGD",phone:"+880"},{name:"Barbados",iso2:"BB",iso3:"BRB",phone:"+1246"},{name:"Belarus",iso2:"BY",iso3:"BLR",phone:"+375"},{name:"Belgium",iso2:"BE",iso3:"BEL",phone:"+32"},{name:"Belize",iso2:"BZ",iso3:"BLZ",phone:"+501"},{name:"Benin",iso2:"BJ",iso3:"BEN",phone:"+229"},{name:"Bermuda",iso2:"BM",iso3:"BMU",phone:"+1441"},{name:"Bhutan",iso2:"BT",iso3:"BTN",phone:"+975"},{name:"Bolivia",iso2:"BO",iso3:"BOL",phone:"+591"},{name:"Bonaire, Sint Eustatius and Saba",iso2:"BQ",iso3:"BES",phone:"+599"},{name:"Bosnia and Herzegovina",iso2:"BA",iso3:"BIH",phone:"+387"},{name:"Botswana",iso2:"BW",iso3:"BWA",phone:"+267"},{name:"Brazil",iso2:"BR",iso3:"BRA",phone:"+55"},{name:"British Virgin Islands",iso2:"VG",iso3:"VGB",phone:"+1284"},{name:"Brunei",iso2:"BN",iso3:"BRN",phone:"+673"},{name:"Bulgaria",iso2:"BG",iso3:"BGR",phone:"+359"},{name:"Burkina Faso",iso2:"BF",iso3:"BFA",phone:"+226"},{name:"Burundi",iso2:"BI",iso3:"BDI",phone:"+257"},{name:"Cambodia",iso2:"KH",iso3:"KHM",phone:"+855"},{name:"Cameroon",iso2:"CM",iso3:"CMR",phone:"+237"},{name:"Canada",iso2:"CA",iso3:"CAN",phone:"+1"},{name:"Cape Verde",iso2:"CV",iso3:"CPV",phone:"+238"},{name:"Cayman Islands",iso2:"KY",iso3:"CYM",phone:"+1345"},{name:"Central African Republic",iso2:"CF",iso3:"CAF",phone:"+236"},{name:"Chad",iso2:"TD",iso3:"TCD",phone:"+235"},{name:"Chile",iso2:"CL",iso3:"CHL",phone:"+56"},{name:"China",iso2:"CN",iso3:"CHN",phone:"+86"},{name:"Christmas Island",iso2:"CX",iso3:"CXR",phone:"+61"},{name:"Cocos (Keeling) Islands",iso2:"CC",iso3:"CCK",phone:"+61"},{name:"Colombia",iso2:"CO",iso3:"COL",phone:"+57"},{name:"Comoros",iso2:"KM",iso3:"COM",phone:"+269"},{name:"Congo",iso2:"CG",iso3:"COG",phone:"+242"},{name:"Cook Islands",iso2:"CK",iso3:"COK",phone:"+682"},{name:"Costa Rica",iso2:"CR",iso3:"CRI",phone:"+506"},{name:"Croatia",iso2:"HR",iso3:"HRV",phone:"+385"},{name:"Cuba",iso2:"CU",iso3:"CUB",phone:"+53"},{name:"Cura\xE7ao",iso2:"CW",iso3:"CUW",phone:"+599"},{name:"Cyprus",iso2:"CY",iso3:"CYP",phone:"+357"},{name:"Czech Republic",iso2:"CZ",iso3:"CZE",phone:"+420"},{name:"Democratic Republic of the Congo",iso2:"CD",iso3:"COD",phone:"+243"},{name:"Denmark",iso2:"DK",iso3:"DNK",phone:"+45"},{name:"Diego Garcia",iso2:"IO",iso3:"IOT",phone:"+246"},{name:"Djibouti",iso2:"DJ",iso3:"DJI",phone:"+253"},{name:"Dominica",iso2:"DM",iso3:"DMA",phone:"+1767"},{name:"Dominican Republic",iso2:"DO",iso3:"DOM",phone:"+1809"},{name:"Dominican Republic",iso2:"DO",iso3:"DOM",phone:"+1829"},{name:"Dominican Republic",iso2:"DO",iso3:"DOM",phone:"+1849"},{name:"East Timor",iso2:"TL",iso3:"TLS",phone:"+670"},{name:"Ecuador",iso2:"EC",iso3:"ECU",phone:"+593"},{name:"Egypt",iso2:"EG",iso3:"EGY",phone:"+20"},{name:"El Salvador",iso2:"SV",iso3:"SLV",phone:"+503"},{name:"Equatorial Guinea",iso2:"GQ",iso3:"GNQ",phone:"+240"},{name:"Eritrea",iso2:"ER",iso3:"ERI",phone:"+291"},{name:"Estonia",iso2:"EE",iso3:"EST",phone:"+372"},{name:"Ethiopia",iso2:"ET",iso3:"ETH",phone:"+251"},{name:"Falkland Islands",iso2:"FK",iso3:"FLK",phone:"+500"},{name:"Faroe Islands",iso2:"FO",iso3:"FRO",phone:"+298"},{name:"Fiji",iso2:"FJ",iso3:"FJI",phone:"+679"},{name:"Finland",iso2:"FI",iso3:"FIN",phone:"+358"},{name:"France",iso2:"FR",iso3:"FRA",phone:"+33"},{name:"French Guiana",iso2:"GF",iso3:"GUF",phone:"+594"},{name:"French Polynesia",iso2:"PF",iso3:"PYF",phone:"+689"},{name:"French Southern Territories",iso2:"TF",iso3:"ATF",phone:"+262"},{name:"Gabon",iso2:"GA",iso3:"GAB",phone:"+241"},{name:"Gambia",iso2:"GM",iso3:"GMB",phone:"+220"},{name:"Georgia",iso2:"GE",iso3:"GEO",phone:"+995"},{name:"Germany",iso2:"DE",iso3:"DEU",phone:"+49"},{name:"Ghana",iso2:"GH",iso3:"GHA",phone:"+233"},{name:"Gibraltar",iso2:"GI",iso3:"GIB",phone:"+350"},{name:"Greece",iso2:"GR",iso3:"GRC",phone:"+30"},{name:"Greenland",iso2:"GL",iso3:"GRL",phone:"+299"},{name:"Grenada",iso2:"GD",iso3:"GRD",phone:"+1473"},{name:"Guadeloupe",iso2:"GP",iso3:"GLP",phone:"+596"},{name:"Guadeloupe",iso2:"GP",iso3:"GLP",phone:"+590"},{name:"Guam",iso2:"GU",iso3:"GUM",phone:"+1671"},{name:"Guatemala",iso2:"GT",iso3:"GTM",phone:"+502"},{name:"Guernsey",iso2:"GG",iso3:"GGY",phone:"+44",phoneFormat:"**** *** ***"},{name:"Guinea",iso2:"GN",iso3:"GIN",phone:"+224"},{name:"Guinea-Bissau",iso2:"GW",iso3:"GNB",phone:"+245"},{name:"Guyana",iso2:"GY",iso3:"GUY",phone:"+592"},{name:"Haiti",iso2:"HT",iso3:"HTI",phone:"+509"},{name:"Holy See",iso2:"VA",iso3:"VAT",phone:"+379"},{name:"Honduras",iso2:"HN",iso3:"HND",phone:"+504"},{name:"Hong Kong",iso2:"HK",iso3:"HKG",phone:"+852"},{name:"Hungary",iso2:"HU",iso3:"HUN",phone:"+36"},{name:"Iceland",iso2:"IS",iso3:"ISL",phone:"+354"},{name:"India",iso2:"IN",iso3:"IND",phone:"+91"},{name:"Indonesia",iso2:"ID",iso3:"IDN",phone:"+62"},{name:"Iran",iso2:"IR",iso3:"IRN",phone:"+98"},{name:"Iraq",iso2:"IQ",iso3:"IRQ",phone:"+964"},{name:"Ireland",iso2:"IE",iso3:"IRL",phone:"+353"},{name:"Isle of Man",iso2:"IM",iso3:"IMN",phone:"+44"},{name:"Israel",iso2:"IL",iso3:"ISR",phone:"+972"},{name:"Italy",iso2:"IT",iso3:"ITA",phone:"+39"},{name:"Ivory Coast",iso2:"CI",iso3:"CIV",phone:"+225"},{name:"Jamaica",iso2:"JM",iso3:"JAM",phone:"+1876"},{name:"Japan",iso2:"JP",iso3:"JPN",phone:"+81"},{name:"Jersey",iso2:"JE",iso3:"JEY",phone:"+44"},{name:"Jordan",iso2:"JO",iso3:"JOR",phone:"+962"},{name:"Kazakhstan",iso2:"KZ",iso3:"KAZ",phone:"+7"},{name:"Kenya",iso2:"KE",iso3:"KEN",phone:"+254"},{name:"Kiribati",iso2:"KI",iso3:"KIR",phone:"+686"},{name:"Kosovo",iso2:"XK",iso3:"RKS",phone:"+383"},{name:"Kuwait",iso2:"KW",iso3:"KWT",phone:"+965"},{name:"Kyrgyzstan",iso2:"KG",iso3:"KGZ",phone:"+996"},{name:"Laos",iso2:"LA",iso3:"LAO",phone:"+856"},{name:"Latvia",iso2:"LV",iso3:"LVA",phone:"+371"},{name:"Lebanon",iso2:"LB",iso3:"LBN",phone:"+961"},{name:"Lesotho",iso2:"LS",iso3:"LSO",phone:"+266"},{name:"Liberia",iso2:"LR",iso3:"LBR",phone:"+231"},{name:"Libya",iso2:"LY",iso3:"LBY",phone:"+218"},{name:"Liechtenstein",iso2:"LI",iso3:"LIE",phone:"+423"},{name:"Lithuania",iso2:"LT",iso3:"LTU",phone:"+370"},{name:"Luxembourg",iso2:"LU",iso3:"LUX",phone:"+352"},{name:"Macau",iso2:"MO",iso3:"MAC",phone:"+853"},{name:"Macedonia",iso2:"MK",iso3:"MKD",phone:"+389"},{name:"Madagascar",iso2:"MG",iso3:"MDG",phone:"+261"},{name:"Malawi",iso2:"MW",iso3:"MWI",phone:"+265"},{name:"Malaysia",iso2:"MY",iso3:"MYS",phone:"+60"},{name:"Maldives",iso2:"MV",iso3:"MDV",phone:"+960"},{name:"Mali",iso2:"ML",iso3:"MLI",phone:"+223"},{name:"Malta",iso2:"MT",iso3:"MLT",phone:"+356"},{name:"Marshall Islands",iso2:"MH",iso3:"MHL",phone:"+692"},{name:"Martinique",iso2:"MQ",iso3:"MTQ",phone:"+596"},{name:"Mauritania",iso2:"MR",iso3:"MRT",phone:"+222"},{name:"Mauritius",iso2:"MU",iso3:"MUS",phone:"+230"},{name:"Mayotte",iso2:"YT",iso3:"MYT",phone:"+262"},{name:"Mexico",iso2:"MX",iso3:"MEX",phone:"+52"},{name:"Micronesia",iso2:"FM",iso3:"FSM",phone:"+691"},{name:"Moldova",iso2:"MD",iso3:"MDA",phone:"+373"},{name:"Monaco",iso2:"MC",iso3:"MCO",phone:"+377"},{name:"Mongolia",iso2:"MN",iso3:"MNG",phone:"+976"},{name:"Montenegro",iso2:"ME",iso3:"MNE",phone:"+382"},{name:"Montserrat",iso2:"MS",iso3:"MSR",phone:"+1664"},{name:"Morocco",iso2:"MA",iso3:"MAR",phone:"+212"},{name:"Mozambique",iso2:"MZ",iso3:"MOZ",phone:"+258"},{name:"Myanmar",iso2:"MM",iso3:"MMR",phone:"+95"},{name:"Namibia",iso2:"NA",iso3:"NAM",phone:"+264"},{name:"Nauru",iso2:"NR",iso3:"NRU",phone:"+674"},{name:"Nepal",iso2:"NP",iso3:"NPL",phone:"+977"},{name:"Netherlands",iso2:"NL",iso3:"NLD",phone:"+31"},{name:"Netherlands Antilles",iso2:"AN",iso3:"ANT",phone:"+599"},{name:"New Caledonia",iso2:"NC",iso3:"NCL",phone:"+687"},{name:"New Zealand",iso2:"NZ",iso3:"NZL",phone:"+64"},{name:"Nicaragua",iso2:"NI",iso3:"NIC",phone:"+505"},{name:"Niger",iso2:"NE",iso3:"NER",phone:"+227"},{name:"Nigeria",iso2:"NG",iso3:"NGA",phone:"+234"},{name:"Niue",iso2:"NU",iso3:"NIU",phone:"+683"},{name:"Norfolk Island",iso2:"NF",iso3:"NFK",phone:"+672"},{name:"North Korea",iso2:"KP",iso3:"PRK",phone:"+850"},{name:"Northern Mariana Islands",iso2:"MP",iso3:"MNP",phone:"+1670"},{name:"Norway",iso2:"NO",iso3:"NOR",phone:"+47"},{name:"Oman",iso2:"OM",iso3:"OMN",phone:"+968"},{name:"Pakistan",iso2:"PK",iso3:"PAK",phone:"+92"},{name:"Palau",iso2:"PW",iso3:"PLW",phone:"+680"},{name:"Palestine",iso2:"PS",iso3:"PSE",phone:"+970"},{name:"Panama",iso2:"PA",iso3:"PAN",phone:"+507"},{name:"Papua New Guinea",iso2:"PG",iso3:"PNG",phone:"+675"},{name:"Paraguay",iso2:"PY",iso3:"PRY",phone:"+595"},{name:"Peru",iso2:"PE",iso3:"PER",phone:"+51"},{name:"Philippines",iso2:"PH",iso3:"PHL",phone:"+63"},{name:"Pitcairn",iso2:"PN",iso3:"PCN",phone:"+64"},{name:"Poland",iso2:"PL",iso3:"POL",phone:"+48"},{name:"Portugal",iso2:"PT",iso3:"PRT",phone:"+351"},{name:"Puerto Rico",iso2:"PR",iso3:"PRI",phone:"+1939"},{name:"Qatar",iso2:"QA",iso3:"QAT",phone:"+974"},{name:"Reunion Island",iso2:"RE",iso3:"REU",phone:"+262"},{name:"Romania",iso2:"RO",iso3:"ROU",phone:"+40"},{name:"Russia",iso2:"RU",iso3:"RUS",phone:"+7"},{name:"Rwanda",iso2:"RW",iso3:"RWA",phone:"+250"},{name:"Saint Barth\xE9lemy",iso2:"BL",iso3:"BLM",phone:"+590"},{name:"Saint Helena",iso2:"SH",iso3:"SHN",phone:"+290"},{name:"Saint Kitts and Nevis",iso2:"KN",iso3:"KNA",phone:"+1869"},{name:"Saint Lucia",iso2:"LC",iso3:"LCA",phone:"+1758"},{name:"Saint Martin (French part)",iso2:"MF",iso3:"MAF",phone:"+590"},{name:"Saint Pierre and Miquelon",iso2:"PM",iso3:"SPM",phone:"+508"},{name:"Saint Vincent and the Grenadines",iso2:"VC",iso3:"VCT",phone:"+1784"},{name:"San Marino",iso2:"SM",iso3:"SMR",phone:"+378"},{name:"Sao Tome and Principe",iso2:"ST",iso3:"STP",phone:"+239"},{name:"Saudi Arabia",iso2:"SA",iso3:"SAU",phone:"+966"},{name:"Senegal",iso2:"SN",iso3:"SEN",phone:"+221"},{name:"Serbia",iso2:"RS",iso3:"SRB",phone:"+381"},{name:"Seychelles",iso2:"SC",iso3:"SYC",phone:"+248"},{name:"Sierra Leone",iso2:"SL",iso3:"SLE",phone:"+232"},{name:"Singapore",iso2:"SG",iso3:"SGP",phone:"+65"},{name:"Sint Maarten",iso2:"SX",iso3:"SXM",phone:"+1721"},{name:"Slovakia",iso2:"SK",iso3:"SVK",phone:"+421"},{name:"Slovenia",iso2:"SI",iso3:"SVN",phone:"+386"},{name:"Solomon Islands",iso2:"SB",iso3:"SLB",phone:"+677"},{name:"Somalia",iso2:"SO",iso3:"SOM",phone:"+252"},{name:"South Africa",iso2:"ZA",iso3:"ZAF",phone:"+27"},{name:"South Georgia and the South Sandwich Islands",iso2:"GS",iso3:"SGS",phone:"+500"},{name:"South Korea",iso2:"KR",iso3:"KOR",phone:"+82"},{name:"South Sudan",iso2:"SS",iso3:"SSD",phone:"+211"},{name:"Spain",iso2:"ES",iso3:"ESP",phone:"+34"},{name:"Sri Lanka",iso2:"LK",iso3:"LKA",phone:"+94"},{name:"Sudan",iso2:"SD",iso3:"SDN",phone:"+249"},{name:"Suriname",iso2:"SR",iso3:"SUR",phone:"+597"},{name:"Svalbard and Jan Mayen",iso2:"SJ",iso3:"SJM",phone:"+47"},{name:"Swaziland",iso2:"SZ",iso3:"SWZ",phone:"+268"},{name:"Sweden",iso2:"SE",iso3:"SWE",phone:"+46"},{name:"Switzerland",iso2:"CH",iso3:"CHE",phone:"+41"},{name:"Syria",iso2:"SY",iso3:"SYR",phone:"+963"},{name:"Taiwan",iso2:"TW",iso3:"TWN",phone:"+886"},{name:"Tajikistan",iso2:"TJ",iso3:"TJK",phone:"+992"},{name:"Tanzania",iso2:"TZ",iso3:"TZA",phone:"+255"},{name:"Thailand",iso2:"TH",iso3:"THA",phone:"+66"},{name:"Togo",iso2:"TG",iso3:"TGO",phone:"+228"},{name:"Tokelau",iso2:"TK",iso3:"TKL",phone:"+690"},{name:"Tonga",iso2:"TO",iso3:"TON",phone:"+676"},{name:"Trinidad and Tobago",iso2:"TT",iso3:"TTO",phone:"+1868"},{name:"Tunisia",iso2:"TN",iso3:"TUN",phone:"+216"},{name:"Turkey",iso2:"TR",iso3:"TUR",phone:"+90"},{name:"Turkmenistan",iso2:"TM",iso3:"TKM",phone:"+993"},{name:"Turks and Caicos",iso2:"TC",iso3:"TCA",phone:"+1649"},{name:"Tuvalu",iso2:"TV",iso3:"TUV",phone:"+688"},{name:"Uganda",iso2:"UG",iso3:"UGA",phone:"+256"},{name:"Ukraine",iso2:"UA",iso3:"UKR",phone:"+380"},{name:"United Arab Emirates",iso2:"AE",iso3:"ARE",phone:"+971"},{name:"United Kingdom",iso2:"GB",iso3:"GBR",phone:"+44",phoneFormat:"**** *** ***"},{name:"United States Minor Outlying Islands",iso2:"UM",iso3:"UMI",phone:"+1"},{name:"United States of America",iso2:"US",iso3:"USA",phone:"+1"},{name:"Uruguay",iso2:"UY",iso3:"URY",phone:"+598"},{name:"Uzbekistan",iso2:"UZ",iso3:"UZB",phone:"+998"},{name:"Vanuatu",iso2:"VU",iso3:"VUT",phone:"+678"},{name:"Venezuela",iso2:"VE",iso3:"VEN",phone:"+58"},{name:"Vietnam",iso2:"VN",iso3:"VNM",phone:"+84"},{name:"Virgin Islands (U.S.)",iso2:"VI",iso3:"VIR",phone:"+1340"},{name:"Wallis and Futuna",iso2:"WF",iso3:"WLF",phone:"+681"},{name:"Western Sahara",iso2:"EH",iso3:"ESH",phone:"+212"},{name:"Western Samoa",iso2:"WS",iso3:"WSM",phone:"+685"},{name:"Yemen",iso2:"YE",iso3:"YEM",phone:"+967"},{name:"Zambia",iso2:"ZM",iso3:"ZMB",phone:"+260"},{name:"Zimbabwe",iso2:"ZW",iso3:"ZWE",phone:"+263"}];export default countries;
1
+ var countries=[{name:"Afghanistan",iso2:"AF",iso3:"AFG",phone:"+93"},{name:"\xC5land Islands",iso2:"AX",iso3:"ALA",phone:"+358"},{name:"Albania",iso2:"AL",iso3:"ALB",phone:"+355"},{name:"Algeria",iso2:"DZ",iso3:"DZA",phone:"+213"},{name:"American Samoa",iso2:"AS",iso3:"ASM",phone:"+1684"},{name:"Andorra",iso2:"AD",iso3:"AND",phone:"+376"},{name:"Angola",iso2:"AO",iso3:"AGO",phone:"+244"},{name:"Anguilla",iso2:"AI",iso3:"AIA",phone:"+1264"},{name:"Antarctica",iso2:"AQ",iso3:"ATA",phone:"+672"},{name:"Antigua",iso2:"AG",iso3:"ATG",phone:"+1268"},{name:"Argentina",iso2:"AR",iso3:"ARG",phone:"+54"},{name:"Armenia",iso2:"AM",iso3:"ARM",phone:"+374"},{name:"Aruba",iso2:"AW",iso3:"ABW",phone:"+297"},{name:"Ascension Island",iso2:"SH",iso3:"SHN",phone:"+247"},{name:"Australia",iso2:"AU",iso3:"AUS",phone:"+61"},{name:"Australian Antarctic Territory",iso2:"AQ",iso3:"ATA",phone:"+672"},{name:"Austria",iso2:"AT",iso3:"AUT",phone:"+43"},{name:"Azerbaijan",iso2:"AZ",iso3:"AZE",phone:"+994"},{name:"Bahamas",iso2:"BS",iso3:"BHS",phone:"+1242"},{name:"Bahrain",iso2:"BH",iso3:"BHR",phone:"+973"},{name:"Bangladesh",iso2:"BD",iso3:"BGD",phone:"+880"},{name:"Barbados",iso2:"BB",iso3:"BRB",phone:"+1246"},{name:"Belarus",iso2:"BY",iso3:"BLR",phone:"+375"},{name:"Belgium",iso2:"BE",iso3:"BEL",phone:"+32"},{name:"Belize",iso2:"BZ",iso3:"BLZ",phone:"+501"},{name:"Benin",iso2:"BJ",iso3:"BEN",phone:"+229"},{name:"Bermuda",iso2:"BM",iso3:"BMU",phone:"+1441"},{name:"Bhutan",iso2:"BT",iso3:"BTN",phone:"+975"},{name:"Bolivia",iso2:"BO",iso3:"BOL",phone:"+591"},{name:"Bonaire, Sint Eustatius and Saba",iso2:"BQ",iso3:"BES",phone:"+599"},{name:"Bosnia and Herzegovina",iso2:"BA",iso3:"BIH",phone:"+387"},{name:"Botswana",iso2:"BW",iso3:"BWA",phone:"+267"},{name:"Brazil",iso2:"BR",iso3:"BRA",phone:"+55"},{name:"British Virgin Islands",iso2:"VG",iso3:"VGB",phone:"+1284"},{name:"Brunei",iso2:"BN",iso3:"BRN",phone:"+673"},{name:"Bulgaria",iso2:"BG",iso3:"BGR",phone:"+359"},{name:"Burkina Faso",iso2:"BF",iso3:"BFA",phone:"+226"},{name:"Burundi",iso2:"BI",iso3:"BDI",phone:"+257"},{name:"Cambodia",iso2:"KH",iso3:"KHM",phone:"+855"},{name:"Cameroon",iso2:"CM",iso3:"CMR",phone:"+237"},{name:"Canada",iso2:"CA",iso3:"CAN",phone:"+1"},{name:"Cape Verde",iso2:"CV",iso3:"CPV",phone:"+238"},{name:"Cayman Islands",iso2:"KY",iso3:"CYM",phone:"+1345"},{name:"Central African Republic",iso2:"CF",iso3:"CAF",phone:"+236"},{name:"Chad",iso2:"TD",iso3:"TCD",phone:"+235"},{name:"Chile",iso2:"CL",iso3:"CHL",phone:"+56"},{name:"China",iso2:"CN",iso3:"CHN",phone:"+86"},{name:"Christmas Island",iso2:"CX",iso3:"CXR",phone:"+61"},{name:"Cocos (Keeling) Islands",iso2:"CC",iso3:"CCK",phone:"+61"},{name:"Colombia",iso2:"CO",iso3:"COL",phone:"+57"},{name:"Comoros",iso2:"KM",iso3:"COM",phone:"+269"},{name:"Congo",iso2:"CG",iso3:"COG",phone:"+242"},{name:"Cook Islands",iso2:"CK",iso3:"COK",phone:"+682"},{name:"Costa Rica",iso2:"CR",iso3:"CRI",phone:"+506"},{name:"Croatia",iso2:"HR",iso3:"HRV",phone:"+385"},{name:"Cuba",iso2:"CU",iso3:"CUB",phone:"+53"},{name:"Cura\xE7ao",iso2:"CW",iso3:"CUW",phone:"+599"},{name:"Cyprus",iso2:"CY",iso3:"CYP",phone:"+357"},{name:"Czech Republic",iso2:"CZ",iso3:"CZE",phone:"+420"},{name:"Democratic Republic of the Congo",iso2:"CD",iso3:"COD",phone:"+243"},{name:"Denmark",iso2:"DK",iso3:"DNK",phone:"+45"},{name:"Diego Garcia",iso2:"IO",iso3:"IOT",phone:"+246"},{name:"Djibouti",iso2:"DJ",iso3:"DJI",phone:"+253"},{name:"Dominica",iso2:"DM",iso3:"DMA",phone:"+1767"},{name:"Dominican Republic",iso2:"DO",iso3:"DOM",phone:"+1809"},{name:"Dominican Republic",iso2:"DO",iso3:"DOM",phone:"+1829"},{name:"Dominican Republic",iso2:"DO",iso3:"DOM",phone:"+1849"},{name:"East Timor",iso2:"TL",iso3:"TLS",phone:"+670"},{name:"Ecuador",iso2:"EC",iso3:"ECU",phone:"+593"},{name:"Egypt",iso2:"EG",iso3:"EGY",phone:"+20"},{name:"El Salvador",iso2:"SV",iso3:"SLV",phone:"+503"},{name:"Equatorial Guinea",iso2:"GQ",iso3:"GNQ",phone:"+240"},{name:"Eritrea",iso2:"ER",iso3:"ERI",phone:"+291"},{name:"Estonia",iso2:"EE",iso3:"EST",phone:"+372"},{name:"Ethiopia",iso2:"ET",iso3:"ETH",phone:"+251"},{name:"Falkland Islands",iso2:"FK",iso3:"FLK",phone:"+500"},{name:"Faroe Islands",iso2:"FO",iso3:"FRO",phone:"+298"},{name:"Fiji",iso2:"FJ",iso3:"FJI",phone:"+679"},{name:"Finland",iso2:"FI",iso3:"FIN",phone:"+358"},{name:"France",iso2:"FR",iso3:"FRA",phone:"+33"},{name:"French Guiana",iso2:"GF",iso3:"GUF",phone:"+594"},{name:"French Polynesia",iso2:"PF",iso3:"PYF",phone:"+689"},{name:"French Southern Territories",iso2:"TF",iso3:"ATF",phone:"+262"},{name:"Gabon",iso2:"GA",iso3:"GAB",phone:"+241"},{name:"Gambia",iso2:"GM",iso3:"GMB",phone:"+220"},{name:"Georgia",iso2:"GE",iso3:"GEO",phone:"+995"},{name:"Germany",iso2:"DE",iso3:"DEU",phone:"+49"},{name:"Ghana",iso2:"GH",iso3:"GHA",phone:"+233"},{name:"Gibraltar",iso2:"GI",iso3:"GIB",phone:"+350"},{name:"Greece",iso2:"GR",iso3:"GRC",phone:"+30"},{name:"Greenland",iso2:"GL",iso3:"GRL",phone:"+299"},{name:"Grenada",iso2:"GD",iso3:"GRD",phone:"+1473"},{name:"Guadeloupe",iso2:"GP",iso3:"GLP",phone:"+596"},{name:"Guadeloupe",iso2:"GP",iso3:"GLP",phone:"+590"},{name:"Guam",iso2:"GU",iso3:"GUM",phone:"+1671"},{name:"Guatemala",iso2:"GT",iso3:"GTM",phone:"+502"},{name:"Guernsey",iso2:"GG",iso3:"GGY",phone:"+44",phoneFormat:"**** *** ***"},{name:"Guinea",iso2:"GN",iso3:"GIN",phone:"+224"},{name:"Guinea-Bissau",iso2:"GW",iso3:"GNB",phone:"+245"},{name:"Guyana",iso2:"GY",iso3:"GUY",phone:"+592"},{name:"Haiti",iso2:"HT",iso3:"HTI",phone:"+509"},{name:"Holy See",iso2:"VA",iso3:"VAT",phone:"+379"},{name:"Honduras",iso2:"HN",iso3:"HND",phone:"+504"},{name:"Hong Kong",iso2:"HK",iso3:"HKG",phone:"+852"},{name:"Hungary",iso2:"HU",iso3:"HUN",phone:"+36"},{name:"Iceland",iso2:"IS",iso3:"ISL",phone:"+354"},{name:"India",iso2:"IN",iso3:"IND",phone:"+91"},{name:"Indonesia",iso2:"ID",iso3:"IDN",phone:"+62"},{name:"Iran",iso2:"IR",iso3:"IRN",phone:"+98"},{name:"Iraq",iso2:"IQ",iso3:"IRQ",phone:"+964"},{name:"Ireland",iso2:"IE",iso3:"IRL",phone:"+353"},{name:"Isle of Man",iso2:"IM",iso3:"IMN",phone:"+44"},{name:"Israel",iso2:"IL",iso3:"ISR",phone:"+972"},{name:"Italy",iso2:"IT",iso3:"ITA",phone:"+39"},{name:"Ivory Coast",iso2:"CI",iso3:"CIV",phone:"+225"},{name:"Jamaica",iso2:"JM",iso3:"JAM",phone:"+1876"},{name:"Japan",iso2:"JP",iso3:"JPN",phone:"+81"},{name:"Jersey",iso2:"JE",iso3:"JEY",phone:"+44"},{name:"Jordan",iso2:"JO",iso3:"JOR",phone:"+962"},{name:"Kazakhstan",iso2:"KZ",iso3:"KAZ",phone:"+7"},{name:"Kenya",iso2:"KE",iso3:"KEN",phone:"+254"},{name:"Kiribati",iso2:"KI",iso3:"KIR",phone:"+686"},{name:"Kosovo",iso2:"XK",iso3:"RKS",phone:"+383"},{name:"Kuwait",iso2:"KW",iso3:"KWT",phone:"+965"},{name:"Kyrgyzstan",iso2:"KG",iso3:"KGZ",phone:"+996"},{name:"Laos",iso2:"LA",iso3:"LAO",phone:"+856"},{name:"Latvia",iso2:"LV",iso3:"LVA",phone:"+371"},{name:"Lebanon",iso2:"LB",iso3:"LBN",phone:"+961"},{name:"Lesotho",iso2:"LS",iso3:"LSO",phone:"+266"},{name:"Liberia",iso2:"LR",iso3:"LBR",phone:"+231"},{name:"Libya",iso2:"LY",iso3:"LBY",phone:"+218"},{name:"Liechtenstein",iso2:"LI",iso3:"LIE",phone:"+423"},{name:"Lithuania",iso2:"LT",iso3:"LTU",phone:"+370"},{name:"Luxembourg",iso2:"LU",iso3:"LUX",phone:"+352"},{name:"Macau",iso2:"MO",iso3:"MAC",phone:"+853"},{name:"Macedonia",iso2:"MK",iso3:"MKD",phone:"+389"},{name:"Madagascar",iso2:"MG",iso3:"MDG",phone:"+261"},{name:"Malawi",iso2:"MW",iso3:"MWI",phone:"+265"},{name:"Malaysia",iso2:"MY",iso3:"MYS",phone:"+60"},{name:"Maldives",iso2:"MV",iso3:"MDV",phone:"+960"},{name:"Mali",iso2:"ML",iso3:"MLI",phone:"+223"},{name:"Malta",iso2:"MT",iso3:"MLT",phone:"+356"},{name:"Marshall Islands",iso2:"MH",iso3:"MHL",phone:"+692"},{name:"Martinique",iso2:"MQ",iso3:"MTQ",phone:"+596"},{name:"Mauritania",iso2:"MR",iso3:"MRT",phone:"+222"},{name:"Mauritius",iso2:"MU",iso3:"MUS",phone:"+230"},{name:"Mayotte",iso2:"YT",iso3:"MYT",phone:"+262"},{name:"Mexico",iso2:"MX",iso3:"MEX",phone:"+52"},{name:"Micronesia",iso2:"FM",iso3:"FSM",phone:"+691"},{name:"Moldova",iso2:"MD",iso3:"MDA",phone:"+373"},{name:"Monaco",iso2:"MC",iso3:"MCO",phone:"+377"},{name:"Mongolia",iso2:"MN",iso3:"MNG",phone:"+976"},{name:"Montenegro",iso2:"ME",iso3:"MNE",phone:"+382"},{name:"Montserrat",iso2:"MS",iso3:"MSR",phone:"+1664"},{name:"Morocco",iso2:"MA",iso3:"MAR",phone:"+212"},{name:"Mozambique",iso2:"MZ",iso3:"MOZ",phone:"+258"},{name:"Myanmar",iso2:"MM",iso3:"MMR",phone:"+95"},{name:"Namibia",iso2:"NA",iso3:"NAM",phone:"+264"},{name:"Nauru",iso2:"NR",iso3:"NRU",phone:"+674"},{name:"Nepal",iso2:"NP",iso3:"NPL",phone:"+977"},{name:"Netherlands",iso2:"NL",iso3:"NLD",phone:"+31"},{name:"Netherlands Antilles",iso2:"AN",iso3:"ANT",phone:"+599"},{name:"New Caledonia",iso2:"NC",iso3:"NCL",phone:"+687"},{name:"New Zealand",iso2:"NZ",iso3:"NZL",phone:"+64"},{name:"Nicaragua",iso2:"NI",iso3:"NIC",phone:"+505"},{name:"Niger",iso2:"NE",iso3:"NER",phone:"+227"},{name:"Nigeria",iso2:"NG",iso3:"NGA",phone:"+234"},{name:"Niue",iso2:"NU",iso3:"NIU",phone:"+683"},{name:"Norfolk Island",iso2:"NF",iso3:"NFK",phone:"+672"},{name:"North Korea",iso2:"KP",iso3:"PRK",phone:"+850"},{name:"Northern Mariana Islands",iso2:"MP",iso3:"MNP",phone:"+1670"},{name:"Norway",iso2:"NO",iso3:"NOR",phone:"+47"},{name:"Oman",iso2:"OM",iso3:"OMN",phone:"+968"},{name:"Pakistan",iso2:"PK",iso3:"PAK",phone:"+92"},{name:"Palau",iso2:"PW",iso3:"PLW",phone:"+680"},{name:"Palestine",iso2:"PS",iso3:"PSE",phone:"+970"},{name:"Panama",iso2:"PA",iso3:"PAN",phone:"+507"},{name:"Papua New Guinea",iso2:"PG",iso3:"PNG",phone:"+675"},{name:"Paraguay",iso2:"PY",iso3:"PRY",phone:"+595"},{name:"Peru",iso2:"PE",iso3:"PER",phone:"+51"},{name:"Philippines",iso2:"PH",iso3:"PHL",phone:"+63"},{name:"Pitcairn",iso2:"PN",iso3:"PCN",phone:"+64"},{name:"Poland",iso2:"PL",iso3:"POL",phone:"+48"},{name:"Portugal",iso2:"PT",iso3:"PRT",phone:"+351"},{name:"Puerto Rico",iso2:"PR",iso3:"PRI",phone:"+1"},{name:"Qatar",iso2:"QA",iso3:"QAT",phone:"+974"},{name:"Reunion Island",iso2:"RE",iso3:"REU",phone:"+262"},{name:"Romania",iso2:"RO",iso3:"ROU",phone:"+40"},{name:"Russia",iso2:"RU",iso3:"RUS",phone:"+7"},{name:"Rwanda",iso2:"RW",iso3:"RWA",phone:"+250"},{name:"Saint Barth\xE9lemy",iso2:"BL",iso3:"BLM",phone:"+590"},{name:"Saint Helena",iso2:"SH",iso3:"SHN",phone:"+290"},{name:"Saint Kitts and Nevis",iso2:"KN",iso3:"KNA",phone:"+1869"},{name:"Saint Lucia",iso2:"LC",iso3:"LCA",phone:"+1758"},{name:"Saint Martin (French part)",iso2:"MF",iso3:"MAF",phone:"+590"},{name:"Saint Pierre and Miquelon",iso2:"PM",iso3:"SPM",phone:"+508"},{name:"Saint Vincent and the Grenadines",iso2:"VC",iso3:"VCT",phone:"+1784"},{name:"San Marino",iso2:"SM",iso3:"SMR",phone:"+378"},{name:"Sao Tome and Principe",iso2:"ST",iso3:"STP",phone:"+239"},{name:"Saudi Arabia",iso2:"SA",iso3:"SAU",phone:"+966"},{name:"Senegal",iso2:"SN",iso3:"SEN",phone:"+221"},{name:"Serbia",iso2:"RS",iso3:"SRB",phone:"+381"},{name:"Seychelles",iso2:"SC",iso3:"SYC",phone:"+248"},{name:"Sierra Leone",iso2:"SL",iso3:"SLE",phone:"+232"},{name:"Singapore",iso2:"SG",iso3:"SGP",phone:"+65"},{name:"Sint Maarten",iso2:"SX",iso3:"SXM",phone:"+1721"},{name:"Slovakia",iso2:"SK",iso3:"SVK",phone:"+421"},{name:"Slovenia",iso2:"SI",iso3:"SVN",phone:"+386"},{name:"Solomon Islands",iso2:"SB",iso3:"SLB",phone:"+677"},{name:"Somalia",iso2:"SO",iso3:"SOM",phone:"+252"},{name:"South Africa",iso2:"ZA",iso3:"ZAF",phone:"+27"},{name:"South Georgia and the South Sandwich Islands",iso2:"GS",iso3:"SGS",phone:"+500"},{name:"South Korea",iso2:"KR",iso3:"KOR",phone:"+82"},{name:"South Sudan",iso2:"SS",iso3:"SSD",phone:"+211"},{name:"Spain",iso2:"ES",iso3:"ESP",phone:"+34"},{name:"Sri Lanka",iso2:"LK",iso3:"LKA",phone:"+94"},{name:"Sudan",iso2:"SD",iso3:"SDN",phone:"+249"},{name:"Suriname",iso2:"SR",iso3:"SUR",phone:"+597"},{name:"Svalbard and Jan Mayen",iso2:"SJ",iso3:"SJM",phone:"+47"},{name:"Swaziland",iso2:"SZ",iso3:"SWZ",phone:"+268"},{name:"Sweden",iso2:"SE",iso3:"SWE",phone:"+46"},{name:"Switzerland",iso2:"CH",iso3:"CHE",phone:"+41"},{name:"Syria",iso2:"SY",iso3:"SYR",phone:"+963"},{name:"Taiwan",iso2:"TW",iso3:"TWN",phone:"+886"},{name:"Tajikistan",iso2:"TJ",iso3:"TJK",phone:"+992"},{name:"Tanzania",iso2:"TZ",iso3:"TZA",phone:"+255"},{name:"Thailand",iso2:"TH",iso3:"THA",phone:"+66"},{name:"Togo",iso2:"TG",iso3:"TGO",phone:"+228"},{name:"Tokelau",iso2:"TK",iso3:"TKL",phone:"+690"},{name:"Tonga",iso2:"TO",iso3:"TON",phone:"+676"},{name:"Trinidad and Tobago",iso2:"TT",iso3:"TTO",phone:"+1868"},{name:"Tunisia",iso2:"TN",iso3:"TUN",phone:"+216"},{name:"Turkey",iso2:"TR",iso3:"TUR",phone:"+90"},{name:"Turkmenistan",iso2:"TM",iso3:"TKM",phone:"+993"},{name:"Turks and Caicos",iso2:"TC",iso3:"TCA",phone:"+1649"},{name:"Tuvalu",iso2:"TV",iso3:"TUV",phone:"+688"},{name:"Uganda",iso2:"UG",iso3:"UGA",phone:"+256"},{name:"Ukraine",iso2:"UA",iso3:"UKR",phone:"+380"},{name:"United Arab Emirates",iso2:"AE",iso3:"ARE",phone:"+971"},{name:"United Kingdom",iso2:"GB",iso3:"GBR",phone:"+44",phoneFormat:"**** *** ***"},{name:"United States Minor Outlying Islands",iso2:"UM",iso3:"UMI",phone:"+1"},{name:"United States of America",iso2:"US",iso3:"USA",phone:"+1"},{name:"Uruguay",iso2:"UY",iso3:"URY",phone:"+598"},{name:"Uzbekistan",iso2:"UZ",iso3:"UZB",phone:"+998"},{name:"Vanuatu",iso2:"VU",iso3:"VUT",phone:"+678"},{name:"Venezuela",iso2:"VE",iso3:"VEN",phone:"+58"},{name:"Vietnam",iso2:"VN",iso3:"VNM",phone:"+84"},{name:"Virgin Islands (U.S.)",iso2:"VI",iso3:"VIR",phone:"+1340"},{name:"Wallis and Futuna",iso2:"WF",iso3:"WLF",phone:"+681"},{name:"Western Sahara",iso2:"EH",iso3:"ESH",phone:"+212"},{name:"Western Samoa",iso2:"WS",iso3:"WSM",phone:"+685"},{name:"Yemen",iso2:"YE",iso3:"YEM",phone:"+967"},{name:"Zambia",iso2:"ZM",iso3:"ZMB",phone:"+260"},{name:"Zimbabwe",iso2:"ZW",iso3:"ZWE",phone:"+263"}];export default countries;
@@ -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{Component,createRef}from"react";import CSSTransition from"react-transition-group/CSSTransition";import ActionButton from"../actionButton";import Body from"../body";import{Theme}from"../common";import{DirectionContext}from"../provider/direction";import withNextPortal from"../withNextPortal/withNextPortal";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var CSS_TRANSITION_DURATION=400;export var Snackbar=/*#__PURE__*/function(a){/** @type {RefObject<HTMLSpanElement>} */function b(){var a;return _classCallCheck(this,b),a=c.call(this),_defineProperty(_assertThisInitialized(a),"bodyRef",/*#__PURE__*/createRef()),_defineProperty(_assertThisInitialized(a),"setLeaveTimeout",function(){var b=a.props.timeout;a.timeout=setTimeout(function(){a.setState({visible:!1})},b)}),a.state={visible:!1,text:""},a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"componentWillUnmount",value:function componentWillUnmount(){clearTimeout(this.timeout),clearTimeout(this.transitionTimeout)}},{key:"shouldComponentUpdate",value:function shouldComponentUpdate(a,b){return!!a.text&&(a.timestamp!==this.props.timestamp||b.visible!==this.state.visible||b.text!==this.state.text)}},{key:"componentDidUpdate",value:function componentDidUpdate(a){var b=this,c=this.props,d=c.action,e=c.text,f=c.theme,g=c.timestamp;a.text?a.timestamp!==g&&(clearTimeout(this.timeout),this.state.visible?this.setState({visible:!1},function(){b.transitionTimeout=setTimeout(function(){b.setState({visible:!0,action:d,text:e,theme:f}),b.setLeaveTimeout()},CSS_TRANSITION_DURATION)}):(this.setState({visible:!0,action:d,text:e,theme:f}),this.setLeaveTimeout())):this.setState({visible:!0,action:d,text:e,theme:f},function(){b.setLeaveTimeout()})}},{key:"render",value:function render(){var a=this.state,b=a.action,c=a.text,d=a.theme,e=a.visible,f=this.props.timeout;return/*#__PURE__*/_jsx("div",{className:"snackbar",children:/*#__PURE__*/_jsx(CSSTransition,{nodeRef:this.bodyRef,in:e,classNames:"snackbar__text-container",timeout:{appear:0,enter:f,exit:CSS_TRANSITION_DURATION},unmountOnExit:!0,children:/*#__PURE__*/_jsxs(Body,{ref:this.bodyRef,as:"span",className:"snackbar__text snackbar__text--".concat(d),children:[c,b?/*#__PURE__*/_jsx(ActionButton,{className:"snackbar__text__action",onClick:b.onClick,children:b.label}):null]})})})}}]),b}(Component);Snackbar.contextType=DirectionContext,Snackbar.propTypes={action:PropTypes.shape({label:PropTypes.string.isRequired,onClick:PropTypes.func.isRequired}),text:PropTypes.node.isRequired,theme:PropTypes.oneOf(["light","dark"]),timeout:PropTypes.number.isRequired,timestamp:PropTypes.number.isRequired},Snackbar.defaultProps={action:null,theme:Theme.LIGHT};export default withNextPortal(Snackbar);
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{Component,createRef}from"react";import CSSTransition from"react-transition-group/CSSTransition";import ActionButton from"../actionButton";import Body from"../body";import{Theme}from"../common";import{DirectionContext}from"../provider/direction";import withNextPortal from"../withNextPortal/withNextPortal";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var CSS_TRANSITION_DURATION=400;export var Snackbar=/*#__PURE__*/function(a){/** @type {RefObject<HTMLSpanElement>} */function b(){var a;return _classCallCheck(this,b),a=c.call(this),_defineProperty(_assertThisInitialized(a),"bodyRef",/*#__PURE__*/createRef()),_defineProperty(_assertThisInitialized(a),"setLeaveTimeout",function(){var b=a.props.timeout;a.timeout=setTimeout(function(){a.setState({visible:!1})},b)}),a.state={visible:!1,text:""},a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"componentWillUnmount",value:function componentWillUnmount(){clearTimeout(this.timeout),clearTimeout(this.transitionTimeout)}},{key:"shouldComponentUpdate",value:function shouldComponentUpdate(a,b){return!!a.text&&(a.timestamp!==this.props.timestamp||b.visible!==this.state.visible||b.text!==this.state.text)}},{key:"componentDidUpdate",value:function componentDidUpdate(a){var b=this,c=this.props,d=c.action,e=c.text,f=c.theme,g=c.timestamp;a.text?a.timestamp!==g&&(clearTimeout(this.timeout),this.state.visible?this.setState({visible:!1},function(){b.transitionTimeout=setTimeout(function(){b.setState({visible:!0,action:d,text:e,theme:f}),b.setLeaveTimeout()},CSS_TRANSITION_DURATION)}):(this.setState({visible:!0,action:d,text:e,theme:f}),this.setLeaveTimeout())):this.setState({visible:!0,action:d,text:e,theme:f},function(){b.setLeaveTimeout()})}},{key:"render",value:function render(){var a=this.state,b=a.action,c=a.text,d=a.theme,e=a.visible,f=this.props.timeout;return/*#__PURE__*/_jsx("div",{className:"snackbar",children:/*#__PURE__*/_jsx(CSSTransition,{nodeRef:this.bodyRef,in:e,classNames:"snackbar__text-container",timeout:{appear:0,enter:f,exit:CSS_TRANSITION_DURATION},unmountOnExit:!0,children:/*#__PURE__*/_jsxs(Body,{ref:this.bodyRef,as:"span",className:"snackbar__text snackbar__text--".concat(d),children:[c,b?/*#__PURE__*/_jsx(ActionButton,{className:"snackbar__text__action",onClick:b.onClick,children:b.label}):null]})})})}}]),b}(Component);Snackbar.contextType=DirectionContext,Snackbar.propTypes={action:PropTypes.shape({label:PropTypes.string.isRequired,onClick:PropTypes.func}),text:PropTypes.node.isRequired,theme:PropTypes.oneOf(["light","dark"]),timeout:PropTypes.number.isRequired,timestamp:PropTypes.number.isRequired},Snackbar.defaultProps={action:null,theme:Theme.LIGHT};export default withNextPortal(Snackbar);
@@ -1 +1 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body/Body";import{Position}from"../common";import{useDirection}from"../common/hooks";import Tooltip from"../tooltip";import{isTouchDevice}from"./deviceDetection";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function clamp(a,b,c){return Math.max(Math.min(b,c),a)}/* eslint-disable react/no-array-index-key */var Stepper=function(a){var b=a.steps,c=a.activeStep,d=a.className,e=useDirection(),f=e.isRTL;if(0===b.length)return null;var g=clamp(0,b.length-1,c),h=1/(b.length-1),i=g/(b.length-1),j=Math.max(i-h,0),k=Math.min(g,1)*h;return/*#__PURE__*/_jsxs("div",{className:classNames("tw-stepper",d),children:[/*#__PURE__*/_jsxs("div",{className:"progress",children:[/*#__PURE__*/_jsx("div",{className:"progress-bar-filler",style:{width:"".concat(100*j,"%")}}),/*#__PURE__*/_jsx("div",{className:"progress-bar-ending",style:{width:"".concat(100*k,"%")}})]}),/*#__PURE__*/_jsx("ul",{className:"tw-stepper-steps p-t-1 m-b-0",children:b.map(function renderStep(a,b){var c=b===g,d=a.onClick&&!c,e=d?/*#__PURE__*/_jsx("button",{type:"button",className:"btn-unstyled tw-stepper__step-label",onClick:function onClick(){return d&&a.onClick()},children:/*#__PURE__*/_jsx("small",{children:a.label})}):/*#__PURE__*/_jsx(Body,{as:"span",className:"tw-stepper__step-label small",children:a.label});return/*#__PURE__*/_jsx("li",{className:classNames("hidden-xs","tw-stepper__step",c&&"tw-stepper__step--active",d&&"tw-stepper__step--clickable",a.hoverLabel&&"tw-stepper__step--has-tooltip"),style:f?{right:"".concat(100*(b*h),"%")}:{left:"".concat(100*(b*h),"%")},children:a.hoverLabel&&!isTouchDevice()?/*#__PURE__*/_jsx(Tooltip,{position:Position.BOTTOM,label:a.hoverLabel,children:e}):e},b)})})]})};/* eslint-enable react/no-array-index-key */Stepper.propTypes={steps:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.node.isRequired,onClick:PropTypes.func,hoverLabel:PropTypes.node})).isRequired,activeStep:PropTypes.number,className:PropTypes.string},Stepper.defaultProps={activeStep:0,className:void 0};export default Stepper;
1
+ import classNames from"classnames";import*as React from"react";import Body from"../body/Body";import{Position}from"../common";import{useDirection}from"../common/hooks";import Tooltip from"../tooltip";import{isTouchDevice}from"./deviceDetection";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function clamp(a,b,c){return Math.max(Math.min(b,c),a)}/* eslint-disable react/no-array-index-key */var Stepper=function(a){var b=a.steps,c=a.activeStep,d=void 0===c?0:c,e=a.className,f=useDirection(),g=f.isRTL;if(0===b.length)return null;var h=clamp(0,b.length-1,d),i=1/(b.length-1),j=h/(b.length-1);return/*#__PURE__*/_jsxs("div",{className:classNames("tw-stepper",e),children:[/*#__PURE__*/_jsx("div",{className:"progress",children:/*#__PURE__*/_jsx("div",{className:"progress-bar",style:{width:"".concat(100*j,"%")}})}),/*#__PURE__*/_jsx("ul",{className:"tw-stepper-steps p-t-1 m-b-0",children:b.map(function renderStep(a,b){var c=b===h,d=a.onClick&&!c,e=d?/*#__PURE__*/_jsx("button",{type:"button",className:"btn-unstyled tw-stepper__step-label",onClick:function onClick(){var b;return d&&(null===(b=a.onClick)||void 0===b?void 0:b.call(a))},children:/*#__PURE__*/_jsx("small",{children:a.label})}):/*#__PURE__*/_jsx(Body,{as:"span",className:"tw-stepper__step-label small",children:a.label});return/*#__PURE__*/_jsx("li",{className:classNames("hidden-xs","tw-stepper__step",c&&"tw-stepper__step--active",d&&"tw-stepper__step--clickable",a.hoverLabel&&"tw-stepper__step--has-tooltip"),style:g?{right:"".concat(100*(b*i),"%")}:{left:"".concat(100*(b*i),"%")},children:a.hoverLabel&&!isTouchDevice()?/*#__PURE__*/_jsx(Tooltip,{position:Position.BOTTOM,label:a.hoverLabel,children:e}):e},b)})})]})};/* eslint-enable react/no-array-index-key */export default Stepper;
@@ -1 +1 @@
1
- import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body";import{Size,Key,Typography}from"../common";import Title from"../title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var Tile=function(a){var b=a.className,c=a.description,d=a.disabled,e=a.href,f=a.target,g=a.media,h=a.onClick,i=a.size,j=a.title,k=i===Size.SMALL,l=useTheme(),m=l.isModern,n=e?"a":"button";return/*#__PURE__*/_jsxs(n,{className:classNames("decision","flex-column","np-tile","text-no-decoration","text-xs-center",b,{"p-a-3":!k&&m,"p-y-5 p-x-4":!k&&!m,"p-a-2":k,"np-tile--small":k,disabled:d}),href:e,target:f,"aria-label":j,onClick:d?null:h,onKeyDown:d?null:function(a){var b=a.key;(b===Key.ENTER||Key.SPACE.includes(b))&&h()},children:[/*#__PURE__*/_jsx("div",{className:"np-tile__media d-flex justify-content-center",children:g}),/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,className:classNames(k?"m-t-1":"m-t-2"),children:j}),m&&c&&/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_DEFAULT,className:"m-t-1",children:c}),!m&&c&&/*#__PURE__*/_jsx("div",{className:"np-tile__description",children:c})]})};Tile.propTypes={/** Classes to apply to the Tile container */className:PropTypes.string,description:PropTypes.node,disabled:PropTypes.bool,href:PropTypes.string.isRequired,target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),/** Accepts only Avatar and images */media:PropTypes.node.isRequired,/** Function called onClick or onKeyDown */onClick:PropTypes.func.isRequired,/** The size applied to Tile */size:PropTypes.oneOf(["sm","md"]),title:PropTypes.node.isRequired},Tile.defaultProps={className:"",description:null,disabled:!1,size:Size.MEDIUM,target:void 0};export default Tile;
1
+ import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body";import{Size,Key,Typography}from"../common";import Title from"../title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var Tile=function(a){var b=a.className,c=a.description,d=a.disabled,e=a.href,f=a.target,g=a.media,h=a.onClick,i=a.size,j=a.title,k=i===Size.SMALL,l=useTheme(),m=l.isModern,n=e?"a":"button";return/*#__PURE__*/_jsxs(n,{className:classNames("decision","flex-column","np-tile","text-no-decoration","text-xs-center",b,{"p-a-3":!k&&m,"p-y-5 p-x-4":!k&&!m,"p-a-2":k,"np-tile--small":k,disabled:d}),href:e,target:f,"aria-label":j,onClick:d?null:h,onKeyDown:d?null:function(a){var b=a.key;(b===Key.ENTER||Key.SPACE.includes(b))&&h()},children:[/*#__PURE__*/_jsx("div",{className:"np-tile__media d-flex justify-content-center",children:g}),/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_SUBSECTION,className:classNames(k?"m-t-1":"m-t-2"),children:j}),m&&c&&/*#__PURE__*/_jsx(Body,{as:"span",type:Typography.BODY_DEFAULT,className:"m-t-1",children:c}),!m&&c&&/*#__PURE__*/_jsx("div",{className:"np-tile__description",children:c})]})};Tile.propTypes={/** Classes to apply to the Tile container */className:PropTypes.string,description:PropTypes.node,disabled:PropTypes.bool,href:PropTypes.string.isRequired,target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),/** Accepts only Avatar and images */media:PropTypes.node.isRequired,/** Function called onClick or onKeyDown */onClick:PropTypes.func,/** The size applied to Tile */size:PropTypes.oneOf(["sm","md"]),title:PropTypes.node.isRequired},Tile.defaultProps={className:"",description:null,disabled:!1,size:Size.MEDIUM,target:void 0};export default Tile;
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["disabled","className","onClick","text","children"];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.to-string.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{forwardRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";var ActionButton=/*#__PURE__*/forwardRef(function(a,b){var c=a.disabled,d=a.className,e=void 0===d?void 0:d,f=a.onClick,g=a.text,h=a.children,i=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx("button",_objectSpread(_objectSpread({ref:b,type:"button",className:classNames("np-action-btn","np-text-body-default-bold",e),disabled:void 0!==c&&c,onClick:f},i),{},{children:h||g}))});export default ActionButton;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["disabled","className","onClick","priority","text","children"];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.to-string.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{forwardRef}from"react";import{Priority}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var ActionButton=/*#__PURE__*/forwardRef(function(a,b){var c=a.disabled,d=a.className,e=void 0===d?void 0:d,f=a.onClick,g=a.priority,h=void 0===g?Priority.PRIMARY:g,i=a.text,j=a.children,k=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx("button",_objectSpread(_objectSpread({ref:b,type:"button",className:classNames("np-action-btn","np-text-body-default-bold",h===Priority.SECONDARY?"btn-priority-2":"btn-priority-1",e),disabled:void 0!==c&&c,onClick:f},k),{},{children:j||i}))});export default ActionButton;
@@ -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.to-string.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"@testing-library/jest-dom";import{render,screen,userEvent}from"../test-utils";import ActionButton from".";import{jsx as _jsx}from"react/jsx-runtime";describe("ActionButton",function(){var a={children:"Personal profile",onClick:jest.fn()};describe("by default",function(){beforeEach(function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread({},a)))}),it("renders the text",function(){expect(screen.getByText("Personal profile")).toBeInTheDocument()}),it("is not disabled",function(){expect(screen.getByRole("button")).toBeEnabled()}),it("renders the button",function(){expect(render(/*#__PURE__*/_jsx(ActionButton,_objectSpread({},a))).container).toMatchSnapshot()})}),describe("button attributes",function(){it("disables the button if disabled",function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{disabled:!0}))),expect(screen.getByRole("button")).toBeDisabled()}),it("passes through custom classes if set",function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{className:"catsarethebest"}))),expect(screen.getByRole("button")).toHaveClass("catsarethebest")})}),describe("onClick",function(){it("calls onClick when clicked",function(){var b=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{onClick:b}))),userEvent.click(screen.getByRole("button")),expect(b).toHaveBeenCalledTimes(1)}),it("does not call onClick when clicked if disabled",function(){var b=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{disabled:!0,onClick:b}))),userEvent.click(screen.getByRole("button")),expect(b).toHaveBeenCalledTimes(0)})}),describe("deprecated",function(){it("text prop",function(){var a=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,{disabled:!0,text:"Text prop",onClick:a})),expect(screen.getByText("Text prop")).toBeInTheDocument()})})});
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.to-string.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"@testing-library/jest-dom";import{render,screen,userEvent}from"../test-utils";import ActionButton from".";import{jsx as _jsx}from"react/jsx-runtime";describe("ActionButton",function(){var a={children:"Personal profile",onClick:jest.fn()};describe("by default",function(){beforeEach(function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread({},a)))}),it("renders the text",function(){expect(screen.getByText("Personal profile")).toBeInTheDocument()}),it("is not disabled",function(){expect(screen.getByRole("button")).toBeEnabled()}),it("renders the button",function(){expect(render(/*#__PURE__*/_jsx(ActionButton,_objectSpread({},a))).container).toMatchSnapshot()})}),describe("button attributes",function(){it("disables the button if disabled",function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{disabled:!0}))),expect(screen.getByRole("button")).toBeDisabled()}),it("passes through custom classes if set",function(){render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{className:"catsarethebest"}))),expect(screen.getByRole("button")).toHaveClass("catsarethebest")})}),describe("onClick",function(){it("calls onClick when clicked",function(){var b=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{onClick:b}))),userEvent.click(screen.getByRole("button")),expect(b).toHaveBeenCalledTimes(1)}),it("does not call onClick when clicked if disabled",function(){var b=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{disabled:!0,onClick:b}))),userEvent.click(screen.getByRole("button")),expect(b).toHaveBeenCalledTimes(0)})}),describe("deprecated",function(){it("text prop",function(){var a=jest.fn();render(/*#__PURE__*/_jsx(ActionButton,{disabled:!0,text:"Text prop",onClick:a})),expect(screen.getByText("Text prop")).toBeInTheDocument()})}),describe("priority",function(){it("is rendered for primary",function(){render(/*#__PURE__*/_jsx(ActionButton,{priority:"primary"})),expect(screen.getByRole("button")).toHaveClass("btn-priority-1")}),it("is rendered for secondary",function(){render(/*#__PURE__*/_jsx(ActionButton,{priority:"secondary"})),expect(screen.getByRole("button")).toHaveClass("btn-priority-2")}),it("is backwards compatible if nothing is passed in",function(){render(/*#__PURE__*/_jsx(ActionButton,{})),expect(screen.getByRole("button")).toHaveClass("btn-priority-1")})})});
@@ -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.to-string.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{Settings}from"@transferwise/icons";import{storyConfig}from"../test-utils/story-config";import ActionButton from"./ActionButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:ActionButton,title:"Actions/ActionButton",tags:["autodocs"]};export var Basic={render:function render(a){return/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},a),{},{children:"Button label"}))})}};export var WithIcon={render:function render(a){return/*#__PURE__*/_jsx("div",{children:/*#__PURE__*/_jsxs(ActionButton,_objectSpread(_objectSpread({},a),{},{children:[/*#__PURE__*/_jsx(Settings,{className:"m-r-1"}),"Button label"]}))})}};export var Disabled=storyConfig({render:WithIcon.render,args:{disabled:!0}},{variants:["default","dark","rtl","mobile"]});
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.to-string.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{Settings}from"@transferwise/icons";import{storyConfig}from"../test-utils/story-config";import ActionButton from"./ActionButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:ActionButton,title:"Actions/ActionButton",tags:["autodocs"]};export var Basic=storyConfig({render:function render(a){return/*#__PURE__*/_jsxs("div",{style:{display:"flex",gap:"0.4rem",flexWrap:"wrap"},children:[/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({priority:"primary"},a),{},{children:"Primary label"})),/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({priority:"secondary"},a),{},{children:"Secondary label"})),/*#__PURE__*/_jsxs(ActionButton,_objectSpread(_objectSpread({priority:"primary"},a),{},{style:{display:"flex",gap:"0.4rem"},children:[/*#__PURE__*/_jsx(Settings,{}),"Primary label"]})),/*#__PURE__*/_jsxs(ActionButton,_objectSpread(_objectSpread({priority:"secondary"},a),{},{style:{display:"flex",gap:"0.4rem"},children:[/*#__PURE__*/_jsx(Settings,{}),"Secondary label"]}))]})}},{variants:["default","dark","rtl","mobile"]});export var Disabled=storyConfig({render:Basic.render,args:{disabled:!0}},{variants:["default","dark","rtl","mobile"]});
@@ -1 +1 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","children","disabled","icon","priority","type"];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.to-string.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 PropTypes from"prop-types";import{cloneElement}from"react";import Body from"../body/Body";import{typeClassMap,priorityClassMap}from"../button/classMap";import{ControlType,Priority}from"../common";import{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CircularButton=function(a){var b=a.className,c=a.children,d=a.disabled,e=a.icon,f=a.priority,g=a.type,h=_objectWithoutProperties(a,_excluded),i=classNames("btn np-btn",typeClassMap[g],priorityClassMap[f]),j=24===e.props.size?e:/*#__PURE__*/cloneElement(e,{size:24});return/*#__PURE__*/_jsxs("label",{className:classNames("np-circular-btn",f,g,d?"disabled":"",b),children:[/*#__PURE__*/_jsx("input",_objectSpread({type:"button","aria-label":c,className:i,disabled:d},h)),j,/*#__PURE__*/_jsx(Body,{as:"span",className:"np-circular-btn__label",type:Typography.BODY_DEFAULT_BOLD,children:c})]})};CircularButton.propTypes={className:PropTypes.string,children:PropTypes.string.isRequired,disabled:PropTypes.bool,icon:PropTypes.element.isRequired,onClick:PropTypes.func.isRequired,priority:PropTypes.oneOf(["primary","secondary"]),type:PropTypes.oneOf(["accent","positive","negative"])},CircularButton.defaultProps={className:void 0,disabled:!1,priority:Priority.PRIMARY,type:ControlType.ACCENT};export default CircularButton;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","children","disabled","icon","priority","type"];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.to-string.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 PropTypes from"prop-types";import{cloneElement}from"react";import Body from"../body/Body";import{typeClassMap,priorityClassMap}from"../button/classMap";import{ControlType,Priority}from"../common";import{Typography}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CircularButton=function(a){var b=a.className,c=a.children,d=a.disabled,e=a.icon,f=a.priority,g=a.type,h=_objectWithoutProperties(a,_excluded),i=classNames("btn np-btn",typeClassMap[g],priorityClassMap[f]),j=24===e.props.size?e:/*#__PURE__*/cloneElement(e,{size:24});return/*#__PURE__*/_jsxs("label",{className:classNames("np-circular-btn",f,g,d?"disabled":"",b),children:[/*#__PURE__*/_jsx("input",_objectSpread({type:"button","aria-label":c,className:i,disabled:d},h)),j,/*#__PURE__*/_jsx(Body,{as:"span",className:"np-circular-btn__label",type:Typography.BODY_DEFAULT_BOLD,children:c})]})};CircularButton.propTypes={className:PropTypes.string,children:PropTypes.string.isRequired,disabled:PropTypes.bool,icon:PropTypes.element.isRequired,onClick:PropTypes.func,priority:PropTypes.oneOf(["primary","secondary"]),type:PropTypes.oneOf(["accent","positive","negative"])},CircularButton.defaultProps={className:void 0,disabled:!1,priority:Priority.PRIMARY,type:ControlType.ACCENT};export default CircularButton;
@@ -1 +1 @@
1
- import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import{Layout}from"../propsValues/layouts";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var FlowHeader=/*#__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-flow-header","d-flex","flex-wrap","align-items-center",d),children:[/*#__PURE__*/_jsx("div",{className:classNames("np-flow-header__left",{"flex__item--8":h}),children:f}),/*#__PURE__*/_jsx("div",{className:classNames("align-items-center","d-flex","np-flow-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})]})});FlowHeader.defaultProps={bottomContent:void 0,className:void 0,layout:Layout.HORIZONTAL,leftContent:void 0,rightContent:void 0},FlowHeader.propTypes={bottomContent:PropTypes.node,className:PropTypes.string,layout:PropTypes.oneOf(["HORIZONTAL","VERTICAL"]),leftContent:PropTypes.node,rightContent:PropTypes.node};export default FlowHeader;
1
+ import classNames from"classnames";import*as React from"react";import{Layout}from"../propsValues/layouts";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var FlowHeader=/*#__PURE__*/React.forwardRef(function(a,b){var c=a.bottomContent,d=a.className,e=a.layout,f=void 0===e?Layout.HORIZONTAL:e,g=a.leftContent,h=a.rightContent,i=f===Layout.VERTICAL;return/*#__PURE__*/_jsxs("div",{ref:b,className:classNames("np-flow-header","d-flex","flex-wrap","align-items-center",d),children:[/*#__PURE__*/_jsx("div",{className:classNames("np-flow-header__left",{"flex__item--8":i}),children:g}),/*#__PURE__*/_jsx("div",{className:classNames("align-items-center","d-flex","np-flow-header__right","justify-content-end",{"flex__item--4 ":i,"order-2":!i}),children:h}),/*#__PURE__*/_jsx("div",{className:classNames("align-items-center","d-flex","justify-content-center",{"flex__item--12":i,"order-1 flex-grow-1":!i}),children:c})]})});export default FlowHeader;
@@ -1 +1 @@
1
- export{default as useClientWidth}from"./useClientWidth";export{default as useConditionalListener}from"./useConditionalListener";export{default as useDirection}from"./useDirection";export{default as useHasIntersected}from"./useHasIntersected";export{default as useLayout}from"./useLayout";
1
+ export{useClientWidth}from"./useClientWidth/useClientWidth";export{default as useConditionalListener}from"./useConditionalListener";export{default as useDirection}from"./useDirection";export{default as useHasIntersected}from"./useHasIntersected";export{default as useLayout}from"./useLayout";
@@ -1,5 +1,5 @@
1
1
  import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import throttle from"lodash.throttle";import{useLayoutEffect,useState,useEffect}from"react";var THROTTLE_MS=100,useIsomorphicLayoutEffect="undefined"==typeof window?useEffect:useLayoutEffect;export var useClientWidth=function(a){var b=a.ref,c=a.throttleMs,d=void 0===c?THROTTLE_MS:c,e=useState(null),f=_slicedToArray(e,2),g=f[0],h=f[1];return useIsomorphicLayoutEffect(function(){// eslint-disable-next-line unicorn/consistent-function-scoping
2
- var a=function(){b&&(b.innerWidth?h(b.innerWidth):b.current&&h(b.current.clientWidth))},c=throttle(a,d);// This assignment saves a reference to the function so it will be the same passed to both addEventListener removeEventListener.
2
+ var a=function(){b&&("innerWidth"in b?h(b.innerWidth):b.current&&h(b.current.clientWidth))},c=throttle(a,d);// This assignment saves a reference to the function so it will be the same passed to both addEventListener removeEventListener.
3
3
  // If throttle gets passed directly to both add and removeEventListenet the results will be that the event
4
4
  // won't get removed even if the component is unmounted.
5
5
  return window.addEventListener("resize",c,!0),window.requestAnimationFrame(a),function(){return window.removeEventListener("resize",c,!0)}},[]),[g]};useClientWidth.THROTTLE_MS=100;
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import{useEffect,useState}from"react";import{Breakpoint}from"../../propsValues/breakpoint";import useClientWidth from"../useClientWidth";export var useLayout=function(){var a="undefined"==typeof window?void 0:window,b=useState(),c=_slicedToArray(b,2),d=c[0],e=c[1],f=useClientWidth({ref:a}),g=_slicedToArray(f,1),h=g[0];return useEffect(function(){return h?h<=Breakpoint.EXTRA_SMALL?void e(Breakpoint.EXTRA_SMALL):Breakpoint.EXTRA_SMALL<h&&h<=Breakpoint.SMALL?void e(Breakpoint.SMALL):Breakpoint.SMALL<h&&h<=Breakpoint.MEDIUM?void e(Breakpoint.MEDIUM):Breakpoint.MEDIUM<h&&h<=Breakpoint.LARGE?void e(Breakpoint.LARGE):void(Breakpoint.LARGE<h&&e(Breakpoint.EXTRA_LARGE)):void 0},[h]),{isMobile:!!d&&[Breakpoint.EXTRA_SMALL,Breakpoint.SMALL].includes(d),isExtraSmall:d===Breakpoint.EXTRA_SMALL,isSmall:d===Breakpoint.SMALL,isMedium:d===Breakpoint.MEDIUM,isLarge:d===Breakpoint.LARGE,isExtraLarge:d===Breakpoint.EXTRA_LARGE}};
1
+ import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import{useEffect,useState}from"react";import{Breakpoint}from"../../propsValues/breakpoint";import{useClientWidth}from"../useClientWidth/useClientWidth";export var useLayout=function(){var a="undefined"==typeof window?void 0:window,b=useState(),c=_slicedToArray(b,2),d=c[0],e=c[1],f=useClientWidth({ref:a}),g=_slicedToArray(f,1),h=g[0];return useEffect(function(){return h?h<=Breakpoint.EXTRA_SMALL?void e(Breakpoint.EXTRA_SMALL):Breakpoint.EXTRA_SMALL<h&&h<=Breakpoint.SMALL?void e(Breakpoint.SMALL):Breakpoint.SMALL<h&&h<=Breakpoint.MEDIUM?void e(Breakpoint.MEDIUM):Breakpoint.MEDIUM<h&&h<=Breakpoint.LARGE?void e(Breakpoint.LARGE):void(Breakpoint.LARGE<h&&e(Breakpoint.EXTRA_LARGE)):void 0},[h]),{isMobile:!!d&&[Breakpoint.EXTRA_SMALL,Breakpoint.SMALL].includes(d),isExtraSmall:d===Breakpoint.EXTRA_SMALL,isSmall:d===Breakpoint.SMALL,isMedium:d===Breakpoint.MEDIUM,isLarge:d===Breakpoint.LARGE,isExtraLarge:d===Breakpoint.EXTRA_LARGE}};
@@ -1 +1 @@
1
- import{formatDate}from"@transferwise/formatting";import{isKey}from"@transferwise/neptune-validation";import{useTheme}from"@wise/components-theming";import PropTypes from"prop-types";import{useIntl}from"react-intl";import Chevron from"../../chevron";import{Size,Position}from"../../common";import{CloseButton}from"../../common/closeButton/CloseButton";import messages from"./DateTrigger.messages";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var DateTrigger=function(a){var b=a.selectedDate,c=a.size,d=a.placeholder,e=a.label,f=a.monthFormat,g=a.disabled,h=a.onClick,i=a.onClear,j=useTheme(),k=j.isModern,l=useIntl(),m=l.locale,n=l.formatMessage;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("button",{className:"btn btn-".concat(c," btn-input np-date-trigger"),disabled:g,type:"button",onClick:h,children:[e&&/*#__PURE__*/_jsx("span",{className:"control-label small m-r-1",children:e}),b?/*#__PURE__*/_jsx("span",{className:"font-weight-normal",children:formatDate(b,m,{day:"numeric",month:f,year:"numeric"})}):/*#__PURE__*/_jsx("span",{className:"form-control-placeholder visible-xs-inline visible-sm-inline visible-md-inline visible-lg-inline visible-xl-inline",children:d}),i?null:/*#__PURE__*/_jsx(Chevron,{orientation:Position.BOTTOM,disabled:g})]}),i?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("div",{className:"clearfix"}),/*#__PURE__*/_jsx("span",{className:"input-group-addon",children:/*#__PURE__*/_jsx(CloseButton,{className:"clear-btn clear-btn--".concat(c),"aria-label":n(messages.ariaLabel),size:Size.SMALL,onClick:function(a){a.stopPropagation(),a.preventDefault(),i()},onKeyPress:function handleKeyDown(a){(isKey({keyType:"Space",event:a})||isKey({keyType:"Enter",event:a}))&&(a.stopPropagation(),a.preventDefault(),i())}})})]}):null]})};DateTrigger.propTypes={selectedDate:PropTypes.instanceOf(Date),size:PropTypes.oneOf(["sm","md","lg"]),placeholder:PropTypes.string.isRequired,label:PropTypes.string.isRequired,monthFormat:PropTypes.oneOf(["short","long"]).isRequired,disabled:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired,onClear:PropTypes.func},DateTrigger.defaultProps={selectedDate:null,size:Size.MEDIUM,onClear:void 0};export default DateTrigger;
1
+ import{formatDate}from"@transferwise/formatting";import{isKey}from"@transferwise/neptune-validation";import PropTypes from"prop-types";import{useIntl}from"react-intl";import Chevron from"../../chevron";import{Size,Position}from"../../common";import{CloseButton}from"../../common/closeButton/CloseButton";import messages from"./DateTrigger.messages";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var DateTrigger=function(a){var b=a.selectedDate,c=a.size,d=a.placeholder,e=a.label,f=a.monthFormat,g=a.disabled,h=a.onClick,i=a.onClear,j=useIntl(),k=j.locale,l=j.formatMessage;return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("button",{className:"btn btn-".concat(c," btn-input np-date-trigger"),disabled:g,type:"button",onClick:h,children:[e&&/*#__PURE__*/_jsx("span",{className:"control-label small m-r-1",children:e}),b?/*#__PURE__*/_jsx("span",{className:"font-weight-normal",children:formatDate(b,k,{day:"numeric",month:f,year:"numeric"})}):/*#__PURE__*/_jsx("span",{className:"form-control-placeholder visible-xs-inline visible-sm-inline visible-md-inline visible-lg-inline visible-xl-inline",children:d}),i?null:/*#__PURE__*/_jsx(Chevron,{orientation:Position.BOTTOM,disabled:g})]}),i?/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("div",{className:"clearfix"}),/*#__PURE__*/_jsx("span",{className:"input-group-addon",children:/*#__PURE__*/_jsx(CloseButton,{className:"clear-btn clear-btn--".concat(c),"aria-label":l(messages.ariaLabel),size:Size.SMALL,onClick:function(a){a.stopPropagation(),a.preventDefault(),i()},onKeyPress:function handleKeyDown(a){(isKey({keyType:"Space",event:a})||isKey({keyType:"Enter",event:a}))&&(a.stopPropagation(),a.preventDefault(),i())}})})]}):null]})};DateTrigger.propTypes={selectedDate:PropTypes.instanceOf(Date),size:PropTypes.oneOf(["sm","md","lg"]),placeholder:PropTypes.string.isRequired,label:PropTypes.string.isRequired,monthFormat:PropTypes.oneOf(["short","long"]).isRequired,disabled:PropTypes.bool.isRequired,onClick:PropTypes.func,onClear:PropTypes.func},DateTrigger.defaultProps={selectedDate:null,size:Size.MEDIUM,onClear:void 0};export default DateTrigger;
@@ -1,5 +1,5 @@
1
- import"core-js/modules/es.object.to-string.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.symbol.description.js";import"core-js/modules/es.array.map.js";import classNames from"classnames";import PropTypes from"prop-types";import requiredIf from"react-required-if";import{Size,Breakpoint}from"../common";import NavigationOption from"../navigationOption";import SizeSwapper from"../sizeSwapper";import Tile from"../tile";import{Presentation,Type}from"./decisionEnums";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var Decision=function(a){var b=a.options,c=a.presentation,d=a.type,e=a.showMediaCircleInList,f=a.isContainerAligned,g=a.size;if(d===Type.NAVIGATION){var h=Presentation.LIST_BLOCK,i=Presentation.LIST_BLOCK_GRID;if(c===h||c===i){var j=g===Size.SMALL,k=c===i,l=[{items:[],layout:SizeSwapper.Layout.COLUMN},{items:[],breakpoint:j?Breakpoint.EXTRA_SMALL:Breakpoint.SMALL,wrap:k}];return b.forEach(function(a,b){var c=a.description,d=a.disabled,g=a.href,h=a.target,i=a.media,m=i.block,n=i.list,o=a.onClick,p=a.title;l[0].items.push(/*#__PURE__*/_jsx(NavigationOption// eslint-disable-next-line react/no-array-index-key
1
+ import"core-js/modules/es.object.to-string.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.symbol.description.js";import"core-js/modules/es.array.map.js";import classNames from"classnames";import PropTypes from"prop-types";import{Size,Breakpoint}from"../common";import NavigationOption from"../navigationOption";import SizeSwapper from"../sizeSwapper";import Tile from"../tile";import{Presentation,Type}from"./decisionEnums";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var Decision=function(a){var b=a.options,c=a.presentation,d=a.type,e=a.showMediaCircleInList,f=a.isContainerAligned,g=a.size;if(d===Type.NAVIGATION){var h=Presentation.LIST_BLOCK,i=Presentation.LIST_BLOCK_GRID;if(c===h||c===i){var j=g===Size.SMALL,k=c===i,l=[{items:[],layout:SizeSwapper.Layout.COLUMN},{items:[],breakpoint:j?Breakpoint.EXTRA_SMALL:Breakpoint.SMALL,wrap:k}];return b.forEach(function(a,b){var c=a.description,d=a.disabled,g=a.href,h=a.target,i=a.media,m=i.block,n=i.list,o=a.onClick,p=a.title;l[0].items.push(/*#__PURE__*/_jsx(NavigationOption// eslint-disable-next-line react/no-array-index-key
2
2
  ,{complex:!1,content:c,disabled:d,href:g,target:h,media:n,showMediaAtAllSizes:!0,showMediaCircle:e,isContainerAligned:f,title:p,onClick:o},"nav-".concat(b))),l[1].items.push(/*#__PURE__*/_jsx(Tile// eslint-disable-next-line react/no-array-index-key
3
3
  ,{className:classNames("np-decision__tile".concat(j?"--small":""),{"np-decision__tile--fixed-width":k}),description:c,disabled:d,href:g,target:h,media:m,size:j?Size.SMALL:Size.MEDIUM,title:p,onClick:o},"tile-".concat(b)))}),/*#__PURE__*/_jsx("div",{className:classNames("np-decision",{"np-decision--small":j,"np-decision--grid":k}),children:/*#__PURE__*/_jsx(SizeSwapper,{items:l})})}// LIST
4
4
  return b.map(function(a,b){var c=a.title,d=a.description,g=a.disabled,h=a.href,i=a.target,j=a.media.list,k=a.onClick;return/*#__PURE__*/_jsx(NavigationOption// eslint-disable-next-line react/no-array-index-key
5
- ,{complex:!1,content:d,disabled:g,href:h,target:i,media:j,showMediaAtAllSizes:!0,showMediaCircle:e,isContainerAligned:f,title:c,onClick:k},"nav-".concat(b))})}return/*#__PURE__*/_jsx(_Fragment,{})};Decision.propTypes={/** A list of elements to be rendered */options:PropTypes.arrayOf(PropTypes.shape({description:PropTypes.node,disabled:PropTypes.bool,href:requiredIf(PropTypes.string,function(a){return a.type===Type.NAVIGATION}),target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),media:PropTypes.shape({block:PropTypes.node.isRequired,list:PropTypes.node.isRequired}),onClick:PropTypes.func,title:PropTypes.node.isRequired})).isRequired,/** Handles the display mode of the component */presentation:PropTypes.oneOf(["LIST","LIST_BLOCK","LIST_BLOCK_GRID"]),/** Size currently affects only Tile dimension */size:PropTypes.oneOf(["sm","md"]),/** Decide which kind of element type needs to be rendered ex: Navigation Options or in the future Radio or Checkbox Options */type:PropTypes.oneOf(["NAVIGATION"]),/** Display media in a circle in list presentation */showMediaCircleInList:PropTypes.bool,/** Sets navigation options to be aligned with the parent container */isContainerAligned:PropTypes.bool},Decision.defaultProps={presentation:Presentation.LIST,size:Size.MEDIUM,type:Type.NAVIGATION,showMediaCircleInList:!0,isContainerAligned:!1};export default Decision;
5
+ ,{complex:!1,content:d,disabled:g,href:h,target:i,media:j,showMediaAtAllSizes:!0,showMediaCircle:e,isContainerAligned:f,title:c,onClick:k},"nav-".concat(b))})}return/*#__PURE__*/_jsx(_Fragment,{})};Decision.propTypes={/** A list of elements to be rendered */options:PropTypes.arrayOf(PropTypes.shape({description:PropTypes.node,disabled:PropTypes.bool,href:PropTypes.string,target:PropTypes.oneOf(["_self","_blank","_parent","_top"]),media:PropTypes.shape({block:PropTypes.node.isRequired,list:PropTypes.node.isRequired}),onClick:PropTypes.func,title:PropTypes.node.isRequired})).isRequired,/** Handles the display mode of the component */presentation:PropTypes.oneOf(["LIST","LIST_BLOCK","LIST_BLOCK_GRID"]),/** Size currently affects only Tile dimension */size:PropTypes.oneOf(["sm","md"]),/** Decide which kind of element type needs to be rendered ex: Navigation Options or in the future Radio or Checkbox Options */type:PropTypes.oneOf(["NAVIGATION"]),/** Display media in a circle in list presentation */showMediaCircleInList:PropTypes.bool,/** Sets navigation options to be aligned with the parent container */isContainerAligned:PropTypes.bool},Decision.defaultProps={presentation:Presentation.LIST,size:Size.MEDIUM,type:Type.NAVIGATION,showMediaCircleInList:!0,isContainerAligned:!1};export default Decision;
@@ -1 +1 @@
1
- import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import classNames from"classnames";import PropTypes from"prop-types";import ActionButton from"../actionButton";import{Layout}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var isLayoutHorizontal=function(a){return[Layout.HORIZONTAL_LEFT_ALIGNED,Layout.HORIZONTAL_RIGHT_ALIGNED,Layout.HORIZONTAL_JUSTIFIED].includes(a)},getAlignmentClasses=function(a,b){var c=["d-flex"];return b&&(isLayoutHorizontal(a)?c.push("align-items-center"):c.push("align-items-start")),a===Layout.HORIZONTAL_RIGHT_ALIGNED?c.push("text-sm-right tw-definition-list--right-aligned-desktop"):c.push("justify-content-between"),a===Layout.HORIZONTAL_JUSTIFIED&&c.push("text-sm-justify"),c},DefinitionList=function(a){var b=a.definitions,c=a.layout,d=a.muted;return/*#__PURE__*/_jsx("dl",{className:classNames("tw-definition-list d-flex ",{"text-muted":d,"flex-column":c===Layout.VERTICAL_ONE_COLUMN,"tw-definition-list--columns flex-column flex-row--sm":c===Layout.VERTICAL_TWO_COLUMN,"tw-definition-list--horizontal flex-column":isLayoutHorizontal(c)}),children:b.filter(function(a){return a}).map(function(a){var b=a.action,d=a.title,e=a.value,f=a.key;return/*#__PURE__*/_jsxs("div",{className:"tw-definition-list__item",children:[/*#__PURE__*/_jsx("dt",{children:d}),/*#__PURE__*/_jsxs("dd",{className:classNames.apply(void 0,_toConsumableArray(getAlignmentClasses(c,b))),children:[/*#__PURE__*/_jsx("div",{children:e}),b?/*#__PURE__*/_jsx("div",{className:classNames(isLayoutHorizontal(c)?"p-l-2":"p-x-2","tw-definition-list__action"),children:/*#__PURE__*/_jsx(ActionButton,{className:"tw-definition-list__button",onClick:b.onClick,children:b.label})}):null]})]},f)})})};DefinitionList.propTypes={definitions:PropTypes.arrayOf(PropTypes.shape({action:PropTypes.shape({label:PropTypes.string.isRequired,onClick:PropTypes.func.isRequired}),title:PropTypes.node.isRequired,value:PropTypes.node.isRequired,key:PropTypes.string.isRequired})),layout:PropTypes.oneOf(["VERTICAL_TWO_COLUMN","VERTICAL_ONE_COLUMN","HORIZONTAL_JUSTIFIED","HORIZONTAL_LEFT_ALIGNED","HORIZONTAL_RIGHT_ALIGNED"]),muted:PropTypes.bool},DefinitionList.defaultProps={definitions:[],layout:Layout.VERTICAL_TWO_COLUMN,muted:!1};export default DefinitionList;
1
+ import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import classNames from"classnames";import PropTypes from"prop-types";import ActionButton from"../actionButton";import{Layout}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var isLayoutHorizontal=function(a){return[Layout.HORIZONTAL_LEFT_ALIGNED,Layout.HORIZONTAL_RIGHT_ALIGNED,Layout.HORIZONTAL_JUSTIFIED].includes(a)},getAlignmentClasses=function(a,b){var c=["d-flex"];return b&&(isLayoutHorizontal(a)?c.push("align-items-center"):c.push("align-items-start")),a===Layout.HORIZONTAL_RIGHT_ALIGNED?c.push("text-sm-right tw-definition-list--right-aligned-desktop"):c.push("justify-content-between"),a===Layout.HORIZONTAL_JUSTIFIED&&c.push("text-sm-justify"),c},DefinitionList=function(a){var b=a.definitions,c=a.layout,d=a.muted;return/*#__PURE__*/_jsx("dl",{className:classNames("tw-definition-list d-flex ",{"text-muted":d,"flex-column":c===Layout.VERTICAL_ONE_COLUMN,"tw-definition-list--columns flex-column flex-row--sm":c===Layout.VERTICAL_TWO_COLUMN,"tw-definition-list--horizontal flex-column":isLayoutHorizontal(c)}),children:b.filter(function(a){return a}).map(function(a){var b=a.action,d=a.title,e=a.value,f=a.key;return/*#__PURE__*/_jsxs("div",{className:"tw-definition-list__item",children:[/*#__PURE__*/_jsx("dt",{children:d}),/*#__PURE__*/_jsxs("dd",{className:classNames.apply(void 0,_toConsumableArray(getAlignmentClasses(c,b))),children:[/*#__PURE__*/_jsx("div",{children:e}),b?/*#__PURE__*/_jsx("div",{className:classNames(isLayoutHorizontal(c)?"p-l-2":"p-x-2","tw-definition-list__action"),children:/*#__PURE__*/_jsx(ActionButton,{className:"tw-definition-list__button",onClick:b.onClick,children:b.label})}):null]})]},f)})})};DefinitionList.propTypes={definitions:PropTypes.arrayOf(PropTypes.shape({action:PropTypes.shape({label:PropTypes.string.isRequired,onClick:PropTypes.func}),title:PropTypes.node.isRequired,value:PropTypes.node.isRequired,key:PropTypes.string.isRequired})),layout:PropTypes.oneOf(["VERTICAL_TWO_COLUMN","VERTICAL_ONE_COLUMN","HORIZONTAL_JUSTIFIED","HORIZONTAL_LEFT_ALIGNED","HORIZONTAL_RIGHT_ALIGNED"]),muted:PropTypes.bool},DefinitionList.defaultProps={definitions:[],layout:Layout.VERTICAL_TWO_COLUMN,muted:!1};export default DefinitionList;
@@ -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.to-string.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,{size:"lg",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 classNames from"classnames";import{useRef}from"react";import React from"react";import{Breakpoint,Layout}from"../common";import{CloseButton}from"../common/closeButton";import FlowHeader from"../common/flowHeader/FlowHeader";import{useClientWidth}from"../common/hooks";import Logo from"../logo";import Stepper from"../stepper/Stepper";import AnimatedLabel from"./animatedLabel";import BackButton from"./backButton";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 FlowNavigation=function(a){var b=a.activeStep,c=void 0===b?0:b,d=a.avatar,e=a.logo,f=void 0===e?/*#__PURE__*/_jsx(Logo,{}):e,g=a.done,h=void 0!==g&&g,i=a.onClose,j=a.onGoBack,k=a.steps,l=useRef(null),m=useClientWidth({ref:l}),n=_slicedToArray(m,1),o=n[0],p=null!=i&&/*#__PURE__*/_jsx(CloseButton,{size:"lg",onClick:i}),q=null!=o&&o<Breakpoint.SMALL,r=h?null:d;return/*#__PURE__*/_jsx("div",{ref:l,className:classNames("np-flow-navigation d-flex align-items-center justify-content-center p-y-3",{"np-flow-navigation--border-bottom":!h}),children:/*#__PURE__*/_jsx(FlowHeader,{className:classNames("np-flow-navigation__content p-x-3",{"np-flow-navigation--hidden":!o,"np-flow-navigation--xs-max":q,// Size switches on parent container which may or may not have the same size as the window.
2
+ "np-flow-navigation--sm":null!=o&&o>=Breakpoint.SMALL,"np-flow-navigation--lg":null!=o&&o>=Breakpoint.LARGE}),leftContent:q?function getLeftContentSmall(){return/*#__PURE__*/_jsx(_Fragment,{children:null!=j&&0<c?/*#__PURE__*/_jsx(BackButton,{label:/*#__PURE__*/_jsx(AnimatedLabel,{className:"m-x-1",labels:k.map(function(a){return a.label}),activeLabel:c-1}),onClick:j}):f})}():f,rightContent:/*#__PURE__*/_jsxs(_Fragment,{children:[r,r&&p&&/*#__PURE__*/_jsx("span",{className:"separator"}),p]}),bottomContent:!h&&/*#__PURE__*/_jsx(Stepper,{activeStep:c,steps:k,className:classNames("np-flow-navigation__stepper")}),layout:null!=o&&o<Breakpoint.LARGE?Layout.VERTICAL:Layout.HORIZONTAL})})};export default FlowNavigation;