@transferwise/components 0.0.0-experimental-5e2f01a → 0.0.0-experimental-d8ad171
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/build/es/no-polyfill/accordion/Accordion.js +1 -1
- package/build/es/no-polyfill/accordion/Accordion.story.js +1 -1
- 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/actionButton/ActionButton.spec.js +1 -1
- package/build/es/no-polyfill/actionButton/ActionButton.story.js +1 -1
- package/build/es/no-polyfill/actionOption/ActionOption.js +1 -1
- package/build/es/no-polyfill/actionOption/ActionOption.story.js +1 -1
- package/build/es/no-polyfill/alert/Alert.js +1 -1
- package/build/es/no-polyfill/alert/Alert.story.js +1 -1
- package/build/es/no-polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
- package/build/es/no-polyfill/alert/withArrow/alertArrowPositions.js +1 -1
- package/build/es/no-polyfill/alert/withArrow/withArrow.js +1 -1
- package/build/es/no-polyfill/avatar/Avatar.js +1 -1
- package/build/es/no-polyfill/avatar/Avatar.story.js +1 -1
- package/build/es/no-polyfill/avatar/avatarTypes.js +1 -1
- package/build/es/no-polyfill/avatar/colors/colors.js +2 -2
- package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.js +1 -1
- package/build/es/no-polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
- package/build/es/no-polyfill/badge/Badge.js +1 -1
- package/build/es/no-polyfill/body/Body.js +2 -2
- package/build/es/no-polyfill/body/Body.spec.js +1 -1
- package/build/es/no-polyfill/body/Body.story.js +1 -1
- package/build/es/no-polyfill/button/Button.js +5 -5
- package/build/es/no-polyfill/button/Button.story.js +1 -1
- package/build/es/no-polyfill/button/classMap.js +1 -1
- package/build/es/no-polyfill/button/legacyUtils/legacyUtils.js +2 -2
- 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/checkbox/Checkbox.story.js +1 -1
- package/build/es/no-polyfill/checkboxButton/CheckboxButton.js +1 -1
- package/build/es/no-polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
- package/build/es/no-polyfill/checkboxButton/CheckboxButton.story.js +1 -1
- package/build/es/no-polyfill/checkboxOption/CheckboxOption.js +1 -1
- package/build/es/no-polyfill/checkboxOption/CheckboxOption.spec.js +1 -1
- package/build/es/no-polyfill/checkboxOption/CheckboxOption.story.js +1 -1
- package/build/es/no-polyfill/chevron/Chevron.js +1 -1
- package/build/es/no-polyfill/chevron/Chevron.story.js +1 -1
- package/build/es/no-polyfill/chips/Chip.js +1 -1
- package/build/es/no-polyfill/chips/Chips.js +1 -1
- package/build/es/no-polyfill/chips/Chips.spec.js +1 -1
- package/build/es/no-polyfill/chips/Chips.story.js +1 -1
- package/build/es/no-polyfill/circularButton/CircularButton.js +1 -1
- package/build/es/no-polyfill/common/DOMOperations/DOMOperations.js +3 -3
- package/build/es/no-polyfill/common/Option/Option.js +1 -1
- package/build/es/no-polyfill/common/RadioButton/RadioButton.js +1 -1
- package/build/es/no-polyfill/common/bottomSheet/BottomSheet.js +4 -4
- package/build/es/no-polyfill/common/bottomSheet/BottomSheet.spec.js +1 -1
- package/build/es/no-polyfill/common/bottomSheet/BottomSheet.story.js +2 -2
- package/build/es/no-polyfill/common/closeButton/CloseButton.js +1 -1
- package/build/es/no-polyfill/common/dateUtils/getDayNames/getDayNames.js +2 -2
- package/build/es/no-polyfill/common/dateUtils/getMonthNames/getMonthNames.js +1 -1
- package/build/es/no-polyfill/common/dateUtils/isDateValid/isDateValid.js +1 -1
- package/build/es/no-polyfill/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +1 -1
- package/build/es/no-polyfill/common/deviceDetection/deviceDetection.js +1 -1
- package/build/es/no-polyfill/common/direction.js +1 -1
- package/build/es/no-polyfill/common/domHelpers/index.js +1 -1
- package/build/es/no-polyfill/common/fakeEvents.js +1 -1
- package/build/es/no-polyfill/common/fileType.js +1 -1
- package/build/es/no-polyfill/common/flowHeader/FlowHeader.js +1 -1
- package/build/es/no-polyfill/common/focusBoundary/FocusBoundary.js +1 -1
- package/build/es/no-polyfill/common/focusBoundary/FocusBoundary.spec.js +1 -1
- package/build/es/no-polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
- package/build/es/no-polyfill/common/focusBoundary/utils/resetFocus.js +1 -1
- package/build/es/no-polyfill/common/historyNavigator/historyNavigator.js +1 -1
- package/build/es/no-polyfill/common/hooks/useClientWidth/useClientWidth.js +3 -3
- package/build/es/no-polyfill/common/hooks/useConditionalListener/useConditionalListener.js +1 -1
- package/build/es/no-polyfill/common/hooks/useDirection/useDirection.js +1 -1
- package/build/es/no-polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -2
- package/build/es/no-polyfill/common/hooks/useLayout/useLayout.js +1 -1
- package/build/es/no-polyfill/common/key.js +1 -1
- package/build/es/no-polyfill/common/locale/index.js +7 -7
- package/build/es/no-polyfill/common/panel/Panel.js +6 -6
- package/build/es/no-polyfill/common/propsValues/breakpoint.js +1 -1
- package/build/es/no-polyfill/common/propsValues/control.js +1 -1
- package/build/es/no-polyfill/common/propsValues/dateMode.js +1 -1
- package/build/es/no-polyfill/common/propsValues/layouts.js +1 -1
- package/build/es/no-polyfill/common/propsValues/markdownNodeType.js +1 -1
- package/build/es/no-polyfill/common/propsValues/monthFormat.js +1 -1
- package/build/es/no-polyfill/common/propsValues/position.js +1 -1
- package/build/es/no-polyfill/common/propsValues/profileType.js +1 -1
- package/build/es/no-polyfill/common/propsValues/scroll.js +1 -1
- package/build/es/no-polyfill/common/propsValues/sentiment.js +1 -1
- package/build/es/no-polyfill/common/propsValues/size.js +1 -1
- package/build/es/no-polyfill/common/propsValues/status.js +1 -1
- package/build/es/no-polyfill/common/propsValues/type.js +1 -1
- package/build/es/no-polyfill/common/propsValues/typography.js +1 -1
- package/build/es/no-polyfill/common/propsValues/variant.js +1 -1
- package/build/es/no-polyfill/common/propsValues/width.js +1 -1
- package/build/es/no-polyfill/common/requirements.js +2 -2
- package/build/es/no-polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
- package/build/es/no-polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +2 -2
- package/build/es/no-polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
- package/build/es/no-polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
- package/build/es/no-polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
- package/build/es/no-polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
- package/build/es/no-polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
- package/build/es/no-polyfill/common/theme.js +1 -1
- package/build/es/no-polyfill/criticalBanner/CriticalCommsBanner.js +1 -1
- package/build/es/no-polyfill/criticalBanner/CriticalCommsBanner.story.js +1 -1
- package/build/es/no-polyfill/dateInput/DateInput.js +4 -10
- package/build/es/no-polyfill/dateInput/DateInput.story.js +1 -1
- package/build/es/no-polyfill/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +1 -1
- package/build/es/no-polyfill/dateInput/utils/explodeDate/explodeDate.js +1 -1
- package/build/es/no-polyfill/dateLookup/DateLookup.js +3 -4
- package/build/es/no-polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
- package/build/es/no-polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
- package/build/es/no-polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
- package/build/es/no-polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -5
- package/build/es/no-polyfill/dateLookup/monthCalendar/MonthCalendar.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/dateLookup/yearCalendar/YearCalendar.js +1 -1
- package/build/es/no-polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
- package/build/es/no-polyfill/decision/Decision.js +5 -5
- package/build/es/no-polyfill/decision/decisionEnums.js +2 -2
- package/build/es/no-polyfill/definitionList/DefinitionList.js +1 -1
- package/build/es/no-polyfill/dimmer/Dimmer.js +3 -3
- package/build/es/no-polyfill/dimmer/Dimmer.story.js +2 -2
- package/build/es/no-polyfill/dimmer/dimmerManager/DimmerManager.js +3 -3
- package/build/es/no-polyfill/display/Display.js +1 -1
- package/build/es/no-polyfill/display/Display.story.js +2 -2
- package/build/es/no-polyfill/drawer/Drawer.js +1 -1
- package/build/es/no-polyfill/dropFade/DropFade.js +3 -3
- package/build/es/no-polyfill/dropFade/DropFade.story.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/dynamicFieldDefinitionList/utils/createDefinitions.js +2 -2
- package/build/es/no-polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
- package/build/es/no-polyfill/emphasis/Emphasis.js +2 -2
- package/build/es/no-polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
- package/build/es/no-polyfill/flowNavigation/FlowNavigation.js +2 -2
- package/build/es/no-polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
- package/build/es/no-polyfill/flowNavigation/backButton/BackButton.js +1 -1
- package/build/es/no-polyfill/header/Header.js +2 -2
- package/build/es/no-polyfill/header/Header.spec.js +1 -1
- package/build/es/no-polyfill/header/Header.story.js +2 -1
- package/build/es/no-polyfill/i18n/index.js +1 -1
- package/build/es/no-polyfill/image/Image.js +2 -2
- package/build/es/no-polyfill/info/Info.js +1 -1
- package/build/es/no-polyfill/info/Info.story.js +1 -1
- package/build/es/no-polyfill/info/infoPresentations.js +1 -1
- package/build/es/no-polyfill/inlineAlert/InlineAlert.js +1 -1
- package/build/es/no-polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
- package/build/es/no-polyfill/inputs/Input.js +1 -1
- package/build/es/no-polyfill/inputs/TextArea.js +1 -1
- package/build/es/no-polyfill/inputs/_common.js +2 -2
- package/build/es/no-polyfill/instructionsList/InstructionsList.js +3 -3
- package/build/es/no-polyfill/link/Link.js +2 -2
- package/build/es/no-polyfill/link/Link.spec.js +1 -1
- package/build/es/no-polyfill/link/Link.story.js +1 -1
- package/build/es/no-polyfill/listItem/ListItem.js +1 -1
- package/build/es/no-polyfill/listItem/ListItem.spec.js +1 -1
- package/build/es/no-polyfill/listItem/ListItem.story.js +1 -1
- package/build/es/no-polyfill/loader/Loader.js +2 -2
- package/build/es/no-polyfill/loader/Loader.story.js +1 -1
- package/build/es/no-polyfill/logo/Logo.js +1 -1
- package/build/es/no-polyfill/logo/Logo.story.js +1 -1
- package/build/es/no-polyfill/logo/logoTypes.js +1 -1
- package/build/es/no-polyfill/markdown/Markdown.js +1 -1
- package/build/es/no-polyfill/modal/Modal.js +1 -1
- package/build/es/no-polyfill/modal/Modal.story.js +2 -2
- package/build/es/no-polyfill/money/Money.js +1 -1
- package/build/es/no-polyfill/money/Money.story.js +1 -1
- package/build/es/no-polyfill/moneyInput/MoneyInput.js +1 -1
- package/build/es/no-polyfill/moneyInput/MoneyInput.story.js +1 -1
- package/build/es/no-polyfill/moneyInput/currencyFormatting.js +2 -2
- package/build/es/no-polyfill/navigationOption/NavigationOption.js +1 -1
- package/build/es/no-polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
- package/build/es/no-polyfill/nudge/Nudge.js +1 -1
- package/build/es/no-polyfill/overlayHeader/OverlayHeader.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/data/countries.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +2 -2
- package/build/es/no-polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
- package/build/es/no-polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +3 -3
- package/build/es/no-polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
- package/build/es/no-polyfill/popover/Popover.js +2 -2
- package/build/es/no-polyfill/processIndicator/ProcessIndicator.js +4 -4
- package/build/es/no-polyfill/progress/Progress.js +1 -1
- package/build/es/no-polyfill/progress/Progress.story.js +1 -1
- package/build/es/no-polyfill/progressBar/ProgressBar.js +1 -1
- package/build/es/no-polyfill/progressBar/ProgressBar.story.js +1 -1
- package/build/es/no-polyfill/provider/Provider.js +1 -1
- package/build/es/no-polyfill/provider/Provider.spec.js +1 -1
- package/build/es/no-polyfill/provider/Provider.story.js +1 -1
- package/build/es/no-polyfill/provider/direction/DirectionProvider.js +1 -1
- package/build/es/no-polyfill/provider/direction/DirectionProvider.spec.js +1 -1
- package/build/es/no-polyfill/provider/language/LanguageProvider.js +1 -1
- package/build/es/no-polyfill/provider/language/LanguageProvider.spec.js +1 -1
- package/build/es/no-polyfill/radio/Radio.js +1 -1
- package/build/es/no-polyfill/radioGroup/RadioGroup.js +2 -2
- package/build/es/no-polyfill/radioOption/RadioOption.js +1 -1
- package/build/es/no-polyfill/section/Section.js +1 -1
- package/build/es/no-polyfill/section/Section.spec.js +1 -1
- package/build/es/no-polyfill/section/Section.story.js +1 -1
- package/build/es/no-polyfill/select/Select.js +8 -9
- package/build/es/no-polyfill/select/option/Option.js +1 -1
- package/build/es/no-polyfill/select/searchBox/SearchBox.js +1 -1
- package/build/es/no-polyfill/sizeSwapper/SizeSwapper.js +3 -3
- package/build/es/no-polyfill/slidingPanel/SlidingPanel.js +2 -2
- package/build/es/no-polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/no-polyfill/snackbar/SnackbarContext.js +1 -1
- package/build/es/no-polyfill/snackbar/SnackbarProvider.js +1 -1
- package/build/es/no-polyfill/snackbar/useSnackbar.js +1 -1
- package/build/es/no-polyfill/statusIcon/StatusIcon.js +1 -1
- package/build/es/no-polyfill/statusIcon/StatusIcon.story.js +1 -1
- package/build/es/no-polyfill/stepper/Stepper.js +1 -1
- package/build/es/no-polyfill/stepper/deviceDetection.js +2 -2
- package/build/es/no-polyfill/sticky/Sticky.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/switchOption/SwitchOption.js +1 -1
- package/build/es/no-polyfill/switchOption/SwitchOption.story.js +1 -1
- package/build/es/no-polyfill/tabs/Tab.js +1 -1
- package/build/es/no-polyfill/tabs/TabList.js +1 -1
- package/build/es/no-polyfill/tabs/TabPanel.js +1 -1
- package/build/es/no-polyfill/tabs/Tabs.js +1 -5
- package/build/es/no-polyfill/tabs/utils.js +2 -2
- package/build/es/no-polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
- package/build/es/no-polyfill/tile/Tile.js +1 -1
- package/build/es/no-polyfill/title/Title.js +1 -1
- package/build/es/no-polyfill/title/Title.spec.js +1 -1
- package/build/es/no-polyfill/title/Title.story.js +1 -1
- package/build/es/no-polyfill/tooltip/Tooltip.js +7 -7
- package/build/es/no-polyfill/tooltip/Tooltip.spec.js +1 -1
- package/build/es/no-polyfill/tooltip/Tooltip.story.js +1 -1
- package/build/es/no-polyfill/typeahead/Typeahead.js +1 -1
- package/build/es/no-polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
- package/build/es/no-polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
- package/build/es/no-polyfill/typeahead/util/highlight.js +1 -1
- package/build/es/no-polyfill/upload/Upload.js +2 -6
- 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/upload/uploadSteps.js +1 -1
- package/build/es/no-polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
- package/build/es/no-polyfill/upload/utils/getFileType/getFileType.js +1 -1
- package/build/es/no-polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +1 -1
- package/build/es/no-polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
- package/build/es/no-polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
- package/build/es/no-polyfill/upload/utils/postData/postData.js +1 -1
- package/build/es/no-polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
- package/build/es/no-polyfill/uploadInput/UploadInput.js +7 -7
- package/build/es/no-polyfill/uploadInput/UploadInput.spec.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/uploadButton/UploadButton.spec.js +3 -3
- package/build/es/no-polyfill/uploadInput/uploadButton/defaults.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
- package/build/es/no-polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
- package/build/es/no-polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
- package/build/es/no-polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
- package/build/es/no-polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
- package/build/es/no-polyfill/utilities/logActionRequired.js +1 -1
- package/build/es/no-polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
- package/build/es/no-polyfill/withNextPortal/withNextPortal.js +1 -1
- package/build/es/polyfill/accordion/Accordion.js +1 -1
- package/build/es/polyfill/accordion/Accordion.story.js +1 -1
- package/build/es/polyfill/accordion/AccordionItem/AccordionItem.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.spec.js +1 -1
- package/build/es/polyfill/actionButton/ActionButton.story.js +1 -1
- package/build/es/polyfill/actionOption/ActionOption.js +1 -1
- package/build/es/polyfill/actionOption/ActionOption.story.js +1 -1
- package/build/es/polyfill/alert/Alert.js +1 -1
- package/build/es/polyfill/alert/Alert.story.js +1 -1
- package/build/es/polyfill/alert/inlineMarkdown/InlineMarkdown.js +1 -1
- package/build/es/polyfill/alert/withArrow/alertArrowPositions.js +1 -1
- package/build/es/polyfill/alert/withArrow/withArrow.js +1 -1
- package/build/es/polyfill/avatar/Avatar.js +1 -1
- package/build/es/polyfill/avatar/Avatar.story.js +1 -1
- package/build/es/polyfill/avatar/avatarTypes.js +1 -1
- package/build/es/polyfill/avatar/colors/colors.js +2 -2
- package/build/es/polyfill/avatarWrapper/AvatarWrapper.js +1 -1
- package/build/es/polyfill/avatarWrapper/AvatarWrapper.story.js +1 -1
- package/build/es/polyfill/badge/Badge.js +1 -1
- package/build/es/polyfill/body/Body.js +2 -2
- package/build/es/polyfill/body/Body.spec.js +1 -1
- package/build/es/polyfill/body/Body.story.js +1 -1
- package/build/es/polyfill/button/Button.js +5 -5
- package/build/es/polyfill/button/Button.story.js +1 -1
- package/build/es/polyfill/button/classMap.js +1 -1
- package/build/es/polyfill/button/legacyUtils/legacyUtils.js +2 -2
- package/build/es/polyfill/card/Card.js +1 -1
- package/build/es/polyfill/checkbox/Checkbox.js +1 -1
- package/build/es/polyfill/checkbox/Checkbox.story.js +1 -1
- package/build/es/polyfill/checkboxButton/CheckboxButton.js +1 -1
- package/build/es/polyfill/checkboxButton/CheckboxButton.spec.js +1 -1
- package/build/es/polyfill/checkboxButton/CheckboxButton.story.js +1 -1
- package/build/es/polyfill/checkboxOption/CheckboxOption.js +1 -1
- package/build/es/polyfill/checkboxOption/CheckboxOption.spec.js +1 -1
- package/build/es/polyfill/checkboxOption/CheckboxOption.story.js +1 -1
- package/build/es/polyfill/chevron/Chevron.js +1 -1
- package/build/es/polyfill/chevron/Chevron.story.js +1 -1
- package/build/es/polyfill/chips/Chip.js +1 -1
- package/build/es/polyfill/chips/Chips.js +1 -1
- package/build/es/polyfill/chips/Chips.spec.js +1 -1
- package/build/es/polyfill/chips/Chips.story.js +1 -1
- package/build/es/polyfill/circularButton/CircularButton.js +1 -1
- package/build/es/polyfill/common/DOMOperations/DOMOperations.js +3 -3
- package/build/es/polyfill/common/Option/Option.js +1 -1
- package/build/es/polyfill/common/RadioButton/RadioButton.js +1 -1
- package/build/es/polyfill/common/bottomSheet/BottomSheet.js +4 -4
- package/build/es/polyfill/common/bottomSheet/BottomSheet.spec.js +1 -1
- package/build/es/polyfill/common/bottomSheet/BottomSheet.story.js +2 -2
- package/build/es/polyfill/common/closeButton/CloseButton.js +1 -1
- package/build/es/polyfill/common/dateUtils/getDayNames/getDayNames.js +2 -2
- package/build/es/polyfill/common/dateUtils/getMonthNames/getMonthNames.js +1 -1
- package/build/es/polyfill/common/dateUtils/isDateValid/isDateValid.js +1 -1
- package/build/es/polyfill/common/dateUtils/isMonthAndYearFormat/isMonthAndYearFormat.js +1 -1
- package/build/es/polyfill/common/deviceDetection/deviceDetection.js +1 -1
- package/build/es/polyfill/common/direction.js +1 -1
- package/build/es/polyfill/common/domHelpers/index.js +1 -1
- package/build/es/polyfill/common/fakeEvents.js +1 -1
- package/build/es/polyfill/common/fileType.js +1 -1
- package/build/es/polyfill/common/flowHeader/FlowHeader.js +1 -1
- package/build/es/polyfill/common/focusBoundary/FocusBoundary.js +1 -1
- package/build/es/polyfill/common/focusBoundary/FocusBoundary.spec.js +1 -1
- package/build/es/polyfill/common/focusBoundary/utils/getFocusableElements.js +2 -2
- package/build/es/polyfill/common/focusBoundary/utils/resetFocus.js +1 -1
- package/build/es/polyfill/common/historyNavigator/historyNavigator.js +1 -1
- package/build/es/polyfill/common/hooks/useClientWidth/useClientWidth.js +3 -3
- package/build/es/polyfill/common/hooks/useConditionalListener/useConditionalListener.js +1 -1
- package/build/es/polyfill/common/hooks/useDirection/useDirection.js +1 -1
- package/build/es/polyfill/common/hooks/useHasIntersected/useHasIntersected.js +2 -2
- package/build/es/polyfill/common/hooks/useLayout/useLayout.js +1 -1
- package/build/es/polyfill/common/key.js +1 -1
- package/build/es/polyfill/common/locale/index.js +8 -8
- package/build/es/polyfill/common/panel/Panel.js +6 -6
- package/build/es/polyfill/common/propsValues/breakpoint.js +1 -1
- package/build/es/polyfill/common/propsValues/control.js +1 -1
- package/build/es/polyfill/common/propsValues/dateMode.js +1 -1
- package/build/es/polyfill/common/propsValues/layouts.js +1 -1
- package/build/es/polyfill/common/propsValues/markdownNodeType.js +1 -1
- package/build/es/polyfill/common/propsValues/monthFormat.js +1 -1
- package/build/es/polyfill/common/propsValues/position.js +1 -1
- package/build/es/polyfill/common/propsValues/profileType.js +1 -1
- package/build/es/polyfill/common/propsValues/scroll.js +1 -1
- package/build/es/polyfill/common/propsValues/sentiment.js +1 -1
- package/build/es/polyfill/common/propsValues/size.js +1 -1
- package/build/es/polyfill/common/propsValues/status.js +1 -1
- package/build/es/polyfill/common/propsValues/type.js +1 -1
- package/build/es/polyfill/common/propsValues/typography.js +1 -1
- package/build/es/polyfill/common/propsValues/variant.js +1 -1
- package/build/es/polyfill/common/propsValues/width.js +1 -1
- package/build/es/polyfill/common/requirements.js +2 -2
- package/build/es/polyfill/common/responsivePanel/ResponsivePanel.js +1 -1
- package/build/es/polyfill/common/textFormat/formatWithPattern/formatWithPattern.js +2 -2
- package/build/es/polyfill/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +1 -1
- package/build/es/polyfill/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +1 -1
- package/build/es/polyfill/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +1 -1
- package/build/es/polyfill/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +1 -1
- package/build/es/polyfill/common/textFormat/unformatWithPattern/unformatWithPattern.js +1 -1
- package/build/es/polyfill/common/theme.js +1 -1
- package/build/es/polyfill/criticalBanner/CriticalCommsBanner.js +1 -1
- package/build/es/polyfill/criticalBanner/CriticalCommsBanner.story.js +1 -1
- package/build/es/polyfill/dateInput/DateInput.js +4 -10
- package/build/es/polyfill/dateInput/DateInput.story.js +1 -1
- package/build/es/polyfill/dateInput/utils/convertToLocalMidnight/convertToLocalMidnight.js +1 -1
- package/build/es/polyfill/dateInput/utils/explodeDate/explodeDate.js +1 -1
- package/build/es/polyfill/dateLookup/DateLookup.js +3 -4
- package/build/es/polyfill/dateLookup/dateHeader/DateHeader.js +1 -1
- package/build/es/polyfill/dateLookup/dateTrigger/DateTrigger.js +1 -1
- package/build/es/polyfill/dateLookup/dayCalendar/DayCalendar.js +1 -1
- package/build/es/polyfill/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -5
- package/build/es/polyfill/dateLookup/monthCalendar/MonthCalendar.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/dateLookup/yearCalendar/YearCalendar.js +1 -1
- package/build/es/polyfill/dateLookup/yearCalendar/table/YearCalendarTable.js +1 -1
- package/build/es/polyfill/decision/Decision.js +5 -5
- package/build/es/polyfill/decision/decisionEnums.js +2 -2
- package/build/es/polyfill/definitionList/DefinitionList.js +1 -1
- package/build/es/polyfill/dimmer/Dimmer.js +3 -3
- package/build/es/polyfill/dimmer/Dimmer.story.js +2 -2
- package/build/es/polyfill/dimmer/dimmerManager/DimmerManager.js +3 -3
- package/build/es/polyfill/display/Display.js +1 -1
- package/build/es/polyfill/display/Display.story.js +2 -2
- package/build/es/polyfill/drawer/Drawer.js +1 -1
- package/build/es/polyfill/dropFade/DropFade.js +3 -3
- package/build/es/polyfill/dropFade/DropFade.story.js +1 -1
- package/build/es/polyfill/dynamicFieldDefinitionList/DynamicFieldDefinitionList.js +1 -1
- package/build/es/polyfill/dynamicFieldDefinitionList/FormattedValue/FormattedValue.js +2 -2
- package/build/es/polyfill/dynamicFieldDefinitionList/utils/createDefinitions.js +2 -2
- package/build/es/polyfill/dynamicFieldDefinitionList/utils/text-format.js +1 -1
- package/build/es/polyfill/emphasis/Emphasis.js +2 -2
- package/build/es/polyfill/emphasis/EmphasisHtmlTransformer.js +2 -2
- package/build/es/polyfill/flowNavigation/FlowNavigation.js +2 -2
- package/build/es/polyfill/flowNavigation/animatedLabel/AnimatedLabel.js +1 -1
- package/build/es/polyfill/flowNavigation/backButton/BackButton.js +1 -1
- package/build/es/polyfill/header/Header.js +2 -2
- package/build/es/polyfill/header/Header.spec.js +1 -1
- package/build/es/polyfill/header/Header.story.js +2 -1
- package/build/es/polyfill/i18n/index.js +1 -1
- package/build/es/polyfill/image/Image.js +2 -2
- package/build/es/polyfill/info/Info.js +1 -1
- package/build/es/polyfill/info/Info.story.js +1 -1
- package/build/es/polyfill/info/infoPresentations.js +1 -1
- package/build/es/polyfill/inlineAlert/InlineAlert.js +1 -1
- package/build/es/polyfill/inputWithDisplayFormat/InputWithDisplayFormat.js +1 -1
- package/build/es/polyfill/inputs/Input.js +1 -1
- package/build/es/polyfill/inputs/TextArea.js +1 -1
- package/build/es/polyfill/inputs/_common.js +2 -2
- package/build/es/polyfill/instructionsList/InstructionsList.js +3 -3
- package/build/es/polyfill/link/Link.js +2 -2
- package/build/es/polyfill/link/Link.spec.js +1 -1
- package/build/es/polyfill/link/Link.story.js +1 -1
- package/build/es/polyfill/listItem/ListItem.js +1 -1
- package/build/es/polyfill/listItem/ListItem.spec.js +1 -1
- package/build/es/polyfill/listItem/ListItem.story.js +1 -1
- package/build/es/polyfill/loader/Loader.js +2 -2
- package/build/es/polyfill/loader/Loader.story.js +1 -1
- package/build/es/polyfill/logo/Logo.js +1 -1
- package/build/es/polyfill/logo/Logo.story.js +1 -1
- package/build/es/polyfill/logo/logoTypes.js +1 -1
- package/build/es/polyfill/markdown/Markdown.js +1 -1
- package/build/es/polyfill/modal/Modal.js +1 -1
- package/build/es/polyfill/modal/Modal.story.js +2 -2
- package/build/es/polyfill/money/Money.js +1 -1
- package/build/es/polyfill/money/Money.story.js +1 -1
- package/build/es/polyfill/moneyInput/MoneyInput.js +1 -1
- package/build/es/polyfill/moneyInput/MoneyInput.story.js +1 -1
- package/build/es/polyfill/moneyInput/currencyFormatting.js +3 -3
- package/build/es/polyfill/navigationOption/NavigationOption.js +1 -1
- package/build/es/polyfill/navigationOptionsList/NavigationOptionsList.js +1 -1
- package/build/es/polyfill/nudge/Nudge.js +1 -1
- package/build/es/polyfill/overlayHeader/OverlayHeader.js +1 -1
- package/build/es/polyfill/phoneNumberInput/PhoneNumberInput.js +1 -1
- package/build/es/polyfill/phoneNumberInput/data/countries.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/cleanNumber/cleanNumber.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/excludeCountries/excludeCountries.js +3 -3
- package/build/es/polyfill/phoneNumberInput/utils/explodeNumberModel/index.js +2 -2
- package/build/es/polyfill/phoneNumberInput/utils/filterOptionsForQuery/index.js +2 -2
- package/build/es/polyfill/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js +2 -2
- package/build/es/polyfill/phoneNumberInput/utils/isStringNumeric/isStringNumeric.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/isValidPhoneNumber/isValidPhoneNumber.js +2 -2
- package/build/es/polyfill/phoneNumberInput/utils/longestMatchingPrefix/index.js +1 -1
- package/build/es/polyfill/phoneNumberInput/utils/setDefaultPrefix/index.js +3 -3
- package/build/es/polyfill/phoneNumberInput/utils/sortArrayByProperty/sortArrayByProperty.js +2 -2
- package/build/es/polyfill/popover/Popover.js +2 -2
- package/build/es/polyfill/processIndicator/ProcessIndicator.js +4 -4
- package/build/es/polyfill/progress/Progress.js +1 -1
- package/build/es/polyfill/progress/Progress.story.js +1 -1
- package/build/es/polyfill/progressBar/ProgressBar.js +1 -1
- package/build/es/polyfill/progressBar/ProgressBar.story.js +1 -1
- package/build/es/polyfill/provider/Provider.js +1 -1
- package/build/es/polyfill/provider/Provider.spec.js +1 -1
- package/build/es/polyfill/provider/Provider.story.js +1 -1
- package/build/es/polyfill/provider/direction/DirectionProvider.js +1 -1
- package/build/es/polyfill/provider/direction/DirectionProvider.spec.js +1 -1
- package/build/es/polyfill/provider/language/LanguageProvider.js +1 -1
- package/build/es/polyfill/provider/language/LanguageProvider.spec.js +1 -1
- package/build/es/polyfill/radio/Radio.js +1 -1
- package/build/es/polyfill/radioGroup/RadioGroup.js +2 -2
- package/build/es/polyfill/radioOption/RadioOption.js +1 -1
- package/build/es/polyfill/section/Section.js +1 -1
- package/build/es/polyfill/section/Section.spec.js +1 -1
- package/build/es/polyfill/section/Section.story.js +1 -1
- package/build/es/polyfill/select/Select.js +8 -9
- package/build/es/polyfill/select/option/Option.js +2 -2
- package/build/es/polyfill/select/searchBox/SearchBox.js +1 -1
- package/build/es/polyfill/sizeSwapper/SizeSwapper.js +3 -3
- package/build/es/polyfill/slidingPanel/SlidingPanel.js +2 -2
- package/build/es/polyfill/snackbar/Snackbar.js +1 -1
- package/build/es/polyfill/snackbar/SnackbarContext.js +1 -1
- package/build/es/polyfill/snackbar/SnackbarProvider.js +1 -1
- package/build/es/polyfill/snackbar/useSnackbar.js +1 -1
- package/build/es/polyfill/statusIcon/StatusIcon.js +1 -1
- package/build/es/polyfill/statusIcon/StatusIcon.story.js +1 -1
- package/build/es/polyfill/stepper/Stepper.js +1 -1
- package/build/es/polyfill/stepper/deviceDetection.js +2 -2
- package/build/es/polyfill/sticky/Sticky.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/switchOption/SwitchOption.js +1 -1
- package/build/es/polyfill/switchOption/SwitchOption.story.js +1 -1
- package/build/es/polyfill/tabs/Tab.js +1 -1
- package/build/es/polyfill/tabs/TabList.js +1 -1
- package/build/es/polyfill/tabs/TabPanel.js +1 -1
- package/build/es/polyfill/tabs/Tabs.js +1 -5
- package/build/es/polyfill/tabs/utils.js +2 -2
- package/build/es/polyfill/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +1 -1
- package/build/es/polyfill/tile/Tile.js +1 -1
- package/build/es/polyfill/title/Title.js +1 -1
- package/build/es/polyfill/title/Title.spec.js +1 -1
- package/build/es/polyfill/title/Title.story.js +1 -1
- package/build/es/polyfill/tooltip/Tooltip.js +7 -7
- package/build/es/polyfill/tooltip/Tooltip.spec.js +1 -1
- package/build/es/polyfill/tooltip/Tooltip.story.js +1 -1
- package/build/es/polyfill/typeahead/Typeahead.js +1 -1
- package/build/es/polyfill/typeahead/typeaheadInput/TypeaheadInput.js +1 -1
- package/build/es/polyfill/typeahead/typeaheadOption/TypeaheadOption.js +1 -1
- package/build/es/polyfill/typeahead/util/highlight.js +1 -1
- package/build/es/polyfill/upload/Upload.js +2 -6
- 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/upload/uploadSteps.js +1 -1
- package/build/es/polyfill/upload/utils/asyncFileRead/asyncFileRead.js +1 -1
- package/build/es/polyfill/upload/utils/getFileType/getFileType.js +1 -1
- package/build/es/polyfill/upload/utils/getSupportedSpotMimeTypes/getSupportedSpotMimeTypes.js +2 -2
- package/build/es/polyfill/upload/utils/isSizeValid/isSizeValid.js +1 -1
- package/build/es/polyfill/upload/utils/isTypeValid/isTypeValid.js +1 -1
- package/build/es/polyfill/upload/utils/postData/postData.js +1 -1
- package/build/es/polyfill/upload/utils/requestMedia/requestMedia.js +1 -1
- package/build/es/polyfill/uploadInput/UploadInput.js +7 -7
- package/build/es/polyfill/uploadInput/UploadInput.spec.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/uploadButton/UploadButton.spec.js +3 -3
- package/build/es/polyfill/uploadInput/uploadButton/defaults.js +1 -1
- package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.js +3 -3
- package/build/es/polyfill/uploadInput/uploadButton/getAllowedFileTypes.spec.js +1 -1
- package/build/es/polyfill/uploadInput/uploadItem/UploadItem.js +2 -2
- package/build/es/polyfill/uploadInput/uploadItem/UploadItem.spec.js +1 -1
- package/build/es/polyfill/uploadInput/uploadItem/UploadItemBody.js +1 -1
- package/build/es/polyfill/utilities/deprecatedProperty/deprecatedProperty.js +1 -1
- package/build/es/polyfill/utilities/logActionRequired.js +1 -1
- package/build/es/polyfill/withDisplayFormat/WithDisplayFormat.js +3 -4
- package/build/es/polyfill/withNextPortal/withNextPortal.js +1 -1
- package/build/main.css +1 -4236
- package/build/styles/accordion/Accordion.css +1 -59
- package/build/styles/actionButton/ActionButton.css +1 -41
- package/build/styles/avatar/Avatar.css +1 -240
- package/build/styles/badge/Badge.css +1 -66
- package/build/styles/button/Button.css +1 -17
- package/build/styles/card/Card.css +1 -88
- package/build/styles/checkboxButton/CheckboxButton.css +1 -21
- package/build/styles/chips/Chip.css +1 -169
- package/build/styles/circularButton/CircularButton.css +1 -175
- package/build/styles/common/Option/Option.css +1 -74
- package/build/styles/common/RadioButton/RadioButton.css +1 -3
- package/build/styles/common/bottomSheet/BottomSheet.css +1 -44
- package/build/styles/common/closeButton/CloseButton.css +1 -44
- package/build/styles/common/panel/Panel.css +1 -67
- package/build/styles/criticalBanner/CriticalCommsBanner.css +1 -73
- package/build/styles/dateInput/DateInput.css +1 -3
- package/build/styles/dateLookup/DateLookup.css +1 -80
- package/build/styles/dateLookup/dateTrigger/DateTrigger.css +1 -53
- package/build/styles/decision/Decision.css +1 -69
- package/build/styles/definitionList/DefinitionList.css +1 -48
- package/build/styles/dimmer/Dimmer.css +1 -68
- package/build/styles/drawer/Drawer.css +1 -77
- package/build/styles/dropFade/DropFade.css +1 -19
- package/build/styles/dynamicFieldDefinitionList/FormattedValue/FormattedValue.css +1 -4
- package/build/styles/emphasis/Emphasis.css +1 -25
- package/build/styles/flowNavigation/FlowNavigation.css +1 -85
- package/build/styles/flowNavigation/animatedLabel/AnimatedLabel.css +1 -26
- package/build/styles/flowNavigation/backButton/BackButton.css +1 -28
- package/build/styles/header/Header.css +1 -20
- package/build/styles/image/Image.css +1 -12
- package/build/styles/info/Info.css +1 -37
- package/build/styles/inputs/Input.css +1 -53
- package/build/styles/inputs/TextArea.css +1 -59
- package/build/styles/instructionsList/InstructionsList.css +1 -30
- package/build/styles/link/Link.css +1 -12
- package/build/styles/listItem/ListItem.css +1 -6
- package/build/styles/loader/Loader.css +1 -294
- package/build/styles/logo/Logo.css +1 -10
- package/build/styles/main.css +1 -4236
- package/build/styles/modal/Modal.css +1 -133
- package/build/styles/moneyInput/MoneyInput.css +1 -128
- package/build/styles/navigationOption/NavigationOption.css +1 -61
- package/build/styles/navigationOptionsList/NavigationOptionsList.css +1 -12
- package/build/styles/nudge/Nudge.css +1 -138
- package/build/styles/overlayHeader/OverlayHeader.css +1 -31
- package/build/styles/phoneNumberInput/PhoneNumberInput.css +1 -17
- package/build/styles/popover/Popover.css +1 -40
- package/build/styles/progress/Progress.css +1 -35
- package/build/styles/progressBar/ProgressBar.css +1 -9
- package/build/styles/section/Section.css +1 -8
- package/build/styles/select/Select.css +1 -322
- package/build/styles/slidingPanel/SlidingPanel.css +1 -96
- package/build/styles/snackbar/Snackbar.css +1 -85
- package/build/styles/statusIcon/StatusIcon.css +1 -50
- package/build/styles/stepper/Stepper.css +1 -139
- package/build/styles/summary/Summary.css +1 -86
- package/build/styles/switch/Switch.css +1 -64
- package/build/styles/tabs/Tabs.css +1 -104
- package/build/styles/tile/Tile.css +1 -58
- package/build/styles/tooltip/Tooltip.css +1 -37
- package/build/styles/typeahead/Typeahead.css +1 -167
- package/build/styles/typeahead/typeaheadOption/TypeaheadOption.css +1 -6
- package/build/styles/upload/Upload.css +1 -15
- package/build/styles/uploadInput/UploadInput.css +1 -53
- package/build/styles/uploadInput/uploadButton/UploadButton.css +1 -44
- package/build/styles/uploadInput/uploadItem/UploadItem.css +1 -60
- package/build/types/actionButton/ActionButton.d.ts +3 -0
- package/build/types/actionButton/ActionButton.story.d.ts +1 -0
- package/build/types/button/Button.story.d.ts +24 -24
- package/build/umd/no-polyfill/main.js +1 -1
- package/build/umd/polyfill/main.js +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
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 LogoFlagInverse=function(a){return/*#__PURE__*/_jsx("svg",{
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.array.concat.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import React from"react";import{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 LogoFlagInverse=function(a){return/*#__PURE__*/_jsx("svg",_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("path",{fill:"#9FE870",d:"M6.826 7.232 0 15.21h12.188l1.37-3.762H8.335l3.191-3.69.01-.098L9.461 4.09h9.336L11.56 24h4.953L25.25 0H2.676l4.15 7.232Z"})}))};LogoFlagInverse.defaultProps={xmlns:"http://www.w3.org/2000/svg",width:"26",height:"24",fill:"none"};var LogoFlag=function(a){return/*#__PURE__*/_jsx("svg",_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("path",{fill:"#163300",d:"M6.826 7.232 0 15.21h12.188l1.37-3.762H8.335l3.191-3.69.01-.098L9.461 4.09h9.336L11.56 24h4.953L25.25 0H2.676l4.15 7.232Z"})}))};LogoFlag.defaultProps={xmlns:"http://www.w3.org/2000/svg",width:"26",height:"24",fill:"none"};var LogoWiseInverse=function(a){return/*#__PURE__*/_jsx("svg",_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("path",{fill:"#9FE870",d:"M58.738.359h6.498l-3.27 23.322h-6.498L58.739.359Zm-8.193 0L46.16 13.794 44.247.359h-4.545L33.96 13.754 33.243.36h-6.299l2.193 23.322h5.223l6.458-14.75 2.272 14.75h5.143L56.725.359h-6.18Zm54.558 13.555H89.674c.08 3.03 1.894 5.023 4.565 5.023 2.014 0 3.608-1.077 4.844-3.13l5.208 2.368C102.501 21.702 98.729 24 94.08 24c-6.339 0-10.545-4.266-10.545-11.123C83.535 5.342 88.478 0 95.455 0c6.14 0 10.007 4.146 10.007 10.605 0 1.076-.12 2.152-.359 3.309Zm-5.78-4.466c0-2.71-1.516-4.425-3.947-4.425-2.512 0-4.585 1.794-5.144 4.425h9.09ZM6.632 7.387 0 15.139h11.844l1.33-3.655H8.1l3.1-3.586.01-.095-2.016-3.471h9.072l-7.032 19.35h4.812L24.538.358H2.6l4.033 7.028Zm69.168-2.364c2.292 0 4.3 1.233 6.055 3.346l.921-6.575C81.143.688 78.93 0 76 0c-5.82 0-9.09 3.409-9.09 7.734 0 3 1.675 4.834 4.426 6.02l1.315.598c2.452 1.047 3.11 1.565 3.11 2.671 0 1.146-1.106 1.874-2.79 1.874-2.782.01-5.034-1.415-6.728-3.847l-.94 6.699C67.234 23.22 69.708 24 72.97 24c5.532 0 8.93-3.19 8.93-7.615 0-3.01-1.335-4.943-4.704-6.458l-1.435-.678c-1.994-.887-2.671-1.375-2.671-2.352 0-1.056.927-1.874 2.71-1.874Z"})}))};LogoWiseInverse.defaultProps={xmlns:"http://www.w3.org/2000/svg",width:"106",height:"24",fill:"none"};var LogoWise=function(a){return/*#__PURE__*/_jsx("svg",_objectSpread(_objectSpread({},a),{},{children:/*#__PURE__*/_jsx("path",{fill:"#163300",d:"M58.738.359h6.498l-3.27 23.322h-6.498L58.739.359Zm-8.193 0L46.16 13.794 44.247.359h-4.545L33.96 13.754 33.243.36h-6.299l2.193 23.322h5.223l6.458-14.75 2.272 14.75h5.143L56.725.359h-6.18Zm54.558 13.555H89.674c.08 3.03 1.894 5.023 4.565 5.023 2.014 0 3.608-1.077 4.844-3.13l5.208 2.368C102.501 21.702 98.729 24 94.08 24c-6.339 0-10.545-4.266-10.545-11.123C83.535 5.342 88.478 0 95.455 0c6.14 0 10.007 4.146 10.007 10.605 0 1.076-.12 2.152-.359 3.309Zm-5.78-4.466c0-2.71-1.516-4.425-3.947-4.425-2.512 0-4.585 1.794-5.144 4.425h9.09ZM6.632 7.387 0 15.139h11.844l1.33-3.655H8.1l3.1-3.586.01-.095-2.016-3.471h9.072l-7.032 19.35h4.812L24.538.358H2.6l4.033 7.028Zm69.168-2.364c2.292 0 4.3 1.233 6.055 3.346l.921-6.575C81.143.688 78.93 0 76 0c-5.82 0-9.09 3.409-9.09 7.734 0 3 1.675 4.834 4.426 6.02l1.315.598c2.452 1.047 3.11 1.565 3.11 2.671 0 1.146-1.106 1.874-2.79 1.874-2.782.01-5.034-1.415-6.728-3.847l-.94 6.699C67.234 23.22 69.708 24 72.97 24c5.532 0 8.93-3.19 8.93-7.615 0-3.01-1.335-4.943-4.704-6.458l-1.435-.678c-1.994-.887-2.671-1.375-2.671-2.352 0-1.056.927-1.874 2.71-1.874Z"})}))};LogoWise.defaultProps={xmlns:"http://www.w3.org/2000/svg",width:"106",height:"24",fill:"none"};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:LogoWise,WISE_INVERSE:LogoWiseInverse,WISE_BUSINESS_INVERSE:LogoWiseInverse,WISE_FLAG:LogoFlag,WISE_FLAG_INVERSE:LogoFlagInverse},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=j?svgPaths["WISE_FLAG".concat(c?"_INVERSE":"")]:svgPaths["".concat(d).concat(c?"_INVERSE":"")];return f?/*#__PURE__*/_jsx(l,{className:"np-logo-svg"}):/*#__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 +1 @@
|
|
|
1
|
-
import Logo,{LogoType}from".";import{jsx as _jsx}from"react/jsx-runtime";export default{component:Logo,title:"Content/Logo",render:a
|
|
1
|
+
import Logo,{LogoType}from".";import{jsx as _jsx}from"react/jsx-runtime";export default{component:Logo,title:"Content/Logo",render:function render(a){var b=a.type,c=a.inverse;return/*#__PURE__*/_jsx("div",{className:"".concat(c?"bg--dark":""," p-a-3"),children:/*#__PURE__*/_jsx(Logo,{type:b,inverse:c})})},tags:["autodocs"]};export var Basic={args:{type:LogoType.WISE,inverse:!1}};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// TODO: consider to move this enum into component file once we migrate it on TypeScript or replace with some common enum
|
|
2
|
-
export
|
|
2
|
+
export var LogoType=/*#__PURE__*/function(a){return a.WISE="WISE",a.WISE_BUSINESS="WISE_BUSINESS",a}({});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import commonmark from"commonmark";import difference from"lodash.difference";import PropTypes from"prop-types";import{MarkdownNodeType}from"../common";import{logActionRequired}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";
|
|
1
|
+
import"core-js/modules/es.object.values.js";import"core-js/modules/es.string.link.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import commonmark from"commonmark";import difference from"lodash.difference";import PropTypes from"prop-types";import{MarkdownNodeType}from"../common";import{logActionRequired}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";var reader=new commonmark.Parser,writer=new commonmark.HtmlRenderer({safe:!0}),NODE_TYPE_LIST=Object.values(MarkdownNodeType),Markdown=function(a){var b=a.as,c=a.children,d=a.className,e=a.allowList,f=a.blockList,g=a.config;if(!c)return null;null!==e&&void 0!==e&&e.length&&null!==f&&void 0!==f&&f.length&&logActionRequired("Markdown supports only one of `allowList` or `blockList` to be used at a time. `blockList` will be ignored.");var h=function(a){var b=reader.parse(a);if(e||f){var c=e?difference(NODE_TYPE_LIST,e):f;return stripNodes({parsed:b,blockList:c})}return b};return/*#__PURE__*/_jsx(b,{className:d,dangerouslySetInnerHTML:{__html:function createMarkup(){var a=g.link.target,b=h(c);return writer.render(b).replace(/<a href="/g,"<a target=\"".concat(a,"\" href=\""))}()}})};function stripNodes(a){var b=a.blockList,c=a.parsed;if(!c)return c;for(var d=c.walker(),e=d.next();e;){var f=e,g=f.node;if(b.includes(g.type)&&!e.entering){for(;g.firstChild;)g.insertBefore(g.firstChild);g.unlink()}e=d.next()}return d.root}Markdown.propTypes={children:PropTypes.string.isRequired,as:PropTypes.string,className:PropTypes.string,allowList:PropTypes.arrayOf(PropTypes.oneOf(["block_quote","code_block","code","emph","heading","html_block","html_inline","image","item","linebreak","link","list","paragraph","softbreak","strong","thematic_break"])),blockList:PropTypes.arrayOf(PropTypes.oneOf(["block_quote","code_block","code","emph","heading","html_block","html_inline","image","item","linebreak","link","list","paragraph","softbreak","strong","thematic_break"])),config:PropTypes.shape({link:PropTypes.shape({target:PropTypes.oneOf(["_blank","_self"])})})},Markdown.defaultProps={as:"div",className:void 0,allowList:null,blockList:null,config:{link:{target:"_self"}}};export default Markdown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import{useRef}from"react";import CSSTransition from"react-transition-group/CSSTransition";import{Size,Position,Scroll,Typography}from"../common";import{CloseButton}from"../common/closeButton";import{useLayout}from"../common/hooks";import Dimmer from"../dimmer";import Drawer from"../drawer";import Title from"../title/Title";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";
|
|
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"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import classNames from"classnames";import{useRef}from"react";import CSSTransition from"react-transition-group/CSSTransition";import{Size,Position,Scroll,Typography}from"../common";import{CloseButton}from"../common/closeButton";import{useLayout}from"../common/hooks";import Dimmer from"../dimmer";import Drawer from"../drawer";import Title from"../title/Title";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"),v=useRef(null);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,contentPosition:o,onClose:g,children:/*#__PURE__*/_jsx(CSSTransition,{nodeRef:v,appear:!0,in:i,classNames:{enterDone:"in"},timeout:TRANSITION_DURATION_IN_MILLISECONDS,unmountOnExit:!0,children:/*#__PURE__*/_jsx("div",_objectSpread(_objectSpread({ref:v,className:classNames("tw-modal","d-flex","fade","outline-none",m===Scroll.CONTENT&&"tw-modal--scrollable",h)},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(Title,{type:Typography.TITLE_BODY,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;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{action}from"@storybook/addon-actions";import{useState}from"react";import{Button,Modal}from"..";import{Scroll}from"../common";import{lorem10,lorem1000,storyConfig}from"../test-utils";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Modal,title:"Dialogs/Modal",args:{size:"md",position:"center",open:!0},parameters:{chromatic:{delay:2e3}}};export
|
|
2
|
-
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{action}from"@storybook/addon-actions";import{useState}from"react";import{Button,Modal}from"..";import{Scroll}from"../common";import{lorem10,lorem1000,storyConfig}from"../test-utils";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:Modal,title:"Dialogs/Modal",args:{size:"md",position:"center",open:!0},parameters:{chromatic:{delay:2e3}}};export var Basic={args:{title:"Title",body:lorem10,scroll:Scroll.VIEWPORT,footer:/*#__PURE__*/_jsx(Button,{block:!0,children:"Action"})},render:function render(a){// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
2
|
+
var b=useState(a.open),c=_slicedToArray(b,2),d=c[0],e=c[1];return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Button,{onClick:function onClick(){return e(!0)},children:"Open Modal"}),/*#__PURE__*/_jsx(Modal,_objectSpread(_objectSpread({},a),{},{open:d,onClose:function onClose(){e(!1),action("Modal closed")()}}))]})}};export var BasicMobile=storyConfig(Basic,{variants:["mobile"]});export var ContentScroll={args:{title:lorem10,body:lorem1000,scroll:Scroll.CONTENT}};export var ContentScrollMobile=storyConfig(ContentScroll,{variants:["mobile"]});export var ViewportScroll={args:{title:lorem10,body:lorem1000,scroll:Scroll.VIEWPORT}};export var ViewportScrollMobile=storyConfig(ViewportScroll,{variants:["mobile"]});export var WithoutTitle={args:{body:lorem1000,scroll:Scroll.CONTENT}};export var WithoutTitleMobile=storyConfig(WithoutTitle,{variants:["mobile"]});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{formatMoney}from"@transferwise/formatting";import PropTypes from"prop-types";import{useIntl}from"react-intl";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";
|
|
1
|
+
import{formatMoney}from"@transferwise/formatting";import PropTypes from"prop-types";import{useIntl}from"react-intl";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsx as _jsx}from"react/jsx-runtime";var Money=function(a){var b=a.amount,c=a.currency,d=useIntl(),e=d.locale;return/*#__PURE__*/_jsx(_Fragment,{children:formatMoney(b,c,e)})};Money.propTypes={amount:PropTypes.number.isRequired,currency:PropTypes.string.isRequired};export default Money;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import Money from"./Money";export default{component:Money,title:"Typography/Money"};export
|
|
1
|
+
import Money from"./Money";export default{component:Money,title:"Typography/Money"};export var Basic={args:{amount:1234.5678,currency:"GBP"}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{isEmpty,isNumber,isNull}from"@transferwise/neptune-validation";import classNames from"classnames";import PropTypes from"prop-types";import{Component}from"react";import{injectIntl}from"react-intl";import{Typography}from"../common";import{Key as keyValues}from"../common/key";import keyCodes from"../common/keyCodes";import{Size}from"../common/propsValues/size";import{Input}from"../inputs/Input";import Select from"../select";import Title from"../title";import messages from"./MoneyInput.messages";import{formatAmount,parseAmount}from"./currencyFormatting";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";const Currency=PropTypes.shape({header:PropTypes.string,value:PropTypes.string,label:PropTypes.string,currency:PropTypes.string,note:PropTypes.string,searchable:PropTypes.string}),CUSTOM_ACTION="CUSTOM_ACTION",isNumberOrNull=a=>isNumber(a)||isNull(a),formatAmountIfSet=(a,b,c,d)=>d?a||"":"number"==typeof a?formatAmount(a,b,c):"",parseNumber=(a,b,c,d)=>d?d&&a.length>d?0:+a:parseAmount(a,b,c),inputKeyCodeAllowlist=new Set([keyCodes.BACKSPACE,keyCodes.DELETE,keyCodes.COMMA,keyCodes.PERIOD,keyCodes.DOWN,keyCodes.UP,keyCodes.LEFT,keyCodes.RIGHT,keyCodes.ENTER,keyCodes.ESCAPE,keyCodes.TAB]),inputKeyAllowlist=new Set([keyValues.PERIOD,keyValues.COMMA]);class MoneyInput extends Component{constructor(a){super(a);const{locale:b}=this.props.intl;this.formatMessage=this.props.intl.formatMessage,this.state={searchQuery:"",formattedAmount:formatAmountIfSet(a.amount,a.selectedCurrency.currency,b,a.maxLengthOverride),locale:b}}UNSAFE_componentWillReceiveProps(a){this.setState({locale:a?.intl?.locale}),this.amountFocused||this.setState({formattedAmount:formatAmountIfSet(a.amount,a.selectedCurrency.currency,a?.intl?.locale,a.maxLengthOverride)})}isInputAllowedForKeyEvent=a=>{const{keyCode:b,metaKey:c,key:d,ctrlKey:e}=a,f=isNumber(parseInt(d,10));return f||c||e||inputKeyCodeAllowlist.has(b)||inputKeyAllowlist.has(d)};handleKeyDown=a=>{this.isInputAllowedForKeyEvent(a)||a.preventDefault()};handlePaste=a=>{const b=(a.clipboardData||window.clipboardData).getData("text"),{locale:c}=this.state,d=isEmpty(b)?null:parseNumber(b,this.props.selectedCurrency.currency,c,this.props.maxLengthOverride);isNumberOrNull(d)&&(this.setState({formattedAmount:formatAmountIfSet(d,this.props.selectedCurrency.currency,c,this.props.maxLengthOverride)}),this.props.onAmountChange(d)),a.preventDefault()};onAmountChange=a=>{const{value:b}=a.target;this.setState({formattedAmount:b});const c=isEmpty(b)?null:parseNumber(b,this.props.selectedCurrency.currency,this.state.locale,this.props.maxLengthOverride);isNumberOrNull(c)&&this.props.onAmountChange(c)};onAmountBlur=()=>{this.amountFocused=!1,this.setAmount()};onAmountFocus=()=>{this.amountFocused=!0};getSelectOptions(){const a=[...filterOptionsForQuery(this.props.currencies,this.state.searchQuery)];return this.props.onCustomAction&&a.push({value:CUSTOM_ACTION,label:this.props.customActionLabel}),a}setAmount(){this.setState(a=>{const b=parseNumber(a.formattedAmount,this.props.selectedCurrency.currency,a.locale,this.props.maxLengthOverride);return isNumberOrNull(b)?{formattedAmount:formatAmountIfSet(b,this.props.selectedCurrency.currency,a.locale,this.props.maxLengthOverride)}:{formattedAmount:a.formattedAmount}})}handleSelectChange=a=>{this.handleSearchChange(""),this.props.onCustomAction&&a.value===CUSTOM_ACTION?this.props.onCustomAction():this.props.onCurrencyChange(a)};handleSearchChange=a=>{this.setState({searchQuery:a}),this.props.onSearchChange&&this.props.onSearchChange({searchQuery:a,filteredOptions:filterOptionsForQuery(this.props.currencies,a)})};style=a=>this.props.classNames[a]||a;render(){const{selectedCurrency:a,onCurrencyChange:b,size:c,addon:d,id:e,selectProps:f,maxLengthOverride:g}=this.props,h=this.getSelectOptions(),i=!this.state.searchQuery&&(1===h.length&&h[0].currency===a.currency||!b),j=!this.props.onAmountChange;return/*#__PURE__*/_jsxs("div",{className:classNames(this.style("tw-money-input"),this.style("input-group"),this.style(`input-group-${c}`)),children:[/*#__PURE__*/_jsx(Input,{id:e,value:this.state.formattedAmount,inputMode:"decimal",disabled:j,maxLength:g,placeholder:formatAmountIfSet(this.props.placeholder,this.props.selectedCurrency.currency,this.state.locale,this.props.maxLengthOverride),autoComplete:"off",onKeyDown:this.handleKeyDown,onChange:this.onAmountChange,onFocus:this.onAmountFocus,onBlur:this.onAmountBlur,onPaste:this.handlePaste}),d&&/*#__PURE__*/_jsx("span",{className:classNames(this.style("input-group-addon"),this.style(`input-${c}`),j?this.style("disabled"):""),children:d}),i?/*#__PURE__*/_jsxs("div",{className:classNames(this.style("input-group-addon"),this.style(`input-${c}`),this.style("tw-money-input__fixed-currency"),j?this.style("disabled"):""),children:[("lg"===c||"md"===c)&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("i",{className:classNames(this.style("tw-money-input__keyline"))}),/*#__PURE__*/_jsx("i",{className:classNames(this.style("currency-flag"),this.style(`currency-flag-${a.currency.toLowerCase()}`),this.style("m-r-2"))})]}),/*#__PURE__*/_jsx(Title,{as:"span",type:Typography.TITLE_SUBSECTION,className:"lg"===c?this.style("m-r-1"):"",children:a.currency.toUpperCase()})]}):/*#__PURE__*/_jsx("div",{className:classNames(this.style("input-group-btn"),this.style("amount-currency-select-btn")),children:/*#__PURE__*/_jsx(Select,{id:e?`${e}-select`:void 0,classNames:this.props.classNames,options:h,selected:{...a,label:/*#__PURE__*/_jsx(Title,{as:"span",type:Typography.TITLE_SUBSECTION,className:"tw-money-input__text",children:a.label}),note:null},placeholder:this.formatMessage(messages.selectPlaceholder),searchPlaceholder:this.props.searchPlaceholder,searchValue:this.state.searchQuery,size:c,required:!0,dropdownWidth:Size.LARGE,inverse:!0,onChange:this.handleSelectChange,onSearchChange:this.handleSearchChange,...f})})]})}}function filterOptionsForQuery(a,b){if(!b)return a;const c=removeDuplicateValueOptions(a).filter(a=>isCurrencyOptionAndFitsQuery(a,b));return sortOptionsLabelsToFirst(c,b)}function removeDuplicateValueOptions(a){const b=[],c=[];return a.forEach(a=>{a.value&&!c.includes(a.value)&&(b.push(a),c.push(a.value))}),b}function isCurrencyOptionAndFitsQuery(a,b){return!!a.value&&(contains(a.label,b)||contains(a.searchable,b)||contains(a.note,b))}function contains(a,b){return a&&a.toLowerCase().includes(b.toLowerCase())}function sortOptionsLabelsToFirst(a,b){return a.sort((a,c)=>{const d=contains(a.label,b),e=contains(c.label,b);return d&&e?0:d?-1:e?1:0})}MoneyInput.propTypes={id:PropTypes.string,currencies:PropTypes.arrayOf(Currency).isRequired,selectedCurrency:Currency.isRequired,onCurrencyChange:PropTypes.func,placeholder:PropTypes.number,amount:PropTypes.number,size:PropTypes.oneOf(["sm","md","lg"]),onAmountChange:PropTypes.func,addon:PropTypes.node,searchPlaceholder:PropTypes.string,/**
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.reflect.construct.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}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"core-js/modules/es.array.iterator.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.parse-int.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.array.includes.js";import"core-js/modules/es.string.includes.js";import"core-js/modules/es.array.sort.js";import{isEmpty,isNumber,isNull}from"@transferwise/neptune-validation";import classNames from"classnames";import PropTypes from"prop-types";import{Component}from"react";import{injectIntl}from"react-intl";import{Typography}from"../common";import{Key as keyValues}from"../common/key";import keyCodes from"../common/keyCodes";import{Size}from"../common/propsValues/size";import{Input}from"../inputs/Input";import Select from"../select";import Title from"../title";import messages from"./MoneyInput.messages";import{formatAmount,parseAmount}from"./currencyFormatting";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 Currency=PropTypes.shape({header:PropTypes.string,value:PropTypes.string,label:PropTypes.string,currency:PropTypes.string,note:PropTypes.string,searchable:PropTypes.string}),CUSTOM_ACTION="CUSTOM_ACTION",isNumberOrNull=function(a){return isNumber(a)||isNull(a)},formatAmountIfSet=function(a,b,c,d){return d?a||"":"number"==typeof a?formatAmount(a,b,c):""},parseNumber=function(a,b,c,d){return d?d&&a.length>d?0:+a:parseAmount(a,b,c)},inputKeyCodeAllowlist=new Set([keyCodes.BACKSPACE,keyCodes.DELETE,keyCodes.COMMA,keyCodes.PERIOD,keyCodes.DOWN,keyCodes.UP,keyCodes.LEFT,keyCodes.RIGHT,keyCodes.ENTER,keyCodes.ESCAPE,keyCodes.TAB]),inputKeyAllowlist=new Set([keyValues.PERIOD,keyValues.COMMA]),MoneyInput=/*#__PURE__*/function(a){function b(a){var d;_classCallCheck(this,b),d=c.call(this,a),_defineProperty(_assertThisInitialized(d),"isInputAllowedForKeyEvent",function(a){var b=a.keyCode,c=a.metaKey,d=a.key,e=a.ctrlKey,f=isNumber(parseInt(d,10));return f||c||e||inputKeyCodeAllowlist.has(b)||inputKeyAllowlist.has(d)}),_defineProperty(_assertThisInitialized(d),"handleKeyDown",function(a){d.isInputAllowedForKeyEvent(a)||a.preventDefault()}),_defineProperty(_assertThisInitialized(d),"handlePaste",function(a){var b=(a.clipboardData||window.clipboardData).getData("text"),c=d.state.locale,e=isEmpty(b)?null:parseNumber(b,d.props.selectedCurrency.currency,c,d.props.maxLengthOverride);isNumberOrNull(e)&&(d.setState({formattedAmount:formatAmountIfSet(e,d.props.selectedCurrency.currency,c,d.props.maxLengthOverride)}),d.props.onAmountChange(e)),a.preventDefault()}),_defineProperty(_assertThisInitialized(d),"onAmountChange",function(a){var b=a.target.value;d.setState({formattedAmount:b});var c=isEmpty(b)?null:parseNumber(b,d.props.selectedCurrency.currency,d.state.locale,d.props.maxLengthOverride);isNumberOrNull(c)&&d.props.onAmountChange(c)}),_defineProperty(_assertThisInitialized(d),"onAmountBlur",function(){d.amountFocused=!1,d.setAmount()}),_defineProperty(_assertThisInitialized(d),"onAmountFocus",function(){d.amountFocused=!0}),_defineProperty(_assertThisInitialized(d),"handleSelectChange",function(a){d.handleSearchChange(""),d.props.onCustomAction&&a.value===CUSTOM_ACTION?d.props.onCustomAction():d.props.onCurrencyChange(a)}),_defineProperty(_assertThisInitialized(d),"handleSearchChange",function(a){d.setState({searchQuery:a}),d.props.onSearchChange&&d.props.onSearchChange({searchQuery:a,filteredOptions:filterOptionsForQuery(d.props.currencies,a)})}),_defineProperty(_assertThisInitialized(d),"style",function(a){return d.props.classNames[a]||a});var e=d.props.intl.locale;return d.formatMessage=d.props.intl.formatMessage,d.state={searchQuery:"",formattedAmount:formatAmountIfSet(a.amount,a.selectedCurrency.currency,e,a.maxLengthOverride),locale:e},d}_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"UNSAFE_componentWillReceiveProps",value:function UNSAFE_componentWillReceiveProps(a){var b;if(this.setState({locale:null===a||void 0===a||null===(b=a.intl)||void 0===b?void 0:b.locale}),!this.amountFocused){var c;this.setState({formattedAmount:formatAmountIfSet(a.amount,a.selectedCurrency.currency,null===a||void 0===a||null===(c=a.intl)||void 0===c?void 0:c.locale,a.maxLengthOverride)})}}},{key:"getSelectOptions",value:function getSelectOptions(){var a=_toConsumableArray(filterOptionsForQuery(this.props.currencies,this.state.searchQuery));return this.props.onCustomAction&&a.push({value:CUSTOM_ACTION,label:this.props.customActionLabel}),a}},{key:"setAmount",value:function setAmount(){var a=this;this.setState(function(b){var c=parseNumber(b.formattedAmount,a.props.selectedCurrency.currency,b.locale,a.props.maxLengthOverride);return isNumberOrNull(c)?{formattedAmount:formatAmountIfSet(c,a.props.selectedCurrency.currency,b.locale,a.props.maxLengthOverride)}:{formattedAmount:b.formattedAmount}})}},{key:"render",value:function render(){var a=this.props,b=a.selectedCurrency,c=a.onCurrencyChange,d=a.size,e=a.addon,f=a.id,g=a.selectProps,h=a.maxLengthOverride,i=this.getSelectOptions(),j=!this.state.searchQuery&&(1===i.length&&i[0].currency===b.currency||!c),k=!this.props.onAmountChange;return/*#__PURE__*/_jsxs("div",{className:classNames(this.style("tw-money-input"),this.style("input-group"),this.style("input-group-".concat(d))),children:[/*#__PURE__*/_jsx(Input,{id:f,value:this.state.formattedAmount,inputMode:"decimal",disabled:k,maxLength:h,placeholder:formatAmountIfSet(this.props.placeholder,this.props.selectedCurrency.currency,this.state.locale,this.props.maxLengthOverride),autoComplete:"off",onKeyDown:this.handleKeyDown,onChange:this.onAmountChange,onFocus:this.onAmountFocus,onBlur:this.onAmountBlur,onPaste:this.handlePaste}),e&&/*#__PURE__*/_jsx("span",{className:classNames(this.style("input-group-addon"),this.style("input-".concat(d)),k?this.style("disabled"):""),children:e}),j?/*#__PURE__*/_jsxs("div",{className:classNames(this.style("input-group-addon"),this.style("input-".concat(d)),this.style("tw-money-input__fixed-currency"),k?this.style("disabled"):""),children:[("lg"===d||"md"===d)&&/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("i",{className:classNames(this.style("tw-money-input__keyline"))}),/*#__PURE__*/_jsx("i",{className:classNames(this.style("currency-flag"),this.style("currency-flag-".concat(b.currency.toLowerCase())),this.style("m-r-2"))})]}),/*#__PURE__*/_jsx(Title,{as:"span",type:Typography.TITLE_SUBSECTION,className:"lg"===d?this.style("m-r-1"):"",children:b.currency.toUpperCase()})]}):/*#__PURE__*/_jsx("div",{className:classNames(this.style("input-group-btn"),this.style("amount-currency-select-btn")),children:/*#__PURE__*/_jsx(Select,_objectSpread({id:f?"".concat(f,"-select"):void 0,classNames:this.props.classNames,options:i,selected:_objectSpread(_objectSpread({},b),{},{label:/*#__PURE__*/_jsx(Title,{as:"span",type:Typography.TITLE_SUBSECTION,className:"tw-money-input__text",children:b.label}),note:null}),placeholder:this.formatMessage(messages.selectPlaceholder),searchPlaceholder:this.props.searchPlaceholder,searchValue:this.state.searchQuery,size:d,required:!0,dropdownWidth:Size.LARGE,inverse:!0,onChange:this.handleSelectChange,onSearchChange:this.handleSearchChange},g))})]})}}]),b}(Component);function filterOptionsForQuery(a,b){if(!b)return a;var c=removeDuplicateValueOptions(a).filter(function(a){return isCurrencyOptionAndFitsQuery(a,b)});return sortOptionsLabelsToFirst(c,b)}function removeDuplicateValueOptions(a){var b=[],c=[];return a.forEach(function(a){a.value&&!c.includes(a.value)&&(b.push(a),c.push(a.value))}),b}function isCurrencyOptionAndFitsQuery(a,b){return!!a.value&&(contains(a.label,b)||contains(a.searchable,b)||contains(a.note,b))}function contains(a,b){return a&&a.toLowerCase().includes(b.toLowerCase())}function sortOptionsLabelsToFirst(a,b){return a.sort(function(a,c){var d=contains(a.label,b),e=contains(c.label,b);return d&&e?0:d?-1:e?1:0})}MoneyInput.propTypes={id:PropTypes.string,currencies:PropTypes.arrayOf(Currency).isRequired,selectedCurrency:Currency.isRequired,onCurrencyChange:PropTypes.func,placeholder:PropTypes.number,amount:PropTypes.number,size:PropTypes.oneOf(["sm","md","lg"]),onAmountChange:PropTypes.func,addon:PropTypes.node,searchPlaceholder:PropTypes.string,/**
|
|
2
2
|
* Allows the consumer to react to searching, while the search itself is handled internally. Called with `{ searchQuery: string, filteredOptions: Currency[] }`
|
|
3
3
|
*/onSearchChange:PropTypes.func,customActionLabel:PropTypes.node,onCustomAction:PropTypes.func,classNames:PropTypes.objectOf(PropTypes.string),selectProps:PropTypes.object,maxLengthOverride:PropTypes.number},MoneyInput.defaultProps={id:null,size:Size.LARGE,addon:null,searchPlaceholder:"",onSearchChange:void 0,onCurrencyChange:null,placeholder:null,amount:null,onAmountChange:null,customActionLabel:"",onCustomAction:null,classNames:{},selectProps:{},maxLengthOverride:null};// this export is necessary for react-to-typescript-definitions
|
|
4
4
|
// to be able to properly generate TS types, this is due to us wrapping this component in `injectIntl` before exporting
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{within,userEvent}from"@storybook/testing-library";import MoneyInput from".";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:MoneyInput,title:"Forms/MoneyInput",render:a
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import{within,userEvent}from"@storybook/testing-library";import MoneyInput from".";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export default{component:MoneyInput,title:"Forms/MoneyInput",render:function render(a){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("label",{htmlFor:a.id,children:"Editable money input label"}),/*#__PURE__*/_jsx(MoneyInput,_objectSpread({},a))]})},args:{id:"money-input",amount:1e3,selectProps:{buttonProps:{"aria-label":"Select currency"},dropdownProps:{"aria-label":"Currency options"}}},tags:["autodocs"]};var exampleCurrency={eur:{value:"EUR",label:"EUR",note:"Euro",currency:"eur",searchable:"Spain, Germany, France, Austria"},gbp:{value:"GBP",label:"GBP",note:"British pound",currency:"gbp",searchable:"England, Scotland, Wales"}};export var SingleCurrency={args:{currencies:[],selectedCurrency:exampleCurrency.eur,onCurrencyChange:null}};export var MultipleCurrencies={args:{currencies:[{header:"Popular currencies"},exampleCurrency.eur,exampleCurrency.gbp],selectedCurrency:exampleCurrency.eur}};export var OpenedInput=_objectSpread(_objectSpread({},MultipleCurrencies),{},{play:function play(a){var b=a.canvasElement,c=within(b);userEvent.click(c.getByRole("combobox"))}});export var SmallInput={render:function render(a){return/*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx("label",{htmlFor:a.id,children:"Money inputs"}),/*#__PURE__*/_jsx(MoneyInput,_objectSpread(_objectSpread({},a),SingleCurrency.args)),/*#__PURE__*/_jsx("br",{}),/*#__PURE__*/_jsx(MoneyInput,_objectSpread(_objectSpread({},a),MultipleCurrencies.args)),/*#__PURE__*/_jsx("hr",{}),/*#__PURE__*/_jsxs("div",{className:"has-error",children:[/*#__PURE__*/_jsx("label",{htmlFor:a.id,children:"Error states"}),/*#__PURE__*/_jsx(MoneyInput,_objectSpread(_objectSpread({},a),SingleCurrency.args)),/*#__PURE__*/_jsx("br",{}),/*#__PURE__*/_jsx(MoneyInput,_objectSpread(_objectSpread({},a),MultipleCurrencies.args))]})]})},args:{size:"sm"}};export var MediumInput={render:SmallInput.render,args:{size:"md"}};export var LargeInput={render:SmallInput.render,args:{size:"lg"}};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{formatAmount}from"@transferwise/formatting";import{DEFAULT_LOCALE}from"../common/locale";export{formatAmount};// TODO: do not duplicate this between formatting and components
|
|
2
|
-
|
|
1
|
+
import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import"core-js/modules/es.regexp.constructor.js";import"core-js/modules/es.regexp.to-string.js";import"core-js/modules/es.parse-float.js";import"core-js/modules/es.number.to-fixed.js";import{formatAmount}from"@transferwise/formatting";import{DEFAULT_LOCALE}from"../common/locale";export{formatAmount};// TODO: do not duplicate this between formatting and components
|
|
2
|
+
var currencyDecimals={BIF:0,BYR:0,CLP:0,DJF:0,GNF:0,JPY:0,KMF:0,KRW:0,MGA:0,PYG:0,RWF:0,VND:0,VUV:0,XAF:0,XOF:0,XPF:0,// technically HUF does have decimals, but due to the exchange rate banks
|
|
3
3
|
// do not accept decimal amounts
|
|
4
|
-
HUF:0,BHD:3,JOD:3,KWD:3,OMR:3,TND:3},DEFAULT_CURRENCY_DECIMALS=2;function isNumberLocaleSupported(){
|
|
4
|
+
HUF:0,BHD:3,JOD:3,KWD:3,OMR:3,TND:3},DEFAULT_CURRENCY_DECIMALS=2;function isNumberLocaleSupported(){var a=1234 .toLocaleString&&1234 .toLocaleString(DEFAULT_LOCALE);return"1,234"===a}function getValidLocale(a){try{var b=a.replace(/_/,"-");return Intl.NumberFormat(b),b}catch(a){return"en-GB"}}function getCurrencyDecimals(){var a=0<arguments.length&&arguments[0]!==void 0?arguments[0]:"",b=a.toUpperCase();return Object.prototype.hasOwnProperty.call(currencyDecimals,b)?currencyDecimals[b]:DEFAULT_CURRENCY_DECIMALS}function getDecimalSeparator(a){return isNumberLocaleSupported()?1.1.toLocaleString(a)[1]:"."}export function parseAmount(a,b,c){var d=getValidLocale(c),e=getCurrencyDecimals(b),f=isNumberLocaleSupported()?1e4.toLocaleString(d)[2]:",",g=getDecimalSeparator(d),h=(a?"".concat(a):"").replace(new RegExp("\\".concat(f),"g"),"").replace(new RegExp("\\".concat(g),"g"),".").replace(/[^0-9.]/g,""),i=parseFloat(parseFloat(h).toFixed(e));return Math.abs(i)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import classNames from"classnames";import{forwardRef}from"react";import Chevron from"../chevron";import{Position}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _objectWithoutProperties from"@babel/runtime/helpers/objectWithoutProperties";var _excluded=["as","disabled","onClick","className"];import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import classNames from"classnames";import{forwardRef}from"react";import Chevron from"../chevron";import{Position}from"../common";import Option from"../common/Option";import{jsx as _jsx}from"react/jsx-runtime";var NavigationOption=/*#__PURE__*/forwardRef(function(a,b){var c=a.as,d=void 0===c?"button":c,e=a.disabled,f=void 0!==e&&e,g=a.onClick,h=a.className,i=_objectWithoutProperties(a,_excluded);return"href"in i&&i.href&&(d="a"),/*#__PURE__*/_jsx(Option,_objectSpread(_objectSpread({},i),{},{ref:b,as:d,className:classNames("np-navigation-option",h),button:/*#__PURE__*/_jsx(Chevron,{orientation:Position.RIGHT,disabled:f,className:"d-block"}),disabled:f,onClick:function onClick(a){return f?void a.preventDefault():void(g&&g(a))}}))});export default NavigationOption;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import PropTypes from"prop-types";import{Children}from"react";import{jsx as _jsx}from"react/jsx-runtime";
|
|
1
|
+
import"core-js/modules/es.array.map.js";import PropTypes from"prop-types";import{Children}from"react";import{jsx as _jsx}from"react/jsx-runtime";var NavigationOptionList=function(a){var b=a.children;return/*#__PURE__*/_jsx("ul",{className:"np-navigation-options-list",children:Children.map(b,function(a){return/*#__PURE__*/_jsx("li",{className:"np-navigation-options-list__item",children:a},a.key)})})};NavigationOptionList.propTypes={children:PropTypes.node.isRequired};export default NavigationOptionList;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Illustration}from"@wise/art";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body";import{Typography}from"../common";import{CloseButton}from"../common/closeButton";import Link from"../link";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export
|
|
1
|
+
import"core-js/modules/es.string.link.js";import{Illustration}from"@wise/art";import{useTheme}from"@wise/components-theming";import classNames from"classnames";import PropTypes from"prop-types";import Body from"../body";import{Typography}from"../common";import{CloseButton}from"../common/closeButton";import Link from"../link";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";export var Media={GLOBE:"globe",LOCK:"lock",WALLET:"wallet",GEAR:"gear","INVITE-LETTER":"invite-letter"};var Nudge=function(a){var b=a.media,c=a.mediaName,d=a.title,e=a.link,f=a.href,g=a.onClick,h=a.onDismiss,i=a.id,j=a.className,k=useTheme(),l=k.isModern;return/*#__PURE__*/_jsxs("div",{className:classNames("wds-nudge",j),id:i,children:[l?!!c&&/*#__PURE__*/_jsx("div",{className:"wds-nudge-media",children:/*#__PURE__*/_jsx(Illustration,{name:c,className:classNames("wds-nudge-media-".concat(c)),size:"small",disablePadding:!0})}):/*#__PURE__*/_jsx("div",{className:"wds-nudge-media",children:b}),/*#__PURE__*/_jsxs("div",{className:"wds-nudge-container",children:[/*#__PURE__*/_jsxs("div",{className:"wds-nudge-content",children:[l?/*#__PURE__*/_jsx(Body,{type:Typography.BODY_LARGE,className:classNames("wds-nudge-body"),children:d}):/*#__PURE__*/_jsx("div",{className:"wds-nudge-title",children:d}),e&&/*#__PURE__*/_jsx(Link,{href:f,type:Typography.LINK_LARGE,className:"wds-nudge-link",onClick:g,children:e})]}),h&&/*#__PURE__*/_jsx(CloseButton,{className:"wds-nudge-control",size:"sm",onClick:h})]})]})};Nudge.propTypes={media:PropTypes.node,mediaName:PropTypes.oneOf(["globe","lock","wallet","gear","invite-letter"]),title:PropTypes.node.isRequired,link:PropTypes.node,href:PropTypes.string,onClick:PropTypes.func,onDismiss:PropTypes.func,id:PropTypes.string,className:PropTypes.string},Nudge.Media=Media,Nudge.defaultProps={id:null,className:null,onClick:void 0,onDismiss:void 0};export default Nudge;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import PropTypes from"prop-types";import{CloseButton}from"../common/closeButton";import FlowHeader from"../common/flowHeader";import Logo from"../logo";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
import PropTypes from"prop-types";import{CloseButton}from"../common/closeButton";import FlowHeader from"../common/flowHeader";import Logo from"../logo";import{jsx as _jsx}from"react/jsx-runtime";import{Fragment as _Fragment}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var OverlayHeader=function(a){var b=a.avatar,c=a.onClose,d=a.logo,e=c&&/*#__PURE__*/_jsx(CloseButton,{onClick:c});return/*#__PURE__*/_jsx("div",{className:"np-overlay-header d-flex justify-content-center",children:/*#__PURE__*/_jsx(FlowHeader,{className:"np-overlay-header__content p-a-3",leftContent:d,rightContent:/*#__PURE__*/_jsxs(_Fragment,{children:[b,b&&e&&/*#__PURE__*/_jsx("span",{className:"separator"}),e]})})})};OverlayHeader.defaultProps={avatar:null,logo:/*#__PURE__*/_jsx(Logo,{}),onClose:null},OverlayHeader.propTypes={/** An Avatar */avatar:PropTypes.element,logo:PropTypes.node,/** Function called when the close is clicked */onClose:PropTypes.func};export default OverlayHeader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isArray}from"@transferwise/neptune-validation";import PropTypes from"prop-types";import{useState,useEffect}from"react";import{useIntl}from"react-intl";import{Size}from"../common";import Select from"../select";import countries from"./data/countries";import{explodeNumberModel,filterOptionsForQuery,isValidPhoneNumber,cleanNumber,setDefaultPrefix,isStringNumeric,sortArrayByProperty,groupCountriesByPrefix,excludeCountries}from"./utils";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.array.map.js";import"core-js/modules/es.array.join.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import"core-js/modules/es.array.find.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";import{isArray}from"@transferwise/neptune-validation";import PropTypes from"prop-types";import{useState,useEffect}from"react";import{useIntl}from"react-intl";import{Size}from"../common";import Select from"../select";import countries from"./data/countries";import{explodeNumberModel,filterOptionsForQuery,isValidPhoneNumber,cleanNumber,setDefaultPrefix,isStringNumeric,sortArrayByProperty,groupCountriesByPrefix,excludeCountries}from"./utils";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var ALLOWED_PHONE_CHARS=/^$|^[\d-\s]+$/,PhoneNumberInput=function(a){var b=a.id,c=a.onChange,d=a.searchPlaceholder,e=a.disabled,f=a.required,g=a.size,h=a.placeholder,i=a.onFocus,j=a.onBlur,k=a.countryCode,l=a.selectProps,m=a.disabledCountries,n=useIntl(),o=n.locale,p=useState(function getInitialValue(){var b=a.initialValue,c=b?cleanNumber(b):null;return c&&isValidPhoneNumber(c)?explodeNumberModel(c):{prefix:setDefaultPrefix(o,k),suffix:""}}()),q=_slicedToArray(p,2),r=q[0],s=q[1],t=useState(null),u=_slicedToArray(t,2),v=u[0],w=u[1],x=useState(""),y=_slicedToArray(x,2),z=y[0],A=y[1],B=excludeCountries(countries,m),C=groupCountriesByPrefix(sortArrayByProperty(B,"iso3")),D=groupCountriesByPrefix(sortArrayByProperty(B,"phone")),E=function getSelectOptions(){var a=filterOptionsForQuery(isStringNumeric(z)?D:C,z);return a.map(function(a){var b=a.phone,c=a.iso3,d=a.iso2,e="";return c?e=isArray(c)?c.join(", "):c:d&&(e=isArray(d)?d.join(", "):d),{value:b,label:b,note:e}})}();return useEffect(function(){if(null===v)return w(r);var a=r.prefix+r.suffix,b=v.prefix+v.suffix;if(a!==b){var d=isValidPhoneNumber(a)?cleanNumber(a):null;c(d),w(r)}},[c,v,r]),/*#__PURE__*/_jsxs("div",{className:"tw-telephone",children:[/*#__PURE__*/_jsx("div",{className:"tw-telephone__country-select",children:/*#__PURE__*/_jsx(Select,_objectSpread({id:b?"".concat(b,"-select"):void 0,options:E,selected:{value:r.prefix,label:r.prefix},placeholder:"Select an option...",searchPlaceholder:d,dropdownWidth:Size.SMALL,searchValue:z,required:f,disabled:e,size:g,onChange:function onPrefixChange(a){var b=a.value;A(""),s({prefix:b,suffix:r.suffix})},onSearchChange:function onSearchChange(a){return A(a)}},l))}),/*#__PURE__*/_jsx("div",{className:"tw-telephone__number-input",children:/*#__PURE__*/_jsx("div",{className:"input-group input-group-".concat(g),children:/*#__PURE__*/_jsx("input",{id:b,name:"phoneNumber",inputMode:"numeric",value:r.suffix,className:"form-control",disabled:e,required:f,placeholder:h,onChange:function onSuffixChange(a){var b=a.target.value,c=void 0===b?"":b;ALLOWED_PHONE_CHARS.test(c)&&s({prefix:r.prefix,suffix:c})},onPaste:function onPaste(a){if(a.nativeEvent.clipboardData){var b=(a.nativeEvent.clipboardData.getData("text/plain")||"").replace(/(\s|-)+/g,""),c=explodeNumberModel(b),d=c.prefix,e=c.suffix,f=E.find(function(a){var b=a.value;return b===d});f&&ALLOWED_PHONE_CHARS.test(e)&&s({prefix:d,suffix:e})}},onFocus:i,onBlur:j})})})]})};PhoneNumberInput.propTypes={id:PropTypes.string,required:PropTypes.bool,disabled:PropTypes.bool,initialValue:PropTypes.string,onChange:PropTypes.func.isRequired,onFocus:PropTypes.func,onBlur:PropTypes.func,countryCode:PropTypes.string,searchPlaceholder:PropTypes.string,size:PropTypes.oneOf(["sm","md","lg"]),placeholder:PropTypes.string,selectProps:PropTypes.object,/** List of iso3 codes of countries to remove from the list */disabledCountries:PropTypes.arrayOf(PropTypes.string)},PhoneNumberInput.defaultProps={id:null,required:!1,disabled:!1,initialValue:null,onFocus:function onFocus(){},onBlur:function onBlur(){},countryCode:null,searchPlaceholder:"Prefix",size:Size.MEDIUM,placeholder:"",selectProps:{},disabledCountries:[]};export default PhoneNumberInput;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const countries=[{name:"Afghanistan",iso2:"AF",iso3:"AFG",phone:"+93"},{name:"\xC5land Islands",iso2:"AX",iso3:"ALA",phone:"+358"},{name:"Albania",iso2:"AL",iso3:"ALB",phone:"+355"},{name:"Algeria",iso2:"DZ",iso3:"DZA",phone:"+213"},{name:"American Samoa",iso2:"AS",iso3:"ASM",phone:"+1684"},{name:"Andorra",iso2:"AD",iso3:"AND",phone:"+376"},{name:"Angola",iso2:"AO",iso3:"AGO",phone:"+244"},{name:"Anguilla",iso2:"AI",iso3:"AIA",phone:"+1264"},{name:"Antarctica",iso2:"AQ",iso3:"ATA",phone:"+672"},{name:"Antigua",iso2:"AG",iso3:"ATG",phone:"+1268"},{name:"Argentina",iso2:"AR",iso3:"ARG",phone:"+54"},{name:"Armenia",iso2:"AM",iso3:"ARM",phone:"+374"},{name:"Aruba",iso2:"AW",iso3:"ABW",phone:"+297"},{name:"Ascension Island",iso2:"SH",iso3:"SHN",phone:"+247"},{name:"Australia",iso2:"AU",iso3:"AUS",phone:"+61"},{name:"Australian Antarctic Territory",iso2:"AQ",iso3:"ATA",phone:"+672"},{name:"Austria",iso2:"AT",iso3:"AUT",phone:"+43"},{name:"Azerbaijan",iso2:"AZ",iso3:"AZE",phone:"+994"},{name:"Bahamas",iso2:"BS",iso3:"BHS",phone:"+1242"},{name:"Bahrain",iso2:"BH",iso3:"BHR",phone:"+973"},{name:"Bangladesh",iso2:"BD",iso3:"BGD",phone:"+880"},{name:"Barbados",iso2:"BB",iso3:"BRB",phone:"+1246"},{name:"Belarus",iso2:"BY",iso3:"BLR",phone:"+375"},{name:"Belgium",iso2:"BE",iso3:"BEL",phone:"+32"},{name:"Belize",iso2:"BZ",iso3:"BLZ",phone:"+501"},{name:"Benin",iso2:"BJ",iso3:"BEN",phone:"+229"},{name:"Bermuda",iso2:"BM",iso3:"BMU",phone:"+1441"},{name:"Bhutan",iso2:"BT",iso3:"BTN",phone:"+975"},{name:"Bolivia",iso2:"BO",iso3:"BOL",phone:"+591"},{name:"Bonaire, Sint Eustatius and Saba",iso2:"BQ",iso3:"BES",phone:"+599"},{name:"Bosnia and Herzegovina",iso2:"BA",iso3:"BIH",phone:"+387"},{name:"Botswana",iso2:"BW",iso3:"BWA",phone:"+267"},{name:"Brazil",iso2:"BR",iso3:"BRA",phone:"+55"},{name:"British Virgin Islands",iso2:"VG",iso3:"VGB",phone:"+1284"},{name:"Brunei",iso2:"BN",iso3:"BRN",phone:"+673"},{name:"Bulgaria",iso2:"BG",iso3:"BGR",phone:"+359"},{name:"Burkina Faso",iso2:"BF",iso3:"BFA",phone:"+226"},{name:"Burundi",iso2:"BI",iso3:"BDI",phone:"+257"},{name:"Cambodia",iso2:"KH",iso3:"KHM",phone:"+855"},{name:"Cameroon",iso2:"CM",iso3:"CMR",phone:"+237"},{name:"Canada",iso2:"CA",iso3:"CAN",phone:"+1"},{name:"Cape Verde",iso2:"CV",iso3:"CPV",phone:"+238"},{name:"Cayman Islands",iso2:"KY",iso3:"CYM",phone:"+1345"},{name:"Central African Republic",iso2:"CF",iso3:"CAF",phone:"+236"},{name:"Chad",iso2:"TD",iso3:"TCD",phone:"+235"},{name:"Chile",iso2:"CL",iso3:"CHL",phone:"+56"},{name:"China",iso2:"CN",iso3:"CHN",phone:"+86"},{name:"Christmas Island",iso2:"CX",iso3:"CXR",phone:"+61"},{name:"Cocos (Keeling) Islands",iso2:"CC",iso3:"CCK",phone:"+61"},{name:"Colombia",iso2:"CO",iso3:"COL",phone:"+57"},{name:"Comoros",iso2:"KM",iso3:"COM",phone:"+269"},{name:"Congo",iso2:"CG",iso3:"COG",phone:"+242"},{name:"Cook Islands",iso2:"CK",iso3:"COK",phone:"+682"},{name:"Costa Rica",iso2:"CR",iso3:"CRI",phone:"+506"},{name:"Croatia",iso2:"HR",iso3:"HRV",phone:"+385"},{name:"Cuba",iso2:"CU",iso3:"CUB",phone:"+53"},{name:"Cura\xE7ao",iso2:"CW",iso3:"CUW",phone:"+599"},{name:"Cyprus",iso2:"CY",iso3:"CYP",phone:"+357"},{name:"Czech Republic",iso2:"CZ",iso3:"CZE",phone:"+420"},{name:"Democratic Republic of the Congo",iso2:"CD",iso3:"COD",phone:"+243"},{name:"Denmark",iso2:"DK",iso3:"DNK",phone:"+45"},{name:"Diego Garcia",iso2:"IO",iso3:"IOT",phone:"+246"},{name:"Djibouti",iso2:"DJ",iso3:"DJI",phone:"+253"},{name:"Dominica",iso2:"DM",iso3:"DMA",phone:"+1767"},{name:"Dominican Republic",iso2:"DO",iso3:"DOM",phone:"+1809"},{name:"Dominican Republic",iso2:"DO",iso3:"DOM",phone:"+1829"},{name:"Dominican Republic",iso2:"DO",iso3:"DOM",phone:"+1849"},{name:"East Timor",iso2:"TL",iso3:"TLS",phone:"+670"},{name:"Ecuador",iso2:"EC",iso3:"ECU",phone:"+593"},{name:"Egypt",iso2:"EG",iso3:"EGY",phone:"+20"},{name:"El Salvador",iso2:"SV",iso3:"SLV",phone:"+503"},{name:"Equatorial Guinea",iso2:"GQ",iso3:"GNQ",phone:"+240"},{name:"Eritrea",iso2:"ER",iso3:"ERI",phone:"+291"},{name:"Estonia",iso2:"EE",iso3:"EST",phone:"+372"},{name:"Ethiopia",iso2:"ET",iso3:"ETH",phone:"+251"},{name:"Falkland Islands",iso2:"FK",iso3:"FLK",phone:"+500"},{name:"Faroe Islands",iso2:"FO",iso3:"FRO",phone:"+298"},{name:"Fiji",iso2:"FJ",iso3:"FJI",phone:"+679"},{name:"Finland",iso2:"FI",iso3:"FIN",phone:"+358"},{name:"France",iso2:"FR",iso3:"FRA",phone:"+33"},{name:"French Guiana",iso2:"GF",iso3:"GUF",phone:"+594"},{name:"French Polynesia",iso2:"PF",iso3:"PYF",phone:"+689"},{name:"French Southern Territories",iso2:"TF",iso3:"ATF",phone:"+262"},{name:"Gabon",iso2:"GA",iso3:"GAB",phone:"+241"},{name:"Gambia",iso2:"GM",iso3:"GMB",phone:"+220"},{name:"Georgia",iso2:"GE",iso3:"GEO",phone:"+995"},{name:"Germany",iso2:"DE",iso3:"DEU",phone:"+49"},{name:"Ghana",iso2:"GH",iso3:"GHA",phone:"+233"},{name:"Gibraltar",iso2:"GI",iso3:"GIB",phone:"+350"},{name:"Greece",iso2:"GR",iso3:"GRC",phone:"+30"},{name:"Greenland",iso2:"GL",iso3:"GRL",phone:"+299"},{name:"Grenada",iso2:"GD",iso3:"GRD",phone:"+1473"},{name:"Guadeloupe",iso2:"GP",iso3:"GLP",phone:"+596"},{name:"Guadeloupe",iso2:"GP",iso3:"GLP",phone:"+590"},{name:"Guam",iso2:"GU",iso3:"GUM",phone:"+1671"},{name:"Guatemala",iso2:"GT",iso3:"GTM",phone:"+502"},{name:"Guernsey",iso2:"GG",iso3:"GGY",phone:"+44",phoneFormat:"**** *** ***"},{name:"Guinea",iso2:"GN",iso3:"GIN",phone:"+224"},{name:"Guinea-Bissau",iso2:"GW",iso3:"GNB",phone:"+245"},{name:"Guyana",iso2:"GY",iso3:"GUY",phone:"+592"},{name:"Haiti",iso2:"HT",iso3:"HTI",phone:"+509"},{name:"Holy See",iso2:"VA",iso3:"VAT",phone:"+379"},{name:"Honduras",iso2:"HN",iso3:"HND",phone:"+504"},{name:"Hong Kong",iso2:"HK",iso3:"HKG",phone:"+852"},{name:"Hungary",iso2:"HU",iso3:"HUN",phone:"+36"},{name:"Iceland",iso2:"IS",iso3:"ISL",phone:"+354"},{name:"India",iso2:"IN",iso3:"IND",phone:"+91"},{name:"Indonesia",iso2:"ID",iso3:"IDN",phone:"+62"},{name:"Iran",iso2:"IR",iso3:"IRN",phone:"+98"},{name:"Iraq",iso2:"IQ",iso3:"IRQ",phone:"+964"},{name:"Ireland",iso2:"IE",iso3:"IRL",phone:"+353"},{name:"Isle of Man",iso2:"IM",iso3:"IMN",phone:"+44"},{name:"Israel",iso2:"IL",iso3:"ISR",phone:"+972"},{name:"Italy",iso2:"IT",iso3:"ITA",phone:"+39"},{name:"Ivory Coast",iso2:"CI",iso3:"CIV",phone:"+225"},{name:"Jamaica",iso2:"JM",iso3:"JAM",phone:"+1876"},{name:"Japan",iso2:"JP",iso3:"JPN",phone:"+81"},{name:"Jersey",iso2:"JE",iso3:"JEY",phone:"+44"},{name:"Jordan",iso2:"JO",iso3:"JOR",phone:"+962"},{name:"Kazakhstan",iso2:"KZ",iso3:"KAZ",phone:"+7"},{name:"Kenya",iso2:"KE",iso3:"KEN",phone:"+254"},{name:"Kiribati",iso2:"KI",iso3:"KIR",phone:"+686"},{name:"Kosovo",iso2:"XK",iso3:"RKS",phone:"+383"},{name:"Kuwait",iso2:"KW",iso3:"KWT",phone:"+965"},{name:"Kyrgyzstan",iso2:"KG",iso3:"KGZ",phone:"+996"},{name:"Laos",iso2:"LA",iso3:"LAO",phone:"+856"},{name:"Latvia",iso2:"LV",iso3:"LVA",phone:"+371"},{name:"Lebanon",iso2:"LB",iso3:"LBN",phone:"+961"},{name:"Lesotho",iso2:"LS",iso3:"LSO",phone:"+266"},{name:"Liberia",iso2:"LR",iso3:"LBR",phone:"+231"},{name:"Libya",iso2:"LY",iso3:"LBY",phone:"+218"},{name:"Liechtenstein",iso2:"LI",iso3:"LIE",phone:"+423"},{name:"Lithuania",iso2:"LT",iso3:"LTU",phone:"+370"},{name:"Luxembourg",iso2:"LU",iso3:"LUX",phone:"+352"},{name:"Macau",iso2:"MO",iso3:"MAC",phone:"+853"},{name:"Macedonia",iso2:"MK",iso3:"MKD",phone:"+389"},{name:"Madagascar",iso2:"MG",iso3:"MDG",phone:"+261"},{name:"Malawi",iso2:"MW",iso3:"MWI",phone:"+265"},{name:"Malaysia",iso2:"MY",iso3:"MYS",phone:"+60"},{name:"Maldives",iso2:"MV",iso3:"MDV",phone:"+960"},{name:"Mali",iso2:"ML",iso3:"MLI",phone:"+223"},{name:"Malta",iso2:"MT",iso3:"MLT",phone:"+356"},{name:"Marshall Islands",iso2:"MH",iso3:"MHL",phone:"+692"},{name:"Martinique",iso2:"MQ",iso3:"MTQ",phone:"+596"},{name:"Mauritania",iso2:"MR",iso3:"MRT",phone:"+222"},{name:"Mauritius",iso2:"MU",iso3:"MUS",phone:"+230"},{name:"Mayotte",iso2:"YT",iso3:"MYT",phone:"+262"},{name:"Mexico",iso2:"MX",iso3:"MEX",phone:"+52"},{name:"Micronesia",iso2:"FM",iso3:"FSM",phone:"+691"},{name:"Moldova",iso2:"MD",iso3:"MDA",phone:"+373"},{name:"Monaco",iso2:"MC",iso3:"MCO",phone:"+377"},{name:"Mongolia",iso2:"MN",iso3:"MNG",phone:"+976"},{name:"Montenegro",iso2:"ME",iso3:"MNE",phone:"+382"},{name:"Montserrat",iso2:"MS",iso3:"MSR",phone:"+1664"},{name:"Morocco",iso2:"MA",iso3:"MAR",phone:"+212"},{name:"Mozambique",iso2:"MZ",iso3:"MOZ",phone:"+258"},{name:"Myanmar",iso2:"MM",iso3:"MMR",phone:"+95"},{name:"Namibia",iso2:"NA",iso3:"NAM",phone:"+264"},{name:"Nauru",iso2:"NR",iso3:"NRU",phone:"+674"},{name:"Nepal",iso2:"NP",iso3:"NPL",phone:"+977"},{name:"Netherlands",iso2:"NL",iso3:"NLD",phone:"+31"},{name:"Netherlands Antilles",iso2:"AN",iso3:"ANT",phone:"+599"},{name:"New Caledonia",iso2:"NC",iso3:"NCL",phone:"+687"},{name:"New Zealand",iso2:"NZ",iso3:"NZL",phone:"+64"},{name:"Nicaragua",iso2:"NI",iso3:"NIC",phone:"+505"},{name:"Niger",iso2:"NE",iso3:"NER",phone:"+227"},{name:"Nigeria",iso2:"NG",iso3:"NGA",phone:"+234"},{name:"Niue",iso2:"NU",iso3:"NIU",phone:"+683"},{name:"Norfolk Island",iso2:"NF",iso3:"NFK",phone:"+672"},{name:"North Korea",iso2:"KP",iso3:"PRK",phone:"+850"},{name:"Northern Mariana Islands",iso2:"MP",iso3:"MNP",phone:"+1670"},{name:"Norway",iso2:"NO",iso3:"NOR",phone:"+47"},{name:"Oman",iso2:"OM",iso3:"OMN",phone:"+968"},{name:"Pakistan",iso2:"PK",iso3:"PAK",phone:"+92"},{name:"Palau",iso2:"PW",iso3:"PLW",phone:"+680"},{name:"Palestine",iso2:"PS",iso3:"PSE",phone:"+970"},{name:"Panama",iso2:"PA",iso3:"PAN",phone:"+507"},{name:"Papua New Guinea",iso2:"PG",iso3:"PNG",phone:"+675"},{name:"Paraguay",iso2:"PY",iso3:"PRY",phone:"+595"},{name:"Peru",iso2:"PE",iso3:"PER",phone:"+51"},{name:"Philippines",iso2:"PH",iso3:"PHL",phone:"+63"},{name:"Pitcairn",iso2:"PN",iso3:"PCN",phone:"+64"},{name:"Poland",iso2:"PL",iso3:"POL",phone:"+48"},{name:"Portugal",iso2:"PT",iso3:"PRT",phone:"+351"},{name:"Puerto Rico",iso2:"PR",iso3:"PRI",phone:"+1939"},{name:"Qatar",iso2:"QA",iso3:"QAT",phone:"+974"},{name:"Reunion Island",iso2:"RE",iso3:"REU",phone:"+262"},{name:"Romania",iso2:"RO",iso3:"ROU",phone:"+40"},{name:"Russia",iso2:"RU",iso3:"RUS",phone:"+7"},{name:"Rwanda",iso2:"RW",iso3:"RWA",phone:"+250"},{name:"Saint Barth\xE9lemy",iso2:"BL",iso3:"BLM",phone:"+590"},{name:"Saint Helena",iso2:"SH",iso3:"SHN",phone:"+290"},{name:"Saint Kitts and Nevis",iso2:"KN",iso3:"KNA",phone:"+1869"},{name:"Saint Lucia",iso2:"LC",iso3:"LCA",phone:"+1758"},{name:"Saint Martin (French part)",iso2:"MF",iso3:"MAF",phone:"+590"},{name:"Saint Pierre and Miquelon",iso2:"PM",iso3:"SPM",phone:"+508"},{name:"Saint Vincent and the Grenadines",iso2:"VC",iso3:"VCT",phone:"+1784"},{name:"San Marino",iso2:"SM",iso3:"SMR",phone:"+378"},{name:"Sao Tome and Principe",iso2:"ST",iso3:"STP",phone:"+239"},{name:"Saudi Arabia",iso2:"SA",iso3:"SAU",phone:"+966"},{name:"Senegal",iso2:"SN",iso3:"SEN",phone:"+221"},{name:"Serbia",iso2:"RS",iso3:"SRB",phone:"+381"},{name:"Seychelles",iso2:"SC",iso3:"SYC",phone:"+248"},{name:"Sierra Leone",iso2:"SL",iso3:"SLE",phone:"+232"},{name:"Singapore",iso2:"SG",iso3:"SGP",phone:"+65"},{name:"Sint Maarten",iso2:"SX",iso3:"SXM",phone:"+1721"},{name:"Slovakia",iso2:"SK",iso3:"SVK",phone:"+421"},{name:"Slovenia",iso2:"SI",iso3:"SVN",phone:"+386"},{name:"Solomon Islands",iso2:"SB",iso3:"SLB",phone:"+677"},{name:"Somalia",iso2:"SO",iso3:"SOM",phone:"+252"},{name:"South Africa",iso2:"ZA",iso3:"ZAF",phone:"+27"},{name:"South Georgia and the South Sandwich Islands",iso2:"GS",iso3:"SGS",phone:"+500"},{name:"South Korea",iso2:"KR",iso3:"KOR",phone:"+82"},{name:"South Sudan",iso2:"SS",iso3:"SSD",phone:"+211"},{name:"Spain",iso2:"ES",iso3:"ESP",phone:"+34"},{name:"Sri Lanka",iso2:"LK",iso3:"LKA",phone:"+94"},{name:"Sudan",iso2:"SD",iso3:"SDN",phone:"+249"},{name:"Suriname",iso2:"SR",iso3:"SUR",phone:"+597"},{name:"Svalbard and Jan Mayen",iso2:"SJ",iso3:"SJM",phone:"+47"},{name:"Swaziland",iso2:"SZ",iso3:"SWZ",phone:"+268"},{name:"Sweden",iso2:"SE",iso3:"SWE",phone:"+46"},{name:"Switzerland",iso2:"CH",iso3:"CHE",phone:"+41"},{name:"Syria",iso2:"SY",iso3:"SYR",phone:"+963"},{name:"Taiwan",iso2:"TW",iso3:"TWN",phone:"+886"},{name:"Tajikistan",iso2:"TJ",iso3:"TJK",phone:"+992"},{name:"Tanzania",iso2:"TZ",iso3:"TZA",phone:"+255"},{name:"Thailand",iso2:"TH",iso3:"THA",phone:"+66"},{name:"Togo",iso2:"TG",iso3:"TGO",phone:"+228"},{name:"Tokelau",iso2:"TK",iso3:"TKL",phone:"+690"},{name:"Tonga",iso2:"TO",iso3:"TON",phone:"+676"},{name:"Trinidad and Tobago",iso2:"TT",iso3:"TTO",phone:"+1868"},{name:"Tunisia",iso2:"TN",iso3:"TUN",phone:"+216"},{name:"Turkey",iso2:"TR",iso3:"TUR",phone:"+90"},{name:"Turkmenistan",iso2:"TM",iso3:"TKM",phone:"+993"},{name:"Turks and Caicos",iso2:"TC",iso3:"TCA",phone:"+1649"},{name:"Tuvalu",iso2:"TV",iso3:"TUV",phone:"+688"},{name:"Uganda",iso2:"UG",iso3:"UGA",phone:"+256"},{name:"Ukraine",iso2:"UA",iso3:"UKR",phone:"+380"},{name:"United Arab Emirates",iso2:"AE",iso3:"ARE",phone:"+971"},{name:"United Kingdom",iso2:"GB",iso3:"GBR",phone:"+44",phoneFormat:"**** *** ***"},{name:"United States Minor Outlying Islands",iso2:"UM",iso3:"UMI",phone:"+1"},{name:"United States of America",iso2:"US",iso3:"USA",phone:"+1"},{name:"Uruguay",iso2:"UY",iso3:"URY",phone:"+598"},{name:"Uzbekistan",iso2:"UZ",iso3:"UZB",phone:"+998"},{name:"Vanuatu",iso2:"VU",iso3:"VUT",phone:"+678"},{name:"Venezuela",iso2:"VE",iso3:"VEN",phone:"+58"},{name:"Vietnam",iso2:"VN",iso3:"VNM",phone:"+84"},{name:"Virgin Islands (U.S.)",iso2:"VI",iso3:"VIR",phone:"+1340"},{name:"Wallis and Futuna",iso2:"WF",iso3:"WLF",phone:"+681"},{name:"Western Sahara",iso2:"EH",iso3:"ESH",phone:"+212"},{name:"Western Samoa",iso2:"WS",iso3:"WSM",phone:"+685"},{name:"Yemen",iso2:"YE",iso3:"YEM",phone:"+967"},{name:"Zambia",iso2:"ZM",iso3:"ZMB",phone:"+260"},{name:"Zimbabwe",iso2:"ZW",iso3:"ZWE",phone:"+263"}];export default countries;
|
|
1
|
+
var countries=[{name:"Afghanistan",iso2:"AF",iso3:"AFG",phone:"+93"},{name:"\xC5land Islands",iso2:"AX",iso3:"ALA",phone:"+358"},{name:"Albania",iso2:"AL",iso3:"ALB",phone:"+355"},{name:"Algeria",iso2:"DZ",iso3:"DZA",phone:"+213"},{name:"American Samoa",iso2:"AS",iso3:"ASM",phone:"+1684"},{name:"Andorra",iso2:"AD",iso3:"AND",phone:"+376"},{name:"Angola",iso2:"AO",iso3:"AGO",phone:"+244"},{name:"Anguilla",iso2:"AI",iso3:"AIA",phone:"+1264"},{name:"Antarctica",iso2:"AQ",iso3:"ATA",phone:"+672"},{name:"Antigua",iso2:"AG",iso3:"ATG",phone:"+1268"},{name:"Argentina",iso2:"AR",iso3:"ARG",phone:"+54"},{name:"Armenia",iso2:"AM",iso3:"ARM",phone:"+374"},{name:"Aruba",iso2:"AW",iso3:"ABW",phone:"+297"},{name:"Ascension Island",iso2:"SH",iso3:"SHN",phone:"+247"},{name:"Australia",iso2:"AU",iso3:"AUS",phone:"+61"},{name:"Australian Antarctic Territory",iso2:"AQ",iso3:"ATA",phone:"+672"},{name:"Austria",iso2:"AT",iso3:"AUT",phone:"+43"},{name:"Azerbaijan",iso2:"AZ",iso3:"AZE",phone:"+994"},{name:"Bahamas",iso2:"BS",iso3:"BHS",phone:"+1242"},{name:"Bahrain",iso2:"BH",iso3:"BHR",phone:"+973"},{name:"Bangladesh",iso2:"BD",iso3:"BGD",phone:"+880"},{name:"Barbados",iso2:"BB",iso3:"BRB",phone:"+1246"},{name:"Belarus",iso2:"BY",iso3:"BLR",phone:"+375"},{name:"Belgium",iso2:"BE",iso3:"BEL",phone:"+32"},{name:"Belize",iso2:"BZ",iso3:"BLZ",phone:"+501"},{name:"Benin",iso2:"BJ",iso3:"BEN",phone:"+229"},{name:"Bermuda",iso2:"BM",iso3:"BMU",phone:"+1441"},{name:"Bhutan",iso2:"BT",iso3:"BTN",phone:"+975"},{name:"Bolivia",iso2:"BO",iso3:"BOL",phone:"+591"},{name:"Bonaire, Sint Eustatius and Saba",iso2:"BQ",iso3:"BES",phone:"+599"},{name:"Bosnia and Herzegovina",iso2:"BA",iso3:"BIH",phone:"+387"},{name:"Botswana",iso2:"BW",iso3:"BWA",phone:"+267"},{name:"Brazil",iso2:"BR",iso3:"BRA",phone:"+55"},{name:"British Virgin Islands",iso2:"VG",iso3:"VGB",phone:"+1284"},{name:"Brunei",iso2:"BN",iso3:"BRN",phone:"+673"},{name:"Bulgaria",iso2:"BG",iso3:"BGR",phone:"+359"},{name:"Burkina Faso",iso2:"BF",iso3:"BFA",phone:"+226"},{name:"Burundi",iso2:"BI",iso3:"BDI",phone:"+257"},{name:"Cambodia",iso2:"KH",iso3:"KHM",phone:"+855"},{name:"Cameroon",iso2:"CM",iso3:"CMR",phone:"+237"},{name:"Canada",iso2:"CA",iso3:"CAN",phone:"+1"},{name:"Cape Verde",iso2:"CV",iso3:"CPV",phone:"+238"},{name:"Cayman Islands",iso2:"KY",iso3:"CYM",phone:"+1345"},{name:"Central African Republic",iso2:"CF",iso3:"CAF",phone:"+236"},{name:"Chad",iso2:"TD",iso3:"TCD",phone:"+235"},{name:"Chile",iso2:"CL",iso3:"CHL",phone:"+56"},{name:"China",iso2:"CN",iso3:"CHN",phone:"+86"},{name:"Christmas Island",iso2:"CX",iso3:"CXR",phone:"+61"},{name:"Cocos (Keeling) Islands",iso2:"CC",iso3:"CCK",phone:"+61"},{name:"Colombia",iso2:"CO",iso3:"COL",phone:"+57"},{name:"Comoros",iso2:"KM",iso3:"COM",phone:"+269"},{name:"Congo",iso2:"CG",iso3:"COG",phone:"+242"},{name:"Cook Islands",iso2:"CK",iso3:"COK",phone:"+682"},{name:"Costa Rica",iso2:"CR",iso3:"CRI",phone:"+506"},{name:"Croatia",iso2:"HR",iso3:"HRV",phone:"+385"},{name:"Cuba",iso2:"CU",iso3:"CUB",phone:"+53"},{name:"Cura\xE7ao",iso2:"CW",iso3:"CUW",phone:"+599"},{name:"Cyprus",iso2:"CY",iso3:"CYP",phone:"+357"},{name:"Czech Republic",iso2:"CZ",iso3:"CZE",phone:"+420"},{name:"Democratic Republic of the Congo",iso2:"CD",iso3:"COD",phone:"+243"},{name:"Denmark",iso2:"DK",iso3:"DNK",phone:"+45"},{name:"Diego Garcia",iso2:"IO",iso3:"IOT",phone:"+246"},{name:"Djibouti",iso2:"DJ",iso3:"DJI",phone:"+253"},{name:"Dominica",iso2:"DM",iso3:"DMA",phone:"+1767"},{name:"Dominican Republic",iso2:"DO",iso3:"DOM",phone:"+1809"},{name:"Dominican Republic",iso2:"DO",iso3:"DOM",phone:"+1829"},{name:"Dominican Republic",iso2:"DO",iso3:"DOM",phone:"+1849"},{name:"East Timor",iso2:"TL",iso3:"TLS",phone:"+670"},{name:"Ecuador",iso2:"EC",iso3:"ECU",phone:"+593"},{name:"Egypt",iso2:"EG",iso3:"EGY",phone:"+20"},{name:"El Salvador",iso2:"SV",iso3:"SLV",phone:"+503"},{name:"Equatorial Guinea",iso2:"GQ",iso3:"GNQ",phone:"+240"},{name:"Eritrea",iso2:"ER",iso3:"ERI",phone:"+291"},{name:"Estonia",iso2:"EE",iso3:"EST",phone:"+372"},{name:"Ethiopia",iso2:"ET",iso3:"ETH",phone:"+251"},{name:"Falkland Islands",iso2:"FK",iso3:"FLK",phone:"+500"},{name:"Faroe Islands",iso2:"FO",iso3:"FRO",phone:"+298"},{name:"Fiji",iso2:"FJ",iso3:"FJI",phone:"+679"},{name:"Finland",iso2:"FI",iso3:"FIN",phone:"+358"},{name:"France",iso2:"FR",iso3:"FRA",phone:"+33"},{name:"French Guiana",iso2:"GF",iso3:"GUF",phone:"+594"},{name:"French Polynesia",iso2:"PF",iso3:"PYF",phone:"+689"},{name:"French Southern Territories",iso2:"TF",iso3:"ATF",phone:"+262"},{name:"Gabon",iso2:"GA",iso3:"GAB",phone:"+241"},{name:"Gambia",iso2:"GM",iso3:"GMB",phone:"+220"},{name:"Georgia",iso2:"GE",iso3:"GEO",phone:"+995"},{name:"Germany",iso2:"DE",iso3:"DEU",phone:"+49"},{name:"Ghana",iso2:"GH",iso3:"GHA",phone:"+233"},{name:"Gibraltar",iso2:"GI",iso3:"GIB",phone:"+350"},{name:"Greece",iso2:"GR",iso3:"GRC",phone:"+30"},{name:"Greenland",iso2:"GL",iso3:"GRL",phone:"+299"},{name:"Grenada",iso2:"GD",iso3:"GRD",phone:"+1473"},{name:"Guadeloupe",iso2:"GP",iso3:"GLP",phone:"+596"},{name:"Guadeloupe",iso2:"GP",iso3:"GLP",phone:"+590"},{name:"Guam",iso2:"GU",iso3:"GUM",phone:"+1671"},{name:"Guatemala",iso2:"GT",iso3:"GTM",phone:"+502"},{name:"Guernsey",iso2:"GG",iso3:"GGY",phone:"+44",phoneFormat:"**** *** ***"},{name:"Guinea",iso2:"GN",iso3:"GIN",phone:"+224"},{name:"Guinea-Bissau",iso2:"GW",iso3:"GNB",phone:"+245"},{name:"Guyana",iso2:"GY",iso3:"GUY",phone:"+592"},{name:"Haiti",iso2:"HT",iso3:"HTI",phone:"+509"},{name:"Holy See",iso2:"VA",iso3:"VAT",phone:"+379"},{name:"Honduras",iso2:"HN",iso3:"HND",phone:"+504"},{name:"Hong Kong",iso2:"HK",iso3:"HKG",phone:"+852"},{name:"Hungary",iso2:"HU",iso3:"HUN",phone:"+36"},{name:"Iceland",iso2:"IS",iso3:"ISL",phone:"+354"},{name:"India",iso2:"IN",iso3:"IND",phone:"+91"},{name:"Indonesia",iso2:"ID",iso3:"IDN",phone:"+62"},{name:"Iran",iso2:"IR",iso3:"IRN",phone:"+98"},{name:"Iraq",iso2:"IQ",iso3:"IRQ",phone:"+964"},{name:"Ireland",iso2:"IE",iso3:"IRL",phone:"+353"},{name:"Isle of Man",iso2:"IM",iso3:"IMN",phone:"+44"},{name:"Israel",iso2:"IL",iso3:"ISR",phone:"+972"},{name:"Italy",iso2:"IT",iso3:"ITA",phone:"+39"},{name:"Ivory Coast",iso2:"CI",iso3:"CIV",phone:"+225"},{name:"Jamaica",iso2:"JM",iso3:"JAM",phone:"+1876"},{name:"Japan",iso2:"JP",iso3:"JPN",phone:"+81"},{name:"Jersey",iso2:"JE",iso3:"JEY",phone:"+44"},{name:"Jordan",iso2:"JO",iso3:"JOR",phone:"+962"},{name:"Kazakhstan",iso2:"KZ",iso3:"KAZ",phone:"+7"},{name:"Kenya",iso2:"KE",iso3:"KEN",phone:"+254"},{name:"Kiribati",iso2:"KI",iso3:"KIR",phone:"+686"},{name:"Kosovo",iso2:"XK",iso3:"RKS",phone:"+383"},{name:"Kuwait",iso2:"KW",iso3:"KWT",phone:"+965"},{name:"Kyrgyzstan",iso2:"KG",iso3:"KGZ",phone:"+996"},{name:"Laos",iso2:"LA",iso3:"LAO",phone:"+856"},{name:"Latvia",iso2:"LV",iso3:"LVA",phone:"+371"},{name:"Lebanon",iso2:"LB",iso3:"LBN",phone:"+961"},{name:"Lesotho",iso2:"LS",iso3:"LSO",phone:"+266"},{name:"Liberia",iso2:"LR",iso3:"LBR",phone:"+231"},{name:"Libya",iso2:"LY",iso3:"LBY",phone:"+218"},{name:"Liechtenstein",iso2:"LI",iso3:"LIE",phone:"+423"},{name:"Lithuania",iso2:"LT",iso3:"LTU",phone:"+370"},{name:"Luxembourg",iso2:"LU",iso3:"LUX",phone:"+352"},{name:"Macau",iso2:"MO",iso3:"MAC",phone:"+853"},{name:"Macedonia",iso2:"MK",iso3:"MKD",phone:"+389"},{name:"Madagascar",iso2:"MG",iso3:"MDG",phone:"+261"},{name:"Malawi",iso2:"MW",iso3:"MWI",phone:"+265"},{name:"Malaysia",iso2:"MY",iso3:"MYS",phone:"+60"},{name:"Maldives",iso2:"MV",iso3:"MDV",phone:"+960"},{name:"Mali",iso2:"ML",iso3:"MLI",phone:"+223"},{name:"Malta",iso2:"MT",iso3:"MLT",phone:"+356"},{name:"Marshall Islands",iso2:"MH",iso3:"MHL",phone:"+692"},{name:"Martinique",iso2:"MQ",iso3:"MTQ",phone:"+596"},{name:"Mauritania",iso2:"MR",iso3:"MRT",phone:"+222"},{name:"Mauritius",iso2:"MU",iso3:"MUS",phone:"+230"},{name:"Mayotte",iso2:"YT",iso3:"MYT",phone:"+262"},{name:"Mexico",iso2:"MX",iso3:"MEX",phone:"+52"},{name:"Micronesia",iso2:"FM",iso3:"FSM",phone:"+691"},{name:"Moldova",iso2:"MD",iso3:"MDA",phone:"+373"},{name:"Monaco",iso2:"MC",iso3:"MCO",phone:"+377"},{name:"Mongolia",iso2:"MN",iso3:"MNG",phone:"+976"},{name:"Montenegro",iso2:"ME",iso3:"MNE",phone:"+382"},{name:"Montserrat",iso2:"MS",iso3:"MSR",phone:"+1664"},{name:"Morocco",iso2:"MA",iso3:"MAR",phone:"+212"},{name:"Mozambique",iso2:"MZ",iso3:"MOZ",phone:"+258"},{name:"Myanmar",iso2:"MM",iso3:"MMR",phone:"+95"},{name:"Namibia",iso2:"NA",iso3:"NAM",phone:"+264"},{name:"Nauru",iso2:"NR",iso3:"NRU",phone:"+674"},{name:"Nepal",iso2:"NP",iso3:"NPL",phone:"+977"},{name:"Netherlands",iso2:"NL",iso3:"NLD",phone:"+31"},{name:"Netherlands Antilles",iso2:"AN",iso3:"ANT",phone:"+599"},{name:"New Caledonia",iso2:"NC",iso3:"NCL",phone:"+687"},{name:"New Zealand",iso2:"NZ",iso3:"NZL",phone:"+64"},{name:"Nicaragua",iso2:"NI",iso3:"NIC",phone:"+505"},{name:"Niger",iso2:"NE",iso3:"NER",phone:"+227"},{name:"Nigeria",iso2:"NG",iso3:"NGA",phone:"+234"},{name:"Niue",iso2:"NU",iso3:"NIU",phone:"+683"},{name:"Norfolk Island",iso2:"NF",iso3:"NFK",phone:"+672"},{name:"North Korea",iso2:"KP",iso3:"PRK",phone:"+850"},{name:"Northern Mariana Islands",iso2:"MP",iso3:"MNP",phone:"+1670"},{name:"Norway",iso2:"NO",iso3:"NOR",phone:"+47"},{name:"Oman",iso2:"OM",iso3:"OMN",phone:"+968"},{name:"Pakistan",iso2:"PK",iso3:"PAK",phone:"+92"},{name:"Palau",iso2:"PW",iso3:"PLW",phone:"+680"},{name:"Palestine",iso2:"PS",iso3:"PSE",phone:"+970"},{name:"Panama",iso2:"PA",iso3:"PAN",phone:"+507"},{name:"Papua New Guinea",iso2:"PG",iso3:"PNG",phone:"+675"},{name:"Paraguay",iso2:"PY",iso3:"PRY",phone:"+595"},{name:"Peru",iso2:"PE",iso3:"PER",phone:"+51"},{name:"Philippines",iso2:"PH",iso3:"PHL",phone:"+63"},{name:"Pitcairn",iso2:"PN",iso3:"PCN",phone:"+64"},{name:"Poland",iso2:"PL",iso3:"POL",phone:"+48"},{name:"Portugal",iso2:"PT",iso3:"PRT",phone:"+351"},{name:"Puerto Rico",iso2:"PR",iso3:"PRI",phone:"+1"},{name:"Qatar",iso2:"QA",iso3:"QAT",phone:"+974"},{name:"Reunion Island",iso2:"RE",iso3:"REU",phone:"+262"},{name:"Romania",iso2:"RO",iso3:"ROU",phone:"+40"},{name:"Russia",iso2:"RU",iso3:"RUS",phone:"+7"},{name:"Rwanda",iso2:"RW",iso3:"RWA",phone:"+250"},{name:"Saint Barth\xE9lemy",iso2:"BL",iso3:"BLM",phone:"+590"},{name:"Saint Helena",iso2:"SH",iso3:"SHN",phone:"+290"},{name:"Saint Kitts and Nevis",iso2:"KN",iso3:"KNA",phone:"+1869"},{name:"Saint Lucia",iso2:"LC",iso3:"LCA",phone:"+1758"},{name:"Saint Martin (French part)",iso2:"MF",iso3:"MAF",phone:"+590"},{name:"Saint Pierre and Miquelon",iso2:"PM",iso3:"SPM",phone:"+508"},{name:"Saint Vincent and the Grenadines",iso2:"VC",iso3:"VCT",phone:"+1784"},{name:"San Marino",iso2:"SM",iso3:"SMR",phone:"+378"},{name:"Sao Tome and Principe",iso2:"ST",iso3:"STP",phone:"+239"},{name:"Saudi Arabia",iso2:"SA",iso3:"SAU",phone:"+966"},{name:"Senegal",iso2:"SN",iso3:"SEN",phone:"+221"},{name:"Serbia",iso2:"RS",iso3:"SRB",phone:"+381"},{name:"Seychelles",iso2:"SC",iso3:"SYC",phone:"+248"},{name:"Sierra Leone",iso2:"SL",iso3:"SLE",phone:"+232"},{name:"Singapore",iso2:"SG",iso3:"SGP",phone:"+65"},{name:"Sint Maarten",iso2:"SX",iso3:"SXM",phone:"+1721"},{name:"Slovakia",iso2:"SK",iso3:"SVK",phone:"+421"},{name:"Slovenia",iso2:"SI",iso3:"SVN",phone:"+386"},{name:"Solomon Islands",iso2:"SB",iso3:"SLB",phone:"+677"},{name:"Somalia",iso2:"SO",iso3:"SOM",phone:"+252"},{name:"South Africa",iso2:"ZA",iso3:"ZAF",phone:"+27"},{name:"South Georgia and the South Sandwich Islands",iso2:"GS",iso3:"SGS",phone:"+500"},{name:"South Korea",iso2:"KR",iso3:"KOR",phone:"+82"},{name:"South Sudan",iso2:"SS",iso3:"SSD",phone:"+211"},{name:"Spain",iso2:"ES",iso3:"ESP",phone:"+34"},{name:"Sri Lanka",iso2:"LK",iso3:"LKA",phone:"+94"},{name:"Sudan",iso2:"SD",iso3:"SDN",phone:"+249"},{name:"Suriname",iso2:"SR",iso3:"SUR",phone:"+597"},{name:"Svalbard and Jan Mayen",iso2:"SJ",iso3:"SJM",phone:"+47"},{name:"Swaziland",iso2:"SZ",iso3:"SWZ",phone:"+268"},{name:"Sweden",iso2:"SE",iso3:"SWE",phone:"+46"},{name:"Switzerland",iso2:"CH",iso3:"CHE",phone:"+41"},{name:"Syria",iso2:"SY",iso3:"SYR",phone:"+963"},{name:"Taiwan",iso2:"TW",iso3:"TWN",phone:"+886"},{name:"Tajikistan",iso2:"TJ",iso3:"TJK",phone:"+992"},{name:"Tanzania",iso2:"TZ",iso3:"TZA",phone:"+255"},{name:"Thailand",iso2:"TH",iso3:"THA",phone:"+66"},{name:"Togo",iso2:"TG",iso3:"TGO",phone:"+228"},{name:"Tokelau",iso2:"TK",iso3:"TKL",phone:"+690"},{name:"Tonga",iso2:"TO",iso3:"TON",phone:"+676"},{name:"Trinidad and Tobago",iso2:"TT",iso3:"TTO",phone:"+1868"},{name:"Tunisia",iso2:"TN",iso3:"TUN",phone:"+216"},{name:"Turkey",iso2:"TR",iso3:"TUR",phone:"+90"},{name:"Turkmenistan",iso2:"TM",iso3:"TKM",phone:"+993"},{name:"Turks and Caicos",iso2:"TC",iso3:"TCA",phone:"+1649"},{name:"Tuvalu",iso2:"TV",iso3:"TUV",phone:"+688"},{name:"Uganda",iso2:"UG",iso3:"UGA",phone:"+256"},{name:"Ukraine",iso2:"UA",iso3:"UKR",phone:"+380"},{name:"United Arab Emirates",iso2:"AE",iso3:"ARE",phone:"+971"},{name:"United Kingdom",iso2:"GB",iso3:"GBR",phone:"+44",phoneFormat:"**** *** ***"},{name:"United States Minor Outlying Islands",iso2:"UM",iso3:"UMI",phone:"+1"},{name:"United States of America",iso2:"US",iso3:"USA",phone:"+1"},{name:"Uruguay",iso2:"UY",iso3:"URY",phone:"+598"},{name:"Uzbekistan",iso2:"UZ",iso3:"UZB",phone:"+998"},{name:"Vanuatu",iso2:"VU",iso3:"VUT",phone:"+678"},{name:"Venezuela",iso2:"VE",iso3:"VEN",phone:"+58"},{name:"Vietnam",iso2:"VN",iso3:"VNM",phone:"+84"},{name:"Virgin Islands (U.S.)",iso2:"VI",iso3:"VIR",phone:"+1340"},{name:"Wallis and Futuna",iso2:"WF",iso3:"WLF",phone:"+681"},{name:"Western Sahara",iso2:"EH",iso3:"ESH",phone:"+212"},{name:"Western Samoa",iso2:"WS",iso3:"WSM",phone:"+685"},{name:"Yemen",iso2:"YE",iso3:"YEM",phone:"+967"},{name:"Zambia",iso2:"ZM",iso3:"ZMB",phone:"+260"},{name:"Zimbabwe",iso2:"ZW",iso3:"ZWE",phone:"+263"}];export default countries;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.match.js";import"core-js/modules/es.array.join.js";var DIGITS_MATCH=/^$|^(\+)|([\d]+)/g;export var cleanNumber=function(a){return a.match(DIGITS_MATCH)&&a.match(DIGITS_MATCH).join("")||""};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import"core-js/modules/es.array.iterator.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.set.js";import"core-js/modules/es.string.iterator.js";import"core-js/modules/web.dom-collections.iterator.js";import"core-js/modules/es.array.filter.js";// Reference fro localeCompare : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare
|
|
2
|
+
var filterCountriesByIso3=function(a,b){var c=new Set(b);return a.filter(function(a){return!c.has(a.iso3)})};/**
|
|
3
3
|
* Removes the countries sepecified in the second param
|
|
4
4
|
*
|
|
5
5
|
* @param {Array} countries: list of country metadata objects
|
|
6
6
|
* @param {Array} disabledCountries: list of iso3 country codes to remove from the list
|
|
7
7
|
* @returns
|
|
8
|
-
*/export
|
|
8
|
+
*/export var excludeCountries=function(a,b){return 0<b.length?filterCountriesByIso3(a,b):a};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{findCountryByPrefix}from"../findCountryByPrefix";/**
|
|
1
|
+
import"core-js/modules/es.array.slice.js";import{findCountryByPrefix}from"../findCountryByPrefix";/**
|
|
2
2
|
* Given a sting in a valid format ex:'+447573135343' it returns an object of shape
|
|
3
3
|
* {prefix=+44 ,suffix=7573135343}
|
|
4
4
|
*
|
|
5
5
|
* @param {string} number - a string that defines a phone number.
|
|
6
6
|
* @returns {{prefix: (string|*), suffix: string, format: string}}
|
|
7
|
-
*/export
|
|
7
|
+
*/export var explodeNumberModel=function(a){var b="",c="",d="",e=findCountryByPrefix(a);return e?(b=e.phone,c=a.slice(e.phone.length),d=e.phoneFormat||""):(b="",c=a.slice(1),d=""),{prefix:b,suffix:c,format:d}};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{isOptionAndFitsQuery}from"../isOptionAndFitsQuery";/**
|
|
1
|
+
import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import{isOptionAndFitsQuery}from"../isOptionAndFitsQuery";/**
|
|
2
2
|
* Filters a set of options based on search string
|
|
3
3
|
*
|
|
4
4
|
* @param options
|
|
5
5
|
* @param query
|
|
6
6
|
* @returns {*}
|
|
7
|
-
*/export
|
|
7
|
+
*/export var filterOptionsForQuery=function(a,b){return a.filter(function(a){return isOptionAndFitsQuery(a,b)})};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import countries from"../../data/countries";import{longestMatchingPrefix}from"../longestMatchingPrefix";export
|
|
1
|
+
import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import countries from"../../data/countries";import{longestMatchingPrefix}from"../longestMatchingPrefix";export var findCountryByCode=function(a){var b;return a&&2===a.length&&(b=countries.filter(function(b){return a.toUpperCase()===b.iso2})),b&&0<b.length?longestMatchingPrefix(b):null};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import countries from"../../data/countries";import{longestMatchingPrefix}from"../longestMatchingPrefix";export
|
|
1
|
+
import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import countries from"../../data/countries";import{longestMatchingPrefix}from"../longestMatchingPrefix";export var findCountryByPrefix=function(a){var b=null;return a&&1<a.length&&(b=countries.filter(function(b){return 0===a.indexOf(b.phone)})),b&&0<b.length?longestMatchingPrefix(b):null};
|
package/build/es/polyfill/phoneNumberInput/utils/groupCountriesByPrefix/groupCountriesByPrefix.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isArray}from"@transferwise/neptune-validation";export
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.keys.js";import"core-js/modules/es.symbol.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.get-own-property-descriptor.js";import"core-js/modules/web.dom-collections.for-each.js";import"core-js/modules/es.object.get-own-property-descriptors.js";function ownKeys(a,b){var c=Object.keys(a);if(Object.getOwnPropertySymbols){var d=Object.getOwnPropertySymbols(a);b&&(d=d.filter(function(b){return Object.getOwnPropertyDescriptor(a,b).enumerable})),c.push.apply(c,d)}return c}function _objectSpread(a){for(var b,c=1;c<arguments.length;c++)b=null==arguments[c]?{}:arguments[c],c%2?ownKeys(Object(b),!0).forEach(function(c){_defineProperty(a,c,b[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(b)):ownKeys(Object(b)).forEach(function(c){Object.defineProperty(a,c,Object.getOwnPropertyDescriptor(b,c))});return a}import"core-js/modules/es.array.reduce.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.function.name.js";import"core-js/modules/es.array.concat.js";import"core-js/modules/es.object.values.js";import{isArray}from"@transferwise/neptune-validation";export var groupCountriesByPrefix=function(a){var b=a.reduce(function(a,b){var c=b.name,d=b.iso2,e=b.iso3,f=b.phone;if(a[f]){var g=a[f];a[f]=_objectSpread(_objectSpread({},g),{},{name:isArray(g.name)?[].concat(_toConsumableArray(g.name),[c]):[g.name,c],iso2:isArray(g.iso2)?[].concat(_toConsumableArray(g.iso2),[d]):[g.iso2,d],iso3:isArray(g.iso3)?[].concat(_toConsumableArray(g.iso3),[e]):[g.iso3,e]})}else a[f]=b;return a},{});return Object.values(b)};
|
package/build/es/polyfill/phoneNumberInput/utils/isOptionAndFitsQuery/isOptionAndFitsQuery.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{isArray}from"@transferwise/neptune-validation";/**
|
|
1
|
+
import"core-js/modules/es.function.name.js";import"core-js/modules/es.array.filter.js";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.replace.js";import{isArray}from"@transferwise/neptune-validation";/**
|
|
2
2
|
* Checks if query is contained into object properties.
|
|
3
3
|
*
|
|
4
4
|
* @param {object} option - the select option
|
|
5
5
|
* @param {string} query - the current search query
|
|
6
6
|
* @returns {boolean}
|
|
7
|
-
*/export
|
|
7
|
+
*/export var isOptionAndFitsQuery=function(a,b){return startsWith(a.iso3,b)||startsWith(a.iso2,b)||startsWith(a.name,b)||startsWith(a.phone,b)};export var startsWith=function(a,b){return isArray(a)?0<a.filter(function(a){return 0===normalizeValue(a).indexOf(normalizeValue(b))}).length:0===normalizeValue(a).indexOf(normalizeValue(b))};var normalizeValue=function(a){return a.toLowerCase().replace("+","")};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
import"core-js/modules/es.regexp.exec.js";export var isStringNumeric=function(a){return /^\+?[\d-\s]+$/.test(a)};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
import"core-js/modules/es.regexp.exec.js";import"core-js/modules/es.string.match.js";import"core-js/modules/es.array.join.js";/**
|
|
2
2
|
*
|
|
3
3
|
* @param phoneNumber
|
|
4
4
|
* @returns {boolean} - returns true for number that starts with '+' and contains a mix of digits and spaces with
|
|
5
5
|
* at least 4 digits.
|
|
6
|
-
*/export
|
|
6
|
+
*/export var isValidPhoneNumber=function(a){return /^\+[\d-\s]+$/.test(a)&&a.match(/\d+/g)&&4<=a.match(/\d+/g).join("").length};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
import"core-js/modules/es.array.reduce.js";import"core-js/modules/es.object.to-string.js";export var longestMatchingPrefix=function(a){return a.reduce(function(c,a){return c.phone.length>a.phone.length?c:a})};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import{getCountryFromLocale}from"../../../common/locale";import{findCountryByCode}from"../findCountryByCode";/**
|
|
2
2
|
* Default phone code, the UK one `+44`
|
|
3
|
-
*/
|
|
3
|
+
*/var DEFAULT_PHONE_CODE="+44";/**
|
|
4
4
|
* Given a valid locale it returns the correspondent prefix if found or +44 otherwise.
|
|
5
5
|
*
|
|
6
6
|
* @param {string} locale - a string that represent the locale ex:'es-ES'
|
|
7
7
|
* @param countryCode
|
|
8
8
|
* @returns {string}
|
|
9
|
-
*/export
|
|
9
|
+
*/export var setDefaultPrefix=function(a,b){var c=findCountryByCode(b)||// when `locale` code has explicit region: `en-GB`, `en-US`, `ar-AE`
|
|
10
10
|
findCountryByCode(getCountryFromLocale(a))||// when `locale` code is only two chars value: `fr`, `es`
|
|
11
|
-
findCountryByCode(a);return c
|
|
11
|
+
findCountryByCode(a);return(null===c||void 0===c?void 0:c.phone)||DEFAULT_PHONE_CODE};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
1
|
+
import _toConsumableArray from"@babel/runtime/helpers/toConsumableArray";import"core-js/modules/es.array.sort.js";// Reference fro localeCompare : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/localeCompare
|
|
2
|
+
export var sortArrayByProperty=function(a,c){return _toConsumableArray(a).sort(function(d,a){return d[c].localeCompare(a[c])})};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{useTheme}from"@wise/components-theming";import classnames from"classnames";import PropTypes from"prop-types";import{useRef,useState,cloneElement}from"react";import{Position,Typography}from"../common";import ResponsivePanel from"../common/responsivePanel";import Title from"../title";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
import _defineProperty from"@babel/runtime/helpers/defineProperty";import _slicedToArray from"@babel/runtime/helpers/slicedToArray";var _deprecatedPlacements;import"core-js/modules/es.array.concat.js";import{useTheme}from"@wise/components-theming";import classnames from"classnames";import PropTypes from"prop-types";import{useRef,useState,cloneElement}from"react";import{Position,Typography}from"../common";import ResponsivePanel from"../common/responsivePanel";import Title from"../title";import{logActionRequiredIf}from"../utilities";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var Popover=function(a){var b=a.children,c=a.className,d=a.content,e=a.preferredPlacement,f=a.title;logActionRequired({preferredPlacement:e});var g=useRef(null),h=useState(!1),i=_slicedToArray(h,2),j=i[0],k=i[1],l=useTheme(),m=l.isModern;return/*#__PURE__*/_jsxs("span",{className:classnames("np-popover",c),children:[/*#__PURE__*/_jsx("span",{ref:g,className:"d-inline-block",children:/*#__PURE__*/cloneElement(b,{onClick:function onClick(){var a;null!==b&&void 0!==b&&null!==(a=b.props)&&void 0!==a&&a.onClick&&b.props.onClick(),k(!j)}})}),/*#__PURE__*/_jsx(ResponsivePanel,{open:j,anchorRef:g,position:deprecatedPlacements[e]||e,arrow:!0,className:"np-popover__container",onClose:function onClose(){return k(!1)},children:/*#__PURE__*/_jsxs("div",{className:m?"np-popover__content np-text-default-body":"np-popover__content","aria-hidden":!j,role:"tooltip",children:[f&&/*#__PURE__*/_jsx(Title,{type:Typography.TITLE_BODY,className:"m-b-1",children:f}),d]})})]})},logActionRequired=function(a){var b=a.preferredPlacement;logActionRequiredIf("Popover has deprecated ".concat(b," value for the 'preferredPlacement' prop. Please use ").concat(deprecatedPlacements[b]," instead."),deprecatedPlacements[b])};Popover.defaultProps={className:void 0,preferredPlacement:Position.RIGHT,title:void 0},Popover.propTypes={children:PropTypes.node.isRequired,className:PropTypes.string,content:PropTypes.node.isRequired,/**
|
|
2
2
|
* `'left-top'` / `'right-top'` are deprecated use `Position.TOP` / `'top'` instead,
|
|
3
3
|
* `'bottom-right'` / `'bottom-left'` are deprecated use `Position.BOTTOM` / `'bottom'` instead
|
|
4
|
-
*/preferredPlacement:PropTypes.oneOf(["top","right","bottom","left","left-top","right-top","bottom-right","bottom-left"]),title:PropTypes.node};
|
|
4
|
+
*/preferredPlacement:PropTypes.oneOf(["top","right","bottom","left","left-top","right-top","bottom-right","bottom-left"]),title:PropTypes.node};var deprecatedPlacements=(_deprecatedPlacements={},_defineProperty(_deprecatedPlacements,Position.BOTTOM_LEFT,Position.BOTTOM),_defineProperty(_deprecatedPlacements,Position.BOTTOM_RIGHT,Position.BOTTOM),_defineProperty(_deprecatedPlacements,Position.LEFT_TOP,Position.TOP),_defineProperty(_deprecatedPlacements,Position.RIGHT_TOP,Position.TOP),_deprecatedPlacements);export default Popover;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import classNames from"classnames";import PropTypes from"prop-types";import{Component}from"react";import{Status,Size}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";
|
|
1
|
+
import _classCallCheck from"@babel/runtime/helpers/classCallCheck";import _createClass from"@babel/runtime/helpers/createClass";import _assertThisInitialized from"@babel/runtime/helpers/assertThisInitialized";import _inherits from"@babel/runtime/helpers/inherits";import _possibleConstructorReturn from"@babel/runtime/helpers/possibleConstructorReturn";import _getPrototypeOf from"@babel/runtime/helpers/getPrototypeOf";import _defineProperty from"@babel/runtime/helpers/defineProperty";import"core-js/modules/es.object.to-string.js";import"core-js/modules/es.reflect.construct.js";function _createSuper(a){var b=_isNativeReflectConstruct();return function(){var c,d=_getPrototypeOf(a);if(b){var e=_getPrototypeOf(this).constructor;c=Reflect.construct(d,arguments,e)}else c=d.apply(this,arguments);return _possibleConstructorReturn(this,c)}}function _isNativeReflectConstruct(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(a){return!1}}import classNames from"classnames";import PropTypes from"prop-types";import{Component}from"react";import{Status,Size}from"../common";import{jsx as _jsx}from"react/jsx-runtime";import{jsxs as _jsxs}from"react/jsx-runtime";var radius={xs:11,sm:22,xl:61};export var ANIMATION_DURATION_IN_MS=1500;var ProcessIndicator=/*#__PURE__*/function(a){function b(a){var d;return _classCallCheck(this,b),d=c.call(this,a),_defineProperty(_assertThisInitialized(d),"runCallBack",function(a){var b=d.props.onAnimationCompleted;b&&(d.timeouts=setTimeout(function(){b(a)},ANIMATION_DURATION_IN_MS))}),d.state={status:a.status,size:a.size},d.interval=null,d.timeout=null,d}/**
|
|
2
2
|
* Create interval for animation duration (1500ms)
|
|
3
3
|
* Update state only at the end of every interval
|
|
4
4
|
* (end of animation loop) if props changed before end of animation
|
|
5
|
-
*/componentDidMount(){this.interval=setInterval(()
|
|
5
|
+
*/_inherits(b,a);var c=_createSuper(b);return _createClass(b,[{key:"componentDidMount",value:function componentDidMount(){var a=this;this.interval=setInterval(function(){var b=a.state.status,c=a.state.size,d=a.props.status,e=a.props.size;b!==d&&a.setState({status:d},a.runCallBack(d)),c!==e&&a.setState({size:e})},ANIMATION_DURATION_IN_MS)}/**
|
|
6
6
|
* Only trigger render if comopnent's state got
|
|
7
7
|
* updated from interval callback
|
|
8
8
|
*
|
|
9
9
|
* @param nextProps
|
|
10
10
|
* @param nextState
|
|
11
|
-
*/shouldComponentUpdate(a,b){
|
|
12
|
-
componentWillUnmount(){clearInterval(this.interval),clearTimeout(this.timeout)}
|
|
11
|
+
*/},{key:"shouldComponentUpdate",value:function shouldComponentUpdate(a,b){var c=a.status===b.status,d=a.size===b.size;return c&&d}// Clear interval before destroying component
|
|
12
|
+
},{key:"componentWillUnmount",value:function componentWillUnmount(){clearInterval(this.interval),clearTimeout(this.timeout)}},{key:"render",value:function render(){var a,b=this.props,c=b.className,d=b["data-testid"],e=this.state,f=e.size,g=e.status,h=classNames("process process-".concat(f),c,(a={},_defineProperty(a,"process-danger",g===Status.FAILED),_defineProperty(a,"process-stopped",g===Status.HIDDEN),_defineProperty(a,"process-success",g===Status.SUCCEEDED),a));return/*#__PURE__*/_jsxs("span",{className:h,"data-testid":d,children:[/*#__PURE__*/_jsxs("span",{className:"process-icon-container",children:[/*#__PURE__*/_jsx("span",{className:"process-icon-horizontal"}),/*#__PURE__*/_jsx("span",{className:"process-icon-vertical"})]}),/*#__PURE__*/_jsx("svg",{xmlns:"http://www.w3.org/2000/svg",children:/*#__PURE__*/_jsx("circle",{className:"process-circle",cx:"50%",cy:"50%",r:radius[this.state.size],fillOpacity:"0.0"})})]})}}]),b}(Component);ProcessIndicator.propTypes={status:PropTypes.oneOf(["processing","failed","succeeded","hidden"]),size:PropTypes.oneOf(["xs","sm","xl"]),onAnimationCompleted:PropTypes.func,className:PropTypes.string,"data-testid":PropTypes.string},ProcessIndicator.defaultProps={status:Status.PROCESSING,size:Size.SMALL,onAnimationCompleted:null,className:void 0,"data-testid":null};export default ProcessIndicator;
|