@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.js
CHANGED
|
@@ -5,7 +5,6 @@ var classNames = require('classnames');
|
|
|
5
5
|
var jsxRuntime = require('react/jsx-runtime');
|
|
6
6
|
var icons = require('@transferwise/icons');
|
|
7
7
|
var reactIntl = require('react-intl');
|
|
8
|
-
var PropTypes = require('prop-types');
|
|
9
8
|
var commonmark = require('commonmark');
|
|
10
9
|
var componentsTheming = require('@wise/components-theming');
|
|
11
10
|
var reactTransitionGroup = require('react-transition-group');
|
|
@@ -18,10 +17,10 @@ var mergeProps = require('merge-props');
|
|
|
18
17
|
var react = require('@floating-ui/react');
|
|
19
18
|
var overlays = require('@react-aria/overlays');
|
|
20
19
|
var reactPopper = require('react-popper');
|
|
20
|
+
var PropTypes = require('prop-types');
|
|
21
21
|
var art = require('@wise/art');
|
|
22
22
|
var clamp$2 = require('lodash.clamp');
|
|
23
23
|
var debounce = require('lodash.debounce');
|
|
24
|
-
var requiredIf = require('react-required-if');
|
|
25
24
|
var web = require('@react-spring/web');
|
|
26
25
|
|
|
27
26
|
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
@@ -46,12 +45,11 @@ function _interopNamespace(e) {
|
|
|
46
45
|
|
|
47
46
|
var React__namespace = /*#__PURE__*/_interopNamespace(React);
|
|
48
47
|
var classNames__default = /*#__PURE__*/_interopDefault(classNames);
|
|
49
|
-
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
50
48
|
var commonmark__default = /*#__PURE__*/_interopDefault(commonmark);
|
|
51
49
|
var mergeProps__default = /*#__PURE__*/_interopDefault(mergeProps);
|
|
50
|
+
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
52
51
|
var clamp__default = /*#__PURE__*/_interopDefault(clamp$2);
|
|
53
52
|
var debounce__default = /*#__PURE__*/_interopDefault(debounce);
|
|
54
|
-
var requiredIf__default = /*#__PURE__*/_interopDefault(requiredIf);
|
|
55
53
|
|
|
56
54
|
exports.Typography = void 0;
|
|
57
55
|
(function (Typography) {
|
|
@@ -860,21 +858,14 @@ function stripNodes({
|
|
|
860
858
|
}
|
|
861
859
|
|
|
862
860
|
const allowList = [exports.MarkdownNodeType.STRONG];
|
|
863
|
-
|
|
861
|
+
function InlineMarkdown(props) {
|
|
864
862
|
return /*#__PURE__*/jsxRuntime.jsx(Markdown, {
|
|
865
863
|
...props,
|
|
866
864
|
as: "span",
|
|
867
865
|
allowList: allowList,
|
|
868
866
|
blockList: undefined
|
|
869
867
|
});
|
|
870
|
-
}
|
|
871
|
-
InlineMarkdown.propTypes = {
|
|
872
|
-
children: PropTypes__default.default.string.isRequired,
|
|
873
|
-
className: PropTypes__default.default.string
|
|
874
|
-
};
|
|
875
|
-
InlineMarkdown.defaultProps = {
|
|
876
|
-
className: undefined
|
|
877
|
-
};
|
|
868
|
+
}
|
|
878
869
|
|
|
879
870
|
var messages$c = reactIntl.defineMessages({
|
|
880
871
|
opensInNewTab: {
|
|
@@ -1508,7 +1499,7 @@ const Button = /*#__PURE__*/React.forwardRef(({
|
|
|
1508
1499
|
});
|
|
1509
1500
|
});
|
|
1510
1501
|
|
|
1511
|
-
const Card$
|
|
1502
|
+
const Card$1 = /*#__PURE__*/React.forwardRef(({
|
|
1512
1503
|
className,
|
|
1513
1504
|
children = null,
|
|
1514
1505
|
id,
|
|
@@ -1541,7 +1532,7 @@ const Card$2 = /*#__PURE__*/React.forwardRef(({
|
|
|
1541
1532
|
}), children]
|
|
1542
1533
|
});
|
|
1543
1534
|
});
|
|
1544
|
-
Card$
|
|
1535
|
+
Card$1.displayName = 'Card';
|
|
1545
1536
|
|
|
1546
1537
|
function Display({
|
|
1547
1538
|
as: Heading = 'h1',
|
|
@@ -1920,7 +1911,7 @@ const PromoCard = /*#__PURE__*/React.forwardRef(({
|
|
|
1920
1911
|
React.useEffect(() => {
|
|
1921
1912
|
setChecked(defaultChecked ?? isChecked ?? false);
|
|
1922
1913
|
}, [defaultChecked, isChecked]);
|
|
1923
|
-
return /*#__PURE__*/jsxRuntime.jsxs(Card$
|
|
1914
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Card$1, {
|
|
1924
1915
|
...commonProps,
|
|
1925
1916
|
...checkedProps,
|
|
1926
1917
|
...props,
|
|
@@ -2217,20 +2208,19 @@ const isVisible = (container, el) => {
|
|
|
2217
2208
|
return elemLeft >= cScrollOffset && elemRight <= cScrollOffset + cWidth;
|
|
2218
2209
|
};
|
|
2219
2210
|
|
|
2220
|
-
const Card = /*#__PURE__*/React.forwardRef((
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
} = props;
|
|
2211
|
+
const Card = /*#__PURE__*/React.forwardRef(function Card({
|
|
2212
|
+
'aria-label': ariaLabel,
|
|
2213
|
+
as: Element = 'div',
|
|
2214
|
+
isExpanded,
|
|
2215
|
+
title,
|
|
2216
|
+
details,
|
|
2217
|
+
children,
|
|
2218
|
+
onClick,
|
|
2219
|
+
icon,
|
|
2220
|
+
id,
|
|
2221
|
+
className,
|
|
2222
|
+
'data-testid': dataTestId
|
|
2223
|
+
}, reference) {
|
|
2234
2224
|
const isOpen = !!(isExpanded && children);
|
|
2235
2225
|
return /*#__PURE__*/jsxRuntime.jsxs(Element, {
|
|
2236
2226
|
ref: reference,
|
|
@@ -2240,7 +2230,7 @@ const Card = /*#__PURE__*/React.forwardRef((props, reference) => {
|
|
|
2240
2230
|
'np-card--has-icon': !!icon
|
|
2241
2231
|
}),
|
|
2242
2232
|
id: id,
|
|
2243
|
-
"data-testid":
|
|
2233
|
+
"data-testid": dataTestId,
|
|
2244
2234
|
children: [/*#__PURE__*/jsxRuntime.jsx(Option$2, {
|
|
2245
2235
|
"aria-label": ariaLabel,
|
|
2246
2236
|
as: children ? 'button' : 'div',
|
|
@@ -2252,7 +2242,7 @@ const Card = /*#__PURE__*/React.forwardRef((props, reference) => {
|
|
|
2252
2242
|
button: children && /*#__PURE__*/jsxRuntime.jsx(Chevron, {
|
|
2253
2243
|
orientation: isOpen ? exports.Position.TOP : exports.Position.BOTTOM
|
|
2254
2244
|
}),
|
|
2255
|
-
onClick: () =>
|
|
2245
|
+
onClick: children ? () => onClick?.(!isExpanded) : undefined
|
|
2256
2246
|
}), /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2257
2247
|
className: classNames__default.default('np-card__divider', {
|
|
2258
2248
|
'np-card__divider--expanded': isOpen
|
|
@@ -2265,31 +2255,6 @@ const Card = /*#__PURE__*/React.forwardRef((props, reference) => {
|
|
|
2265
2255
|
})]
|
|
2266
2256
|
});
|
|
2267
2257
|
});
|
|
2268
|
-
const hasChildren = ({
|
|
2269
|
-
children
|
|
2270
|
-
}) => children;
|
|
2271
|
-
Card.propTypes = {
|
|
2272
|
-
'aria-label': PropTypes__default.default.string,
|
|
2273
|
-
as: PropTypes__default.default.string,
|
|
2274
|
-
isExpanded: requiredIf__default.default(PropTypes__default.default.bool, hasChildren),
|
|
2275
|
-
title: PropTypes__default.default.node.isRequired,
|
|
2276
|
-
details: PropTypes__default.default.node.isRequired,
|
|
2277
|
-
onClick: requiredIf__default.default(PropTypes__default.default.func, hasChildren),
|
|
2278
|
-
icon: PropTypes__default.default.node,
|
|
2279
|
-
children: PropTypes__default.default.node,
|
|
2280
|
-
id: PropTypes__default.default.string,
|
|
2281
|
-
className: PropTypes__default.default.string,
|
|
2282
|
-
'data-testid': PropTypes__default.default.string
|
|
2283
|
-
};
|
|
2284
|
-
Card.defaultProps = {
|
|
2285
|
-
'aria-label': undefined,
|
|
2286
|
-
as: 'div',
|
|
2287
|
-
children: null,
|
|
2288
|
-
id: null,
|
|
2289
|
-
className: null,
|
|
2290
|
-
'data-testid': null
|
|
2291
|
-
};
|
|
2292
|
-
var Card$1 = Card;
|
|
2293
2258
|
|
|
2294
2259
|
const CheckboxButton = /*#__PURE__*/React.forwardRef(({
|
|
2295
2260
|
checked,
|
|
@@ -2313,9 +2278,8 @@ const CheckboxButton = /*#__PURE__*/React.forwardRef(({
|
|
|
2313
2278
|
})
|
|
2314
2279
|
})]
|
|
2315
2280
|
}));
|
|
2316
|
-
var CheckboxButton$1 = CheckboxButton;
|
|
2317
2281
|
|
|
2318
|
-
|
|
2282
|
+
function Checkbox({
|
|
2319
2283
|
id,
|
|
2320
2284
|
checked,
|
|
2321
2285
|
required,
|
|
@@ -2327,14 +2291,11 @@ const Checkbox = ({
|
|
|
2327
2291
|
onChange,
|
|
2328
2292
|
onFocus,
|
|
2329
2293
|
onBlur
|
|
2330
|
-
})
|
|
2331
|
-
const {
|
|
2332
|
-
isModern
|
|
2333
|
-
} = componentsTheming.useTheme();
|
|
2294
|
+
}) {
|
|
2334
2295
|
const classList = classNames__default.default('np-checkbox', {
|
|
2335
2296
|
checkbox: true,
|
|
2336
2297
|
'checkbox-lg': secondary,
|
|
2337
|
-
disabled
|
|
2298
|
+
disabled
|
|
2338
2299
|
}, className);
|
|
2339
2300
|
const innerDisabled = disabled || readOnly;
|
|
2340
2301
|
return /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -2344,7 +2305,7 @@ const Checkbox = ({
|
|
|
2344
2305
|
className: classNames__default.default({
|
|
2345
2306
|
disabled
|
|
2346
2307
|
}),
|
|
2347
|
-
children: [/*#__PURE__*/jsxRuntime.jsx(CheckboxButton
|
|
2308
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(CheckboxButton, {
|
|
2348
2309
|
className: "p-r-2",
|
|
2349
2310
|
checked: checked,
|
|
2350
2311
|
disabled: innerDisabled,
|
|
@@ -2361,39 +2322,12 @@ const Checkbox = ({
|
|
|
2361
2322
|
children: label
|
|
2362
2323
|
}), secondary && /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
2363
2324
|
as: "span",
|
|
2364
|
-
className: classNames__default.default({
|
|
2365
|
-
secondary: !isModern
|
|
2366
|
-
}),
|
|
2367
2325
|
children: secondary
|
|
2368
2326
|
})]
|
|
2369
2327
|
})]
|
|
2370
2328
|
})
|
|
2371
2329
|
});
|
|
2372
|
-
}
|
|
2373
|
-
Checkbox.propTypes = {
|
|
2374
|
-
id: PropTypes__default.default.string,
|
|
2375
|
-
checked: PropTypes__default.default.bool,
|
|
2376
|
-
required: PropTypes__default.default.bool,
|
|
2377
|
-
disabled: PropTypes__default.default.bool,
|
|
2378
|
-
readOnly: PropTypes__default.default.bool,
|
|
2379
|
-
label: PropTypes__default.default.node.isRequired,
|
|
2380
|
-
secondary: PropTypes__default.default.string,
|
|
2381
|
-
onFocus: PropTypes__default.default.func,
|
|
2382
|
-
onChange: PropTypes__default.default.func.isRequired,
|
|
2383
|
-
onBlur: PropTypes__default.default.func,
|
|
2384
|
-
className: PropTypes__default.default.string
|
|
2385
|
-
};
|
|
2386
|
-
Checkbox.defaultProps = {
|
|
2387
|
-
id: null,
|
|
2388
|
-
checked: false,
|
|
2389
|
-
required: false,
|
|
2390
|
-
disabled: false,
|
|
2391
|
-
readOnly: false,
|
|
2392
|
-
secondary: null,
|
|
2393
|
-
onFocus: null,
|
|
2394
|
-
onBlur: null,
|
|
2395
|
-
className: undefined
|
|
2396
|
-
};
|
|
2330
|
+
}
|
|
2397
2331
|
|
|
2398
2332
|
const CheckboxOption = /*#__PURE__*/React.forwardRef(({
|
|
2399
2333
|
checked,
|
|
@@ -2405,7 +2339,7 @@ const CheckboxOption = /*#__PURE__*/React.forwardRef(({
|
|
|
2405
2339
|
...rest,
|
|
2406
2340
|
ref: reference,
|
|
2407
2341
|
disabled: disabled,
|
|
2408
|
-
button: /*#__PURE__*/jsxRuntime.jsx(CheckboxButton
|
|
2342
|
+
button: /*#__PURE__*/jsxRuntime.jsx(CheckboxButton, {
|
|
2409
2343
|
checked: checked,
|
|
2410
2344
|
disabled: disabled,
|
|
2411
2345
|
onChange: () => onChange?.(!checked)
|
|
@@ -2432,7 +2366,7 @@ const Chip = ({
|
|
|
2432
2366
|
isModern
|
|
2433
2367
|
} = componentsTheming.useTheme();
|
|
2434
2368
|
const closeButtonReference = React.useRef(null);
|
|
2435
|
-
const previousCloseButtonShown = React.useRef();
|
|
2369
|
+
const previousCloseButtonShown = React.useRef(undefined);
|
|
2436
2370
|
React.useEffect(() => {
|
|
2437
2371
|
if (closeButtonReference.current != null && previousCloseButtonShown.current === false) {
|
|
2438
2372
|
closeButtonReference.current?.focus();
|
|
@@ -2460,7 +2394,7 @@ const Chip = ({
|
|
|
2460
2394
|
}), onRemove ? /*#__PURE__*/jsxRuntime.jsx(CloseButton, {
|
|
2461
2395
|
ref: closeButtonReference,
|
|
2462
2396
|
className: isModern ? `btn-unstyled` : `btn-unstyled m-l-1`,
|
|
2463
|
-
"aria-label": closeButton
|
|
2397
|
+
"aria-label": closeButton?.['aria-label'],
|
|
2464
2398
|
size: "sm",
|
|
2465
2399
|
filled: isModern,
|
|
2466
2400
|
onClick: onRemove
|
|
@@ -2783,6 +2717,7 @@ const SlidingPanel = /*#__PURE__*/React.forwardRef(({
|
|
|
2783
2717
|
slidingPanelPositionFixed,
|
|
2784
2718
|
className,
|
|
2785
2719
|
children,
|
|
2720
|
+
testId,
|
|
2786
2721
|
...rest
|
|
2787
2722
|
}, reference) => {
|
|
2788
2723
|
const localReference = React.useRef(null);
|
|
@@ -2803,20 +2738,21 @@ const SlidingPanel = /*#__PURE__*/React.forwardRef(({
|
|
|
2803
2738
|
unmountOnExit: true
|
|
2804
2739
|
}, /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
2805
2740
|
ref: localReference,
|
|
2741
|
+
"data-testid": testId,
|
|
2806
2742
|
className: classNames__default.default('sliding-panel', `sliding-panel--open-${position}`, showSlidingPanelBorder && `sliding-panel--border-${position}`, slidingPanelPositionFixed && 'sliding-panel--fixed', className),
|
|
2807
2743
|
children: children
|
|
2808
2744
|
}));
|
|
2809
2745
|
});
|
|
2810
2746
|
|
|
2811
|
-
|
|
2747
|
+
function Drawer({
|
|
2812
2748
|
children,
|
|
2813
2749
|
className,
|
|
2814
2750
|
footerContent,
|
|
2815
2751
|
headerTitle,
|
|
2816
2752
|
onClose,
|
|
2817
|
-
open,
|
|
2818
|
-
position
|
|
2819
|
-
})
|
|
2753
|
+
open = false,
|
|
2754
|
+
position = 'right'
|
|
2755
|
+
}) {
|
|
2820
2756
|
logActionRequiredIf('Drawer now expects `onClose`, and will soon make this prop required. Please update your usage to provide it.', !onClose);
|
|
2821
2757
|
const {
|
|
2822
2758
|
isMobile
|
|
@@ -2854,32 +2790,7 @@ const Drawer = ({
|
|
|
2854
2790
|
})
|
|
2855
2791
|
})
|
|
2856
2792
|
});
|
|
2857
|
-
}
|
|
2858
|
-
Drawer.propTypes = {
|
|
2859
|
-
/** The content to appear in the drawer body. */
|
|
2860
|
-
children: PropTypes__default.default.node,
|
|
2861
|
-
className: PropTypes__default.default.string,
|
|
2862
|
-
/** The content to appear in the drawer footer. */
|
|
2863
|
-
footerContent: PropTypes__default.default.node,
|
|
2864
|
-
/** The content to appear in the drawer header. */
|
|
2865
|
-
headerTitle: PropTypes__default.default.node,
|
|
2866
|
-
/** The status of Drawer either open or not. */
|
|
2867
|
-
open: PropTypes__default.default.bool,
|
|
2868
|
-
/** The placement of Drawer on the screen either left or right. On mobile it will default to bottom. */
|
|
2869
|
-
position: PropTypes__default.default.oneOf(['left', 'right', 'bottom']),
|
|
2870
|
-
/** The action to perform on close click. */
|
|
2871
|
-
onClose: PropTypes__default.default.func
|
|
2872
|
-
};
|
|
2873
|
-
Drawer.defaultProps = {
|
|
2874
|
-
children: null,
|
|
2875
|
-
className: undefined,
|
|
2876
|
-
footerContent: null,
|
|
2877
|
-
headerTitle: null,
|
|
2878
|
-
onClose: null,
|
|
2879
|
-
open: false,
|
|
2880
|
-
position: exports.Position.RIGHT
|
|
2881
|
-
};
|
|
2882
|
-
var Drawer$1 = Drawer;
|
|
2793
|
+
}
|
|
2883
2794
|
|
|
2884
2795
|
const INITIAL_Y_POSITION = 0;
|
|
2885
2796
|
const CONTENT_SCROLL_THRESHOLD = 1;
|
|
@@ -3009,7 +2920,7 @@ const BottomSheet$1 = props => {
|
|
|
3009
2920
|
};
|
|
3010
2921
|
}
|
|
3011
2922
|
const is400Zoom = useMedia(`(max-width: ${exports.Breakpoint.ZOOM_400}px)`);
|
|
3012
|
-
return is400Zoom ? /*#__PURE__*/jsxRuntime.jsx(Drawer
|
|
2923
|
+
return is400Zoom ? /*#__PURE__*/jsxRuntime.jsx(Drawer, {
|
|
3013
2924
|
open: props.open,
|
|
3014
2925
|
className: props.className,
|
|
3015
2926
|
onClose: close,
|
|
@@ -4680,7 +4591,7 @@ const NavigationOption = /*#__PURE__*/React.forwardRef(({
|
|
|
4680
4591
|
});
|
|
4681
4592
|
});
|
|
4682
4593
|
|
|
4683
|
-
|
|
4594
|
+
function Tile({
|
|
4684
4595
|
className,
|
|
4685
4596
|
description,
|
|
4686
4597
|
disabled,
|
|
@@ -4688,10 +4599,10 @@ const Tile = ({
|
|
|
4688
4599
|
target,
|
|
4689
4600
|
media,
|
|
4690
4601
|
onClick,
|
|
4691
|
-
size,
|
|
4602
|
+
size = 'md',
|
|
4692
4603
|
title
|
|
4693
|
-
})
|
|
4694
|
-
const isSmall = size ===
|
|
4604
|
+
}) {
|
|
4605
|
+
const isSmall = size === 'sm';
|
|
4695
4606
|
const Element = href ? 'a' : 'button';
|
|
4696
4607
|
return /*#__PURE__*/jsxRuntime.jsxs(Element, {
|
|
4697
4608
|
className: classNames__default.default('decision', 'flex-column', 'np-tile', 'text-no-decoration', 'text-xs-center', className, {
|
|
@@ -4700,12 +4611,12 @@ const Tile = ({
|
|
|
4700
4611
|
}, disabled && 'disabled'),
|
|
4701
4612
|
href: href,
|
|
4702
4613
|
target: target,
|
|
4703
|
-
onClick: disabled ?
|
|
4704
|
-
onKeyDown: disabled ?
|
|
4614
|
+
onClick: disabled ? undefined : onClick,
|
|
4615
|
+
onKeyDown: disabled ? undefined : ({
|
|
4705
4616
|
key
|
|
4706
4617
|
}) => {
|
|
4707
4618
|
if (key === 'Enter' || key === ' ') {
|
|
4708
|
-
onClick();
|
|
4619
|
+
onClick?.();
|
|
4709
4620
|
}
|
|
4710
4621
|
},
|
|
4711
4622
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
@@ -4722,29 +4633,7 @@ const Tile = ({
|
|
|
4722
4633
|
children: description
|
|
4723
4634
|
}) : null]
|
|
4724
4635
|
});
|
|
4725
|
-
}
|
|
4726
|
-
Tile.propTypes = {
|
|
4727
|
-
/** Classes to apply to the Tile container */
|
|
4728
|
-
className: PropTypes__default.default.string,
|
|
4729
|
-
description: PropTypes__default.default.node,
|
|
4730
|
-
disabled: PropTypes__default.default.bool,
|
|
4731
|
-
href: PropTypes__default.default.string,
|
|
4732
|
-
target: PropTypes__default.default.oneOf(['_self', '_blank', '_parent', '_top']),
|
|
4733
|
-
/** Accepts only Avatar and images */
|
|
4734
|
-
media: PropTypes__default.default.node.isRequired,
|
|
4735
|
-
/** Function called onClick or onKeyDown */
|
|
4736
|
-
onClick: PropTypes__default.default.func,
|
|
4737
|
-
/** The size applied to Tile */
|
|
4738
|
-
size: PropTypes__default.default.oneOf(['sm', 'md']),
|
|
4739
|
-
title: PropTypes__default.default.node.isRequired
|
|
4740
|
-
};
|
|
4741
|
-
Tile.defaultProps = {
|
|
4742
|
-
className: '',
|
|
4743
|
-
description: null,
|
|
4744
|
-
disabled: false,
|
|
4745
|
-
size: exports.Size.MEDIUM,
|
|
4746
|
-
target: undefined
|
|
4747
|
-
};
|
|
4636
|
+
}
|
|
4748
4637
|
|
|
4749
4638
|
exports.DecisionPresentation = void 0;
|
|
4750
4639
|
(function (DecisionPresentation) {
|
|
@@ -4836,9 +4725,9 @@ const Decision = ({
|
|
|
4836
4725
|
return null;
|
|
4837
4726
|
};
|
|
4838
4727
|
|
|
4839
|
-
const isLayoutHorizontal = layout =>
|
|
4728
|
+
const isLayoutHorizontal = layout => layout === exports.Layout.HORIZONTAL_LEFT_ALIGNED || layout === exports.Layout.HORIZONTAL_RIGHT_ALIGNED || layout === exports.Layout.HORIZONTAL_JUSTIFIED;
|
|
4840
4729
|
const getAlignmentClasses = (layout, action) => {
|
|
4841
|
-
|
|
4730
|
+
const classes = ['d-flex'];
|
|
4842
4731
|
if (action) {
|
|
4843
4732
|
if (isLayoutHorizontal(layout)) {
|
|
4844
4733
|
classes.push('align-items-center');
|
|
@@ -4856,60 +4745,44 @@ const getAlignmentClasses = (layout, action) => {
|
|
|
4856
4745
|
}
|
|
4857
4746
|
return classes;
|
|
4858
4747
|
};
|
|
4859
|
-
const
|
|
4860
|
-
|
|
4861
|
-
|
|
4748
|
+
const defaultDefinitions = [];
|
|
4749
|
+
function DefinitionList({
|
|
4750
|
+
definitions = defaultDefinitions,
|
|
4751
|
+
layout = 'VERTICAL_TWO_COLUMN',
|
|
4862
4752
|
muted
|
|
4863
|
-
})
|
|
4864
|
-
|
|
4865
|
-
'
|
|
4866
|
-
|
|
4867
|
-
|
|
4868
|
-
|
|
4869
|
-
|
|
4870
|
-
children: definitions.filter(definition => definition).map(({
|
|
4871
|
-
action,
|
|
4872
|
-
title,
|
|
4873
|
-
value,
|
|
4874
|
-
key
|
|
4875
|
-
}) => /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4876
|
-
className: "tw-definition-list__item",
|
|
4877
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("dt", {
|
|
4878
|
-
children: title
|
|
4879
|
-
}), /*#__PURE__*/jsxRuntime.jsxs("dd", {
|
|
4880
|
-
className: classNames__default.default(...getAlignmentClasses(layout, action)),
|
|
4881
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4882
|
-
children: value
|
|
4883
|
-
}), action ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4884
|
-
className: classNames__default.default(isLayoutHorizontal(layout) ? 'p-l-2' : 'p-x-2', 'tw-definition-list__action'),
|
|
4885
|
-
children: /*#__PURE__*/jsxRuntime.jsx(ActionButton, {
|
|
4886
|
-
className: "tw-definition-list__button",
|
|
4887
|
-
onClick: action.onClick,
|
|
4888
|
-
children: action.label
|
|
4889
|
-
})
|
|
4890
|
-
}) : null]
|
|
4891
|
-
})]
|
|
4892
|
-
}, key))
|
|
4893
|
-
});
|
|
4894
|
-
DefinitionList.propTypes = {
|
|
4895
|
-
definitions: PropTypes__default.default.arrayOf(PropTypes__default.default.shape({
|
|
4896
|
-
action: PropTypes__default.default.shape({
|
|
4897
|
-
label: PropTypes__default.default.string.isRequired,
|
|
4898
|
-
onClick: PropTypes__default.default.func
|
|
4753
|
+
}) {
|
|
4754
|
+
return /*#__PURE__*/jsxRuntime.jsx("dl", {
|
|
4755
|
+
className: classNames__default.default('tw-definition-list d-flex ', {
|
|
4756
|
+
'text-muted': muted,
|
|
4757
|
+
'flex-column': layout === exports.Layout.VERTICAL_ONE_COLUMN,
|
|
4758
|
+
'tw-definition-list--columns flex-column flex-row--sm': layout === exports.Layout.VERTICAL_TWO_COLUMN,
|
|
4759
|
+
'tw-definition-list--horizontal flex-column': isLayoutHorizontal(layout)
|
|
4899
4760
|
}),
|
|
4900
|
-
|
|
4901
|
-
|
|
4902
|
-
|
|
4903
|
-
|
|
4904
|
-
|
|
4905
|
-
|
|
4906
|
-
|
|
4907
|
-
|
|
4908
|
-
|
|
4909
|
-
|
|
4910
|
-
|
|
4911
|
-
|
|
4912
|
-
|
|
4761
|
+
children: definitions.filter(definition => definition).map(({
|
|
4762
|
+
action,
|
|
4763
|
+
title,
|
|
4764
|
+
value,
|
|
4765
|
+
key
|
|
4766
|
+
}) => /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
4767
|
+
className: "tw-definition-list__item",
|
|
4768
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("dt", {
|
|
4769
|
+
children: title
|
|
4770
|
+
}), /*#__PURE__*/jsxRuntime.jsxs("dd", {
|
|
4771
|
+
className: classNames__default.default(...getAlignmentClasses(layout, action)),
|
|
4772
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4773
|
+
children: value
|
|
4774
|
+
}), action ? /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
4775
|
+
className: classNames__default.default(isLayoutHorizontal(layout) ? 'p-l-2' : 'p-x-2', 'tw-definition-list__action'),
|
|
4776
|
+
children: /*#__PURE__*/jsxRuntime.jsx(ActionButton, {
|
|
4777
|
+
className: "tw-definition-list__button",
|
|
4778
|
+
onClick: action.onClick,
|
|
4779
|
+
children: action.label
|
|
4780
|
+
})
|
|
4781
|
+
}) : null]
|
|
4782
|
+
})]
|
|
4783
|
+
}, key))
|
|
4784
|
+
});
|
|
4785
|
+
}
|
|
4913
4786
|
|
|
4914
4787
|
const DropFade = ({
|
|
4915
4788
|
children,
|
|
@@ -5098,14 +4971,6 @@ const FlowHeader = /*#__PURE__*/React__namespace.forwardRef(({
|
|
|
5098
4971
|
});
|
|
5099
4972
|
});
|
|
5100
4973
|
|
|
5101
|
-
// TODO: consider to move this enum into component file once we migrate it on TypeScript or replace with some common enum
|
|
5102
|
-
exports.LogoType = void 0;
|
|
5103
|
-
(function (LogoType) {
|
|
5104
|
-
LogoType["WISE"] = "WISE";
|
|
5105
|
-
LogoType["WISE_BUSINESS"] = "WISE_BUSINESS";
|
|
5106
|
-
LogoType["WISE_PLATFORM"] = "WISE_PLATFORM";
|
|
5107
|
-
})(exports.LogoType || (exports.LogoType = {}));
|
|
5108
|
-
|
|
5109
4974
|
var LogoFlagInverse = function LogoFlagInverse(props) {
|
|
5110
4975
|
return /*#__PURE__*/jsxRuntime.jsx("svg", {
|
|
5111
4976
|
...props,
|
|
@@ -5238,15 +5103,26 @@ const svgPaths = {
|
|
|
5238
5103
|
WISE_FLAG_PLATFORM: LogoFlagPlatform,
|
|
5239
5104
|
WISE_FLAG_PLATFORM_INVERSE: LogoFlagPlatformInverse
|
|
5240
5105
|
};
|
|
5241
|
-
|
|
5106
|
+
exports.LogoType = void 0;
|
|
5107
|
+
(function (LogoType) {
|
|
5108
|
+
LogoType["WISE"] = "WISE";
|
|
5109
|
+
LogoType["WISE_BUSINESS"] = "WISE_BUSINESS";
|
|
5110
|
+
LogoType["WISE_PLATFORM"] = "WISE_PLATFORM";
|
|
5111
|
+
})(exports.LogoType || (exports.LogoType = {}));
|
|
5112
|
+
const labelByType = {
|
|
5113
|
+
WISE: 'Wise',
|
|
5114
|
+
WISE_BUSINESS: 'Wise Business',
|
|
5115
|
+
WISE_PLATFORM: 'Wise Platform'
|
|
5116
|
+
};
|
|
5117
|
+
function Logo({
|
|
5242
5118
|
className,
|
|
5243
5119
|
inverse,
|
|
5244
|
-
type
|
|
5245
|
-
})
|
|
5246
|
-
const LogoSm = svgPaths[`WISE_FLAG${type ===
|
|
5120
|
+
type = 'WISE'
|
|
5121
|
+
}) {
|
|
5122
|
+
const LogoSm = svgPaths[`WISE_FLAG${type === 'WISE_PLATFORM' ? '_PLATFORM' : ''}${inverse ? '_INVERSE' : ''}`];
|
|
5247
5123
|
const LogoMd = svgPaths[`${type}${inverse ? '_INVERSE' : ''}`];
|
|
5248
5124
|
return /*#__PURE__*/jsxRuntime.jsxs("span", {
|
|
5249
|
-
"aria-label": type
|
|
5125
|
+
"aria-label": labelByType[type],
|
|
5250
5126
|
role: "img",
|
|
5251
5127
|
className: classNames__default.default(className, 'np-logo'),
|
|
5252
5128
|
children: [/*#__PURE__*/jsxRuntime.jsx(LogoSm, {
|
|
@@ -5255,21 +5131,7 @@ const Logo = ({
|
|
|
5255
5131
|
className: "np-logo-svg np-logo-svg--size-md"
|
|
5256
5132
|
})]
|
|
5257
5133
|
});
|
|
5258
|
-
}
|
|
5259
|
-
Logo.propTypes = {
|
|
5260
|
-
/** Extra classes applied to Logo */
|
|
5261
|
-
className: PropTypes__default.default.string,
|
|
5262
|
-
/** If true, will use dark colours for dark on light theme */
|
|
5263
|
-
inverse: PropTypes__default.default.bool,
|
|
5264
|
-
/** What type of logo to display */
|
|
5265
|
-
type: PropTypes__default.default.oneOf(['WISE', 'WISE_BUSINESS', 'WISE_PLATFORM'])
|
|
5266
|
-
};
|
|
5267
|
-
Logo.defaultProps = {
|
|
5268
|
-
className: undefined,
|
|
5269
|
-
inverse: false,
|
|
5270
|
-
type: exports.LogoType.WISE
|
|
5271
|
-
};
|
|
5272
|
-
var Logo$1 = Logo;
|
|
5134
|
+
}
|
|
5273
5135
|
|
|
5274
5136
|
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
5275
5137
|
const Tooltip = ({
|
|
@@ -5499,7 +5361,7 @@ BackButton.defaultProps = {
|
|
|
5499
5361
|
const FlowNavigation = ({
|
|
5500
5362
|
activeStep = 0,
|
|
5501
5363
|
avatar,
|
|
5502
|
-
logo = /*#__PURE__*/jsxRuntime.jsx(Logo
|
|
5364
|
+
logo = /*#__PURE__*/jsxRuntime.jsx(Logo, {}),
|
|
5503
5365
|
done = false,
|
|
5504
5366
|
onClose,
|
|
5505
5367
|
onGoBack,
|
|
@@ -5651,7 +5513,7 @@ const Modal = ({
|
|
|
5651
5513
|
const noDivider = checkSpecialClasses('no-divider');
|
|
5652
5514
|
const contentReference = React.useRef(null);
|
|
5653
5515
|
const titleId = React.useId();
|
|
5654
|
-
return !isMedium ? /*#__PURE__*/jsxRuntime.jsx(Drawer
|
|
5516
|
+
return !isMedium ? /*#__PURE__*/jsxRuntime.jsx(Drawer, {
|
|
5655
5517
|
open: open,
|
|
5656
5518
|
headerTitle: title,
|
|
5657
5519
|
footerContent: footer,
|
|
@@ -6097,7 +5959,7 @@ const getCursorPositionAfterActionStroke = (action, selectionStart, selectionEnd
|
|
|
6097
5959
|
return cursorPosition;
|
|
6098
5960
|
};
|
|
6099
5961
|
|
|
6100
|
-
class WithDisplayFormat extends
|
|
5962
|
+
class WithDisplayFormat extends React__namespace.Component {
|
|
6101
5963
|
static defaultProps = {
|
|
6102
5964
|
autoComplete: 'off',
|
|
6103
5965
|
displayPattern: '',
|
|
@@ -7926,7 +7788,7 @@ const OverlayHeader = ({
|
|
|
7926
7788
|
};
|
|
7927
7789
|
OverlayHeader.defaultProps = {
|
|
7928
7790
|
avatar: null,
|
|
7929
|
-
logo: /*#__PURE__*/jsxRuntime.jsx(Logo
|
|
7791
|
+
logo: /*#__PURE__*/jsxRuntime.jsx(Logo, {}),
|
|
7930
7792
|
onClose: null
|
|
7931
7793
|
};
|
|
7932
7794
|
OverlayHeader.propTypes = {
|
|
@@ -9452,16 +9314,11 @@ const Progress = ({
|
|
|
9452
9314
|
id,
|
|
9453
9315
|
progress
|
|
9454
9316
|
}) => {
|
|
9455
|
-
const [value, setValue] = React.useState(0);
|
|
9456
|
-
React.useEffect(() => {
|
|
9457
|
-
setValue(progress.value);
|
|
9458
|
-
});
|
|
9459
9317
|
return /*#__PURE__*/jsxRuntime.jsxs("progress", {
|
|
9460
9318
|
id: id,
|
|
9461
9319
|
className: classNames__default.default('np-progress d-block', className),
|
|
9462
9320
|
...progress,
|
|
9463
|
-
|
|
9464
|
-
children: [value, "%"]
|
|
9321
|
+
children: [Math.floor(progress.value / progress.max * 100), "%"]
|
|
9465
9322
|
});
|
|
9466
9323
|
};
|
|
9467
9324
|
|
|
@@ -9955,12 +9812,8 @@ function Option$1({
|
|
|
9955
9812
|
note = '',
|
|
9956
9813
|
secondary = '',
|
|
9957
9814
|
icon,
|
|
9958
|
-
classNames = {},
|
|
9959
9815
|
selected = false
|
|
9960
9816
|
}) {
|
|
9961
|
-
const {
|
|
9962
|
-
isModern
|
|
9963
|
-
} = componentsTheming.useTheme();
|
|
9964
9817
|
const iconElement = icon ? /*#__PURE__*/React.cloneElement(icon, {
|
|
9965
9818
|
size: 24,
|
|
9966
9819
|
className: 'tw-icon'
|
|
@@ -9974,22 +9827,12 @@ function Option$1({
|
|
|
9974
9827
|
className: selected ? 'text-ellipsis' : undefined,
|
|
9975
9828
|
children: [label, note && /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
9976
9829
|
as: "span",
|
|
9977
|
-
className:
|
|
9830
|
+
className: "m-l-1",
|
|
9978
9831
|
children: note
|
|
9979
9832
|
})]
|
|
9980
9833
|
});
|
|
9981
|
-
const secondaryElementClassNames = () => {
|
|
9982
|
-
let classes = undefined;
|
|
9983
|
-
if (selected) {
|
|
9984
|
-
classes = 'text-ellipsis';
|
|
9985
|
-
}
|
|
9986
|
-
if (isModern) {
|
|
9987
|
-
return classes;
|
|
9988
|
-
}
|
|
9989
|
-
return `${classes ? classes + ' ' : ''}body-2`;
|
|
9990
|
-
};
|
|
9991
9834
|
const secondaryElement = secondary && /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
9992
|
-
className:
|
|
9835
|
+
className: classNames__default.default(selected && 'text-ellipsis'),
|
|
9993
9836
|
children: secondary
|
|
9994
9837
|
});
|
|
9995
9838
|
return iconElement ? /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
@@ -10498,7 +10341,7 @@ function Select({
|
|
|
10498
10341
|
, {
|
|
10499
10342
|
className: classNames__default.default(s('tw-icon'), s('tw-chevron-up-icon'), s('tw-chevron'), s('bottom'), s('np-select-chevron'))
|
|
10500
10343
|
})]
|
|
10501
|
-
}), isMobile ? isSearchEnabled ? /*#__PURE__*/jsxRuntime.jsx(Drawer
|
|
10344
|
+
}), isMobile ? isSearchEnabled ? /*#__PURE__*/jsxRuntime.jsx(Drawer, {
|
|
10502
10345
|
open: open,
|
|
10503
10346
|
headerTitle: searchPlaceholder || formatMessage(messages$2.searchPlaceholder),
|
|
10504
10347
|
onClose: handleCloseOptions,
|
|
@@ -10636,15 +10479,13 @@ class Snackbar extends React.Component {
|
|
|
10636
10479
|
const {
|
|
10637
10480
|
action,
|
|
10638
10481
|
text,
|
|
10639
|
-
theme,
|
|
10640
10482
|
timestamp
|
|
10641
10483
|
} = this.props;
|
|
10642
10484
|
if (!previousProps.text) {
|
|
10643
10485
|
this.setState({
|
|
10644
10486
|
visible: true,
|
|
10645
10487
|
action,
|
|
10646
|
-
text
|
|
10647
|
-
theme
|
|
10488
|
+
text
|
|
10648
10489
|
}, () => {
|
|
10649
10490
|
this.setLeaveTimeout();
|
|
10650
10491
|
});
|
|
@@ -10658,8 +10499,7 @@ class Snackbar extends React.Component {
|
|
|
10658
10499
|
this.setState({
|
|
10659
10500
|
visible: true,
|
|
10660
10501
|
action,
|
|
10661
|
-
text
|
|
10662
|
-
theme
|
|
10502
|
+
text
|
|
10663
10503
|
});
|
|
10664
10504
|
this.setLeaveTimeout();
|
|
10665
10505
|
}, CSS_TRANSITION_DURATION);
|
|
@@ -10668,8 +10508,7 @@ class Snackbar extends React.Component {
|
|
|
10668
10508
|
this.setState({
|
|
10669
10509
|
visible: true,
|
|
10670
10510
|
action,
|
|
10671
|
-
text
|
|
10672
|
-
theme
|
|
10511
|
+
text
|
|
10673
10512
|
});
|
|
10674
10513
|
this.setLeaveTimeout();
|
|
10675
10514
|
}
|
|
@@ -10679,7 +10518,6 @@ class Snackbar extends React.Component {
|
|
|
10679
10518
|
const {
|
|
10680
10519
|
action,
|
|
10681
10520
|
text,
|
|
10682
|
-
theme = exports.Theme.LIGHT,
|
|
10683
10521
|
visible
|
|
10684
10522
|
} = this.state;
|
|
10685
10523
|
const {
|
|
@@ -10700,7 +10538,7 @@ class Snackbar extends React.Component {
|
|
|
10700
10538
|
children: /*#__PURE__*/jsxRuntime.jsxs(Body, {
|
|
10701
10539
|
ref: this.bodyRef,
|
|
10702
10540
|
as: "span",
|
|
10703
|
-
className:
|
|
10541
|
+
className: "snackbar__text",
|
|
10704
10542
|
"aria-live": "polite",
|
|
10705
10543
|
children: [text, action ? /*#__PURE__*/jsxRuntime.jsx(ActionButton, {
|
|
10706
10544
|
className: "snackbar__text__action",
|
|
@@ -10759,19 +10597,21 @@ function SnackbarProvider({
|
|
|
10759
10597
|
});
|
|
10760
10598
|
}
|
|
10761
10599
|
|
|
10762
|
-
|
|
10600
|
+
const Sticky = ({
|
|
10601
|
+
children,
|
|
10763
10602
|
open = true,
|
|
10764
|
-
position =
|
|
10765
|
-
|
|
10766
|
-
}) {
|
|
10603
|
+
position = exports.Position.BOTTOM,
|
|
10604
|
+
testId
|
|
10605
|
+
}) => {
|
|
10767
10606
|
return /*#__PURE__*/jsxRuntime.jsx(SlidingPanel, {
|
|
10607
|
+
testId: testId,
|
|
10768
10608
|
open: open,
|
|
10769
10609
|
position: position,
|
|
10770
10610
|
slidingPanelPositionFixed: true,
|
|
10771
10611
|
showSlidingPanelBorder: true,
|
|
10772
10612
|
children: children
|
|
10773
10613
|
});
|
|
10774
|
-
}
|
|
10614
|
+
};
|
|
10775
10615
|
|
|
10776
10616
|
var messages$1 = reactIntl.defineMessages({
|
|
10777
10617
|
statusNotDone: {
|
|
@@ -10952,9 +10792,7 @@ const stopPropagation = event => {
|
|
|
10952
10792
|
if (event) {
|
|
10953
10793
|
event.stopPropagation();
|
|
10954
10794
|
event.preventDefault();
|
|
10955
|
-
|
|
10956
|
-
event.nativeEvent.stopImmediatePropagation();
|
|
10957
|
-
}
|
|
10795
|
+
event.nativeEvent?.stopImmediatePropagation?.();
|
|
10958
10796
|
}
|
|
10959
10797
|
};
|
|
10960
10798
|
const SwitchOption = ({
|
|
@@ -11156,7 +10994,7 @@ const SpacerWidth = {
|
|
|
11156
10994
|
lg: 32
|
|
11157
10995
|
};
|
|
11158
10996
|
class Tabs extends React.Component {
|
|
11159
|
-
/** @type {RefObject<HTMLDivElement>} */
|
|
10997
|
+
/** @type {React.RefObject<HTMLDivElement | null>} */
|
|
11160
10998
|
containerReference = /*#__PURE__*/React.createRef();
|
|
11161
10999
|
constructor(props) {
|
|
11162
11000
|
super(props);
|
|
@@ -11643,14 +11481,14 @@ Tabs.propTypes = {
|
|
|
11643
11481
|
disabled: PropTypes__default.default.bool.isRequired
|
|
11644
11482
|
})).isRequired,
|
|
11645
11483
|
selected: PropTypes__default.default.number.isRequired,
|
|
11646
|
-
onTabSelect: PropTypes__default.default.func.isRequired,
|
|
11647
11484
|
name: PropTypes__default.default.string.isRequired,
|
|
11648
11485
|
animatePanelsOnClick: PropTypes__default.default.bool,
|
|
11649
11486
|
changeTabOnSwipe: PropTypes__default.default.bool,
|
|
11650
11487
|
className: PropTypes__default.default.string,
|
|
11651
11488
|
transitionSpacing: PropTypes__default.default.oneOf(['default', 'xs', 'sm', 'md', 'lg']),
|
|
11652
11489
|
headerWidth: PropTypes__default.default.oneOf(['auto', 'block']),
|
|
11653
|
-
id: PropTypes__default.default.string
|
|
11490
|
+
id: PropTypes__default.default.string,
|
|
11491
|
+
onTabSelect: PropTypes__default.default.func.isRequired
|
|
11654
11492
|
};
|
|
11655
11493
|
Tabs.defaultProps = {
|
|
11656
11494
|
animatePanelsOnClick: false,
|
|
@@ -13192,13 +13030,8 @@ const UploadButton = ({
|
|
|
13192
13030
|
maxFiles,
|
|
13193
13031
|
onChange,
|
|
13194
13032
|
id = DEFAULT_FILE_INPUT_ID,
|
|
13195
|
-
uploadButtonTitle
|
|
13196
|
-
multipleFileInputWithFilesAdded
|
|
13033
|
+
uploadButtonTitle
|
|
13197
13034
|
}) => {
|
|
13198
|
-
const {
|
|
13199
|
-
isModern
|
|
13200
|
-
} = componentsTheming.useTheme();
|
|
13201
|
-
useDirection();
|
|
13202
13035
|
const {
|
|
13203
13036
|
formatMessage
|
|
13204
13037
|
} = reactIntl.useIntl();
|
|
@@ -13261,7 +13094,7 @@ const UploadButton = ({
|
|
|
13261
13094
|
function getAcceptedTypes() {
|
|
13262
13095
|
const areAllFilesAllowed = getFileTypesDescription() === '*';
|
|
13263
13096
|
if (areAllFilesAllowed) {
|
|
13264
|
-
return {}; //file input by default allows all files
|
|
13097
|
+
return {}; // file input by default allows all files
|
|
13265
13098
|
}
|
|
13266
13099
|
if (Array.isArray(fileTypes)) {
|
|
13267
13100
|
return {
|
|
@@ -13273,17 +13106,13 @@ const UploadButton = ({
|
|
|
13273
13106
|
};
|
|
13274
13107
|
}
|
|
13275
13108
|
function renderDescription() {
|
|
13276
|
-
return /*#__PURE__*/jsxRuntime.
|
|
13277
|
-
|
|
13278
|
-
|
|
13279
|
-
|
|
13280
|
-
|
|
13281
|
-
|
|
13282
|
-
|
|
13283
|
-
children: [getDescription(), maxFiles && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
13284
|
-
children: [/*#__PURE__*/jsxRuntime.jsx("br", {}), `Maximum ${maxFiles} files.`]
|
|
13285
|
-
})]
|
|
13286
|
-
})
|
|
13109
|
+
return /*#__PURE__*/jsxRuntime.jsxs(Body, {
|
|
13110
|
+
className: classNames__default.default({
|
|
13111
|
+
'text-primary': !disabled
|
|
13112
|
+
}),
|
|
13113
|
+
children: [getDescription(), maxFiles && /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
13114
|
+
children: [/*#__PURE__*/jsxRuntime.jsx("br", {}), `Maximum ${maxFiles} files.`]
|
|
13115
|
+
})]
|
|
13287
13116
|
});
|
|
13288
13117
|
}
|
|
13289
13118
|
function renderButtonTitle() {
|
|
@@ -13317,14 +13146,11 @@ const UploadButton = ({
|
|
|
13317
13146
|
onChange: filesSelected
|
|
13318
13147
|
}), /*#__PURE__*/jsxRuntime.jsx("label", {
|
|
13319
13148
|
htmlFor: id,
|
|
13320
|
-
className: classNames__default.default('btn', 'np-upload-
|
|
13321
|
-
disabled,
|
|
13322
|
-
'np-upload-input--square-top': multipleFileInputWithFilesAdded
|
|
13323
|
-
}),
|
|
13149
|
+
className: classNames__default.default('btn', 'np-upload-button'),
|
|
13324
13150
|
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
13325
13151
|
className: "media",
|
|
13326
13152
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
13327
|
-
className: "np-upload-icon media-left",
|
|
13153
|
+
className: "np-upload-icon media-middle media-left",
|
|
13328
13154
|
children: /*#__PURE__*/jsxRuntime.jsx(icons.Upload, {
|
|
13329
13155
|
size: 24,
|
|
13330
13156
|
className: "text-link"
|
|
@@ -13340,9 +13166,7 @@ const UploadButton = ({
|
|
|
13340
13166
|
})]
|
|
13341
13167
|
})
|
|
13342
13168
|
}), isDropping && /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
13343
|
-
className: classNames__default.default('droppable-card', 'droppable-dropping-card', 'droppable-card-content',
|
|
13344
|
-
'np-upload-input--square-top': multipleFileInputWithFilesAdded
|
|
13345
|
-
}),
|
|
13169
|
+
className: classNames__default.default('droppable-card', 'droppable-dropping-card', 'droppable-card-content'),
|
|
13346
13170
|
children: [/*#__PURE__*/jsxRuntime.jsx(icons.PlusCircle, {
|
|
13347
13171
|
className: "m-x-1",
|
|
13348
13172
|
size: 24
|
|
@@ -13389,7 +13213,7 @@ const UploadItemBody = ({
|
|
|
13389
13213
|
href: url,
|
|
13390
13214
|
target: "_blank",
|
|
13391
13215
|
rel: "noopener noreferrer",
|
|
13392
|
-
className: singleFileUpload ? 'np-upload-item--single-file' : '',
|
|
13216
|
+
className: singleFileUpload ? 'np-upload-item--single-file' : 'np-upload-item--link',
|
|
13393
13217
|
onClick: onDownload,
|
|
13394
13218
|
children: children
|
|
13395
13219
|
});
|
|
@@ -13414,20 +13238,15 @@ const UploadItem = ({
|
|
|
13414
13238
|
status,
|
|
13415
13239
|
filename,
|
|
13416
13240
|
error,
|
|
13241
|
+
errors,
|
|
13417
13242
|
url
|
|
13418
13243
|
} = file;
|
|
13419
|
-
const {
|
|
13420
|
-
isModern
|
|
13421
|
-
} = componentsTheming.useTheme();
|
|
13422
13244
|
const isSucceeded = [exports.Status.SUCCEEDED, undefined].includes(status) && !!url;
|
|
13423
13245
|
const getIcon = () => {
|
|
13424
|
-
if (error || status === exports.Status.FAILED) {
|
|
13425
|
-
return
|
|
13246
|
+
if (error || errors?.length || status === exports.Status.FAILED) {
|
|
13247
|
+
return /*#__PURE__*/jsxRuntime.jsx(StatusIcon, {
|
|
13426
13248
|
size: exports.Size.SMALL,
|
|
13427
13249
|
sentiment: exports.Sentiment.NEGATIVE
|
|
13428
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(icons.AlertCircle, {
|
|
13429
|
-
size: 24,
|
|
13430
|
-
className: "text-negative"
|
|
13431
13250
|
});
|
|
13432
13251
|
}
|
|
13433
13252
|
let processIndicator;
|
|
@@ -13442,31 +13261,37 @@ const UploadItem = ({
|
|
|
13442
13261
|
case exports.Status.SUCCEEDED:
|
|
13443
13262
|
case exports.Status.DONE:
|
|
13444
13263
|
default:
|
|
13445
|
-
processIndicator =
|
|
13264
|
+
processIndicator = /*#__PURE__*/jsxRuntime.jsx(StatusIcon, {
|
|
13446
13265
|
size: exports.Size.SMALL,
|
|
13447
13266
|
sentiment: exports.Sentiment.POSITIVE
|
|
13448
|
-
}) : /*#__PURE__*/jsxRuntime.jsx(ProcessIndicator, {
|
|
13449
|
-
size: exports.Size.EXTRA_SMALL,
|
|
13450
|
-
status: exports.Status.SUCCEEDED
|
|
13451
13267
|
});
|
|
13452
13268
|
}
|
|
13453
|
-
|
|
13454
|
-
|
|
13269
|
+
return processIndicator;
|
|
13270
|
+
};
|
|
13271
|
+
const getErrorMessage = error => typeof error === 'object' ? error.message : error || formatMessage(MESSAGES.uploadingFailed);
|
|
13272
|
+
const getMultipleErrors = errors => {
|
|
13273
|
+
if (!errors?.length) {
|
|
13274
|
+
return null;
|
|
13455
13275
|
}
|
|
13456
|
-
|
|
13457
|
-
|
|
13458
|
-
|
|
13459
|
-
|
|
13460
|
-
|
|
13461
|
-
|
|
13276
|
+
if (errors?.length === 1) {
|
|
13277
|
+
return getErrorMessage(errors[0]);
|
|
13278
|
+
}
|
|
13279
|
+
return /*#__PURE__*/jsxRuntime.jsx("ul", {
|
|
13280
|
+
className: "np-upload-input-errors m-b-0",
|
|
13281
|
+
children: errors.map((error, index) => {
|
|
13282
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
13283
|
+
return /*#__PURE__*/jsxRuntime.jsx("li", {
|
|
13284
|
+
children: getErrorMessage(error)
|
|
13285
|
+
}, index);
|
|
13286
|
+
})
|
|
13287
|
+
});
|
|
13462
13288
|
};
|
|
13463
|
-
const getErrorMessage = () => typeof error === 'object' ? error.message : error || formatMessage(MESSAGES.uploadingFailed);
|
|
13464
13289
|
const getDescription = () => {
|
|
13465
|
-
if (error || status === exports.Status.FAILED) {
|
|
13290
|
+
if (error || errors?.length || status === exports.Status.FAILED) {
|
|
13466
13291
|
return /*#__PURE__*/jsxRuntime.jsx(Body, {
|
|
13467
13292
|
type: exports.Typography.BODY_DEFAULT_BOLD,
|
|
13468
13293
|
className: "text-negative",
|
|
13469
|
-
children: getErrorMessage()
|
|
13294
|
+
children: errors?.length ? getMultipleErrors(errors) : getErrorMessage(error)
|
|
13470
13295
|
});
|
|
13471
13296
|
}
|
|
13472
13297
|
switch (status) {
|
|
@@ -13536,7 +13361,7 @@ const UploadItem = ({
|
|
|
13536
13361
|
}),
|
|
13537
13362
|
type: "button",
|
|
13538
13363
|
onClick: () => onDelete(),
|
|
13539
|
-
children: /*#__PURE__*/jsxRuntime.jsx(icons.
|
|
13364
|
+
children: /*#__PURE__*/jsxRuntime.jsx(icons.Bin, {
|
|
13540
13365
|
size: 16
|
|
13541
13366
|
})
|
|
13542
13367
|
})]
|
|
@@ -13573,9 +13398,6 @@ const UploadInput = ({
|
|
|
13573
13398
|
sizeLimitErrorMessage,
|
|
13574
13399
|
uploadButtonTitle
|
|
13575
13400
|
}) => {
|
|
13576
|
-
const {
|
|
13577
|
-
isModern
|
|
13578
|
-
} = componentsTheming.useTheme();
|
|
13579
13401
|
const [markedFileForDelete, setMarkedFileForDelete] = React.useState(null);
|
|
13580
13402
|
const [mounted, setMounted] = React.useState(false);
|
|
13581
13403
|
const {
|
|
@@ -13733,7 +13555,7 @@ const UploadInput = ({
|
|
|
13733
13555
|
return /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
13734
13556
|
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
13735
13557
|
className: classNames__default.default('np-upload-input', className, {
|
|
13736
|
-
disabled
|
|
13558
|
+
disabled
|
|
13737
13559
|
}),
|
|
13738
13560
|
children: [uploadedFiles.map(file => /*#__PURE__*/jsxRuntime.jsx(UploadItem, {
|
|
13739
13561
|
file: file,
|
|
@@ -13750,7 +13572,6 @@ const UploadInput = ({
|
|
|
13750
13572
|
sizeLimit: sizeLimit,
|
|
13751
13573
|
description: description,
|
|
13752
13574
|
maxFiles: maxFiles,
|
|
13753
|
-
multipleFileInputWithFilesAdded: multiple && uploadedFiles.length > 0,
|
|
13754
13575
|
onChange: addFiles
|
|
13755
13576
|
})]
|
|
13756
13577
|
}), /*#__PURE__*/jsxRuntime.jsx(Modal, {
|
|
@@ -14804,14 +14625,14 @@ exports.Alert = Alert;
|
|
|
14804
14625
|
exports.Avatar = Avatar;
|
|
14805
14626
|
exports.AvatarWrapper = AvatarWrapper;
|
|
14806
14627
|
exports.Badge = Badge;
|
|
14807
|
-
exports.BaseCard = Card$
|
|
14628
|
+
exports.BaseCard = Card$1;
|
|
14808
14629
|
exports.Body = Body;
|
|
14809
14630
|
exports.BottomSheet = BottomSheet$1;
|
|
14810
14631
|
exports.Button = Button;
|
|
14811
|
-
exports.Card = Card
|
|
14632
|
+
exports.Card = Card;
|
|
14812
14633
|
exports.Carousel = Carousel;
|
|
14813
14634
|
exports.Checkbox = Checkbox;
|
|
14814
|
-
exports.CheckboxButton = CheckboxButton
|
|
14635
|
+
exports.CheckboxButton = CheckboxButton;
|
|
14815
14636
|
exports.CheckboxOption = CheckboxOption;
|
|
14816
14637
|
exports.Chevron = Chevron;
|
|
14817
14638
|
exports.Chip = Chip;
|
|
@@ -14823,11 +14644,11 @@ exports.DEFAULT_LOCALE = DEFAULT_LOCALE;
|
|
|
14823
14644
|
exports.DateInput = DateInput;
|
|
14824
14645
|
exports.DateLookup = DateLookup$1;
|
|
14825
14646
|
exports.Decision = Decision;
|
|
14826
|
-
exports.DefinitionList = DefinitionList
|
|
14647
|
+
exports.DefinitionList = DefinitionList;
|
|
14827
14648
|
exports.Dimmer = Dimmer$1;
|
|
14828
14649
|
exports.DirectionProvider = DirectionProvider;
|
|
14829
14650
|
exports.Display = Display;
|
|
14830
|
-
exports.Drawer = Drawer
|
|
14651
|
+
exports.Drawer = Drawer;
|
|
14831
14652
|
exports.DropFade = DropFade;
|
|
14832
14653
|
exports.Emphasis = Emphasis;
|
|
14833
14654
|
exports.Field = Field;
|
|
@@ -14845,7 +14666,7 @@ exports.LanguageProvider = LanguageProvider;
|
|
|
14845
14666
|
exports.Link = Link;
|
|
14846
14667
|
exports.ListItem = ListItem$1;
|
|
14847
14668
|
exports.Loader = Loader;
|
|
14848
|
-
exports.Logo = Logo
|
|
14669
|
+
exports.Logo = Logo;
|
|
14849
14670
|
exports.Markdown = Markdown;
|
|
14850
14671
|
exports.Modal = Modal;
|
|
14851
14672
|
exports.Money = Money;
|