@transferwise/components 41.7.3-next-ecd0dbf129.13 → 41.8.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 +11 -0
- package/build/es/no-polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
- package/build/es/no-polyfill/actionButton/ActionButton.js +1 -1
- package/build/es/no-polyfill/alert/Alert.js +1 -1
- package/build/es/no-polyfill/avatar/Avatar.js +1 -1
- package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.js +1 -1
- package/build/es/no-polyfill/card/Card.js +1 -1
- package/build/es/no-polyfill/checkbox/Checkbox.js +1 -1
- package/build/es/no-polyfill/checkboxButton/CheckboxButton.story.js +1 -1
- package/build/es/no-polyfill/chips/Chip.js +1 -1
- package/build/es/no-polyfill/circularButton/CircularButton.js +1 -1
- package/build/es/no-polyfill/common/Option/Option.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/index.js +1 -1
- package/build/es/no-polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
- package/build/es/no-polyfill/common/theme.js +1 -1
- package/build/es/no-polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
- package/build/es/no-polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +1 -1
- package/build/es/no-polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
- package/build/es/no-polyfill/dateLookup/tableLink/TableLink.js +1 -1
- package/build/es/no-polyfill/drawer/Drawer.js +1 -1
- package/build/es/no-polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
- package/build/es/no-polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +1 -1
- package/build/es/no-polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
- package/build/es/no-polyfill/header/Header.js +2 -2
- package/build/es/no-polyfill/header/Header.story.js +2 -1
- package/build/es/no-polyfill/index.js +2 -2
- package/build/es/no-polyfill/inlineAlert/InlineAlert.js +1 -1
- package/build/es/no-polyfill/instructionsList/InstructionsList.js +3 -3
- package/build/es/no-polyfill/link/Link.js +3 -2
- package/build/es/no-polyfill/link/Link.story.js +1 -1
- package/build/es/no-polyfill/logo/Logo.js +1 -1
- package/build/es/no-polyfill/modal/Modal.js +1 -1
- package/build/es/no-polyfill/modal/Modal.story.js +1 -1
- package/build/es/no-polyfill/moneyInput/MoneyInput.js +1 -1
- package/build/es/no-polyfill/nudge/Nudge.js +1 -1
- package/build/es/no-polyfill/popover/Popover.js +1 -1
- package/build/es/no-polyfill/progressBar/ProgressBar.js +1 -1
- package/build/es/no-polyfill/radio/Radio.js +1 -1
- package/build/es/no-polyfill/select/Select.js +4 -4
- package/build/es/no-polyfill/select/option/Option.js +1 -1
- package/build/es/no-polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/no-polyfill/stepper/Stepper.js +1 -1
- package/build/es/no-polyfill/summary/Summary.js +1 -1
- package/build/es/no-polyfill/switch/Switch.js +1 -1
- package/build/es/no-polyfill/switch/Switch.story.js +1 -1
- package/build/es/no-polyfill/tabs/Tab.js +1 -1
- package/build/es/no-polyfill/tile/Tile.js +1 -1
- package/build/es/no-polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
- package/build/es/no-polyfill/upload/Upload.js +1 -1
- package/build/es/no-polyfill/upload/steps/completeStep/completeStep.js +1 -1
- package/build/es/no-polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
- package/build/es/no-polyfill/upload/steps/processingStep/processingStep.js +1 -1
- package/build/es/no-polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
- package/build/es/no-polyfill/uploadInput/UploadInput.story.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
- package/build/es/polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.js +1 -1
- package/build/es/polyfill/alert/Alert.js +1 -1
- package/build/es/polyfill/avatar/Avatar.js +1 -1
- package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -1
- package/build/es/polyfill/card/Card.js +1 -1
- package/build/es/polyfill/checkbox/Checkbox.js +1 -1
- package/build/es/polyfill/checkboxButton/CheckboxButton.story.js +1 -1
- package/build/es/polyfill/chips/Chip.js +1 -1
- package/build/es/polyfill/circularButton/CircularButton.js +1 -1
- package/build/es/polyfill/common/Option/Option.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/index.js +1 -1
- package/build/es/polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
- package/build/es/polyfill/common/theme.js +1 -1
- package/build/es/polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
- package/build/es/polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +1 -1
- package/build/es/polyfill/dateLookup/monthCalendar/table/MonthCalendarTable.js +1 -1
- package/build/es/polyfill/dateLookup/tableLink/TableLink.js +1 -1
- package/build/es/polyfill/drawer/Drawer.js +1 -1
- package/build/es/polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
- package/build/es/polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +1 -1
- package/build/es/polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
- package/build/es/polyfill/header/Header.js +2 -2
- package/build/es/polyfill/header/Header.story.js +2 -1
- package/build/es/polyfill/index.js +2 -2
- package/build/es/polyfill/inlineAlert/InlineAlert.js +1 -1
- package/build/es/polyfill/instructionsList/InstructionsList.js +3 -3
- package/build/es/polyfill/link/Link.js +3 -2
- package/build/es/polyfill/link/Link.story.js +1 -1
- package/build/es/polyfill/logo/Logo.js +1 -1
- package/build/es/polyfill/modal/Modal.js +1 -1
- package/build/es/polyfill/modal/Modal.story.js +1 -1
- package/build/es/polyfill/moneyInput/MoneyInput.js +1 -1
- package/build/es/polyfill/nudge/Nudge.js +1 -1
- package/build/es/polyfill/popover/Popover.js +1 -1
- package/build/es/polyfill/progressBar/ProgressBar.js +1 -1
- package/build/es/polyfill/radio/Radio.js +1 -1
- package/build/es/polyfill/select/Select.js +4 -4
- package/build/es/polyfill/select/option/Option.js +1 -1
- package/build/es/polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/polyfill/stepper/Stepper.js +1 -1
- package/build/es/polyfill/summary/Summary.js +1 -1
- package/build/es/polyfill/switch/Switch.js +1 -1
- package/build/es/polyfill/switch/Switch.story.js +1 -1
- package/build/es/polyfill/tabs/Tab.js +1 -1
- package/build/es/polyfill/tile/Tile.js +1 -1
- package/build/es/polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
- package/build/es/polyfill/upload/Upload.js +1 -1
- package/build/es/polyfill/upload/steps/completeStep/completeStep.js +1 -1
- package/build/es/polyfill/upload/steps/mediaUploadStep/mediaUploadStep.js +1 -1
- package/build/es/polyfill/upload/steps/processingStep/processingStep.js +1 -1
- package/build/es/polyfill/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
- package/build/es/polyfill/uploadInput/UploadInput.story.js +1 -1
- package/build/es/polyfill/uploadInput/uploadButton/UploadButton.js +1 -1
- package/build/es/polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
- 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/actionOption/ActionOption.css +1 -0
- 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/Option/Option.css +1 -1
- package/build/styles/common/bottomSheet/BottomSheet.css +1 -1
- package/build/styles/common/closeButton/CloseButton.css +1 -1
- package/build/styles/common/panel/Panel.css +1 -1
- package/build/styles/dateLookup/DateLookup.css +1 -1
- package/build/styles/dimmer/Dimmer.css +1 -1
- package/build/styles/drawer/Drawer.css +1 -1
- package/build/styles/emphasis/Emphasis.css +1 -1
- package/build/styles/flowNavigation/FlowNavigation.css +1 -1
- package/build/styles/flowNavigation/animatedLabel/AnimatedLabel.css +1 -1
- package/build/styles/header/Header.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/link/Link.css +1 -1
- package/build/styles/main.css +1 -1
- package/build/styles/modal/Modal.css +1 -1
- package/build/styles/moneyInput/MoneyInput.css +1 -1
- package/build/styles/navigationOption/NavigationOption.css +1 -1
- package/build/styles/nudge/Nudge.css +1 -1
- package/build/styles/overlayHeader/OverlayHeader.css +1 -1
- package/build/styles/popover/Popover.css +1 -1
- package/build/styles/progress/Progress.css +1 -1
- package/build/styles/progressBar/ProgressBar.css +1 -0
- package/build/styles/select/Select.css +1 -1
- package/build/styles/slidingPanel/SlidingPanel.css +1 -1
- package/build/styles/snackbar/Snackbar.css +1 -1
- package/build/styles/stepper/Stepper.css +1 -1
- package/build/styles/summary/Summary.css +1 -1
- package/build/styles/switch/Switch.css +1 -1
- package/build/styles/tabs/Tabs.css +1 -1
- package/build/styles/tile/Tile.css +1 -1
- package/build/styles/typeahead/Typeahead.css +1 -1
- package/build/styles/uploadInput/UploadInput.css +1 -1
- package/build/styles/uploadInput/uploadButton/UploadButton.css +1 -1
- package/build/styles/uploadInput/uploadItem/UploadItem.css +1 -1
- package/build/types/accordion/AccordionItem/AccordionItem.d.ts +3 -3
- package/build/types/alert/Alert.d.ts +0 -3
- package/build/types/common/RadioButton/RadioButton.d.ts +1 -1
- package/build/types/common/commonProps.d.ts +2 -0
- package/build/types/common/index.d.ts +0 -2
- package/build/types/common/panel/Panel.d.ts +1 -1
- package/build/types/common/responsivePanel/ResponsivePanel.d.ts +1 -1
- package/build/types/common/theme.d.ts +2 -6
- package/build/types/dateLookup/dayCalendar/DayCalendar.d.ts +1 -1
- package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts +1 -1
- package/build/types/dateLookup/monthCalendar/MonthCalendar.d.ts +1 -1
- package/build/types/dynamicFieldDefinitionList/FormattedValue/FormattedValue.d.ts +2 -2
- package/build/types/header/Header.d.ts +1 -1
- package/build/types/header/Header.story.d.ts +2 -1
- package/build/types/index.d.ts +2 -5
- package/build/types/instructionsList/InstructionsList.d.ts +11 -8
- package/build/types/link/Link.d.ts +5 -6
- package/build/types/link/Link.story.d.ts +2 -2
- package/build/types/provider/Provider.story.d.ts +3 -3
- package/build/types/select/searchBox/SearchBox.d.ts +1 -1
- package/build/types/tabs/TabPanel.d.ts +3 -3
- package/build/types/tile/Tile.d.ts +2 -2
- package/build/types/tooltip/Tooltip.story.d.ts +1 -1
- package/build/types/typeahead/typeaheadOption/TypeaheadOption.d.ts +2 -2
- package/build/types/upload/steps/mediaUploadStep/mediaUploadStep.d.ts +1 -1
- package/build/types/upload/steps/uploadImageStep/uploadImageStep.d.ts +1 -1
- 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 +9 -22
- package/scripts/generate-type-declarations.js +1 -0
- package/build/es/no-polyfill/body/Body.js +0 -1
- package/build/es/no-polyfill/body/Body.spec.js +0 -1
- package/build/es/no-polyfill/body/Body.story.js +0 -1
- package/build/es/no-polyfill/body/index.js +0 -1
- package/build/es/no-polyfill/common/propsValues/typography.js +0 -1
- package/build/es/no-polyfill/common/propsValues/variant.js +0 -1
- package/build/es/no-polyfill/criticalBanner/CriticalCommsBanner.js +0 -1
- package/build/es/no-polyfill/criticalBanner/CriticalCommsBanner.story.js +0 -1
- package/build/es/no-polyfill/criticalBanner/index.js +0 -1
- package/build/es/no-polyfill/display/Display.story.js +0 -1
- package/build/es/no-polyfill/logo/svg/logo-business-inverse.svg +0 -1
- package/build/es/no-polyfill/logo/svg/logo-business.svg +0 -1
- package/build/es/no-polyfill/logo/svg/logo-inverse.svg +0 -1
- package/build/es/no-polyfill/logo/svg/logo.svg +0 -1
- package/build/es/no-polyfill/title/Title.js +0 -1
- package/build/es/no-polyfill/title/Title.spec.js +0 -1
- package/build/es/no-polyfill/title/Title.story.js +0 -1
- package/build/es/no-polyfill/title/index.js +0 -1
- package/build/es/polyfill/body/Body.js +0 -1
- package/build/es/polyfill/body/Body.spec.js +0 -1
- package/build/es/polyfill/body/Body.story.js +0 -1
- package/build/es/polyfill/body/index.js +0 -1
- package/build/es/polyfill/common/propsValues/typography.js +0 -1
- package/build/es/polyfill/common/propsValues/variant.js +0 -1
- package/build/es/polyfill/criticalBanner/CriticalCommsBanner.js +0 -1
- package/build/es/polyfill/criticalBanner/CriticalCommsBanner.story.js +0 -1
- package/build/es/polyfill/criticalBanner/index.js +0 -1
- package/build/es/polyfill/display/Display.story.js +0 -1
- package/build/es/polyfill/logo/svg/logo-business-inverse.svg +0 -1
- package/build/es/polyfill/logo/svg/logo-business.svg +0 -1
- package/build/es/polyfill/logo/svg/logo-inverse.svg +0 -1
- package/build/es/polyfill/logo/svg/logo.svg +0 -1
- package/build/es/polyfill/title/Title.js +0 -1
- package/build/es/polyfill/title/Title.spec.js +0 -1
- package/build/es/polyfill/title/Title.story.js +0 -1
- package/build/es/polyfill/title/index.js +0 -1
- package/build/styles/criticalBanner/CriticalCommsBanner.css +0 -1
- package/build/types/body/Body.d.ts +0 -14
- package/build/types/body/Body.spec.d.ts +0 -1
- package/build/types/body/Body.story.d.ts +0 -8
- package/build/types/body/index.d.ts +0 -1
- package/build/types/common/propsValues/typography.d.ts +0 -28
- package/build/types/common/propsValues/variant.d.ts +0 -4
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts +0 -12
- package/build/types/criticalBanner/CriticalCommsBanner.story.d.ts +0 -8
- package/build/types/criticalBanner/index.d.ts +0 -1
- package/build/types/display/Display.story.d.ts +0 -6
- package/build/types/title/Title.d.ts +0 -14
- package/build/types/title/Title.spec.d.ts +0 -1
- package/build/types/title/Title.story.d.ts +0 -8
- package/build/types/title/index.d.ts +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [41.8.0](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.7.2...@transferwise/components@41.8.0) (2022-11-16)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* support onClick on Anchor Links ([#1745](https://github.com/transferwise/neptune-web/issues/1745)) ([09caea5](https://github.com/transferwise/neptune-web/commit/09caea5b774987971e24d5781643bb5da1cf9a8e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [41.7.2](https://github.com/transferwise/neptune-web/compare/@transferwise/components@41.7.1...@transferwise/components@41.7.2) (2022-11-11)
|
|
7
18
|
|
|
8
19
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
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 _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["disabled","className","onClick","text","children"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";var ActionButton=/*#__PURE__*/forwardRef(function(a,b){var c=a.disabled,d=a.className,e=void 0===d?void 0:d,f=a.onClick,g=a.text,h=a.children,i=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx("button",_objectSpread(_objectSpread({ref:b,type:"button",className:classNames("np-action-btn",
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["disabled","className","onClick","text","children"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";var ActionButton=/*#__PURE__*/forwardRef(function(a,b){var c=a.disabled,d=a.className,e=void 0===d?void 0:d,f=a.onClick,g=a.text,h=a.children,i=_objectWithoutProperties(a,_excluded);return/*#__PURE__*/_jsx("button",_objectSpread(_objectSpread({ref:b,type:"button",className:classNames("np-action-btn",e),disabled:void 0!==c&&c,onClick:f},i),{},{children:h||g}))});export default ActionButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";var _deprecatedTypeMap,_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,
|
|
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{Size,Theme}from"../common";import{AvatarType}from"./avatarTypes";import{jsx as _jsx}from"react/jsx-runtime";var Avatar=function(a){var b=a.backgroundColor,c=a.children,d=a.className,e=a.outlined,f=a.size,g=a.theme,h=a.type;return/*#__PURE__*/_jsx("div",{className:classnames("tw-avatar",d,"tw-avatar--".concat(f),"tw-avatar--".concat(h),"tw-avatar--".concat(g),{"tw-avatar--outlined":e
|
|
1
|
+
import classnames from"classnames";import PropTypes from"prop-types";import{Size,Theme}from"../common";import{AvatarType}from"./avatarTypes";import{jsx as _jsx}from"react/jsx-runtime";var Avatar=function(a){var b=a.backgroundColor,c=a.children,d=a.className,e=a.outlined,f=a.size,g=a.theme,h=a.type;return/*#__PURE__*/_jsx("div",{className:classnames("tw-avatar",d,"tw-avatar--".concat(f),"tw-avatar--".concat(h),"tw-avatar--".concat(g),{"tw-avatar--outlined":e}),children:/*#__PURE__*/_jsx("div",{className:"tw-avatar__content",style:{backgroundColor:b||void 0},children:c})})};Avatar.propTypes={backgroundColor:PropTypes.string,children:PropTypes.node,className:PropTypes.string,outlined:PropTypes.bool,size:PropTypes.oneOf(["sm","md","lg"]),theme:PropTypes.oneOf(["light","dark"]),type:PropTypes.oneOf(["thumbnail","icon","emoji","initials"])},Avatar.defaultProps={backgroundColor:null,children:null,className:null,outlined:!1,size:Size.MEDIUM,theme:Theme.LIGHT,type:AvatarType.THUMBNAIL};export default Avatar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["url","children"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{Person as ProfileIcon,Briefcase as BriefcaseIcon}from"@transferwise/icons";import PropTypes from"prop-types";import{useState,useEffect}from"react";import Avatar,{AvatarType}from"../avatar";import Badge from"../badge";import
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["url","children"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{Person as ProfileIcon,Briefcase as BriefcaseIcon}from"@transferwise/icons";import PropTypes from"prop-types";import{useState,useEffect}from"react";import Avatar,{AvatarType}from"../avatar";import Badge from"../badge";import{ProfileType,Size}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var OptionalBadge=function(a){var b=a.url,c=a.children,d=_objectWithoutProperties(a,_excluded);return b?/*#__PURE__*/_jsx(Badge,_objectSpread(_objectSpread({badge:/*#__PURE__*/_jsx("img",{src:b,alt:""})},d),{},{children:c})):c};OptionalBadge.propTypes={url:PropTypes.string,children:PropTypes.node.isRequired},OptionalBadge.defaultProps={url:void 0};var AvatarWrapper=function(a){var b=a.url,c=a.profileType,d=a.badgeUrl,e=a.name,f=a.avatarProps,g=a.badgeProps,h=useState(!1),i=_slicedToArray(h,2),j=i[0],k=i[1],l=c===ProfileType.BUSINESS;useEffect(function(){return k(!1)},[b]);return/*#__PURE__*/_jsx(OptionalBadge,_objectSpread(_objectSpread({url:d},g),{},{children:/*#__PURE__*/_jsx(Avatar,_objectSpread({size:Size.MEDIUM},function getAvatarProps(){return b&&!j?_objectSpread({type:AvatarType.THUMBNAIL,children:/*#__PURE__*/_jsx("img",{src:b,alt:"avatar",onError:function onError(){return k(!0)}})},f):c?_objectSpread({type:AvatarType.ICON,children:l?/*#__PURE__*/_jsx(BriefcaseIcon,{size:"24"}):/*#__PURE__*/_jsx(ProfileIcon,{size:"24"})},f):e?_objectSpread({type:AvatarType.INITIALS,children:/*#__PURE__*/_jsx("small",{children:getInitials(e)})},f):_objectSpread({type:AvatarType.ICON,children:/*#__PURE__*/_jsx(ProfileIcon,{size:"24"})},f)}()))}))};function getInitials(a){var b=a.split(" ").map(function(a){return a[0]}).join("").toUpperCase();return 1===b.length?b[0]:b[0]+b.slice(-1)}AvatarWrapper.defaultProps={url:void 0,profileType:void 0,badgeUrl:void 0,name:void 0,avatarProps:{},badgeProps:{}},AvatarWrapper.propTypes={url:PropTypes.string,profileType:PropTypes.oneOf(["PERSONAL","BUSINESS"]),badgeUrl:PropTypes.string,name:PropTypes.string,avatarProps:PropTypes.shape({}),badgeProps:PropTypes.shape({})};export default AvatarWrapper;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["aria-label","as","isExpanded","title","details","children","onClick","icon","id","className"];import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import requiredIf from"react-required-if";import
|
|
1
|
+
import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["aria-label","as","isExpanded","title","details","children","onClick","icon","id","className"];import classNames from"classnames";import PropTypes from"prop-types";import{forwardRef}from"react";import requiredIf from"react-required-if";import Chevron from"../chevron";import{Position}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Card=/*#__PURE__*/forwardRef(function(a,b){var c=a["aria-label"],d=a.as,e=a.isExpanded,f=a.title,g=a.details,h=a.children,i=a.onClick,j=a.icon,k=a.id,l=a.className,m=_objectWithoutProperties(a,_excluded),n=!!(e&&h);return/*#__PURE__*/_jsxs(d,{ref:b,className:classNames("np-card",l,{"np-card--expanded":n,"np-card--inactive":!h,"np-card--has-icon":!!j}),id:k,"data-testid":m["data-testid"],children:[/*#__PURE__*/_jsx(Option,{"aria-label":c,as:h?"button":"div",className:classNames("np-card__button"),media:j,title:f,content:g,showMediaAtAllSizes:!0,button:h&&/*#__PURE__*/_jsx(Chevron,{orientation:n?Position.TOP:Position.BOTTOM}),onClick:function onClick(){return h&&i(!e)}}),/*#__PURE__*/_jsx("div",{className:classNames("np-card__divider",{"np-card__divider--expanded":n})}),n&&/*#__PURE__*/_jsx("div",{className:"np-card__content",children:h})]})}),hasChildren=function(a){var b=a.children;return b};Card.propTypes={"aria-label":PropTypes.string,as:PropTypes.string,isExpanded:requiredIf(PropTypes.bool,hasChildren),title:PropTypes.node.isRequired,details:PropTypes.node.isRequired,onClick:requiredIf(PropTypes.func,hasChildren),icon:PropTypes.node,children:PropTypes.node,id:PropTypes.string,className:PropTypes.string,"data-testid":PropTypes.string},Card.defaultProps={"aria-label":void 0,as:"div",children:null,id:null,className:null,"data-testid":null};export default Card;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import
|
|
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 _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{boolean}from"@storybook/addon-knobs";import{useState}from"react";import CheckboxButton from"./CheckboxButton";import{jsx as _jsx}from"react/jsx-runtime";export default{component:CheckboxButton,title:"
|
|
1
|
+
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import{boolean}from"@storybook/addon-knobs";import{useState}from"react";import CheckboxButton from"./CheckboxButton";import{jsx as _jsx}from"react/jsx-runtime";export default{component:CheckboxButton,title:"CheckboxButton"};var onBlur=function(){return console.log("blur")},onClick=function(){return console.log("click")},onFocus=function(){return console.log("focus")};export var Basic=function(){var a=useState(!0),b=_slicedToArray(a,2),c=b[0],d=b[1],e=boolean("disabled",!1);return/*#__PURE__*/_jsx(CheckboxButton,{"aria-label":"Toggle email updates",checked:c,disabled:e,onBlur:onBlur,onClick:onClick,onFocus:onFocus,onChange:function onChange(){return d(!c)}})};
|
|
@@ -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
|
|
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 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","children","disabled","icon","priority","type"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["className","children","disabled","icon","priority","type"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import PropTypes from"prop-types";import{cloneElement}from"react";import{typeClassMap,priorityClassMap}from"../button/classMap";import{ControlType,Priority}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var CircularButton=function(a){var b=a.className,c=a.children,d=a.disabled,e=a.icon,f=a.priority,g=a.type,h=_objectWithoutProperties(a,_excluded),i=classNames("btn np-btn",typeClassMap[g],priorityClassMap[f]),j=24===e.props.size?e:/*#__PURE__*/cloneElement(e,{size:24});return/*#__PURE__*/_jsxs("label",{className:classNames("np-circular-btn",f,g,d?"disabled":"",b),children:[/*#__PURE__*/_jsx("input",_objectSpread({type:"button","aria-label":c,className:i,disabled:d},h)),j,/*#__PURE__*/_jsx("span",{className:"np-circular-btn__label",children:c})]})};CircularButton.propTypes={className:PropTypes.string,children:PropTypes.string.isRequired,disabled:PropTypes.bool,icon:PropTypes.element.isRequired,onClick:PropTypes.func.isRequired,priority:PropTypes.oneOf(["primary","secondary"]),type:PropTypes.oneOf(["accent","positive","negative"])},CircularButton.defaultProps={className:void 0,disabled:!1,priority:Priority.PRIMARY,type:ControlType.ACCENT};export default CircularButton;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["media","title","content","as","button","decision","disabled","complex","inverseMediaCircle","className","showMediaAtAllSizes","showMediaCircle"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["media","title","content","as","button","decision","disabled","complex","inverseMediaCircle","className","showMediaAtAllSizes","showMediaCircle"];function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Option=/*#__PURE__*/forwardRef(function(a,b){var c,d=a.media,e=void 0===d?"":d,f=a.title,g=a.content,h=a.as,i=a.button,j=a.decision,k=a.disabled,l=void 0!==k&&k,m=a.complex,n=a.inverseMediaCircle,o=a.className,p=a.showMediaAtAllSizes,q=a.showMediaCircle,r=_objectWithoutProperties(a,_excluded),s=null!==(c=h)&&void 0!==c?c:"label";return/*#__PURE__*/_jsx(s,_objectSpread(_objectSpread({},r),{},{ref:b,className:classNames("np-option",o,{"decision-complex":m,decision:!(void 0!==j)||j,disabled:l,"np-option__sm-media":p}),disabled:l&&"button"===s,children:/*#__PURE__*/_jsxs("div",{className:"media",children:[e&&/*#__PURE__*/_jsx("div",{className:"media-left",children:!(void 0!==q)||q?/*#__PURE__*/_jsx("div",{className:classNames("circle circle-sm text-primary",{"circle-inverse":!(void 0!==n)||n}),children:e}):/*#__PURE__*/_jsx("div",{className:"np-option__no-media-circle",children:e})}),/*#__PURE__*/_jsxs("div",{className:"media-body",children:[/*#__PURE__*/_jsx("div",{className:"decision__title",children:f}),g&&/*#__PURE__*/_jsx("div",{className:"decision__content",children:g})]}),/*#__PURE__*/_jsx("div",{className:"media-right",children:i})]})}))});export default Option;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import
|
|
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
|
export{default as HistoryNavigator}from"./historyNavigator";export*from"./domHelpers";export{addNoScrollBodyClass,removeNoScrollBodyClass}from"./DOMOperations";export*from"./theme";export*from"./direction";// Props
|
|
2
|
-
export*from"./propsValues/control";export{Breakpoint}from"./propsValues/breakpoint";export*from"./propsValues/size";export*from"./propsValues/
|
|
2
|
+
export*from"./propsValues/control";export{Breakpoint}from"./propsValues/breakpoint";export*from"./propsValues/size";export*from"./propsValues/width";export{Type}from"./propsValues/type";export{DateMode}from"./propsValues/dateMode";export{MonthFormat}from"./propsValues/monthFormat";export*from"./propsValues/position";export{Layout}from"./propsValues/layouts";export{Status}from"./propsValues/status";export{Sentiment}from"./propsValues/sentiment";export{ProfileType}from"./propsValues/profileType";export*from"./propsValues/scroll";export{MarkdownNodeType}from"./propsValues/markdownNodeType";export{FileType}from"./fileType";export{Key}from"./key";export*from"./locale";export*from"./commonProps";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
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"
|
|
1
|
+
export var Theme;(function(a){a.LIGHT="light",a.DARK="dark",a.NAVY="navy"})(Theme||(Theme={}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import PropTypes from"prop-types";import Chevron from"../../chevron";import{Position,Size}from"../../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var buttonClasses="btn-link p-a-0 text-no-decoration
|
|
1
|
+
import PropTypes from"prop-types";import Chevron from"../../chevron";import{Position,Size}from"../../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var buttonClasses="btn-link p-a-0 text-no-decoration font-weight-bold",DateHeader=function(a){var b=a.label,c=a.onLabelClick,d=a.onPreviousClick,e=a.onNextClick;return/*#__PURE__*/_jsxs("div",{className:"text-xs-center p-t-1 p-b-2 clearfix",children:[/*#__PURE__*/_jsx("div",{className:"pull-left-single-direction",children:/*#__PURE__*/_jsx("button",{type:"button",className:buttonClasses,onClick:d,children:/*#__PURE__*/_jsx(Chevron,{orientation:Position.LEFT,className:"left-single-direction",size:Size.MEDIUM})})}),b&&/*#__PURE__*/_jsx("button",{type:"button",className:"tw-date-lookup-header-current ".concat(buttonClasses),onClick:c,children:b}),/*#__PURE__*/_jsx("div",{className:"pull-right-single-direction",children:/*#__PURE__*/_jsx("button",{type:"button",className:buttonClasses,onClick:e,children:/*#__PURE__*/_jsx(Chevron,{orientation:Position.RIGHT,className:"right-single-direction",size:Size.MEDIUM})})})]})};DateHeader.propTypes={label:PropTypes.string,onLabelClick:PropTypes.func,onPreviousClick:PropTypes.func.isRequired,onNextClick:PropTypes.func.isRequired},DateHeader.defaultProps={label:null,onLabelClick:function onLabelClick(){}};export default DateHeader;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{PureComponent}from"react";import{injectIntl}from"react-intl";import{getDayNames,isWithinRange}from"../../../common/dateUtils";import{getStartOfDay}from"../../getStartOfDay";import TableLink from"../../tableLink";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var SHORT_DAY_FORMAT={day:"numeric"},DayCalendarTable=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"getTableStructure",function(){var b=a.props,c=b.viewMonth,d=b.viewYear,e=new Date(d,c,1).getDay();0===e&&(e=7);var f,g=new Date(d,c+1,0).getDate(),h=[],j=[];// Pad first week
|
|
2
2
|
for(f=1;f<e;f+=1)h.push(!1);// Fill in days
|
|
3
3
|
for(f=1;f<=g;f+=1)h.push(f),0==(e+f-1)%7&&(j.push(h),h=[]);if(0<h.length){// Pad last week
|
|
4
|
-
for(f=h.length;7>f;f+=1)h.push(!1);j.push(h)}return j}),_defineProperty(_assertThisInitialized(a),"days",getDayNames(a.props.intl.locale,"short")),_defineProperty(_assertThisInitialized(a),"daysShort",getDayNames(a.props.intl.locale,"narrow")),_defineProperty(_assertThisInitialized(a),"selectDay",function(b){var c=a.props,d=c.viewMonth,e=c.viewYear,f=c.onSelect;f(new Date(e,d,b))}),_defineProperty(_assertThisInitialized(a),"isDisabled",function(b){var c=a.props,d=c.min,e=c.max,f=c.viewMonth,g=c.viewYear,h=new Date(g,f,b);return!isWithinRange(h,d,e)}),_defineProperty(_assertThisInitialized(a),"isActive",function(b){var c=a.props,d=c.selectedDate,e=c.viewMonth,f=c.viewYear;return!!(d&&+new Date(f,e,b)==+d)}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this,b=this.props,c=b.viewMonth,d=b.viewYear,e=b.intl.locale,f=this.getTableStructure();return/*#__PURE__*/_jsxs("table",{className:"table table-condensed table-bordered tw-date-lookup-calendar m-b-0",children:[/*#__PURE__*/_jsx("thead",{children:/*#__PURE__*/_jsx("tr",{children:this.days.map(function(b,c){return/*#__PURE__*/_jsxs("th",{className:"text-xs-center
|
|
4
|
+
for(f=h.length;7>f;f+=1)h.push(!1);j.push(h)}return j}),_defineProperty(_assertThisInitialized(a),"days",getDayNames(a.props.intl.locale,"short")),_defineProperty(_assertThisInitialized(a),"daysShort",getDayNames(a.props.intl.locale,"narrow")),_defineProperty(_assertThisInitialized(a),"selectDay",function(b){var c=a.props,d=c.viewMonth,e=c.viewYear,f=c.onSelect;f(new Date(e,d,b))}),_defineProperty(_assertThisInitialized(a),"isDisabled",function(b){var c=a.props,d=c.min,e=c.max,f=c.viewMonth,g=c.viewYear,h=new Date(g,f,b);return!isWithinRange(h,d,e)}),_defineProperty(_assertThisInitialized(a),"isActive",function(b){var c=a.props,d=c.selectedDate,e=c.viewMonth,f=c.viewYear;return!!(d&&+new Date(f,e,b)==+d)}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this,b=this.props,c=b.viewMonth,d=b.viewYear,e=b.intl.locale,f=this.getTableStructure();return/*#__PURE__*/_jsxs("table",{className:"table table-condensed table-bordered tw-date-lookup-calendar m-b-0",children:[/*#__PURE__*/_jsx("thead",{children:/*#__PURE__*/_jsx("tr",{children:this.days.map(function(b,c){return/*#__PURE__*/_jsxs("th",{className:"text-xs-center",children:[/*#__PURE__*/_jsx("span",{className:"hidden-xs",children:b.slice(0,3)}),/*#__PURE__*/_jsx("span",{className:"visible-xs-inline-block",children:a.daysShort[c].slice(0,2)})]},b)})})}),/*#__PURE__*/_jsx("tbody",{children:f.map(function(b,f){return/*#__PURE__*/_jsx("tr",{children:b.map(function(b,f){return/*#__PURE__*/_jsx("td",{className:4<f?"default":"",children:b&&/*#__PURE__*/_jsx(TableLink,{item:b,type:"day",title:formatDate(new Date(d,c,b),e,SHORT_DAY_FORMAT),longTitle:formatDate(new Date(d,c,b),e),active:a.isActive(b),disabled:a.isDisabled(b),today:+getStartOfDay(new Date)==+new Date(d,c,b),onClick:a.selectDay})},f)})},f)})})]})}}]),b}(PureComponent);DayCalendarTable.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewMonth:PropTypes.number.isRequired,viewYear:PropTypes.number.isRequired,onSelect:PropTypes.func.isRequired},DayCalendarTable.defaultProps={selectedDate:null,min:null,max:null};export default injectIntl(DayCalendarTable);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{useIntl}from"react-intl";import TableLink from"../../tableLink";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ROWS=3,COLS=4,MONTH_ONLY_FORMAY={month:"short"},MonthCalendarTable=function(a){var b=a.selectedDate,c=a.min,d=a.max,e=a.viewYear,f=a.placeholder,g=a.onSelect,h=useIntl(),i=h.locale,j=function(a){return/*#__PURE__*/_jsx(TableLink,{item:a,type:"month",title:formatDate(new Date(e,a),i,MONTH_ONLY_FORMAY),active:!!(b&&a===b.getMonth()&&e===b.getFullYear()),disabled:k(a),today:e===new Date().getFullYear()&&a===new Date().getMonth(),onClick:g})},k=function(a){var b=new Date(e,a);return!!(c&&b<new Date(c.getFullYear(),c.getMonth())||d&&b>new Date(d.getFullYear(),d.getMonth()))};return/*#__PURE__*/_jsxs("table",{className:"table table-condensed table-bordered tw-date-lookup-calendar
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import{formatDate}from"@transferwise/formatting";import PropTypes from"prop-types";import{useIntl}from"react-intl";import TableLink from"../../tableLink";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ROWS=3,COLS=4,MONTH_ONLY_FORMAY={month:"short"},MonthCalendarTable=function(a){var b=a.selectedDate,c=a.min,d=a.max,e=a.viewYear,f=a.placeholder,g=a.onSelect,h=useIntl(),i=h.locale,j=function(a){return/*#__PURE__*/_jsx(TableLink,{item:a,type:"month",title:formatDate(new Date(e,a),i,MONTH_ONLY_FORMAY),active:!!(b&&a===b.getMonth()&&e===b.getFullYear()),disabled:k(a),today:e===new Date().getFullYear()&&a===new Date().getMonth(),onClick:g})},k=function(a){var b=new Date(e,a);return!!(c&&b<new Date(c.getFullYear(),c.getMonth())||d&&b>new Date(d.getFullYear(),d.getMonth()))};return/*#__PURE__*/_jsxs("table",{className:"table table-condensed table-bordered tw-date-lookup-calendar m-b-0",children:[/*#__PURE__*/_jsx("thead",{className:"sr-only",children:/*#__PURE__*/_jsx("tr",{children:/*#__PURE__*/_jsx("th",{colSpan:"3",children:f})})}),/*#__PURE__*/_jsx("tbody",{children:_toConsumableArray([,,,]).map(function(a,b){return/*#__PURE__*/_jsx("tr",{children:_toConsumableArray(Array(COLS)).map(function(a,c){return/*#__PURE__*/_jsx("td",{children:j(b*COLS+c)},c)})},b)})})]})};MonthCalendarTable.propTypes={selectedDate:PropTypes.instanceOf(Date),min:PropTypes.instanceOf(Date),max:PropTypes.instanceOf(Date),viewYear:PropTypes.number.isRequired,placeholder:PropTypes.string.isRequired,onSelect:PropTypes.func.isRequired},MonthCalendarTable.defaultProps={selectedDate:null,min:null,max:null};export default MonthCalendarTable;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import PropTypes from"prop-types";import{PureComponent}from"react";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var TableLink=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"onClick",function(b){b.preventDefault(),a.props.disabled||a.props.onClick(a.props.item)}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.item,c=a.type,d=a.title,e=a.longTitle,f=a.active,g=a.disabled,h=a.today;return/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx("button",{type:"button",className:"tw-date-lookup-".concat(c,"-option ").concat(f?"active":""," ").concat(h?"today":""
|
|
1
|
+
import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import PropTypes from"prop-types";import{PureComponent}from"react";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";var TableLink=/*#__PURE__*/function(a){function b(){var a;_classCallCheck(this,b);for(var d=arguments.length,e=Array(d),f=0;f<d;f++)e[f]=arguments[f];return a=c.call.apply(c,[this].concat(e)),_defineProperty(_assertThisInitialized(a),"onClick",function(b){b.preventDefault(),a.props.disabled||a.props.onClick(a.props.item)}),a}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"render",value:function render(){var a=this.props,b=a.item,c=a.type,d=a.title,e=a.longTitle,f=a.active,g=a.disabled,h=a.today;return/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx("button",{type:"button",className:"tw-date-lookup-".concat(c,"-option ").concat(f?"active":""," ").concat(h?"today":""),disabled:g,"aria-label":e,onClick:this.onClick,children:d||b})})}}]),b}(PureComponent);TableLink.propTypes={item:PropTypes.number.isRequired,// day (1-31), month (0-11) or year (2018 etc)
|
|
2
2
|
type:PropTypes.oneOf(["day","month","year"]).isRequired,title:PropTypes.string,longTitle:PropTypes.string,active:PropTypes.bool.isRequired,disabled:PropTypes.bool.isRequired,today:PropTypes.bool.isRequired,onClick:PropTypes.func.isRequired},TableLink.defaultProps={title:null,longTitle:null};export default TableLink;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import
|
|
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 +1 @@
|
|
|
1
|
-
import PropTypes from"prop-types";import{
|
|
1
|
+
import PropTypes from"prop-types";import{Layout}from"../common";import{prepFields}from"../common/requirements";import DefinitionList from"../definitionList";import createDefinitions from"./utils/createDefinitions";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var DynamicFieldDefinitionList=function(a){var b=a.model,c=a.title,d=a.layout,e=a.fields;return/*#__PURE__*/_jsxs(_Fragment,{children:[c&&/*#__PURE__*/_jsx("div",{className:"m-t-1",children:/*#__PURE__*/_jsx("div",{className:"p-t-3 title-4",children:c})}),/*#__PURE__*/_jsx(DefinitionList,{layout:d,definitions:createDefinitions(prepFields(e),b)})]})};DynamicFieldDefinitionList.propTypes={model:PropTypes.shape({}).isRequired,fields:PropTypes.shape({}).isRequired,title:PropTypes.string,layout:PropTypes.oneOf(["VERTICAL_TWO_COLUMN","VERTICAL_ONE_COLUMN","HORIZONTAL_JUSTIFIED","HORIZONTAL_LEFT_ALIGNED"])},DynamicFieldDefinitionList.defaultProps={title:null,layout:Layout.VERTICAL_TWO_COLUMN};export default DynamicFieldDefinitionList;
|
|
@@ -2,7 +2,7 @@ import{formatDate,formatNumber}from"@transferwise/formatting";import classNames
|
|
|
2
2
|
*
|
|
3
3
|
* @param {Array} options
|
|
4
4
|
* @param {string|number} value
|
|
5
|
-
*/import{jsx as _jsx}from"react/jsx-runtime";var getValueLabel=function(a,b){var c=a.find(function(a){return a.value===b});return c&&c.label?c.label:b},mask=function(a){return Array(a.length+1).join("*")},FormattedValue=function(a){var b=a.field,c=a.value,d=useIntl(),e=d.locale,f=[];switch(b.tagClassName&&b.tagClassName.h3&&(f.push("
|
|
5
|
+
*/import{jsx as _jsx}from"react/jsx-runtime";var getValueLabel=function(a,b){var c=a.find(function(a){return a.value===b});return c&&c.label?c.label:b},mask=function(a){return Array(a.length+1).join("*")},FormattedValue=function(a){var b=a.field,c=a.value,d=useIntl(),e=d.locale,f=[];switch(b.tagClassName&&b.tagClassName.h3&&(f.push("title-3"),f.push("formatted-value__h3-custom-alignment")),b.control){case"select":case"radio":return/*#__PURE__*/_jsx("span",{children:getValueLabel(b.values,c)});case"date":return/*#__PURE__*/_jsx("span",{children:formatDate(c instanceof Date?c:new Date(c),e)});case"number":return/*#__PURE__*/_jsx("span",{children:formatNumber(c,e)});case"password":return/*#__PURE__*/_jsx("span",{children:mask(c)});case"file":return/*#__PURE__*/_jsx("div",{className:"thumbnail",children:/*#__PURE__*/_jsx("img",{alt:b.title,src:c})});case"checkbox":return/*#__PURE__*/_jsx("span",{children:JSON.stringify(c)});default:return/*#__PURE__*/_jsx("span",{className:classNames(f),children:formatUsingPattern(c,b.displayFormat)});}};/**
|
|
6
6
|
*
|
|
7
7
|
* @param {string} value
|
|
8
8
|
*/FormattedValue.propTypes={field:PropTypes.shape({control:PropTypes.string.isRequired,displayFormat:PropTypes.string,refreshRequirementsOnChange:PropTypes.bool,title:PropTypes.string.isRequired,type:PropTypes.string.isRequired,width:PropTypes.string,tagClassName:PropTypes.shape({h3:PropTypes.bool}),values:PropTypes.arrayOf(PropTypes.shape({value:PropTypes.any}))}).isRequired,value:PropTypes.any.isRequired};export default FormattedValue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import{jsx as _jsx}from"react/jsx-runtime";var AnimatedLabel=function(a){var b=a.activeLabel,c=a.className,d=a.labels,e=d.length-1;return/*#__PURE__*/_jsx("div",{className:classNames("np-animated-label",
|
|
1
|
+
import classNames from"classnames";import PropTypes from"prop-types";import{jsx as _jsx}from"react/jsx-runtime";var AnimatedLabel=function(a){var b=a.activeLabel,c=a.className,d=a.labels,e=d.length-1;return/*#__PURE__*/_jsx("div",{className:classNames("np-animated-label",c),children:d.map(function(a,c){var d=c-1;return/*#__PURE__*/_jsx("div",{className:classNames("text-xs-left",{"np-animated-label--in":c===b,"np-animated-label--out":d===b&&d!==e}),children:a},d)})})};AnimatedLabel.propTypes={activeLabel:PropTypes.number.isRequired,className:PropTypes.string,labels:PropTypes.arrayOf(PropTypes.node).isRequired},AnimatedLabel.defaultProps={className:void 0};export default AnimatedLabel;
|
|
@@ -1,5 +1,5 @@
|
|
|
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
|
|
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",onClick:b.onClick};return"href"in b?/*#__PURE__*/_jsx(Link,_objectSpread(_objectSpread({href:b.href,target:b.target},c),{},{children:b.text})):/*#__PURE__*/_jsx(ActionButton,_objectSpread(_objectSpread({},c),{},{children:b.text}))};/**
|
|
2
2
|
*
|
|
3
3
|
* Neptune Web: https://transferwise.github.io/neptune-web/components/content/Header
|
|
4
4
|
*
|
|
5
|
-
*/export var Header=function(a){var b=a.action,c=a.as,d=void 0===c?"h5":c,e=a.title,f=a.className;return/*#__PURE__*/_jsxs("div",{className:classNames("np-header",f),children:[/*#__PURE__*/_jsx(
|
|
5
|
+
*/export var Header=function(a){var b=a.action,c=a.as,d=void 0===c?"h5":c,e=a.title,f=a.className;return/*#__PURE__*/_jsxs("div",{className:classNames("np-header",f),children:[/*#__PURE__*/_jsx(d,{className:"np-header__title title-5",children:e}),b&&/*#__PURE__*/_jsx(HeaderAction,{action:b})]})};export default Header;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
import Header from"./Header";import{jsx as _jsx}from"react/jsx-runtime";export default{component:Header,title:"Header"};export var Basic=function(){return/*#__PURE__*/_jsx(Header,{title:"Header title"})};export var WithAction=function(){return/*#__PURE__*/_jsx(Header,{title:"Header title",action:{"aria-label":"Magic",text:"Click me!",onClick:function onClick(){return alert("Action!")}}})};export var WithActionAsLink=function(){return/*#__PURE__*/_jsx(Header,{title:"Header title",action:{text:"This is a link",href:"https://wise.com",target:"_blank"}})};
|
|
1
|
+
import Header from"./Header";import{jsx as _jsx}from"react/jsx-runtime";export default{component:Header,title:"Header"};export var Basic=function(){return/*#__PURE__*/_jsx(Header,{title:"Header title"})};export var WithAction=function(){return/*#__PURE__*/_jsx(Header,{title:"Header title",action:{"aria-label":"Magic",text:"Click me!",onClick:function onClick(){return alert("Action!")}}})};export var WithActionAsLink=function(){return/*#__PURE__*/_jsx(Header,{title:"Header title",action:{text:"This is a link",href:"https://wise.com",target:"_blank"}})};export var WithActionAsLinkPreventingNavigationWithTracking=function(){return/*#__PURE__*/_jsx(Header,{title:"Header title",action:{text:"This is a link",href:"https://wise.com",target:"_blank",onClick:function onClick(a){// we can stop the navigation from happening as onClick will always run before href redirect
|
|
2
|
+
alert("Running onClick handler"),a.preventDefault()}}})};
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* Types
|
|
3
3
|
*/ /**
|
|
4
4
|
* Components
|
|
5
|
-
*/export{default as
|
|
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
|
|
9
|
-
*/export{Direction,Size,Width,Sentiment,Priority,ControlType,Type,Theme,DateMode,MonthFormat,Position,Scroll,ProfileType,Breakpoint,Layout,Status,MarkdownNodeType
|
|
9
|
+
*/export{Direction,Size,Width,Sentiment,Priority,ControlType,Type,Theme,DateMode,MonthFormat,Position,Scroll,ProfileType,Breakpoint,Layout,Status,MarkdownNodeType}from"./common";export{AvatarType}from"./avatar";export{InfoPresentation}from"./info";export{UploadStep}from"./upload";export{DecisionPresentation,DecisionType}from"./decision";export{AlertArrowPosition}from"./alert/withArrow";export{LogoType}from"./logo";export{FileType}from"./common";/**
|
|
10
10
|
* Utils
|
|
11
11
|
*/export{SUPPORTED_LANGUAGES,RTL_LANGUAGES,DEFAULT_LANG,DEFAULT_LOCALE,adjustLocale,getLangFromLocale,getCountryFromLocale,getDirectionFromLocale,isServerSide,isBrowser}from"./common";/**
|
|
12
12
|
* Translations
|
|
@@ -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
|
|
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 PropTypes from"prop-types";import withArrow,{AlertArrowPosition}from"../alert/withArrow";import{Sentiment}from"../common";import{jsx as _jsx}from"react/jsx-runtime";var typeClassMap=_defineProperty({},Sentiment.ERROR,"danger"),InlineAlert=function(a){var b=withArrow(function(b){var c=b.children,d=b.className,e=b.type,f="alert-".concat(typeClassMap[e]||e);return/*#__PURE__*/_jsx("div",{role:"alert",id:a.id,className:classNames("alert alert-detach p-x-2 p-y-1",f,d),children:c})},AlertArrowPosition.TOP_LEFT);return/*#__PURE__*/_jsx(b,_objectSpread({},a))};InlineAlert.propTypes={children:PropTypes.node.isRequired,className:PropTypes.string,id:PropTypes.string,type:PropTypes.oneOf(["positive","negative","warning","neutral","success","info","error"])},InlineAlert.defaultProps={className:void 0,id:void 0,type:Sentiment.NEUTRAL};export default InlineAlert;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{CrossCircle,
|
|
2
|
-
_jsxs("div",{className:"instruction",children:[/*#__PURE__*/_jsx(
|
|
3
|
-
_jsxs("div",{className:"instruction",children:[/*#__PURE__*/_jsx(
|
|
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,5 +1,6 @@
|
|
|
1
|
-
import
|
|
1
|
+
import{NavigateAway as NavigateAwayIcon}from"@transferwise/icons";import classNames from"classnames";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";/**
|
|
2
2
|
* Standard Link component with navigate away icon
|
|
3
3
|
*
|
|
4
4
|
* Documentation: https://transferwise.github.io/neptune-web/components/content/Link
|
|
5
|
-
|
|
5
|
+
*
|
|
6
|
+
*/var Link=function(a){var b=a.className,c=a.children,d=a.href,e=a.target,f=a["aria-label"],g=a.onClick,h="_blank"===e;return/*#__PURE__*/_jsxs("a",{href:d,target:e,className:classNames("np-link d-inline-flex",b),"aria-label":f,rel:h?"noreferrer":void 0,onClick:g,children:[c,h&&/*#__PURE__*/_jsx(NavigateAwayIcon,{})]})};export default Link;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import Link from".";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";export default{component:Link,title:"Link"};export var Basic=function(){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsxs("p",{children:["Lorem Ipsum is simply dummy text of the printing and typesetting industry"," ",/*#__PURE__*/_jsx(Link,{"aria-label":"Click here for more details",href:"#",children:"content"}),". Lorem Ipsum has been the industry standard dummy text ever since the 1500s."]}),/*#__PURE__*/_jsxs("p",{children:["Lorem Ipsum is simply dummy text of the printing and typesetting industry"," ",/*#__PURE__*/_jsx(Link,{href:"https://wise.com",target:"_blank",children:"https://wise.com"}),". Lorem Ipsum has been the industry standard dummy text ever since the 1500s."]})]})};
|
|
@@ -1 +1 @@
|
|
|
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{useTheme}from"@wise/components-theming";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 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:"#9fe870"})}))};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:"#9fe870"})}))};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.isModern,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;
|
|
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 +1 @@
|
|
|
1
|
-
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["title","body","footer","onClose","className","open","size","scroll","position"];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
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["title","body","footer","onClose","className","open","size","scroll","position"];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 CSSTransition from"react-transition-group/CSSTransition";import{Size,Position,Scroll}from"../common";import CloseButton from"../common/closeButton";import{useLayout}from"../common/hooks";import Dimmer from"../dimmer";import Drawer from"../drawer";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var TRANSITION_DURATION_IN_MILLISECONDS=150,Modal=function(a){var b=a.title,c=void 0===b?null:b,d=a.body,e=a.footer,f=void 0===e?null:e,g=a.onClose,h=a.className,i=a.open,j=a.size,k=void 0===j?Size.MEDIUM:j,l=a.scroll,m=void 0===l?Scroll.VIEWPORT:l,n=a.position,o=void 0===n?Position.CENTER:n,p=_objectWithoutProperties(a,_excluded),q=function(a){return null===h||void 0===h?void 0:h.split(" ").includes(a)},r=useLayout(),s=r.isMobile,t=q("compact"),u=q("no-divider");return s?/*#__PURE__*/_jsx(Drawer,{open:i,headerTitle:c,footerContent:f,position:Position.BOTTOM,onClose:g,children:d}):/*#__PURE__*/_jsx(Dimmer,{open:i,scrollable:m===Scroll.VIEWPORT,className:classNames("d-flex","justify-content-center"),onClose:g,children:/*#__PURE__*/_jsx(CSSTransition,{appear:!0,in:i,classNames:{enterDone:"in"},timeout:TRANSITION_DURATION_IN_MILLISECONDS,unmountOnExit:!0,children:/*#__PURE__*/_jsx("div",_objectSpread(_objectSpread({className:classNames("tw-modal","d-flex","fade","outline-none",h,{"align-self-center":o===Position.CENTER,"tw-modal--scrollable":m===Scroll.CONTENT})},p),{},{children:/*#__PURE__*/_jsx("div",{className:classNames("tw-modal-dialog","d-flex",_defineProperty({},"tw-modal-".concat(k),k)),"aria-modal":!0,role:"dialog",children:/*#__PURE__*/_jsxs("div",{className:classNames("tw-modal-content","d-flex","flex-column","justify-content-between",{"tw-modal-compact":t,"tw-modal-no-title":!c}),children:[/*#__PURE__*/_jsxs("div",{className:classNames("tw-modal-header","d-flex","align-items-center","justify-content-between","flex-wrap",{"modal--withoutborder":!c||u}),children:[/*#__PURE__*/_jsx("h4",{className:"tw-modal-title",children:c}),/*#__PURE__*/_jsx(CloseButton,{onClick:g})]}),/*#__PURE__*/_jsx("div",{className:classNames("tw-modal-body",{"tw-modal-body--scrollable":m===Scroll.CONTENT}),children:d}),f&&/*#__PURE__*/_jsx("div",{className:classNames("tw-modal-footer","d-flex","align-items-center","flex-wrap",{"modal--withoutborder":u}),children:f})]})})}))})})};export default Modal;
|