@transferwise/components 0.0.0-experimental-8978349 → 0.0.0-experimental-a918fce
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/main.css +13 -1
- package/build/styles/main.css +13 -1
- package/build/styles/prompt/ActionPrompt/ActionPrompt.css +12 -0
- package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +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/package.json +3 -3
- package/src/main.css +13 -1
- package/src/main.less +1 -0
- package/src/prompt/ActionPrompt/ActionPrompt.css +12 -0
- package/src/prompt/ActionPrompt/ActionPrompt.less +10 -0
- package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +161 -0
- package/src/prompt/ActionPrompt/ActionPrompt.tsx +125 -0
- package/src/prompt/ActionPrompt/index.ts +2 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -1
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +1 -1
- /package/src/accordion/{Accordion.test.js → Accordion.spec.js} +0 -0
- /package/src/accordion/AccordionItem/{AccordionItem.test.js → AccordionItem.spec.js} +0 -0
- /package/src/accordion/AccordionItem/__snapshots__/{AccordionItem.test.js.snap → AccordionItem.spec.js.snap} +0 -0
- /package/src/accordion/__snapshots__/{Accordion.test.js.snap → Accordion.spec.js.snap} +0 -0
- /package/src/actionButton/{ActionButton.test.tsx → ActionButton.spec.tsx} +0 -0
- /package/src/actionButton/__snapshots__/{ActionButton.test.tsx.snap → ActionButton.spec.tsx.snap} +0 -0
- /package/src/actionOption/{ActionOption.test.tsx → ActionOption.spec.tsx} +0 -0
- /package/src/alert/{Alert.test.tsx → Alert.spec.tsx} +0 -0
- /package/src/alert/{Alert.test.story.tsx → Alert.tests.story.tsx} +0 -0
- /package/src/avatar/{Avatar.test.tsx → Avatar.spec.tsx} +0 -0
- /package/src/avatarWrapper/{AvatarWrapper.test.tsx → AvatarWrapper.spec.tsx} +0 -0
- /package/src/avatarWrapper/__snapshots__/{AvatarWrapper.test.tsx.snap → AvatarWrapper.spec.tsx.snap} +0 -0
- /package/src/badge/{Badge.test.tsx → Badge.spec.tsx} +0 -0
- /package/src/body/{Body.test.tsx → Body.spec.tsx} +0 -0
- /package/src/button/{Button.test.tsx → Button.spec.tsx} +0 -0
- /package/src/button/{LegacyButton.test.tsx → LegacyButton.spec.tsx} +0 -0
- /package/src/button/_stories/{Button.brightGreen.test.story.tsx → Button.brightGreen.tests.story.tsx} +0 -0
- /package/src/button/_stories/{Button.dark.test.story.tsx → Button.dark.tests.story.tsx} +0 -0
- /package/src/button/_stories/{Button.default.test.story.tsx → Button.default.tests.story.tsx} +0 -0
- /package/src/button/_stories/{Button.forestGreen.test.story.tsx → Button.forestGreen.tests.story.tsx} +0 -0
- /package/src/button/_stories/{Button.test.story.tsx → Button.tests.story.tsx} +0 -0
- /package/src/button/legacyUtils/{legacyUtils.test.tsx → legacyUtils.spec.tsx} +0 -0
- /package/src/card/{Card.test.tsx → Card.spec.tsx} +0 -0
- /package/src/carousel/{Carousel.test.tsx → Carousel.spec.tsx} +0 -0
- /package/src/checkbox/{Checkbox.test.tsx → Checkbox.spec.tsx} +0 -0
- /package/src/checkbox/__snapshots__/{Checkbox.test.tsx.snap → Checkbox.spec.tsx.snap} +0 -0
- /package/src/checkboxButton/{CheckboxButton.test.tsx → CheckboxButton.spec.tsx} +0 -0
- /package/src/checkboxOption/{CheckboxOption.test.tsx → CheckboxOption.spec.tsx} +0 -0
- /package/src/chevron/{Chevron.test.tsx → Chevron.spec.tsx} +0 -0
- /package/src/chevron/__snapshots__/{Chevron.test.tsx.snap → Chevron.spec.tsx.snap} +0 -0
- /package/src/chips/{Chips.test.tsx → Chips.spec.tsx} +0 -0
- /package/src/chips/__snapshots__/{Chips.test.tsx.snap → Chips.spec.tsx.snap} +0 -0
- /package/src/circularButton/{CircularButton.test.tsx → CircularButton.spec.tsx} +0 -0
- /package/src/circularButton/{CircularButton.test.story.tsx → CircularButton.tests.story.tsx} +0 -0
- /package/src/common/DOMOperations/{DOMOperations.test.tsx → DOMOperations.spec.tsx} +0 -0
- /package/src/common/Option/{Option.test.tsx → Option.spec.tsx} +0 -0
- /package/src/common/RadioButton/{RadioButton.test.tsx → RadioButton.spec.tsx} +0 -0
- /package/src/common/RadioButton/__snapshots__/{RadioButton.test.tsx.snap → RadioButton.spec.tsx.snap} +0 -0
- /package/src/common/bottomSheet/{BottomSheet.test.tsx → BottomSheet.spec.tsx} +0 -0
- /package/src/common/bottomSheet/__snapshots__/{BottomSheet.test.tsx.snap → BottomSheet.spec.tsx.snap} +0 -0
- /package/src/common/card/{Card.test.tsx → Card.spec.tsx} +0 -0
- /package/src/common/card/__snapshots__/{Card.test.tsx.snap → Card.spec.tsx.snap} +0 -0
- /package/src/common/closeButton/{CloseButton.test.tsx → CloseButton.spec.tsx} +0 -0
- /package/src/common/closeButton/__snapshots__/{CloseButton.test.tsx.snap → CloseButton.spec.tsx.snap} +0 -0
- /package/src/common/dateUtils/getDayNames/{getDayNames.test.js → getDayNames.spec.js} +0 -0
- /package/src/common/dateUtils/getMonthNames/{getMonthNames.test.js → getMonthNames.spec.js} +0 -0
- /package/src/common/dateUtils/isDateValid/{isDateValid.test.ts → isDateValid.spec.ts} +0 -0
- /package/src/common/dateUtils/isMonthAndYearFormat/{isMonthAndYearFormat.test.js → isMonthAndYearFormat.spec.js} +0 -0
- /package/src/common/dateUtils/isWithinRange/{isWithinRange.test.ts → isWithinRange.spec.ts} +0 -0
- /package/src/common/dateUtils/moveToWithinRange/{moveToWithinRange.test.js → moveToWithinRange.spec.js} +0 -0
- /package/src/common/deviceDetection/{deviceDetection.test.ts → deviceDetection.spec.ts} +0 -0
- /package/src/common/domHelpers/{documentIosClick.test.ts → documentIosClick.spec.ts} +0 -0
- /package/src/common/flowHeader/{FlowHeader.test.tsx → FlowHeader.spec.tsx} +0 -0
- /package/src/common/flowHeader/__snapshots__/{FlowHeader.test.tsx.snap → FlowHeader.spec.tsx.snap} +0 -0
- /package/src/common/historyNavigator/{historyNavigator.test.ts → historyNavigator.spec.ts} +0 -0
- /package/src/common/hooks/useConditionalListener/{useConditionalListener.test.js → useConditionalListener.spec.js} +0 -0
- /package/src/common/hooks/useDirection/{useDirection.test.js → useDirection.spec.js} +0 -0
- /package/src/common/hooks/useHasIntersected/{useHasIntersected.test.js → useHasIntersected.spec.js} +0 -0
- /package/src/common/hooks/{useMedia.test.ts → useMedia.spec.ts} +0 -0
- /package/src/common/{initials.test.tsx → initials.spec.tsx} +0 -0
- /package/src/common/locale/{index.test.ts → index.spec.ts} +0 -0
- /package/src/common/panel/{Panel.test.tsx → Panel.spec.tsx} +0 -0
- /package/src/common/panel/__snapshots__/{Panel.test.tsx.snap → Panel.spec.tsx.snap} +0 -0
- /package/src/common/responsivePanel/{ResponsivePanel.test.js → ResponsivePanel.spec.js} +0 -0
- /package/src/common/textFormat/formatWithPattern/{formatWithPattern.test.ts → formatWithPattern.spec.ts} +0 -0
- /package/src/common/textFormat/getCountOfSymbolsInSelection/{getCountOfSymbolsInSelection.test.ts → getCountOfSymbolsInSelection.spec.ts} +0 -0
- /package/src/common/textFormat/getCursorPositionAfterKeystroke/{getCursorPositionAfterKeystroke.test.ts → getCursorPositionAfterKeystroke.spec.ts} +0 -0
- /package/src/common/textFormat/getDistanceToSymbol/{getDistanceToSymbol.test.ts → getDistanceToSymbol.spec.ts} +0 -0
- /package/src/common/textFormat/getSymbolsInPatternWithPosition/{getSymbolsInPatternWithPosition.test.ts → getSymbolsInPatternWithPosition.spec.ts} +0 -0
- /package/src/common/textFormat/unformatWithPattern/{unformatWithPattern.test.ts → unformatWithPattern.spec.ts} +0 -0
- /package/src/dateInput/{DateInput.test.tsx → DateInput.spec.tsx} +0 -0
- /package/src/dateInput/{DateInput.test.story.tsx → DateInput.tests.story.tsx} +0 -0
- /package/src/dateInput/utils/convertToLocalMidnight/{convertToLocalMidnight.test.ts → convertToLocalMidnight.spec.ts} +0 -0
- /package/src/dateLookup/{DateLookup.test.tsx → DateLookup.spec.tsx} +0 -0
- /package/src/dateLookup/{DateLookup.test.story.tsx → DateLookup.tests.story.tsx} +0 -0
- /package/src/dateLookup/getFocusableTime/{getFocusable.test.ts → getFocusable.spec.ts} +0 -0
- /package/src/dateLookup/getStartOfDay/{getStartOfDay.test.js → getStartOfDay.spec.js} +0 -0
- /package/src/decision/{Decision.test.tsx → Decision.spec.tsx} +0 -0
- /package/src/dimmer/{Dimmer.test.tsx → Dimmer.spec.tsx} +0 -0
- /package/src/divider/{Divider.test.tsx → Divider.spec.tsx} +0 -0
- /package/src/drawer/{Drawer.test.tsx → Drawer.spec.tsx} +0 -0
- /package/src/emphasis/{Emphasis.test.tsx → Emphasis.spec.tsx} +0 -0
- /package/src/emphasis/{EmphasisHtmlTransformer.test.tsx → EmphasisHtmlTransformer.spec.tsx} +0 -0
- /package/src/expressiveMoneyInput/{ExpressiveMoneyInput.test.tsx → ExpressiveMoneyInput.spec.tsx} +0 -0
- /package/src/expressiveMoneyInput/amountInput/{AmountInput.test.tsx → AmountInput.spec.tsx} +0 -0
- /package/src/expressiveMoneyInput/amountInput/{utils.test.ts → utils.spec.ts} +0 -0
- /package/src/expressiveMoneyInput/currencySelector/{CurrencySelector.test.tsx → CurrencySelector.spec.tsx} +0 -0
- /package/src/field/{Field.test.tsx → Field.spec.tsx} +0 -0
- /package/src/flowNavigation/{FlowNavigation.test.js → FlowNavigation.spec.js} +0 -0
- /package/src/flowNavigation/__snapshots__/{FlowNavigation.test.js.snap → FlowNavigation.spec.js.snap} +0 -0
- /package/src/flowNavigation/animatedLabel/{AnimatedLabel.test.js → AnimatedLabel.spec.js} +0 -0
- /package/src/header/{Header.test.tsx → Header.spec.tsx} +0 -0
- /package/src/header/{Header.test.story.tsx → Header.tests.story.tsx} +0 -0
- /package/src/iconButton/{iconButton.test.tsx → iconButton.spec.tsx} +0 -0
- /package/src/image/{Image.test.tsx → Image.spec.tsx} +0 -0
- /package/src/info/{Info.test.jsx → Info.spec.jsx} +0 -0
- /package/src/inlineAlert/{InlineAlert.test.tsx → InlineAlert.spec.tsx} +0 -0
- /package/src/inputWithDisplayFormat/{InputWithDisplayFormat.test.js → InputWithDisplayFormat.spec.js} +0 -0
- /package/src/inputs/{InputGroup.test.tsx → InputGroup.spec.tsx} +0 -0
- /package/src/inputs/{SearchInput.test.tsx → SearchInput.spec.tsx} +0 -0
- /package/src/inputs/{SelectInput.test.tsx → SelectInput.spec.tsx} +0 -0
- /package/src/instructionsList/{InstructionsList.test.tsx → InstructionsList.spec.tsx} +0 -0
- /package/src/label/{Label.test.tsx → Label.spec.tsx} +0 -0
- /package/src/legacylistItem/{LegacyListItem.test.tsx → LegacyListItem.spec.tsx} +0 -0
- /package/src/legacylistItem/{LegacyListItem.test.story.tsx → LegacyListItem.tests.story.tsx} +0 -0
- /package/src/link/{Link.test.tsx → Link.spec.tsx} +0 -0
- /package/src/list/{List.test.tsx → List.spec.tsx} +0 -0
- /package/src/listItem/AdditionalInfo/{ListItemAdditionalInfo.test.tsx → ListItemAdditionalInfo.spec.tsx} +0 -0
- /package/src/listItem/AvatarLayout/{ListItemAvatarLayout.test.tsx → ListItemAvatarLayout.spec.tsx} +0 -0
- /package/src/listItem/AvatarView/{ListItemAvatarView.test.tsx → ListItemAvatarView.spec.tsx} +0 -0
- /package/src/listItem/Button/{ListItemButton.test.tsx → ListItemButton.spec.tsx} +0 -0
- /package/src/listItem/Checkbox/{ListItemCheckbox.test.tsx → ListItemCheckbox.spec.tsx} +0 -0
- /package/src/listItem/IconButton/{ListItemIconButton.test.tsx → ListItemIconButton.spec.tsx} +0 -0
- /package/src/listItem/Image/{ListItemImage.test.tsx → ListItemImage.spec.tsx} +0 -0
- /package/src/listItem/{ListItem.test.tsx → ListItem.spec.tsx} +0 -0
- /package/src/listItem/Navigation/{ListItemNavigation.test.tsx → ListItemNavigation.spec.tsx} +0 -0
- /package/src/listItem/Prompt/{ListItemPrompt.test.tsx → ListItemPrompt.spec.tsx} +0 -0
- /package/src/listItem/Radio/{ListItemRadio.test.tsx → ListItemRadio.spec.tsx} +0 -0
- /package/src/listItem/Switch/{ListItemSwitch.test.tsx → ListItemSwitch.spec.tsx} +0 -0
- /package/src/loader/{Loader.test.tsx → Loader.spec.tsx} +0 -0
- /package/src/logo/{Logo.test.tsx → Logo.spec.tsx} +0 -0
- /package/src/logo/__snapshots__/{Logo.test.tsx.snap → Logo.spec.tsx.snap} +0 -0
- /package/src/markdown/{Markdown.test.tsx → Markdown.spec.tsx} +0 -0
- /package/src/modal/{Modal.test.tsx → Modal.spec.tsx} +0 -0
- /package/src/money/{Money.test.tsx → Money.spec.tsx} +0 -0
- /package/src/moneyInput/{MoneyInput.test.tsx → MoneyInput.spec.tsx} +0 -0
- /package/src/moneyInput/{currencyFormatting.test.ts → currencyFormatting.spec.ts} +0 -0
- /package/src/navigationOption/{NavigationOption.test.tsx → NavigationOption.spec.tsx} +0 -0
- /package/src/navigationOptionsList/{NavigationOptionsList.test.tsx → NavigationOptionsList.spec.tsx} +0 -0
- /package/src/nudge/{Nudge.test.tsx → Nudge.spec.tsx} +0 -0
- /package/src/overlayHeader/{OverlayHeader.test.tsx → OverlayHeader.spec.tsx} +0 -0
- /package/src/overlayHeader/__snapshots__/{OverlayHeader.test.tsx.snap → OverlayHeader.spec.tsx.snap} +0 -0
- /package/src/phoneNumberInput/{PhoneNumberInput.test.tsx → PhoneNumberInput.spec.tsx} +0 -0
- /package/src/phoneNumberInput/utils/cleanNumber/{cleanNumber.test.ts → cleanNumber.spec.ts} +0 -0
- /package/src/phoneNumberInput/utils/excludeCountries/{excludeCountries.test.ts → excludeCountries.spec.ts} +0 -0
- /package/src/phoneNumberInput/utils/explodeNumberModel/{explodeNumberModel.test.ts → explodeNumberModel.spec.ts} +0 -0
- /package/src/phoneNumberInput/utils/findCountryByCode/{findCountryByCode.test.ts → findCountryByCode.spec.ts} +0 -0
- /package/src/phoneNumberInput/utils/findCountryByPrefix/{findCountryByPrefix.test.ts → findCountryByPrefix.spec.ts} +0 -0
- /package/src/phoneNumberInput/utils/groupCountriesByPrefix/{groupCountriesByPrefix.test.ts → groupCountriesByPrefix.spec.ts} +0 -0
- /package/src/phoneNumberInput/utils/isStringNumeric/{isStringNumeric.test.ts → isStringNumeric.spec.ts} +0 -0
- /package/src/phoneNumberInput/utils/isValidPhoneNumber/{isValidPhoneNumber.test.ts → isValidPhoneNumber.spec.ts} +0 -0
- /package/src/phoneNumberInput/utils/longestMatchingPrefix/{longestMatchingPrefix.test.ts → longestMatchingPrefix.spec.ts} +0 -0
- /package/src/phoneNumberInput/utils/setDefaultPrefix/{setDefaultPrefix.test.ts → setDefaultPrefix.spec.ts} +0 -0
- /package/src/phoneNumberInput/utils/sortArrayByProperty/{sortArrayByProperty.test.ts → sortArrayByProperty.spec.ts} +0 -0
- /package/src/popover/{Popover.test.tsx → Popover.spec.tsx} +0 -0
- /package/src/popover/__snapshots__/{Popover.test.tsx.snap → Popover.spec.tsx.snap} +0 -0
- /package/src/primitives/PrimitiveAnchor/stories/{PrimitiveAnchor.test.story.tsx → PrimitiveAnchor.tests.story.tsx} +0 -0
- /package/src/primitives/PrimitiveAnchor/test/{PrimitiveAnchor.test.tsx → PrimitiveAnchor.spec.tsx} +0 -0
- /package/src/primitives/PrimitiveButton/stories/{PrimitiveButton.test.story.tsx → PrimitiveButton.tests.story.tsx} +0 -0
- /package/src/primitives/PrimitiveButton/test/{PrimitiveButton.test.tsx → PrimitiveButton.spec.tsx} +0 -0
- /package/src/processIndicator/{ProcessIndicator.rtl.test.tsx → ProcessIndicator.rtl.spec.tsx} +0 -0
- /package/src/progress/{Progress.test.tsx → Progress.spec.tsx} +0 -0
- /package/src/progressBar/{ProgressBar.test.tsx → ProgressBar.spec.tsx} +0 -0
- /package/src/promoCard/{PromoCard.test.tsx → PromoCard.spec.tsx} +0 -0
- /package/src/promoCard/{PromoCardContext.test.tsx → PromoCardContext.spec.tsx} +0 -0
- /package/src/promoCard/{PromoCardGroup.test.tsx → PromoCardGroup.spec.tsx} +0 -0
- /package/src/promoCard/__snapshots__/{PromoCard.test.tsx.snap → PromoCard.spec.tsx.snap} +0 -0
- /package/src/promoCard/__snapshots__/{PromoCardGroup.test.tsx.snap → PromoCardGroup.spec.tsx.snap} +0 -0
- /package/src/prompt/InlinePrompt/{InlinePrompt.test.tsx → InlinePrompt.spec.tsx} +0 -0
- /package/src/provider/{Provider.test.tsx → Provider.spec.tsx} +0 -0
- /package/src/provider/direction/{DirectionProvider.test.tsx → DirectionProvider.spec.tsx} +0 -0
- /package/src/provider/language/{LanguageProvider.test.tsx → LanguageProvider.spec.tsx} +0 -0
- /package/src/radio/{Radio.test.tsx → Radio.spec.tsx} +0 -0
- /package/src/radioGroup/{RadioGroup.test.tsx → RadioGroup.spec.tsx} +0 -0
- /package/src/radioOption/{RadioOption.test.tsx → RadioOption.spec.tsx} +0 -0
- /package/src/section/{Section.test.tsx → Section.spec.tsx} +0 -0
- /package/src/segmentedControl/{SegmentedControl.test.tsx → SegmentedControl.spec.tsx} +0 -0
- /package/src/select/{Select.rtl.test.tsx → Select.rtl.spec.tsx} +0 -0
- /package/src/select/{Select.test.tsx → Select.spec.tsx} +0 -0
- /package/src/select/option/{Option.test.tsx → Option.spec.tsx} +0 -0
- /package/src/select/searchBox/{SearchBox.test.tsx → SearchBox.spec.tsx} +0 -0
- /package/src/sentimentSurface/{SentimentSurface.test.tsx → SentimentSurface.spec.tsx} +0 -0
- /package/src/sentimentSurface/{SentimentSurface.test.story.tsx → SentimentSurface.tests.story.tsx} +0 -0
- /package/src/slidingPanel/{SlidingPanel.test.tsx → SlidingPanel.spec.tsx} +0 -0
- /package/src/snackbar/{Snackbar.test.story.tsx → Snackbar.tests.story.tsx} +0 -0
- /package/src/{ssr.test.tsx → ssr.spec.tsx} +0 -0
- /package/src/statusIcon/{StatusIcon.test.tsx → StatusIcon.spec.tsx} +0 -0
- /package/src/stepper/{Stepper.test.tsx → Stepper.spec.tsx} +0 -0
- /package/src/stepper/{Stepper.test.story.tsx → Stepper.tests.story.tsx} +0 -0
- /package/src/stepper/{deviceDetection.test.ts → deviceDetection.spec.ts} +0 -0
- /package/src/sticky/{Sticky.test.tsx → Sticky.spec.tsx} +0 -0
- /package/src/summary/{Summary.test.tsx → Summary.spec.tsx} +0 -0
- /package/src/summary/{Summary.test.story.tsx → Summary.tests.story.tsx} +0 -0
- /package/src/switch/{Switch.test.tsx → Switch.spec.tsx} +0 -0
- /package/src/switchOption/{SwitchOption.test.tsx → SwitchOption.spec.tsx} +0 -0
- /package/src/table/{Table.test.tsx → Table.spec.tsx} +0 -0
- /package/src/table/{TableCell.test.tsx → TableCell.spec.tsx} +0 -0
- /package/src/table/{TableHeader.test.tsx → TableHeader.spec.tsx} +0 -0
- /package/src/table/{TableRow.test.tsx → TableRow.spec.tsx} +0 -0
- /package/src/table/{TableStatusText.test.tsx → TableStatusText.spec.tsx} +0 -0
- /package/src/tabs/{Tabs.test.tsx → Tabs.spec.tsx} +0 -0
- /package/src/tabs/{utils.test.ts → utils.spec.ts} +0 -0
- /package/src/textareaWithDisplayFormat/{TextareaWithDisplayFormat.test.js → TextareaWithDisplayFormat.spec.js} +0 -0
- /package/src/tile/{Tile.test.tsx → Tile.spec.tsx} +0 -0
- /package/src/tile/__snapshots__/{Tile.test.tsx.snap → Tile.spec.tsx.snap} +0 -0
- /package/src/title/{Title.test.tsx → Title.spec.tsx} +0 -0
- /package/src/tooltip/{Tooltip.test.tsx → Tooltip.spec.tsx} +0 -0
- /package/src/tooltip/__snapshots__/{Tooltip.test.tsx.snap → Tooltip.spec.tsx.snap} +0 -0
- /package/src/typeahead/{Typeahead.test.tsx → Typeahead.spec.tsx} +0 -0
- /package/src/typeahead/typeaheadInput/{TypeaheadInput.test.tsx → TypeaheadInput.spec.tsx} +0 -0
- /package/src/typeahead/util/{highlight.test.tsx → highlight.spec.tsx} +0 -0
- /package/src/upload/{Upload.test.tsx → Upload.spec.tsx} +0 -0
- /package/src/upload/{Upload.test.story.tsx → Upload.tests.story.tsx} +0 -0
- /package/src/upload/steps/completeStep/{completeStep.test.tsx → completeStep.spec.tsx} +0 -0
- /package/src/upload/steps/processingStep/{processingStep.test.tsx → processingStep.spec.tsx} +0 -0
- /package/src/upload/steps/uploadImageStep/{uploadImageStep.test.tsx → uploadImageStep.spec.tsx} +0 -0
- /package/src/upload/utils/asyncFileRead/{asyncFileRead.test.ts → asyncFileRead.spec.ts} +0 -0
- /package/src/upload/utils/getFileType/{getFileType.test.ts → getFileType.spec.ts} +0 -0
- /package/src/upload/utils/isSizeValid/{isSizeValid.test.ts → isSizeValid.spec.ts} +0 -0
- /package/src/upload/utils/isTypeValid/{isTypeValid.test.ts → isTypeValid.spec.ts} +0 -0
- /package/src/upload/utils/postData/{postData.test.ts → postData.spec.ts} +0 -0
- /package/src/uploadInput/{UploadInput.test.tsx → UploadInput.spec.tsx} +0 -0
- /package/src/uploadInput/{UploadInput.test.story.tsx → UploadInput.tests.story.tsx} +0 -0
- /package/src/uploadInput/uploadButton/{UploadButton.test.tsx → UploadButton.spec.tsx} +0 -0
- /package/src/uploadInput/uploadButton/{getAllowedFileTypes.test.ts → getAllowedFileTypes.spec.ts} +0 -0
- /package/src/uploadInput/uploadItem/{UploadItem.test.tsx → UploadItem.spec.tsx} +0 -0
- /package/src/utilities/deprecatedProperty/{deprecatedProperty.test.ts → deprecatedProperty.spec.ts} +0 -0
- /package/src/withDisplayFormat/{WithDisplayFormat.test.js → WithDisplayFormat.spec.js} +0 -0
- /package/src/withId/{withId.test.tsx → withId.spec.tsx} +0 -0
- /package/src/withNextPortal/{withNextPortal.test.tsx → withNextPortal.spec.tsx} +0 -0
package/build/main.css
CHANGED
|
@@ -5370,7 +5370,7 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5370
5370
|
gap: var(--Prompt-actions-gap, var(--size-8));
|
|
5371
5371
|
grid-column-start: 2;
|
|
5372
5372
|
}
|
|
5373
|
-
@media (max-width:
|
|
5373
|
+
@media (max-width: 767px) {
|
|
5374
5374
|
.wds-prompt__actions-wrapper {
|
|
5375
5375
|
grid-column: span 2;
|
|
5376
5376
|
width: 100%;
|
|
@@ -7423,3 +7423,15 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
7423
7423
|
.np-list-item__action {
|
|
7424
7424
|
flex-shrink: 0;
|
|
7425
7425
|
}
|
|
7426
|
+
.wds-action-prompt {
|
|
7427
|
+
--Prompt-padding: var(--size-16);
|
|
7428
|
+
--Prompt-gap: var(--size-10) var(--size-16);
|
|
7429
|
+
}
|
|
7430
|
+
.wds-action-prompt--media-image {
|
|
7431
|
+
width: 48px;
|
|
7432
|
+
width: var(--size-48);
|
|
7433
|
+
height: 48px;
|
|
7434
|
+
height: var(--size-48);
|
|
7435
|
+
-o-object-fit: contain;
|
|
7436
|
+
object-fit: contain;
|
|
7437
|
+
}
|
package/build/styles/main.css
CHANGED
|
@@ -5370,7 +5370,7 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5370
5370
|
gap: var(--Prompt-actions-gap, var(--size-8));
|
|
5371
5371
|
grid-column-start: 2;
|
|
5372
5372
|
}
|
|
5373
|
-
@media (max-width:
|
|
5373
|
+
@media (max-width: 767px) {
|
|
5374
5374
|
.wds-prompt__actions-wrapper {
|
|
5375
5375
|
grid-column: span 2;
|
|
5376
5376
|
width: 100%;
|
|
@@ -7423,3 +7423,15 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
7423
7423
|
.np-list-item__action {
|
|
7424
7424
|
flex-shrink: 0;
|
|
7425
7425
|
}
|
|
7426
|
+
.wds-action-prompt {
|
|
7427
|
+
--Prompt-padding: var(--size-16);
|
|
7428
|
+
--Prompt-gap: var(--size-10) var(--size-16);
|
|
7429
|
+
}
|
|
7430
|
+
.wds-action-prompt--media-image {
|
|
7431
|
+
width: 48px;
|
|
7432
|
+
width: var(--size-48);
|
|
7433
|
+
height: 48px;
|
|
7434
|
+
height: var(--size-48);
|
|
7435
|
+
-o-object-fit: contain;
|
|
7436
|
+
object-fit: contain;
|
|
7437
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.wds-action-prompt {
|
|
2
|
+
--Prompt-padding: var(--size-16);
|
|
3
|
+
--Prompt-gap: var(--size-10) var(--size-16);
|
|
4
|
+
}
|
|
5
|
+
.wds-action-prompt--media-image {
|
|
6
|
+
width: 48px;
|
|
7
|
+
width: var(--size-48);
|
|
8
|
+
height: 48px;
|
|
9
|
+
height: var(--size-48);
|
|
10
|
+
-o-object-fit: contain;
|
|
11
|
+
object-fit: contain;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { AvatarViewProps } from '../../avatarView';
|
|
3
|
+
import { ButtonProps } from '../../button/Button.types';
|
|
4
|
+
import { PrimitivePromptProps } from '../PrimitivePrompt';
|
|
5
|
+
import { BadgeAssetsProps } from '../../badge';
|
|
6
|
+
export type ActionPromptProps = {
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
description?: ReactNode;
|
|
9
|
+
media?: {
|
|
10
|
+
imgSrc?: string;
|
|
11
|
+
avatar?: Pick<AvatarViewProps, 'imgSrc' | 'profileName' | 'profileType'> & {
|
|
12
|
+
asset?: AvatarViewProps['children'];
|
|
13
|
+
badge?: Pick<BadgeAssetsProps, 'flagCode'>;
|
|
14
|
+
};
|
|
15
|
+
'aria-label'?: string;
|
|
16
|
+
};
|
|
17
|
+
actionPrimary: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {
|
|
18
|
+
label: ButtonProps['children'];
|
|
19
|
+
};
|
|
20
|
+
actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {
|
|
21
|
+
label: ButtonProps['children'];
|
|
22
|
+
};
|
|
23
|
+
} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid' | 'sentiment' | 'onDismiss'>;
|
|
24
|
+
export declare const ActionPrompt: ({ sentiment, title, description, onDismiss, media, actionPrimary, actionSecondary, id, className, "data-testid": testId, }: ActionPromptProps) => import("react").JSX.Element;
|
|
25
|
+
export default ActionPrompt;
|
|
26
|
+
//# sourceMappingURL=ActionPrompt.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionPrompt.d.ts","sourceRoot":"","sources":["../../../../src/prompt/ActionPrompt/ActionPrompt.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOlC,OAAmB,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,EAAmB,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAI/C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,SAAS,CAAC;IACjB,WAAW,CAAC,EAAE,SAAS,CAAC;IACxB,KAAK,CAAC,EAAE;QACN,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,MAAM,CAAC,EAAE,IAAI,CAAC,eAAe,EAAE,QAAQ,GAAG,aAAa,GAAG,aAAa,CAAC,GAAG;YACzE,KAAK,CAAC,EAAE,eAAe,CAAC,UAAU,CAAC,CAAC;YACpC,KAAK,CAAC,EAAE,IAAI,CAAC,gBAAgB,EAAE,UAAU,CAAC,CAAC;SAC5C,CAAC;QACF,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,aAAa,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG;QAChE,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;KAChC,CAAC;IACF,eAAe,CAAC,EAAE,IAAI,CAAC,WAAW,EAAE,SAAS,GAAG,MAAM,GAAG,QAAQ,CAAC,GAAG;QACnE,KAAK,EAAE,WAAW,CAAC,UAAU,CAAC,CAAC;KAChC,CAAC;CACH,GAAG,IAAI,CAAC,oBAAoB,EAAE,IAAI,GAAG,WAAW,GAAG,aAAa,GAAG,WAAW,GAAG,WAAW,CAAC,CAAC;AAE/F,eAAO,MAAM,YAAY,GAAI,4HAW1B,iBAAiB,gCA6EnB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/prompt/ActionPrompt/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@transferwise/components",
|
|
3
|
-
"version": "0.0.0-experimental-
|
|
3
|
+
"version": "0.0.0-experimental-a918fce",
|
|
4
4
|
"description": "Neptune React components",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -87,8 +87,8 @@
|
|
|
87
87
|
"storybook-addon-test-codegen": "^3.0.1",
|
|
88
88
|
"@transferwise/less-config": "3.1.2",
|
|
89
89
|
"@transferwise/neptune-css": "14.26.1",
|
|
90
|
-
"@wise/
|
|
91
|
-
"@wise/
|
|
90
|
+
"@wise/components-theming": "1.10.1",
|
|
91
|
+
"@wise/wds-configs": "0.0.0"
|
|
92
92
|
},
|
|
93
93
|
"peerDependencies": {
|
|
94
94
|
"@transferwise/icons": "^3 || ^4",
|
package/src/main.css
CHANGED
|
@@ -5370,7 +5370,7 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
5370
5370
|
gap: var(--Prompt-actions-gap, var(--size-8));
|
|
5371
5371
|
grid-column-start: 2;
|
|
5372
5372
|
}
|
|
5373
|
-
@media (max-width:
|
|
5373
|
+
@media (max-width: 767px) {
|
|
5374
5374
|
.wds-prompt__actions-wrapper {
|
|
5375
5375
|
grid-column: span 2;
|
|
5376
5376
|
width: 100%;
|
|
@@ -7423,3 +7423,15 @@ html:not([dir="rtl"]) .np-navigation-option {
|
|
|
7423
7423
|
.np-list-item__action {
|
|
7424
7424
|
flex-shrink: 0;
|
|
7425
7425
|
}
|
|
7426
|
+
.wds-action-prompt {
|
|
7427
|
+
--Prompt-padding: var(--size-16);
|
|
7428
|
+
--Prompt-gap: var(--size-10) var(--size-16);
|
|
7429
|
+
}
|
|
7430
|
+
.wds-action-prompt--media-image {
|
|
7431
|
+
width: 48px;
|
|
7432
|
+
width: var(--size-48);
|
|
7433
|
+
height: 48px;
|
|
7434
|
+
height: var(--size-48);
|
|
7435
|
+
-o-object-fit: contain;
|
|
7436
|
+
object-fit: contain;
|
|
7437
|
+
}
|
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!
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
.wds-action-prompt {
|
|
2
|
+
--Prompt-padding: var(--size-16);
|
|
3
|
+
--Prompt-gap: var(--size-10) var(--size-16);
|
|
4
|
+
}
|
|
5
|
+
.wds-action-prompt--media-image {
|
|
6
|
+
width: 48px;
|
|
7
|
+
width: var(--size-48);
|
|
8
|
+
height: 48px;
|
|
9
|
+
height: var(--size-48);
|
|
10
|
+
-o-object-fit: contain;
|
|
11
|
+
object-fit: contain;
|
|
12
|
+
}
|
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Bank } from '@transferwise/icons';
|
|
3
|
+
import { ActionPrompt } from './ActionPrompt';
|
|
4
|
+
import { lorem10 } from '../../test-utils';
|
|
5
|
+
import { allModes } from '../../../.storybook/modes';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Prompts/ActionPrompt',
|
|
9
|
+
component: ActionPrompt,
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
export const AllSentiments = {
|
|
13
|
+
render: () => {
|
|
14
|
+
return (['negative', 'warning', 'neutral', 'success', 'proposition'] as const).map(
|
|
15
|
+
(sentiment) => (
|
|
16
|
+
<ActionPrompt
|
|
17
|
+
key={sentiment}
|
|
18
|
+
sentiment={sentiment}
|
|
19
|
+
title="Title"
|
|
20
|
+
description={lorem10}
|
|
21
|
+
actionPrimary={{ label: 'Primary', onClick: () => {} }}
|
|
22
|
+
actionSecondary={{ label: 'Secondary', onClick: () => {} }}
|
|
23
|
+
className="m-b-2"
|
|
24
|
+
onDismiss={() => {
|
|
25
|
+
console.log('empty callback');
|
|
26
|
+
}}
|
|
27
|
+
/>
|
|
28
|
+
),
|
|
29
|
+
);
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Mobile = {
|
|
34
|
+
...AllSentiments,
|
|
35
|
+
parameters: {
|
|
36
|
+
variants: ['mobile'],
|
|
37
|
+
chromatic: {
|
|
38
|
+
mobile: allModes.largeMobile,
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
export const PrimaryActionOnly = () => {
|
|
44
|
+
return (
|
|
45
|
+
<ActionPrompt
|
|
46
|
+
sentiment="proposition"
|
|
47
|
+
title="Payment successful"
|
|
48
|
+
description="Your money is on its way"
|
|
49
|
+
actionPrimary={{ label: 'View details', onClick: () => {} }}
|
|
50
|
+
onDismiss={() => {}}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export const WithoutDescription = () => {
|
|
56
|
+
return (
|
|
57
|
+
<>
|
|
58
|
+
<ActionPrompt
|
|
59
|
+
sentiment="warning"
|
|
60
|
+
title="Session expiring soon"
|
|
61
|
+
actionPrimary={{ label: 'Stay logged in', onClick: () => {} }}
|
|
62
|
+
actionSecondary={{ label: 'Log out', onClick: () => {} }}
|
|
63
|
+
className="m-b-2"
|
|
64
|
+
onDismiss={() => {}}
|
|
65
|
+
/>
|
|
66
|
+
<ActionPrompt
|
|
67
|
+
sentiment="success"
|
|
68
|
+
title="Session expiring soon"
|
|
69
|
+
actionPrimary={{ label: 'Stay logged in', onClick: () => {} }}
|
|
70
|
+
className="m-b-2"
|
|
71
|
+
/>
|
|
72
|
+
<ActionPrompt
|
|
73
|
+
title="Session expiring soon"
|
|
74
|
+
actionPrimary={{ label: 'Stay logged in', onClick: () => {} }}
|
|
75
|
+
/>
|
|
76
|
+
</>
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const Media = () => {
|
|
81
|
+
return (
|
|
82
|
+
<>
|
|
83
|
+
<ActionPrompt
|
|
84
|
+
sentiment="neutral"
|
|
85
|
+
title="Custom image"
|
|
86
|
+
description={lorem10}
|
|
87
|
+
media={{ imgSrc: '../../wise-card.svg' }}
|
|
88
|
+
actionPrimary={{ label: 'Invite now', onClick: () => {} }}
|
|
89
|
+
className="m-b-2"
|
|
90
|
+
/>
|
|
91
|
+
<ActionPrompt
|
|
92
|
+
sentiment="neutral"
|
|
93
|
+
title="Profile Image"
|
|
94
|
+
description={lorem10}
|
|
95
|
+
media={{ avatar: { imgSrc: '../../avatar-rectangle-fox.webp' } }}
|
|
96
|
+
actionPrimary={{ label: 'Invite now', onClick: () => {} }}
|
|
97
|
+
className="m-b-2"
|
|
98
|
+
/>
|
|
99
|
+
<ActionPrompt
|
|
100
|
+
sentiment="proposition"
|
|
101
|
+
title="Business Profile"
|
|
102
|
+
description={lorem10}
|
|
103
|
+
media={{ avatar: { profileType: 'BUSINESS', badge: { flagCode: 'GB' } } }}
|
|
104
|
+
actionPrimary={{ label: 'Invite now', onClick: () => {} }}
|
|
105
|
+
className="m-b-2"
|
|
106
|
+
/>
|
|
107
|
+
<ActionPrompt
|
|
108
|
+
sentiment="negative"
|
|
109
|
+
title="Personal Profile"
|
|
110
|
+
description={lorem10}
|
|
111
|
+
media={{ avatar: { profileType: 'PERSONAL', badge: { flagCode: 'EU' } } }}
|
|
112
|
+
actionPrimary={{ label: 'Invite now', onClick: () => {} }}
|
|
113
|
+
className="m-b-2"
|
|
114
|
+
/>
|
|
115
|
+
<ActionPrompt
|
|
116
|
+
sentiment="warning"
|
|
117
|
+
title="Custom Icon"
|
|
118
|
+
description={lorem10}
|
|
119
|
+
media={{ avatar: { asset: <Bank /> } }}
|
|
120
|
+
actionPrimary={{ label: 'Invite now', onClick: () => {} }}
|
|
121
|
+
className="m-b-2"
|
|
122
|
+
/>
|
|
123
|
+
<ActionPrompt
|
|
124
|
+
sentiment="success"
|
|
125
|
+
title="Initials"
|
|
126
|
+
description={lorem10}
|
|
127
|
+
media={{ avatar: { profileName: 'John Doe' } }}
|
|
128
|
+
actionPrimary={{ label: 'Invite now', onClick: () => {} }}
|
|
129
|
+
actionSecondary={{ label: 'Maybe later', onClick: () => {} }}
|
|
130
|
+
/>
|
|
131
|
+
</>
|
|
132
|
+
);
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export const OnDismiss = () => {
|
|
136
|
+
const [showNeutralPrompt, setShowNeutralPrompt] = useState(true);
|
|
137
|
+
const [showSuccessPrompt, setShowSuccessPrompt] = useState(true);
|
|
138
|
+
return (
|
|
139
|
+
<>
|
|
140
|
+
{showNeutralPrompt && (
|
|
141
|
+
<ActionPrompt
|
|
142
|
+
sentiment="proposition"
|
|
143
|
+
title="Payment successful"
|
|
144
|
+
description="Your money is on its way"
|
|
145
|
+
actionPrimary={{ label: 'View details', onClick: () => {} }}
|
|
146
|
+
className="m-b-2"
|
|
147
|
+
onDismiss={() => setShowNeutralPrompt(false)}
|
|
148
|
+
/>
|
|
149
|
+
)}
|
|
150
|
+
{showSuccessPrompt && (
|
|
151
|
+
<ActionPrompt
|
|
152
|
+
sentiment="success"
|
|
153
|
+
title="Payment successful"
|
|
154
|
+
description="Your money is on its way"
|
|
155
|
+
actionPrimary={{ label: 'View details', onClick: () => {} }}
|
|
156
|
+
onDismiss={() => setShowSuccessPrompt(false)}
|
|
157
|
+
/>
|
|
158
|
+
)}
|
|
159
|
+
</>
|
|
160
|
+
);
|
|
161
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
|
|
4
|
+
import StatusIcon from '../../statusIcon';
|
|
5
|
+
import Body from '../../body';
|
|
6
|
+
import Button from '../../button';
|
|
7
|
+
import { Breakpoint, Typography } from '../../common';
|
|
8
|
+
import AvatarView, { AvatarViewProps } from '../../avatarView';
|
|
9
|
+
import Image from '../../image';
|
|
10
|
+
import { ButtonProps } from '../../button/Button.types';
|
|
11
|
+
import { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';
|
|
12
|
+
import { BadgeAssetsProps } from '../../badge';
|
|
13
|
+
import { useScreenSize } from '../../common/hooks/useScreenSize';
|
|
14
|
+
import { GiftBox } from '@transferwise/icons';
|
|
15
|
+
|
|
16
|
+
export type ActionPromptProps = {
|
|
17
|
+
title: ReactNode;
|
|
18
|
+
description?: ReactNode;
|
|
19
|
+
media?: {
|
|
20
|
+
imgSrc?: string;
|
|
21
|
+
avatar?: Pick<AvatarViewProps, 'imgSrc' | 'profileName' | 'profileType'> & {
|
|
22
|
+
asset?: AvatarViewProps['children'];
|
|
23
|
+
badge?: Pick<BadgeAssetsProps, 'flagCode'>;
|
|
24
|
+
};
|
|
25
|
+
'aria-label'?: string;
|
|
26
|
+
};
|
|
27
|
+
actionPrimary: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {
|
|
28
|
+
label: ButtonProps['children'];
|
|
29
|
+
};
|
|
30
|
+
actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {
|
|
31
|
+
label: ButtonProps['children'];
|
|
32
|
+
};
|
|
33
|
+
} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid' | 'sentiment' | 'onDismiss'>;
|
|
34
|
+
|
|
35
|
+
export const ActionPrompt = ({
|
|
36
|
+
sentiment = 'neutral',
|
|
37
|
+
title,
|
|
38
|
+
description,
|
|
39
|
+
onDismiss,
|
|
40
|
+
media,
|
|
41
|
+
actionPrimary,
|
|
42
|
+
actionSecondary,
|
|
43
|
+
id,
|
|
44
|
+
className,
|
|
45
|
+
'data-testid': testId,
|
|
46
|
+
}: ActionPromptProps) => {
|
|
47
|
+
const isMobile = !useScreenSize(Breakpoint.MEDIUM);
|
|
48
|
+
|
|
49
|
+
const renderMedia = () => {
|
|
50
|
+
if (media?.imgSrc) {
|
|
51
|
+
return (
|
|
52
|
+
<Image
|
|
53
|
+
src={media.imgSrc}
|
|
54
|
+
className="wds-action-prompt--media-image"
|
|
55
|
+
alt={media['aria-label'] ?? ''}
|
|
56
|
+
/>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
if (media?.avatar) {
|
|
60
|
+
const badge = media.avatar.badge
|
|
61
|
+
? media.avatar.badge
|
|
62
|
+
: sentiment === 'proposition'
|
|
63
|
+
? {}
|
|
64
|
+
: { status: sentiment };
|
|
65
|
+
return (
|
|
66
|
+
<AvatarView {...media.avatar} badge={badge} size={48}>
|
|
67
|
+
{media.avatar.asset}
|
|
68
|
+
</AvatarView>
|
|
69
|
+
);
|
|
70
|
+
}
|
|
71
|
+
return sentiment === 'proposition' ? (
|
|
72
|
+
<AvatarView size={48}>
|
|
73
|
+
<GiftBox />
|
|
74
|
+
</AvatarView>
|
|
75
|
+
) : (
|
|
76
|
+
<StatusIcon size={48} sentiment={sentiment} />
|
|
77
|
+
);
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
return (
|
|
81
|
+
<PrimitivePrompt
|
|
82
|
+
id={id}
|
|
83
|
+
sentiment={sentiment}
|
|
84
|
+
data-testid={testId}
|
|
85
|
+
className={clsx('wds-action-prompt', `wds-action-prompt--${sentiment}`, className)}
|
|
86
|
+
media={renderMedia()}
|
|
87
|
+
actions={
|
|
88
|
+
<>
|
|
89
|
+
{actionSecondary && (
|
|
90
|
+
// @ts-expect-error onClick type mismatch
|
|
91
|
+
<Button
|
|
92
|
+
v2
|
|
93
|
+
size="md"
|
|
94
|
+
priority="secondary"
|
|
95
|
+
href={actionSecondary.href}
|
|
96
|
+
block={isMobile}
|
|
97
|
+
onClick={actionSecondary?.onClick}
|
|
98
|
+
>
|
|
99
|
+
{actionSecondary.label}
|
|
100
|
+
</Button>
|
|
101
|
+
)}
|
|
102
|
+
{/* @ts-expect-error onClick type mismatch */}
|
|
103
|
+
<Button
|
|
104
|
+
v2
|
|
105
|
+
size="md"
|
|
106
|
+
priority="primary"
|
|
107
|
+
href={actionPrimary.href}
|
|
108
|
+
block={isMobile}
|
|
109
|
+
onClick={actionPrimary.onClick}
|
|
110
|
+
>
|
|
111
|
+
{actionPrimary.label}
|
|
112
|
+
</Button>
|
|
113
|
+
</>
|
|
114
|
+
}
|
|
115
|
+
onDismiss={onDismiss}
|
|
116
|
+
>
|
|
117
|
+
<div className={clsx('d-flex', 'flex-column', 'justify-content-center')}>
|
|
118
|
+
<Body type={Typography.BODY_LARGE_BOLD}>{title}</Body>
|
|
119
|
+
{description && <Body>{description}</Body>}
|
|
120
|
+
</div>
|
|
121
|
+
</PrimitivePrompt>
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
export default ActionPrompt;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/actionButton/__snapshots__/{ActionButton.test.tsx.snap → ActionButton.spec.tsx.snap}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/avatarWrapper/__snapshots__/{AvatarWrapper.test.tsx.snap → AvatarWrapper.spec.tsx.snap}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/button/_stories/{Button.default.test.story.tsx → Button.default.tests.story.tsx}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/circularButton/{CircularButton.test.story.tsx → CircularButton.tests.story.tsx}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/src/common/flowHeader/__snapshots__/{FlowHeader.test.tsx.snap → FlowHeader.spec.tsx.snap}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|