@transferwise/components 46.37.0 → 46.39.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 +179 -357
- package/build/index.js.map +1 -1
- package/build/index.mjs +173 -350
- 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/actionButton/ActionButton.d.ts +2 -2
- package/build/types/actionButton/ActionButton.d.ts.map +1 -1
- package/build/types/actionOption/ActionOption.d.ts +0 -1
- package/build/types/actionOption/ActionOption.d.ts.map +1 -1
- package/build/types/alert/Alert.d.ts +0 -1
- 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 +2 -2
- 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 +0 -1
- package/build/types/chips/Chip.d.ts.map +1 -1
- package/build/types/chips/Chips.d.ts +0 -1
- 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/closeButton/CloseButton.d.ts +4 -5
- 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/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 +0 -1
- package/build/types/common/hooks/useResizeObserver.d.ts.map +1 -1
- package/build/types/common/panel/Panel.d.ts +8 -8
- package/build/types/common/panel/Panel.d.ts.map +1 -1
- package/build/types/common/polymorphicWithOverrides/PolymorphicWithOverrides.d.ts +0 -1
- package/build/types/common/polymorphicWithOverrides/PolymorphicWithOverrides.d.ts.map +1 -1
- package/build/types/common/responsivePanel/ResponsivePanel.d.ts +8 -9
- 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.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 +0 -1
- 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 +5 -17
- package/build/types/flowNavigation/backButton/BackButton.d.ts.map +1 -1
- package/build/types/flowNavigation/backButton/index.d.ts +2 -2
- 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 +5 -0
- package/build/types/index.d.ts.map +1 -1
- package/build/types/info/Info.d.ts +2 -3
- package/build/types/info/Info.d.ts.map +1 -1
- package/build/types/info/index.d.ts +1 -1
- package/build/types/info/index.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 +0 -1
- 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 +0 -1
- 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 +0 -1
- package/build/types/inputs/TextArea.d.ts.map +1 -1
- package/build/types/inputs/_BottomSheet.d.ts +0 -1
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/build/types/inputs/_ButtonInput.d.ts +0 -1
- 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/overlayHeader/OverlayHeader.d.ts +9 -18
- package/build/types/overlayHeader/OverlayHeader.d.ts.map +1 -1
- package/build/types/overlayHeader/index.d.ts +2 -1
- package/build/types/overlayHeader/index.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 +0 -1
- package/build/types/progress/Progress.d.ts.map +1 -1
- package/build/types/progressBar/ProgressBar.d.ts +0 -1
- package/build/types/progressBar/ProgressBar.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/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/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 +1 -1
- 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 +0 -1
- 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.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/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 +0 -1
- 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.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 +24 -27
- package/src/accordion/Accordion.spec.js +5 -5
- package/src/accordion/AccordionItem/AccordionItem.spec.js +2 -2
- package/src/actionButton/ActionButton.spec.tsx +4 -5
- package/src/alert/Alert.spec.tsx +4 -4
- package/src/alert/Alert.story.tsx +6 -5
- package/src/alert/inlineMarkdown/InlineMarkdown.tsx +13 -0
- package/src/alert/inlineMarkdown/index.ts +2 -0
- package/src/button/Button.spec.js +4 -5
- package/src/card/{Card.spec.js → Card.spec.tsx} +4 -4
- 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/carousel/Carousel.spec.tsx +17 -17
- package/src/checkbox/{Checkbox.spec.js → Checkbox.spec.tsx} +5 -7
- package/src/checkbox/{Checkbox.js → Checkbox.tsx} +19 -41
- package/src/checkbox/index.ts +2 -0
- package/src/checkboxButton/CheckboxButton.spec.tsx +0 -2
- package/src/checkboxOption/CheckboxOption.spec.tsx +0 -2
- package/src/chevron/Chevron.spec.tsx +0 -1
- package/src/chips/Chips.spec.tsx +0 -1
- package/src/chips/Chips.story.tsx +5 -3
- package/src/circularButton/CircularButton.spec.tsx +4 -5
- package/src/common/RadioButton/RadioButton.spec.tsx +2 -2
- package/src/common/card/Card.story.tsx +1 -0
- package/src/common/closeButton/CloseButton.spec.tsx +0 -1
- package/src/common/flowHeader/FlowHeader.spec.tsx +0 -1
- package/src/dateInput/DateInput.story.tsx +21 -16
- package/src/dateLookup/DateLookup.rtl.spec.tsx +18 -16
- package/src/dateLookup/DateLookup.testingLibrary.spec.js +47 -44
- package/src/dateLookup/DateLookup.tests.story.tsx +4 -2
- package/src/decision/Decision.spec.js +0 -2
- 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.rtl.spec.js +10 -10
- package/src/drawer/{Drawer.rtl.spec.js → Drawer.rtl.spec.tsx} +6 -4
- 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.spec.tsx +0 -1
- package/src/field/Field.spec.tsx +2 -2
- package/src/flowNavigation/FlowNavigation.spec.js +0 -2
- package/src/flowNavigation/animatedLabel/AnimatedLabel.spec.js +0 -1
- package/src/flowNavigation/backButton/BackButton.tsx +29 -0
- package/src/flowNavigation/backButton/index.ts +2 -0
- package/src/header/Header.spec.tsx +6 -6
- package/src/image/Image.spec.tsx +0 -1
- package/src/index.ts +5 -0
- package/src/info/Info.story.tsx +15 -9
- package/src/info/Info.tsx +2 -2
- package/src/info/index.ts +1 -1
- package/src/inlineAlert/InlineAlert.spec.tsx +0 -1
- package/src/inputs/SelectInput.spec.tsx +26 -47
- package/src/link/Link.spec.tsx +0 -1
- package/src/listItem/ListItem.spec.tsx +0 -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/moneyInput/MoneyInput.rtl.spec.tsx +2 -2
- package/src/moneyInput/MoneyInput.story.tsx +1 -4
- package/src/overlayHeader/{OverlayHeader.spec.js → OverlayHeader.spec.tsx} +1 -1
- package/src/overlayHeader/{OverlayHeader.story.js → OverlayHeader.story.tsx} +10 -2
- package/src/overlayHeader/{OverlayHeader.js → OverlayHeader.tsx} +12 -19
- package/src/overlayHeader/index.ts +2 -0
- package/src/phoneNumberInput/PhoneNumberInput.story.tsx +1 -0
- package/src/popover/Popover.spec.tsx +10 -10
- package/src/progress/Progress.spec.tsx +0 -1
- package/src/progressBar/ProgressBar.spec.tsx +0 -1
- package/src/section/Section.story.tsx +0 -2
- package/src/segmentedControl/SegmentedControl.spec.tsx +10 -11
- package/src/select/Select.spec.js +71 -71
- package/src/slidingPanel/SlidingPanel.spec.js +2 -1
- package/src/slidingPanel/SlidingPanel.tsx +3 -0
- 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/sticky/Sticky.spec.tsx +71 -0
- package/src/sticky/Sticky.story.tsx +72 -15
- package/src/sticky/Sticky.tsx +49 -5
- package/src/test-utils/Parameters.d.ts +8 -0
- package/src/test-utils/index.js +1 -1
- package/src/test-utils/jest.setup.js +2 -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.spec.tsx +15 -16
- package/src/uploadInput/UploadInput.css +25 -27
- package/src/uploadInput/UploadInput.less +24 -23
- package/src/uploadInput/UploadInput.spec.tsx +9 -10
- package/src/uploadInput/UploadInput.story.tsx +8 -130
- package/src/uploadInput/UploadInput.tests.story.tsx +212 -0
- package/src/uploadInput/UploadInput.tsx +1 -4
- 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 +4 -5
- 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.spec.tsx +4 -4
- package/src/uploadInput/uploadItem/UploadItem.tsx +30 -25
- package/src/uploadInput/uploadItem/UploadItemBody.tsx +1 -1
- 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/flowNavigation/backButton/BackButton.js +0 -32
- package/src/flowNavigation/backButton/BackButton.spec.js +0 -16
- package/src/flowNavigation/backButton/__snapshots__/BackButton.spec.js.snap +0 -37
- package/src/flowNavigation/backButton/index.js +0 -3
- package/src/logo/index.js +0 -2
- package/src/logo/logoTypes.ts +0 -6
- package/src/overlayHeader/index.js +0 -1
- package/src/snackbar/Snackbar.spec.js +0 -112
- package/src/sticky/Sticky.spec.js +0 -34
- /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/overlayHeader/__snapshots__/{OverlayHeader.spec.js.snap → OverlayHeader.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
|
@@ -1,74 +1,109 @@
|
|
|
1
|
-
.np-upload-item
|
|
1
|
+
.np-upload-item {
|
|
2
|
+
border: 1px solid #c9cbce;
|
|
3
|
+
border: 1px solid var(--color-interactive-secondary);
|
|
4
|
+
}
|
|
5
|
+
.np-upload-item:first-child ~ div:before {
|
|
2
6
|
display: block;
|
|
3
7
|
position: relative;
|
|
4
|
-
|
|
5
|
-
|
|
8
|
+
height: 1px;
|
|
9
|
+
background-color: rgba(0,0,0,0.10196);
|
|
10
|
+
background-color: var(--color-border-neutral);
|
|
6
11
|
content: " ";
|
|
7
12
|
margin: 0 16px;
|
|
8
13
|
margin: 0 var(--size-16);
|
|
9
14
|
}
|
|
10
|
-
.np-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
border-
|
|
15
|
+
.np-upload-item:first-child ~ div {
|
|
16
|
+
border-top: 0;
|
|
17
|
+
}
|
|
18
|
+
.np-upload-item:not(:last-child) {
|
|
19
|
+
border-bottom: 0;
|
|
20
|
+
}
|
|
21
|
+
.np-upload-item.np-upload-item__link:hover:before,
|
|
22
|
+
.np-upload-button-container:hover:before {
|
|
23
|
+
margin: 0 !important;
|
|
24
|
+
}
|
|
25
|
+
.np-upload-item.np-upload-item__link:hover + div:before,
|
|
26
|
+
.np-upload-button-container:hover + div:before {
|
|
27
|
+
margin: 0 !important;
|
|
28
|
+
}
|
|
29
|
+
.np-upload-button-container:has(:focus-visible) {
|
|
30
|
+
outline: var(--ring-outline-color) solid var(--ring-outline-width);
|
|
31
|
+
outline-offset: var(--ring-outline-offset);
|
|
32
|
+
border-color: transparent;
|
|
33
|
+
outline-offset: -3px;
|
|
15
34
|
}
|
|
16
|
-
.np-
|
|
17
|
-
.np-
|
|
18
|
-
.np-
|
|
19
|
-
|
|
20
|
-
border-top-right-radius: calc(var(--radius-small) - 1px);
|
|
35
|
+
.np-upload-item--single-file:focus-visible,
|
|
36
|
+
.np-upload-item--link:focus-visible,
|
|
37
|
+
.np-upload-button-container:has(:focus-visible) {
|
|
38
|
+
outline-width: 3px;
|
|
21
39
|
}
|
|
22
40
|
.np-upload-item__link a {
|
|
23
41
|
flex: 1;
|
|
24
42
|
-webkit-text-decoration: none;
|
|
25
43
|
text-decoration: none;
|
|
26
|
-
|
|
27
|
-
border-top-right-radius: 0;
|
|
28
|
-
border-bottom-right-radius: 0;
|
|
44
|
+
border-radius: inherit;
|
|
29
45
|
}
|
|
30
|
-
.np-
|
|
31
|
-
|
|
32
|
-
border-radius: initial;
|
|
33
|
-
}
|
|
34
|
-
.np-upload-item__link a.np-upload-item--single-file {
|
|
35
|
-
border-bottom-left-radius: calc(10px - 1px);
|
|
36
|
-
border-bottom-left-radius: calc(var(--radius-small) - 1px);
|
|
46
|
+
.np-upload-item__link a:focus-visible {
|
|
47
|
+
outline-offset: -2px;
|
|
37
48
|
}
|
|
38
49
|
.np-upload-item__link a:hover,
|
|
39
|
-
.np-upload-item__link a:focus-visible,
|
|
40
50
|
.np-upload-item__link a:active {
|
|
41
51
|
-webkit-text-decoration: none;
|
|
42
52
|
text-decoration: none;
|
|
43
53
|
background-color: rgba(134,167,189,0.10196);
|
|
44
54
|
background-color: var(--color-background-neutral);
|
|
45
55
|
}
|
|
46
|
-
.np-upload-item__link a:hover ~ .np-upload-item__remove-button,
|
|
47
|
-
.np-upload-item__link a:focus-visible ~ .np-upload-item__remove-button,
|
|
48
|
-
.np-upload-item__link a:active ~ .np-upload-item__remove-button {
|
|
49
|
-
background-color: rgba(134,167,189,0.10196);
|
|
50
|
-
background-color: var(--color-background-neutral);
|
|
51
|
-
}
|
|
52
|
-
.np-upload-item__link .np-upload-item__remove-button.np-upload-item--single-file {
|
|
53
|
-
border-bottom-right-radius: calc(10px - 1px);
|
|
54
|
-
border-bottom-right-radius: calc(var(--radius-small) - 1px);
|
|
55
|
-
}
|
|
56
56
|
.np-upload-item__body {
|
|
57
57
|
display: flex;
|
|
58
58
|
align-items: center;
|
|
59
59
|
justify-content: space-between;
|
|
60
|
+
position: relative;
|
|
61
|
+
border-radius: inherit;
|
|
60
62
|
}
|
|
61
63
|
.np-upload-item__remove-button {
|
|
62
|
-
|
|
63
|
-
align-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
display: flex;
|
|
65
|
+
align-items: center;
|
|
66
|
+
justify-content: center;
|
|
67
|
+
align-self: flex-start;
|
|
68
|
+
position: absolute;
|
|
69
|
+
height: 24px;
|
|
70
|
+
height: var(--size-24);
|
|
71
|
+
min-height: 0;
|
|
72
|
+
width: 24px;
|
|
73
|
+
width: var(--size-24);
|
|
74
|
+
padding: 0;
|
|
75
|
+
border-radius: 50% !important;
|
|
76
|
+
outline-offset: 0 !important;
|
|
77
|
+
background-color: rgba(134,167,189,0.10196);
|
|
78
|
+
background-color: var(--color-background-neutral);
|
|
79
|
+
color: var(--color-interactive-primary);
|
|
80
|
+
right: 16px;
|
|
81
|
+
right: var(--size-16);
|
|
82
|
+
top: 16px;
|
|
83
|
+
top: var(--size-16);
|
|
84
|
+
transition: color, background-color 0.15s ease-in-out;
|
|
85
|
+
}
|
|
86
|
+
@media (max-width: 320px) {
|
|
87
|
+
.np-upload-item__remove-button {
|
|
88
|
+
top: 16px;
|
|
89
|
+
top: var(--size-16);
|
|
90
|
+
right: 16px;
|
|
91
|
+
right: var(--size-16);
|
|
92
|
+
height: 48px;
|
|
93
|
+
height: var(--size-48);
|
|
94
|
+
width: 48px;
|
|
95
|
+
width: var(--size-48);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
.np-upload-item__remove-button:hover {
|
|
99
|
+
background-color: var(--color-sentiment-negative);
|
|
100
|
+
color: var(--color-contrast-overlay) !important;
|
|
101
|
+
}
|
|
102
|
+
.np-upload-item__remove-button:before {
|
|
103
|
+
display: block;
|
|
104
|
+
width: 44px;
|
|
105
|
+
height: 44px;
|
|
106
|
+
content: '';
|
|
107
|
+
border-radius: 50%;
|
|
108
|
+
position: absolute;
|
|
74
109
|
}
|
|
@@ -1,77 +1,112 @@
|
|
|
1
|
-
@
|
|
1
|
+
@import (reference) "../../../node_modules/@transferwise/neptune-css/src/less/ring.less";
|
|
2
2
|
|
|
3
3
|
.np-upload-item {
|
|
4
|
-
|
|
4
|
+
border: 1px solid var(--color-interactive-secondary);
|
|
5
|
+
|
|
6
|
+
&:first-child ~ div:before {
|
|
5
7
|
display: block;
|
|
6
8
|
position: relative;
|
|
7
|
-
|
|
9
|
+
height: 1px;
|
|
10
|
+
background-color: var(--color-border-neutral);
|
|
8
11
|
content: " ";
|
|
9
12
|
margin: 0 var(--size-16);
|
|
10
13
|
}
|
|
14
|
+
|
|
11
15
|
&:first-child {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
&:active {
|
|
17
|
-
border-top-left-radius: @small-border-minus-one;
|
|
16
|
+
& ~ div {
|
|
17
|
+
border-top: 0;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
21
|
+
&:not(:last-child) {
|
|
22
|
+
border-bottom: 0;
|
|
24
23
|
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.np-upload-item.np-upload-item__link:hover,
|
|
27
|
+
.np-upload-button-container:hover {
|
|
28
|
+
&:before {
|
|
29
|
+
margin: 0 !important;
|
|
25
30
|
}
|
|
31
|
+
& + div:before {
|
|
32
|
+
margin: 0 !important;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.np-upload-button-container:has(:focus-visible) {
|
|
37
|
+
.ring();
|
|
38
|
+
border-color: transparent;
|
|
39
|
+
outline-offset: -3px;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.np-upload-item--single-file:focus-visible,
|
|
43
|
+
.np-upload-item--link:focus-visible,
|
|
44
|
+
.np-upload-button-container:has(:focus-visible) {
|
|
45
|
+
outline-width: 3px;
|
|
26
46
|
}
|
|
27
47
|
|
|
28
48
|
.np-upload-item__link {
|
|
29
49
|
a {
|
|
30
|
-
.np-theme-personal & {
|
|
31
|
-
border-radius: unset;
|
|
32
|
-
}
|
|
33
50
|
flex: 1;
|
|
34
51
|
text-decoration: none;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
&.np-upload-item--single-file {
|
|
40
|
-
border-bottom-left-radius: @small-border-minus-one;
|
|
52
|
+
border-radius: inherit;
|
|
53
|
+
&:focus-visible {
|
|
54
|
+
outline-offset: -2px;
|
|
41
55
|
}
|
|
42
56
|
|
|
43
57
|
&:hover,
|
|
44
|
-
&:focus-visible,
|
|
45
58
|
&:active {
|
|
46
59
|
text-decoration: none;
|
|
47
60
|
background-color: var(--color-background-neutral);
|
|
48
|
-
|
|
49
|
-
~ .np-upload-item__remove-button {
|
|
50
|
-
background-color: var(--color-background-neutral);
|
|
51
|
-
}
|
|
52
61
|
}
|
|
53
62
|
}
|
|
54
|
-
|
|
55
|
-
.np-upload-item__remove-button.np-upload-item--single-file {
|
|
56
|
-
border-bottom-right-radius: @small-border-minus-one;
|
|
57
|
-
}
|
|
58
63
|
}
|
|
59
64
|
|
|
60
65
|
.np-upload-item__body {
|
|
61
66
|
display: flex;
|
|
62
67
|
align-items: center;
|
|
63
68
|
justify-content: space-between;
|
|
69
|
+
// We should have the `relative` position for the body, because we have `absolute` position for `np-upload-item__remove-button` to achieve appropriate `hover` effects
|
|
70
|
+
position: relative;
|
|
71
|
+
border-radius: inherit;
|
|
64
72
|
}
|
|
65
73
|
|
|
66
74
|
.np-upload-item__remove-button {
|
|
67
|
-
|
|
68
|
-
align-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
75
|
+
display: flex;
|
|
76
|
+
align-items: center;
|
|
77
|
+
justify-content: center;
|
|
78
|
+
align-self: flex-start;
|
|
79
|
+
position: absolute;
|
|
80
|
+
height: var(--size-24);
|
|
81
|
+
min-height: 0;
|
|
82
|
+
width: var(--size-24);
|
|
83
|
+
padding: 0;
|
|
84
|
+
border-radius: 50% !important;
|
|
85
|
+
outline-offset: 0 !important;
|
|
86
|
+
background-color: var(--color-background-neutral);
|
|
87
|
+
color: var(--color-interactive-primary);
|
|
88
|
+
right: var(--size-16);
|
|
89
|
+
top: var(--size-16);
|
|
90
|
+
transition: color, background-color 0.15s ease-in-out;
|
|
72
91
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
92
|
+
@media (--screen-400-zoom) {
|
|
93
|
+
top: var(--size-16);
|
|
94
|
+
right: var(--size-16);
|
|
95
|
+
height: var(--size-48);
|
|
96
|
+
width: var(--size-48);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
&:hover {
|
|
100
|
+
background-color: var(--color-sentiment-negative);
|
|
101
|
+
color: var(--color-contrast-overlay) !important;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&:before {
|
|
105
|
+
display: block;
|
|
106
|
+
width: 44px;
|
|
107
|
+
height: 44px;
|
|
108
|
+
content: '';
|
|
109
|
+
border-radius: 50%;
|
|
110
|
+
position: absolute;
|
|
76
111
|
}
|
|
77
112
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import userEvent from '@testing-library/user-event';
|
|
1
|
+
import { userEvent } from '@testing-library/user-event';
|
|
2
2
|
|
|
3
3
|
import { Status } from '../../common';
|
|
4
4
|
import { render, screen } from '../../test-utils';
|
|
5
5
|
|
|
6
|
-
import UploadItem, { UploadItemProps
|
|
6
|
+
import UploadItem, { UploadItemProps } from './UploadItem';
|
|
7
7
|
|
|
8
8
|
describe('UploadItem', () => {
|
|
9
9
|
const props: UploadItemProps = {
|
|
@@ -111,10 +111,10 @@ describe('UploadItem', () => {
|
|
|
111
111
|
});
|
|
112
112
|
|
|
113
113
|
describe('manual file download handler', () => {
|
|
114
|
-
it('calls onDownload handler provided through props', () => {
|
|
114
|
+
it('calls onDownload handler provided through props', async () => {
|
|
115
115
|
const onDownload = jest.fn();
|
|
116
116
|
renderComponent({ ...props, onDownload });
|
|
117
|
-
userEvent.click(screen.getAllByRole('link')[0]);
|
|
117
|
+
await userEvent.click(screen.getAllByRole('link')[0]);
|
|
118
118
|
expect(onDownload).toHaveBeenCalledTimes(1);
|
|
119
119
|
expect(onDownload).toHaveBeenCalledWith(props.file);
|
|
120
120
|
});
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useTheme } from '@wise/components-theming';
|
|
1
|
+
import { Bin } from '@transferwise/icons';
|
|
3
2
|
import classNames from 'classnames';
|
|
4
3
|
import { useIntl } from 'react-intl';
|
|
5
4
|
|
|
@@ -7,7 +6,7 @@ import Body from '../../body';
|
|
|
7
6
|
import { Size, Status, Typography, Sentiment } from '../../common';
|
|
8
7
|
import ProcessIndicator from '../../processIndicator/ProcessIndicator';
|
|
9
8
|
import StatusIcon from '../../statusIcon/StatusIcon';
|
|
10
|
-
import { UploadedFile } from '../types';
|
|
9
|
+
import { UploadedFile, UploadError } from '../types';
|
|
11
10
|
|
|
12
11
|
import MESSAGES from './UploadItem.messages';
|
|
13
12
|
import { UploadItemBody } from './UploadItemBody';
|
|
@@ -43,18 +42,13 @@ const UploadItem = ({
|
|
|
43
42
|
singleFileUpload,
|
|
44
43
|
}: UploadItemProps) => {
|
|
45
44
|
const { formatMessage } = useIntl();
|
|
46
|
-
const { status, filename, error, url } = file;
|
|
47
|
-
const { isModern } = useTheme();
|
|
45
|
+
const { status, filename, error, errors, url } = file;
|
|
48
46
|
|
|
49
47
|
const isSucceeded = [Status.SUCCEEDED, undefined].includes(status) && !!url;
|
|
50
48
|
|
|
51
49
|
const getIcon = () => {
|
|
52
|
-
if (error || status === Status.FAILED) {
|
|
53
|
-
return
|
|
54
|
-
<StatusIcon size={Size.SMALL} sentiment={Sentiment.NEGATIVE} />
|
|
55
|
-
) : (
|
|
56
|
-
<AlertCircle size={24} className="text-negative" />
|
|
57
|
-
);
|
|
50
|
+
if (error || errors?.length || status === Status.FAILED) {
|
|
51
|
+
return <StatusIcon size={Size.SMALL} sentiment={Sentiment.NEGATIVE} />;
|
|
58
52
|
}
|
|
59
53
|
|
|
60
54
|
let processIndicator: React.ReactNode;
|
|
@@ -67,28 +61,39 @@ const UploadItem = ({
|
|
|
67
61
|
case Status.SUCCEEDED:
|
|
68
62
|
case Status.DONE:
|
|
69
63
|
default:
|
|
70
|
-
processIndicator =
|
|
71
|
-
<StatusIcon size={Size.SMALL} sentiment={Sentiment.POSITIVE} />
|
|
72
|
-
) : (
|
|
73
|
-
<ProcessIndicator size={Size.EXTRA_SMALL} status={Status.SUCCEEDED} />
|
|
74
|
-
);
|
|
64
|
+
processIndicator = <StatusIcon size={Size.SMALL} sentiment={Sentiment.POSITIVE} />;
|
|
75
65
|
}
|
|
76
66
|
|
|
77
|
-
|
|
78
|
-
return processIndicator;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
return <span style={{ transform: 'scale(0.8335)' }}>{processIndicator}</span>; // Scale down ProcessIndicator to be 20px*20px to match `icons`
|
|
67
|
+
return processIndicator;
|
|
82
68
|
};
|
|
83
69
|
|
|
84
|
-
const getErrorMessage = () =>
|
|
70
|
+
const getErrorMessage = (error?: UploadError) =>
|
|
85
71
|
typeof error === 'object' ? error.message : error || formatMessage(MESSAGES.uploadingFailed);
|
|
86
72
|
|
|
73
|
+
const getMultipleErrors = (errors?: UploadError[]) => {
|
|
74
|
+
if (!errors?.length) {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (errors?.length === 1) {
|
|
79
|
+
return getErrorMessage(errors[0]);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<ul className="np-upload-input-errors m-b-0">
|
|
84
|
+
{errors.map((error, index) => {
|
|
85
|
+
// eslint-disable-next-line react/no-array-index-key
|
|
86
|
+
return <li key={index}>{getErrorMessage(error)}</li>;
|
|
87
|
+
})}
|
|
88
|
+
</ul>
|
|
89
|
+
);
|
|
90
|
+
};
|
|
91
|
+
|
|
87
92
|
const getDescription = () => {
|
|
88
|
-
if (error || status === Status.FAILED) {
|
|
93
|
+
if (error || errors?.length || status === Status.FAILED) {
|
|
89
94
|
return (
|
|
90
95
|
<Body type={Typography.BODY_DEFAULT_BOLD} className="text-negative">
|
|
91
|
-
{getErrorMessage()}
|
|
96
|
+
{errors?.length ? getMultipleErrors(errors) : getErrorMessage(error)}
|
|
92
97
|
</Body>
|
|
93
98
|
);
|
|
94
99
|
}
|
|
@@ -150,7 +155,7 @@ const UploadItem = ({
|
|
|
150
155
|
type="button"
|
|
151
156
|
onClick={() => onDelete()}
|
|
152
157
|
>
|
|
153
|
-
<
|
|
158
|
+
<Bin size={16} />
|
|
154
159
|
</button>
|
|
155
160
|
)}
|
|
156
161
|
</div>
|
|
@@ -21,7 +21,7 @@ export const UploadItemBody = ({
|
|
|
21
21
|
href={url}
|
|
22
22
|
target="_blank"
|
|
23
23
|
rel="noopener noreferrer"
|
|
24
|
-
className={singleFileUpload ? 'np-upload-item--single-file' : ''}
|
|
24
|
+
className={singleFileUpload ? 'np-upload-item--single-file' : 'np-upload-item--link'}
|
|
25
25
|
onClick={onDownload}
|
|
26
26
|
>
|
|
27
27
|
{children}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logoTypes.d.ts","sourceRoot":"","sources":["../../../src/logo/logoTypes.ts"],"names":[],"mappings":"AACA,oBAAY,QAAQ;IAClB,IAAI,SAAS;IACb,aAAa,kBAAkB;IAC/B,aAAa,kBAAkB;CAChC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import PropTypes from 'prop-types';
|
|
2
|
-
|
|
3
|
-
import { MarkdownNodeType } from '../../common';
|
|
4
|
-
import Markdown from '../../markdown';
|
|
5
|
-
|
|
6
|
-
const allowList = [MarkdownNodeType.STRONG];
|
|
7
|
-
|
|
8
|
-
const InlineMarkdown = (props) => {
|
|
9
|
-
return <Markdown {...props} as="span" allowList={allowList} blockList={undefined} />;
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
InlineMarkdown.propTypes = {
|
|
13
|
-
children: PropTypes.string.isRequired,
|
|
14
|
-
className: PropTypes.string,
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
InlineMarkdown.defaultProps = {
|
|
18
|
-
className: undefined,
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
export default InlineMarkdown;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './InlineMarkdown';
|
package/src/card/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Card';
|
package/src/checkbox/index.js
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import classNames from 'classnames';
|
|
2
|
-
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
|
-
import ActionButton from '../actionButton';
|
|
5
|
-
import { Layout } from '../common';
|
|
6
|
-
|
|
7
|
-
const isLayoutHorizontal = (layout) =>
|
|
8
|
-
[
|
|
9
|
-
Layout.HORIZONTAL_LEFT_ALIGNED,
|
|
10
|
-
Layout.HORIZONTAL_RIGHT_ALIGNED,
|
|
11
|
-
Layout.HORIZONTAL_JUSTIFIED,
|
|
12
|
-
].includes(layout);
|
|
13
|
-
|
|
14
|
-
const getAlignmentClasses = (layout, action) => {
|
|
15
|
-
let classes = ['d-flex'];
|
|
16
|
-
|
|
17
|
-
if (action) {
|
|
18
|
-
if (isLayoutHorizontal(layout)) {
|
|
19
|
-
classes.push('align-items-center');
|
|
20
|
-
} else {
|
|
21
|
-
classes.push('align-items-start');
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
if (layout === Layout.HORIZONTAL_RIGHT_ALIGNED) {
|
|
26
|
-
classes.push('text-sm-right tw-definition-list--right-aligned-desktop');
|
|
27
|
-
} else {
|
|
28
|
-
classes.push('justify-content-between');
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
if (layout === Layout.HORIZONTAL_JUSTIFIED) {
|
|
32
|
-
classes.push('text-sm-justify');
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return classes;
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
const DefinitionList = ({ definitions, layout, muted }) => (
|
|
39
|
-
<dl
|
|
40
|
-
className={classNames('tw-definition-list d-flex ', {
|
|
41
|
-
'text-muted': muted,
|
|
42
|
-
'flex-column': layout === Layout.VERTICAL_ONE_COLUMN,
|
|
43
|
-
'tw-definition-list--columns flex-column flex-row--sm': layout === Layout.VERTICAL_TWO_COLUMN,
|
|
44
|
-
'tw-definition-list--horizontal flex-column': isLayoutHorizontal(layout),
|
|
45
|
-
})}
|
|
46
|
-
>
|
|
47
|
-
{definitions
|
|
48
|
-
.filter((definition) => definition)
|
|
49
|
-
.map(({ action, title, value, key }) => (
|
|
50
|
-
<div key={key} className="tw-definition-list__item">
|
|
51
|
-
<dt>{title}</dt>
|
|
52
|
-
<dd className={classNames(...getAlignmentClasses(layout, action))}>
|
|
53
|
-
<div>{value}</div>
|
|
54
|
-
{action ? (
|
|
55
|
-
<div
|
|
56
|
-
className={classNames(
|
|
57
|
-
isLayoutHorizontal(layout) ? 'p-l-2' : 'p-x-2',
|
|
58
|
-
'tw-definition-list__action',
|
|
59
|
-
)}
|
|
60
|
-
>
|
|
61
|
-
<ActionButton className="tw-definition-list__button" onClick={action.onClick}>
|
|
62
|
-
{action.label}
|
|
63
|
-
</ActionButton>
|
|
64
|
-
</div>
|
|
65
|
-
) : null}
|
|
66
|
-
</dd>
|
|
67
|
-
</div>
|
|
68
|
-
))}
|
|
69
|
-
</dl>
|
|
70
|
-
);
|
|
71
|
-
|
|
72
|
-
DefinitionList.propTypes = {
|
|
73
|
-
definitions: PropTypes.arrayOf(
|
|
74
|
-
PropTypes.shape({
|
|
75
|
-
action: PropTypes.shape({
|
|
76
|
-
label: PropTypes.string.isRequired,
|
|
77
|
-
onClick: PropTypes.func,
|
|
78
|
-
}),
|
|
79
|
-
title: PropTypes.node.isRequired,
|
|
80
|
-
value: PropTypes.node.isRequired,
|
|
81
|
-
key: PropTypes.string.isRequired,
|
|
82
|
-
}),
|
|
83
|
-
),
|
|
84
|
-
layout: PropTypes.oneOf([
|
|
85
|
-
'VERTICAL_TWO_COLUMN',
|
|
86
|
-
'VERTICAL_ONE_COLUMN',
|
|
87
|
-
'HORIZONTAL_JUSTIFIED',
|
|
88
|
-
'HORIZONTAL_LEFT_ALIGNED',
|
|
89
|
-
'HORIZONTAL_RIGHT_ALIGNED',
|
|
90
|
-
]),
|
|
91
|
-
muted: PropTypes.bool,
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
DefinitionList.defaultProps = {
|
|
95
|
-
definitions: [],
|
|
96
|
-
layout: Layout.VERTICAL_TWO_COLUMN,
|
|
97
|
-
muted: false,
|
|
98
|
-
};
|
|
99
|
-
|
|
100
|
-
export default DefinitionList;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './DefinitionList';
|
package/src/drawer/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from './Drawer';
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import { ArrowLeft as ArrowLeftIcon } from '@transferwise/icons';
|
|
2
|
-
import classNames from 'classnames';
|
|
3
|
-
import PropTypes from 'prop-types';
|
|
4
|
-
|
|
5
|
-
import Avatar, { AvatarType } from '../../avatar';
|
|
6
|
-
|
|
7
|
-
const BackButton = ({ className, onClick, 'aria-label': ariaLabel }) => (
|
|
8
|
-
<Avatar type={AvatarType.ICON} size={40}>
|
|
9
|
-
<button
|
|
10
|
-
type="button"
|
|
11
|
-
aria-label={ariaLabel}
|
|
12
|
-
className={classNames('np-back-button', 'btn-unstyled', className)}
|
|
13
|
-
onClick={onClick}
|
|
14
|
-
>
|
|
15
|
-
<ArrowLeftIcon size={24} />
|
|
16
|
-
</button>
|
|
17
|
-
</Avatar>
|
|
18
|
-
);
|
|
19
|
-
|
|
20
|
-
BackButton.propTypes = {
|
|
21
|
-
'aria-label': PropTypes.string.isRequired,
|
|
22
|
-
className: PropTypes.string,
|
|
23
|
-
label: PropTypes.element,
|
|
24
|
-
onClick: PropTypes.func,
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
BackButton.defaultProps = {
|
|
28
|
-
className: undefined,
|
|
29
|
-
label: undefined,
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export default BackButton;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { render } from '../../test-utils';
|
|
2
|
-
import messages from '../FlowNavigation.messages';
|
|
3
|
-
|
|
4
|
-
import BackButton from '.';
|
|
5
|
-
|
|
6
|
-
const props = {
|
|
7
|
-
label: <>label</>,
|
|
8
|
-
className: 'className',
|
|
9
|
-
onClick: jest.fn(),
|
|
10
|
-
'aria-label': messages.back.defaultMessage,
|
|
11
|
-
};
|
|
12
|
-
describe('BackButton', () => {
|
|
13
|
-
it(`renders as expected`, () => {
|
|
14
|
-
expect(render(<BackButton {...props} />).container).toMatchSnapshot();
|
|
15
|
-
});
|
|
16
|
-
});
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`BackButton renders as expected 1`] = `
|
|
4
|
-
<div>
|
|
5
|
-
<div
|
|
6
|
-
class="tw-avatar tw-avatar--40 tw-avatar--icon"
|
|
7
|
-
>
|
|
8
|
-
<div
|
|
9
|
-
class="tw-avatar__content"
|
|
10
|
-
>
|
|
11
|
-
<button
|
|
12
|
-
class="np-back-button btn-unstyled className"
|
|
13
|
-
type="button"
|
|
14
|
-
>
|
|
15
|
-
<span
|
|
16
|
-
aria-hidden="true"
|
|
17
|
-
class="tw-icon tw-icon-arrow-left "
|
|
18
|
-
data-testid="arrow-left-icon"
|
|
19
|
-
role="presentation"
|
|
20
|
-
>
|
|
21
|
-
<svg
|
|
22
|
-
fill="currentColor"
|
|
23
|
-
focusable="false"
|
|
24
|
-
height="24"
|
|
25
|
-
viewBox="0 0 24 24"
|
|
26
|
-
width="24"
|
|
27
|
-
>
|
|
28
|
-
<path
|
|
29
|
-
d="M22.286 11.316H4.629l7.114-7.114-1.2-1.2-8.572 8.571a.829.829 0 0 0 0 1.2l8.572 8.572 1.2-1.2-7.114-7.114h17.657v-1.715Z"
|
|
30
|
-
/>
|
|
31
|
-
</svg>
|
|
32
|
-
</span>
|
|
33
|
-
</button>
|
|
34
|
-
</div>
|
|
35
|
-
</div>
|
|
36
|
-
</div>
|
|
37
|
-
`;
|