@transferwise/components 46.36.1 → 46.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/build/index.js +169 -348
- package/build/index.js.map +1 -1
- package/build/index.mjs +164 -342
- package/build/index.mjs.map +1 -1
- package/build/main.css +127 -108
- package/build/styles/main.css +127 -108
- package/build/styles/uploadInput/UploadInput.css +25 -27
- package/build/styles/uploadInput/uploadButton/UploadButton.css +24 -38
- package/build/styles/uploadInput/uploadItem/UploadItem.css +81 -46
- package/build/types/accordion/AccordionItem/AccordionItem.d.ts.map +1 -1
- package/build/types/actionButton/ActionButton.d.ts +2 -2
- package/build/types/actionButton/ActionButton.d.ts.map +1 -1
- package/build/types/actionOption/ActionOption.d.ts +4 -5
- package/build/types/actionOption/ActionOption.d.ts.map +1 -1
- package/build/types/alert/Alert.d.ts +1 -2
- package/build/types/alert/Alert.d.ts.map +1 -1
- package/build/types/alert/inlineMarkdown/InlineMarkdown.d.ts +4 -11
- package/build/types/alert/inlineMarkdown/InlineMarkdown.d.ts.map +1 -1
- package/build/types/alert/inlineMarkdown/index.d.ts +2 -1
- package/build/types/alert/inlineMarkdown/index.d.ts.map +1 -1
- package/build/types/avatar/Avatar.d.ts +0 -1
- package/build/types/avatar/Avatar.d.ts.map +1 -1
- package/build/types/avatar/colors/colors.d.ts.map +1 -1
- package/build/types/avatarWrapper/AvatarWrapper.d.ts +0 -1
- package/build/types/avatarWrapper/AvatarWrapper.d.ts.map +1 -1
- package/build/types/body/Body.d.ts +3 -3
- package/build/types/body/Body.d.ts.map +1 -1
- package/build/types/button/Button.d.ts +0 -1
- package/build/types/button/Button.d.ts.map +1 -1
- package/build/types/button/Button.messages.d.ts +3 -3
- package/build/types/button/classMap.d.ts +6 -6
- package/build/types/card/Card.d.ts +16 -20
- package/build/types/card/Card.d.ts.map +1 -1
- package/build/types/card/index.d.ts +2 -1
- package/build/types/card/index.d.ts.map +1 -1
- package/build/types/checkbox/Checkbox.d.ts +15 -20
- package/build/types/checkbox/Checkbox.d.ts.map +1 -1
- package/build/types/checkbox/index.d.ts +2 -2
- package/build/types/checkbox/index.d.ts.map +1 -1
- package/build/types/checkboxOption/CheckboxOption.d.ts +2 -3
- package/build/types/checkboxOption/CheckboxOption.d.ts.map +1 -1
- package/build/types/chevron/Chevron.d.ts +0 -1
- package/build/types/chevron/Chevron.d.ts.map +1 -1
- package/build/types/chips/Chip.d.ts +1 -2
- package/build/types/chips/Chip.d.ts.map +1 -1
- package/build/types/chips/Chips.d.ts +1 -2
- package/build/types/chips/Chips.d.ts.map +1 -1
- package/build/types/circularButton/CircularButton.d.ts +0 -1
- package/build/types/circularButton/CircularButton.d.ts.map +1 -1
- package/build/types/common/RadioButton/RadioButton.d.ts +0 -1
- package/build/types/common/RadioButton/RadioButton.d.ts.map +1 -1
- package/build/types/common/action/Action.d.ts +0 -1
- package/build/types/common/action/Action.d.ts.map +1 -1
- package/build/types/common/bottomSheet/BottomSheet.d.ts +2 -2
- package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
- package/build/types/common/closeButton/CloseButton.d.ts +5 -6
- package/build/types/common/closeButton/CloseButton.d.ts.map +1 -1
- package/build/types/common/commonProps.d.ts +0 -1
- package/build/types/common/commonProps.d.ts.map +1 -1
- package/build/types/common/dateUtils/getMonthNames/getMonthNames.d.ts +1 -1
- package/build/types/common/dateUtils/getMonthNames/getMonthNames.d.ts.map +1 -1
- package/build/types/common/flowHeader/FlowHeader.d.ts +1 -1
- package/build/types/common/flowHeader/FlowHeader.d.ts.map +1 -1
- package/build/types/common/focusBoundary/FocusBoundary.d.ts +0 -1
- package/build/types/common/focusBoundary/FocusBoundary.d.ts.map +1 -1
- package/build/types/common/hooks/useDirection/useDirection.d.ts.map +1 -1
- package/build/types/common/hooks/useResizeObserver.d.ts +1 -2
- package/build/types/common/hooks/useResizeObserver.d.ts.map +1 -1
- package/build/types/common/panel/Panel.d.ts +11 -11
- package/build/types/common/panel/Panel.d.ts.map +1 -1
- package/build/types/common/polymorphicWithOverrides/PolymorphicWithOverrides.d.ts +1 -2
- package/build/types/common/polymorphicWithOverrides/PolymorphicWithOverrides.d.ts.map +1 -1
- package/build/types/common/responsivePanel/ResponsivePanel.d.ts +9 -10
- package/build/types/common/responsivePanel/ResponsivePanel.d.ts.map +1 -1
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts +0 -1
- package/build/types/criticalBanner/CriticalCommsBanner.d.ts.map +1 -1
- package/build/types/dateInput/DateInput.d.ts +0 -1
- package/build/types/dateInput/DateInput.d.ts.map +1 -1
- package/build/types/dateLookup/DateLookup.d.ts +1 -1
- package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
- package/build/types/dateLookup/dateHeader/DateHeader.d.ts +0 -1
- package/build/types/dateLookup/dateHeader/DateHeader.d.ts.map +1 -1
- package/build/types/dateLookup/dateTrigger/DateTrigger.d.ts +0 -1
- package/build/types/dateLookup/dateTrigger/DateTrigger.d.ts.map +1 -1
- package/build/types/dateLookup/dayCalendar/DayCalendar.d.ts +0 -1
- package/build/types/dateLookup/dayCalendar/DayCalendar.d.ts.map +1 -1
- package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts +0 -1
- package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts.map +1 -1
- package/build/types/dateLookup/monthCalendar/MonthCalendar.d.ts +0 -1
- package/build/types/dateLookup/monthCalendar/MonthCalendar.d.ts.map +1 -1
- package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts +0 -1
- package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts.map +1 -1
- package/build/types/dateLookup/tableLink/TableLink.d.ts +0 -1
- package/build/types/dateLookup/tableLink/TableLink.d.ts.map +1 -1
- package/build/types/dateLookup/yearCalendar/YearCalendar.d.ts +0 -1
- package/build/types/dateLookup/yearCalendar/YearCalendar.d.ts.map +1 -1
- package/build/types/dateLookup/yearCalendar/table/YearCalendarTable.d.ts +0 -1
- package/build/types/dateLookup/yearCalendar/table/YearCalendarTable.d.ts.map +1 -1
- package/build/types/decision/Decision.d.ts +1 -2
- package/build/types/decision/Decision.d.ts.map +1 -1
- package/build/types/definitionList/DefinitionList.d.ts +19 -24
- package/build/types/definitionList/DefinitionList.d.ts.map +1 -1
- package/build/types/definitionList/index.d.ts +2 -1
- package/build/types/definitionList/index.d.ts.map +1 -1
- package/build/types/dimmer/Dimmer.d.ts +3 -3
- package/build/types/dimmer/Dimmer.d.ts.map +1 -1
- package/build/types/drawer/Drawer.d.ts +18 -36
- package/build/types/drawer/Drawer.d.ts.map +1 -1
- package/build/types/drawer/index.d.ts +2 -1
- package/build/types/drawer/index.d.ts.map +1 -1
- package/build/types/dropFade/DropFade.d.ts.map +1 -1
- package/build/types/emphasis/Emphasis.d.ts +1 -2
- package/build/types/emphasis/Emphasis.d.ts.map +1 -1
- package/build/types/field/Field.d.ts +0 -1
- package/build/types/field/Field.d.ts.map +1 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts +0 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/flowNavigation/backButton/BackButton.d.ts +3 -3
- package/build/types/flowNavigation/backButton/index.d.ts +1 -1
- package/build/types/flowNavigation/backButton/index.d.ts.map +1 -1
- package/build/types/header/Header.d.ts +0 -1
- package/build/types/header/Header.d.ts.map +1 -1
- package/build/types/image/Image.d.ts +0 -1
- package/build/types/image/Image.d.ts.map +1 -1
- package/build/types/index.d.ts +4 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/info/Info.d.ts +0 -1
- package/build/types/info/Info.d.ts.map +1 -1
- package/build/types/inputWithDisplayFormat/InputWithDisplayFormat.d.ts +0 -1
- package/build/types/inputWithDisplayFormat/InputWithDisplayFormat.d.ts.map +1 -1
- package/build/types/inputs/Input.d.ts +1 -2
- package/build/types/inputs/Input.d.ts.map +1 -1
- package/build/types/inputs/InputGroup.d.ts +0 -1
- package/build/types/inputs/InputGroup.d.ts.map +1 -1
- package/build/types/inputs/SearchInput.d.ts +1 -2
- package/build/types/inputs/SearchInput.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts +0 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/inputs/TextArea.d.ts +1 -2
- package/build/types/inputs/TextArea.d.ts.map +1 -1
- package/build/types/inputs/_BottomSheet.d.ts +1 -2
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/build/types/inputs/_ButtonInput.d.ts +1 -2
- package/build/types/inputs/_ButtonInput.d.ts.map +1 -1
- package/build/types/inputs/_Popover.d.ts +0 -1
- package/build/types/inputs/_Popover.d.ts.map +1 -1
- package/build/types/inputs/contexts.d.ts +0 -1
- package/build/types/inputs/contexts.d.ts.map +1 -1
- package/build/types/label/Label.d.ts +0 -1
- package/build/types/label/Label.d.ts.map +1 -1
- package/build/types/loader/Loader.d.ts +0 -1
- package/build/types/loader/Loader.d.ts.map +1 -1
- package/build/types/logo/Logo.d.ts +15 -23
- package/build/types/logo/Logo.d.ts.map +1 -1
- package/build/types/logo/index.d.ts +1 -2
- package/build/types/logo/index.d.ts.map +1 -1
- package/build/types/markdown/Markdown.d.ts +0 -1
- package/build/types/markdown/Markdown.d.ts.map +1 -1
- package/build/types/money/Money.d.ts +0 -1
- package/build/types/money/Money.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts +0 -1
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/navigationOption/NavigationOption.d.ts +0 -1
- package/build/types/navigationOption/NavigationOption.d.ts.map +1 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts +0 -1
- package/build/types/phoneNumberInput/PhoneNumberInput.d.ts.map +1 -1
- package/build/types/popover/Popover.d.ts +0 -1
- package/build/types/popover/Popover.d.ts.map +1 -1
- package/build/types/progress/Progress.d.ts +1 -2
- package/build/types/progress/Progress.d.ts.map +1 -1
- package/build/types/progressBar/ProgressBar.d.ts +1 -2
- package/build/types/progressBar/ProgressBar.d.ts.map +1 -1
- package/build/types/promoCard/PromoCard.d.ts +1 -1
- package/build/types/promoCard/PromoCard.d.ts.map +1 -1
- package/build/types/provider/Provider.d.ts +0 -1
- package/build/types/provider/Provider.d.ts.map +1 -1
- package/build/types/provider/direction/DirectionProvider.d.ts +2 -2
- package/build/types/provider/direction/DirectionProvider.d.ts.map +1 -1
- package/build/types/provider/language/LanguageProvider.d.ts +2 -2
- package/build/types/provider/language/LanguageProvider.d.ts.map +1 -1
- package/build/types/radio/Radio.d.ts +0 -1
- package/build/types/radio/Radio.d.ts.map +1 -1
- package/build/types/radioGroup/RadioGroup.d.ts +0 -1
- package/build/types/radioGroup/RadioGroup.d.ts.map +1 -1
- package/build/types/radioOption/RadioOption.d.ts +0 -1
- package/build/types/radioOption/RadioOption.d.ts.map +1 -1
- package/build/types/segmentedControl/SegmentedControl.d.ts +0 -1
- package/build/types/segmentedControl/SegmentedControl.d.ts.map +1 -1
- package/build/types/select/index.d.ts +1 -1
- package/build/types/select/index.d.ts.map +1 -1
- package/build/types/select/option/Option.d.ts +2 -1
- package/build/types/select/option/Option.d.ts.map +1 -1
- package/build/types/select/option/index.d.ts +1 -1
- package/build/types/select/option/index.d.ts.map +1 -1
- package/build/types/select/searchBox/SearchBox.d.ts +3 -3
- package/build/types/select/searchBox/SearchBox.d.ts.map +1 -1
- package/build/types/slidingPanel/SlidingPanel.d.ts +2 -2
- package/build/types/slidingPanel/SlidingPanel.d.ts.map +1 -1
- package/build/types/snackbar/Snackbar.d.ts +2 -1
- package/build/types/snackbar/Snackbar.d.ts.map +1 -1
- package/build/types/snackbar/SnackbarContext.d.ts +0 -1
- package/build/types/snackbar/SnackbarContext.d.ts.map +1 -1
- package/build/types/snackbar/SnackbarProvider.d.ts +0 -1
- package/build/types/snackbar/SnackbarProvider.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts +0 -1
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/build/types/sticky/Sticky.d.ts +32 -4
- package/build/types/sticky/Sticky.d.ts.map +1 -1
- package/build/types/switchOption/SwitchOption.d.ts +3 -4
- package/build/types/switchOption/SwitchOption.d.ts.map +1 -1
- package/build/types/tabs/TabList.d.ts +1 -1
- package/build/types/tabs/TabPanel.d.ts +4 -4
- package/build/types/tabs/Tabs.d.ts +1 -1
- package/build/types/tabs/Tabs.d.ts.map +1 -1
- package/build/types/test-utils/story-config.d.ts +8 -0
- package/build/types/test-utils/story-config.d.ts.map +1 -1
- package/build/types/textareaWithDisplayFormat/TextareaWithDisplayFormat.d.ts +0 -1
- package/build/types/textareaWithDisplayFormat/TextareaWithDisplayFormat.d.ts.map +1 -1
- package/build/types/tile/Tile.d.ts +16 -37
- package/build/types/tile/Tile.d.ts.map +1 -1
- package/build/types/tile/index.d.ts +1 -1
- package/build/types/tile/index.d.ts.map +1 -1
- package/build/types/tooltip/Tooltip.d.ts.map +1 -1
- package/build/types/typeahead/Typeahead.d.ts.map +1 -1
- package/build/types/typeahead/typeaheadOption/TypeaheadOption.d.ts +0 -1
- package/build/types/typeahead/typeaheadOption/TypeaheadOption.d.ts.map +1 -1
- package/build/types/typeahead/util/highlight.d.ts +0 -1
- package/build/types/typeahead/util/highlight.d.ts.map +1 -1
- package/build/types/upload/Upload.d.ts.map +1 -1
- package/build/types/upload/Upload.messages.d.ts +20 -20
- package/build/types/upload/steps/completeStep/completeStep.d.ts +10 -10
- package/build/types/upload/steps/mediaUploadStep/mediaUploadStep.d.ts +8 -8
- package/build/types/upload/steps/processingStep/processingStep.d.ts +8 -8
- package/build/types/upload/steps/uploadImageStep/uploadImageStep.d.ts +9 -9
- package/build/types/upload/steps/uploadImageStep/uploadImageStep.d.ts.map +1 -1
- package/build/types/uploadInput/UploadInput.d.ts +1 -2
- package/build/types/uploadInput/UploadInput.d.ts.map +1 -1
- package/build/types/uploadInput/types.d.ts +9 -1
- package/build/types/uploadInput/types.d.ts.map +1 -1
- package/build/types/uploadInput/uploadButton/UploadButton.d.ts +1 -6
- package/build/types/uploadInput/uploadButton/UploadButton.d.ts.map +1 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts +0 -1
- package/build/types/uploadInput/uploadItem/UploadItem.d.ts.map +1 -1
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts +4 -4
- package/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
- package/build/types/withNextPortal/withNextPortal.d.ts +0 -1
- package/build/types/withNextPortal/withNextPortal.d.ts.map +1 -1
- package/package.json +3 -4
- package/src/accordion/AccordionItem/AccordionItem.tsx +5 -2
- package/src/actionOption/ActionOption.tsx +4 -5
- package/src/alert/Alert.tsx +1 -1
- package/src/alert/inlineMarkdown/InlineMarkdown.tsx +13 -0
- package/src/alert/inlineMarkdown/index.ts +2 -0
- package/src/body/Body.tsx +4 -3
- package/src/card/{Card.story.js → Card.story.tsx} +6 -15
- package/src/card/{Card.js → Card.tsx} +23 -34
- package/src/card/index.ts +2 -0
- package/src/checkbox/{Checkbox.spec.js → Checkbox.spec.tsx} +5 -5
- package/src/checkbox/{Checkbox.js → Checkbox.tsx} +19 -41
- package/src/checkbox/index.ts +2 -0
- package/src/chips/Chip.tsx +5 -6
- package/src/chips/Chips.tsx +1 -2
- package/src/common/bottomSheet/BottomSheet.tsx +2 -9
- package/src/common/closeButton/CloseButton.tsx +1 -1
- package/src/common/flowHeader/FlowHeader.tsx +1 -1
- package/src/common/hooks/useResizeObserver.ts +1 -1
- package/src/common/panel/Panel.spec.tsx +1 -1
- package/src/common/panel/Panel.tsx +7 -7
- package/src/common/polymorphicWithOverrides/PolymorphicWithOverrides.tsx +1 -1
- package/src/decision/Decision.tsx +1 -1
- package/src/definitionList/{DefinitionList.story.js → DefinitionList.story.tsx} +22 -2
- package/src/definitionList/DefinitionList.tsx +95 -0
- package/src/definitionList/index.ts +2 -0
- package/src/dimmer/Dimmer.tsx +2 -10
- package/src/drawer/{Drawer.rtl.spec.js → Drawer.rtl.spec.tsx} +4 -2
- package/src/drawer/{Drawer.story.js → Drawer.story.tsx} +20 -28
- package/src/drawer/{Drawer.js → Drawer.tsx} +26 -31
- package/src/drawer/index.ts +2 -0
- package/src/emphasis/Emphasis.tsx +1 -3
- package/src/index.ts +4 -0
- package/src/inputs/Input.tsx +1 -1
- package/src/inputs/SearchInput.tsx +1 -1
- package/src/inputs/SelectInput.tsx +4 -4
- package/src/inputs/TextArea.tsx +1 -1
- package/src/inputs/_BottomSheet.tsx +1 -1
- package/src/inputs/_ButtonInput.tsx +1 -1
- package/src/logo/Logo.story.tsx +3 -6
- package/src/logo/{Logo.js → Logo.tsx} +25 -35
- package/src/logo/index.ts +1 -0
- package/src/main.css +127 -108
- package/src/progress/Progress.tsx +3 -15
- package/src/progressBar/ProgressBar.tsx +1 -2
- package/src/promoCard/PromoCard.tsx +2 -2
- package/src/promoCard/PromoCardContext.spec.tsx +1 -1
- package/src/provider/direction/DirectionProvider.tsx +2 -5
- package/src/provider/language/LanguageProvider.tsx +2 -2
- package/src/section/Section.story.tsx +0 -2
- package/src/segmentedControl/SegmentedControl.tsx +2 -2
- package/src/select/option/Option.tsx +6 -18
- package/src/slidingPanel/SlidingPanel.spec.js +2 -1
- package/src/slidingPanel/SlidingPanel.tsx +4 -1
- package/src/snackbar/Snackbar.story.tsx +20 -100
- package/src/snackbar/Snackbar.tests.story.tsx +281 -0
- package/src/snackbar/Snackbar.tsx +8 -12
- package/src/ssr.spec.js +6 -0
- package/src/sticky/Sticky.spec.tsx +71 -0
- package/src/sticky/Sticky.story.tsx +72 -15
- package/src/sticky/Sticky.tsx +49 -5
- package/src/switchOption/SwitchOption.tsx +5 -7
- package/src/tabs/Tabs.js +3 -3
- package/src/test-utils/Parameters.d.ts +8 -0
- package/src/test-utils/story-config.ts +5 -0
- package/src/tile/{Tile.spec.js → Tile.spec.tsx} +1 -1
- package/src/tile/{Tile.js → Tile.tsx} +24 -35
- package/src/tooltip/Tooltip.tsx +2 -1
- package/src/uploadInput/UploadInput.css +25 -27
- package/src/uploadInput/UploadInput.less +24 -23
- package/src/uploadInput/UploadInput.story.tsx +60 -10
- package/src/uploadInput/UploadInput.tsx +3 -6
- package/src/uploadInput/types.ts +11 -1
- package/src/uploadInput/uploadButton/UploadButton.css +24 -38
- package/src/uploadInput/uploadButton/UploadButton.less +27 -40
- package/src/uploadInput/uploadButton/UploadButton.spec.tsx +0 -1
- package/src/uploadInput/uploadButton/UploadButton.tsx +12 -37
- package/src/uploadInput/uploadItem/UploadItem.css +81 -46
- package/src/uploadInput/uploadItem/UploadItem.less +75 -40
- package/src/uploadInput/uploadItem/UploadItem.tsx +33 -29
- package/src/uploadInput/uploadItem/UploadItemBody.tsx +1 -1
- package/src/withDisplayFormat/WithDisplayFormat.tsx +3 -3
- package/build/types/logo/logoTypes.d.ts +0 -6
- package/build/types/logo/logoTypes.d.ts.map +0 -1
- package/src/alert/inlineMarkdown/InlineMarkdown.js +0 -21
- package/src/alert/inlineMarkdown/index.js +0 -1
- package/src/card/index.js +0 -1
- package/src/checkbox/index.js +0 -3
- package/src/definitionList/DefinitionList.js +0 -100
- package/src/definitionList/index.js +0 -1
- package/src/drawer/index.js +0 -1
- package/src/logo/index.js +0 -2
- package/src/logo/logoTypes.ts +0 -6
- package/src/snackbar/Snackbar.spec.js +0 -112
- package/src/sticky/Sticky.spec.js +0 -34
- /package/src/card/{Card.spec.js → Card.spec.tsx} +0 -0
- /package/src/checkbox/__snapshots__/{Checkbox.spec.js.snap → Checkbox.spec.tsx.snap} +0 -0
- /package/src/drawer/__snapshots__/{Drawer.rtl.spec.js.snap → Drawer.rtl.spec.tsx.snap} +0 -0
- /package/src/logo/{Logo.spec.js → Logo.spec.tsx} +0 -0
- /package/src/logo/__snapshots__/{Logo.spec.js.snap → Logo.spec.tsx.snap} +0 -0
- /package/src/tile/{Tile.story.js → Tile.story.tsx} +0 -0
- /package/src/tile/__snapshots__/{Tile.spec.js.snap → Tile.spec.tsx.snap} +0 -0
- /package/src/tile/{index.js → index.ts} +0 -0
package/build/index.mjs
CHANGED
|
@@ -2,9 +2,8 @@ import * as React from 'react';
|
|
|
2
2
|
import React__default, { forwardRef, useId, cloneElement, useState, useEffect, useRef, useMemo, Component, createContext, useContext, useSyncExternalStore, useCallback, useImperativeHandle, createElement, PureComponent, createRef, isValidElement, Children, Fragment as Fragment$1 } from 'react';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
|
-
import { ChevronUp, CrossCircleFill, Cross, Check, Info as Info$1, Alert as Alert$1, ClockBorderless, NavigateAway, Briefcase, Person, ArrowRight, Download, ChevronLeft, ChevronRight, AlertCircleFill, AlertCircle, ArrowLeft, QuestionMarkCircle, Search, CrossCircle, ChevronDown, CheckCircleFill, ClockFill, Upload as Upload$2, Document, Plus, PlusCircle } from '@transferwise/icons';
|
|
5
|
+
import { ChevronUp, CrossCircleFill, Cross, Check, Info as Info$1, Alert as Alert$1, ClockBorderless, NavigateAway, Briefcase, Person, ArrowRight, Download, ChevronLeft, ChevronRight, AlertCircleFill, AlertCircle, ArrowLeft, QuestionMarkCircle, Search, CrossCircle, ChevronDown, CheckCircleFill, ClockFill, Upload as Upload$2, Document, Plus, PlusCircle, Bin } from '@transferwise/icons';
|
|
6
6
|
import { defineMessages, useIntl, injectIntl, IntlProvider } from 'react-intl';
|
|
7
|
-
import PropTypes from 'prop-types';
|
|
8
7
|
import commonmark from 'commonmark';
|
|
9
8
|
import { useTheme, ThemeProvider } from '@wise/components-theming';
|
|
10
9
|
import { CSSTransition } from 'react-transition-group';
|
|
@@ -17,10 +16,10 @@ import mergeProps from 'merge-props';
|
|
|
17
16
|
import { useFloating, useDismiss, useRole, useInteractions, FloatingPortal, FloatingFocusManager, offset, flip, shift, size, autoUpdate } from '@floating-ui/react';
|
|
18
17
|
import { usePreventScroll } from '@react-aria/overlays';
|
|
19
18
|
import { usePopper } from 'react-popper';
|
|
19
|
+
import PropTypes from 'prop-types';
|
|
20
20
|
import { Flag, Illustration } from '@wise/art';
|
|
21
21
|
import clamp$2 from 'lodash.clamp';
|
|
22
22
|
import debounce from 'lodash.debounce';
|
|
23
|
-
import requiredIf from 'react-required-if';
|
|
24
23
|
import { Spring, animated } from '@react-spring/web';
|
|
25
24
|
|
|
26
25
|
var Typography;
|
|
@@ -830,21 +829,14 @@ function stripNodes({
|
|
|
830
829
|
}
|
|
831
830
|
|
|
832
831
|
const allowList = [MarkdownNodeType.STRONG];
|
|
833
|
-
|
|
832
|
+
function InlineMarkdown(props) {
|
|
834
833
|
return /*#__PURE__*/jsx(Markdown, {
|
|
835
834
|
...props,
|
|
836
835
|
as: "span",
|
|
837
836
|
allowList: allowList,
|
|
838
837
|
blockList: undefined
|
|
839
838
|
});
|
|
840
|
-
}
|
|
841
|
-
InlineMarkdown.propTypes = {
|
|
842
|
-
children: PropTypes.string.isRequired,
|
|
843
|
-
className: PropTypes.string
|
|
844
|
-
};
|
|
845
|
-
InlineMarkdown.defaultProps = {
|
|
846
|
-
className: undefined
|
|
847
|
-
};
|
|
839
|
+
}
|
|
848
840
|
|
|
849
841
|
var messages$c = defineMessages({
|
|
850
842
|
opensInNewTab: {
|
|
@@ -1478,7 +1470,7 @@ const Button = /*#__PURE__*/forwardRef(({
|
|
|
1478
1470
|
});
|
|
1479
1471
|
});
|
|
1480
1472
|
|
|
1481
|
-
const Card$
|
|
1473
|
+
const Card$1 = /*#__PURE__*/forwardRef(({
|
|
1482
1474
|
className,
|
|
1483
1475
|
children = null,
|
|
1484
1476
|
id,
|
|
@@ -1511,7 +1503,7 @@ const Card$2 = /*#__PURE__*/forwardRef(({
|
|
|
1511
1503
|
}), children]
|
|
1512
1504
|
});
|
|
1513
1505
|
});
|
|
1514
|
-
Card$
|
|
1506
|
+
Card$1.displayName = 'Card';
|
|
1515
1507
|
|
|
1516
1508
|
function Display({
|
|
1517
1509
|
as: Heading = 'h1',
|
|
@@ -1890,7 +1882,7 @@ const PromoCard = /*#__PURE__*/forwardRef(({
|
|
|
1890
1882
|
useEffect(() => {
|
|
1891
1883
|
setChecked(defaultChecked ?? isChecked ?? false);
|
|
1892
1884
|
}, [defaultChecked, isChecked]);
|
|
1893
|
-
return /*#__PURE__*/jsxs(Card$
|
|
1885
|
+
return /*#__PURE__*/jsxs(Card$1, {
|
|
1894
1886
|
...commonProps,
|
|
1895
1887
|
...checkedProps,
|
|
1896
1888
|
...props,
|
|
@@ -2187,20 +2179,19 @@ const isVisible = (container, el) => {
|
|
|
2187
2179
|
return elemLeft >= cScrollOffset && elemRight <= cScrollOffset + cWidth;
|
|
2188
2180
|
};
|
|
2189
2181
|
|
|
2190
|
-
const Card = /*#__PURE__*/forwardRef((
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
|
|
2194
|
-
|
|
2195
|
-
|
|
2196
|
-
|
|
2197
|
-
|
|
2198
|
-
|
|
2199
|
-
|
|
2200
|
-
|
|
2201
|
-
|
|
2202
|
-
|
|
2203
|
-
} = props;
|
|
2182
|
+
const Card = /*#__PURE__*/forwardRef(function Card({
|
|
2183
|
+
'aria-label': ariaLabel,
|
|
2184
|
+
as: Element = 'div',
|
|
2185
|
+
isExpanded,
|
|
2186
|
+
title,
|
|
2187
|
+
details,
|
|
2188
|
+
children,
|
|
2189
|
+
onClick,
|
|
2190
|
+
icon,
|
|
2191
|
+
id,
|
|
2192
|
+
className,
|
|
2193
|
+
'data-testid': dataTestId
|
|
2194
|
+
}, reference) {
|
|
2204
2195
|
const isOpen = !!(isExpanded && children);
|
|
2205
2196
|
return /*#__PURE__*/jsxs(Element, {
|
|
2206
2197
|
ref: reference,
|
|
@@ -2210,7 +2201,7 @@ const Card = /*#__PURE__*/forwardRef((props, reference) => {
|
|
|
2210
2201
|
'np-card--has-icon': !!icon
|
|
2211
2202
|
}),
|
|
2212
2203
|
id: id,
|
|
2213
|
-
"data-testid":
|
|
2204
|
+
"data-testid": dataTestId,
|
|
2214
2205
|
children: [/*#__PURE__*/jsx(Option$2, {
|
|
2215
2206
|
"aria-label": ariaLabel,
|
|
2216
2207
|
as: children ? 'button' : 'div',
|
|
@@ -2222,7 +2213,7 @@ const Card = /*#__PURE__*/forwardRef((props, reference) => {
|
|
|
2222
2213
|
button: children && /*#__PURE__*/jsx(Chevron, {
|
|
2223
2214
|
orientation: isOpen ? Position.TOP : Position.BOTTOM
|
|
2224
2215
|
}),
|
|
2225
|
-
onClick: () =>
|
|
2216
|
+
onClick: children ? () => onClick?.(!isExpanded) : undefined
|
|
2226
2217
|
}), /*#__PURE__*/jsx("div", {
|
|
2227
2218
|
className: classNames('np-card__divider', {
|
|
2228
2219
|
'np-card__divider--expanded': isOpen
|
|
@@ -2235,31 +2226,6 @@ const Card = /*#__PURE__*/forwardRef((props, reference) => {
|
|
|
2235
2226
|
})]
|
|
2236
2227
|
});
|
|
2237
2228
|
});
|
|
2238
|
-
const hasChildren = ({
|
|
2239
|
-
children
|
|
2240
|
-
}) => children;
|
|
2241
|
-
Card.propTypes = {
|
|
2242
|
-
'aria-label': PropTypes.string,
|
|
2243
|
-
as: PropTypes.string,
|
|
2244
|
-
isExpanded: requiredIf(PropTypes.bool, hasChildren),
|
|
2245
|
-
title: PropTypes.node.isRequired,
|
|
2246
|
-
details: PropTypes.node.isRequired,
|
|
2247
|
-
onClick: requiredIf(PropTypes.func, hasChildren),
|
|
2248
|
-
icon: PropTypes.node,
|
|
2249
|
-
children: PropTypes.node,
|
|
2250
|
-
id: PropTypes.string,
|
|
2251
|
-
className: PropTypes.string,
|
|
2252
|
-
'data-testid': PropTypes.string
|
|
2253
|
-
};
|
|
2254
|
-
Card.defaultProps = {
|
|
2255
|
-
'aria-label': undefined,
|
|
2256
|
-
as: 'div',
|
|
2257
|
-
children: null,
|
|
2258
|
-
id: null,
|
|
2259
|
-
className: null,
|
|
2260
|
-
'data-testid': null
|
|
2261
|
-
};
|
|
2262
|
-
var Card$1 = Card;
|
|
2263
2229
|
|
|
2264
2230
|
const CheckboxButton = /*#__PURE__*/forwardRef(({
|
|
2265
2231
|
checked,
|
|
@@ -2283,9 +2249,8 @@ const CheckboxButton = /*#__PURE__*/forwardRef(({
|
|
|
2283
2249
|
})
|
|
2284
2250
|
})]
|
|
2285
2251
|
}));
|
|
2286
|
-
var CheckboxButton$1 = CheckboxButton;
|
|
2287
2252
|
|
|
2288
|
-
|
|
2253
|
+
function Checkbox({
|
|
2289
2254
|
id,
|
|
2290
2255
|
checked,
|
|
2291
2256
|
required,
|
|
@@ -2297,14 +2262,11 @@ const Checkbox = ({
|
|
|
2297
2262
|
onChange,
|
|
2298
2263
|
onFocus,
|
|
2299
2264
|
onBlur
|
|
2300
|
-
})
|
|
2301
|
-
const {
|
|
2302
|
-
isModern
|
|
2303
|
-
} = useTheme();
|
|
2265
|
+
}) {
|
|
2304
2266
|
const classList = classNames('np-checkbox', {
|
|
2305
2267
|
checkbox: true,
|
|
2306
2268
|
'checkbox-lg': secondary,
|
|
2307
|
-
disabled
|
|
2269
|
+
disabled
|
|
2308
2270
|
}, className);
|
|
2309
2271
|
const innerDisabled = disabled || readOnly;
|
|
2310
2272
|
return /*#__PURE__*/jsx("div", {
|
|
@@ -2314,7 +2276,7 @@ const Checkbox = ({
|
|
|
2314
2276
|
className: classNames({
|
|
2315
2277
|
disabled
|
|
2316
2278
|
}),
|
|
2317
|
-
children: [/*#__PURE__*/jsx(CheckboxButton
|
|
2279
|
+
children: [/*#__PURE__*/jsx(CheckboxButton, {
|
|
2318
2280
|
className: "p-r-2",
|
|
2319
2281
|
checked: checked,
|
|
2320
2282
|
disabled: innerDisabled,
|
|
@@ -2331,39 +2293,12 @@ const Checkbox = ({
|
|
|
2331
2293
|
children: label
|
|
2332
2294
|
}), secondary && /*#__PURE__*/jsx(Body, {
|
|
2333
2295
|
as: "span",
|
|
2334
|
-
className: classNames({
|
|
2335
|
-
secondary: !isModern
|
|
2336
|
-
}),
|
|
2337
2296
|
children: secondary
|
|
2338
2297
|
})]
|
|
2339
2298
|
})]
|
|
2340
2299
|
})
|
|
2341
2300
|
});
|
|
2342
|
-
}
|
|
2343
|
-
Checkbox.propTypes = {
|
|
2344
|
-
id: PropTypes.string,
|
|
2345
|
-
checked: PropTypes.bool,
|
|
2346
|
-
required: PropTypes.bool,
|
|
2347
|
-
disabled: PropTypes.bool,
|
|
2348
|
-
readOnly: PropTypes.bool,
|
|
2349
|
-
label: PropTypes.node.isRequired,
|
|
2350
|
-
secondary: PropTypes.string,
|
|
2351
|
-
onFocus: PropTypes.func,
|
|
2352
|
-
onChange: PropTypes.func.isRequired,
|
|
2353
|
-
onBlur: PropTypes.func,
|
|
2354
|
-
className: PropTypes.string
|
|
2355
|
-
};
|
|
2356
|
-
Checkbox.defaultProps = {
|
|
2357
|
-
id: null,
|
|
2358
|
-
checked: false,
|
|
2359
|
-
required: false,
|
|
2360
|
-
disabled: false,
|
|
2361
|
-
readOnly: false,
|
|
2362
|
-
secondary: null,
|
|
2363
|
-
onFocus: null,
|
|
2364
|
-
onBlur: null,
|
|
2365
|
-
className: undefined
|
|
2366
|
-
};
|
|
2301
|
+
}
|
|
2367
2302
|
|
|
2368
2303
|
const CheckboxOption = /*#__PURE__*/forwardRef(({
|
|
2369
2304
|
checked,
|
|
@@ -2375,7 +2310,7 @@ const CheckboxOption = /*#__PURE__*/forwardRef(({
|
|
|
2375
2310
|
...rest,
|
|
2376
2311
|
ref: reference,
|
|
2377
2312
|
disabled: disabled,
|
|
2378
|
-
button: /*#__PURE__*/jsx(CheckboxButton
|
|
2313
|
+
button: /*#__PURE__*/jsx(CheckboxButton, {
|
|
2379
2314
|
checked: checked,
|
|
2380
2315
|
disabled: disabled,
|
|
2381
2316
|
onChange: () => onChange?.(!checked)
|
|
@@ -2402,7 +2337,7 @@ const Chip = ({
|
|
|
2402
2337
|
isModern
|
|
2403
2338
|
} = useTheme();
|
|
2404
2339
|
const closeButtonReference = useRef(null);
|
|
2405
|
-
const previousCloseButtonShown = useRef();
|
|
2340
|
+
const previousCloseButtonShown = useRef(undefined);
|
|
2406
2341
|
useEffect(() => {
|
|
2407
2342
|
if (closeButtonReference.current != null && previousCloseButtonShown.current === false) {
|
|
2408
2343
|
closeButtonReference.current?.focus();
|
|
@@ -2430,7 +2365,7 @@ const Chip = ({
|
|
|
2430
2365
|
}), onRemove ? /*#__PURE__*/jsx(CloseButton, {
|
|
2431
2366
|
ref: closeButtonReference,
|
|
2432
2367
|
className: isModern ? `btn-unstyled` : `btn-unstyled m-l-1`,
|
|
2433
|
-
"aria-label": closeButton
|
|
2368
|
+
"aria-label": closeButton?.['aria-label'],
|
|
2434
2369
|
size: "sm",
|
|
2435
2370
|
filled: isModern,
|
|
2436
2371
|
onClick: onRemove
|
|
@@ -2753,6 +2688,7 @@ const SlidingPanel = /*#__PURE__*/forwardRef(({
|
|
|
2753
2688
|
slidingPanelPositionFixed,
|
|
2754
2689
|
className,
|
|
2755
2690
|
children,
|
|
2691
|
+
testId,
|
|
2756
2692
|
...rest
|
|
2757
2693
|
}, reference) => {
|
|
2758
2694
|
const localReference = useRef(null);
|
|
@@ -2773,20 +2709,21 @@ const SlidingPanel = /*#__PURE__*/forwardRef(({
|
|
|
2773
2709
|
unmountOnExit: true
|
|
2774
2710
|
}, /*#__PURE__*/jsx("div", {
|
|
2775
2711
|
ref: localReference,
|
|
2712
|
+
"data-testid": testId,
|
|
2776
2713
|
className: classNames('sliding-panel', `sliding-panel--open-${position}`, showSlidingPanelBorder && `sliding-panel--border-${position}`, slidingPanelPositionFixed && 'sliding-panel--fixed', className),
|
|
2777
2714
|
children: children
|
|
2778
2715
|
}));
|
|
2779
2716
|
});
|
|
2780
2717
|
|
|
2781
|
-
|
|
2718
|
+
function Drawer({
|
|
2782
2719
|
children,
|
|
2783
2720
|
className,
|
|
2784
2721
|
footerContent,
|
|
2785
2722
|
headerTitle,
|
|
2786
2723
|
onClose,
|
|
2787
|
-
open,
|
|
2788
|
-
position
|
|
2789
|
-
})
|
|
2724
|
+
open = false,
|
|
2725
|
+
position = 'right'
|
|
2726
|
+
}) {
|
|
2790
2727
|
logActionRequiredIf('Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.', !onClose);
|
|
2791
2728
|
const {
|
|
2792
2729
|
isMobile
|
|
@@ -2824,32 +2761,7 @@ const Drawer = ({
|
|
|
2824
2761
|
})
|
|
2825
2762
|
})
|
|
2826
2763
|
});
|
|
2827
|
-
}
|
|
2828
|
-
Drawer.propTypes = {
|
|
2829
|
-
/** The content to appear in the drawer body. */
|
|
2830
|
-
children: PropTypes.node,
|
|
2831
|
-
className: PropTypes.string,
|
|
2832
|
-
/** The content to appear in the drawer footer. */
|
|
2833
|
-
footerContent: PropTypes.node,
|
|
2834
|
-
/** The content to appear in the drawer header. */
|
|
2835
|
-
headerTitle: PropTypes.node,
|
|
2836
|
-
/** The status of Drawer either open or not. */
|
|
2837
|
-
open: PropTypes.bool,
|
|
2838
|
-
/** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */
|
|
2839
|
-
position: PropTypes.oneOf(['left', 'right', 'bottom']),
|
|
2840
|
-
/** The action to perform on close click. */
|
|
2841
|
-
onClose: PropTypes.func
|
|
2842
|
-
};
|
|
2843
|
-
Drawer.defaultProps = {
|
|
2844
|
-
children: null,
|
|
2845
|
-
className: undefined,
|
|
2846
|
-
footerContent: null,
|
|
2847
|
-
headerTitle: null,
|
|
2848
|
-
onClose: null,
|
|
2849
|
-
open: false,
|
|
2850
|
-
position: Position.RIGHT
|
|
2851
|
-
};
|
|
2852
|
-
var Drawer$1 = Drawer;
|
|
2764
|
+
}
|
|
2853
2765
|
|
|
2854
2766
|
const INITIAL_Y_POSITION = 0;
|
|
2855
2767
|
const CONTENT_SCROLL_THRESHOLD = 1;
|
|
@@ -2979,7 +2891,7 @@ const BottomSheet$1 = props => {
|
|
|
2979
2891
|
};
|
|
2980
2892
|
}
|
|
2981
2893
|
const is400Zoom = useMedia(`(max-width: ${Breakpoint.ZOOM_400}px)`);
|
|
2982
|
-
return is400Zoom ? /*#__PURE__*/jsx(Drawer
|
|
2894
|
+
return is400Zoom ? /*#__PURE__*/jsx(Drawer, {
|
|
2983
2895
|
open: props.open,
|
|
2984
2896
|
className: props.className,
|
|
2985
2897
|
onClose: close,
|
|
@@ -4650,7 +4562,7 @@ const NavigationOption = /*#__PURE__*/forwardRef(({
|
|
|
4650
4562
|
});
|
|
4651
4563
|
});
|
|
4652
4564
|
|
|
4653
|
-
|
|
4565
|
+
function Tile({
|
|
4654
4566
|
className,
|
|
4655
4567
|
description,
|
|
4656
4568
|
disabled,
|
|
@@ -4658,10 +4570,10 @@ const Tile = ({
|
|
|
4658
4570
|
target,
|
|
4659
4571
|
media,
|
|
4660
4572
|
onClick,
|
|
4661
|
-
size,
|
|
4573
|
+
size = 'md',
|
|
4662
4574
|
title
|
|
4663
|
-
})
|
|
4664
|
-
const isSmall = size ===
|
|
4575
|
+
}) {
|
|
4576
|
+
const isSmall = size === 'sm';
|
|
4665
4577
|
const Element = href ? 'a' : 'button';
|
|
4666
4578
|
return /*#__PURE__*/jsxs(Element, {
|
|
4667
4579
|
className: classNames('decision', 'flex-column', 'np-tile', 'text-no-decoration', 'text-xs-center', className, {
|
|
@@ -4670,12 +4582,12 @@ const Tile = ({
|
|
|
4670
4582
|
}, disabled && 'disabled'),
|
|
4671
4583
|
href: href,
|
|
4672
4584
|
target: target,
|
|
4673
|
-
onClick: disabled ?
|
|
4674
|
-
onKeyDown: disabled ?
|
|
4585
|
+
onClick: disabled ? undefined : onClick,
|
|
4586
|
+
onKeyDown: disabled ? undefined : ({
|
|
4675
4587
|
key
|
|
4676
4588
|
}) => {
|
|
4677
4589
|
if (key === 'Enter' || key === ' ') {
|
|
4678
|
-
onClick();
|
|
4590
|
+
onClick?.();
|
|
4679
4591
|
}
|
|
4680
4592
|
},
|
|
4681
4593
|
children: [/*#__PURE__*/jsx("div", {
|
|
@@ -4692,29 +4604,7 @@ const Tile = ({
|
|
|
4692
4604
|
children: description
|
|
4693
4605
|
}) : null]
|
|
4694
4606
|
});
|
|
4695
|
-
}
|
|
4696
|
-
Tile.propTypes = {
|
|
4697
|
-
/** Classes to apply to the Tile container */
|
|
4698
|
-
className: PropTypes.string,
|
|
4699
|
-
description: PropTypes.node,
|
|
4700
|
-
disabled: PropTypes.bool,
|
|
4701
|
-
href: PropTypes.string,
|
|
4702
|
-
target: PropTypes.oneOf(['_self', '_blank', '_parent', '_top']),
|
|
4703
|
-
/** Accepts only Avatar and images */
|
|
4704
|
-
media: PropTypes.node.isRequired,
|
|
4705
|
-
/** Function called onClick or onKeyDown */
|
|
4706
|
-
onClick: PropTypes.func,
|
|
4707
|
-
/** The size applied to Tile */
|
|
4708
|
-
size: PropTypes.oneOf(['sm', 'md']),
|
|
4709
|
-
title: PropTypes.node.isRequired
|
|
4710
|
-
};
|
|
4711
|
-
Tile.defaultProps = {
|
|
4712
|
-
className: '',
|
|
4713
|
-
description: null,
|
|
4714
|
-
disabled: false,
|
|
4715
|
-
size: Size.MEDIUM,
|
|
4716
|
-
target: undefined
|
|
4717
|
-
};
|
|
4607
|
+
}
|
|
4718
4608
|
|
|
4719
4609
|
var DecisionPresentation;
|
|
4720
4610
|
(function (DecisionPresentation) {
|
|
@@ -4806,9 +4696,9 @@ const Decision = ({
|
|
|
4806
4696
|
return null;
|
|
4807
4697
|
};
|
|
4808
4698
|
|
|
4809
|
-
const isLayoutHorizontal = layout =>
|
|
4699
|
+
const isLayoutHorizontal = layout => layout === Layout.HORIZONTAL_LEFT_ALIGNED || layout === Layout.HORIZONTAL_RIGHT_ALIGNED || layout === Layout.HORIZONTAL_JUSTIFIED;
|
|
4810
4700
|
const getAlignmentClasses = (layout, action) => {
|
|
4811
|
-
|
|
4701
|
+
const classes = ['d-flex'];
|
|
4812
4702
|
if (action) {
|
|
4813
4703
|
if (isLayoutHorizontal(layout)) {
|
|
4814
4704
|
classes.push('align-items-center');
|
|
@@ -4826,60 +4716,44 @@ const getAlignmentClasses = (layout, action) => {
|
|
|
4826
4716
|
}
|
|
4827
4717
|
return classes;
|
|
4828
4718
|
};
|
|
4829
|
-
const
|
|
4830
|
-
|
|
4831
|
-
|
|
4719
|
+
const defaultDefinitions = [];
|
|
4720
|
+
function DefinitionList({
|
|
4721
|
+
definitions = defaultDefinitions,
|
|
4722
|
+
layout = 'VERTICAL_TWO_COLUMN',
|
|
4832
4723
|
muted
|
|
4833
|
-
})
|
|
4834
|
-
|
|
4835
|
-
'
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
children: definitions.filter(definition => definition).map(({
|
|
4841
|
-
action,
|
|
4842
|
-
title,
|
|
4843
|
-
value,
|
|
4844
|
-
key
|
|
4845
|
-
}) => /*#__PURE__*/jsxs("div", {
|
|
4846
|
-
className: "tw-definition-list__item",
|
|
4847
|
-
children: [/*#__PURE__*/jsx("dt", {
|
|
4848
|
-
children: title
|
|
4849
|
-
}), /*#__PURE__*/jsxs("dd", {
|
|
4850
|
-
className: classNames(...getAlignmentClasses(layout, action)),
|
|
4851
|
-
children: [/*#__PURE__*/jsx("div", {
|
|
4852
|
-
children: value
|
|
4853
|
-
}), action ? /*#__PURE__*/jsx("div", {
|
|
4854
|
-
className: classNames(isLayoutHorizontal(layout) ? 'p-l-2' : 'p-x-2', 'tw-definition-list__action'),
|
|
4855
|
-
children: /*#__PURE__*/jsx(ActionButton, {
|
|
4856
|
-
className: "tw-definition-list__button",
|
|
4857
|
-
onClick: action.onClick,
|
|
4858
|
-
children: action.label
|
|
4859
|
-
})
|
|
4860
|
-
}) : null]
|
|
4861
|
-
})]
|
|
4862
|
-
}, key))
|
|
4863
|
-
});
|
|
4864
|
-
DefinitionList.propTypes = {
|
|
4865
|
-
definitions: PropTypes.arrayOf(PropTypes.shape({
|
|
4866
|
-
action: PropTypes.shape({
|
|
4867
|
-
label: PropTypes.string.isRequired,
|
|
4868
|
-
onClick: PropTypes.func
|
|
4724
|
+
}) {
|
|
4725
|
+
return /*#__PURE__*/jsx("dl", {
|
|
4726
|
+
className: classNames('tw-definition-list d-flex ', {
|
|
4727
|
+
'text-muted': muted,
|
|
4728
|
+
'flex-column': layout === Layout.VERTICAL_ONE_COLUMN,
|
|
4729
|
+
'tw-definition-list--columns flex-column flex-row--sm': layout === Layout.VERTICAL_TWO_COLUMN,
|
|
4730
|
+
'tw-definition-list--horizontal flex-column': isLayoutHorizontal(layout)
|
|
4869
4731
|
}),
|
|
4870
|
-
|
|
4871
|
-
|
|
4872
|
-
|
|
4873
|
-
|
|
4874
|
-
|
|
4875
|
-
|
|
4876
|
-
|
|
4877
|
-
|
|
4878
|
-
|
|
4879
|
-
|
|
4880
|
-
|
|
4881
|
-
|
|
4882
|
-
|
|
4732
|
+
children: definitions.filter(definition => definition).map(({
|
|
4733
|
+
action,
|
|
4734
|
+
title,
|
|
4735
|
+
value,
|
|
4736
|
+
key
|
|
4737
|
+
}) => /*#__PURE__*/jsxs("div", {
|
|
4738
|
+
className: "tw-definition-list__item",
|
|
4739
|
+
children: [/*#__PURE__*/jsx("dt", {
|
|
4740
|
+
children: title
|
|
4741
|
+
}), /*#__PURE__*/jsxs("dd", {
|
|
4742
|
+
className: classNames(...getAlignmentClasses(layout, action)),
|
|
4743
|
+
children: [/*#__PURE__*/jsx("div", {
|
|
4744
|
+
children: value
|
|
4745
|
+
}), action ? /*#__PURE__*/jsx("div", {
|
|
4746
|
+
className: classNames(isLayoutHorizontal(layout) ? 'p-l-2' : 'p-x-2', 'tw-definition-list__action'),
|
|
4747
|
+
children: /*#__PURE__*/jsx(ActionButton, {
|
|
4748
|
+
className: "tw-definition-list__button",
|
|
4749
|
+
onClick: action.onClick,
|
|
4750
|
+
children: action.label
|
|
4751
|
+
})
|
|
4752
|
+
}) : null]
|
|
4753
|
+
})]
|
|
4754
|
+
}, key))
|
|
4755
|
+
});
|
|
4756
|
+
}
|
|
4883
4757
|
|
|
4884
4758
|
const DropFade = ({
|
|
4885
4759
|
children,
|
|
@@ -5068,14 +4942,6 @@ const FlowHeader = /*#__PURE__*/React.forwardRef(({
|
|
|
5068
4942
|
});
|
|
5069
4943
|
});
|
|
5070
4944
|
|
|
5071
|
-
// TODO: consider to move this enum into component file once we migrate it on TypeScript or replace with some common enum
|
|
5072
|
-
var LogoType;
|
|
5073
|
-
(function (LogoType) {
|
|
5074
|
-
LogoType["WISE"] = "WISE";
|
|
5075
|
-
LogoType["WISE_BUSINESS"] = "WISE_BUSINESS";
|
|
5076
|
-
LogoType["WISE_PLATFORM"] = "WISE_PLATFORM";
|
|
5077
|
-
})(LogoType || (LogoType = {}));
|
|
5078
|
-
|
|
5079
4945
|
var LogoFlagInverse = function LogoFlagInverse(props) {
|
|
5080
4946
|
return /*#__PURE__*/jsx("svg", {
|
|
5081
4947
|
...props,
|
|
@@ -5208,15 +5074,26 @@ const svgPaths = {
|
|
|
5208
5074
|
WISE_FLAG_PLATFORM: LogoFlagPlatform,
|
|
5209
5075
|
WISE_FLAG_PLATFORM_INVERSE: LogoFlagPlatformInverse
|
|
5210
5076
|
};
|
|
5211
|
-
|
|
5077
|
+
var LogoType;
|
|
5078
|
+
(function (LogoType) {
|
|
5079
|
+
LogoType["WISE"] = "WISE";
|
|
5080
|
+
LogoType["WISE_BUSINESS"] = "WISE_BUSINESS";
|
|
5081
|
+
LogoType["WISE_PLATFORM"] = "WISE_PLATFORM";
|
|
5082
|
+
})(LogoType || (LogoType = {}));
|
|
5083
|
+
const labelByType = {
|
|
5084
|
+
WISE: 'Wise',
|
|
5085
|
+
WISE_BUSINESS: 'Wise Business',
|
|
5086
|
+
WISE_PLATFORM: 'Wise Platform'
|
|
5087
|
+
};
|
|
5088
|
+
function Logo({
|
|
5212
5089
|
className,
|
|
5213
5090
|
inverse,
|
|
5214
|
-
type
|
|
5215
|
-
})
|
|
5216
|
-
const LogoSm = svgPaths[`WISE_FLAG${type ===
|
|
5091
|
+
type = 'WISE'
|
|
5092
|
+
}) {
|
|
5093
|
+
const LogoSm = svgPaths[`WISE_FLAG${type === 'WISE_PLATFORM' ? '_PLATFORM' : ''}${inverse ? '_INVERSE' : ''}`];
|
|
5217
5094
|
const LogoMd = svgPaths[`${type}${inverse ? '_INVERSE' : ''}`];
|
|
5218
5095
|
return /*#__PURE__*/jsxs("span", {
|
|
5219
|
-
"aria-label": type
|
|
5096
|
+
"aria-label": labelByType[type],
|
|
5220
5097
|
role: "img",
|
|
5221
5098
|
className: classNames(className, 'np-logo'),
|
|
5222
5099
|
children: [/*#__PURE__*/jsx(LogoSm, {
|
|
@@ -5225,21 +5102,7 @@ const Logo = ({
|
|
|
5225
5102
|
className: "np-logo-svg np-logo-svg--size-md"
|
|
5226
5103
|
})]
|
|
5227
5104
|
});
|
|
5228
|
-
}
|
|
5229
|
-
Logo.propTypes = {
|
|
5230
|
-
/** Extra classes applied to Logo */
|
|
5231
|
-
className: PropTypes.string,
|
|
5232
|
-
/** If true, will use dark colours for dark on light theme */
|
|
5233
|
-
inverse: PropTypes.bool,
|
|
5234
|
-
/** What type of logo to display */
|
|
5235
|
-
type: PropTypes.oneOf(['WISE', 'WISE_BUSINESS', 'WISE_PLATFORM'])
|
|
5236
|
-
};
|
|
5237
|
-
Logo.defaultProps = {
|
|
5238
|
-
className: undefined,
|
|
5239
|
-
inverse: false,
|
|
5240
|
-
type: LogoType.WISE
|
|
5241
|
-
};
|
|
5242
|
-
var Logo$1 = Logo;
|
|
5105
|
+
}
|
|
5243
5106
|
|
|
5244
5107
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
5245
5108
|
const Tooltip = ({
|
|
@@ -5469,7 +5332,7 @@ BackButton.defaultProps = {
|
|
|
5469
5332
|
const FlowNavigation = ({
|
|
5470
5333
|
activeStep = 0,
|
|
5471
5334
|
avatar,
|
|
5472
|
-
logo = /*#__PURE__*/jsx(Logo
|
|
5335
|
+
logo = /*#__PURE__*/jsx(Logo, {}),
|
|
5473
5336
|
done = false,
|
|
5474
5337
|
onClose,
|
|
5475
5338
|
onGoBack,
|
|
@@ -5621,7 +5484,7 @@ const Modal = ({
|
|
|
5621
5484
|
const noDivider = checkSpecialClasses('no-divider');
|
|
5622
5485
|
const contentReference = useRef(null);
|
|
5623
5486
|
const titleId = useId();
|
|
5624
|
-
return !isMedium ? /*#__PURE__*/jsx(Drawer
|
|
5487
|
+
return !isMedium ? /*#__PURE__*/jsx(Drawer, {
|
|
5625
5488
|
open: open,
|
|
5626
5489
|
headerTitle: title,
|
|
5627
5490
|
footerContent: footer,
|
|
@@ -6067,7 +5930,7 @@ const getCursorPositionAfterActionStroke = (action, selectionStart, selectionEnd
|
|
|
6067
5930
|
return cursorPosition;
|
|
6068
5931
|
};
|
|
6069
5932
|
|
|
6070
|
-
class WithDisplayFormat extends Component {
|
|
5933
|
+
class WithDisplayFormat extends React.Component {
|
|
6071
5934
|
static defaultProps = {
|
|
6072
5935
|
autoComplete: 'off',
|
|
6073
5936
|
displayPattern: '',
|
|
@@ -7896,7 +7759,7 @@ const OverlayHeader = ({
|
|
|
7896
7759
|
};
|
|
7897
7760
|
OverlayHeader.defaultProps = {
|
|
7898
7761
|
avatar: null,
|
|
7899
|
-
logo: /*#__PURE__*/jsx(Logo
|
|
7762
|
+
logo: /*#__PURE__*/jsx(Logo, {}),
|
|
7900
7763
|
onClose: null
|
|
7901
7764
|
};
|
|
7902
7765
|
OverlayHeader.propTypes = {
|
|
@@ -9422,16 +9285,11 @@ const Progress = ({
|
|
|
9422
9285
|
id,
|
|
9423
9286
|
progress
|
|
9424
9287
|
}) => {
|
|
9425
|
-
const [value, setValue] = useState(0);
|
|
9426
|
-
useEffect(() => {
|
|
9427
|
-
setValue(progress.value);
|
|
9428
|
-
});
|
|
9429
9288
|
return /*#__PURE__*/jsxs("progress", {
|
|
9430
9289
|
id: id,
|
|
9431
9290
|
className: classNames('np-progress d-block', className),
|
|
9432
9291
|
...progress,
|
|
9433
|
-
|
|
9434
|
-
children: [value, "%"]
|
|
9292
|
+
children: [Math.floor(progress.value / progress.max * 100), "%"]
|
|
9435
9293
|
});
|
|
9436
9294
|
};
|
|
9437
9295
|
|
|
@@ -9925,12 +9783,8 @@ function Option$1({
|
|
|
9925
9783
|
note = '',
|
|
9926
9784
|
secondary = '',
|
|
9927
9785
|
icon,
|
|
9928
|
-
classNames = {},
|
|
9929
9786
|
selected = false
|
|
9930
9787
|
}) {
|
|
9931
|
-
const {
|
|
9932
|
-
isModern
|
|
9933
|
-
} = useTheme();
|
|
9934
9788
|
const iconElement = icon ? /*#__PURE__*/cloneElement(icon, {
|
|
9935
9789
|
size: 24,
|
|
9936
9790
|
className: 'tw-icon'
|
|
@@ -9944,22 +9798,12 @@ function Option$1({
|
|
|
9944
9798
|
className: selected ? 'text-ellipsis' : undefined,
|
|
9945
9799
|
children: [label, note && /*#__PURE__*/jsx(Body, {
|
|
9946
9800
|
as: "span",
|
|
9947
|
-
className:
|
|
9801
|
+
className: "m-l-1",
|
|
9948
9802
|
children: note
|
|
9949
9803
|
})]
|
|
9950
9804
|
});
|
|
9951
|
-
const secondaryElementClassNames = () => {
|
|
9952
|
-
let classes = undefined;
|
|
9953
|
-
if (selected) {
|
|
9954
|
-
classes = 'text-ellipsis';
|
|
9955
|
-
}
|
|
9956
|
-
if (isModern) {
|
|
9957
|
-
return classes;
|
|
9958
|
-
}
|
|
9959
|
-
return `${classes ? classes + ' ' : ''}body-2`;
|
|
9960
|
-
};
|
|
9961
9805
|
const secondaryElement = secondary && /*#__PURE__*/jsx(Body, {
|
|
9962
|
-
className:
|
|
9806
|
+
className: classNames(selected && 'text-ellipsis'),
|
|
9963
9807
|
children: secondary
|
|
9964
9808
|
});
|
|
9965
9809
|
return iconElement ? /*#__PURE__*/jsxs("div", {
|
|
@@ -10468,7 +10312,7 @@ function Select({
|
|
|
10468
10312
|
, {
|
|
10469
10313
|
className: classNames(s('tw-icon'), s('tw-chevron-up-icon'), s('tw-chevron'), s('bottom'), s('np-select-chevron'))
|
|
10470
10314
|
})]
|
|
10471
|
-
}), isMobile ? isSearchEnabled ? /*#__PURE__*/jsx(Drawer
|
|
10315
|
+
}), isMobile ? isSearchEnabled ? /*#__PURE__*/jsx(Drawer, {
|
|
10472
10316
|
open: open,
|
|
10473
10317
|
headerTitle: searchPlaceholder || formatMessage(messages$2.searchPlaceholder),
|
|
10474
10318
|
onClose: handleCloseOptions,
|
|
@@ -10606,15 +10450,13 @@ class Snackbar extends Component {
|
|
|
10606
10450
|
const {
|
|
10607
10451
|
action,
|
|
10608
10452
|
text,
|
|
10609
|
-
theme,
|
|
10610
10453
|
timestamp
|
|
10611
10454
|
} = this.props;
|
|
10612
10455
|
if (!previousProps.text) {
|
|
10613
10456
|
this.setState({
|
|
10614
10457
|
visible: true,
|
|
10615
10458
|
action,
|
|
10616
|
-
text
|
|
10617
|
-
theme
|
|
10459
|
+
text
|
|
10618
10460
|
}, () => {
|
|
10619
10461
|
this.setLeaveTimeout();
|
|
10620
10462
|
});
|
|
@@ -10628,8 +10470,7 @@ class Snackbar extends Component {
|
|
|
10628
10470
|
this.setState({
|
|
10629
10471
|
visible: true,
|
|
10630
10472
|
action,
|
|
10631
|
-
text
|
|
10632
|
-
theme
|
|
10473
|
+
text
|
|
10633
10474
|
});
|
|
10634
10475
|
this.setLeaveTimeout();
|
|
10635
10476
|
}, CSS_TRANSITION_DURATION);
|
|
@@ -10638,8 +10479,7 @@ class Snackbar extends Component {
|
|
|
10638
10479
|
this.setState({
|
|
10639
10480
|
visible: true,
|
|
10640
10481
|
action,
|
|
10641
|
-
text
|
|
10642
|
-
theme
|
|
10482
|
+
text
|
|
10643
10483
|
});
|
|
10644
10484
|
this.setLeaveTimeout();
|
|
10645
10485
|
}
|
|
@@ -10649,7 +10489,6 @@ class Snackbar extends Component {
|
|
|
10649
10489
|
const {
|
|
10650
10490
|
action,
|
|
10651
10491
|
text,
|
|
10652
|
-
theme = Theme.LIGHT,
|
|
10653
10492
|
visible
|
|
10654
10493
|
} = this.state;
|
|
10655
10494
|
const {
|
|
@@ -10670,7 +10509,7 @@ class Snackbar extends Component {
|
|
|
10670
10509
|
children: /*#__PURE__*/jsxs(Body, {
|
|
10671
10510
|
ref: this.bodyRef,
|
|
10672
10511
|
as: "span",
|
|
10673
|
-
className:
|
|
10512
|
+
className: "snackbar__text",
|
|
10674
10513
|
"aria-live": "polite",
|
|
10675
10514
|
children: [text, action ? /*#__PURE__*/jsx(ActionButton, {
|
|
10676
10515
|
className: "snackbar__text__action",
|
|
@@ -10729,19 +10568,21 @@ function SnackbarProvider({
|
|
|
10729
10568
|
});
|
|
10730
10569
|
}
|
|
10731
10570
|
|
|
10732
|
-
|
|
10571
|
+
const Sticky = ({
|
|
10572
|
+
children,
|
|
10733
10573
|
open = true,
|
|
10734
|
-
position =
|
|
10735
|
-
|
|
10736
|
-
}) {
|
|
10574
|
+
position = Position.BOTTOM,
|
|
10575
|
+
testId
|
|
10576
|
+
}) => {
|
|
10737
10577
|
return /*#__PURE__*/jsx(SlidingPanel, {
|
|
10578
|
+
testId: testId,
|
|
10738
10579
|
open: open,
|
|
10739
10580
|
position: position,
|
|
10740
10581
|
slidingPanelPositionFixed: true,
|
|
10741
10582
|
showSlidingPanelBorder: true,
|
|
10742
10583
|
children: children
|
|
10743
10584
|
});
|
|
10744
|
-
}
|
|
10585
|
+
};
|
|
10745
10586
|
|
|
10746
10587
|
var messages$1 = defineMessages({
|
|
10747
10588
|
statusNotDone: {
|
|
@@ -10922,9 +10763,7 @@ const stopPropagation = event => {
|
|
|
10922
10763
|
if (event) {
|
|
10923
10764
|
event.stopPropagation();
|
|
10924
10765
|
event.preventDefault();
|
|
10925
|
-
|
|
10926
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
10927
|
-
}
|
|
10766
|
+
event.nativeEvent?.stopImmediatePropagation?.();
|
|
10928
10767
|
}
|
|
10929
10768
|
};
|
|
10930
10769
|
const SwitchOption = ({
|
|
@@ -11126,7 +10965,7 @@ const SpacerWidth = {
|
|
|
11126
10965
|
lg: 32
|
|
11127
10966
|
};
|
|
11128
10967
|
class Tabs extends Component {
|
|
11129
|
-
/** @type {RefObject<HTMLDivElement>} */
|
|
10968
|
+
/** @type {React.RefObject<HTMLDivElement | null>} */
|
|
11130
10969
|
containerReference = /*#__PURE__*/createRef();
|
|
11131
10970
|
constructor(props) {
|
|
11132
10971
|
super(props);
|
|
@@ -11613,14 +11452,14 @@ Tabs.propTypes = {
|
|
|
11613
11452
|
disabled: PropTypes.bool.isRequired
|
|
11614
11453
|
})).isRequired,
|
|
11615
11454
|
selected: PropTypes.number.isRequired,
|
|
11616
|
-
onTabSelect: PropTypes.func.isRequired,
|
|
11617
11455
|
name: PropTypes.string.isRequired,
|
|
11618
11456
|
animatePanelsOnClick: PropTypes.bool,
|
|
11619
11457
|
changeTabOnSwipe: PropTypes.bool,
|
|
11620
11458
|
className: PropTypes.string,
|
|
11621
11459
|
transitionSpacing: PropTypes.oneOf(['default', 'xs', 'sm', 'md', 'lg']),
|
|
11622
11460
|
headerWidth: PropTypes.oneOf(['auto', 'block']),
|
|
11623
|
-
id: PropTypes.string
|
|
11461
|
+
id: PropTypes.string,
|
|
11462
|
+
onTabSelect: PropTypes.func.isRequired
|
|
11624
11463
|
};
|
|
11625
11464
|
Tabs.defaultProps = {
|
|
11626
11465
|
animatePanelsOnClick: false,
|
|
@@ -13162,13 +13001,8 @@ const UploadButton = ({
|
|
|
13162
13001
|
maxFiles,
|
|
13163
13002
|
onChange,
|
|
13164
13003
|
id = DEFAULT_FILE_INPUT_ID,
|
|
13165
|
-
uploadButtonTitle
|
|
13166
|
-
multipleFileInputWithFilesAdded
|
|
13004
|
+
uploadButtonTitle
|
|
13167
13005
|
}) => {
|
|
13168
|
-
const {
|
|
13169
|
-
isModern
|
|
13170
|
-
} = useTheme();
|
|
13171
|
-
useDirection();
|
|
13172
13006
|
const {
|
|
13173
13007
|
formatMessage
|
|
13174
13008
|
} = useIntl();
|
|
@@ -13231,7 +13065,7 @@ const UploadButton = ({
|
|
|
13231
13065
|
function getAcceptedTypes() {
|
|
13232
13066
|
const areAllFilesAllowed = getFileTypesDescription() === '*';
|
|
13233
13067
|
if (areAllFilesAllowed) {
|
|
13234
|
-
return {}; //file input by default allows all files
|
|
13068
|
+
return {}; // file input by default allows all files
|
|
13235
13069
|
}
|
|
13236
13070
|
if (Array.isArray(fileTypes)) {
|
|
13237
13071
|
return {
|
|
@@ -13243,17 +13077,13 @@ const UploadButton = ({
|
|
|
13243
13077
|
};
|
|
13244
13078
|
}
|
|
13245
13079
|
function renderDescription() {
|
|
13246
|
-
return /*#__PURE__*/
|
|
13247
|
-
|
|
13248
|
-
|
|
13249
|
-
|
|
13250
|
-
|
|
13251
|
-
|
|
13252
|
-
|
|
13253
|
-
children: [getDescription(), maxFiles && /*#__PURE__*/jsxs(Fragment, {
|
|
13254
|
-
children: [/*#__PURE__*/jsx("br", {}), `Maximum ${maxFiles} files.`]
|
|
13255
|
-
})]
|
|
13256
|
-
})
|
|
13080
|
+
return /*#__PURE__*/jsxs(Body, {
|
|
13081
|
+
className: classNames({
|
|
13082
|
+
'text-primary': !disabled
|
|
13083
|
+
}),
|
|
13084
|
+
children: [getDescription(), maxFiles && /*#__PURE__*/jsxs(Fragment, {
|
|
13085
|
+
children: [/*#__PURE__*/jsx("br", {}), `Maximum ${maxFiles} files.`]
|
|
13086
|
+
})]
|
|
13257
13087
|
});
|
|
13258
13088
|
}
|
|
13259
13089
|
function renderButtonTitle() {
|
|
@@ -13287,14 +13117,11 @@ const UploadButton = ({
|
|
|
13287
13117
|
onChange: filesSelected
|
|
13288
13118
|
}), /*#__PURE__*/jsx("label", {
|
|
13289
13119
|
htmlFor: id,
|
|
13290
|
-
className: classNames('btn', 'np-upload-
|
|
13291
|
-
disabled,
|
|
13292
|
-
'np-upload-input--square-top': multipleFileInputWithFilesAdded
|
|
13293
|
-
}),
|
|
13120
|
+
className: classNames('btn', 'np-upload-button'),
|
|
13294
13121
|
children: /*#__PURE__*/jsxs("div", {
|
|
13295
13122
|
className: "media",
|
|
13296
13123
|
children: [/*#__PURE__*/jsx("div", {
|
|
13297
|
-
className: "np-upload-icon media-left",
|
|
13124
|
+
className: "np-upload-icon media-middle media-left",
|
|
13298
13125
|
children: /*#__PURE__*/jsx(Upload$2, {
|
|
13299
13126
|
size: 24,
|
|
13300
13127
|
className: "text-link"
|
|
@@ -13310,9 +13137,7 @@ const UploadButton = ({
|
|
|
13310
13137
|
})]
|
|
13311
13138
|
})
|
|
13312
13139
|
}), isDropping && /*#__PURE__*/jsxs("div", {
|
|
13313
|
-
className: classNames('droppable-card', 'droppable-dropping-card', 'droppable-card-content',
|
|
13314
|
-
'np-upload-input--square-top': multipleFileInputWithFilesAdded
|
|
13315
|
-
}),
|
|
13140
|
+
className: classNames('droppable-card', 'droppable-dropping-card', 'droppable-card-content'),
|
|
13316
13141
|
children: [/*#__PURE__*/jsx(PlusCircle, {
|
|
13317
13142
|
className: "m-x-1",
|
|
13318
13143
|
size: 24
|
|
@@ -13359,7 +13184,7 @@ const UploadItemBody = ({
|
|
|
13359
13184
|
href: url,
|
|
13360
13185
|
target: "_blank",
|
|
13361
13186
|
rel: "noopener noreferrer",
|
|
13362
|
-
className: singleFileUpload ? 'np-upload-item--single-file' : '',
|
|
13187
|
+
className: singleFileUpload ? 'np-upload-item--single-file' : 'np-upload-item--link',
|
|
13363
13188
|
onClick: onDownload,
|
|
13364
13189
|
children: children
|
|
13365
13190
|
});
|
|
@@ -13384,20 +13209,15 @@ const UploadItem = ({
|
|
|
13384
13209
|
status,
|
|
13385
13210
|
filename,
|
|
13386
13211
|
error,
|
|
13212
|
+
errors,
|
|
13387
13213
|
url
|
|
13388
13214
|
} = file;
|
|
13389
|
-
const {
|
|
13390
|
-
isModern
|
|
13391
|
-
} = useTheme();
|
|
13392
13215
|
const isSucceeded = [Status.SUCCEEDED, undefined].includes(status) && !!url;
|
|
13393
13216
|
const getIcon = () => {
|
|
13394
|
-
if (error || status === Status.FAILED) {
|
|
13395
|
-
return
|
|
13217
|
+
if (error || errors?.length || status === Status.FAILED) {
|
|
13218
|
+
return /*#__PURE__*/jsx(StatusIcon, {
|
|
13396
13219
|
size: Size.SMALL,
|
|
13397
13220
|
sentiment: Sentiment.NEGATIVE
|
|
13398
|
-
}) : /*#__PURE__*/jsx(AlertCircle, {
|
|
13399
|
-
size: 24,
|
|
13400
|
-
className: "text-negative"
|
|
13401
13221
|
});
|
|
13402
13222
|
}
|
|
13403
13223
|
let processIndicator;
|
|
@@ -13412,31 +13232,37 @@ const UploadItem = ({
|
|
|
13412
13232
|
case Status.SUCCEEDED:
|
|
13413
13233
|
case Status.DONE:
|
|
13414
13234
|
default:
|
|
13415
|
-
processIndicator =
|
|
13235
|
+
processIndicator = /*#__PURE__*/jsx(StatusIcon, {
|
|
13416
13236
|
size: Size.SMALL,
|
|
13417
13237
|
sentiment: Sentiment.POSITIVE
|
|
13418
|
-
}) : /*#__PURE__*/jsx(ProcessIndicator, {
|
|
13419
|
-
size: Size.EXTRA_SMALL,
|
|
13420
|
-
status: Status.SUCCEEDED
|
|
13421
13238
|
});
|
|
13422
13239
|
}
|
|
13423
|
-
|
|
13424
|
-
|
|
13240
|
+
return processIndicator;
|
|
13241
|
+
};
|
|
13242
|
+
const getErrorMessage = error => typeof error === 'object' ? error.message : error || formatMessage(MESSAGES.uploadingFailed);
|
|
13243
|
+
const getMultipleErrors = errors => {
|
|
13244
|
+
if (!errors?.length) {
|
|
13245
|
+
return null;
|
|
13425
13246
|
}
|
|
13426
|
-
|
|
13427
|
-
|
|
13428
|
-
|
|
13429
|
-
|
|
13430
|
-
|
|
13431
|
-
|
|
13247
|
+
if (errors?.length === 1) {
|
|
13248
|
+
return getErrorMessage(errors[0]);
|
|
13249
|
+
}
|
|
13250
|
+
return /*#__PURE__*/jsx("ul", {
|
|
13251
|
+
className: "np-upload-input-errors m-b-0",
|
|
13252
|
+
children: errors.map((error, index) => {
|
|
13253
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
13254
|
+
return /*#__PURE__*/jsx("li", {
|
|
13255
|
+
children: getErrorMessage(error)
|
|
13256
|
+
}, index);
|
|
13257
|
+
})
|
|
13258
|
+
});
|
|
13432
13259
|
};
|
|
13433
|
-
const getErrorMessage = () => typeof error === 'object' ? error.message : error || formatMessage(MESSAGES.uploadingFailed);
|
|
13434
13260
|
const getDescription = () => {
|
|
13435
|
-
if (error || status === Status.FAILED) {
|
|
13261
|
+
if (error || errors?.length || status === Status.FAILED) {
|
|
13436
13262
|
return /*#__PURE__*/jsx(Body, {
|
|
13437
13263
|
type: Typography.BODY_DEFAULT_BOLD,
|
|
13438
13264
|
className: "text-negative",
|
|
13439
|
-
children: getErrorMessage()
|
|
13265
|
+
children: errors?.length ? getMultipleErrors(errors) : getErrorMessage(error)
|
|
13440
13266
|
});
|
|
13441
13267
|
}
|
|
13442
13268
|
switch (status) {
|
|
@@ -13506,7 +13332,7 @@ const UploadItem = ({
|
|
|
13506
13332
|
}),
|
|
13507
13333
|
type: "button",
|
|
13508
13334
|
onClick: () => onDelete(),
|
|
13509
|
-
children: /*#__PURE__*/jsx(
|
|
13335
|
+
children: /*#__PURE__*/jsx(Bin, {
|
|
13510
13336
|
size: 16
|
|
13511
13337
|
})
|
|
13512
13338
|
})]
|
|
@@ -13543,9 +13369,6 @@ const UploadInput = ({
|
|
|
13543
13369
|
sizeLimitErrorMessage,
|
|
13544
13370
|
uploadButtonTitle
|
|
13545
13371
|
}) => {
|
|
13546
|
-
const {
|
|
13547
|
-
isModern
|
|
13548
|
-
} = useTheme();
|
|
13549
13372
|
const [markedFileForDelete, setMarkedFileForDelete] = useState(null);
|
|
13550
13373
|
const [mounted, setMounted] = useState(false);
|
|
13551
13374
|
const {
|
|
@@ -13703,7 +13526,7 @@ const UploadInput = ({
|
|
|
13703
13526
|
return /*#__PURE__*/jsxs(Fragment, {
|
|
13704
13527
|
children: [/*#__PURE__*/jsxs("div", {
|
|
13705
13528
|
className: classNames('np-upload-input', className, {
|
|
13706
|
-
disabled
|
|
13529
|
+
disabled
|
|
13707
13530
|
}),
|
|
13708
13531
|
children: [uploadedFiles.map(file => /*#__PURE__*/jsx(UploadItem, {
|
|
13709
13532
|
file: file,
|
|
@@ -13720,7 +13543,6 @@ const UploadInput = ({
|
|
|
13720
13543
|
sizeLimit: sizeLimit,
|
|
13721
13544
|
description: description,
|
|
13722
13545
|
maxFiles: maxFiles,
|
|
13723
|
-
multipleFileInputWithFilesAdded: multiple && uploadedFiles.length > 0,
|
|
13724
13546
|
onChange: addFiles
|
|
13725
13547
|
})]
|
|
13726
13548
|
}), /*#__PURE__*/jsx(Modal, {
|
|
@@ -14767,5 +14589,5 @@ const translations = {
|
|
|
14767
14589
|
'zh-HK': zhHK
|
|
14768
14590
|
};
|
|
14769
14591
|
|
|
14770
|
-
export { Accordion, ActionButton, ActionOption, Alert, AlertArrowPosition, Avatar, AvatarType, AvatarWrapper, Badge, Card$
|
|
14592
|
+
export { Accordion, ActionButton, ActionOption, Alert, AlertArrowPosition, Avatar, AvatarType, AvatarWrapper, Badge, Card$1 as BaseCard, Body, BottomSheet$1 as BottomSheet, Breakpoint, Button, Card, Carousel, Checkbox, CheckboxButton, CheckboxOption, Chevron, Chip, Chips, CircularButton, ControlType, CriticalCommsBanner, DEFAULT_LANG, DEFAULT_LOCALE, DateInput, DateLookup$1 as DateLookup, DateMode, Decision, DecisionPresentation, DecisionType, DefinitionList, Dimmer$1 as Dimmer, Direction, DirectionProvider, Display, Drawer, DropFade, Emphasis, Field, FileType, FlowNavigation, Header, Image, Info, InfoPresentation, InlineAlert, Input, InputGroup, InputWithDisplayFormat, InstructionsList, Label, LanguageProvider, Layout, Link, ListItem$1 as ListItem, Loader, Logo, LogoType, Markdown, MarkdownNodeType, Modal, Money, MoneyInput$1 as MoneyInput, MonthFormat, NavigationOption, NavigationOptionList as NavigationOptionsList, Nudge, Option$2 as Option, OverlayHeader$1 as OverlayHeader, PhoneNumberInput, Popover$1 as Popover, Position, Priority, ProcessIndicator, ProfileType, Progress, ProgressBar, PromoCard$1 as PromoCard, PromoCardGroup$1 as PromoCardGroup, Provider, RTL_LANGUAGES, Radio, RadioGroup, RadioOption, SUPPORTED_LANGUAGES, Scroll, SearchInput, Section, SegmentedControl, Select, SelectInput, SelectInputOptionContent, SelectInputTriggerButton, Sentiment, Size, SlidingPanel, SnackbarConsumer, SnackbarContext, SnackbarPortal, SnackbarProvider, Status, StatusIcon, Stepper, Sticky, Summary, Switch, SwitchOption, Tabs$1 as Tabs, TextArea, TextareaWithDisplayFormat, Theme, Title, Tooltip, Type, Typeahead$1 as Typeahead, Typography, Upload$1 as Upload, UploadInput, UploadStep, Variant, Width, adjustLocale, getCountryFromLocale, getDirectionFromLocale, getLangFromLocale, isBrowser, isServerSide, translations, useDirection, useLayout, useScreenSize, useSnackbar };
|
|
14771
14593
|
//# sourceMappingURL=index.mjs.map
|