@transferwise/components 41.5.2-next-e17ebb966d.32 → 41.5.2-next-755a0fdaa9.32

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 (38) hide show
  1. package/build/es/no-polyfill/common/hooks/useTheme/useTheme.js +1 -1
  2. package/build/es/no-polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
  3. package/build/es/no-polyfill/common/theme.js +1 -1
  4. package/build/es/no-polyfill/header/Header.js +1 -1
  5. package/build/es/no-polyfill/logo/Logo.js +1 -1
  6. package/build/es/no-polyfill/logo/svg/logo-business-inverse.svg +1 -0
  7. package/build/es/no-polyfill/logo/svg/logo-business.svg +1 -0
  8. package/build/es/no-polyfill/logo/svg/logo-inverse.svg +1 -0
  9. package/build/es/no-polyfill/logo/svg/logo.svg +1 -0
  10. package/build/es/no-polyfill/provider/theme/ThemeProvider.js +2 -2
  11. package/build/es/no-polyfill/select/Select.js +7 -7
  12. package/build/es/polyfill/common/hooks/useTheme/useTheme.js +1 -1
  13. package/build/es/polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
  14. package/build/es/polyfill/common/theme.js +1 -1
  15. package/build/es/polyfill/header/Header.js +1 -1
  16. package/build/es/polyfill/logo/Logo.js +1 -1
  17. package/build/es/polyfill/logo/svg/logo-business-inverse.svg +1 -0
  18. package/build/es/polyfill/logo/svg/logo-business.svg +1 -0
  19. package/build/es/polyfill/logo/svg/logo-inverse.svg +1 -0
  20. package/build/es/polyfill/logo/svg/logo.svg +1 -0
  21. package/build/es/polyfill/provider/theme/ThemeProvider.js +2 -2
  22. package/build/es/polyfill/select/Select.js +7 -7
  23. package/build/main.css +1 -1
  24. package/build/styles/common/closeButton/CloseButton.css +1 -1
  25. package/build/styles/common/panel/Panel.css +1 -1
  26. package/build/styles/dateLookup/DateLookup.css +1 -1
  27. package/build/styles/header/Header.css +1 -1
  28. package/build/styles/main.css +1 -1
  29. package/build/styles/moneyInput/MoneyInput.css +1 -1
  30. package/build/styles/popover/Popover.css +1 -1
  31. package/build/styles/progress/Progress.css +1 -1
  32. package/build/styles/select/Select.css +1 -1
  33. package/build/styles/uploadInput/UploadInput.css +1 -1
  34. package/build/types/common/hooks/useTheme/useTheme.d.ts +0 -1
  35. package/build/types/common/theme.d.ts +0 -1
  36. package/build/umd/no-polyfill/main.js +1 -1
  37. package/build/umd/polyfill/main.js +1 -1
  38. package/package.json +5 -3
@@ -1 +1 @@
1
- import{useContext,useMemo}from"react";import{ThemeContext}from"../../../provider/theme/ThemeProvider";import{getThemeClassName,modernThemes}from"../../theme";export var useTheme=function(){var a=useContext(ThemeContext);return{theme:a,isThemeModern:useMemo(function(){return modernThemes.has(a)},[a]),className:useMemo(function(){return getThemeClassName(a)},[a])}};
1
+ import{useContext,useMemo}from"react";import{ThemeContext}from"../../../provider/theme/ThemeProvider";import{modernThemes}from"../../theme";export var useTheme=function(){var a=useContext(ThemeContext);return{theme:a,isThemeModern:useMemo(function(){return modernThemes.has(a)},[a])}};
@@ -1 +1 @@
1
- import classNames from"classnames";import{forwardRef}from"react";import{Position}from"..";import BottomSheet from"../bottomSheet";import{useLayout,useTheme}from"../hooks";import Panel from"../panel";import{jsx as _jsx}from"react/jsx-runtime";var ResponsivePanel=/*#__PURE__*/forwardRef(function(a,b){var c=a.anchorRef,d=a.arrow,e=a.flip,f=a.children,g=a.className,h=void 0===g?void 0:g,i=a.onClose,j=a.open,k=void 0!==j&&j,l=a.position,m=void 0===l?Position.BOTTOM:l,n=useTheme(),o=n.className,p=useLayout(),q=p.isMobile;return q?/*#__PURE__*/_jsx(BottomSheet,{open:k,className:h,onClose:i,children:f},"bottomSheet"):/*#__PURE__*/_jsx(Panel,{ref:b,flip:!(void 0!==e)||e,arrow:void 0!==d&&d,open:k,position:m,anchorRef:c,className:classNames(o,h),onClose:i,children:f},"panel")});export default ResponsivePanel;
1
+ import{forwardRef}from"react";import{Position}from"..";import BottomSheet from"../bottomSheet";import{useLayout}from"../hooks";import Panel from"../panel";import{jsx as _jsx}from"react/jsx-runtime";var ResponsivePanel=/*#__PURE__*/forwardRef(function(a,b){var c=a.anchorRef,d=a.arrow,e=a.flip,f=a.children,g=a.className,h=void 0===g?void 0:g,i=a.onClose,j=a.open,k=void 0!==j&&j,l=a.position,m=void 0===l?Position.BOTTOM:l,n=useLayout(),o=n.isMobile;return o?/*#__PURE__*/_jsx(BottomSheet,{open:k,className:h,onClose:i,children:f},"bottomSheet"):/*#__PURE__*/_jsx(Panel,{ref:b,flip:!(void 0!==e)||e,arrow:void 0!==d&&d,open:k,position:m,anchorRef:c,className:h,onClose:i,children:f},"panel")});export default ResponsivePanel;
@@ -1 +1 @@
1
- export var Theme;(function(a){a.LIGHT="light",a.DARK="dark",a.NAVY="navy",a.PERSONAL="personal"})(Theme||(Theme={}));export var modernThemes=new Set(["personal"]);export var getThemeClassName=function(a){return"np-theme-".concat(a)};
1
+ export var Theme;(function(a){a.LIGHT="light",a.DARK="dark",a.NAVY="navy",a.PERSONAL="personal"})(Theme||(Theme={}));export var modernThemes=new Set(["personal"]);
@@ -1,4 +1,4 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import ActionButton from"../actionButton/ActionButton";import Button from"../button";import{Typography}from"../common";import{useTheme}from"../common/hooks";import Link from"../link";import Title from"../title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var HeaderAction=function(a){var b=a.action,c=useTheme(),d=c.isThemeModern,e={"aria-label":b["aria-label"]};return"href"in b?/*#__PURE__*/_jsx(Link,_objectSpread(_objectSpread({href:b.href,target:b.target},e),{},{children:b.text})):d?/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({priority:"tertiary",onClick:b.onClick},e),{},{children:b.text})):/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({onClick:b.onClick},e),{},{children:b.text}))};/**
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import ActionButton from"../actionButton/ActionButton";import Button from"../button";import{Typography}from"../common";import{useTheme}from"../common/hooks";import Link from"../link";import Title from"../title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var HeaderAction=function(a){var b=a.action,c=useTheme(),d=c.isThemeModern,e={"aria-label":b["aria-label"]};return"href"in b?/*#__PURE__*/_jsx(Link,_objectSpread(_objectSpread({href:b.href,target:b.target},e),{},{children:b.text})):d?/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({className:"np-header__button",priority:"tertiary",size:"sm",onClick:b.onClick},e),{},{children:b.text})):/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({onClick:b.onClick},e),{},{children:b.text}))};/**
2
2
  *
3
3
  * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header
4
4
  *
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import classNames from"classnames";import PropTypes from"prop-types";import{Breakpoint}from"../common";import{isServerSide}from"../common/domHelpers";import{useClientWidth}from"../common/hooks";import{LogoType}from"./logoTypes";import{jsx as _jsx}from"react/jsx-runtime";var baseUrl="https://wise.com/public-resources/assets/logos/wise/",logoPaths={WISE:"brand_logo.svg",WISE_BUSINESS:"brand_logo_business.svg",WISE_INVERSE:"brand_logo_inverse.svg",WISE_BUSINESS_INVERSE:"brand_logo_business_inverse.svg",WISE_FLAG:"brand_flag.svg"},Logo=function(a){var b=a.className,c=a.inverse,d=a.type,e=useClientWidth({ref:isServerSide()?void 0:window}),f=_slicedToArray(e,1),g=f[0],h=g<Breakpoint.SMALL,i=h?logoPaths.WISE_FLAG:logoPaths["".concat(d).concat(c?"_INVERSE":"")];return/*#__PURE__*/_jsx("img",{className:classNames("np-logo",b),alt:d===LogoType.WISE?"Wise":"Wise business",src:"".concat(baseUrl).concat(i)})};Logo.propTypes={/** Extra classes applied to Logo */className:PropTypes.string,/** If true, will use dark colours for dark on light theme */inverse:PropTypes.bool,/** What type of logo to display */type:PropTypes.oneOf(["WISE","WISE_BUSINESS"])},Logo.defaultProps={className:void 0,inverse:!1,type:LogoType.WISE};export default Logo;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";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 React from"react";import classNames from"classnames";import PropTypes from"prop-types";import{Breakpoint}from"../common";import{isServerSide}from"../common/domHelpers";import{useClientWidth}from"../common/hooks";import{useTheme}from"../common/hooks";import{LogoType}from"./logoTypes";import{jsx as _jsx}from"react/jsx-runtime";var LogoWiseBusinessInverse=function(a){return/*#__PURE__*/_jsx("svg",_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("path",{d:"M119.48 8.004h-2.403v14.557h2.403V8.004zM37.642 22.561l2.655-14.557h3.508l-2.656 14.557h-3.507zM17.549 8.004h3.407l1.103 10.524 4.459-10.524H29.9l1.178 10.624 4.31-10.624h3.382l-6.164 14.557h-3.858L27.496 12.54l-4.26 10.022h-3.733L17.55 8.004zM2.574 8.004l2.27 3.86-4.043 3.865h6.877l.718-1.684h-3.48l2.177-2.177-1.269-2.18h5.905L6.283 22.562h2.045l6.164-14.557H2.574zM78.501 9.87c-2.685 0-4.946 2.43-4.946 5.455 0 2.968 2.261 5.399 4.946 5.399 2.714 0 4.862-2.431 4.862-5.399 0-3.024-2.148-5.455-4.862-5.455zm0 13.059c-2.148 0-4.013-1.216-5.03-2.714v2.346h-2.319V1.531h2.403v8.678c1.046-1.413 2.855-2.572 4.946-2.572 4.184 0 7.265 3.448 7.265 7.66s-3.081 7.632-7.265 7.632zm21.536-.368h-2.318v-1.583c-.989 1.187-2.459 1.922-4.24 1.922-3.56 0-5.596-2.544-5.596-6.133V8.004h2.374v8.876c0 2.318 1.272 3.844 3.59 3.844 2.148 0 3.788-1.611 3.788-3.788V8.004h2.402v14.557zm8.674.368c-3.534 0-6.106-1.894-6.502-4.975h2.431c.311 1.696 1.979 2.742 4.071 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.534-.509-5.682-1.357-5.682-4.098 0-2.092 1.809-4.325 5.71-4.325 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.345-3.505-2.345-1.922 0-3.307.904-3.307 2.035 0 1.045.82 1.413 3.674 1.865 3.223.509 5.88 1.13 5.88 4.438 0 2.911-2.488 4.749-5.964 4.749zm25.948-.368h-2.374v-8.847c0-2.233-1.244-3.872-3.562-3.872-2.205 0-3.816 1.639-3.816 3.815v8.904h-2.402V8.004h2.317v1.583c.99-1.215 2.488-1.95 4.24-1.95 3.562 0 5.597 2.544 5.597 6.162v8.762zm13.879-8.791c-.594-2.374-2.573-3.957-4.693-3.957-2.006 0-4.126 1.47-4.748 3.957h9.441zm2.317 4.269c-1.017 3.109-3.505 4.861-6.868 4.861-4.184 0-7.462-3.335-7.462-7.603 0-4.212 3.278-7.66 7.32-7.66 3.76 0 7.378 3.109 7.35 8.282h-12.24c.311 3.024 2.629 4.805 5.032 4.805 2.063 0 3.533-.99 4.324-2.685h2.544zm8.394 4.89c-3.533 0-6.106-1.894-6.501-4.975h2.431c.31 1.696 1.978 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.533-.509-5.682-1.357-5.682-4.098 0-2.092 1.809-4.325 5.71-4.325 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.345-3.505-2.345-1.922 0-3.307.904-3.307 2.035 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438 0 2.911-2.487 4.749-5.964 4.749zm13.652 0c-3.533 0-6.105-1.894-6.501-4.975h2.431c.311 1.696 1.979 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.395-1.78-3.957-2.261-3.533-.509-5.681-1.357-5.681-4.098 0-2.092 1.809-4.325 5.71-4.325 3.363 0 5.624 1.696 5.935 4.55h-2.43c-.34-1.554-1.725-2.345-3.505-2.345-1.923 0-3.308.904-3.308 2.035 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438-.001 2.911-2.487 4.749-5.964 4.749zM57.207 13.867c.352-1.804 2.105-3.233 4.21-3.233 1.83 0 3.207 1.329 3.207 3.233h-7.417zm10.9.45c0-3.909-2.73-6.665-6.54-6.665-4.86 0-8.118 3.534-8.118 8.57 0 3.932 2.756 6.664 6.64 6.664 3.533 0 6.163-1.703 7.24-4.435h-3.933c-.526.853-1.628 1.378-2.982 1.378-2.079 0-3.382-1.378-3.508-3.332H67.88a10.08 10.08 0 0 0 .227-2.18zm-25.204 8.219.701-3.758c2.156.425 2.48-.777 3.032-3.709l.275-1.453c.778-4.084 2.355-6.113 6.865-5.562l-.701 3.758c-2.156-.426-2.53 1.202-3.006 3.732l-.276 1.453c-.776 4.135-2.405 6.09-6.89 5.539z",fill:"#163300"})}))};LogoWiseBusinessInverse.defaultProps={width:"180",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var LogoWiseBusiness=function(a){return/*#__PURE__*/_jsx("svg",_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("path",{d:"M119.48 8.004h-2.403v14.557h2.403V8.004zM37.642 22.561l2.655-14.557h3.508l-2.656 14.557h-3.507zM17.549 8.004h3.407l1.103 10.524 4.459-10.524H29.9l1.178 10.624 4.31-10.624h3.382l-6.164 14.557h-3.858L27.496 12.54l-4.26 10.021h-3.733L17.55 8.004zM2.574 8.004l2.27 3.86-4.043 3.865h6.877l.718-1.684h-3.48l2.177-2.177-1.269-2.18h5.905L6.283 22.562h2.045l6.164-14.557H2.574zM78.501 9.87c-2.685 0-4.946 2.43-4.946 5.455 0 2.968 2.261 5.399 4.946 5.399 2.714 0 4.862-2.431 4.862-5.399 0-3.024-2.148-5.455-4.862-5.455zm0 13.059c-2.148 0-4.013-1.216-5.03-2.714v2.346h-2.319V1.531h2.403v8.678c1.046-1.413 2.855-2.572 4.946-2.572 4.184 0 7.265 3.448 7.265 7.66s-3.081 7.632-7.265 7.632zm21.536-.368h-2.318v-1.583c-.989 1.188-2.459 1.922-4.24 1.922-3.56 0-5.596-2.544-5.596-6.133V8.004h2.374v8.876c0 2.318 1.272 3.844 3.59 3.844 2.148 0 3.788-1.611 3.788-3.788V8.004h2.402v14.557zm8.674.368c-3.534 0-6.106-1.894-6.502-4.975h2.431c.311 1.696 1.979 2.742 4.071 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.534-.509-5.682-1.357-5.682-4.099 0-2.091 1.809-4.324 5.71-4.324 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.346-3.505-2.346-1.922 0-3.307.905-3.307 2.036 0 1.045.82 1.413 3.674 1.865 3.223.509 5.88 1.13 5.88 4.438 0 2.911-2.488 4.749-5.964 4.749zm25.948-.368h-2.374v-8.847c0-2.233-1.244-3.873-3.562-3.873-2.205 0-3.816 1.64-3.816 3.816v8.904h-2.402V8.004h2.317v1.583c.99-1.215 2.488-1.95 4.24-1.95 3.562 0 5.597 2.544 5.597 6.162v8.762zm13.879-8.791c-.594-2.374-2.573-3.957-4.693-3.957-2.007 0-4.127 1.47-4.748 3.957h9.441zm2.317 4.269c-1.017 3.109-3.505 4.861-6.868 4.861-4.184 0-7.463-3.335-7.463-7.603 0-4.212 3.279-7.66 7.321-7.66 3.76 0 7.378 3.109 7.35 8.282h-12.24c.311 3.024 2.629 4.805 5.032 4.805 2.063 0 3.533-.99 4.324-2.685h2.544zm8.394 4.89c-3.533 0-6.106-1.894-6.501-4.975h2.431c.31 1.696 1.978 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.533-.509-5.682-1.357-5.682-4.099 0-2.091 1.809-4.324 5.71-4.324 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.346-3.505-2.346-1.922 0-3.307.905-3.307 2.036 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438 0 2.911-2.487 4.749-5.964 4.749zm13.652 0c-3.533 0-6.105-1.894-6.501-4.975h2.431c.311 1.696 1.979 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.395-1.78-3.957-2.261-3.533-.509-5.681-1.357-5.681-4.099 0-2.091 1.809-4.324 5.71-4.324 3.363 0 5.624 1.696 5.935 4.55h-2.43c-.34-1.554-1.725-2.346-3.505-2.346-1.923 0-3.308.905-3.308 2.036 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438-.001 2.911-2.487 4.749-5.964 4.749zM57.207 13.867c.352-1.804 2.105-3.233 4.21-3.233 1.83 0 3.207 1.329 3.207 3.233h-7.417zm10.9.45c0-3.909-2.73-6.665-6.54-6.665-4.86 0-8.118 3.533-8.118 8.57 0 3.932 2.756 6.664 6.64 6.664 3.533 0 6.163-1.703 7.24-4.435h-3.933c-.526.852-1.628 1.378-2.982 1.378-2.079 0-3.382-1.378-3.508-3.332H67.88a10.08 10.08 0 0 0 .227-2.18zm-25.204 8.219.701-3.758c2.156.425 2.48-.777 3.032-3.709l.275-1.453c.778-4.084 2.355-6.114 6.865-5.562l-.701 3.758c-2.156-.426-2.53 1.202-3.006 3.732l-.276 1.453c-.776 4.135-2.405 6.09-6.89 5.539z",fill:"#163300"})}))};LogoWiseBusiness.defaultProps={width:"180",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var LogoWiseInverse=function(a){return/*#__PURE__*/_jsx("svg",_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("path",{d:"M93.669 10.69c0-5.382-3.75-9.167-9.007-9.167-6.692 0-11.177 4.862-11.177 11.805 0 5.418 3.786 9.167 9.132 9.167 4.862 0 8.486-2.35 9.975-6.1h-5.4c-.718 1.167-2.243 1.902-4.108 1.902-2.871 0-4.665-1.902-4.827-4.593h15.107c.197-1.022.305-1.901.305-3.014zm-14.999-.628c.484-2.475 2.889-4.449 5.795-4.449 2.512 0 4.413 1.83 4.413 4.45H78.67zM58.971 22.01l.969-5.166c2.96.592 3.409-1.077 4.18-5.095l.377-1.992c1.076-5.615 3.247-8.414 9.455-7.66l-.97 5.167c-2.96-.592-3.48 1.65-4.143 5.13l-.377 1.992c-1.077 5.687-3.32 8.378-9.49 7.625zm-7.248.019 3.66-20.022h4.826l-3.642 20.022h-4.844zM24.076 2.007h4.683l1.525 14.478L36.42 2.007h4.646L42.7 16.629l5.92-14.622h4.665l-8.486 20.022h-5.31L37.765 8.25 31.9 22.03h-5.131L24.076 2.007zM6.584 7.317l-5.561 5.31h9.454l.987-2.313h-4.79L9.67 7.317 7.93 4.321h8.127l-7.5 17.708h2.817L19.86 2.007H3.463l3.121 5.31z",fill:"#163300"})}))};LogoWiseInverse.defaultProps={width:"95",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var LogoWise=function(a){return/*#__PURE__*/_jsx("svg",_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("path",{d:"M93.668 10.69c0-5.382-3.75-9.167-9.006-9.167-6.692 0-11.177 4.862-11.177 11.805 0 5.418 3.786 9.167 9.132 9.167 4.862 0 8.486-2.35 9.975-6.1h-5.4c-.718 1.167-2.243 1.902-4.109 1.902-2.87 0-4.664-1.902-4.826-4.593h15.106c.198-1.022.305-1.901.305-3.014zm-14.998-.628c.484-2.475 2.888-4.449 5.795-4.449 2.511 0 4.413 1.83 4.413 4.45H78.67zM58.971 22.01l.969-5.166c2.96.592 3.409-1.077 4.18-5.095l.377-1.992c1.076-5.615 3.247-8.414 9.455-7.66l-.97 5.167c-2.96-.592-3.48 1.65-4.143 5.13l-.377 1.992c-1.077 5.687-3.32 8.378-9.49 7.625zm-7.248.019 3.66-20.022h4.826l-3.642 20.022h-4.844zM24.076 2.007h4.683l1.525 14.478L36.42 2.007h4.646L42.7 16.629l5.92-14.622h4.665l-8.486 20.022h-5.31L37.764 8.25 31.9 22.03h-5.132l-2.69-20.022zM6.584 7.317l-5.561 5.31h9.454l.987-2.314h-4.79L9.67 7.317 7.93 4.321h8.127l-7.5 17.708h2.817L19.86 2.007H3.463l3.121 5.31z",fill:"#163300"})}))};LogoWise.defaultProps={width:"95",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var baseUrl="https://wise.com/public-resources/assets/logos/wise/",logoPaths={WISE:"brand_logo.svg",WISE_BUSINESS:"brand_logo_business.svg",WISE_INVERSE:"brand_logo_inverse.svg",WISE_BUSINESS_INVERSE:"brand_logo_business_inverse.svg",WISE_FLAG:"brand_flag.svg"},svgPaths={WISE:LogoWise,WISE_BUSINESS:LogoWiseBusiness,WISE_INVERSE:LogoWiseInverse,WISE_BUSINESS_INVERSE:LogoWiseBusinessInverse},Logo=function(a){var b=a.className,c=a.inverse,d=a.type,e=useTheme(),f=e.isThemeModern,g=useClientWidth({ref:isServerSide()?void 0:window}),h=_slicedToArray(g,1),i=h[0],j=i<Breakpoint.SMALL,k=j?logoPaths.WISE_FLAG:logoPaths["".concat(d).concat(c?"_INVERSE":"")],l=svgPaths["".concat(d).concat(c?"_INVERSE":"")];return f?/*#__PURE__*/_jsx(l,{}):/*#__PURE__*/_jsx("img",{className:classNames("np-logo",b),alt:d===LogoType.WISE?"Wise":"Wise business",src:"".concat(baseUrl).concat(k)})};Logo.propTypes={/** Extra classes applied to Logo */className:PropTypes.string,/** If true, will use dark colours for dark on light theme */inverse:PropTypes.bool,/** What type of logo to display */type:PropTypes.oneOf(["WISE","WISE_BUSINESS"])},Logo.defaultProps={className:void 0,inverse:!1,type:LogoType.WISE};export default Logo;
@@ -0,0 +1 @@
1
+ <svg width="180" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M119.48 8.004h-2.403v14.557h2.403V8.004zM37.642 22.561l2.655-14.557h3.508l-2.656 14.557h-3.507zM17.549 8.004h3.407l1.103 10.524 4.459-10.524H29.9l1.178 10.624 4.31-10.624h3.382l-6.164 14.557h-3.858L27.496 12.54l-4.26 10.022h-3.733L17.55 8.004z" fill="#163300"/><path d="M2.574 8.004l2.27 3.86-4.043 3.865h6.877l.718-1.684h-3.48l2.177-2.177-1.269-2.18h5.905L6.283 22.562h2.045l6.164-14.557H2.574z" fill="#163300"/><path d="M78.501 9.87c-2.685 0-4.946 2.43-4.946 5.455 0 2.968 2.261 5.399 4.946 5.399 2.714 0 4.862-2.431 4.862-5.399 0-3.024-2.148-5.455-4.862-5.455zm0 13.059c-2.148 0-4.013-1.216-5.03-2.714v2.346h-2.319V1.531h2.403v8.678c1.046-1.413 2.855-2.572 4.946-2.572 4.184 0 7.265 3.448 7.265 7.66s-3.081 7.632-7.265 7.632zM100.037 22.561h-2.318v-1.583c-.989 1.187-2.459 1.922-4.24 1.922-3.56 0-5.596-2.544-5.596-6.133V8.004h2.374v8.876c0 2.318 1.272 3.844 3.59 3.844 2.148 0 3.788-1.611 3.788-3.788V8.004h2.402v14.557zM108.711 22.929c-3.534 0-6.106-1.894-6.502-4.975h2.431c.311 1.696 1.979 2.742 4.071 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.534-.509-5.682-1.357-5.682-4.098 0-2.092 1.809-4.325 5.71-4.325 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.345-3.505-2.345-1.922 0-3.307.904-3.307 2.035 0 1.045.82 1.413 3.674 1.865 3.223.509 5.88 1.13 5.88 4.438 0 2.911-2.488 4.749-5.964 4.749zM134.659 22.561h-2.374v-8.847c0-2.233-1.244-3.872-3.562-3.872-2.205 0-3.816 1.639-3.816 3.815v8.904h-2.402V8.004h2.317v1.583c.99-1.215 2.488-1.95 4.24-1.95 3.562 0 5.597 2.544 5.597 6.162v8.762zM148.538 13.77c-.594-2.374-2.573-3.957-4.693-3.957-2.006 0-4.126 1.47-4.748 3.957h9.441zm2.317 4.269c-1.017 3.109-3.505 4.861-6.868 4.861-4.184 0-7.462-3.335-7.462-7.603 0-4.212 3.278-7.66 7.32-7.66 3.76 0 7.378 3.109 7.35 8.282h-12.24c.311 3.024 2.629 4.805 5.032 4.805 2.063 0 3.533-.99 4.324-2.685h2.544zM159.249 22.929c-3.533 0-6.106-1.894-6.501-4.975h2.431c.31 1.696 1.978 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.533-.509-5.682-1.357-5.682-4.098 0-2.092 1.809-4.325 5.71-4.325 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.345-3.505-2.345-1.922 0-3.307.904-3.307 2.035 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438 0 2.911-2.487 4.749-5.964 4.749zM172.901 22.929c-3.533 0-6.105-1.894-6.501-4.975h2.431c.311 1.696 1.979 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.395-1.78-3.957-2.261-3.533-.509-5.681-1.357-5.681-4.098 0-2.092 1.809-4.325 5.71-4.325 3.363 0 5.624 1.696 5.935 4.55h-2.43c-.34-1.554-1.725-2.345-3.505-2.345-1.923 0-3.308.904-3.308 2.035 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438-.001 2.911-2.487 4.749-5.964 4.749zM57.207 13.867c.352-1.804 2.105-3.233 4.21-3.233 1.83 0 3.207 1.329 3.207 3.233h-7.417zm10.9.45c0-3.909-2.73-6.665-6.54-6.665-4.86 0-8.118 3.534-8.118 8.57 0 3.932 2.756 6.664 6.64 6.664 3.533 0 6.163-1.703 7.24-4.435h-3.933c-.526.853-1.628 1.378-2.982 1.378-2.079 0-3.382-1.378-3.508-3.332H67.88c.152-.725.227-1.377.227-2.18zM42.903 22.536l.701-3.758c2.156.425 2.48-.777 3.032-3.709l.275-1.453c.778-4.084 2.355-6.113 6.865-5.562l-.701 3.758c-2.156-.426-2.53 1.202-3.006 3.732l-.276 1.453c-.776 4.135-2.405 6.09-6.89 5.539z" fill="#163300"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="180" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M119.48 8.004h-2.403v14.557h2.403V8.004zM37.642 22.561l2.655-14.557h3.508l-2.656 14.557h-3.507zM17.549 8.004h3.407l1.103 10.524 4.459-10.524H29.9l1.178 10.624 4.31-10.624h3.382l-6.164 14.557h-3.858L27.496 12.54l-4.26 10.021h-3.733L17.55 8.004z" fill="#163300"/><path d="M2.574 8.004l2.27 3.86-4.043 3.865h6.877l.718-1.684h-3.48l2.177-2.177-1.269-2.18h5.905L6.283 22.562h2.045l6.164-14.557H2.574z" fill="#163300"/><path d="M78.501 9.87c-2.685 0-4.946 2.43-4.946 5.455 0 2.968 2.261 5.399 4.946 5.399 2.714 0 4.862-2.431 4.862-5.399 0-3.024-2.148-5.455-4.862-5.455zm0 13.059c-2.148 0-4.013-1.216-5.03-2.714v2.346h-2.319V1.531h2.403v8.678c1.046-1.413 2.855-2.572 4.946-2.572 4.184 0 7.265 3.448 7.265 7.66s-3.081 7.632-7.265 7.632zM100.037 22.561h-2.318v-1.583c-.989 1.188-2.459 1.922-4.24 1.922-3.56 0-5.596-2.544-5.596-6.133V8.004h2.374v8.876c0 2.318 1.272 3.844 3.59 3.844 2.148 0 3.788-1.611 3.788-3.788V8.004h2.402v14.557zM108.711 22.929c-3.534 0-6.106-1.894-6.502-4.975h2.431c.311 1.696 1.979 2.742 4.071 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.534-.509-5.682-1.357-5.682-4.099 0-2.091 1.809-4.324 5.71-4.324 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.346-3.505-2.346-1.922 0-3.307.905-3.307 2.036 0 1.045.82 1.413 3.674 1.865 3.223.509 5.88 1.13 5.88 4.438 0 2.911-2.488 4.749-5.964 4.749zM134.659 22.561h-2.374v-8.847c0-2.233-1.244-3.873-3.562-3.873-2.205 0-3.816 1.64-3.816 3.816v8.904h-2.402V8.004h2.317v1.583c.99-1.215 2.488-1.95 4.24-1.95 3.562 0 5.597 2.544 5.597 6.162v8.762zM148.538 13.77c-.594-2.374-2.573-3.957-4.693-3.957-2.007 0-4.127 1.47-4.748 3.957h9.441zm2.317 4.269c-1.017 3.109-3.505 4.861-6.868 4.861-4.184 0-7.463-3.335-7.463-7.603 0-4.212 3.279-7.66 7.321-7.66 3.76 0 7.378 3.109 7.35 8.282h-12.24c.311 3.024 2.629 4.805 5.032 4.805 2.063 0 3.533-.99 4.324-2.685h2.544zM159.249 22.929c-3.533 0-6.106-1.894-6.501-4.975h2.431c.31 1.696 1.978 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.533-.509-5.682-1.357-5.682-4.099 0-2.091 1.809-4.324 5.71-4.324 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.346-3.505-2.346-1.922 0-3.307.905-3.307 2.036 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438 0 2.911-2.487 4.749-5.964 4.749zM172.901 22.929c-3.533 0-6.105-1.894-6.501-4.975h2.431c.311 1.696 1.979 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.395-1.78-3.957-2.261-3.533-.509-5.681-1.357-5.681-4.099 0-2.091 1.809-4.324 5.71-4.324 3.363 0 5.624 1.696 5.935 4.55h-2.43c-.34-1.554-1.725-2.346-3.505-2.346-1.923 0-3.308.905-3.308 2.036 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438-.001 2.911-2.487 4.749-5.964 4.749zM57.207 13.867c.352-1.804 2.105-3.233 4.21-3.233 1.83 0 3.207 1.329 3.207 3.233h-7.417zm10.9.45c0-3.909-2.73-6.665-6.54-6.665-4.86 0-8.118 3.533-8.118 8.57 0 3.932 2.756 6.664 6.64 6.664 3.533 0 6.163-1.703 7.24-4.435h-3.933c-.526.852-1.628 1.378-2.982 1.378-2.079 0-3.382-1.378-3.508-3.332H67.88c.152-.725.227-1.377.227-2.18zM42.903 22.536l.701-3.758c2.156.425 2.48-.777 3.032-3.709l.275-1.453c.778-4.084 2.355-6.114 6.865-5.562l-.701 3.758c-2.156-.426-2.53 1.202-3.006 3.732l-.276 1.453c-.776 4.135-2.405 6.09-6.89 5.539z" fill="#163300"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="95" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M93.669 10.69c0-5.382-3.75-9.167-9.007-9.167-6.692 0-11.177 4.862-11.177 11.805 0 5.418 3.786 9.167 9.132 9.167 4.862 0 8.486-2.35 9.975-6.1h-5.4c-.718 1.167-2.243 1.902-4.108 1.902-2.871 0-4.665-1.902-4.827-4.593h15.107c.197-1.022.305-1.901.305-3.014zm-14.999-.628c.484-2.475 2.889-4.449 5.795-4.449 2.512 0 4.413 1.83 4.413 4.45H78.67zM58.971 22.01l.969-5.166c2.96.592 3.409-1.077 4.18-5.095l.377-1.992c1.076-5.615 3.247-8.414 9.455-7.66l-.97 5.167c-2.96-.592-3.48 1.65-4.143 5.13l-.377 1.992c-1.077 5.687-3.32 8.378-9.49 7.625zM51.723 22.029l3.66-20.022h4.826l-3.642 20.022h-4.844zM24.076 2.007h4.683l1.525 14.478L36.42 2.007h4.646L42.7 16.629l5.92-14.622h4.665l-8.486 20.022h-5.31L37.765 8.25 31.9 22.03h-5.131L24.076 2.007z" fill="#163300"/><path d="M6.584 7.317l-5.561 5.31h9.454l.987-2.313h-4.79L9.67 7.317 7.93 4.321h8.127l-7.5 17.708h2.817L19.86 2.007H3.463l3.121 5.31z" fill="#163300"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="95" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M93.668 10.69c0-5.382-3.75-9.167-9.006-9.167-6.692 0-11.177 4.862-11.177 11.805 0 5.418 3.786 9.167 9.132 9.167 4.862 0 8.486-2.35 9.975-6.1h-5.4c-.718 1.167-2.243 1.902-4.109 1.902-2.87 0-4.664-1.902-4.826-4.593h15.106c.198-1.022.305-1.901.305-3.014zm-14.998-.628c.484-2.475 2.888-4.449 5.795-4.449 2.511 0 4.413 1.83 4.413 4.45H78.67zM58.971 22.01l.969-5.166c2.96.592 3.409-1.077 4.18-5.095l.377-1.992c1.076-5.615 3.247-8.414 9.455-7.66l-.97 5.167c-2.96-.592-3.48 1.65-4.143 5.13l-.377 1.992c-1.077 5.687-3.32 8.378-9.49 7.625zM51.723 22.029l3.66-20.022h4.826l-3.642 20.022h-4.844zM24.076 2.007h4.683l1.525 14.478L36.42 2.007h4.646L42.7 16.629l5.92-14.622h4.665l-8.486 20.022h-5.31L37.764 8.25 31.9 22.03h-5.132l-2.69-20.022z" fill="#163300"/><path d="M6.584 7.317l-5.561 5.31h9.454l.987-2.314h-4.79L9.67 7.317 7.93 4.321h8.127l-7.5 17.708h2.817L19.86 2.007H3.463l3.121 5.31z" fill="#163300"/></svg>
@@ -1,3 +1,3 @@
1
- import React from"react";import{Children,cloneElement,createContext,isValidElement}from"react";import{getThemeClassName,Theme}from"../../common/theme";import{jsx as _jsx}from"react/jsx-runtime";export var ThemeContext=/*#__PURE__*/createContext(Theme.LIGHT);export var ThemeProvider=function(a){var b=a.theme,c=a.children,d=Children.map(c,function(a){var c;if(!/*#__PURE__*/isValidElement(a))return"production"!==process.env.NODE_ENV&&console.warn("[ThemeProvider] Trying to inject `className` to an invalid React element, this will be skipped!"),a;// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
2
- var d=[getThemeClassName(b),null===a||void 0===a||null===(c=a.props)||void 0===c?void 0:c.className].filter(Boolean).join(" ");if(/*#__PURE__*/isValidElement(a))// eslint-disable-next-line @typescript-eslint/no-explicit-any
1
+ import React from"react";import{Children,cloneElement,createContext,isValidElement}from"react";import{Theme}from"../../common/theme";import{jsx as _jsx}from"react/jsx-runtime";export var ThemeContext=/*#__PURE__*/createContext(Theme.LIGHT);export var ThemeProvider=function(a){var b=a.theme,c=a.children,d=Children.map(c,function(a){var c;if(!/*#__PURE__*/isValidElement(a))return"production"!==process.env.NODE_ENV&&console.warn("[ThemeProvider] Trying to inject `className` to an invalid React element, this will be skipped!"),a;// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
2
+ var d=["np-theme-".concat(b),null===a||void 0===a||null===(c=a.props)||void 0===c?void 0:c.className].filter(Boolean).join(" ");if(/*#__PURE__*/isValidElement(a))// eslint-disable-next-line @typescript-eslint/no-explicit-any
3
3
  return/*#__PURE__*/cloneElement(a,{className:d})});return/*#__PURE__*/_jsx(ThemeContext.Provider,{value:b,children:d})};
@@ -1,11 +1,11 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";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{useState,useEffect,useRef,useMemo}from"react";import{useIntl}from"react-intl";import Body from"../body";import Button from"../button";import Chevron from"../chevron";import{Position,getSimpleRandomId}from"../common";import BottomSheet from"../common/bottomSheet";import{stopPropagation}from"../common/domHelpers";import{useLayout,useTheme}from"../common/hooks";import KeyCodes from"../common/keyCodes";import Panel from"../common/panel";import Drawer from"../drawer";import messages from"./Select.messages";import Option from"./option";import SearchBox from"./searchBox";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var DEFAULT_SEARCH_VALUE="",DEFAULT_OPTIONS_PAGE_SIZE=100,includesString=function(a,b){return a.toLowerCase().includes(b.toLowerCase())};function defaultFilterFunction(a,b){if(isPlaceholderOption(a))return!0;var c=a.label,d=a.note,e=a.secondary,f=a.currency,g=a.searchStrings;return!!c&&includesString(c,b)||!!d&&includesString(d,b)||!!e&&includesString(e,b)||!!f&&includesString(f,b)||!!g&&g.some(function(a){return includesString(a,b)})}function isActionableOption(a){return!a.header&&!a.separator&&!a.disabled}function isHeaderOption(a){return null!==a&&"header"in a}function isSparatorOption(a){return null!==a&&"separator"in a}/**
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";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{useState,useEffect,useRef,useMemo}from"react";import{useIntl}from"react-intl";import Body from"../body";import Button from"../button";import Chevron from"../chevron";import{Position,getSimpleRandomId}from"../common";import BottomSheet from"../common/bottomSheet";import{stopPropagation}from"../common/domHelpers";import{useLayout}from"../common/hooks";import KeyCodes from"../common/keyCodes";import Panel from"../common/panel";import Drawer from"../drawer";import messages from"./Select.messages";import Option from"./option";import SearchBox from"./searchBox";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var DEFAULT_SEARCH_VALUE="",DEFAULT_OPTIONS_PAGE_SIZE=100,includesString=function(a,b){return a.toLowerCase().includes(b.toLowerCase())};function defaultFilterFunction(a,b){if(isPlaceholderOption(a))return!0;var c=a.label,d=a.note,e=a.secondary,f=a.currency,g=a.searchStrings;return!!c&&includesString(c,b)||!!d&&includesString(d,b)||!!e&&includesString(e,b)||!!f&&includesString(f,b)||!!g&&g.some(function(a){return includesString(a,b)})}function isActionableOption(a){return!a.header&&!a.separator&&!a.disabled}function isHeaderOption(a){return null!==a&&"header"in a}function isSparatorOption(a){return null!==a&&"separator"in a}/**
2
2
  * No option or placeholder option is selected
3
- */var DEFAULT_SELECTED_OPTION=null;function isPlaceholderOption(a){return a===DEFAULT_SELECTED_OPTION||"placeholder"in a}export default function Select(a){function b(){if(null!==V){var a=la().filter(isActionableOption);0<a.length&&e(a[V])}}function c(a){var b=la().filter(isActionableOption),c=b.reduce(function(a,b,c){return null===a?k(v,b)?c:null:a},null),d=null===X.current||void 0===X.current?-1:X.current,e=d;null===d&&null===c&&W(0),null===d&&null!==c&&(e=c);var f=e+a,g=Math.max(Math.min(0,b.length-1),f);W(g)}function d(a){return function(b){stopPropagation(b),e(a)}}function e(a){x(isPlaceholderOption(a)?DEFAULT_SELECTED_OPTION:a),na()}function f(){var a,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=b.className,d=classNames(L("np-dropdown-menu"),(a={},_defineProperty(a,L("np-dropdown-menu-desktop"),!ka),_defineProperty(a,L("np-dropdown-menu-".concat(r)),!ka&&!fa),a),L(c)),e=la();return/*#__PURE__*/_jsxs("ul",_objectSpread(_objectSpread({ref:da,id:ia,role:"listbox",tabIndex:"-1",className:d},G),{},{children:[!o&&!ea&&null!==m&&/*#__PURE__*/_jsx(h,{}),ea&&/*#__PURE__*/_jsx(SearchBox,{ref:aa,classNames:E,value:C||R,placeholder:D||K(messages.searchPlaceholder),onChange:ma,onClick:stopPropagation}),e.slice(0,$).map(oa),$<e.length&&/*#__PURE__*/_jsx(g,{})]}))}function g(){function a(a){stopPropagation(a),_($+DEFAULT_OPTIONS_PAGE_SIZE)}return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{className:classNames(L("clickable"),L("border-bottom"),L("show-more")),onClick:a,onKeyPress:a,children:/*#__PURE__*/_jsx("a",{children:"..."})}))}function h(){var a={placeholder:m};return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{className:classNames(L("clickable"),L("border-bottom")),onClick:d(a),onKeyPress:d(a),children:/*#__PURE__*/_jsx("a",{children:m})}))}// eslint-disable-next-line react/prop-types
4
- function i(a){var b=a.index;return/*#__PURE__*/_jsx("li",{className:L("np-separator"),"aria-hidden":!0},b)}// eslint-disable-next-line react/prop-types
5
- function j(a){var b=a.index,c=a.children;return/*#__PURE__*/_jsx("li",{className:classNames(L("np-dropdown-header"),L("np-text-title-group")),onClick:stopPropagation,onKeyPress:stopPropagation,children:c},b)}function k(a,b){return(null===a||void 0===a?void 0:a.value)===(null===b||void 0===b?void 0:b.value)}function l(a){return la().reduce(function(b,c,d){return d<a&&isActionableOption(c)?b+1:b},0)}var m=a.placeholder,n=a.id,o=a.required,p=a.disabled,q=a.inverse,r=a.dropdownWidth,t=a.size,u=a.block,v=a.selected,w=a.search,x=a.onChange,y=a.onFocus,z=a.onBlur,A=a.options,B=a.onSearchChange,C=a.searchValue,D=a.searchPlaceholder,E=a.classNames,F=a.dropdownUp,G=a.dropdownProps,H=a.buttonProps,I=useTheme(),J=useIntl(),K=J.formatMessage,L=function(a){return E[a]||a},s=useState(!1),M=_slicedToArray(s,2),N=M[0],O=M[1],P=useState(DEFAULT_SEARCH_VALUE),Q=_slicedToArray(P,2),R=Q[0],S=Q[1],T=useState(null),U=_slicedToArray(T,2),V=U[0],W=U[1],X=useRef(),Y=useState(DEFAULT_OPTIONS_PAGE_SIZE),Z=_slicedToArray(Y,2),$=Z[0],_=Z[1],aa=useRef(null),ba=useRef(null),ca=useRef(null),da=useRef(null),ea=!!B||!!w,fa=null===r,ga=useMemo(function(){return getSimpleRandomId("np-select-")},[]),ha=n||ga,ia="".concat(ha,"-listbox"),ja=useLayout(),ka=ja.isMobile,la=function(){return w&&R?A.filter(function(a){return isActionableOption(a)&&!isPlaceholderOption(a)}).filter(function(a){return"function"==typeof w?w(a,R):defaultFilterFunction(a,R)}):A},ma=function(a){_(DEFAULT_OPTIONS_PAGE_SIZE),S(a.target.value),B&&B(a.target.value)};useEffect(function(){X.current=V,N&&(!ka||""!==R)&&(ea&&!!aa.current&&aa.current.focus(),!ea&&da.current&&da.current.focus())},[N,R,ea,ka,V]);var na=function(){O(!1),W(null),ca.current&&ca.current.focus()},oa=function(a,b){var c,e=a;if(isSparatorOption(e)&&null!==e&&void 0!==e&&e.separator)return/*#__PURE__*/_jsx(i,{index:b});var f=a;if(isHeaderOption(f)&&f.header)return/*#__PURE__*/_jsx(j,{index:b,children:f.header});var g=k(v,a),h=a,m=!h.disabled&&V===l(b),n=classNames(L("np-dropdown-item"),h.disabled?[L("disabled")]:L("clickable"),(c={},_defineProperty(c,L("active"),g),_defineProperty(c,L("np-dropdown-item--focused"),m),c)),o=h.disabled?stopPropagation:d(h);return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{"aria-selected":g,"aria-disabled":a.disabled,role:"option",tabIndex:"-1",className:n,onClick:o,onKeyPress:o,children:/*#__PURE__*/_jsx("a",{disabled:h.disabled,children:/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},h),{},{classNames:E}))})},b))},pa=!!A.length;return N&&(""!==C||""!==R)&&(pa&&null===V&&W(0),!pa&&null!==V&&W(null)),/*#__PURE__*/_jsxs("div",{// eslint-disable-line jsx-a11y/no-static-element-interactions
6
- ref:ba,className:classNames(L("np-select"),u?L("btn-block"):null,L("btn-group")),onKeyDown:function handleKeyDown(a){switch(a.keyCode){case KeyCodes.UP:case KeyCodes.DOWN:N?c(a.keyCode===KeyCodes.UP?-1:1):O(!0),stopPropagation(a);break;case KeyCodes.SPACE:a.target!==aa.current&&(N?b():O(!0),stopPropagation(a));break;case KeyCodes.ENTER:N?b():O(!0),stopPropagation(a);break;case KeyCodes.ESCAPE:na(),stopPropagation(a);break;case KeyCodes.TAB:N&&b();break;default:}},onTouchMove:function handleTouchStart(a){a.currentTarget===a.target&&N&&na()},onFocus:function handleOnFocus(a){y&&y(a)},onBlur:function handleOnBlur(a){var b=a.nativeEvent;if(b){var c=b.relatedTarget,d=a.currentTarget;if(d&&c&&d.contains(c))return}z&&z(a)},children:[/*#__PURE__*/_jsxs(Button,_objectSpread(_objectSpread({ref:ca,id:ha,block:u,size:t,htmlType:"button",className:classNames(L("np-dropdown-toggle"),L("np-text-body-large"),"string"==typeof E&&-1!==E.search("form-control")?L("form-control"):null,q?L("np-dropdown-toggle-navy"):null)// reset Button's styles
7
- ,type:null,priority:null,disabled:p,role:"combobox","aria-controls":ia,"aria-expanded":N,"aria-autocomplete":"none",onClick:function handleOnClick(){O(!0)}},H),{},{children:[v?/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},v),{},{classNames:E,selected:!0})):/*#__PURE__*/_jsx(Body,{className:L("form-control-placeholder"),children:m}),/*#__PURE__*/_jsx(Chevron// disabled={disabled}
8
- ,{className:classNames(L("tw-icon"),L("tw-chevron-up-icon"),L("tw-chevron"),L("bottom"),L("np-select-chevron"))})]})),ka?ea?/*#__PURE__*/_jsx(Drawer,{className:I.className,open:N,headerTitle:D||K(messages.searchPlaceholder),onClose:na,children:f()}):/*#__PURE__*/_jsx(BottomSheet,{open:N,onClose:na,children:f({className:"p-a-1"})}):/*#__PURE__*/_jsx(Panel,{className:I.className,open:N,flip:!1,altAxis:!0,anchorRef:ba,anchorWidth:fa,position:F?Position.TOP:Position.BOTTOM,onClose:na,children:f({className:"p-a-1"})})]})}Select.propTypes={placeholder:PropTypes.string,id:PropTypes.string,required:PropTypes.bool,disabled:PropTypes.bool,inverse:PropTypes.bool,dropdownRight:PropTypes.oneOf(["xs","sm","md","lg","xl"]),dropdownWidth:PropTypes.oneOf(["sm","md","lg"]),size:PropTypes.oneOf(["sm","md","lg"]),block:PropTypes.bool,selected:PropTypes.shape({value:PropTypes.any.isRequired,label:PropTypes.node,icon:PropTypes.node,currency:PropTypes.string,note:PropTypes.node,secondary:PropTypes.node}),/**
3
+ */var DEFAULT_SELECTED_OPTION=null;function isPlaceholderOption(a){return a===DEFAULT_SELECTED_OPTION||"placeholder"in a}export default function Select(a){function b(){if(null!==U){var a=ka().filter(isActionableOption);0<a.length&&e(a[U])}}function c(a){var b=ka().filter(isActionableOption),c=b.reduce(function(a,b,c){return null===a?k(v,b)?c:null:a},null),d=null===W.current||void 0===W.current?-1:W.current,e=d;null===d&&null===c&&V(0),null===d&&null!==c&&(e=c);var f=e+a,g=Math.max(Math.min(0,b.length-1),f);V(g)}function d(a){return function(b){stopPropagation(b),e(a)}}function e(a){x(isPlaceholderOption(a)?DEFAULT_SELECTED_OPTION:a),ma()}function f(){var a,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=b.className,d=classNames(K("np-dropdown-menu"),(a={},_defineProperty(a,K("np-dropdown-menu-desktop"),!ja),_defineProperty(a,K("np-dropdown-menu-".concat(r)),!ja&&!ea),a),K(c)),e=ka();return/*#__PURE__*/_jsxs("ul",_objectSpread(_objectSpread({ref:ca,id:ha,role:"listbox",tabIndex:"-1",className:d},G),{},{children:[!o&&!da&&null!==m&&/*#__PURE__*/_jsx(h,{}),da&&/*#__PURE__*/_jsx(SearchBox,{ref:_,classNames:E,value:C||Q,placeholder:D||J(messages.searchPlaceholder),onChange:la,onClick:stopPropagation}),e.slice(0,Z).map(na),Z<e.length&&/*#__PURE__*/_jsx(g,{})]}))}function g(){function a(a){stopPropagation(a),$(Z+DEFAULT_OPTIONS_PAGE_SIZE)}return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{className:classNames(K("clickable"),K("border-bottom"),K("show-more")),onClick:a,onKeyPress:a,children:/*#__PURE__*/_jsx("a",{children:"..."})}))}function h(){var a={placeholder:m};return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{className:classNames(K("clickable"),K("border-bottom")),onClick:d(a),onKeyPress:d(a),children:/*#__PURE__*/_jsx("a",{children:m})}))}// eslint-disable-next-line react/prop-types
4
+ function i(a){var b=a.index;return/*#__PURE__*/_jsx("li",{className:K("np-separator"),"aria-hidden":!0},b)}// eslint-disable-next-line react/prop-types
5
+ function j(a){var b=a.index,c=a.children;return/*#__PURE__*/_jsx("li",{className:classNames(K("np-dropdown-header"),K("np-text-title-group")),onClick:stopPropagation,onKeyPress:stopPropagation,children:c},b)}function k(a,b){return(null===a||void 0===a?void 0:a.value)===(null===b||void 0===b?void 0:b.value)}function l(a){return ka().reduce(function(b,c,d){return d<a&&isActionableOption(c)?b+1:b},0)}var m=a.placeholder,n=a.id,o=a.required,p=a.disabled,q=a.inverse,r=a.dropdownWidth,t=a.size,u=a.block,v=a.selected,w=a.search,x=a.onChange,y=a.onFocus,z=a.onBlur,A=a.options,B=a.onSearchChange,C=a.searchValue,D=a.searchPlaceholder,E=a.classNames,F=a.dropdownUp,G=a.dropdownProps,H=a.buttonProps,I=useIntl(),J=I.formatMessage,K=function(a){return E[a]||a},s=useState(!1),L=_slicedToArray(s,2),M=L[0],N=L[1],O=useState(DEFAULT_SEARCH_VALUE),P=_slicedToArray(O,2),Q=P[0],R=P[1],S=useState(null),T=_slicedToArray(S,2),U=T[0],V=T[1],W=useRef(),X=useState(DEFAULT_OPTIONS_PAGE_SIZE),Y=_slicedToArray(X,2),Z=Y[0],$=Y[1],_=useRef(null),aa=useRef(null),ba=useRef(null),ca=useRef(null),da=!!B||!!w,ea=null===r,fa=useMemo(function(){return getSimpleRandomId("np-select-")},[]),ga=n||fa,ha="".concat(ga,"-listbox"),ia=useLayout(),ja=ia.isMobile,ka=function(){return w&&Q?A.filter(function(a){return isActionableOption(a)&&!isPlaceholderOption(a)}).filter(function(a){return"function"==typeof w?w(a,Q):defaultFilterFunction(a,Q)}):A},la=function(a){$(DEFAULT_OPTIONS_PAGE_SIZE),R(a.target.value),B&&B(a.target.value)};useEffect(function(){W.current=U,M&&(!ja||""!==Q)&&(da&&!!_.current&&_.current.focus(),!da&&ca.current&&ca.current.focus())},[M,Q,da,ja,U]);var ma=function(){N(!1),V(null),ba.current&&ba.current.focus()},na=function(a,b){var c,e=a;if(isSparatorOption(e)&&null!==e&&void 0!==e&&e.separator)return/*#__PURE__*/_jsx(i,{index:b});var f=a;if(isHeaderOption(f)&&f.header)return/*#__PURE__*/_jsx(j,{index:b,children:f.header});var g=k(v,a),h=a,m=!h.disabled&&U===l(b),n=classNames(K("np-dropdown-item"),h.disabled?[K("disabled")]:K("clickable"),(c={},_defineProperty(c,K("active"),g),_defineProperty(c,K("np-dropdown-item--focused"),m),c)),o=h.disabled?stopPropagation:d(h);return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{"aria-selected":g,"aria-disabled":a.disabled,role:"option",tabIndex:"-1",className:n,onClick:o,onKeyPress:o,children:/*#__PURE__*/_jsx("a",{disabled:h.disabled,children:/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},h),{},{classNames:E}))})},b))},oa=!!A.length;return M&&(""!==C||""!==Q)&&(oa&&null===U&&V(0),!oa&&null!==U&&V(null)),/*#__PURE__*/_jsxs("div",{// eslint-disable-line jsx-a11y/no-static-element-interactions
6
+ ref:aa,className:classNames(K("np-select"),u?K("btn-block"):null,K("btn-group")),onKeyDown:function handleKeyDown(a){switch(a.keyCode){case KeyCodes.UP:case KeyCodes.DOWN:M?c(a.keyCode===KeyCodes.UP?-1:1):N(!0),stopPropagation(a);break;case KeyCodes.SPACE:a.target!==_.current&&(M?b():N(!0),stopPropagation(a));break;case KeyCodes.ENTER:M?b():N(!0),stopPropagation(a);break;case KeyCodes.ESCAPE:ma(),stopPropagation(a);break;case KeyCodes.TAB:M&&b();break;default:}},onTouchMove:function handleTouchStart(a){a.currentTarget===a.target&&M&&ma()},onFocus:function handleOnFocus(a){y&&y(a)},onBlur:function handleOnBlur(a){var b=a.nativeEvent;if(b){var c=b.relatedTarget,d=a.currentTarget;if(d&&c&&d.contains(c))return}z&&z(a)},children:[/*#__PURE__*/_jsxs(Button,_objectSpread(_objectSpread({ref:ba,id:ga,block:u,size:t,htmlType:"button",className:classNames(K("np-dropdown-toggle"),K("np-text-body-large"),"string"==typeof E&&-1!==E.search("form-control")?K("form-control"):null,q?K("np-dropdown-toggle-navy"):null)// reset Button's styles
7
+ ,type:null,priority:null,disabled:p,role:"combobox","aria-controls":ha,"aria-expanded":M,"aria-autocomplete":"none",onClick:function handleOnClick(){N(!0)}},H),{},{children:[v?/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},v),{},{classNames:E,selected:!0})):/*#__PURE__*/_jsx(Body,{className:K("form-control-placeholder"),children:m}),/*#__PURE__*/_jsx(Chevron// disabled={disabled}
8
+ ,{className:classNames(K("tw-icon"),K("tw-chevron-up-icon"),K("tw-chevron"),K("bottom"),K("np-select-chevron"))})]})),ja?da?/*#__PURE__*/_jsx(Drawer,{open:M,headerTitle:D||J(messages.searchPlaceholder),onClose:ma,children:f()}):/*#__PURE__*/_jsx(BottomSheet,{open:M,onClose:ma,children:f({className:"p-a-1"})}):/*#__PURE__*/_jsx(Panel,{open:M,flip:!1,altAxis:!0,anchorRef:aa,anchorWidth:ea,position:F?Position.TOP:Position.BOTTOM,onClose:ma,children:f({className:"p-a-1"})})]})}Select.propTypes={placeholder:PropTypes.string,id:PropTypes.string,required:PropTypes.bool,disabled:PropTypes.bool,inverse:PropTypes.bool,dropdownRight:PropTypes.oneOf(["xs","sm","md","lg","xl"]),dropdownWidth:PropTypes.oneOf(["sm","md","lg"]),size:PropTypes.oneOf(["sm","md","lg"]),block:PropTypes.bool,selected:PropTypes.shape({value:PropTypes.any.isRequired,label:PropTypes.node,icon:PropTypes.node,currency:PropTypes.string,note:PropTypes.node,secondary:PropTypes.node}),/**
9
9
  * Search toggle
10
10
  * if `true` default search functionality being enabled (not case sensitive search in option labels & currency props)
11
11
  * if `function` you can define your own search function to implement custom search experience. This search function used while filtering the options array. The custom search function takes two parameters. First is the option the second is the keyword.
@@ -1 +1 @@
1
- import{useContext,useMemo}from"react";import{ThemeContext}from"../../../provider/theme/ThemeProvider";import{getThemeClassName,modernThemes}from"../../theme";export var useTheme=function(){var a=useContext(ThemeContext);return{theme:a,isThemeModern:useMemo(function(){return modernThemes.has(a)},[a]),className:useMemo(function(){return getThemeClassName(a)},[a])}};
1
+ import{useContext,useMemo}from"react";import{ThemeContext}from"../../../provider/theme/ThemeProvider";import{modernThemes}from"../../theme";export var useTheme=function(){var a=useContext(ThemeContext);return{theme:a,isThemeModern:useMemo(function(){return modernThemes.has(a)},[a])}};
@@ -1 +1 @@
1
- import classNames from"classnames";import{forwardRef}from"react";import{Position}from"..";import BottomSheet from"../bottomSheet";import{useLayout,useTheme}from"../hooks";import Panel from"../panel";import{jsx as _jsx}from"react/jsx-runtime";var ResponsivePanel=/*#__PURE__*/forwardRef(function(a,b){var c=a.anchorRef,d=a.arrow,e=a.flip,f=a.children,g=a.className,h=void 0===g?void 0:g,i=a.onClose,j=a.open,k=void 0!==j&&j,l=a.position,m=void 0===l?Position.BOTTOM:l,n=useTheme(),o=n.className,p=useLayout(),q=p.isMobile;return q?/*#__PURE__*/_jsx(BottomSheet,{open:k,className:h,onClose:i,children:f},"bottomSheet"):/*#__PURE__*/_jsx(Panel,{ref:b,flip:!(void 0!==e)||e,arrow:void 0!==d&&d,open:k,position:m,anchorRef:c,className:classNames(o,h),onClose:i,children:f},"panel")});export default ResponsivePanel;
1
+ import{forwardRef}from"react";import{Position}from"..";import BottomSheet from"../bottomSheet";import{useLayout}from"../hooks";import Panel from"../panel";import{jsx as _jsx}from"react/jsx-runtime";var ResponsivePanel=/*#__PURE__*/forwardRef(function(a,b){var c=a.anchorRef,d=a.arrow,e=a.flip,f=a.children,g=a.className,h=void 0===g?void 0:g,i=a.onClose,j=a.open,k=void 0!==j&&j,l=a.position,m=void 0===l?Position.BOTTOM:l,n=useLayout(),o=n.isMobile;return o?/*#__PURE__*/_jsx(BottomSheet,{open:k,className:h,onClose:i,children:f},"bottomSheet"):/*#__PURE__*/_jsx(Panel,{ref:b,flip:!(void 0!==e)||e,arrow:void 0!==d&&d,open:k,position:m,anchorRef:c,className:h,onClose:i,children:f},"panel")});export default ResponsivePanel;
@@ -1 +1 @@
1
- import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";export var Theme;(function(a){a.LIGHT="light",a.DARK="dark",a.NAVY="navy",a.PERSONAL="personal"})(Theme||(Theme={}));export var modernThemes=new Set(["personal"]);export var getThemeClassName=function(a){return"np-theme-".concat(a)};
1
+ import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";export var Theme;(function(a){a.LIGHT="light",a.DARK="dark",a.NAVY="navy",a.PERSONAL="personal"})(Theme||(Theme={}));export var modernThemes=new Set(["personal"]);
@@ -1,4 +1,4 @@
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 classNames from"classnames";import ActionButton from"../actionButton/ActionButton";import Button from"../button";import{Typography}from"../common";import{useTheme}from"../common/hooks";import Link from"../link";import Title from"../title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var HeaderAction=function(a){var b=a.action,c=useTheme(),d=c.isThemeModern,e={"aria-label":b["aria-label"]};return"href"in b?/*#__PURE__*/_jsx(Link,_objectSpread(_objectSpread({href:b.href,target:b.target},e),{},{children:b.text})):d?/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({priority:"tertiary",onClick:b.onClick},e),{},{children:b.text})):/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({onClick:b.onClick},e),{},{children:b.text}))};/**
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 classNames from"classnames";import ActionButton from"../actionButton/ActionButton";import Button from"../button";import{Typography}from"../common";import{useTheme}from"../common/hooks";import Link from"../link";import Title from"../title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var HeaderAction=function(a){var b=a.action,c=useTheme(),d=c.isThemeModern,e={"aria-label":b["aria-label"]};return"href"in b?/*#__PURE__*/_jsx(Link,_objectSpread(_objectSpread({href:b.href,target:b.target},e),{},{children:b.text})):d?/*#__PURE__*/_jsx(Button,_objectSpread(_objectSpread({className:"np-header__button",priority:"tertiary",size:"sm",onClick:b.onClick},e),{},{children:b.text})):/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({onClick:b.onClick},e),{},{children:b.text}))};/**
2
2
  *
3
3
  * Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header
4
4
  *
@@ -1 +1 @@
1
- import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"core-js/modules/es.array.concat.js";import classNames from"classnames";import PropTypes from"prop-types";import{Breakpoint}from"../common";import{isServerSide}from"../common/domHelpers";import{useClientWidth}from"../common/hooks";import{LogoType}from"./logoTypes";import{jsx as _jsx}from"react/jsx-runtime";var baseUrl="https://wise.com/public-resources/assets/logos/wise/",logoPaths={WISE:"brand_logo.svg",WISE_BUSINESS:"brand_logo_business.svg",WISE_INVERSE:"brand_logo_inverse.svg",WISE_BUSINESS_INVERSE:"brand_logo_business_inverse.svg",WISE_FLAG:"brand_flag.svg"},Logo=function(a){var b=a.className,c=a.inverse,d=a.type,e=useClientWidth({ref:isServerSide()?void 0:window}),f=_slicedToArray(e,1),g=f[0],h=g<Breakpoint.SMALL,i=h?logoPaths.WISE_FLAG:logoPaths["".concat(d).concat(c?"_INVERSE":"")];return/*#__PURE__*/_jsx("img",{className:classNames("np-logo",b),alt:d===LogoType.WISE?"Wise":"Wise business",src:"".concat(baseUrl).concat(i)})};Logo.propTypes={/** Extra classes applied to Logo */className:PropTypes.string,/** If true, will use dark colours for dark on light theme */inverse:PropTypes.bool,/** What type of logo to display */type:PropTypes.oneOf(["WISE","WISE_BUSINESS"])},Logo.defaultProps={className:void 0,inverse:!1,type:LogoType.WISE};export default Logo;
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.array.concat.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.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";import React from"react";import classNames from"classnames";import PropTypes from"prop-types";import{Breakpoint}from"../common";import{isServerSide}from"../common/domHelpers";import{useClientWidth}from"../common/hooks";import{useTheme}from"../common/hooks";import{LogoType}from"./logoTypes";import{jsx as _jsx}from"react/jsx-runtime";var LogoWiseBusinessInverse=function(a){return/*#__PURE__*/_jsx("svg",_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("path",{d:"M119.48 8.004h-2.403v14.557h2.403V8.004zM37.642 22.561l2.655-14.557h3.508l-2.656 14.557h-3.507zM17.549 8.004h3.407l1.103 10.524 4.459-10.524H29.9l1.178 10.624 4.31-10.624h3.382l-6.164 14.557h-3.858L27.496 12.54l-4.26 10.022h-3.733L17.55 8.004zM2.574 8.004l2.27 3.86-4.043 3.865h6.877l.718-1.684h-3.48l2.177-2.177-1.269-2.18h5.905L6.283 22.562h2.045l6.164-14.557H2.574zM78.501 9.87c-2.685 0-4.946 2.43-4.946 5.455 0 2.968 2.261 5.399 4.946 5.399 2.714 0 4.862-2.431 4.862-5.399 0-3.024-2.148-5.455-4.862-5.455zm0 13.059c-2.148 0-4.013-1.216-5.03-2.714v2.346h-2.319V1.531h2.403v8.678c1.046-1.413 2.855-2.572 4.946-2.572 4.184 0 7.265 3.448 7.265 7.66s-3.081 7.632-7.265 7.632zm21.536-.368h-2.318v-1.583c-.989 1.187-2.459 1.922-4.24 1.922-3.56 0-5.596-2.544-5.596-6.133V8.004h2.374v8.876c0 2.318 1.272 3.844 3.59 3.844 2.148 0 3.788-1.611 3.788-3.788V8.004h2.402v14.557zm8.674.368c-3.534 0-6.106-1.894-6.502-4.975h2.431c.311 1.696 1.979 2.742 4.071 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.534-.509-5.682-1.357-5.682-4.098 0-2.092 1.809-4.325 5.71-4.325 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.345-3.505-2.345-1.922 0-3.307.904-3.307 2.035 0 1.045.82 1.413 3.674 1.865 3.223.509 5.88 1.13 5.88 4.438 0 2.911-2.488 4.749-5.964 4.749zm25.948-.368h-2.374v-8.847c0-2.233-1.244-3.872-3.562-3.872-2.205 0-3.816 1.639-3.816 3.815v8.904h-2.402V8.004h2.317v1.583c.99-1.215 2.488-1.95 4.24-1.95 3.562 0 5.597 2.544 5.597 6.162v8.762zm13.879-8.791c-.594-2.374-2.573-3.957-4.693-3.957-2.006 0-4.126 1.47-4.748 3.957h9.441zm2.317 4.269c-1.017 3.109-3.505 4.861-6.868 4.861-4.184 0-7.462-3.335-7.462-7.603 0-4.212 3.278-7.66 7.32-7.66 3.76 0 7.378 3.109 7.35 8.282h-12.24c.311 3.024 2.629 4.805 5.032 4.805 2.063 0 3.533-.99 4.324-2.685h2.544zm8.394 4.89c-3.533 0-6.106-1.894-6.501-4.975h2.431c.31 1.696 1.978 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.533-.509-5.682-1.357-5.682-4.098 0-2.092 1.809-4.325 5.71-4.325 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.345-3.505-2.345-1.922 0-3.307.904-3.307 2.035 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438 0 2.911-2.487 4.749-5.964 4.749zm13.652 0c-3.533 0-6.105-1.894-6.501-4.975h2.431c.311 1.696 1.979 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.395-1.78-3.957-2.261-3.533-.509-5.681-1.357-5.681-4.098 0-2.092 1.809-4.325 5.71-4.325 3.363 0 5.624 1.696 5.935 4.55h-2.43c-.34-1.554-1.725-2.345-3.505-2.345-1.923 0-3.308.904-3.308 2.035 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438-.001 2.911-2.487 4.749-5.964 4.749zM57.207 13.867c.352-1.804 2.105-3.233 4.21-3.233 1.83 0 3.207 1.329 3.207 3.233h-7.417zm10.9.45c0-3.909-2.73-6.665-6.54-6.665-4.86 0-8.118 3.534-8.118 8.57 0 3.932 2.756 6.664 6.64 6.664 3.533 0 6.163-1.703 7.24-4.435h-3.933c-.526.853-1.628 1.378-2.982 1.378-2.079 0-3.382-1.378-3.508-3.332H67.88a10.08 10.08 0 0 0 .227-2.18zm-25.204 8.219.701-3.758c2.156.425 2.48-.777 3.032-3.709l.275-1.453c.778-4.084 2.355-6.113 6.865-5.562l-.701 3.758c-2.156-.426-2.53 1.202-3.006 3.732l-.276 1.453c-.776 4.135-2.405 6.09-6.89 5.539z",fill:"#163300"})}))};LogoWiseBusinessInverse.defaultProps={width:"180",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var LogoWiseBusiness=function(a){return/*#__PURE__*/_jsx("svg",_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("path",{d:"M119.48 8.004h-2.403v14.557h2.403V8.004zM37.642 22.561l2.655-14.557h3.508l-2.656 14.557h-3.507zM17.549 8.004h3.407l1.103 10.524 4.459-10.524H29.9l1.178 10.624 4.31-10.624h3.382l-6.164 14.557h-3.858L27.496 12.54l-4.26 10.021h-3.733L17.55 8.004zM2.574 8.004l2.27 3.86-4.043 3.865h6.877l.718-1.684h-3.48l2.177-2.177-1.269-2.18h5.905L6.283 22.562h2.045l6.164-14.557H2.574zM78.501 9.87c-2.685 0-4.946 2.43-4.946 5.455 0 2.968 2.261 5.399 4.946 5.399 2.714 0 4.862-2.431 4.862-5.399 0-3.024-2.148-5.455-4.862-5.455zm0 13.059c-2.148 0-4.013-1.216-5.03-2.714v2.346h-2.319V1.531h2.403v8.678c1.046-1.413 2.855-2.572 4.946-2.572 4.184 0 7.265 3.448 7.265 7.66s-3.081 7.632-7.265 7.632zm21.536-.368h-2.318v-1.583c-.989 1.188-2.459 1.922-4.24 1.922-3.56 0-5.596-2.544-5.596-6.133V8.004h2.374v8.876c0 2.318 1.272 3.844 3.59 3.844 2.148 0 3.788-1.611 3.788-3.788V8.004h2.402v14.557zm8.674.368c-3.534 0-6.106-1.894-6.502-4.975h2.431c.311 1.696 1.979 2.742 4.071 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.534-.509-5.682-1.357-5.682-4.099 0-2.091 1.809-4.324 5.71-4.324 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.346-3.505-2.346-1.922 0-3.307.905-3.307 2.036 0 1.045.82 1.413 3.674 1.865 3.223.509 5.88 1.13 5.88 4.438 0 2.911-2.488 4.749-5.964 4.749zm25.948-.368h-2.374v-8.847c0-2.233-1.244-3.873-3.562-3.873-2.205 0-3.816 1.64-3.816 3.816v8.904h-2.402V8.004h2.317v1.583c.99-1.215 2.488-1.95 4.24-1.95 3.562 0 5.597 2.544 5.597 6.162v8.762zm13.879-8.791c-.594-2.374-2.573-3.957-4.693-3.957-2.007 0-4.127 1.47-4.748 3.957h9.441zm2.317 4.269c-1.017 3.109-3.505 4.861-6.868 4.861-4.184 0-7.463-3.335-7.463-7.603 0-4.212 3.279-7.66 7.321-7.66 3.76 0 7.378 3.109 7.35 8.282h-12.24c.311 3.024 2.629 4.805 5.032 4.805 2.063 0 3.533-.99 4.324-2.685h2.544zm8.394 4.89c-3.533 0-6.106-1.894-6.501-4.975h2.431c.31 1.696 1.978 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.533-.509-5.682-1.357-5.682-4.099 0-2.091 1.809-4.324 5.71-4.324 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.346-3.505-2.346-1.922 0-3.307.905-3.307 2.036 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438 0 2.911-2.487 4.749-5.964 4.749zm13.652 0c-3.533 0-6.105-1.894-6.501-4.975h2.431c.311 1.696 1.979 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.395-1.78-3.957-2.261-3.533-.509-5.681-1.357-5.681-4.099 0-2.091 1.809-4.324 5.71-4.324 3.363 0 5.624 1.696 5.935 4.55h-2.43c-.34-1.554-1.725-2.346-3.505-2.346-1.923 0-3.308.905-3.308 2.036 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438-.001 2.911-2.487 4.749-5.964 4.749zM57.207 13.867c.352-1.804 2.105-3.233 4.21-3.233 1.83 0 3.207 1.329 3.207 3.233h-7.417zm10.9.45c0-3.909-2.73-6.665-6.54-6.665-4.86 0-8.118 3.533-8.118 8.57 0 3.932 2.756 6.664 6.64 6.664 3.533 0 6.163-1.703 7.24-4.435h-3.933c-.526.852-1.628 1.378-2.982 1.378-2.079 0-3.382-1.378-3.508-3.332H67.88a10.08 10.08 0 0 0 .227-2.18zm-25.204 8.219.701-3.758c2.156.425 2.48-.777 3.032-3.709l.275-1.453c.778-4.084 2.355-6.114 6.865-5.562l-.701 3.758c-2.156-.426-2.53 1.202-3.006 3.732l-.276 1.453c-.776 4.135-2.405 6.09-6.89 5.539z",fill:"#163300"})}))};LogoWiseBusiness.defaultProps={width:"180",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var LogoWiseInverse=function(a){return/*#__PURE__*/_jsx("svg",_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("path",{d:"M93.669 10.69c0-5.382-3.75-9.167-9.007-9.167-6.692 0-11.177 4.862-11.177 11.805 0 5.418 3.786 9.167 9.132 9.167 4.862 0 8.486-2.35 9.975-6.1h-5.4c-.718 1.167-2.243 1.902-4.108 1.902-2.871 0-4.665-1.902-4.827-4.593h15.107c.197-1.022.305-1.901.305-3.014zm-14.999-.628c.484-2.475 2.889-4.449 5.795-4.449 2.512 0 4.413 1.83 4.413 4.45H78.67zM58.971 22.01l.969-5.166c2.96.592 3.409-1.077 4.18-5.095l.377-1.992c1.076-5.615 3.247-8.414 9.455-7.66l-.97 5.167c-2.96-.592-3.48 1.65-4.143 5.13l-.377 1.992c-1.077 5.687-3.32 8.378-9.49 7.625zm-7.248.019 3.66-20.022h4.826l-3.642 20.022h-4.844zM24.076 2.007h4.683l1.525 14.478L36.42 2.007h4.646L42.7 16.629l5.92-14.622h4.665l-8.486 20.022h-5.31L37.765 8.25 31.9 22.03h-5.131L24.076 2.007zM6.584 7.317l-5.561 5.31h9.454l.987-2.313h-4.79L9.67 7.317 7.93 4.321h8.127l-7.5 17.708h2.817L19.86 2.007H3.463l3.121 5.31z",fill:"#163300"})}))};LogoWiseInverse.defaultProps={width:"95",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var LogoWise=function(a){return/*#__PURE__*/_jsx("svg",_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("path",{d:"M93.668 10.69c0-5.382-3.75-9.167-9.006-9.167-6.692 0-11.177 4.862-11.177 11.805 0 5.418 3.786 9.167 9.132 9.167 4.862 0 8.486-2.35 9.975-6.1h-5.4c-.718 1.167-2.243 1.902-4.109 1.902-2.87 0-4.664-1.902-4.826-4.593h15.106c.198-1.022.305-1.901.305-3.014zm-14.998-.628c.484-2.475 2.888-4.449 5.795-4.449 2.511 0 4.413 1.83 4.413 4.45H78.67zM58.971 22.01l.969-5.166c2.96.592 3.409-1.077 4.18-5.095l.377-1.992c1.076-5.615 3.247-8.414 9.455-7.66l-.97 5.167c-2.96-.592-3.48 1.65-4.143 5.13l-.377 1.992c-1.077 5.687-3.32 8.378-9.49 7.625zm-7.248.019 3.66-20.022h4.826l-3.642 20.022h-4.844zM24.076 2.007h4.683l1.525 14.478L36.42 2.007h4.646L42.7 16.629l5.92-14.622h4.665l-8.486 20.022h-5.31L37.764 8.25 31.9 22.03h-5.132l-2.69-20.022zM6.584 7.317l-5.561 5.31h9.454l.987-2.314h-4.79L9.67 7.317 7.93 4.321h8.127l-7.5 17.708h2.817L19.86 2.007H3.463l3.121 5.31z",fill:"#163300"})}))};LogoWise.defaultProps={width:"95",height:"24",fill:"none",xmlns:"http://www.w3.org/2000/svg"};var baseUrl="https://wise.com/public-resources/assets/logos/wise/",logoPaths={WISE:"brand_logo.svg",WISE_BUSINESS:"brand_logo_business.svg",WISE_INVERSE:"brand_logo_inverse.svg",WISE_BUSINESS_INVERSE:"brand_logo_business_inverse.svg",WISE_FLAG:"brand_flag.svg"},svgPaths={WISE:LogoWise,WISE_BUSINESS:LogoWiseBusiness,WISE_INVERSE:LogoWiseInverse,WISE_BUSINESS_INVERSE:LogoWiseBusinessInverse},Logo=function(a){var b=a.className,c=a.inverse,d=a.type,e=useTheme(),f=e.isThemeModern,g=useClientWidth({ref:isServerSide()?void 0:window}),h=_slicedToArray(g,1),i=h[0],j=i<Breakpoint.SMALL,k=j?logoPaths.WISE_FLAG:logoPaths["".concat(d).concat(c?"_INVERSE":"")],l=svgPaths["".concat(d).concat(c?"_INVERSE":"")];return f?/*#__PURE__*/_jsx(l,{}):/*#__PURE__*/_jsx("img",{className:classNames("np-logo",b),alt:d===LogoType.WISE?"Wise":"Wise business",src:"".concat(baseUrl).concat(k)})};Logo.propTypes={/** Extra classes applied to Logo */className:PropTypes.string,/** If true, will use dark colours for dark on light theme */inverse:PropTypes.bool,/** What type of logo to display */type:PropTypes.oneOf(["WISE","WISE_BUSINESS"])},Logo.defaultProps={className:void 0,inverse:!1,type:LogoType.WISE};export default Logo;
@@ -0,0 +1 @@
1
+ <svg width="180" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M119.48 8.004h-2.403v14.557h2.403V8.004zM37.642 22.561l2.655-14.557h3.508l-2.656 14.557h-3.507zM17.549 8.004h3.407l1.103 10.524 4.459-10.524H29.9l1.178 10.624 4.31-10.624h3.382l-6.164 14.557h-3.858L27.496 12.54l-4.26 10.022h-3.733L17.55 8.004z" fill="#163300"/><path d="M2.574 8.004l2.27 3.86-4.043 3.865h6.877l.718-1.684h-3.48l2.177-2.177-1.269-2.18h5.905L6.283 22.562h2.045l6.164-14.557H2.574z" fill="#163300"/><path d="M78.501 9.87c-2.685 0-4.946 2.43-4.946 5.455 0 2.968 2.261 5.399 4.946 5.399 2.714 0 4.862-2.431 4.862-5.399 0-3.024-2.148-5.455-4.862-5.455zm0 13.059c-2.148 0-4.013-1.216-5.03-2.714v2.346h-2.319V1.531h2.403v8.678c1.046-1.413 2.855-2.572 4.946-2.572 4.184 0 7.265 3.448 7.265 7.66s-3.081 7.632-7.265 7.632zM100.037 22.561h-2.318v-1.583c-.989 1.187-2.459 1.922-4.24 1.922-3.56 0-5.596-2.544-5.596-6.133V8.004h2.374v8.876c0 2.318 1.272 3.844 3.59 3.844 2.148 0 3.788-1.611 3.788-3.788V8.004h2.402v14.557zM108.711 22.929c-3.534 0-6.106-1.894-6.502-4.975h2.431c.311 1.696 1.979 2.742 4.071 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.534-.509-5.682-1.357-5.682-4.098 0-2.092 1.809-4.325 5.71-4.325 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.345-3.505-2.345-1.922 0-3.307.904-3.307 2.035 0 1.045.82 1.413 3.674 1.865 3.223.509 5.88 1.13 5.88 4.438 0 2.911-2.488 4.749-5.964 4.749zM134.659 22.561h-2.374v-8.847c0-2.233-1.244-3.872-3.562-3.872-2.205 0-3.816 1.639-3.816 3.815v8.904h-2.402V8.004h2.317v1.583c.99-1.215 2.488-1.95 4.24-1.95 3.562 0 5.597 2.544 5.597 6.162v8.762zM148.538 13.77c-.594-2.374-2.573-3.957-4.693-3.957-2.006 0-4.126 1.47-4.748 3.957h9.441zm2.317 4.269c-1.017 3.109-3.505 4.861-6.868 4.861-4.184 0-7.462-3.335-7.462-7.603 0-4.212 3.278-7.66 7.32-7.66 3.76 0 7.378 3.109 7.35 8.282h-12.24c.311 3.024 2.629 4.805 5.032 4.805 2.063 0 3.533-.99 4.324-2.685h2.544zM159.249 22.929c-3.533 0-6.106-1.894-6.501-4.975h2.431c.31 1.696 1.978 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.533-.509-5.682-1.357-5.682-4.098 0-2.092 1.809-4.325 5.71-4.325 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.345-3.505-2.345-1.922 0-3.307.904-3.307 2.035 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438 0 2.911-2.487 4.749-5.964 4.749zM172.901 22.929c-3.533 0-6.105-1.894-6.501-4.975h2.431c.311 1.696 1.979 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.395-1.78-3.957-2.261-3.533-.509-5.681-1.357-5.681-4.098 0-2.092 1.809-4.325 5.71-4.325 3.363 0 5.624 1.696 5.935 4.55h-2.43c-.34-1.554-1.725-2.345-3.505-2.345-1.923 0-3.308.904-3.308 2.035 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438-.001 2.911-2.487 4.749-5.964 4.749zM57.207 13.867c.352-1.804 2.105-3.233 4.21-3.233 1.83 0 3.207 1.329 3.207 3.233h-7.417zm10.9.45c0-3.909-2.73-6.665-6.54-6.665-4.86 0-8.118 3.534-8.118 8.57 0 3.932 2.756 6.664 6.64 6.664 3.533 0 6.163-1.703 7.24-4.435h-3.933c-.526.853-1.628 1.378-2.982 1.378-2.079 0-3.382-1.378-3.508-3.332H67.88c.152-.725.227-1.377.227-2.18zM42.903 22.536l.701-3.758c2.156.425 2.48-.777 3.032-3.709l.275-1.453c.778-4.084 2.355-6.113 6.865-5.562l-.701 3.758c-2.156-.426-2.53 1.202-3.006 3.732l-.276 1.453c-.776 4.135-2.405 6.09-6.89 5.539z" fill="#163300"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="180" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M119.48 8.004h-2.403v14.557h2.403V8.004zM37.642 22.561l2.655-14.557h3.508l-2.656 14.557h-3.507zM17.549 8.004h3.407l1.103 10.524 4.459-10.524H29.9l1.178 10.624 4.31-10.624h3.382l-6.164 14.557h-3.858L27.496 12.54l-4.26 10.021h-3.733L17.55 8.004z" fill="#163300"/><path d="M2.574 8.004l2.27 3.86-4.043 3.865h6.877l.718-1.684h-3.48l2.177-2.177-1.269-2.18h5.905L6.283 22.562h2.045l6.164-14.557H2.574z" fill="#163300"/><path d="M78.501 9.87c-2.685 0-4.946 2.43-4.946 5.455 0 2.968 2.261 5.399 4.946 5.399 2.714 0 4.862-2.431 4.862-5.399 0-3.024-2.148-5.455-4.862-5.455zm0 13.059c-2.148 0-4.013-1.216-5.03-2.714v2.346h-2.319V1.531h2.403v8.678c1.046-1.413 2.855-2.572 4.946-2.572 4.184 0 7.265 3.448 7.265 7.66s-3.081 7.632-7.265 7.632zM100.037 22.561h-2.318v-1.583c-.989 1.188-2.459 1.922-4.24 1.922-3.56 0-5.596-2.544-5.596-6.133V8.004h2.374v8.876c0 2.318 1.272 3.844 3.59 3.844 2.148 0 3.788-1.611 3.788-3.788V8.004h2.402v14.557zM108.711 22.929c-3.534 0-6.106-1.894-6.502-4.975h2.431c.311 1.696 1.979 2.742 4.071 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.534-.509-5.682-1.357-5.682-4.099 0-2.091 1.809-4.324 5.71-4.324 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.346-3.505-2.346-1.922 0-3.307.905-3.307 2.036 0 1.045.82 1.413 3.674 1.865 3.223.509 5.88 1.13 5.88 4.438 0 2.911-2.488 4.749-5.964 4.749zM134.659 22.561h-2.374v-8.847c0-2.233-1.244-3.873-3.562-3.873-2.205 0-3.816 1.64-3.816 3.816v8.904h-2.402V8.004h2.317v1.583c.99-1.215 2.488-1.95 4.24-1.95 3.562 0 5.597 2.544 5.597 6.162v8.762zM148.538 13.77c-.594-2.374-2.573-3.957-4.693-3.957-2.007 0-4.127 1.47-4.748 3.957h9.441zm2.317 4.269c-1.017 3.109-3.505 4.861-6.868 4.861-4.184 0-7.463-3.335-7.463-7.603 0-4.212 3.279-7.66 7.321-7.66 3.76 0 7.378 3.109 7.35 8.282h-12.24c.311 3.024 2.629 4.805 5.032 4.805 2.063 0 3.533-.99 4.324-2.685h2.544zM159.249 22.929c-3.533 0-6.106-1.894-6.501-4.975h2.431c.31 1.696 1.978 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.396-1.78-3.957-2.261-3.533-.509-5.682-1.357-5.682-4.099 0-2.091 1.809-4.324 5.71-4.324 3.364 0 5.625 1.696 5.936 4.55h-2.431c-.339-1.554-1.724-2.346-3.505-2.346-1.922 0-3.307.905-3.307 2.036 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438 0 2.911-2.487 4.749-5.964 4.749zM172.901 22.929c-3.533 0-6.105-1.894-6.501-4.975h2.431c.311 1.696 1.979 2.742 4.07 2.742 2.261 0 3.646-1.103 3.646-2.375 0-1.017-.395-1.78-3.957-2.261-3.533-.509-5.681-1.357-5.681-4.099 0-2.091 1.809-4.324 5.71-4.324 3.363 0 5.624 1.696 5.935 4.55h-2.43c-.34-1.554-1.725-2.346-3.505-2.346-1.923 0-3.308.905-3.308 2.036 0 1.045.82 1.413 3.675 1.865 3.222.509 5.879 1.13 5.879 4.438-.001 2.911-2.487 4.749-5.964 4.749zM57.207 13.867c.352-1.804 2.105-3.233 4.21-3.233 1.83 0 3.207 1.329 3.207 3.233h-7.417zm10.9.45c0-3.909-2.73-6.665-6.54-6.665-4.86 0-8.118 3.533-8.118 8.57 0 3.932 2.756 6.664 6.64 6.664 3.533 0 6.163-1.703 7.24-4.435h-3.933c-.526.852-1.628 1.378-2.982 1.378-2.079 0-3.382-1.378-3.508-3.332H67.88c.152-.725.227-1.377.227-2.18zM42.903 22.536l.701-3.758c2.156.425 2.48-.777 3.032-3.709l.275-1.453c.778-4.084 2.355-6.114 6.865-5.562l-.701 3.758c-2.156-.426-2.53 1.202-3.006 3.732l-.276 1.453c-.776 4.135-2.405 6.09-6.89 5.539z" fill="#163300"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="95" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M93.669 10.69c0-5.382-3.75-9.167-9.007-9.167-6.692 0-11.177 4.862-11.177 11.805 0 5.418 3.786 9.167 9.132 9.167 4.862 0 8.486-2.35 9.975-6.1h-5.4c-.718 1.167-2.243 1.902-4.108 1.902-2.871 0-4.665-1.902-4.827-4.593h15.107c.197-1.022.305-1.901.305-3.014zm-14.999-.628c.484-2.475 2.889-4.449 5.795-4.449 2.512 0 4.413 1.83 4.413 4.45H78.67zM58.971 22.01l.969-5.166c2.96.592 3.409-1.077 4.18-5.095l.377-1.992c1.076-5.615 3.247-8.414 9.455-7.66l-.97 5.167c-2.96-.592-3.48 1.65-4.143 5.13l-.377 1.992c-1.077 5.687-3.32 8.378-9.49 7.625zM51.723 22.029l3.66-20.022h4.826l-3.642 20.022h-4.844zM24.076 2.007h4.683l1.525 14.478L36.42 2.007h4.646L42.7 16.629l5.92-14.622h4.665l-8.486 20.022h-5.31L37.765 8.25 31.9 22.03h-5.131L24.076 2.007z" fill="#163300"/><path d="M6.584 7.317l-5.561 5.31h9.454l.987-2.313h-4.79L9.67 7.317 7.93 4.321h8.127l-7.5 17.708h2.817L19.86 2.007H3.463l3.121 5.31z" fill="#163300"/></svg>
@@ -0,0 +1 @@
1
+ <svg width="95" height="24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M93.668 10.69c0-5.382-3.75-9.167-9.006-9.167-6.692 0-11.177 4.862-11.177 11.805 0 5.418 3.786 9.167 9.132 9.167 4.862 0 8.486-2.35 9.975-6.1h-5.4c-.718 1.167-2.243 1.902-4.109 1.902-2.87 0-4.664-1.902-4.826-4.593h15.106c.198-1.022.305-1.901.305-3.014zm-14.998-.628c.484-2.475 2.888-4.449 5.795-4.449 2.511 0 4.413 1.83 4.413 4.45H78.67zM58.971 22.01l.969-5.166c2.96.592 3.409-1.077 4.18-5.095l.377-1.992c1.076-5.615 3.247-8.414 9.455-7.66l-.97 5.167c-2.96-.592-3.48 1.65-4.143 5.13l-.377 1.992c-1.077 5.687-3.32 8.378-9.49 7.625zM51.723 22.029l3.66-20.022h4.826l-3.642 20.022h-4.844zM24.076 2.007h4.683l1.525 14.478L36.42 2.007h4.646L42.7 16.629l5.92-14.622h4.665l-8.486 20.022h-5.31L37.764 8.25 31.9 22.03h-5.132l-2.69-20.022z" fill="#163300"/><path d="M6.584 7.317l-5.561 5.31h9.454l.987-2.314h-4.79L9.67 7.317 7.93 4.321h8.127l-7.5 17.708h2.817L19.86 2.007H3.463l3.121 5.31z" fill="#163300"/></svg>
@@ -1,3 +1,3 @@
1
- import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import React from"react";import{Children,cloneElement,createContext,isValidElement}from"react";import{getThemeClassName,Theme}from"../../common/theme";import{jsx as _jsx}from"react/jsx-runtime";export var ThemeContext=/*#__PURE__*/createContext(Theme.LIGHT);export var ThemeProvider=function(a){var b=a.theme,c=a.children,d=Children.map(c,function(a){var c;if(!/*#__PURE__*/isValidElement(a))return"production"!==process.env.NODE_ENV&&console.warn("[ThemeProvider] Trying to inject `className` to an invalid React element, this will be skipped!"),a;// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
2
- var d=[getThemeClassName(b),null===a||void 0===a||null===(c=a.props)||void 0===c?void 0:c.className].filter(Boolean).join(" ");if(/*#__PURE__*/isValidElement(a))// eslint-disable-next-line @typescript-eslint/no-explicit-any
1
+ import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import React from"react";import{Children,cloneElement,createContext,isValidElement}from"react";import{Theme}from"../../common/theme";import{jsx as _jsx}from"react/jsx-runtime";export var ThemeContext=/*#__PURE__*/createContext(Theme.LIGHT);export var ThemeProvider=function(a){var b=a.theme,c=a.children,d=Children.map(c,function(a){var c;if(!/*#__PURE__*/isValidElement(a))return"production"!==process.env.NODE_ENV&&console.warn("[ThemeProvider] Trying to inject `className` to an invalid React element, this will be skipped!"),a;// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
2
+ var d=["np-theme-".concat(b),null===a||void 0===a||null===(c=a.props)||void 0===c?void 0:c.className].filter(Boolean).join(" ");if(/*#__PURE__*/isValidElement(a))// eslint-disable-next-line @typescript-eslint/no-explicit-any
3
3
  return/*#__PURE__*/cloneElement(a,{className:d})});return/*#__PURE__*/_jsx(ThemeContext.Provider,{value:b,children:d})};
@@ -1,11 +1,11 @@
1
- import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.search.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.array.reduce.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.slice.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.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";import classNames from"classnames";import PropTypes from"prop-types";import{useState,useEffect,useRef,useMemo}from"react";import{useIntl}from"react-intl";import Body from"../body";import Button from"../button";import Chevron from"../chevron";import{Position,getSimpleRandomId}from"../common";import BottomSheet from"../common/bottomSheet";import{stopPropagation}from"../common/domHelpers";import{useLayout,useTheme}from"../common/hooks";import KeyCodes from"../common/keyCodes";import Panel from"../common/panel";import Drawer from"../drawer";import messages from"./Select.messages";import Option from"./option";import SearchBox from"./searchBox";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var DEFAULT_SEARCH_VALUE="",DEFAULT_OPTIONS_PAGE_SIZE=100,includesString=function(a,b){return a.toLowerCase().includes(b.toLowerCase())};function defaultFilterFunction(a,b){if(isPlaceholderOption(a))return!0;var c=a.label,d=a.note,e=a.secondary,f=a.currency,g=a.searchStrings;return!!c&&includesString(c,b)||!!d&&includesString(d,b)||!!e&&includesString(e,b)||!!f&&includesString(f,b)||!!g&&g.some(function(a){return includesString(a,b)})}function isActionableOption(a){return!a.header&&!a.separator&&!a.disabled}function isHeaderOption(a){return null!==a&&"header"in a}function isSparatorOption(a){return null!==a&&"separator"in a}/**
1
+ import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.search.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.array.reduce.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.slice.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.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";import classNames from"classnames";import PropTypes from"prop-types";import{useState,useEffect,useRef,useMemo}from"react";import{useIntl}from"react-intl";import Body from"../body";import Button from"../button";import Chevron from"../chevron";import{Position,getSimpleRandomId}from"../common";import BottomSheet from"../common/bottomSheet";import{stopPropagation}from"../common/domHelpers";import{useLayout}from"../common/hooks";import KeyCodes from"../common/keyCodes";import Panel from"../common/panel";import Drawer from"../drawer";import messages from"./Select.messages";import Option from"./option";import SearchBox from"./searchBox";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var DEFAULT_SEARCH_VALUE="",DEFAULT_OPTIONS_PAGE_SIZE=100,includesString=function(a,b){return a.toLowerCase().includes(b.toLowerCase())};function defaultFilterFunction(a,b){if(isPlaceholderOption(a))return!0;var c=a.label,d=a.note,e=a.secondary,f=a.currency,g=a.searchStrings;return!!c&&includesString(c,b)||!!d&&includesString(d,b)||!!e&&includesString(e,b)||!!f&&includesString(f,b)||!!g&&g.some(function(a){return includesString(a,b)})}function isActionableOption(a){return!a.header&&!a.separator&&!a.disabled}function isHeaderOption(a){return null!==a&&"header"in a}function isSparatorOption(a){return null!==a&&"separator"in a}/**
2
2
  * No option or placeholder option is selected
3
- */var DEFAULT_SELECTED_OPTION=null;function isPlaceholderOption(a){return a===DEFAULT_SELECTED_OPTION||"placeholder"in a}export default function Select(a){function b(){if(null!==V){var a=la().filter(isActionableOption);0<a.length&&e(a[V])}}function c(a){var b=la().filter(isActionableOption),c=b.reduce(function(a,b,c){return null===a?k(v,b)?c:null:a},null),d=null===X.current||void 0===X.current?-1:X.current,e=d;null===d&&null===c&&W(0),null===d&&null!==c&&(e=c);var f=e+a,g=Math.max(Math.min(0,b.length-1),f);W(g)}function d(a){return function(b){stopPropagation(b),e(a)}}function e(a){x(isPlaceholderOption(a)?DEFAULT_SELECTED_OPTION:a),na()}function f(){var a,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=b.className,d=classNames(L("np-dropdown-menu"),(a={},_defineProperty(a,L("np-dropdown-menu-desktop"),!ka),_defineProperty(a,L("np-dropdown-menu-".concat(r)),!ka&&!fa),a),L(c)),e=la();return/*#__PURE__*/_jsxs("ul",_objectSpread(_objectSpread({ref:da,id:ia,role:"listbox",tabIndex:"-1",className:d},G),{},{children:[!o&&!ea&&null!==m&&/*#__PURE__*/_jsx(h,{}),ea&&/*#__PURE__*/_jsx(SearchBox,{ref:aa,classNames:E,value:C||R,placeholder:D||K(messages.searchPlaceholder),onChange:ma,onClick:stopPropagation}),e.slice(0,$).map(oa),$<e.length&&/*#__PURE__*/_jsx(g,{})]}))}function g(){function a(a){stopPropagation(a),_($+DEFAULT_OPTIONS_PAGE_SIZE)}return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{className:classNames(L("clickable"),L("border-bottom"),L("show-more")),onClick:a,onKeyPress:a,children:/*#__PURE__*/_jsx("a",{children:"..."})}))}function h(){var a={placeholder:m};return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{className:classNames(L("clickable"),L("border-bottom")),onClick:d(a),onKeyPress:d(a),children:/*#__PURE__*/_jsx("a",{children:m})}))}// eslint-disable-next-line react/prop-types
4
- function i(a){var b=a.index;return/*#__PURE__*/_jsx("li",{className:L("np-separator"),"aria-hidden":!0},b)}// eslint-disable-next-line react/prop-types
5
- function j(a){var b=a.index,c=a.children;return/*#__PURE__*/_jsx("li",{className:classNames(L("np-dropdown-header"),L("np-text-title-group")),onClick:stopPropagation,onKeyPress:stopPropagation,children:c},b)}function k(a,b){return(null===a||void 0===a?void 0:a.value)===(null===b||void 0===b?void 0:b.value)}function l(a){return la().reduce(function(b,c,d){return d<a&&isActionableOption(c)?b+1:b},0)}var m=a.placeholder,n=a.id,o=a.required,p=a.disabled,q=a.inverse,r=a.dropdownWidth,t=a.size,u=a.block,v=a.selected,w=a.search,x=a.onChange,y=a.onFocus,z=a.onBlur,A=a.options,B=a.onSearchChange,C=a.searchValue,D=a.searchPlaceholder,E=a.classNames,F=a.dropdownUp,G=a.dropdownProps,H=a.buttonProps,I=useTheme(),J=useIntl(),K=J.formatMessage,L=function(a){return E[a]||a},s=useState(!1),M=_slicedToArray(s,2),N=M[0],O=M[1],P=useState(DEFAULT_SEARCH_VALUE),Q=_slicedToArray(P,2),R=Q[0],S=Q[1],T=useState(null),U=_slicedToArray(T,2),V=U[0],W=U[1],X=useRef(),Y=useState(DEFAULT_OPTIONS_PAGE_SIZE),Z=_slicedToArray(Y,2),$=Z[0],_=Z[1],aa=useRef(null),ba=useRef(null),ca=useRef(null),da=useRef(null),ea=!!B||!!w,fa=null===r,ga=useMemo(function(){return getSimpleRandomId("np-select-")},[]),ha=n||ga,ia="".concat(ha,"-listbox"),ja=useLayout(),ka=ja.isMobile,la=function(){return w&&R?A.filter(function(a){return isActionableOption(a)&&!isPlaceholderOption(a)}).filter(function(a){return"function"==typeof w?w(a,R):defaultFilterFunction(a,R)}):A},ma=function(a){_(DEFAULT_OPTIONS_PAGE_SIZE),S(a.target.value),B&&B(a.target.value)};useEffect(function(){X.current=V,N&&(!ka||""!==R)&&(ea&&!!aa.current&&aa.current.focus(),!ea&&da.current&&da.current.focus())},[N,R,ea,ka,V]);var na=function(){O(!1),W(null),ca.current&&ca.current.focus()},oa=function(a,b){var c,e=a;if(isSparatorOption(e)&&null!==e&&void 0!==e&&e.separator)return/*#__PURE__*/_jsx(i,{index:b});var f=a;if(isHeaderOption(f)&&f.header)return/*#__PURE__*/_jsx(j,{index:b,children:f.header});var g=k(v,a),h=a,m=!h.disabled&&V===l(b),n=classNames(L("np-dropdown-item"),h.disabled?[L("disabled")]:L("clickable"),(c={},_defineProperty(c,L("active"),g),_defineProperty(c,L("np-dropdown-item--focused"),m),c)),o=h.disabled?stopPropagation:d(h);return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{"aria-selected":g,"aria-disabled":a.disabled,role:"option",tabIndex:"-1",className:n,onClick:o,onKeyPress:o,children:/*#__PURE__*/_jsx("a",{disabled:h.disabled,children:/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},h),{},{classNames:E}))})},b))},pa=!!A.length;return N&&(""!==C||""!==R)&&(pa&&null===V&&W(0),!pa&&null!==V&&W(null)),/*#__PURE__*/_jsxs("div",{// eslint-disable-line jsx-a11y/no-static-element-interactions
6
- ref:ba,className:classNames(L("np-select"),u?L("btn-block"):null,L("btn-group")),onKeyDown:function handleKeyDown(a){switch(a.keyCode){case KeyCodes.UP:case KeyCodes.DOWN:N?c(a.keyCode===KeyCodes.UP?-1:1):O(!0),stopPropagation(a);break;case KeyCodes.SPACE:a.target!==aa.current&&(N?b():O(!0),stopPropagation(a));break;case KeyCodes.ENTER:N?b():O(!0),stopPropagation(a);break;case KeyCodes.ESCAPE:na(),stopPropagation(a);break;case KeyCodes.TAB:N&&b();break;default:}},onTouchMove:function handleTouchStart(a){a.currentTarget===a.target&&N&&na()},onFocus:function handleOnFocus(a){y&&y(a)},onBlur:function handleOnBlur(a){var b=a.nativeEvent;if(b){var c=b.relatedTarget,d=a.currentTarget;if(d&&c&&d.contains(c))return}z&&z(a)},children:[/*#__PURE__*/_jsxs(Button,_objectSpread(_objectSpread({ref:ca,id:ha,block:u,size:t,htmlType:"button",className:classNames(L("np-dropdown-toggle"),L("np-text-body-large"),"string"==typeof E&&-1!==E.search("form-control")?L("form-control"):null,q?L("np-dropdown-toggle-navy"):null)// reset Button's styles
7
- ,type:null,priority:null,disabled:p,role:"combobox","aria-controls":ia,"aria-expanded":N,"aria-autocomplete":"none",onClick:function handleOnClick(){O(!0)}},H),{},{children:[v?/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},v),{},{classNames:E,selected:!0})):/*#__PURE__*/_jsx(Body,{className:L("form-control-placeholder"),children:m}),/*#__PURE__*/_jsx(Chevron// disabled={disabled}
8
- ,{className:classNames(L("tw-icon"),L("tw-chevron-up-icon"),L("tw-chevron"),L("bottom"),L("np-select-chevron"))})]})),ka?ea?/*#__PURE__*/_jsx(Drawer,{className:I.className,open:N,headerTitle:D||K(messages.searchPlaceholder),onClose:na,children:f()}):/*#__PURE__*/_jsx(BottomSheet,{open:N,onClose:na,children:f({className:"p-a-1"})}):/*#__PURE__*/_jsx(Panel,{className:I.className,open:N,flip:!1,altAxis:!0,anchorRef:ba,anchorWidth:fa,position:F?Position.TOP:Position.BOTTOM,onClose:na,children:f({className:"p-a-1"})})]})}Select.propTypes={placeholder:PropTypes.string,id:PropTypes.string,required:PropTypes.bool,disabled:PropTypes.bool,inverse:PropTypes.bool,dropdownRight:PropTypes.oneOf(["xs","sm","md","lg","xl"]),dropdownWidth:PropTypes.oneOf(["sm","md","lg"]),size:PropTypes.oneOf(["sm","md","lg"]),block:PropTypes.bool,selected:PropTypes.shape({value:PropTypes.any.isRequired,label:PropTypes.node,icon:PropTypes.node,currency:PropTypes.string,note:PropTypes.node,secondary:PropTypes.node}),/**
3
+ */var DEFAULT_SELECTED_OPTION=null;function isPlaceholderOption(a){return a===DEFAULT_SELECTED_OPTION||"placeholder"in a}export default function Select(a){function b(){if(null!==U){var a=ka().filter(isActionableOption);0<a.length&&e(a[U])}}function c(a){var b=ka().filter(isActionableOption),c=b.reduce(function(a,b,c){return null===a?k(v,b)?c:null:a},null),d=null===W.current||void 0===W.current?-1:W.current,e=d;null===d&&null===c&&V(0),null===d&&null!==c&&(e=c);var f=e+a,g=Math.max(Math.min(0,b.length-1),f);V(g)}function d(a){return function(b){stopPropagation(b),e(a)}}function e(a){x(isPlaceholderOption(a)?DEFAULT_SELECTED_OPTION:a),ma()}function f(){var a,b=0<arguments.length&&void 0!==arguments[0]?arguments[0]:{},c=b.className,d=classNames(K("np-dropdown-menu"),(a={},_defineProperty(a,K("np-dropdown-menu-desktop"),!ja),_defineProperty(a,K("np-dropdown-menu-".concat(r)),!ja&&!ea),a),K(c)),e=ka();return/*#__PURE__*/_jsxs("ul",_objectSpread(_objectSpread({ref:ca,id:ha,role:"listbox",tabIndex:"-1",className:d},G),{},{children:[!o&&!da&&null!==m&&/*#__PURE__*/_jsx(h,{}),da&&/*#__PURE__*/_jsx(SearchBox,{ref:_,classNames:E,value:C||Q,placeholder:D||J(messages.searchPlaceholder),onChange:la,onClick:stopPropagation}),e.slice(0,Z).map(na),Z<e.length&&/*#__PURE__*/_jsx(g,{})]}))}function g(){function a(a){stopPropagation(a),$(Z+DEFAULT_OPTIONS_PAGE_SIZE)}return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{className:classNames(K("clickable"),K("border-bottom"),K("show-more")),onClick:a,onKeyPress:a,children:/*#__PURE__*/_jsx("a",{children:"..."})}))}function h(){var a={placeholder:m};return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{className:classNames(K("clickable"),K("border-bottom")),onClick:d(a),onKeyPress:d(a),children:/*#__PURE__*/_jsx("a",{children:m})}))}// eslint-disable-next-line react/prop-types
4
+ function i(a){var b=a.index;return/*#__PURE__*/_jsx("li",{className:K("np-separator"),"aria-hidden":!0},b)}// eslint-disable-next-line react/prop-types
5
+ function j(a){var b=a.index,c=a.children;return/*#__PURE__*/_jsx("li",{className:classNames(K("np-dropdown-header"),K("np-text-title-group")),onClick:stopPropagation,onKeyPress:stopPropagation,children:c},b)}function k(a,b){return(null===a||void 0===a?void 0:a.value)===(null===b||void 0===b?void 0:b.value)}function l(a){return ka().reduce(function(b,c,d){return d<a&&isActionableOption(c)?b+1:b},0)}var m=a.placeholder,n=a.id,o=a.required,p=a.disabled,q=a.inverse,r=a.dropdownWidth,t=a.size,u=a.block,v=a.selected,w=a.search,x=a.onChange,y=a.onFocus,z=a.onBlur,A=a.options,B=a.onSearchChange,C=a.searchValue,D=a.searchPlaceholder,E=a.classNames,F=a.dropdownUp,G=a.dropdownProps,H=a.buttonProps,I=useIntl(),J=I.formatMessage,K=function(a){return E[a]||a},s=useState(!1),L=_slicedToArray(s,2),M=L[0],N=L[1],O=useState(DEFAULT_SEARCH_VALUE),P=_slicedToArray(O,2),Q=P[0],R=P[1],S=useState(null),T=_slicedToArray(S,2),U=T[0],V=T[1],W=useRef(),X=useState(DEFAULT_OPTIONS_PAGE_SIZE),Y=_slicedToArray(X,2),Z=Y[0],$=Y[1],_=useRef(null),aa=useRef(null),ba=useRef(null),ca=useRef(null),da=!!B||!!w,ea=null===r,fa=useMemo(function(){return getSimpleRandomId("np-select-")},[]),ga=n||fa,ha="".concat(ga,"-listbox"),ia=useLayout(),ja=ia.isMobile,ka=function(){return w&&Q?A.filter(function(a){return isActionableOption(a)&&!isPlaceholderOption(a)}).filter(function(a){return"function"==typeof w?w(a,Q):defaultFilterFunction(a,Q)}):A},la=function(a){$(DEFAULT_OPTIONS_PAGE_SIZE),R(a.target.value),B&&B(a.target.value)};useEffect(function(){W.current=U,M&&(!ja||""!==Q)&&(da&&!!_.current&&_.current.focus(),!da&&ca.current&&ca.current.focus())},[M,Q,da,ja,U]);var ma=function(){N(!1),V(null),ba.current&&ba.current.focus()},na=function(a,b){var c,e=a;if(isSparatorOption(e)&&null!==e&&void 0!==e&&e.separator)return/*#__PURE__*/_jsx(i,{index:b});var f=a;if(isHeaderOption(f)&&f.header)return/*#__PURE__*/_jsx(j,{index:b,children:f.header});var g=k(v,a),h=a,m=!h.disabled&&U===l(b),n=classNames(K("np-dropdown-item"),h.disabled?[K("disabled")]:K("clickable"),(c={},_defineProperty(c,K("active"),g),_defineProperty(c,K("np-dropdown-item--focused"),m),c)),o=h.disabled?stopPropagation:d(h);return/*#__PURE__*/ (/* eslint-disable-next-line jsx-a11y/no-noninteractive-element-interactions */_jsx("li",{"aria-selected":g,"aria-disabled":a.disabled,role:"option",tabIndex:"-1",className:n,onClick:o,onKeyPress:o,children:/*#__PURE__*/_jsx("a",{disabled:h.disabled,children:/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},h),{},{classNames:E}))})},b))},oa=!!A.length;return M&&(""!==C||""!==Q)&&(oa&&null===U&&V(0),!oa&&null!==U&&V(null)),/*#__PURE__*/_jsxs("div",{// eslint-disable-line jsx-a11y/no-static-element-interactions
6
+ ref:aa,className:classNames(K("np-select"),u?K("btn-block"):null,K("btn-group")),onKeyDown:function handleKeyDown(a){switch(a.keyCode){case KeyCodes.UP:case KeyCodes.DOWN:M?c(a.keyCode===KeyCodes.UP?-1:1):N(!0),stopPropagation(a);break;case KeyCodes.SPACE:a.target!==_.current&&(M?b():N(!0),stopPropagation(a));break;case KeyCodes.ENTER:M?b():N(!0),stopPropagation(a);break;case KeyCodes.ESCAPE:ma(),stopPropagation(a);break;case KeyCodes.TAB:M&&b();break;default:}},onTouchMove:function handleTouchStart(a){a.currentTarget===a.target&&M&&ma()},onFocus:function handleOnFocus(a){y&&y(a)},onBlur:function handleOnBlur(a){var b=a.nativeEvent;if(b){var c=b.relatedTarget,d=a.currentTarget;if(d&&c&&d.contains(c))return}z&&z(a)},children:[/*#__PURE__*/_jsxs(Button,_objectSpread(_objectSpread({ref:ba,id:ga,block:u,size:t,htmlType:"button",className:classNames(K("np-dropdown-toggle"),K("np-text-body-large"),"string"==typeof E&&-1!==E.search("form-control")?K("form-control"):null,q?K("np-dropdown-toggle-navy"):null)// reset Button's styles
7
+ ,type:null,priority:null,disabled:p,role:"combobox","aria-controls":ha,"aria-expanded":M,"aria-autocomplete":"none",onClick:function handleOnClick(){N(!0)}},H),{},{children:[v?/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},v),{},{classNames:E,selected:!0})):/*#__PURE__*/_jsx(Body,{className:K("form-control-placeholder"),children:m}),/*#__PURE__*/_jsx(Chevron// disabled={disabled}
8
+ ,{className:classNames(K("tw-icon"),K("tw-chevron-up-icon"),K("tw-chevron"),K("bottom"),K("np-select-chevron"))})]})),ja?da?/*#__PURE__*/_jsx(Drawer,{open:M,headerTitle:D||J(messages.searchPlaceholder),onClose:ma,children:f()}):/*#__PURE__*/_jsx(BottomSheet,{open:M,onClose:ma,children:f({className:"p-a-1"})}):/*#__PURE__*/_jsx(Panel,{open:M,flip:!1,altAxis:!0,anchorRef:aa,anchorWidth:ea,position:F?Position.TOP:Position.BOTTOM,onClose:ma,children:f({className:"p-a-1"})})]})}Select.propTypes={placeholder:PropTypes.string,id:PropTypes.string,required:PropTypes.bool,disabled:PropTypes.bool,inverse:PropTypes.bool,dropdownRight:PropTypes.oneOf(["xs","sm","md","lg","xl"]),dropdownWidth:PropTypes.oneOf(["sm","md","lg"]),size:PropTypes.oneOf(["sm","md","lg"]),block:PropTypes.bool,selected:PropTypes.shape({value:PropTypes.any.isRequired,label:PropTypes.node,icon:PropTypes.node,currency:PropTypes.string,note:PropTypes.node,secondary:PropTypes.node}),/**
9
9
  * Search toggle
10
10
  * if `true` default search functionality being enabled (not case sensitive search in option labels & currency props)
11
11
  * if `function` you can define your own search function to implement custom search experience. This search function used while filtering the options array. The custom search function takes two parameters. First is the option the second is the keyword.