@transferwise/components 46.124.0 → 46.125.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/build/field/Field.js +10 -0
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs +10 -0
- package/build/field/Field.mjs.map +1 -1
- package/build/index.js +2 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -0
- package/build/index.mjs.map +1 -1
- package/build/inputs/SelectInput.js +10 -5
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.mjs +11 -6
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/inputs/_BottomSheet.js +5 -2
- package/build/inputs/_BottomSheet.js.map +1 -1
- package/build/inputs/_BottomSheet.mjs +6 -3
- package/build/inputs/_BottomSheet.mjs.map +1 -1
- package/build/inputs/_Popover.js +2 -0
- package/build/inputs/_Popover.js.map +1 -1
- package/build/inputs/_Popover.mjs +2 -0
- package/build/inputs/_Popover.mjs.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js +10 -0
- package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs +10 -0
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
- package/build/main.css +32 -2
- package/build/prompt/ActionPrompt/ActionPrompt.js +123 -0
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -0
- package/build/prompt/ActionPrompt/ActionPrompt.mjs +118 -0
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -0
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js +13 -11
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs +14 -12
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
- package/build/styles/main.css +32 -2
- package/build/styles/prompt/ActionPrompt/ActionPrompt.css +21 -0
- package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +11 -2
- package/build/tabs/Tabs.js +14 -171
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +16 -173
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/tabs/utils.js +0 -18
- package/build/tabs/utils.js.map +1 -1
- package/build/tabs/utils.mjs +1 -17
- package/build/tabs/utils.mjs.map +1 -1
- package/build/typeahead/Typeahead.js +10 -0
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +10 -0
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/types/index.d.ts +2 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/inputs/_BottomSheet.d.ts.map +1 -1
- package/build/types/inputs/_Popover.d.ts.map +1 -1
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +26 -0
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -0
- package/build/types/prompt/ActionPrompt/index.d.ts +3 -0
- package/build/types/prompt/ActionPrompt/index.d.ts.map +1 -0
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
- package/build/types/prompt/index.d.ts +2 -0
- package/build/types/prompt/index.d.ts.map +1 -1
- package/build/types/tabs/Tabs.d.ts +2 -24
- package/build/types/tabs/Tabs.d.ts.map +1 -1
- package/build/types/tabs/utils.d.ts +0 -2
- package/build/types/tabs/utils.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/actionButton/ActionButton.story.tsx +2 -9
- package/src/avatar/Avatar.story.tsx +2 -8
- package/src/button/_stories/{Button.tests.story.tsx → Button.test.story.tsx} +5 -10
- package/src/checkbox/Checkbox.story.tsx +3 -16
- package/src/circularButton/CircularButton.story.tsx +2 -7
- package/src/common/bottomSheet/BottomSheet.story.tsx +6 -32
- package/src/common/circle/Circle.story.tsx +3 -14
- package/src/criticalBanner/CriticalCommsBanner.story.tsx +3 -16
- package/src/dateInput/{DateInput.tests.story.tsx → DateInput.test.story.tsx} +3 -13
- package/src/dateLookup/DateLookup.story.tsx +9 -7
- package/src/header/{Header.tests.story.tsx → Header.test.story.tsx} +5 -10
- package/src/index.ts +2 -2
- package/src/info/Info.story.tsx +4 -20
- package/src/inputs/{SelectInput.spec.tsx → SelectInput.test.tsx} +78 -7
- package/src/inputs/SelectInput.tsx +21 -10
- package/src/inputs/_BottomSheet.tsx +7 -4
- package/src/inputs/_Popover.tsx +2 -0
- package/src/listItem/_stories/variants/ListItem.brightGreen.test.story.tsx +2 -7
- package/src/listItem/_stories/variants/ListItem.dark.test.story.tsx +2 -7
- package/src/listItem/_stories/variants/ListItem.forestGreen.test.story.tsx +2 -7
- package/src/listItem/_stories/variants/ListItem.rtl.test.story.tsx +2 -7
- package/src/main.css +32 -2
- package/src/main.less +1 -0
- package/src/modal/Modal.story.tsx +6 -31
- package/src/moneyInput/{MoneyInput.spec.tsx → MoneyInput.test.tsx} +26 -7
- package/src/prompt/ActionPrompt/ActionPrompt.css +21 -0
- package/src/prompt/ActionPrompt/ActionPrompt.less +23 -0
- package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +184 -0
- package/src/prompt/ActionPrompt/ActionPrompt.test.tsx +256 -0
- package/src/prompt/ActionPrompt/ActionPrompt.tsx +129 -0
- package/src/prompt/ActionPrompt/index.ts +2 -0
- package/src/prompt/InlinePrompt/{InlinePrompt.spec.tsx → InlinePrompt.test.tsx} +3 -38
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +11 -2
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +12 -2
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.test.tsx +161 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +15 -11
- package/src/prompt/index.ts +3 -0
- package/src/snackbar/{Snackbar.tests.story.tsx → Snackbar.test.story.tsx} +6 -32
- package/src/{ssr.spec.tsx → ssr.test.tsx} +1 -0
- package/src/statusIcon/StatusIcon.story.tsx +5 -9
- package/src/tabs/Tabs.story.tsx +1 -45
- package/src/tabs/{Tabs.spec.tsx → Tabs.test.tsx} +0 -22
- package/src/tabs/Tabs.tsx +23 -240
- package/src/tabs/utils.test.ts +68 -0
- package/src/tabs/utils.ts +0 -20
- package/src/tooltip/Tooltip.story.tsx +2 -7
- package/src/tabs/utils.spec.ts +0 -126
- /package/src/accordion/{Accordion.spec.js → Accordion.test.js} +0 -0
- /package/src/accordion/AccordionItem/{AccordionItem.spec.js → AccordionItem.test.js} +0 -0
- /package/src/accordion/AccordionItem/__snapshots__/{AccordionItem.spec.js.snap → AccordionItem.test.js.snap} +0 -0
- /package/src/accordion/__snapshots__/{Accordion.spec.js.snap → Accordion.test.js.snap} +0 -0
- /package/src/actionButton/{ActionButton.spec.tsx → ActionButton.test.tsx} +0 -0
- /package/src/actionButton/__snapshots__/{ActionButton.spec.tsx.snap → ActionButton.test.tsx.snap} +0 -0
- /package/src/actionOption/{ActionOption.spec.tsx → ActionOption.test.tsx} +0 -0
- /package/src/alert/{Alert.tests.story.tsx → Alert.test.story.tsx} +0 -0
- /package/src/alert/{Alert.spec.tsx → Alert.test.tsx} +0 -0
- /package/src/avatar/{Avatar.spec.tsx → Avatar.test.tsx} +0 -0
- /package/src/avatarWrapper/{AvatarWrapper.spec.tsx → AvatarWrapper.test.tsx} +0 -0
- /package/src/avatarWrapper/__snapshots__/{AvatarWrapper.spec.tsx.snap → AvatarWrapper.test.tsx.snap} +0 -0
- /package/src/badge/{Badge.spec.tsx → Badge.test.tsx} +0 -0
- /package/src/body/{Body.spec.tsx → Body.test.tsx} +0 -0
- /package/src/button/{Button.spec.tsx → Button.test.tsx} +0 -0
- /package/src/button/{LegacyButton.spec.tsx → LegacyButton.test.tsx} +0 -0
- /package/src/button/_stories/{Button.brightGreen.tests.story.tsx → Button.brightGreen.test.story.tsx} +0 -0
- /package/src/button/_stories/{Button.dark.tests.story.tsx → Button.dark.test.story.tsx} +0 -0
- /package/src/button/_stories/{Button.default.tests.story.tsx → Button.default.test.story.tsx} +0 -0
- /package/src/button/_stories/{Button.forestGreen.tests.story.tsx → Button.forestGreen.test.story.tsx} +0 -0
- /package/src/button/legacyUtils/{legacyUtils.spec.tsx → legacyUtils.test.tsx} +0 -0
- /package/src/card/{Card.spec.tsx → Card.test.tsx} +0 -0
- /package/src/carousel/{Carousel.spec.tsx → Carousel.test.tsx} +0 -0
- /package/src/checkbox/{Checkbox.spec.tsx → Checkbox.test.tsx} +0 -0
- /package/src/checkbox/__snapshots__/{Checkbox.spec.tsx.snap → Checkbox.test.tsx.snap} +0 -0
- /package/src/checkboxButton/{CheckboxButton.spec.tsx → CheckboxButton.test.tsx} +0 -0
- /package/src/checkboxOption/{CheckboxOption.spec.tsx → CheckboxOption.test.tsx} +0 -0
- /package/src/chevron/{Chevron.spec.tsx → Chevron.test.tsx} +0 -0
- /package/src/chevron/__snapshots__/{Chevron.spec.tsx.snap → Chevron.test.tsx.snap} +0 -0
- /package/src/chips/{Chips.spec.tsx → Chips.test.tsx} +0 -0
- /package/src/chips/__snapshots__/{Chips.spec.tsx.snap → Chips.test.tsx.snap} +0 -0
- /package/src/circularButton/{CircularButton.tests.story.tsx → CircularButton.test.story.tsx} +0 -0
- /package/src/circularButton/{CircularButton.spec.tsx → CircularButton.test.tsx} +0 -0
- /package/src/common/DOMOperations/{DOMOperations.spec.tsx → DOMOperations.test.tsx} +0 -0
- /package/src/common/Option/{Option.spec.tsx → Option.test.tsx} +0 -0
- /package/src/common/RadioButton/{RadioButton.spec.tsx → RadioButton.test.tsx} +0 -0
- /package/src/common/RadioButton/__snapshots__/{RadioButton.spec.tsx.snap → RadioButton.test.tsx.snap} +0 -0
- /package/src/common/bottomSheet/{BottomSheet.spec.tsx → BottomSheet.test.tsx} +0 -0
- /package/src/common/bottomSheet/__snapshots__/{BottomSheet.spec.tsx.snap → BottomSheet.test.tsx.snap} +0 -0
- /package/src/common/card/{Card.spec.tsx → Card.test.tsx} +0 -0
- /package/src/common/card/__snapshots__/{Card.spec.tsx.snap → Card.test.tsx.snap} +0 -0
- /package/src/common/closeButton/{CloseButton.spec.tsx → CloseButton.test.tsx} +0 -0
- /package/src/common/closeButton/__snapshots__/{CloseButton.spec.tsx.snap → CloseButton.test.tsx.snap} +0 -0
- /package/src/common/dateUtils/getDayNames/{getDayNames.spec.js → getDayNames.test.js} +0 -0
- /package/src/common/dateUtils/getMonthNames/{getMonthNames.spec.js → getMonthNames.test.js} +0 -0
- /package/src/common/dateUtils/isDateValid/{isDateValid.spec.ts → isDateValid.test.ts} +0 -0
- /package/src/common/dateUtils/isMonthAndYearFormat/{isMonthAndYearFormat.spec.js → isMonthAndYearFormat.test.js} +0 -0
- /package/src/common/dateUtils/isWithinRange/{isWithinRange.spec.ts → isWithinRange.test.ts} +0 -0
- /package/src/common/dateUtils/moveToWithinRange/{moveToWithinRange.spec.js → moveToWithinRange.test.js} +0 -0
- /package/src/common/deviceDetection/{deviceDetection.spec.ts → deviceDetection.test.ts} +0 -0
- /package/src/common/domHelpers/{documentIosClick.spec.ts → documentIosClick.test.ts} +0 -0
- /package/src/common/flowHeader/{FlowHeader.spec.tsx → FlowHeader.test.tsx} +0 -0
- /package/src/common/flowHeader/__snapshots__/{FlowHeader.spec.tsx.snap → FlowHeader.test.tsx.snap} +0 -0
- /package/src/common/historyNavigator/{historyNavigator.spec.ts → historyNavigator.test.ts} +0 -0
- /package/src/common/hooks/useConditionalListener/{useConditionalListener.spec.js → useConditionalListener.test.js} +0 -0
- /package/src/common/hooks/useDirection/{useDirection.spec.js → useDirection.test.js} +0 -0
- /package/src/common/hooks/useHasIntersected/{useHasIntersected.spec.js → useHasIntersected.test.js} +0 -0
- /package/src/common/hooks/{useMedia.spec.ts → useMedia.test.ts} +0 -0
- /package/src/common/{initials.spec.tsx → initials.test.tsx} +0 -0
- /package/src/common/locale/{index.spec.ts → index.test.ts} +0 -0
- /package/src/common/panel/{Panel.spec.tsx → Panel.test.tsx} +0 -0
- /package/src/common/panel/__snapshots__/{Panel.spec.tsx.snap → Panel.test.tsx.snap} +0 -0
- /package/src/common/responsivePanel/{ResponsivePanel.spec.js → ResponsivePanel.test.js} +0 -0
- /package/src/common/textFormat/formatWithPattern/{formatWithPattern.spec.ts → formatWithPattern.test.ts} +0 -0
- /package/src/common/textFormat/getCountOfSymbolsInSelection/{getCountOfSymbolsInSelection.spec.ts → getCountOfSymbolsInSelection.test.ts} +0 -0
- /package/src/common/textFormat/getCursorPositionAfterKeystroke/{getCursorPositionAfterKeystroke.spec.ts → getCursorPositionAfterKeystroke.test.ts} +0 -0
- /package/src/common/textFormat/getDistanceToSymbol/{getDistanceToSymbol.spec.ts → getDistanceToSymbol.test.ts} +0 -0
- /package/src/common/textFormat/getSymbolsInPatternWithPosition/{getSymbolsInPatternWithPosition.spec.ts → getSymbolsInPatternWithPosition.test.ts} +0 -0
- /package/src/common/textFormat/unformatWithPattern/{unformatWithPattern.spec.ts → unformatWithPattern.test.ts} +0 -0
- /package/src/dateInput/{DateInput.spec.tsx → DateInput.test.tsx} +0 -0
- /package/src/dateInput/utils/convertToLocalMidnight/{convertToLocalMidnight.spec.ts → convertToLocalMidnight.test.ts} +0 -0
- /package/src/dateLookup/{DateLookup.tests.story.tsx → DateLookup.test.story.tsx} +0 -0
- /package/src/dateLookup/{DateLookup.spec.tsx → DateLookup.test.tsx} +0 -0
- /package/src/dateLookup/getFocusableTime/{getFocusable.spec.ts → getFocusable.test.ts} +0 -0
- /package/src/dateLookup/getStartOfDay/{getStartOfDay.spec.js → getStartOfDay.test.js} +0 -0
- /package/src/decision/{Decision.spec.tsx → Decision.test.tsx} +0 -0
- /package/src/dimmer/{Dimmer.spec.tsx → Dimmer.test.tsx} +0 -0
- /package/src/divider/{Divider.spec.tsx → Divider.test.tsx} +0 -0
- /package/src/drawer/{Drawer.spec.tsx → Drawer.test.tsx} +0 -0
- /package/src/emphasis/{Emphasis.spec.tsx → Emphasis.test.tsx} +0 -0
- /package/src/emphasis/{EmphasisHtmlTransformer.spec.tsx → EmphasisHtmlTransformer.test.tsx} +0 -0
- /package/src/expressiveMoneyInput/{ExpressiveMoneyInput.spec.tsx → ExpressiveMoneyInput.test.tsx} +0 -0
- /package/src/expressiveMoneyInput/amountInput/{AmountInput.spec.tsx → AmountInput.test.tsx} +0 -0
- /package/src/expressiveMoneyInput/amountInput/{utils.spec.ts → utils.test.ts} +0 -0
- /package/src/expressiveMoneyInput/currencySelector/{CurrencySelector.spec.tsx → CurrencySelector.test.tsx} +0 -0
- /package/src/field/{Field.spec.tsx → Field.test.tsx} +0 -0
- /package/src/flowNavigation/{FlowNavigation.spec.js → FlowNavigation.test.js} +0 -0
- /package/src/flowNavigation/__snapshots__/{FlowNavigation.spec.js.snap → FlowNavigation.test.js.snap} +0 -0
- /package/src/flowNavigation/animatedLabel/{AnimatedLabel.spec.js → AnimatedLabel.test.js} +0 -0
- /package/src/header/{Header.spec.tsx → Header.test.tsx} +0 -0
- /package/src/iconButton/{iconButton.spec.tsx → iconButton.test.tsx} +0 -0
- /package/src/image/{Image.spec.tsx → Image.test.tsx} +0 -0
- /package/src/info/{Info.spec.jsx → Info.test.jsx} +0 -0
- /package/src/inlineAlert/{InlineAlert.spec.tsx → InlineAlert.test.tsx} +0 -0
- /package/src/inputWithDisplayFormat/{InputWithDisplayFormat.spec.js → InputWithDisplayFormat.test.js} +0 -0
- /package/src/inputs/{InputGroup.spec.tsx → InputGroup.test.tsx} +0 -0
- /package/src/inputs/{SearchInput.spec.tsx → SearchInput.test.tsx} +0 -0
- /package/src/instructionsList/{InstructionsList.spec.tsx → InstructionsList.test.tsx} +0 -0
- /package/src/label/{Label.spec.tsx → Label.test.tsx} +0 -0
- /package/src/legacylistItem/{LegacyListItem.tests.story.tsx → LegacyListItem.test.story.tsx} +0 -0
- /package/src/legacylistItem/{LegacyListItem.spec.tsx → LegacyListItem.test.tsx} +0 -0
- /package/src/link/{Link.spec.tsx → Link.test.tsx} +0 -0
- /package/src/list/{List.spec.tsx → List.test.tsx} +0 -0
- /package/src/listItem/AdditionalInfo/{ListItemAdditionalInfo.spec.tsx → ListItemAdditionalInfo.test.tsx} +0 -0
- /package/src/listItem/AvatarLayout/{ListItemAvatarLayout.spec.tsx → ListItemAvatarLayout.test.tsx} +0 -0
- /package/src/listItem/AvatarView/{ListItemAvatarView.spec.tsx → ListItemAvatarView.test.tsx} +0 -0
- /package/src/listItem/Button/{ListItemButton.spec.tsx → ListItemButton.test.tsx} +0 -0
- /package/src/listItem/Checkbox/{ListItemCheckbox.spec.tsx → ListItemCheckbox.test.tsx} +0 -0
- /package/src/listItem/IconButton/{ListItemIconButton.spec.tsx → ListItemIconButton.test.tsx} +0 -0
- /package/src/listItem/Image/{ListItemImage.spec.tsx → ListItemImage.test.tsx} +0 -0
- /package/src/listItem/{ListItem.spec.tsx → ListItem.test.tsx} +0 -0
- /package/src/listItem/Navigation/{ListItemNavigation.spec.tsx → ListItemNavigation.test.tsx} +0 -0
- /package/src/listItem/Prompt/{ListItemPrompt.spec.tsx → ListItemPrompt.test.tsx} +0 -0
- /package/src/listItem/Radio/{ListItemRadio.spec.tsx → ListItemRadio.test.tsx} +0 -0
- /package/src/listItem/Switch/{ListItemSwitch.spec.tsx → ListItemSwitch.test.tsx} +0 -0
- /package/src/loader/{Loader.spec.tsx → Loader.test.tsx} +0 -0
- /package/src/logo/{Logo.spec.tsx → Logo.test.tsx} +0 -0
- /package/src/logo/__snapshots__/{Logo.spec.tsx.snap → Logo.test.tsx.snap} +0 -0
- /package/src/markdown/{Markdown.spec.tsx → Markdown.test.tsx} +0 -0
- /package/src/modal/{Modal.spec.tsx → Modal.test.tsx} +0 -0
- /package/src/money/{Money.spec.tsx → Money.test.tsx} +0 -0
- /package/src/moneyInput/{currencyFormatting.spec.ts → currencyFormatting.test.ts} +0 -0
- /package/src/navigationOption/{NavigationOption.spec.tsx → NavigationOption.test.tsx} +0 -0
- /package/src/navigationOptionsList/{NavigationOptionsList.spec.tsx → NavigationOptionsList.test.tsx} +0 -0
- /package/src/nudge/{Nudge.spec.tsx → Nudge.test.tsx} +0 -0
- /package/src/overlayHeader/{OverlayHeader.spec.tsx → OverlayHeader.test.tsx} +0 -0
- /package/src/overlayHeader/__snapshots__/{OverlayHeader.spec.tsx.snap → OverlayHeader.test.tsx.snap} +0 -0
- /package/src/phoneNumberInput/{PhoneNumberInput.spec.tsx → PhoneNumberInput.test.tsx} +0 -0
- /package/src/phoneNumberInput/utils/cleanNumber/{cleanNumber.spec.ts → cleanNumber.test.ts} +0 -0
- /package/src/phoneNumberInput/utils/excludeCountries/{excludeCountries.spec.ts → excludeCountries.test.ts} +0 -0
- /package/src/phoneNumberInput/utils/explodeNumberModel/{explodeNumberModel.spec.ts → explodeNumberModel.test.ts} +0 -0
- /package/src/phoneNumberInput/utils/findCountryByCode/{findCountryByCode.spec.ts → findCountryByCode.test.ts} +0 -0
- /package/src/phoneNumberInput/utils/findCountryByPrefix/{findCountryByPrefix.spec.ts → findCountryByPrefix.test.ts} +0 -0
- /package/src/phoneNumberInput/utils/groupCountriesByPrefix/{groupCountriesByPrefix.spec.ts → groupCountriesByPrefix.test.ts} +0 -0
- /package/src/phoneNumberInput/utils/isStringNumeric/{isStringNumeric.spec.ts → isStringNumeric.test.ts} +0 -0
- /package/src/phoneNumberInput/utils/isValidPhoneNumber/{isValidPhoneNumber.spec.ts → isValidPhoneNumber.test.ts} +0 -0
- /package/src/phoneNumberInput/utils/longestMatchingPrefix/{longestMatchingPrefix.spec.ts → longestMatchingPrefix.test.ts} +0 -0
- /package/src/phoneNumberInput/utils/setDefaultPrefix/{setDefaultPrefix.spec.ts → setDefaultPrefix.test.ts} +0 -0
- /package/src/phoneNumberInput/utils/sortArrayByProperty/{sortArrayByProperty.spec.ts → sortArrayByProperty.test.ts} +0 -0
- /package/src/popover/{Popover.spec.tsx → Popover.test.tsx} +0 -0
- /package/src/popover/__snapshots__/{Popover.spec.tsx.snap → Popover.test.tsx.snap} +0 -0
- /package/src/primitives/PrimitiveAnchor/stories/{PrimitiveAnchor.tests.story.tsx → PrimitiveAnchor.test.story.tsx} +0 -0
- /package/src/primitives/PrimitiveAnchor/test/{PrimitiveAnchor.spec.tsx → PrimitiveAnchor.test.tsx} +0 -0
- /package/src/primitives/PrimitiveButton/stories/{PrimitiveButton.tests.story.tsx → PrimitiveButton.test.story.tsx} +0 -0
- /package/src/primitives/PrimitiveButton/test/{PrimitiveButton.spec.tsx → PrimitiveButton.test.tsx} +0 -0
- /package/src/processIndicator/{ProcessIndicator.rtl.spec.tsx → ProcessIndicator.rtl.test.tsx} +0 -0
- /package/src/progress/{Progress.spec.tsx → Progress.test.tsx} +0 -0
- /package/src/progressBar/{ProgressBar.spec.tsx → ProgressBar.test.tsx} +0 -0
- /package/src/promoCard/{PromoCard.spec.tsx → PromoCard.test.tsx} +0 -0
- /package/src/promoCard/{PromoCardContext.spec.tsx → PromoCardContext.test.tsx} +0 -0
- /package/src/promoCard/{PromoCardGroup.spec.tsx → PromoCardGroup.test.tsx} +0 -0
- /package/src/promoCard/__snapshots__/{PromoCard.spec.tsx.snap → PromoCard.test.tsx.snap} +0 -0
- /package/src/promoCard/__snapshots__/{PromoCardGroup.spec.tsx.snap → PromoCardGroup.test.tsx.snap} +0 -0
- /package/src/provider/{Provider.spec.tsx → Provider.test.tsx} +0 -0
- /package/src/provider/direction/{DirectionProvider.spec.tsx → DirectionProvider.test.tsx} +0 -0
- /package/src/provider/language/{LanguageProvider.spec.tsx → LanguageProvider.test.tsx} +0 -0
- /package/src/radio/{Radio.spec.tsx → Radio.test.tsx} +0 -0
- /package/src/radioGroup/{RadioGroup.spec.tsx → RadioGroup.test.tsx} +0 -0
- /package/src/radioOption/{RadioOption.spec.tsx → RadioOption.test.tsx} +0 -0
- /package/src/section/{Section.spec.tsx → Section.test.tsx} +0 -0
- /package/src/segmentedControl/{SegmentedControl.spec.tsx → SegmentedControl.test.tsx} +0 -0
- /package/src/select/{Select.rtl.spec.tsx → Select.rtl.test.tsx} +0 -0
- /package/src/select/{Select.spec.tsx → Select.test.tsx} +0 -0
- /package/src/select/option/{Option.spec.tsx → Option.test.tsx} +0 -0
- /package/src/select/searchBox/{SearchBox.spec.tsx → SearchBox.test.tsx} +0 -0
- /package/src/sentimentSurface/{SentimentSurface.tests.story.tsx → SentimentSurface.test.story.tsx} +0 -0
- /package/src/sentimentSurface/{SentimentSurface.spec.tsx → SentimentSurface.test.tsx} +0 -0
- /package/src/slidingPanel/{SlidingPanel.spec.tsx → SlidingPanel.test.tsx} +0 -0
- /package/src/statusIcon/{StatusIcon.spec.tsx → StatusIcon.test.tsx} +0 -0
- /package/src/stepper/{Stepper.tests.story.tsx → Stepper.test.story.tsx} +0 -0
- /package/src/stepper/{Stepper.spec.tsx → Stepper.test.tsx} +0 -0
- /package/src/stepper/{deviceDetection.spec.ts → deviceDetection.test.ts} +0 -0
- /package/src/sticky/{Sticky.spec.tsx → Sticky.test.tsx} +0 -0
- /package/src/summary/{Summary.tests.story.tsx → Summary.test.story.tsx} +0 -0
- /package/src/summary/{Summary.spec.tsx → Summary.test.tsx} +0 -0
- /package/src/switch/{Switch.spec.tsx → Switch.test.tsx} +0 -0
- /package/src/switchOption/{SwitchOption.spec.tsx → SwitchOption.test.tsx} +0 -0
- /package/src/table/{Table.spec.tsx → Table.test.tsx} +0 -0
- /package/src/table/{TableCell.spec.tsx → TableCell.test.tsx} +0 -0
- /package/src/table/{TableHeader.spec.tsx → TableHeader.test.tsx} +0 -0
- /package/src/table/{TableRow.spec.tsx → TableRow.test.tsx} +0 -0
- /package/src/table/{TableStatusText.spec.tsx → TableStatusText.test.tsx} +0 -0
- /package/src/textareaWithDisplayFormat/{TextareaWithDisplayFormat.spec.js → TextareaWithDisplayFormat.test.js} +0 -0
- /package/src/tile/{Tile.spec.tsx → Tile.test.tsx} +0 -0
- /package/src/tile/__snapshots__/{Tile.spec.tsx.snap → Tile.test.tsx.snap} +0 -0
- /package/src/title/{Title.spec.tsx → Title.test.tsx} +0 -0
- /package/src/tooltip/{Tooltip.spec.tsx → Tooltip.test.tsx} +0 -0
- /package/src/tooltip/__snapshots__/{Tooltip.spec.tsx.snap → Tooltip.test.tsx.snap} +0 -0
- /package/src/typeahead/{Typeahead.spec.tsx → Typeahead.test.tsx} +0 -0
- /package/src/typeahead/typeaheadInput/{TypeaheadInput.spec.tsx → TypeaheadInput.test.tsx} +0 -0
- /package/src/typeahead/util/{highlight.spec.tsx → highlight.test.tsx} +0 -0
- /package/src/upload/{Upload.tests.story.tsx → Upload.test.story.tsx} +0 -0
- /package/src/upload/{Upload.spec.tsx → Upload.test.tsx} +0 -0
- /package/src/upload/steps/completeStep/{completeStep.spec.tsx → completeStep.test.tsx} +0 -0
- /package/src/upload/steps/processingStep/{processingStep.spec.tsx → processingStep.test.tsx} +0 -0
- /package/src/upload/steps/uploadImageStep/{uploadImageStep.spec.tsx → uploadImageStep.test.tsx} +0 -0
- /package/src/upload/utils/asyncFileRead/{asyncFileRead.spec.ts → asyncFileRead.test.ts} +0 -0
- /package/src/upload/utils/getFileType/{getFileType.spec.ts → getFileType.test.ts} +0 -0
- /package/src/upload/utils/isSizeValid/{isSizeValid.spec.ts → isSizeValid.test.ts} +0 -0
- /package/src/upload/utils/isTypeValid/{isTypeValid.spec.ts → isTypeValid.test.ts} +0 -0
- /package/src/upload/utils/postData/{postData.spec.ts → postData.test.ts} +0 -0
- /package/src/uploadInput/{UploadInput.tests.story.tsx → UploadInput.test.story.tsx} +0 -0
- /package/src/uploadInput/{UploadInput.spec.tsx → UploadInput.test.tsx} +0 -0
- /package/src/uploadInput/uploadButton/{UploadButton.spec.tsx → UploadButton.test.tsx} +0 -0
- /package/src/uploadInput/uploadButton/{getAllowedFileTypes.spec.ts → getAllowedFileTypes.test.ts} +0 -0
- /package/src/uploadInput/uploadItem/{UploadItem.spec.tsx → UploadItem.test.tsx} +0 -0
- /package/src/utilities/deprecatedProperty/{deprecatedProperty.spec.ts → deprecatedProperty.test.ts} +0 -0
- /package/src/withDisplayFormat/{WithDisplayFormat.spec.js → WithDisplayFormat.test.js} +0 -0
- /package/src/withId/{withId.spec.tsx → withId.test.tsx} +0 -0
- /package/src/withNextPortal/{withNextPortal.spec.tsx → withNextPortal.test.tsx} +0 -0
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Listbox as ListboxBase,
|
|
3
|
+
ListboxButton,
|
|
4
|
+
ListboxOption,
|
|
5
|
+
ListboxOptions,
|
|
6
|
+
} from '@headlessui/react';
|
|
2
7
|
import { Check, ChevronDown, Cross, CrossCircle } from '@transferwise/icons';
|
|
3
8
|
import { clsx } from 'clsx';
|
|
4
9
|
import mergeProps from 'merge-props';
|
|
@@ -427,8 +432,8 @@ export function SelectInput<T = string, M extends boolean = false>({
|
|
|
427
432
|
<ListboxBase
|
|
428
433
|
name={name}
|
|
429
434
|
multiple={multiple}
|
|
430
|
-
defaultValue={defaultValue}
|
|
431
|
-
value={controlledValue}
|
|
435
|
+
defaultValue={defaultValue as M extends true ? T[] : T}
|
|
436
|
+
value={controlledValue as M extends true ? T[] : T}
|
|
432
437
|
by={compareValues}
|
|
433
438
|
disabled={disabled}
|
|
434
439
|
onChange={
|
|
@@ -576,7 +581,7 @@ export function SelectInputTriggerButton<T extends SelectInputTriggerButtonEleme
|
|
|
576
581
|
);
|
|
577
582
|
|
|
578
583
|
return (
|
|
579
|
-
<
|
|
584
|
+
<ListboxButton
|
|
580
585
|
ref={ref}
|
|
581
586
|
as={PolymorphicWithOverrides}
|
|
582
587
|
role="combobox"
|
|
@@ -617,8 +622,13 @@ const SelectInputOptionsContainer = forwardRef(function SelectInputOptionsContai
|
|
|
617
622
|
return;
|
|
618
623
|
}
|
|
619
624
|
|
|
620
|
-
//
|
|
621
|
-
if (event.key === '
|
|
625
|
+
// Required to make ListBox focusable
|
|
626
|
+
if (event.key === 'Tab') {
|
|
627
|
+
return;
|
|
628
|
+
}
|
|
629
|
+
|
|
630
|
+
// Prevent absorbing Escape early
|
|
631
|
+
if (event.key === 'Escape') {
|
|
622
632
|
onKeyDown?.({
|
|
623
633
|
...event,
|
|
624
634
|
preventDefault: () => {},
|
|
@@ -817,7 +827,8 @@ function SelectInputOptions<T = string>({
|
|
|
817
827
|
};
|
|
818
828
|
|
|
819
829
|
return (
|
|
820
|
-
<
|
|
830
|
+
<ListboxOptions
|
|
831
|
+
modal
|
|
821
832
|
as={SelectInputOptionsContainer}
|
|
822
833
|
static
|
|
823
834
|
className="np-select-input-options-container"
|
|
@@ -974,7 +985,7 @@ function SelectInputOptions<T = string>({
|
|
|
974
985
|
</footer>
|
|
975
986
|
) : null}
|
|
976
987
|
</section>
|
|
977
|
-
</
|
|
988
|
+
</ListboxOptions>
|
|
978
989
|
);
|
|
979
990
|
}
|
|
980
991
|
|
|
@@ -1083,7 +1094,7 @@ function SelectInputOption<T = string>({ value, disabled, children }: SelectInpu
|
|
|
1083
1094
|
const itemsCount = useContext(SelectInputItemsCountContext);
|
|
1084
1095
|
const itemPosition = useContext(SelectInputItemPositionContext);
|
|
1085
1096
|
return (
|
|
1086
|
-
<
|
|
1097
|
+
<ListboxOption
|
|
1087
1098
|
as="div"
|
|
1088
1099
|
value={value}
|
|
1089
1100
|
aria-setsize={itemsCount}
|
|
@@ -1109,7 +1120,7 @@ function SelectInputOption<T = string>({ value, disabled, children }: SelectInpu
|
|
|
1109
1120
|
/>
|
|
1110
1121
|
</>
|
|
1111
1122
|
)}
|
|
1112
|
-
</
|
|
1123
|
+
</ListboxOption>
|
|
1113
1124
|
);
|
|
1114
1125
|
}
|
|
1115
1126
|
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
useInteractions,
|
|
7
7
|
useRole,
|
|
8
8
|
} from '@floating-ui/react';
|
|
9
|
-
import { Transition } from '@headlessui/react';
|
|
9
|
+
import { Transition, TransitionChild } from '@headlessui/react';
|
|
10
10
|
import { FocusScope } from '@react-aria/focus';
|
|
11
11
|
import { ThemeProvider, useTheme } from '@wise/components-theming';
|
|
12
12
|
import { clsx } from 'clsx';
|
|
@@ -73,6 +73,7 @@ export function BottomSheet({
|
|
|
73
73
|
<FloatingPortal>
|
|
74
74
|
<ThemeProvider theme="personal" screenMode={theme === 'personal' ? screenMode : 'light'}>
|
|
75
75
|
<Transition
|
|
76
|
+
as="div"
|
|
76
77
|
show={open}
|
|
77
78
|
className="np-bottom-sheet-v2-container"
|
|
78
79
|
beforeEnter={() => {
|
|
@@ -80,7 +81,8 @@ export function BottomSheet({
|
|
|
80
81
|
}}
|
|
81
82
|
afterLeave={onCloseEnd}
|
|
82
83
|
>
|
|
83
|
-
<
|
|
84
|
+
<TransitionChild
|
|
85
|
+
as="div"
|
|
84
86
|
className="np-bottom-sheet-v2-backdrop"
|
|
85
87
|
enterFrom="np-bottom-sheet-v2-backdrop--closed"
|
|
86
88
|
leaveTo="np-bottom-sheet-v2-backdrop--closed"
|
|
@@ -92,8 +94,9 @@ export function BottomSheet({
|
|
|
92
94
|
<Fragment
|
|
93
95
|
key={floatingKey} // Force inner state invalidation on open
|
|
94
96
|
>
|
|
95
|
-
<
|
|
97
|
+
<TransitionChild
|
|
96
98
|
ref={refs.setFloating}
|
|
99
|
+
as="div"
|
|
97
100
|
className="np-bottom-sheet-v2-content"
|
|
98
101
|
enterFrom="np-bottom-sheet-v2-content--closed"
|
|
99
102
|
leaveTo="np-bottom-sheet-v2-content--closed"
|
|
@@ -121,7 +124,7 @@ export function BottomSheet({
|
|
|
121
124
|
{children}
|
|
122
125
|
</div>
|
|
123
126
|
</div>
|
|
124
|
-
</
|
|
127
|
+
</TransitionChild>
|
|
125
128
|
</Fragment>
|
|
126
129
|
</FloatingFocusManager>
|
|
127
130
|
</FocusScope>
|
package/src/inputs/_Popover.tsx
CHANGED
|
@@ -51,6 +51,7 @@ export function Popover({
|
|
|
51
51
|
onCloseEnd,
|
|
52
52
|
}: PopoverProps) {
|
|
53
53
|
const { refs, floatingStyles, context } = useFloating<Element>({
|
|
54
|
+
strategy: 'fixed',
|
|
54
55
|
placement,
|
|
55
56
|
middleware: [
|
|
56
57
|
offset(8),
|
|
@@ -92,6 +93,7 @@ export function Popover({
|
|
|
92
93
|
<FloatingPortal>
|
|
93
94
|
<ThemeProvider theme="personal" screenMode={theme === 'personal' ? screenMode : 'light'}>
|
|
94
95
|
<Transition
|
|
96
|
+
as="div"
|
|
95
97
|
show={open}
|
|
96
98
|
leave="transition-opacity"
|
|
97
99
|
leaveTo="opacity-0"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react-webpack5';
|
|
2
2
|
import { ListItem, type ListItemProps } from '../../ListItem';
|
|
3
3
|
import { VariantStory } from './helpers';
|
|
4
|
-
import {
|
|
4
|
+
import { withVariantConfig } from '../../../../.storybook/helpers';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
@@ -16,12 +16,7 @@ export default {
|
|
|
16
16
|
|
|
17
17
|
const Default = {
|
|
18
18
|
...VariantStory,
|
|
19
|
-
|
|
20
|
-
variants: ['bright-green'],
|
|
21
|
-
chromatic: {
|
|
22
|
-
'bright-green': allModes.brightGreen,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
19
|
+
...withVariantConfig(['bright-green'], VariantStory),
|
|
25
20
|
args: { variant: 'bright-green' },
|
|
26
21
|
};
|
|
27
22
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react-webpack5';
|
|
2
2
|
import { ListItem, type ListItemProps } from '../../ListItem';
|
|
3
3
|
import { VariantStory } from './helpers';
|
|
4
|
-
import {
|
|
4
|
+
import { withVariantConfig } from '../../../../.storybook/helpers';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
@@ -16,12 +16,7 @@ export default {
|
|
|
16
16
|
|
|
17
17
|
const Default = {
|
|
18
18
|
...VariantStory,
|
|
19
|
-
|
|
20
|
-
variants: ['dark'],
|
|
21
|
-
chromatic: {
|
|
22
|
-
dark: allModes.dark,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
19
|
+
...withVariantConfig(['dark'], VariantStory),
|
|
25
20
|
args: { variant: 'dark' },
|
|
26
21
|
};
|
|
27
22
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react-webpack5';
|
|
2
2
|
import { ListItem, type ListItemProps } from '../../ListItem';
|
|
3
3
|
import { VariantStory } from './helpers';
|
|
4
|
-
import {
|
|
4
|
+
import { withVariantConfig } from '../../../../.storybook/helpers';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
@@ -16,12 +16,7 @@ export default {
|
|
|
16
16
|
|
|
17
17
|
const Default = {
|
|
18
18
|
...VariantStory,
|
|
19
|
-
|
|
20
|
-
variants: ['forest-green'],
|
|
21
|
-
chromatic: {
|
|
22
|
-
forestGreen: allModes.forestGreen,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
19
|
+
...withVariantConfig(['forest-green'], VariantStory),
|
|
25
20
|
args: { variant: 'forest-green' },
|
|
26
21
|
};
|
|
27
22
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Meta } from '@storybook/react-webpack5';
|
|
2
2
|
import { ListItem, type ListItemProps } from '../../ListItem';
|
|
3
3
|
import { VariantStory } from './helpers';
|
|
4
|
-
import {
|
|
4
|
+
import { withVariantConfig } from '../../../../.storybook/helpers';
|
|
5
5
|
|
|
6
6
|
export default {
|
|
7
7
|
component: ListItem,
|
|
@@ -16,12 +16,7 @@ export default {
|
|
|
16
16
|
|
|
17
17
|
const Default = {
|
|
18
18
|
...VariantStory,
|
|
19
|
-
|
|
20
|
-
variants: ['rtl'],
|
|
21
|
-
chromatic: {
|
|
22
|
-
rtl: allModes.rtl,
|
|
23
|
-
},
|
|
24
|
-
},
|
|
19
|
+
...withVariantConfig(['rtl'], VariantStory),
|
|
25
20
|
args: { variant: 'rtl' },
|
|
26
21
|
};
|
|
27
22
|
|
package/src/main.css
CHANGED
|
@@ -5337,8 +5337,10 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5337
5337
|
}
|
|
5338
5338
|
.wds-prompt {
|
|
5339
5339
|
border-radius: 10px;
|
|
5340
|
-
border-radius: var(--radius-small);
|
|
5340
|
+
border-radius: var(--Prompt-border-radius, var(--radius-small));
|
|
5341
5341
|
display: flex;
|
|
5342
|
+
gap: 16px;
|
|
5343
|
+
gap: var(--Prompt-gap, var(--size-16));
|
|
5342
5344
|
word-wrap: break-word;
|
|
5343
5345
|
padding: 8px;
|
|
5344
5346
|
padding: var(--Prompt-padding, var(--padding-x-small));
|
|
@@ -5354,6 +5356,9 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5354
5356
|
grid-template-columns: auto 1fr;
|
|
5355
5357
|
width: 100%;
|
|
5356
5358
|
}
|
|
5359
|
+
.wds-prompt__content-wrapper--with-dismiss {
|
|
5360
|
+
grid-template-columns: auto 1fr auto;
|
|
5361
|
+
}
|
|
5357
5362
|
.wds-prompt__media-wrapper {
|
|
5358
5363
|
align-self: flex-start;
|
|
5359
5364
|
padding-top: calc(4px - 1px);
|
|
@@ -5369,12 +5374,16 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5369
5374
|
gap: 8px;
|
|
5370
5375
|
gap: var(--Prompt-actions-gap, var(--size-8));
|
|
5371
5376
|
grid-column-start: 2;
|
|
5377
|
+
grid-column-end: 3;
|
|
5372
5378
|
}
|
|
5373
|
-
@media (max-width:
|
|
5379
|
+
@media (max-width: 767px) {
|
|
5374
5380
|
.wds-prompt__actions-wrapper {
|
|
5375
5381
|
grid-column: span 2;
|
|
5376
5382
|
width: 100%;
|
|
5377
5383
|
}
|
|
5384
|
+
.wds-prompt__content-wrapper--with-dismiss .wds-prompt__actions-wrapper {
|
|
5385
|
+
grid-column: span 3;
|
|
5386
|
+
}
|
|
5378
5387
|
}
|
|
5379
5388
|
.wds-inline-prompt {
|
|
5380
5389
|
--Prompt-gap: calc(var(--size-12) / 2);
|
|
@@ -7423,3 +7432,24 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
7423
7432
|
.np-list-item__action {
|
|
7424
7433
|
flex-shrink: 0;
|
|
7425
7434
|
}
|
|
7435
|
+
.wds-action-prompt {
|
|
7436
|
+
--Prompt-padding: var(--size-16);
|
|
7437
|
+
--Prompt-actions-gap: var(--size-8);
|
|
7438
|
+
--Prompt-gap: var(--size-10) var(--size-16);
|
|
7439
|
+
--Prompt-border-radius: var(--radius-large);
|
|
7440
|
+
}
|
|
7441
|
+
.wds-action-prompt--media-image {
|
|
7442
|
+
width: 48px;
|
|
7443
|
+
width: var(--size-48);
|
|
7444
|
+
height: 48px;
|
|
7445
|
+
height: var(--size-48);
|
|
7446
|
+
-o-object-fit: contain;
|
|
7447
|
+
object-fit: contain;
|
|
7448
|
+
}
|
|
7449
|
+
@media (max-width: 767px) {
|
|
7450
|
+
.wds-action-prompt--with-two-actions .wds-prompt__actions-wrapper .wds-Button {
|
|
7451
|
+
flex: 1 1 calc(50% - (var(--Prompt-actions-gap) / 2));
|
|
7452
|
+
min-width: -moz-fit-content;
|
|
7453
|
+
min-width: fit-content;
|
|
7454
|
+
}
|
|
7455
|
+
}
|
package/src/main.less
CHANGED
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
@import "./progress/Progress.less";
|
|
87
87
|
@import "./progressBar/ProgressBar.less";
|
|
88
88
|
@import "./legacylistItem/LegacyListItem.less";
|
|
89
|
+
@import "./prompt/ActionPrompt/ActionPrompt.less";
|
|
89
90
|
|
|
90
91
|
// List all less files in src in alphabetical order: find -s src -type f -name '*.less' ! -name 'main.less'
|
|
91
92
|
// Make sure you are not referencing main.less itself in this file!
|
|
@@ -6,7 +6,7 @@ import { useState } from 'react';
|
|
|
6
6
|
import { Button, Modal, ModalProps } from '..';
|
|
7
7
|
import { CommonProps, Scroll } from '../common';
|
|
8
8
|
import { lorem10, lorem100, lorem1000 } from '../test-utils';
|
|
9
|
-
import {
|
|
9
|
+
import { withVariantConfig } from '../../.storybook/helpers';
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
12
|
component: Modal,
|
|
@@ -78,12 +78,7 @@ export const Basic: Story = {
|
|
|
78
78
|
|
|
79
79
|
export const BasicMobile: Story = {
|
|
80
80
|
...Basic,
|
|
81
|
-
|
|
82
|
-
variants: ['mobile'],
|
|
83
|
-
chromatic: {
|
|
84
|
-
mobile: allModes.largeMobile,
|
|
85
|
-
},
|
|
86
|
-
},
|
|
81
|
+
...withVariantConfig(['mobile'], Basic),
|
|
87
82
|
};
|
|
88
83
|
|
|
89
84
|
export const ContentScroll: Story = {
|
|
@@ -97,12 +92,7 @@ export const ContentScroll: Story = {
|
|
|
97
92
|
|
|
98
93
|
export const ContentScrollMobile: Story = {
|
|
99
94
|
...ContentScroll,
|
|
100
|
-
|
|
101
|
-
variants: ['mobile'],
|
|
102
|
-
chromatic: {
|
|
103
|
-
mobile: allModes.largeMobile,
|
|
104
|
-
},
|
|
105
|
-
},
|
|
95
|
+
...withVariantConfig(['mobile'], ContentScroll),
|
|
106
96
|
};
|
|
107
97
|
|
|
108
98
|
export const ViewportScroll: Story = {
|
|
@@ -116,12 +106,7 @@ export const ViewportScroll: Story = {
|
|
|
116
106
|
|
|
117
107
|
export const ViewportScrollMobile: Story = {
|
|
118
108
|
...ViewportScroll,
|
|
119
|
-
|
|
120
|
-
variants: ['mobile'],
|
|
121
|
-
chromatic: {
|
|
122
|
-
mobile: allModes.largeMobile,
|
|
123
|
-
},
|
|
124
|
-
},
|
|
109
|
+
...withVariantConfig(['mobile'], ViewportScroll),
|
|
125
110
|
};
|
|
126
111
|
|
|
127
112
|
export const WithoutTitle: Story = {
|
|
@@ -134,12 +119,7 @@ export const WithoutTitle: Story = {
|
|
|
134
119
|
|
|
135
120
|
export const WithoutTitleMobile: Story = {
|
|
136
121
|
...WithoutTitle,
|
|
137
|
-
|
|
138
|
-
variants: ['mobile'],
|
|
139
|
-
chromatic: {
|
|
140
|
-
mobile: allModes.largeMobile,
|
|
141
|
-
},
|
|
142
|
-
},
|
|
122
|
+
...withVariantConfig(['mobile'], WithoutTitle),
|
|
143
123
|
};
|
|
144
124
|
|
|
145
125
|
export const WithThemeProviderInContent: Story = {
|
|
@@ -161,10 +141,5 @@ export const WithThemeProviderInContent: Story = {
|
|
|
161
141
|
|
|
162
142
|
export const WithThemeProviderInContentMobile: Story = {
|
|
163
143
|
...WithThemeProviderInContent,
|
|
164
|
-
|
|
165
|
-
variants: ['mobile'],
|
|
166
|
-
chromatic: {
|
|
167
|
-
mobile: allModes.largeMobile,
|
|
168
|
-
},
|
|
169
|
-
},
|
|
144
|
+
...withVariantConfig(['mobile'], WithThemeProviderInContent),
|
|
170
145
|
};
|
|
@@ -1,20 +1,21 @@
|
|
|
1
|
+
import { mockAnimationsApi } from 'jsdom-testing-mocks';
|
|
1
2
|
import {
|
|
2
3
|
mockMatchMedia,
|
|
3
|
-
mockRequestAnimationFrame,
|
|
4
4
|
mockResizeObserver,
|
|
5
5
|
render,
|
|
6
6
|
screen,
|
|
7
7
|
userEvent,
|
|
8
|
+
waitFor,
|
|
9
|
+
within,
|
|
8
10
|
} from '../test-utils';
|
|
9
11
|
|
|
10
12
|
import { MoneyInput, CurrencyItem, CurrencyOptionItem, Field } from '..';
|
|
11
13
|
import { MoneyInputPropsWithInputAttributes } from './MoneyInput';
|
|
12
|
-
import { within } from '@testing-library/react';
|
|
13
14
|
import messages from './MoneyInput.messages';
|
|
14
15
|
|
|
15
16
|
mockMatchMedia();
|
|
16
17
|
mockResizeObserver();
|
|
17
|
-
|
|
18
|
+
mockAnimationsApi();
|
|
18
19
|
|
|
19
20
|
describe('Money Input', () => {
|
|
20
21
|
const popularCurrencies: CurrencyOptionItem[] = [
|
|
@@ -114,12 +115,30 @@ describe('Money Input', () => {
|
|
|
114
115
|
it('calls onCurrencyChange when the user selects a different currency', async () => {
|
|
115
116
|
customRender();
|
|
116
117
|
await openDropdown();
|
|
117
|
-
await userEvent.keyboard('eur
|
|
118
|
-
|
|
118
|
+
await userEvent.keyboard('eur');
|
|
119
|
+
await waitFor(() => {
|
|
120
|
+
expect(screen.getAllByRole('option')).toHaveLength(1);
|
|
121
|
+
});
|
|
122
|
+
await userEvent.keyboard('{Enter}');
|
|
123
|
+
|
|
124
|
+
await waitFor(() => {
|
|
125
|
+
expect(initialProps.onCurrencyChange).toHaveBeenCalledTimes(1);
|
|
126
|
+
});
|
|
119
127
|
expect(initialProps.onCurrencyChange).toHaveBeenCalledWith(popularCurrencies[0]);
|
|
128
|
+
|
|
129
|
+
await waitFor(() => {
|
|
130
|
+
expect(screen.queryByRole('listbox')).not.toBeInTheDocument();
|
|
131
|
+
});
|
|
120
132
|
await openDropdown();
|
|
121
|
-
await userEvent.keyboard('gbp
|
|
122
|
-
|
|
133
|
+
await userEvent.keyboard('gbp');
|
|
134
|
+
await waitFor(() => {
|
|
135
|
+
expect(screen.getAllByRole('option')).toHaveLength(1);
|
|
136
|
+
});
|
|
137
|
+
await userEvent.keyboard('{Enter}');
|
|
138
|
+
|
|
139
|
+
await waitFor(() => {
|
|
140
|
+
expect(initialProps.onCurrencyChange).toHaveBeenCalledTimes(2);
|
|
141
|
+
});
|
|
123
142
|
expect(initialProps.onCurrencyChange).toHaveBeenCalledWith(popularCurrencies[2]);
|
|
124
143
|
});
|
|
125
144
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.wds-action-prompt {
|
|
2
|
+
--Prompt-padding: var(--size-16);
|
|
3
|
+
--Prompt-actions-gap: var(--size-8);
|
|
4
|
+
--Prompt-gap: var(--size-10) var(--size-16);
|
|
5
|
+
--Prompt-border-radius: var(--radius-large);
|
|
6
|
+
}
|
|
7
|
+
.wds-action-prompt--media-image {
|
|
8
|
+
width: 48px;
|
|
9
|
+
width: var(--size-48);
|
|
10
|
+
height: 48px;
|
|
11
|
+
height: var(--size-48);
|
|
12
|
+
-o-object-fit: contain;
|
|
13
|
+
object-fit: contain;
|
|
14
|
+
}
|
|
15
|
+
@media (max-width: 767px) {
|
|
16
|
+
.wds-action-prompt--with-two-actions .wds-prompt__actions-wrapper .wds-Button {
|
|
17
|
+
flex: 1 1 calc(50% - (var(--Prompt-actions-gap) / 2));
|
|
18
|
+
min-width: -moz-fit-content;
|
|
19
|
+
min-width: fit-content;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.wds-action-prompt {
|
|
2
|
+
--Prompt-padding: var(--size-16);
|
|
3
|
+
--Prompt-actions-gap: var(--size-8);
|
|
4
|
+
--Prompt-gap: var(--size-10) var(--size-16);
|
|
5
|
+
--Prompt-border-radius: var(--radius-large);
|
|
6
|
+
|
|
7
|
+
&--media-image {
|
|
8
|
+
width: var(--size-48);
|
|
9
|
+
height: var(--size-48);
|
|
10
|
+
object-fit: contain;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&--with-two-actions {
|
|
14
|
+
@media (--screen-sm-max) {
|
|
15
|
+
.wds-prompt__actions-wrapper {
|
|
16
|
+
.wds-Button {
|
|
17
|
+
flex: 1 1 calc(50% - (var(--Prompt-actions-gap) / 2));
|
|
18
|
+
min-width: fit-content;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { ReactElement, useState } from 'react';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
|
+
import { fn } from 'storybook/test';
|
|
4
|
+
import { Bank } from '@transferwise/icons';
|
|
5
|
+
import { ActionPrompt } from './ActionPrompt';
|
|
6
|
+
import { lorem10 } from '../../test-utils';
|
|
7
|
+
import { withVariantConfig } from '../../../.storybook/helpers';
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof ActionPrompt> = {
|
|
10
|
+
title: 'Prompts/ActionPrompt',
|
|
11
|
+
component: ActionPrompt,
|
|
12
|
+
tags: ['new'],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof ActionPrompt>;
|
|
17
|
+
|
|
18
|
+
const withComponentGrid =
|
|
19
|
+
({ maxWidth = 'auto', gap = '1rem' } = {}) =>
|
|
20
|
+
(Story: () => ReactElement) => (
|
|
21
|
+
<div
|
|
22
|
+
style={{
|
|
23
|
+
width: '100%',
|
|
24
|
+
display: 'flex',
|
|
25
|
+
flexDirection: 'column',
|
|
26
|
+
justifyContent: 'flex-start',
|
|
27
|
+
alignItems: 'flex-start',
|
|
28
|
+
alignContent: 'flex-start',
|
|
29
|
+
gap,
|
|
30
|
+
maxWidth,
|
|
31
|
+
}}
|
|
32
|
+
>
|
|
33
|
+
<Story />
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
export const AllSentiments: Story = {
|
|
38
|
+
render: () => {
|
|
39
|
+
return (
|
|
40
|
+
<>
|
|
41
|
+
{(['negative', 'warning', 'neutral', 'success', 'proposition'] as const).map(
|
|
42
|
+
(sentiment) => (
|
|
43
|
+
<ActionPrompt
|
|
44
|
+
key={sentiment}
|
|
45
|
+
sentiment={sentiment}
|
|
46
|
+
title="Title"
|
|
47
|
+
description={lorem10}
|
|
48
|
+
action={{ label: 'Primary', onClick: fn() }}
|
|
49
|
+
actionSecondary={{ label: 'Secondary', onClick: fn() }}
|
|
50
|
+
className="m-b-2"
|
|
51
|
+
onDismiss={fn()}
|
|
52
|
+
/>
|
|
53
|
+
),
|
|
54
|
+
)}
|
|
55
|
+
</>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
decorators: [withComponentGrid()],
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const Mobile: Story = {
|
|
62
|
+
...AllSentiments,
|
|
63
|
+
...withVariantConfig(['mobile'], AllSentiments),
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
export const PrimaryActionOnly: Story = {
|
|
67
|
+
args: {
|
|
68
|
+
sentiment: 'proposition',
|
|
69
|
+
title: 'Payment successful',
|
|
70
|
+
description: 'Your money is on its way',
|
|
71
|
+
action: { label: 'View details', onClick: fn() },
|
|
72
|
+
onDismiss: fn(),
|
|
73
|
+
},
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export const WithoutDescription: Story = {
|
|
77
|
+
render: () => {
|
|
78
|
+
return (
|
|
79
|
+
<>
|
|
80
|
+
<ActionPrompt
|
|
81
|
+
sentiment="warning"
|
|
82
|
+
title="Session expiring soon"
|
|
83
|
+
action={{ label: 'Stay logged in', onClick: fn() }}
|
|
84
|
+
actionSecondary={{ label: 'Log out', onClick: fn() }}
|
|
85
|
+
onDismiss={fn()}
|
|
86
|
+
/>
|
|
87
|
+
<ActionPrompt
|
|
88
|
+
sentiment="success"
|
|
89
|
+
title="Session expiring soon"
|
|
90
|
+
action={{ label: 'Stay logged in', onClick: fn() }}
|
|
91
|
+
/>
|
|
92
|
+
<ActionPrompt
|
|
93
|
+
title="Session expiring soon"
|
|
94
|
+
action={{ label: 'Stay logged in', onClick: fn() }}
|
|
95
|
+
/>
|
|
96
|
+
</>
|
|
97
|
+
);
|
|
98
|
+
},
|
|
99
|
+
decorators: [withComponentGrid()],
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const Media: Story = {
|
|
103
|
+
render: () => {
|
|
104
|
+
return (
|
|
105
|
+
<>
|
|
106
|
+
<ActionPrompt
|
|
107
|
+
sentiment="neutral"
|
|
108
|
+
title="Custom image"
|
|
109
|
+
description={lorem10}
|
|
110
|
+
media={{ imgSrc: '../../wise-card.svg' }}
|
|
111
|
+
action={{ label: 'Invite now', onClick: fn() }}
|
|
112
|
+
/>
|
|
113
|
+
<ActionPrompt
|
|
114
|
+
sentiment="neutral"
|
|
115
|
+
title="Profile Image"
|
|
116
|
+
description={lorem10}
|
|
117
|
+
media={{ avatar: { imgSrc: '../../avatar-rectangle-fox.webp' } }}
|
|
118
|
+
action={{ label: 'Invite now', onClick: fn() }}
|
|
119
|
+
/>
|
|
120
|
+
<ActionPrompt
|
|
121
|
+
sentiment="proposition"
|
|
122
|
+
title="Business Profile"
|
|
123
|
+
description={lorem10}
|
|
124
|
+
media={{ avatar: { profileType: 'BUSINESS', badge: { flagCode: 'GB' } } }}
|
|
125
|
+
action={{ label: 'Invite now', onClick: fn() }}
|
|
126
|
+
/>
|
|
127
|
+
<ActionPrompt
|
|
128
|
+
sentiment="negative"
|
|
129
|
+
title="Personal Profile"
|
|
130
|
+
description={lorem10}
|
|
131
|
+
media={{ avatar: { profileType: 'PERSONAL', badge: { flagCode: 'EU' } } }}
|
|
132
|
+
action={{ label: 'Invite now', onClick: fn() }}
|
|
133
|
+
/>
|
|
134
|
+
<ActionPrompt
|
|
135
|
+
sentiment="warning"
|
|
136
|
+
title="Custom Icon"
|
|
137
|
+
description={lorem10}
|
|
138
|
+
media={{ avatar: { asset: <Bank /> } }}
|
|
139
|
+
action={{ label: 'Invite now', onClick: fn() }}
|
|
140
|
+
/>
|
|
141
|
+
<ActionPrompt
|
|
142
|
+
sentiment="success"
|
|
143
|
+
title="Initials"
|
|
144
|
+
description={lorem10}
|
|
145
|
+
media={{ avatar: { profileName: 'John Doe' } }}
|
|
146
|
+
action={{ label: 'Invite now', onClick: fn() }}
|
|
147
|
+
actionSecondary={{ label: 'Maybe later', onClick: fn() }}
|
|
148
|
+
/>
|
|
149
|
+
</>
|
|
150
|
+
);
|
|
151
|
+
},
|
|
152
|
+
decorators: [withComponentGrid()],
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
export const OnDismiss: Story = {
|
|
156
|
+
render: () => {
|
|
157
|
+
const [showNeutralPrompt, setShowNeutralPrompt] = useState(true);
|
|
158
|
+
const [showSuccessPrompt, setShowSuccessPrompt] = useState(true);
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
<>
|
|
162
|
+
{showNeutralPrompt && (
|
|
163
|
+
<ActionPrompt
|
|
164
|
+
sentiment="proposition"
|
|
165
|
+
title="Payment successful"
|
|
166
|
+
description="Your money is on its way"
|
|
167
|
+
action={{ label: 'View details', onClick: fn() }}
|
|
168
|
+
className="m-b-2"
|
|
169
|
+
onDismiss={() => setShowNeutralPrompt(false)}
|
|
170
|
+
/>
|
|
171
|
+
)}
|
|
172
|
+
{showSuccessPrompt && (
|
|
173
|
+
<ActionPrompt
|
|
174
|
+
sentiment="success"
|
|
175
|
+
title="Payment successful"
|
|
176
|
+
description="Your money is on its way"
|
|
177
|
+
action={{ label: 'View details', onClick: fn() }}
|
|
178
|
+
onDismiss={() => setShowSuccessPrompt(false)}
|
|
179
|
+
/>
|
|
180
|
+
)}
|
|
181
|
+
</>
|
|
182
|
+
);
|
|
183
|
+
},
|
|
184
|
+
};
|