@transferwise/components 41.4.1-next-aecbc402ee.6 → 41.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/build/es/no-polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
- package/build/es/no-polyfill/alert/Alert.js +1 -1
- package/build/es/no-polyfill/checkbox/Checkbox.js +1 -1
- package/build/es/no-polyfill/chips/Chip.js +1 -1
- package/build/es/no-polyfill/common/bottomSheet/BottomSheet.js +2 -2
- package/build/es/no-polyfill/common/closeButton/CloseButton.js +1 -1
- package/build/es/no-polyfill/common/hocs/theme/withTheme.js +1 -1
- package/build/es/no-polyfill/common/hooks/useTheme/useTheme.js +1 -1
- package/build/es/no-polyfill/common/hooks/useTheme/useTheme.spec.js +1 -1
- package/build/es/no-polyfill/common/theme.js +1 -1
- package/build/es/no-polyfill/definitionList/DefinitionList.js +1 -1
- package/build/es/no-polyfill/drawer/Drawer.js +1 -1
- package/build/es/no-polyfill/header/Header.js +1 -1
- package/build/es/no-polyfill/i18n/es.json +1 -1
- package/build/es/no-polyfill/i18n/pl.json +1 -0
- package/build/es/no-polyfill/index.js +1 -1
- package/build/es/no-polyfill/instructionsList/InstructionsList.js +3 -3
- package/build/es/no-polyfill/provider/theme/ThemeProvider.js +2 -3
- package/build/es/no-polyfill/radio/Radio.js +1 -1
- package/build/es/no-polyfill/stepper/Stepper.js +1 -1
- package/build/es/polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
- package/build/es/polyfill/alert/Alert.js +1 -1
- package/build/es/polyfill/checkbox/Checkbox.js +1 -1
- package/build/es/polyfill/chips/Chip.js +1 -1
- package/build/es/polyfill/common/bottomSheet/BottomSheet.js +2 -2
- package/build/es/polyfill/common/closeButton/CloseButton.js +1 -1
- package/build/es/polyfill/common/hocs/theme/withTheme.js +1 -1
- package/build/es/polyfill/common/hooks/useTheme/useTheme.js +1 -1
- package/build/es/polyfill/common/hooks/useTheme/useTheme.spec.js +1 -1
- package/build/es/polyfill/common/theme.js +1 -1
- package/build/es/polyfill/definitionList/DefinitionList.js +1 -1
- package/build/es/polyfill/drawer/Drawer.js +1 -1
- package/build/es/polyfill/header/Header.js +1 -1
- package/build/es/polyfill/i18n/es.json +1 -1
- package/build/es/polyfill/i18n/pl.json +1 -0
- package/build/es/polyfill/index.js +1 -1
- package/build/es/polyfill/instructionsList/InstructionsList.js +3 -3
- package/build/es/polyfill/provider/theme/ThemeProvider.js +2 -3
- package/build/es/polyfill/radio/Radio.js +1 -1
- package/build/es/polyfill/stepper/Stepper.js +1 -1
- package/build/i18n/es.json +1 -1
- package/build/i18n/pl.json +1 -0
- package/build/main.css +1 -1
- package/build/styles/accordion/Accordion.css +1 -1
- package/build/styles/actionButton/ActionButton.css +1 -1
- package/build/styles/avatar/Avatar.css +1 -1
- package/build/styles/card/Card.css +1 -1
- package/build/styles/chips/Chip.css +1 -1
- package/build/styles/circularButton/CircularButton.css +1 -1
- package/build/styles/common/bottomSheet/BottomSheet.css +1 -1
- package/build/styles/common/panel/Panel.css +1 -1
- package/build/styles/definitionList/DefinitionList.css +1 -1
- package/build/styles/emphasis/Emphasis.css +1 -1
- package/build/styles/info/Info.css +1 -1
- package/build/styles/instructionsList/InstructionsList.css +1 -1
- package/build/styles/lab/mobileNav/MobileNav.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/navigationOption/NavigationOption.css +1 -1
- package/build/styles/nudge/Nudge.css +1 -1
- package/build/styles/progress/Progress.css +1 -1
- package/build/styles/select/Select.css +1 -1
- package/build/styles/stepper/Stepper.css +1 -1
- package/build/styles/tile/Tile.css +1 -1
- package/build/styles/uploadInput/UploadInput.css +1 -1
- package/build/styles/uploadInput/uploadItem/UploadItem.css +1 -1
- package/build/types/accordion/AccordionItem/AccordionItem.d.ts +1 -1
- package/build/types/common/hocs/theme/withTheme.d.ts +2 -2
- package/build/types/common/hooks/useTheme/useTheme.d.ts +1 -4
- package/build/types/common/theme.d.ts +2 -5
- package/build/types/definitionList/DefinitionList.d.ts +4 -0
- package/build/types/index.d.ts +1 -1
- package/build/types/provider/theme/ThemeProvider.d.ts +1 -2
- package/build/types/withNextPortal/withNextPortal.d.ts +2 -2
- package/build/umd/no-polyfill/main.js +1 -1
- package/build/umd/polyfill/main.js +1 -1
- package/package.json +6 -15
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,25 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [41.5.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.4.1...@transferwise/components@41.5.0) (2022-10-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* Add optional ActionButton to DefinitionList ([#1594](https://github.com/transferwise/neptune-web/issues/1594)) ([e26185e](https://github.com/transferwise/neptune-web/commit/e26185e0aef770c3cfa2201a0c0ce5a71b3ed8ca))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [41.4.1](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.4.0...@transferwise/components@41.4.1) (2022-10-04)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @transferwise/components
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
6
25
|
# [41.4.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.3.2...@transferwise/components@41.4.0) (2022-09-30)
|
|
7
26
|
|
|
8
27
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Chevron from"../../chevron";import{Position,
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Chevron from"../../chevron";import{Position,Theme}from"../../common";import Option from"../../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function(a){var b=a["aria-label"],c=a.id,d=a.title,e=a.content,f=a.onClick,g=a.open,h=a.icon,i=a.theme,j=h?/*#__PURE__*/cloneElement(h,{size:24}):null;return/*#__PURE__*/_jsxs("div",{id:c,className:classNames("np-accordion-item","np-accordion-item--".concat(i),{"np-accordion-item--open":g}),children:[/*#__PURE__*/_jsx(Option,{"aria-label":b,as:"button",media:j,title:d,button:/*#__PURE__*/_jsx(Chevron,{orientation:g?Position.TOP:Position.DOWN}),inverseMediaCircle:!1,onClick:f}),g&&/*#__PURE__*/_jsx("div",{className:classNames("np-accordion-item__content",{"has-icon":h}),children:e})]})};AccordionItem.propTypes={"aria-label":PropTypes.string,content:PropTypes.node.isRequired,icon:PropTypes.node,id:PropTypes.string,open:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired,title:PropTypes.node.isRequired,theme:PropTypes.oneOf(["light","dark"])},AccordionItem.defaultProps={"aria-label":void 0,icon:null,id:null,theme:Theme.LIGHT};export default AccordionItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_iconTypeMap,_deprecatedTypeMapMes;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{InfoCircle,Warning as AlertIcon,
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_iconTypeMap,_deprecatedTypeMapMes;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{InfoCircle,CheckCircle,Warning as AlertIcon,AlertCircle}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement,useState,useRef}from"react";import requiredIf from"react-required-if";import{Sentiment}from"../common";import CloseButton from"../common/closeButton";import{logActionRequiredIf,deprecated}from"../utilities";import InlineMarkdown from"./inlineMarkdown";import withArrow from"./withArrow";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var deprecatedTypeMap=(_deprecatedTypeMap={},_defineProperty(_deprecatedTypeMap,Sentiment.SUCCESS,Sentiment.POSITIVE),_defineProperty(_deprecatedTypeMap,Sentiment.INFO,Sentiment.NEUTRAL),_defineProperty(_deprecatedTypeMap,Sentiment.ERROR,Sentiment.NEGATIVE),_deprecatedTypeMap),iconTypeMap=(_iconTypeMap={},_defineProperty(_iconTypeMap,Sentiment.POSITIVE,CheckCircle),_defineProperty(_iconTypeMap,Sentiment.NEUTRAL,InfoCircle),_defineProperty(_iconTypeMap,Sentiment.WARNING,AlertIcon),_defineProperty(_iconTypeMap,Sentiment.NEGATIVE,AlertCircle),_iconTypeMap),Alert=function(a){var b=useState(!1),c=_slicedToArray(b,2),d=c[0],e=c[1],f=a.arrow,g=a.action,h=a.children,i=a.className,j=a.icon,k=a.onDismiss,l=a.message,m=a.type,n=useRef(null);if(f){var r=withArrow(Alert,f);return/*#__PURE__*/_jsx(r,_objectSpread({},a))}logActionRequired(a);var o=deprecatedTypeMap[m]||m,p=iconTypeMap[o],q=j?/*#__PURE__*/cloneElement(j,{size:24}):/*#__PURE__*/_jsx(p,{size:24});return/*#__PURE__*/_jsxs("div",{role:"alert",className:classNames("alert d-flex","alert-".concat(o),i),onTouchStart:function handleTouchStart(){return e(!0)},onTouchEnd:function handleTouchEnd(a){d&&g&&null!==n&&void 0!==n&&n.current&&!n.current.contains(a.target)&&("_blank"===(null===g||void 0===g?void 0:g.target)?window.top.open(g.href):window.top.location.assign(g.href)),e(!1)},onTouchMove:function handleTouchMove(){return e(!1)},children:[q,/*#__PURE__*/_jsxs("div",{className:"alert__message flex-grow-1 p-l-2",children:[/*#__PURE__*/_jsx("div",{children:h||/*#__PURE__*/_jsx(InlineMarkdown,{children:l})}),g&&/*#__PURE__*/_jsx("a",{href:g.href,className:"m-t-1 d-inline-block","aria-label":g["aria-label"],target:g.target,children:g.text})]}),k&&/*#__PURE__*/_jsx(CloseButton,{ref:n,size:16,className:"m-l-2",onClick:k})]})},deprecatedTypeMapMessage=(_deprecatedTypeMapMes={},_defineProperty(_deprecatedTypeMapMes,Sentiment.SUCCESS,"Sentiment.POSITIVE"),_defineProperty(_deprecatedTypeMapMes,Sentiment.INFO,"Sentiment.NEUTRAL"),_defineProperty(_deprecatedTypeMapMes,Sentiment.ERROR,"Sentiment.NEGATIVE"),_deprecatedTypeMapMes),deprecatedTypes=Object.keys(deprecatedTypeMap);function logActionRequired(a){var b=a.size,c=a.type;logActionRequiredIf("Alert no longer supports any possible variations in size. Please remove the `size` prop.",!!b),logActionRequiredIf("Alert has deprecated the ".concat(c," value for the `type` prop. Please update to ").concat(deprecatedTypeMapMessage[c],"."),deprecatedTypes.includes(c))}Alert.propTypes={/** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */action:PropTypes.shape({"aria-label":PropTypes.string,href:PropTypes.string.isRequired,target:PropTypes.string,text:PropTypes.node.isRequired}),className:PropTypes.string,/** An optional icon. If not provided, we will default the icon to something appropriate for the type */icon:PropTypes.element,/** The main body of the alert. Accepts plain text and bold words specified with **double stars*/message:requiredIf(PropTypes.node,function(a){var b=a.children;return!b}),/** The presence of the onDismiss handler will trigger the visibility of the close button */onDismiss:PropTypes.func,/** The type dictates which icon and colour will be used */type:PropTypes.oneOf(["negative","neutral","positive","warning","info","error","success"]),/** @deprecated no arrow for `Alert` component anymore, consider to use [`InlineAlert`](https://transferwise.github.io/neptune-web/components/alerts/InlineAlert) component */arrow:deprecated(PropTypes.oneOf(["up-left","up-center","up-right","down-left","down-center","down-right"]),{component:"Alert",expiryDate:new Date("03-01-2021")}),/** @deprecated use `message` property instead */children:deprecated(requiredIf(PropTypes.node,function(a){var b=a.message;return!b}),{component:"Alert",message:"You should now use the `message` prop. Be aware `message` only accepts plain text or text with **bold** markdown.",expiryDate:new Date("03-01-2021")}),/** @deprecated use `onDismiss` instead */dismissible:deprecated(PropTypes.bool,{component:"Alert",message:"The Alert will now be considered dismissible if an `onDismiss` hander is present.",expiryDate:new Date("03-01-2021")})},Alert.defaultProps={action:void 0,arrow:void 0,className:void 0,dismissible:void 0,icon:void 0,type:Sentiment.NEUTRAL};export default Alert;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import CheckboxButton from"../checkboxButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Checkbox=function(a){var b=a.id,c=a.checked,d=a.required,e=a.disabled,f=a.readOnly,g=a.label,h=a.className,i=a.secondary,j=a.onChange,k=a.onFocus,l=a.onBlur,m=d&&!e&&!f&&!c,n=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":i,"has-error":m},h);return/*#__PURE__*/_jsx("div",{id:b,className:n,children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:e}),children:[/*#__PURE__*/_jsx(CheckboxButton,{className:classNames("p-r-
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import CheckboxButton from"../checkboxButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Checkbox=function(a){var b=a.id,c=a.checked,d=a.required,e=a.disabled,f=a.readOnly,g=a.label,h=a.className,i=a.secondary,j=a.onChange,k=a.onFocus,l=a.onBlur,m=d&&!e&&!f&&!c,n=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":i,"has-error":m},h);return/*#__PURE__*/_jsx("div",{id:b,className:n,children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:e}),children:[/*#__PURE__*/_jsx(CheckboxButton,{className:classNames("p-r-2",{"has-error":m}),checked:c,disabled:e||f,onFocus:k,onChange:function onChange(){return j(!c)},onBlur:l}),/*#__PURE__*/_jsxs("span",{className:"np-checkbox__text",children:[g,d&&"*",i&&/*#__PURE__*/_jsx("small",{children:i})]})]})})};Checkbox.propTypes={id:PropTypes.string,checked:PropTypes.bool,required:PropTypes.bool,disabled:PropTypes.bool,readOnly:PropTypes.bool,label:PropTypes.node.isRequired,secondary:PropTypes.string,onFocus:PropTypes.func,onChange:PropTypes.func.isRequired,onBlur:PropTypes.func,className:PropTypes.string},Checkbox.defaultProps={id:null,checked:!1,required:!1,disabled:!1,readOnly:!1,secondary:null,onFocus:null,onBlur:null,className:void 0};export default Checkbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import CloseButton from"../common/closeButton/CloseButton";import{
|
|
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 CloseButton from"../common/closeButton/CloseButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Chip=function(a){var b=a.label,c=a.value,d=a.onRemove,e=a.onClick,f=a.onKeyPress,g=a.className,h=void 0===g?void 0:g,i=a["aria-label"],j=a["aria-checked"],k=a.role,l=a.closeButton,m=e||f,n=m?"button":void 0,o=m?0:-1;return/*#__PURE__*/_jsxs("div",_objectSpread(_objectSpread({role:null!==k&&void 0!==k?k:n,tabIndex:o,"aria-label":i,"aria-checked":j,className:classNames("np-chip","d-flex","align-items-center","justify-content-between",h)},m&&{onClick:e,onKeyPress:f}),{},{children:[/*#__PURE__*/_jsx("span",{"aria-hidden":!!d,className:"np-chip-label",children:b}),d?/*#__PURE__*/_jsx(CloseButton/* @ts-expect-error remove when CloseButton will be written on TS */,{className:"btn-unstyled m-l-1","aria-label":l&&l["aria-label"],size:16,onClick:d}):null]}),c)};export default Chip;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import classNames from"classnames";import{useRef,useState}from"react";import Dimmer from"../../dimmer";import SlidingPanel from"../../slidingPanel";import CloseButton from"../closeButton";import{isServerSide}from"../domHelpers";import{useConditionalListener
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import classNames from"classnames";import{useRef,useState}from"react";import Dimmer from"../../dimmer";import SlidingPanel from"../../slidingPanel";import CloseButton from"../closeButton";import{isServerSide}from"../domHelpers";import{useConditionalListener}from"../hooks";import{Position}from"../propsValues/position";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var INITIAL_Y_POSITION=0,CONTENT_SCROLL_THRESHOLD=1,MOVE_OFFSET_THRESHOLD=50,BottomSheet=function(a){function b(a){null!==g.current&&(g.current.style.transform="translateY(".concat(a,"px)"))}function c(b){m(!1),o.current=INITIAL_Y_POSITION,null!==g.current&&g.current.style.removeProperty("transform"),a.onClose&&a.onClose(b)}function d(a){// stop moving component
|
|
2
2
|
cancelAnimationFrame(n.current),m(!1),o.current>MOVE_OFFSET_THRESHOLD&&e()?c(a):b(INITIAL_Y_POSITION),o.current=INITIAL_Y_POSITION}function e(){var a;return(null===i||void 0===i||null===(a=i.current)||void 0===a?void 0:a.scrollTop)!==void 0&&i.current.scrollTop<=CONTENT_SCROLL_THRESHOLD}/**
|
|
3
3
|
* Calculates how hard user moves component,
|
|
4
4
|
* result value used to determine whether to hide component or re-position to default state
|
|
@@ -7,4 +7,4 @@ cancelAnimationFrame(n.current),m(!1),o.current>MOVE_OFFSET_THRESHOLD&&e()?c(a):
|
|
|
7
7
|
*/function f(a){return a-p.current}/**
|
|
8
8
|
* Set `max-height` for content part (in order to keep it scrollable for content overflow cases) of the component
|
|
9
9
|
* and ensures space for safe zone (32px) at the top.
|
|
10
|
-
*/var g=useRef(null),h=useRef(null),i=useRef(null),j=useState(!1),k=_slicedToArray(j,2),l=k[0],m=k[1],n=useRef(0),o=useRef(0),p=useRef(0);useConditionalListener({attachListener:a.open&&!isServerSide(),callback:function callback(){if(null!==h.current){var a=h.current.classList;e()?a.remove("np-bottom-sheet--top-bar--shadow"):a.add("np-bottom-sheet--top-bar--shadow")}},eventType:"scroll",parent:isServerSide()?void 0:document});var q=function(a){return function(b){p.current=(a?b.touches[0]:b).clientY,m(!0)}},r=function(a){return function(c){if(l){var d=a?c.touches[0]:c,h=d.clientY,i=f(h);i>INITIAL_Y_POSITION&&e()&&(o.current=i,n.current=requestAnimationFrame(function(){n.current!==void 0&&null!==g.current&&b(i)}))}}}
|
|
10
|
+
*/var g=useRef(null),h=useRef(null),i=useRef(null),j=useState(!1),k=_slicedToArray(j,2),l=k[0],m=k[1],n=useRef(0),o=useRef(0),p=useRef(0);useConditionalListener({attachListener:a.open&&!isServerSide(),callback:function callback(){if(null!==h.current){var a=h.current.classList;e()?a.remove("np-bottom-sheet--top-bar--shadow"):a.add("np-bottom-sheet--top-bar--shadow")}},eventType:"scroll",parent:isServerSide()?void 0:document});var q=function(a){return function(b){p.current=(a?b.touches[0]:b).clientY,m(!0)}},r=function(a){return function(c){if(l){var d=a?c.touches[0]:c,h=d.clientY,i=f(h);i>INITIAL_Y_POSITION&&e()&&(o.current=i,n.current=requestAnimationFrame(function(){n.current!==void 0&&null!==g.current&&b(i)}))}}};return/*#__PURE__*/_jsx(Dimmer,{open:a.open,fadeContentOnEnter:!0,fadeContentOnExit:!0,onClose:c,children:/*#__PURE__*/_jsxs(SlidingPanel,{ref:g,open:a.open,position:Position.BOTTOM,className:classNames("np-bottom-sheet",a.className),role:"dialog",onTouchStart:q(!0),onTouchMove:r(!0),onTouchEnd:d,onMouseDown:q(!1),onMouseMove:r(!1),onMouseUp:d,children:[/*#__PURE__*/_jsxs("div",{ref:h,className:"np-bottom-sheet--top-bar",children:[/*#__PURE__*/_jsx("div",{className:"np-bottom-sheet--handler"}),/*#__PURE__*/_jsx(CloseButton,{size:16,className:"sr-only np-bottom-sheet--close-btn",onClick:c})]}),/*#__PURE__*/_jsx("div",{ref:i,style:function(){var a=isServerSide()?0:window.innerHeight,b="".concat(100*(.01*a),"px");return{maxHeight:"calc(".concat(b," - ").concat("64px"," - ").concat("32px",")")}}(),className:"np-bottom-sheet--content",children:a.children})]})})};export default BottomSheet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Cross
|
|
1
|
+
import{Cross as CrossIcon}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import{useIntl}from"react-intl";import messages from"./CloseButton.messages";import{jsx as _jsx}from"react/jsx-runtime";export var CloseButton=/*#__PURE__*/forwardRef(function(a,b){var c=useIntl(),d=a.onClick,e=a.size,f=a.className,g=a["aria-label"]||c.formatMessage(messages.ariaLabel);return/*#__PURE__*/_jsx("button",{ref:b,type:"button",className:classNames("np-close-button","close btn-link","text-no-decoration",{"np-close-button--large":e===CloseButton.Size.LARGE},f),"aria-label":g,onClick:d,children:/*#__PURE__*/_jsx(CrossIcon,{size:e})})});CloseButton.Size={SMALL:16,LARGE:24},CloseButton.propTypes={onClick:PropTypes.func.isRequired,className:PropTypes.string,size:PropTypes.oneOf(Object.values(CloseButton.Size)),"aria-label":PropTypes.string},CloseButton.defaultProps={className:null,size:CloseButton.Size.LARGE,"aria-label":void 0};export default CloseButton;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import _defineProperty from"@babel/runtime/helpers/defineProperty";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{useTheme}from"../../hooks";// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
|
-
import{jsx as _jsx}from"react/jsx-runtime";function getDisplayName(a){return a.displayName||a.name||"Component"}export function withTheme(a){var b=function(b){var c=useTheme()
|
|
2
|
+
import{jsx as _jsx}from"react/jsx-runtime";function getDisplayName(a){return a.displayName||a.name||"Component"}export function withTheme(a){var b=function(b){var c=useTheme();return/*#__PURE__*/_jsx(a,_objectSpread({theme:c},b))};return b.displayName="withTheme(".concat(getDisplayName(a),")"),b.WrappedComponent=a,b}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useContext
|
|
1
|
+
import{useContext}from"react";import{ThemeContext}from"../../../provider/theme/ThemeProvider";export var useTheme=function(){return useContext(ThemeContext)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{renderHook}from"@testing-library/react-hooks";import{Theme}from"../../../common/theme";import{ThemeProvider}from"../../../provider";import{useTheme}from"./useTheme";describe("useTheme",function(){it("returns default light theme",function(){var a=renderHook(function(){return useTheme()}),b=a.result.current;expect(b
|
|
1
|
+
import{renderHook}from"@testing-library/react-hooks";import{Theme}from"../../../common/theme";import{ThemeProvider}from"../../../provider";import{useTheme}from"./useTheme";describe("useTheme",function(){it("returns default light theme",function(){var a=renderHook(function(){return useTheme()}),b=a.result.current;expect(b).toStrictEqual(Theme.LIGHT)}),it("returns provided theme",function(){var a=renderHook(function(){return useTheme()},{wrapper:ThemeProvider,initialProps:{theme:Theme.NAVY}}),b=a.result.current;expect(b).toStrictEqual(Theme.NAVY)})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export var Theme;(function(a){a.LIGHT="light",a.DARK="dark",a.NAVY="navy"
|
|
1
|
+
export var Theme;(function(a){a.LIGHT="light",a.DARK="dark",a.NAVY="navy"})(Theme||(Theme={}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import classNames from"classnames";import PropTypes from"prop-types";import ActionButton from"../actionButton";import{Layout}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var isLayoutHorizontal=function(a){return[Layout.HORIZONTAL_LEFT_ALIGNED,Layout.HORIZONTAL_RIGHT_ALIGNED,Layout.HORIZONTAL_JUSTIFIED].includes(a)},getAlignmentClasses=function(a,b){var c=["d-flex"];return b&&(isLayoutHorizontal(a)?c.push("align-items-center"):c.push("align-items-start")),a===Layout.HORIZONTAL_RIGHT_ALIGNED?c.push("text-sm-right justify-content-end"):c.push("justify-content-between"),a===Layout.HORIZONTAL_JUSTIFIED&&c.push("text-sm-justify"),c},DefinitionList=function(a){var b=a.definitions,c=a.layout,d=a.muted;return/*#__PURE__*/_jsx("dl",{className:classNames("tw-definition-list d-flex ",{"text-muted":d,"flex-column":c===Layout.VERTICAL_ONE_COLUMN,"tw-definition-list--columns flex-column flex-row--sm":c===Layout.VERTICAL_TWO_COLUMN,"tw-definition-list--horizontal flex-column":isLayoutHorizontal(c)}),children:b.filter(function(a){return a}).map(function(a){var b=a.action,d=a.title,e=a.value,f=a.key;return/*#__PURE__*/_jsxs("div",{className:"tw-definition-list__item",children:[/*#__PURE__*/_jsx("dt",{children:d}),/*#__PURE__*/_jsxs("dd",{className:classNames.apply(void 0,_toConsumableArray(getAlignmentClasses(c,b))),children:[/*#__PURE__*/_jsx("div",{children:e}),b?/*#__PURE__*/_jsx("div",{className:classNames(isLayoutHorizontal(c)?"p-l-2":"p-x-2","tw-definition-list__action"),children:/*#__PURE__*/_jsx(ActionButton,{className:"tw-definition-list__button",onClick:b.onClick,children:b.label})}):null]})]},f)})})};DefinitionList.propTypes={definitions:PropTypes.arrayOf(PropTypes.shape({action:PropTypes.shape({label:PropTypes.string.isRequired,onClick:PropTypes.func.isRequired}),title:PropTypes.node.isRequired,value:PropTypes.node.isRequired,key:PropTypes.string.isRequired})),layout:PropTypes.oneOf(["VERTICAL_TWO_COLUMN","VERTICAL_ONE_COLUMN","HORIZONTAL_JUSTIFIED","HORIZONTAL_LEFT_ALIGNED","HORIZONTAL_RIGHT_ALIGNED"]),muted:PropTypes.bool},DefinitionList.defaultProps={definitions:[],layout:Layout.VERTICAL_TWO_COLUMN,muted:!1};export default DefinitionList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import CloseButton from"../common/closeButton";import{useLayout
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import CloseButton from"../common/closeButton";import{useLayout}from"../common/hooks";import{Position}from"../common/propsValues/position";import Dimmer from"../dimmer";import SlidingPanel from"../slidingPanel";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Drawer=function(a){var b=a.children,c=a.className,d=a.footerContent,e=a.headerTitle,f=a.onClose,g=a.open,h=a.position;logActionRequiredIf("Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.",!f);var i=useLayout(),j=i.isMobile;return/*#__PURE__*/_jsx(Dimmer,{open:g,onClose:f,children:/*#__PURE__*/_jsx(SlidingPanel,{open:g,position:j?Position.BOTTOM:h,children:/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer",c),children:[/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer-header",{"np-drawer-header--withborder":e}),children:[/*#__PURE__*/_jsx(CloseButton,{onClick:f}),e&&/*#__PURE__*/_jsx("div",{className:"np-drawer-header--title title-3",children:e})]}),b&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-content"),children:b}),d&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-footer"),children:d})]})})})};Drawer.propTypes={/** The content to appear in the drawer body. */children:PropTypes.node,className:PropTypes.string,/** The content to appear in the drawer footer. */footerContent:PropTypes.node,/** The content to appear in the drawer header. */headerTitle:PropTypes.node,/** The action to perform on close click. */onClose:PropTypes.func,/** The status of Drawer either open or not. */open:PropTypes.bool,/** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */position:PropTypes.oneOf(["left","right","bottom"])},Drawer.defaultProps={children:null,className:void 0,footerContent:null,headerTitle:null,onClose:null,open:!1,position:Position.RIGHT};export default Drawer;
|
|
@@ -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
|
|
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 Link from"../link";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var HeaderAction=function(a){var b=a.action,c={"aria-label":b["aria-label"],className:"np-header__action"};return"href"in b?/*#__PURE__*/_jsx(Link,_objectSpread(_objectSpread({href:b.href,target:b.target},c),{},{children:b.text})):/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({onClick:b.onClick},c),{},{children:b.text}))};/**
|
|
2
2
|
*
|
|
3
3
|
* Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header
|
|
4
4
|
*
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"neptune.UploadInput.deleteModalTitle": "¿Estás seguro que quieres eliminar este archivo?",
|
|
35
35
|
"neptune.UploadInput.fileIsTooLarge": "El archivo es demasiado grande",
|
|
36
36
|
"neptune.UploadInput.fileTypeNotSupported": "Tipo de archivo no compatible",
|
|
37
|
-
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Lo sentimos,
|
|
37
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Lo sentimos, ha habido un error porque solo podemos aceptar {maxFilesAllowed} archivos a la vez.",
|
|
38
38
|
"neptune.UploadItem.deleting": "Eliminando...",
|
|
39
39
|
"neptune.UploadItem.removeFile": "Eliminar el archivo {filename}",
|
|
40
40
|
"neptune.UploadItem.uploaded": "Subido",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"neptune.Pagination.ariaLabel": "Nawigacja w paginacji",
|
|
10
10
|
"neptune.PaginationLink.ariaLabel.active": "Przejdź do strony {pageNumber}",
|
|
11
11
|
"neptune.PaginationLink.ariaLabel.inactive": "Obecna strona, strona {pageNumber}",
|
|
12
|
+
"neptune.Select.searchPlaceholder": "Wyszukaj...",
|
|
12
13
|
"neptune.Summary.statusDone": "Czynność wykonana",
|
|
13
14
|
"neptune.Summary.statusNotDone": "Czynność do wykonania",
|
|
14
15
|
"neptune.Summary.statusPending": "Czynność oczekująca",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Types
|
|
3
3
|
*/ /**
|
|
4
4
|
* Components
|
|
5
|
-
*/export{default as Accordion}from"./accordion";export{default as ActionButton}from"./actionButton";export{default as ActionOption}from"./actionOption";export{default as Alert}from"./alert";export{default as Avatar}from"./avatar";export{default as AvatarWrapper}from"./avatarWrapper";export{default as Badge}from"./badge";export{default as BottomSheet}from"./common/bottomSheet";export{default as Button}from"./button";export{default as Card}from"./card";export{default as Checkbox}from"./checkbox";export{default as CheckboxButton}from"./checkboxButton";export{default as CheckboxOption}from"./checkboxOption";export{default as Chevron}from"./chevron";export{default as Chips,Chip}from"./chips";export{default as CircularButton}from"./circularButton";export{default as DateInput}from"./dateInput";export{default as DateLookup}from"./dateLookup";export{default as Decision}from"./decision";export{default as DefinitionList}from"./definitionList";export{default as Dimmer}from"./dimmer";export{default as Drawer}from"./drawer";export{default as DropFade}from"./dropFade";export{default as DynamicFieldDefinitionList}from"./dynamicFieldDefinitionList";export{default as Emphasis}from"./emphasis";export{default as FlowNavigation}from"./flowNavigation";export{default as Header}from"./header";export{default as Image}from"./image";export{default as Info}from"./info";export{default as InlineAlert}from"./inlineAlert";export{default as InputWithDisplayFormat}from"./inputWithDisplayFormat";export{default as InstructionsList}from"./instructionsList";export{default as Link}from"./link";export{default as Loader}from"./loader";export{default as Logo}from"./logo";export{default as Markdown}from"./markdown";export{default as Modal}from"./modal";export{default as Money}from"./money";export{default as MoneyInput}from"./moneyInput";export{default as NavigationOption}from"./navigationOption";export{default as NavigationOptionsList}from"./navigationOptionsList";export{default as Nudge}from"./nudge";export{default as Option}from"./common/Option";export{default as OverlayHeader}from"./overlayHeader";export{default as PhoneNumberInput}from"./phoneNumberInput";export{default as Popover}from"./popover";export{default as ProcessIndicator}from"./processIndicator";export{default as ProgressBar}from"./progressBar";export{default as Progress}from"./progress";export{default as Provider,DirectionProvider
|
|
5
|
+
*/export{default as Accordion}from"./accordion";export{default as ActionButton}from"./actionButton";export{default as ActionOption}from"./actionOption";export{default as Alert}from"./alert";export{default as Avatar}from"./avatar";export{default as AvatarWrapper}from"./avatarWrapper";export{default as Badge}from"./badge";export{default as BottomSheet}from"./common/bottomSheet";export{default as Button}from"./button";export{default as Card}from"./card";export{default as Checkbox}from"./checkbox";export{default as CheckboxButton}from"./checkboxButton";export{default as CheckboxOption}from"./checkboxOption";export{default as Chevron}from"./chevron";export{default as Chips,Chip}from"./chips";export{default as CircularButton}from"./circularButton";export{default as DateInput}from"./dateInput";export{default as DateLookup}from"./dateLookup";export{default as Decision}from"./decision";export{default as DefinitionList}from"./definitionList";export{default as Dimmer}from"./dimmer";export{default as Drawer}from"./drawer";export{default as DropFade}from"./dropFade";export{default as DynamicFieldDefinitionList}from"./dynamicFieldDefinitionList";export{default as Emphasis}from"./emphasis";export{default as FlowNavigation}from"./flowNavigation";export{default as Header}from"./header";export{default as Image}from"./image";export{default as Info}from"./info";export{default as InlineAlert}from"./inlineAlert";export{default as InputWithDisplayFormat}from"./inputWithDisplayFormat";export{default as InstructionsList}from"./instructionsList";export{default as Link}from"./link";export{default as Loader}from"./loader";export{default as Logo}from"./logo";export{default as Markdown}from"./markdown";export{default as Modal}from"./modal";export{default as Money}from"./money";export{default as MoneyInput}from"./moneyInput";export{default as NavigationOption}from"./navigationOption";export{default as NavigationOptionsList}from"./navigationOptionsList";export{default as Nudge}from"./nudge";export{default as Option}from"./common/Option";export{default as OverlayHeader}from"./overlayHeader";export{default as PhoneNumberInput}from"./phoneNumberInput";export{default as Popover}from"./popover";export{default as ProcessIndicator}from"./processIndicator";export{default as ProgressBar}from"./progressBar";export{default as Progress}from"./progress";export{default as Provider,DirectionProvider}from"./provider";export{default as Radio}from"./radio";export{default as RadioGroup}from"./radioGroup";export{default as RadioOption}from"./radioOption";export{default as Section}from"./section";export{default as Select}from"./select";export{default as SlidingPanel}from"./slidingPanel";export{default as SnackbarPortal}from"./snackbar/Snackbar";export{default as SnackbarProvider}from"./snackbar/SnackbarProvider";export{default as Stepper}from"./stepper";export{default as Sticky}from"./sticky";export{default as Summary}from"./summary";export{default as Switch}from"./switch";export{default as SwitchOption}from"./switchOption";export{default as Tabs}from"./tabs";export{default as TextareaWithDisplayFormat}from"./textareaWithDisplayFormat";export{default as Tooltip}from"./tooltip";export{default as Typeahead}from"./typeahead";export{default as Upload}from"./upload";export{default as UploadInput}from"./uploadInput";export{SnackbarConsumer,SnackbarContext}from"./snackbar/SnackbarContext";/**
|
|
6
6
|
* Hooks
|
|
7
7
|
*/export{default as useSnackbar}from"./snackbar/useSnackbar";export{useDirection,useLayout}from"./common/hooks";/**
|
|
8
8
|
* Enums
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{CrossCircle as CrossCircleIcon,CheckCircle as CheckCircleIcon}from"@transferwise/icons";import
|
|
2
|
-
_jsxs("div",{className:"instruction m-t-1",children:[/*#__PURE__*/_jsx(CheckCircleIcon,{size:24,className:"do"}),/*#__PURE__*/_jsx("p",{className:
|
|
3
|
-
_jsxs("div",{className:"instruction m-t-1",children:[/*#__PURE__*/_jsx(CrossCircleIcon,{size:24,className:"dont"}),/*#__PURE__*/_jsx("p",{className:
|
|
1
|
+
import{CrossCircle as CrossCircleIcon,CheckCircle as CheckCircleIcon}from"@transferwise/icons";import PropTypes from"prop-types";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var InstructionsList=function(a){var b=a.dos,c=a.donts;return/*#__PURE__*/_jsxs("div",{className:"tw-instructions",children:[b.map(function(a,b){return/*#__PURE__*/ (// eslint-disable-next-line react/no-array-index-key
|
|
2
|
+
_jsxs("div",{className:"instruction m-t-1",children:[/*#__PURE__*/_jsx(CheckCircleIcon,{size:24,className:"do"}),/*#__PURE__*/_jsx("p",{className:"m-l-2 m-b-0 text-primary",children:a})]},b))}),c.map(function(a,b){return/*#__PURE__*/ (// eslint-disable-next-line react/no-array-index-key
|
|
3
|
+
_jsxs("div",{className:"instruction m-t-1",children:[/*#__PURE__*/_jsx(CrossCircleIcon,{size:24,className:"dont"}),/*#__PURE__*/_jsx("p",{className:"m-l-2 m-b-0 text-primary",children:a})]},b))})]})};InstructionsList.defaultProps={dos:[],donts:[]},InstructionsList.propTypes={dos:PropTypes.arrayOf(PropTypes.node),donts:PropTypes.arrayOf(PropTypes.node)};export default InstructionsList;
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import
|
|
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(" ");
|
|
3
|
-
return/*#__PURE__*/cloneElement(a,{className:d})});return/*#__PURE__*/_jsx(ThemeContext.Provider,{value:b,children:d})};
|
|
1
|
+
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(" ");return/*#__PURE__*/cloneElement(a,{className:d})});return/*#__PURE__*/_jsx(ThemeContext.Provider,{value:b,children:d})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","id","disabled","className","avatar","secondary"];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 RadioButton from"../common/RadioButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Radio=function(a){var b=a.label,c=a.id,d=a.disabled,e=a.className,f=a.avatar,g=a.secondary,h=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx("div",{className:classNames("radio np-radio",{"radio-lg":g},e),children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:d}),htmlFor:c,children:[/*#__PURE__*/_jsx("span",{className:"np-radio-button p-r-
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["label","id","disabled","className","avatar","secondary"];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 RadioButton from"../common/RadioButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Radio=function(a){var b=a.label,c=a.id,d=a.disabled,e=a.className,f=a.avatar,g=a.secondary,h=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx("div",{className:classNames("radio np-radio",{"radio-lg":g},e),children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:d}),htmlFor:c,children:[/*#__PURE__*/_jsx("span",{className:"np-radio-button p-r-2",children:/*#__PURE__*/_jsx(RadioButton,_objectSpread({id:c,disabled:d},h))}),/*#__PURE__*/_jsxs("span",{className:"np-radio__text",children:[b,g&&/*#__PURE__*/_jsx("small",{children:g})]}),f&&/*#__PURE__*/_jsx("span",{className:"np-radio__avatar m-l-auto",children:f})]})})};Radio.propTypes={avatar:PropTypes.element,checked:PropTypes.bool,disabled:PropTypes.bool,id:PropTypes.string,label:PropTypes.string.isRequired,name:PropTypes.string.isRequired,onChange:PropTypes.func.isRequired,secondary:PropTypes.string,value:PropTypes.oneOfType([PropTypes.number,PropTypes.string]),className:PropTypes.string},Radio.defaultProps={avatar:void 0,checked:!1,disabled:!1,id:null,secondary:null,value:"",className:void 0};export default Radio;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import{Position}from"../common";import{useDirection}from"../common/hooks";import Tooltip from"../tooltip";import{isTouchDevice}from"./deviceDetection";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function clamp(a,b,c){return Math.max(Math.min(b,c),a)}/* eslint-disable react/no-array-index-key */var Stepper=function(a){var b=a.steps,c=a.activeStep,d=a.className,e=useDirection(),f=e.isRTL;if(0===b.length)return null;var g=clamp(0,b.length-1,c),h=1/(b.length-1),i=g/(b.length-1),j=Math.max(i-h,0),k=Math.min(g,1)*h;return/*#__PURE__*/_jsxs("div",{className:classNames("tw-stepper",d),children:[/*#__PURE__*/_jsxs("div",{className:"progress",children:[/*#__PURE__*/_jsx("div",{className:"progress-bar-filler",style:{width:"".concat(100*j,"%")}}),/*#__PURE__*/_jsx("div",{className:"progress-bar-ending",style:{width:"".concat(100*k,"%")}})]}),/*#__PURE__*/_jsx("ul",{className:"tw-stepper-steps p-t-1 m-b-0",children:b.map(function renderStep(a,b){var c=b===g,d=a.onClick&&!c,e=d?/*#__PURE__*/_jsx("button",{type:"button",className:"btn-unstyled tw-stepper__step-label",onClick:function onClick(){return d&&a.onClick()},children:/*#__PURE__*/_jsx("small",{children:a.label})}):/*#__PURE__*/_jsx("small",{className:"tw-stepper__step-label",children:a.label});return/*#__PURE__*/_jsx("li",{className:
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import{Position}from"../common";import{useDirection}from"../common/hooks";import Tooltip from"../tooltip";import{isTouchDevice}from"./deviceDetection";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";function clamp(a,b,c){return Math.max(Math.min(b,c),a)}/* eslint-disable react/no-array-index-key */var Stepper=function(a){var b=a.steps,c=a.activeStep,d=a.className,e=useDirection(),f=e.isRTL;if(0===b.length)return null;var g=clamp(0,b.length-1,c),h=1/(b.length-1),i=g/(b.length-1),j=Math.max(i-h,0),k=Math.min(g,1)*h;return/*#__PURE__*/_jsxs("div",{className:classNames("tw-stepper",d),children:[/*#__PURE__*/_jsxs("div",{className:"progress",children:[/*#__PURE__*/_jsx("div",{className:"progress-bar-filler",style:{width:"".concat(100*j,"%")}}),/*#__PURE__*/_jsx("div",{className:"progress-bar-ending",style:{width:"".concat(100*k,"%")}})]}),/*#__PURE__*/_jsx("ul",{className:"tw-stepper-steps p-t-1 m-b-0",children:b.map(function renderStep(a,b){var c=b===g,d=a.onClick&&!c,e=d?/*#__PURE__*/_jsx("button",{type:"button",className:"btn-unstyled tw-stepper__step-label",onClick:function onClick(){return d&&a.onClick()},children:/*#__PURE__*/_jsx("small",{children:a.label})}):/*#__PURE__*/_jsx("small",{className:"tw-stepper__step-label",children:a.label});return/*#__PURE__*/_jsx("li",{className:"\n hidden-xs\n tw-stepper__step\n ".concat(c?"tw-stepper__step--active":"","\n ").concat(d?"tw-stepper__step--clickable":"","\n "),style:f?{right:"".concat(100*(b*h),"%")}:{left:"".concat(100*(b*h),"%")},children:a.hoverLabel&&!isTouchDevice()?/*#__PURE__*/_jsx(Tooltip,{position:Position.BOTTOM,label:a.hoverLabel,children:e}):e},b)})})]})};/* eslint-enable react/no-array-index-key */Stepper.propTypes={steps:PropTypes.arrayOf(PropTypes.shape({label:PropTypes.node.isRequired,onClick:PropTypes.func,hoverLabel:PropTypes.node})).isRequired,activeStep:PropTypes.number,className:PropTypes.string},Stepper.defaultProps={activeStep:0,className:void 0};export default Stepper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Chevron from"../../chevron";import{Position,
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import Chevron from"../../chevron";import{Position,Theme}from"../../common";import Option from"../../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var AccordionItem=function(a){var b=a["aria-label"],c=a.id,d=a.title,e=a.content,f=a.onClick,g=a.open,h=a.icon,i=a.theme,j=h?/*#__PURE__*/cloneElement(h,{size:24}):null;return/*#__PURE__*/_jsxs("div",{id:c,className:classNames("np-accordion-item","np-accordion-item--".concat(i),{"np-accordion-item--open":g}),children:[/*#__PURE__*/_jsx(Option,{"aria-label":b,as:"button",media:j,title:d,button:/*#__PURE__*/_jsx(Chevron,{orientation:g?Position.TOP:Position.DOWN}),inverseMediaCircle:!1,onClick:f}),g&&/*#__PURE__*/_jsx("div",{className:classNames("np-accordion-item__content",{"has-icon":h}),children:e})]})};AccordionItem.propTypes={"aria-label":PropTypes.string,content:PropTypes.node.isRequired,icon:PropTypes.node,id:PropTypes.string,open:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired,title:PropTypes.node.isRequired,theme:PropTypes.oneOf(["light","dark"])},AccordionItem.defaultProps={"aria-label":void 0,icon:null,id:null,theme:Theme.LIGHT};export default AccordionItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_iconTypeMap,_deprecatedTypeMapMes;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"core-js/modules/es.object.keys.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.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{InfoCircle,Warning as AlertIcon,
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_iconTypeMap,_deprecatedTypeMapMes;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"core-js/modules/es.object.keys.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.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{InfoCircle,CheckCircle,Warning as AlertIcon,AlertCircle}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement,useState,useRef}from"react";import requiredIf from"react-required-if";import{Sentiment}from"../common";import CloseButton from"../common/closeButton";import{logActionRequiredIf,deprecated}from"../utilities";import InlineMarkdown from"./inlineMarkdown";import withArrow from"./withArrow";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var deprecatedTypeMap=(_deprecatedTypeMap={},_defineProperty(_deprecatedTypeMap,Sentiment.SUCCESS,Sentiment.POSITIVE),_defineProperty(_deprecatedTypeMap,Sentiment.INFO,Sentiment.NEUTRAL),_defineProperty(_deprecatedTypeMap,Sentiment.ERROR,Sentiment.NEGATIVE),_deprecatedTypeMap),iconTypeMap=(_iconTypeMap={},_defineProperty(_iconTypeMap,Sentiment.POSITIVE,CheckCircle),_defineProperty(_iconTypeMap,Sentiment.NEUTRAL,InfoCircle),_defineProperty(_iconTypeMap,Sentiment.WARNING,AlertIcon),_defineProperty(_iconTypeMap,Sentiment.NEGATIVE,AlertCircle),_iconTypeMap),Alert=function(a){var b=useState(!1),c=_slicedToArray(b,2),d=c[0],e=c[1],f=a.arrow,g=a.action,h=a.children,i=a.className,j=a.icon,k=a.onDismiss,l=a.message,m=a.type,n=useRef(null);if(f){var r=withArrow(Alert,f);return/*#__PURE__*/_jsx(r,_objectSpread({},a))}logActionRequired(a);var o=deprecatedTypeMap[m]||m,p=iconTypeMap[o],q=j?/*#__PURE__*/cloneElement(j,{size:24}):/*#__PURE__*/_jsx(p,{size:24});return/*#__PURE__*/_jsxs("div",{role:"alert",className:classNames("alert d-flex","alert-".concat(o),i),onTouchStart:function handleTouchStart(){return e(!0)},onTouchEnd:function handleTouchEnd(a){d&&g&&null!==n&&void 0!==n&&n.current&&!n.current.contains(a.target)&&("_blank"===(null===g||void 0===g?void 0:g.target)?window.top.open(g.href):window.top.location.assign(g.href)),e(!1)},onTouchMove:function handleTouchMove(){return e(!1)},children:[q,/*#__PURE__*/_jsxs("div",{className:"alert__message flex-grow-1 p-l-2",children:[/*#__PURE__*/_jsx("div",{children:h||/*#__PURE__*/_jsx(InlineMarkdown,{children:l})}),g&&/*#__PURE__*/_jsx("a",{href:g.href,className:"m-t-1 d-inline-block","aria-label":g["aria-label"],target:g.target,children:g.text})]}),k&&/*#__PURE__*/_jsx(CloseButton,{ref:n,size:16,className:"m-l-2",onClick:k})]})},deprecatedTypeMapMessage=(_deprecatedTypeMapMes={},_defineProperty(_deprecatedTypeMapMes,Sentiment.SUCCESS,"Sentiment.POSITIVE"),_defineProperty(_deprecatedTypeMapMes,Sentiment.INFO,"Sentiment.NEUTRAL"),_defineProperty(_deprecatedTypeMapMes,Sentiment.ERROR,"Sentiment.NEGATIVE"),_deprecatedTypeMapMes),deprecatedTypes=Object.keys(deprecatedTypeMap);function logActionRequired(a){var b=a.size,c=a.type;logActionRequiredIf("Alert no longer supports any possible variations in size. Please remove the `size` prop.",!!b),logActionRequiredIf("Alert has deprecated the ".concat(c," value for the `type` prop. Please update to ").concat(deprecatedTypeMapMessage[c],"."),deprecatedTypes.includes(c))}Alert.propTypes={/** An optional call to action to sit under the main body of the alert. If your label is short, use aria-label to provide more context */action:PropTypes.shape({"aria-label":PropTypes.string,href:PropTypes.string.isRequired,target:PropTypes.string,text:PropTypes.node.isRequired}),className:PropTypes.string,/** An optional icon. If not provided, we will default the icon to something appropriate for the type */icon:PropTypes.element,/** The main body of the alert. Accepts plain text and bold words specified with **double stars*/message:requiredIf(PropTypes.node,function(a){var b=a.children;return!b}),/** The presence of the onDismiss handler will trigger the visibility of the close button */onDismiss:PropTypes.func,/** The type dictates which icon and colour will be used */type:PropTypes.oneOf(["negative","neutral","positive","warning","info","error","success"]),/** @deprecated no arrow for `Alert` component anymore, consider to use [`InlineAlert`](https://transferwise.github.io/neptune-web/components/alerts/InlineAlert) component */arrow:deprecated(PropTypes.oneOf(["up-left","up-center","up-right","down-left","down-center","down-right"]),{component:"Alert",expiryDate:new Date("03-01-2021")}),/** @deprecated use `message` property instead */children:deprecated(requiredIf(PropTypes.node,function(a){var b=a.message;return!b}),{component:"Alert",message:"You should now use the `message` prop. Be aware `message` only accepts plain text or text with **bold** markdown.",expiryDate:new Date("03-01-2021")}),/** @deprecated use `onDismiss` instead */dismissible:deprecated(PropTypes.bool,{component:"Alert",message:"The Alert will now be considered dismissible if an `onDismiss` hander is present.",expiryDate:new Date("03-01-2021")})},Alert.defaultProps={action:void 0,arrow:void 0,className:void 0,dismissible:void 0,icon:void 0,type:Sentiment.NEUTRAL};export default Alert;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import CheckboxButton from"../checkboxButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Checkbox=function(a){var b=a.id,c=a.checked,d=a.required,e=a.disabled,f=a.readOnly,g=a.label,h=a.className,i=a.secondary,j=a.onChange,k=a.onFocus,l=a.onBlur,m=d&&!e&&!f&&!c,n=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":i,"has-error":m},h);return/*#__PURE__*/_jsx("div",{id:b,className:n,children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:e}),children:[/*#__PURE__*/_jsx(CheckboxButton,{className:classNames("p-r-
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import CheckboxButton from"../checkboxButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Checkbox=function(a){var b=a.id,c=a.checked,d=a.required,e=a.disabled,f=a.readOnly,g=a.label,h=a.className,i=a.secondary,j=a.onChange,k=a.onFocus,l=a.onBlur,m=d&&!e&&!f&&!c,n=classNames("np-checkbox",{checkbox:!0,"checkbox-lg":i,"has-error":m},h);return/*#__PURE__*/_jsx("div",{id:b,className:n,children:/*#__PURE__*/_jsxs("label",{className:classNames({disabled:e}),children:[/*#__PURE__*/_jsx(CheckboxButton,{className:classNames("p-r-2",{"has-error":m}),checked:c,disabled:e||f,onFocus:k,onChange:function onChange(){return j(!c)},onBlur:l}),/*#__PURE__*/_jsxs("span",{className:"np-checkbox__text",children:[g,d&&"*",i&&/*#__PURE__*/_jsx("small",{children:i})]})]})})};Checkbox.propTypes={id:PropTypes.string,checked:PropTypes.bool,required:PropTypes.bool,disabled:PropTypes.bool,readOnly:PropTypes.bool,label:PropTypes.node.isRequired,secondary:PropTypes.string,onFocus:PropTypes.func,onChange:PropTypes.func.isRequired,onBlur:PropTypes.func,className:PropTypes.string},Checkbox.defaultProps={id:null,checked:!1,required:!1,disabled:!1,readOnly:!1,secondary:null,onFocus:null,onBlur:null,className:void 0};export default Checkbox;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import CloseButton from"../common/closeButton/CloseButton";import{
|
|
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 CloseButton from"../common/closeButton/CloseButton";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Chip=function(a){var b=a.label,c=a.value,d=a.onRemove,e=a.onClick,f=a.onKeyPress,g=a.className,h=void 0===g?void 0:g,i=a["aria-label"],j=a["aria-checked"],k=a.role,l=a.closeButton,m=e||f,n=m?"button":void 0,o=m?0:-1;return/*#__PURE__*/_jsxs("div",_objectSpread(_objectSpread({role:null!==k&&void 0!==k?k:n,tabIndex:o,"aria-label":i,"aria-checked":j,className:classNames("np-chip","d-flex","align-items-center","justify-content-between",h)},m&&{onClick:e,onKeyPress:f}),{},{children:[/*#__PURE__*/_jsx("span",{"aria-hidden":!!d,className:"np-chip-label",children:b}),d?/*#__PURE__*/_jsx(CloseButton/* @ts-expect-error remove when CloseButton will be written on TS */,{className:"btn-unstyled m-l-1","aria-label":l&&l["aria-label"],size:16,onClick:d}):null]}),c)};export default Chip;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"core-js/modules/es.array.concat.js";import classNames from"classnames";import{useRef,useState}from"react";import Dimmer from"../../dimmer";import SlidingPanel from"../../slidingPanel";import CloseButton from"../closeButton";import{isServerSide}from"../domHelpers";import{useConditionalListener
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"core-js/modules/es.array.concat.js";import classNames from"classnames";import{useRef,useState}from"react";import Dimmer from"../../dimmer";import SlidingPanel from"../../slidingPanel";import CloseButton from"../closeButton";import{isServerSide}from"../domHelpers";import{useConditionalListener}from"../hooks";import{Position}from"../propsValues/position";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var INITIAL_Y_POSITION=0,CONTENT_SCROLL_THRESHOLD=1,MOVE_OFFSET_THRESHOLD=50,BottomSheet=function(a){function b(a){null!==g.current&&(g.current.style.transform="translateY(".concat(a,"px)"))}function c(b){m(!1),o.current=INITIAL_Y_POSITION,null!==g.current&&g.current.style.removeProperty("transform"),a.onClose&&a.onClose(b)}function d(a){// stop moving component
|
|
2
2
|
cancelAnimationFrame(n.current),m(!1),o.current>MOVE_OFFSET_THRESHOLD&&e()?c(a):b(INITIAL_Y_POSITION),o.current=INITIAL_Y_POSITION}function e(){var a;return(null===i||void 0===i||null===(a=i.current)||void 0===a?void 0:a.scrollTop)!==void 0&&i.current.scrollTop<=CONTENT_SCROLL_THRESHOLD}/**
|
|
3
3
|
* Calculates how hard user moves component,
|
|
4
4
|
* result value used to determine whether to hide component or re-position to default state
|
|
@@ -7,4 +7,4 @@ cancelAnimationFrame(n.current),m(!1),o.current>MOVE_OFFSET_THRESHOLD&&e()?c(a):
|
|
|
7
7
|
*/function f(a){return a-p.current}/**
|
|
8
8
|
* Set `max-height` for content part (in order to keep it scrollable for content overflow cases) of the component
|
|
9
9
|
* and ensures space for safe zone (32px) at the top.
|
|
10
|
-
*/var g=useRef(null),h=useRef(null),i=useRef(null),j=useState(!1),k=_slicedToArray(j,2),l=k[0],m=k[1],n=useRef(0),o=useRef(0),p=useRef(0);useConditionalListener({attachListener:a.open&&!isServerSide(),callback:function callback(){if(null!==h.current){var a=h.current.classList;e()?a.remove("np-bottom-sheet--top-bar--shadow"):a.add("np-bottom-sheet--top-bar--shadow")}},eventType:"scroll",parent:isServerSide()?void 0:document});var q=function(a){return function(b){p.current=(a?b.touches[0]:b).clientY,m(!0)}},r=function(a){return function(c){if(l){var d=a?c.touches[0]:c,h=d.clientY,i=f(h);i>INITIAL_Y_POSITION&&e()&&(o.current=i,n.current=requestAnimationFrame(function(){n.current!==void 0&&null!==g.current&&b(i)}))}}}
|
|
10
|
+
*/var g=useRef(null),h=useRef(null),i=useRef(null),j=useState(!1),k=_slicedToArray(j,2),l=k[0],m=k[1],n=useRef(0),o=useRef(0),p=useRef(0);useConditionalListener({attachListener:a.open&&!isServerSide(),callback:function callback(){if(null!==h.current){var a=h.current.classList;e()?a.remove("np-bottom-sheet--top-bar--shadow"):a.add("np-bottom-sheet--top-bar--shadow")}},eventType:"scroll",parent:isServerSide()?void 0:document});var q=function(a){return function(b){p.current=(a?b.touches[0]:b).clientY,m(!0)}},r=function(a){return function(c){if(l){var d=a?c.touches[0]:c,h=d.clientY,i=f(h);i>INITIAL_Y_POSITION&&e()&&(o.current=i,n.current=requestAnimationFrame(function(){n.current!==void 0&&null!==g.current&&b(i)}))}}};return/*#__PURE__*/_jsx(Dimmer,{open:a.open,fadeContentOnEnter:!0,fadeContentOnExit:!0,onClose:c,children:/*#__PURE__*/_jsxs(SlidingPanel,{ref:g,open:a.open,position:Position.BOTTOM,className:classNames("np-bottom-sheet",a.className),role:"dialog",onTouchStart:q(!0),onTouchMove:r(!0),onTouchEnd:d,onMouseDown:q(!1),onMouseMove:r(!1),onMouseUp:d,children:[/*#__PURE__*/_jsxs("div",{ref:h,className:"np-bottom-sheet--top-bar",children:[/*#__PURE__*/_jsx("div",{className:"np-bottom-sheet--handler"}),/*#__PURE__*/_jsx(CloseButton,{size:16,className:"sr-only np-bottom-sheet--close-btn",onClick:c})]}),/*#__PURE__*/_jsx("div",{ref:i,style:function(){var a=isServerSide()?0:window.innerHeight,b="".concat(100*(.01*a),"px");return{maxHeight:"calc(".concat(b," - ").concat("64px"," - ").concat("32px",")")}}(),className:"np-bottom-sheet--content",children:a.children})]})})};export default BottomSheet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import"core-js/modules/es.object.values.js";import{Cross
|
|
1
|
+
import"core-js/modules/es.object.values.js";import{Cross as CrossIcon}from"@transferwise/icons";import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import{useIntl}from"react-intl";import messages from"./CloseButton.messages";import{jsx as _jsx}from"react/jsx-runtime";export var CloseButton=/*#__PURE__*/forwardRef(function(a,b){var c=useIntl(),d=a.onClick,e=a.size,f=a.className,g=a["aria-label"]||c.formatMessage(messages.ariaLabel);return/*#__PURE__*/_jsx("button",{ref:b,type:"button",className:classNames("np-close-button","close btn-link","text-no-decoration",{"np-close-button--large":e===CloseButton.Size.LARGE},f),"aria-label":g,onClick:d,children:/*#__PURE__*/_jsx(CrossIcon,{size:e})})});CloseButton.Size={SMALL:16,LARGE:24},CloseButton.propTypes={onClick:PropTypes.func.isRequired,className:PropTypes.string,size:PropTypes.oneOf(Object.values(CloseButton.Size)),"aria-label":PropTypes.string},CloseButton.defaultProps={className:null,size:CloseButton.Size.LARGE,"aria-label":void 0};export default CloseButton;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.function.name.js";import{useTheme}from"../../hooks";// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
|
-
import{jsx as _jsx}from"react/jsx-runtime";function getDisplayName(a){return a.displayName||a.name||"Component"}export function withTheme(a){var b=function(b){var c=useTheme()
|
|
2
|
+
import{jsx as _jsx}from"react/jsx-runtime";function getDisplayName(a){return a.displayName||a.name||"Component"}export function withTheme(a){var b=function(b){var c=useTheme();return/*#__PURE__*/_jsx(a,_objectSpread({theme:c},b))};return b.displayName="withTheme(".concat(getDisplayName(a),")"),b.WrappedComponent=a,b}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{useContext
|
|
1
|
+
import{useContext}from"react";import{ThemeContext}from"../../../provider/theme/ThemeProvider";export var useTheme=function(){return useContext(ThemeContext)};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{renderHook}from"@testing-library/react-hooks";import{Theme}from"../../../common/theme";import{ThemeProvider}from"../../../provider";import{useTheme}from"./useTheme";describe("useTheme",function(){it("returns default light theme",function(){var a=renderHook(function(){return useTheme()}),b=a.result.current;expect(b
|
|
1
|
+
import{renderHook}from"@testing-library/react-hooks";import{Theme}from"../../../common/theme";import{ThemeProvider}from"../../../provider";import{useTheme}from"./useTheme";describe("useTheme",function(){it("returns default light theme",function(){var a=renderHook(function(){return useTheme()}),b=a.result.current;expect(b).toStrictEqual(Theme.LIGHT)}),it("returns provided theme",function(){var a=renderHook(function(){return useTheme()},{wrapper:ThemeProvider,initialProps:{theme:Theme.NAVY}}),b=a.result.current;expect(b).toStrictEqual(Theme.NAVY)})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
export var Theme;(function(a){a.LIGHT="light",a.DARK="dark",a.NAVY="navy"})(Theme||(Theme={}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import classNames from"classnames";import PropTypes from"prop-types";import ActionButton from"../actionButton";import{Layout}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var isLayoutHorizontal=function(a){return[Layout.HORIZONTAL_LEFT_ALIGNED,Layout.HORIZONTAL_RIGHT_ALIGNED,Layout.HORIZONTAL_JUSTIFIED].includes(a)},getAlignmentClasses=function(a,b){var c=["d-flex"];return b&&(isLayoutHorizontal(a)?c.push("align-items-center"):c.push("align-items-start")),a===Layout.HORIZONTAL_RIGHT_ALIGNED?c.push("text-sm-right justify-content-end"):c.push("justify-content-between"),a===Layout.HORIZONTAL_JUSTIFIED&&c.push("text-sm-justify"),c},DefinitionList=function(a){var b=a.definitions,c=a.layout,d=a.muted;return/*#__PURE__*/_jsx("dl",{className:classNames("tw-definition-list d-flex ",{"text-muted":d,"flex-column":c===Layout.VERTICAL_ONE_COLUMN,"tw-definition-list--columns flex-column flex-row--sm":c===Layout.VERTICAL_TWO_COLUMN,"tw-definition-list--horizontal flex-column":isLayoutHorizontal(c)}),children:b.filter(function(a){return a}).map(function(a){var b=a.action,d=a.title,e=a.value,f=a.key;return/*#__PURE__*/_jsxs("div",{className:"tw-definition-list__item",children:[/*#__PURE__*/_jsx("dt",{children:d}),/*#__PURE__*/_jsxs("dd",{className:classNames.apply(void 0,_toConsumableArray(getAlignmentClasses(c,b))),children:[/*#__PURE__*/_jsx("div",{children:e}),b?/*#__PURE__*/_jsx("div",{className:classNames(isLayoutHorizontal(c)?"p-l-2":"p-x-2","tw-definition-list__action"),children:/*#__PURE__*/_jsx(ActionButton,{className:"tw-definition-list__button",onClick:b.onClick,children:b.label})}):null]})]},f)})})};DefinitionList.propTypes={definitions:PropTypes.arrayOf(PropTypes.shape({action:PropTypes.shape({label:PropTypes.string.isRequired,onClick:PropTypes.func.isRequired}),title:PropTypes.node.isRequired,value:PropTypes.node.isRequired,key:PropTypes.string.isRequired})),layout:PropTypes.oneOf(["VERTICAL_TWO_COLUMN","VERTICAL_ONE_COLUMN","HORIZONTAL_JUSTIFIED","HORIZONTAL_LEFT_ALIGNED","HORIZONTAL_RIGHT_ALIGNED"]),muted:PropTypes.bool},DefinitionList.defaultProps={definitions:[],layout:Layout.VERTICAL_TWO_COLUMN,muted:!1};export default DefinitionList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import CloseButton from"../common/closeButton";import{useLayout
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import CloseButton from"../common/closeButton";import{useLayout}from"../common/hooks";import{Position}from"../common/propsValues/position";import Dimmer from"../dimmer";import SlidingPanel from"../slidingPanel";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Drawer=function(a){var b=a.children,c=a.className,d=a.footerContent,e=a.headerTitle,f=a.onClose,g=a.open,h=a.position;logActionRequiredIf("Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.",!f);var i=useLayout(),j=i.isMobile;return/*#__PURE__*/_jsx(Dimmer,{open:g,onClose:f,children:/*#__PURE__*/_jsx(SlidingPanel,{open:g,position:j?Position.BOTTOM:h,children:/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer",c),children:[/*#__PURE__*/_jsxs("div",{className:classNames("np-drawer-header",{"np-drawer-header--withborder":e}),children:[/*#__PURE__*/_jsx(CloseButton,{onClick:f}),e&&/*#__PURE__*/_jsx("div",{className:"np-drawer-header--title title-3",children:e})]}),b&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-content"),children:b}),d&&/*#__PURE__*/_jsx("div",{className:classNames("np-drawer-footer"),children:d})]})})})};Drawer.propTypes={/** The content to appear in the drawer body. */children:PropTypes.node,className:PropTypes.string,/** The content to appear in the drawer footer. */footerContent:PropTypes.node,/** The content to appear in the drawer header. */headerTitle:PropTypes.node,/** The action to perform on close click. */onClose:PropTypes.func,/** The status of Drawer either open or not. */open:PropTypes.bool,/** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */position:PropTypes.oneOf(["left","right","bottom"])},Drawer.defaultProps={children:null,className:void 0,footerContent:null,headerTitle:null,onClose:null,open:!1,position:Position.RIGHT};export default Drawer;
|
|
@@ -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
|
|
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 Link from"../link";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var HeaderAction=function(a){var b=a.action,c={"aria-label":b["aria-label"],className:"np-header__action"};return"href"in b?/*#__PURE__*/_jsx(Link,_objectSpread(_objectSpread({href:b.href,target:b.target},c),{},{children:b.text})):/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({onClick:b.onClick},c),{},{children:b.text}))};/**
|
|
2
2
|
*
|
|
3
3
|
* Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header
|
|
4
4
|
*
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"neptune.UploadInput.deleteModalTitle": "¿Estás seguro que quieres eliminar este archivo?",
|
|
35
35
|
"neptune.UploadInput.fileIsTooLarge": "El archivo es demasiado grande",
|
|
36
36
|
"neptune.UploadInput.fileTypeNotSupported": "Tipo de archivo no compatible",
|
|
37
|
-
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Lo sentimos,
|
|
37
|
+
"neptune.UploadInput.maximumFilesAlreadyUploaded": "Lo sentimos, ha habido un error porque solo podemos aceptar {maxFilesAllowed} archivos a la vez.",
|
|
38
38
|
"neptune.UploadItem.deleting": "Eliminando...",
|
|
39
39
|
"neptune.UploadItem.removeFile": "Eliminar el archivo {filename}",
|
|
40
40
|
"neptune.UploadItem.uploaded": "Subido",
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
"neptune.Pagination.ariaLabel": "Nawigacja w paginacji",
|
|
10
10
|
"neptune.PaginationLink.ariaLabel.active": "Przejdź do strony {pageNumber}",
|
|
11
11
|
"neptune.PaginationLink.ariaLabel.inactive": "Obecna strona, strona {pageNumber}",
|
|
12
|
+
"neptune.Select.searchPlaceholder": "Wyszukaj...",
|
|
12
13
|
"neptune.Summary.statusDone": "Czynność wykonana",
|
|
13
14
|
"neptune.Summary.statusNotDone": "Czynność do wykonania",
|
|
14
15
|
"neptune.Summary.statusPending": "Czynność oczekująca",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* Types
|
|
3
3
|
*/ /**
|
|
4
4
|
* Components
|
|
5
|
-
*/export{default as Accordion}from"./accordion";export{default as ActionButton}from"./actionButton";export{default as ActionOption}from"./actionOption";export{default as Alert}from"./alert";export{default as Avatar}from"./avatar";export{default as AvatarWrapper}from"./avatarWrapper";export{default as Badge}from"./badge";export{default as BottomSheet}from"./common/bottomSheet";export{default as Button}from"./button";export{default as Card}from"./card";export{default as Checkbox}from"./checkbox";export{default as CheckboxButton}from"./checkboxButton";export{default as CheckboxOption}from"./checkboxOption";export{default as Chevron}from"./chevron";export{default as Chips,Chip}from"./chips";export{default as CircularButton}from"./circularButton";export{default as DateInput}from"./dateInput";export{default as DateLookup}from"./dateLookup";export{default as Decision}from"./decision";export{default as DefinitionList}from"./definitionList";export{default as Dimmer}from"./dimmer";export{default as Drawer}from"./drawer";export{default as DropFade}from"./dropFade";export{default as DynamicFieldDefinitionList}from"./dynamicFieldDefinitionList";export{default as Emphasis}from"./emphasis";export{default as FlowNavigation}from"./flowNavigation";export{default as Header}from"./header";export{default as Image}from"./image";export{default as Info}from"./info";export{default as InlineAlert}from"./inlineAlert";export{default as InputWithDisplayFormat}from"./inputWithDisplayFormat";export{default as InstructionsList}from"./instructionsList";export{default as Link}from"./link";export{default as Loader}from"./loader";export{default as Logo}from"./logo";export{default as Markdown}from"./markdown";export{default as Modal}from"./modal";export{default as Money}from"./money";export{default as MoneyInput}from"./moneyInput";export{default as NavigationOption}from"./navigationOption";export{default as NavigationOptionsList}from"./navigationOptionsList";export{default as Nudge}from"./nudge";export{default as Option}from"./common/Option";export{default as OverlayHeader}from"./overlayHeader";export{default as PhoneNumberInput}from"./phoneNumberInput";export{default as Popover}from"./popover";export{default as ProcessIndicator}from"./processIndicator";export{default as ProgressBar}from"./progressBar";export{default as Progress}from"./progress";export{default as Provider,DirectionProvider
|
|
5
|
+
*/export{default as Accordion}from"./accordion";export{default as ActionButton}from"./actionButton";export{default as ActionOption}from"./actionOption";export{default as Alert}from"./alert";export{default as Avatar}from"./avatar";export{default as AvatarWrapper}from"./avatarWrapper";export{default as Badge}from"./badge";export{default as BottomSheet}from"./common/bottomSheet";export{default as Button}from"./button";export{default as Card}from"./card";export{default as Checkbox}from"./checkbox";export{default as CheckboxButton}from"./checkboxButton";export{default as CheckboxOption}from"./checkboxOption";export{default as Chevron}from"./chevron";export{default as Chips,Chip}from"./chips";export{default as CircularButton}from"./circularButton";export{default as DateInput}from"./dateInput";export{default as DateLookup}from"./dateLookup";export{default as Decision}from"./decision";export{default as DefinitionList}from"./definitionList";export{default as Dimmer}from"./dimmer";export{default as Drawer}from"./drawer";export{default as DropFade}from"./dropFade";export{default as DynamicFieldDefinitionList}from"./dynamicFieldDefinitionList";export{default as Emphasis}from"./emphasis";export{default as FlowNavigation}from"./flowNavigation";export{default as Header}from"./header";export{default as Image}from"./image";export{default as Info}from"./info";export{default as InlineAlert}from"./inlineAlert";export{default as InputWithDisplayFormat}from"./inputWithDisplayFormat";export{default as InstructionsList}from"./instructionsList";export{default as Link}from"./link";export{default as Loader}from"./loader";export{default as Logo}from"./logo";export{default as Markdown}from"./markdown";export{default as Modal}from"./modal";export{default as Money}from"./money";export{default as MoneyInput}from"./moneyInput";export{default as NavigationOption}from"./navigationOption";export{default as NavigationOptionsList}from"./navigationOptionsList";export{default as Nudge}from"./nudge";export{default as Option}from"./common/Option";export{default as OverlayHeader}from"./overlayHeader";export{default as PhoneNumberInput}from"./phoneNumberInput";export{default as Popover}from"./popover";export{default as ProcessIndicator}from"./processIndicator";export{default as ProgressBar}from"./progressBar";export{default as Progress}from"./progress";export{default as Provider,DirectionProvider}from"./provider";export{default as Radio}from"./radio";export{default as RadioGroup}from"./radioGroup";export{default as RadioOption}from"./radioOption";export{default as Section}from"./section";export{default as Select}from"./select";export{default as SlidingPanel}from"./slidingPanel";export{default as SnackbarPortal}from"./snackbar/Snackbar";export{default as SnackbarProvider}from"./snackbar/SnackbarProvider";export{default as Stepper}from"./stepper";export{default as Sticky}from"./sticky";export{default as Summary}from"./summary";export{default as Switch}from"./switch";export{default as SwitchOption}from"./switchOption";export{default as Tabs}from"./tabs";export{default as TextareaWithDisplayFormat}from"./textareaWithDisplayFormat";export{default as Tooltip}from"./tooltip";export{default as Typeahead}from"./typeahead";export{default as Upload}from"./upload";export{default as UploadInput}from"./uploadInput";export{SnackbarConsumer,SnackbarContext}from"./snackbar/SnackbarContext";/**
|
|
6
6
|
* Hooks
|
|
7
7
|
*/export{default as useSnackbar}from"./snackbar/useSnackbar";export{useDirection,useLayout}from"./common/hooks";/**
|
|
8
8
|
* Enums
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import"core-js/modules/es.array.map.js";import{CrossCircle as CrossCircleIcon,CheckCircle as CheckCircleIcon}from"@transferwise/icons";import
|
|
2
|
-
_jsxs("div",{className:"instruction m-t-1",children:[/*#__PURE__*/_jsx(CheckCircleIcon,{size:24,className:"do"}),/*#__PURE__*/_jsx("p",{className:
|
|
3
|
-
_jsxs("div",{className:"instruction m-t-1",children:[/*#__PURE__*/_jsx(CrossCircleIcon,{size:24,className:"dont"}),/*#__PURE__*/_jsx("p",{className:
|
|
1
|
+
import"core-js/modules/es.array.map.js";import{CrossCircle as CrossCircleIcon,CheckCircle as CheckCircleIcon}from"@transferwise/icons";import PropTypes from"prop-types";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var InstructionsList=function(a){var b=a.dos,c=a.donts;return/*#__PURE__*/_jsxs("div",{className:"tw-instructions",children:[b.map(function(a,b){return/*#__PURE__*/ (// eslint-disable-next-line react/no-array-index-key
|
|
2
|
+
_jsxs("div",{className:"instruction m-t-1",children:[/*#__PURE__*/_jsx(CheckCircleIcon,{size:24,className:"do"}),/*#__PURE__*/_jsx("p",{className:"m-l-2 m-b-0 text-primary",children:a})]},b))}),c.map(function(a,b){return/*#__PURE__*/ (// eslint-disable-next-line react/no-array-index-key
|
|
3
|
+
_jsxs("div",{className:"instruction m-t-1",children:[/*#__PURE__*/_jsx(CrossCircleIcon,{size:24,className:"dont"}),/*#__PURE__*/_jsx("p",{className:"m-l-2 m-b-0 text-primary",children:a})]},b))})]})};InstructionsList.defaultProps={dos:[],donts:[]},InstructionsList.propTypes={dos:PropTypes.arrayOf(PropTypes.node),donts:PropTypes.arrayOf(PropTypes.node)};export default InstructionsList;
|
|
@@ -1,3 +1,2 @@
|
|
|
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
|
|
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(" ");
|
|
3
|
-
return/*#__PURE__*/cloneElement(a,{className:d})});return/*#__PURE__*/_jsx(ThemeContext.Provider,{value:b,children:d})};
|
|
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{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(" ");return/*#__PURE__*/cloneElement(a,{className:d})});return/*#__PURE__*/_jsx(ThemeContext.Provider,{value:b,children:d})};
|