@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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_Popover.mjs","sources":["../../src/inputs/_Popover.tsx"],"sourcesContent":["import {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingPortal,\n offset,\n type Placement,\n shift,\n size as floatingSize,\n useDismiss,\n useFloating,\n useInteractions,\n useRole,\n} from '@floating-ui/react';\nimport { Transition } from '@headlessui/react';\nimport { FocusScope } from '@react-aria/focus';\nimport { ThemeProvider, useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useState } from 'react';\n\nimport { PreventScroll } from '../common/preventScroll/PreventScroll';\n\nexport interface PopoverProps {\n placement?: Placement;\n open: boolean;\n renderTrigger: (args: {\n ref: React.RefCallback<Element>;\n getInteractionProps: (customEventHandlers?: React.HTMLProps<Element>) => {\n [key: string]: unknown;\n };\n }) => React.ReactNode;\n title?: string;\n size?: 'md' | 'lg';\n padding?: 'none' | 'md';\n children?: React.ReactNode;\n onClose?: () => void;\n onCloseEnd?: () => void;\n}\n\nconst floatingPadding = 16;\n\nexport function Popover({\n placement,\n open,\n renderTrigger,\n title,\n size = 'md',\n padding = 'md',\n children,\n onClose,\n onCloseEnd,\n}: PopoverProps) {\n const { refs, floatingStyles, context } = useFloating<Element>({\n placement,\n middleware: [\n offset(8),\n flip({ padding: floatingPadding, crossAxis: false }),\n shift(),\n floatingSize({\n padding: floatingPadding,\n apply: ({ elements, rects, availableHeight }) => {\n elements.floating.style.setProperty('--max-height', `${availableHeight}px`);\n elements.floating.style.setProperty('--width', `${rects.reference.width}px`);\n },\n }),\n ],\n whileElementsMounted: autoUpdate,\n open,\n onOpenChange: (value) => {\n if (!value) {\n onClose?.();\n }\n },\n });\n\n const dismiss = useDismiss(context);\n const role = useRole(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([role, dismiss]);\n\n const [floatingKey, setFloatingKey] = useState(0);\n\n const { theme, screenMode } = useTheme();\n\n return (\n <>\n {open ? <PreventScroll /> : null}\n {renderTrigger({\n ref: refs.setReference,\n getInteractionProps: getReferenceProps,\n })}\n\n <FloatingPortal>\n <ThemeProvider theme=\"personal\" screenMode={theme === 'personal' ? screenMode : 'light'}>\n <Transition\n show={open}\n leave=\"transition-opacity\"\n leaveTo=\"opacity-0\"\n beforeEnter={() => {\n setFloatingKey((prev) => prev + 1);\n }}\n afterLeave={onCloseEnd}\n >\n <FocusScope>\n <FloatingFocusManager context={context}>\n <div\n key={floatingKey} // Force inner state invalidation on open\n ref={refs.setFloating}\n className={clsx('np-popover-v2-container', {\n 'np-popover-v2-container--size-md': size === 'md',\n 'np-popover-v2-container--size-lg': size === 'lg',\n })}\n style={floatingStyles}\n {...getFloatingProps()}\n >\n <div\n className={clsx('np-popover-v2', title && 'np-popover-v2--has-title', {\n 'np-popover-v2--padding-md': padding === 'md',\n })}\n >\n {title ? (\n <h2 className=\"np-popover-v2-title np-text-title-body\">{title}</h2>\n ) : null}\n <div className=\"np-popover-v2-content np-text-body-default\">{children}</div>\n </div>\n </div>\n </FloatingFocusManager>\n </FocusScope>\n </Transition>\n </ThemeProvider>\n </FloatingPortal>\n </>\n );\n}\n"],"names":["floatingPadding","Popover","placement","open","renderTrigger","title","size","padding","children","onClose","onCloseEnd","refs","floatingStyles","context","useFloating","middleware","offset","flip","crossAxis","shift","floatingSize","apply","elements","rects","availableHeight","floating","style","setProperty","reference","width","whileElementsMounted","autoUpdate","onOpenChange","value","dismiss","useDismiss","role","useRole","getReferenceProps","getFloatingProps","useInteractions","floatingKey","setFloatingKey","useState","theme","screenMode","useTheme","_jsxs","_Fragment","_jsx","PreventScroll","ref","setReference","getInteractionProps","FloatingPortal","ThemeProvider","Transition","show","leave","leaveTo","beforeEnter","prev","afterLeave","FocusScope","FloatingFocusManager","setFloating","className","clsx"],"mappings":";;;;;;;;;AAuCA,MAAMA,eAAe,GAAG,EAAE;AAEpB,SAAUC,OAAOA,CAAC;EACtBC,SAAS;EACTC,IAAI;EACJC,aAAa;EACbC,KAAK;AACLC,QAAAA,MAAI,GAAG,IAAI;AACXC,EAAAA,OAAO,GAAG,IAAI;EACdC,QAAQ;EACRC,OAAO;AACPC,EAAAA;AAAU,CACG,EAAA;EACb,MAAM;IAAEC,IAAI;IAAEC,cAAc;AAAEC,IAAAA;GAAS,GAAGC,WAAW,CAAU;
|
|
1
|
+
{"version":3,"file":"_Popover.mjs","sources":["../../src/inputs/_Popover.tsx"],"sourcesContent":["import {\n autoUpdate,\n flip,\n FloatingFocusManager,\n FloatingPortal,\n offset,\n type Placement,\n shift,\n size as floatingSize,\n useDismiss,\n useFloating,\n useInteractions,\n useRole,\n} from '@floating-ui/react';\nimport { Transition } from '@headlessui/react';\nimport { FocusScope } from '@react-aria/focus';\nimport { ThemeProvider, useTheme } from '@wise/components-theming';\nimport { clsx } from 'clsx';\nimport { useState } from 'react';\n\nimport { PreventScroll } from '../common/preventScroll/PreventScroll';\n\nexport interface PopoverProps {\n placement?: Placement;\n open: boolean;\n renderTrigger: (args: {\n ref: React.RefCallback<Element>;\n getInteractionProps: (customEventHandlers?: React.HTMLProps<Element>) => {\n [key: string]: unknown;\n };\n }) => React.ReactNode;\n title?: string;\n size?: 'md' | 'lg';\n padding?: 'none' | 'md';\n children?: React.ReactNode;\n onClose?: () => void;\n onCloseEnd?: () => void;\n}\n\nconst floatingPadding = 16;\n\nexport function Popover({\n placement,\n open,\n renderTrigger,\n title,\n size = 'md',\n padding = 'md',\n children,\n onClose,\n onCloseEnd,\n}: PopoverProps) {\n const { refs, floatingStyles, context } = useFloating<Element>({\n strategy: 'fixed',\n placement,\n middleware: [\n offset(8),\n flip({ padding: floatingPadding, crossAxis: false }),\n shift(),\n floatingSize({\n padding: floatingPadding,\n apply: ({ elements, rects, availableHeight }) => {\n elements.floating.style.setProperty('--max-height', `${availableHeight}px`);\n elements.floating.style.setProperty('--width', `${rects.reference.width}px`);\n },\n }),\n ],\n whileElementsMounted: autoUpdate,\n open,\n onOpenChange: (value) => {\n if (!value) {\n onClose?.();\n }\n },\n });\n\n const dismiss = useDismiss(context);\n const role = useRole(context);\n const { getReferenceProps, getFloatingProps } = useInteractions([role, dismiss]);\n\n const [floatingKey, setFloatingKey] = useState(0);\n\n const { theme, screenMode } = useTheme();\n\n return (\n <>\n {open ? <PreventScroll /> : null}\n {renderTrigger({\n ref: refs.setReference,\n getInteractionProps: getReferenceProps,\n })}\n\n <FloatingPortal>\n <ThemeProvider theme=\"personal\" screenMode={theme === 'personal' ? screenMode : 'light'}>\n <Transition\n as=\"div\"\n show={open}\n leave=\"transition-opacity\"\n leaveTo=\"opacity-0\"\n beforeEnter={() => {\n setFloatingKey((prev) => prev + 1);\n }}\n afterLeave={onCloseEnd}\n >\n <FocusScope>\n <FloatingFocusManager context={context}>\n <div\n key={floatingKey} // Force inner state invalidation on open\n ref={refs.setFloating}\n className={clsx('np-popover-v2-container', {\n 'np-popover-v2-container--size-md': size === 'md',\n 'np-popover-v2-container--size-lg': size === 'lg',\n })}\n style={floatingStyles}\n {...getFloatingProps()}\n >\n <div\n className={clsx('np-popover-v2', title && 'np-popover-v2--has-title', {\n 'np-popover-v2--padding-md': padding === 'md',\n })}\n >\n {title ? (\n <h2 className=\"np-popover-v2-title np-text-title-body\">{title}</h2>\n ) : null}\n <div className=\"np-popover-v2-content np-text-body-default\">{children}</div>\n </div>\n </div>\n </FloatingFocusManager>\n </FocusScope>\n </Transition>\n </ThemeProvider>\n </FloatingPortal>\n </>\n );\n}\n"],"names":["floatingPadding","Popover","placement","open","renderTrigger","title","size","padding","children","onClose","onCloseEnd","refs","floatingStyles","context","useFloating","strategy","middleware","offset","flip","crossAxis","shift","floatingSize","apply","elements","rects","availableHeight","floating","style","setProperty","reference","width","whileElementsMounted","autoUpdate","onOpenChange","value","dismiss","useDismiss","role","useRole","getReferenceProps","getFloatingProps","useInteractions","floatingKey","setFloatingKey","useState","theme","screenMode","useTheme","_jsxs","_Fragment","_jsx","PreventScroll","ref","setReference","getInteractionProps","FloatingPortal","ThemeProvider","Transition","as","show","leave","leaveTo","beforeEnter","prev","afterLeave","FocusScope","FloatingFocusManager","setFloating","className","clsx"],"mappings":";;;;;;;;;AAuCA,MAAMA,eAAe,GAAG,EAAE;AAEpB,SAAUC,OAAOA,CAAC;EACtBC,SAAS;EACTC,IAAI;EACJC,aAAa;EACbC,KAAK;AACLC,QAAAA,MAAI,GAAG,IAAI;AACXC,EAAAA,OAAO,GAAG,IAAI;EACdC,QAAQ;EACRC,OAAO;AACPC,EAAAA;AAAU,CACG,EAAA;EACb,MAAM;IAAEC,IAAI;IAAEC,cAAc;AAAEC,IAAAA;GAAS,GAAGC,WAAW,CAAU;AAC7DC,IAAAA,QAAQ,EAAE,OAAO;IACjBb,SAAS;IACTc,UAAU,EAAE,CACVC,MAAM,CAAC,CAAC,CAAC,EACTC,IAAI,CAAC;AAAEX,MAAAA,OAAO,EAAEP,eAAe;AAAEmB,MAAAA,SAAS,EAAE;AAAK,KAAE,CAAC,EACpDC,KAAK,EAAE,EACPC,IAAY,CAAC;AACXd,MAAAA,OAAO,EAAEP,eAAe;AACxBsB,MAAAA,KAAK,EAAEA,CAAC;QAAEC,QAAQ;QAAEC,KAAK;AAAEC,QAAAA;AAAe,OAAE,KAAI;AAC9CF,QAAAA,QAAQ,CAACG,QAAQ,CAACC,KAAK,CAACC,WAAW,CAAC,cAAc,EAAE,CAAA,EAAGH,eAAe,CAAA,EAAA,CAAI,CAAC;AAC3EF,QAAAA,QAAQ,CAACG,QAAQ,CAACC,KAAK,CAACC,WAAW,CAAC,SAAS,EAAE,CAAA,EAAGJ,KAAK,CAACK,SAAS,CAACC,KAAK,IAAI,CAAC;AAC9E,MAAA;KACD,CAAC,CACH;AACDC,IAAAA,oBAAoB,EAAEC,UAAU;IAChC7B,IAAI;IACJ8B,YAAY,EAAGC,KAAK,IAAI;MACtB,IAAI,CAACA,KAAK,EAAE;AACVzB,QAAAA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T0C,GAAA,CAACgB,oBAAoB,EAAA;AAACrD,cAAAA,OAAO,EAAEA,OAAQ;AAAAL,cAAAA,QAAA,eACrC0C,GAAA,CAAA,KAAA,EAAA;AACoB;gBAClBE,GAAG,EAAEzC,IAAI,CAACwD,WAAY;AACtBC,gBAAAA,SAAS,EAAEC,IAAI,CAAC,yBAAyB,EAAE;kBACzC,kCAAkC,EAAE/D,MAAI,KAAK,IAAI;kBACjD,kCAAkC,EAAEA,MAAI,KAAK;AAC9C,iBAAA,CAAE;AACHqB,gBAAAA,KAAK,EAAEf,cAAe;gBAAA,GAClB4B,gBAAgB,EAAE;AAAAhC,gBAAAA,QAAA,eAEtBwC,IAAA,CAAA,KAAA,EAAA;kBACEoB,SAAS,EAAEC,IAAI,CAAC,eAAe,EAAEhE,KAAK,IAAI,0BAA0B,EAAE;oBACpE,2BAA2B,EAAEE,OAAO,KAAK;AAC1C,mBAAA,CAAE;kBAAAC,QAAA,EAAA,CAEFH,KAAK,gBACJ6C,GAAA,CAAA,IAAA,EAAA;AAAIkB,oBAAAA,SAAS,EAAC,wCAAwC;AAAA5D,oBAAAA,QAAA,EAAEH;AAAK,mBAAK,CAAC,GACjE,IAAI,eACR6C,GAAA,CAAA,KAAA,EAAA;AAAKkB,oBAAAA,SAAS,EAAC,4CAA4C;AAAA5D,oBAAAA,QAAA,EAAEA;AAAQ,mBAAM,CAC7E;iBAAK;AACP,eAAA,EAnBOkC,WAmBF;aACe;WACZ;SACF;OACC;AACjB,KAAgB,CAClB;AAAA,GAAA,CAAG;AAEP;;;;"}
|
|
@@ -29,6 +29,16 @@ require('../../common/closeButton/CloseButton.messages.js');
|
|
|
29
29
|
var jsxRuntime = require('react/jsx-runtime');
|
|
30
30
|
var ListItemContext = require('../ListItemContext.js');
|
|
31
31
|
var InlinePrompt = require('../../prompt/InlinePrompt/InlinePrompt.js');
|
|
32
|
+
require('../../statusIcon/StatusIcon.js');
|
|
33
|
+
require('../../body/Body.js');
|
|
34
|
+
require('../../button/Button.resolver.js');
|
|
35
|
+
require('../../badge/Badge.js');
|
|
36
|
+
require('@wise/art');
|
|
37
|
+
require('@transferwise/neptune-validation');
|
|
38
|
+
require('../../provider/direction/DirectionProvider.js');
|
|
39
|
+
require('../../sentimentSurface/SentimentSurface.js');
|
|
40
|
+
require('../../primitives/PrimitiveButton/PrimitiveButton.js');
|
|
41
|
+
require('../../primitives/PrimitiveAnchor/PrimitiveAnchor.js');
|
|
32
42
|
|
|
33
43
|
const Prompt = ({
|
|
34
44
|
sentiment: sentiment$1 = sentiment.Sentiment.NEUTRAL,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemPrompt.js","sources":["../../../src/listItem/Prompt/ListItemPrompt.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport { Sentiment } from '../../common';\nimport { ListItemContext, type ListItemContextData } from '../ListItemContext';\nimport { InlinePrompt, type InlinePromptProps } from '../../prompt';\n\nexport type ListItemPromptProps = Pick<InlinePromptProps, 'children' | 'sentiment' | 'mediaLabel'>;\n\n/**\n * This component allows for rendering an Inline Prompt. <br />\n * In the future it will be a thin wrapper around a standalone component.<br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.\n */\nexport const Prompt = ({\n sentiment = Sentiment.NEUTRAL,\n mediaLabel,\n children,\n}: ListItemPromptProps) => {\n const { ids, props } = useContext<ListItemContextData>(ListItemContext);\n const isLongLivedMuted = props.disabled && Boolean(props.disabledPromptMessage);\n\n return (\n <InlinePrompt\n id={ids.prompt}\n sentiment={sentiment}\n mediaLabel={mediaLabel}\n muted={isLongLivedMuted}\n className=\"wds-list-item-prompt\"\n >\n {isLongLivedMuted ? props.disabledPromptMessage : children}\n </InlinePrompt>\n );\n};\n\nPrompt.displayName = 'ListItem.Prompt';\nexport default Prompt;\n"],"names":["Prompt","sentiment","Sentiment","NEUTRAL","mediaLabel","children","ids","props","useContext","ListItemContext","isLongLivedMuted","disabled","Boolean","disabledPromptMessage","_jsx","InlinePrompt","id","prompt","muted","className","displayName"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItemPrompt.js","sources":["../../../src/listItem/Prompt/ListItemPrompt.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport { Sentiment } from '../../common';\nimport { ListItemContext, type ListItemContextData } from '../ListItemContext';\nimport { InlinePrompt, type InlinePromptProps } from '../../prompt';\n\nexport type ListItemPromptProps = Pick<InlinePromptProps, 'children' | 'sentiment' | 'mediaLabel'>;\n\n/**\n * This component allows for rendering an Inline Prompt. <br />\n * In the future it will be a thin wrapper around a standalone component.<br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.\n */\nexport const Prompt = ({\n sentiment = Sentiment.NEUTRAL,\n mediaLabel,\n children,\n}: ListItemPromptProps) => {\n const { ids, props } = useContext<ListItemContextData>(ListItemContext);\n const isLongLivedMuted = props.disabled && Boolean(props.disabledPromptMessage);\n\n return (\n <InlinePrompt\n id={ids.prompt}\n sentiment={sentiment}\n mediaLabel={mediaLabel}\n muted={isLongLivedMuted}\n className=\"wds-list-item-prompt\"\n >\n {isLongLivedMuted ? props.disabledPromptMessage : children}\n </InlinePrompt>\n );\n};\n\nPrompt.displayName = 'ListItem.Prompt';\nexport default Prompt;\n"],"names":["Prompt","sentiment","Sentiment","NEUTRAL","mediaLabel","children","ids","props","useContext","ListItemContext","isLongLivedMuted","disabled","Boolean","disabledPromptMessage","_jsx","InlinePrompt","id","prompt","muted","className","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAMA,MAAM,GAAGA,CAAC;aACrBC,WAAS,GAAGC,mBAAS,CAACC,OAAO;EAC7BC,UAAU;AACVC,EAAAA;AAAQ,CACY,KAAI;EACxB,MAAM;IAAEC,GAAG;AAAEC,IAAAA;AAAK,GAAE,GAAGC,gBAAU,CAAsBC,+BAAe,CAAC;EACvE,MAAMC,gBAAgB,GAAGH,KAAK,CAACI,QAAQ,IAAIC,OAAO,CAACL,KAAK,CAACM,qBAAqB,CAAC;EAE/E,oBACEC,cAAA,CAACC,yBAAY,EAAA;IACXC,EAAE,EAAEV,GAAG,CAACW,MAAO;AACfhB,IAAAA,SAAS,EAAEA,WAAU;AACrBG,IAAAA,UAAU,EAAEA,UAAW;AACvBc,IAAAA,KAAK,EAAER,gBAAiB;AACxBS,IAAAA,SAAS,EAAC,sBAAsB;AAAAd,IAAAA,QAAA,EAE/BK,gBAAgB,GAAGH,KAAK,CAACM,qBAAqB,GAAGR;AAAQ,GAC9C,CAAC;AAEnB;AAEAL,MAAM,CAACoB,WAAW,GAAG,iBAAiB;;;;;"}
|
|
@@ -25,6 +25,16 @@ import '../../common/closeButton/CloseButton.messages.mjs';
|
|
|
25
25
|
import { jsx } from 'react/jsx-runtime';
|
|
26
26
|
import { ListItemContext } from '../ListItemContext.mjs';
|
|
27
27
|
import { InlinePrompt } from '../../prompt/InlinePrompt/InlinePrompt.mjs';
|
|
28
|
+
import '../../statusIcon/StatusIcon.mjs';
|
|
29
|
+
import '../../body/Body.mjs';
|
|
30
|
+
import '../../button/Button.resolver.mjs';
|
|
31
|
+
import '../../badge/Badge.mjs';
|
|
32
|
+
import '@wise/art';
|
|
33
|
+
import '@transferwise/neptune-validation';
|
|
34
|
+
import '../../provider/direction/DirectionProvider.mjs';
|
|
35
|
+
import '../../sentimentSurface/SentimentSurface.mjs';
|
|
36
|
+
import '../../primitives/PrimitiveButton/PrimitiveButton.mjs';
|
|
37
|
+
import '../../primitives/PrimitiveAnchor/PrimitiveAnchor.mjs';
|
|
28
38
|
|
|
29
39
|
const Prompt = ({
|
|
30
40
|
sentiment = Sentiment.NEUTRAL,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ListItemPrompt.mjs","sources":["../../../src/listItem/Prompt/ListItemPrompt.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport { Sentiment } from '../../common';\nimport { ListItemContext, type ListItemContextData } from '../ListItemContext';\nimport { InlinePrompt, type InlinePromptProps } from '../../prompt';\n\nexport type ListItemPromptProps = Pick<InlinePromptProps, 'children' | 'sentiment' | 'mediaLabel'>;\n\n/**\n * This component allows for rendering an Inline Prompt. <br />\n * In the future it will be a thin wrapper around a standalone component.<br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.\n */\nexport const Prompt = ({\n sentiment = Sentiment.NEUTRAL,\n mediaLabel,\n children,\n}: ListItemPromptProps) => {\n const { ids, props } = useContext<ListItemContextData>(ListItemContext);\n const isLongLivedMuted = props.disabled && Boolean(props.disabledPromptMessage);\n\n return (\n <InlinePrompt\n id={ids.prompt}\n sentiment={sentiment}\n mediaLabel={mediaLabel}\n muted={isLongLivedMuted}\n className=\"wds-list-item-prompt\"\n >\n {isLongLivedMuted ? props.disabledPromptMessage : children}\n </InlinePrompt>\n );\n};\n\nPrompt.displayName = 'ListItem.Prompt';\nexport default Prompt;\n"],"names":["Prompt","sentiment","Sentiment","NEUTRAL","mediaLabel","children","ids","props","useContext","ListItemContext","isLongLivedMuted","disabled","Boolean","disabledPromptMessage","_jsx","InlinePrompt","id","prompt","muted","className","displayName"],"mappings":"
|
|
1
|
+
{"version":3,"file":"ListItemPrompt.mjs","sources":["../../../src/listItem/Prompt/ListItemPrompt.tsx"],"sourcesContent":["import { useContext } from 'react';\nimport { Sentiment } from '../../common';\nimport { ListItemContext, type ListItemContextData } from '../ListItemContext';\nimport { InlinePrompt, type InlinePromptProps } from '../../prompt';\n\nexport type ListItemPromptProps = Pick<InlinePromptProps, 'children' | 'sentiment' | 'mediaLabel'>;\n\n/**\n * This component allows for rendering an Inline Prompt. <br />\n * In the future it will be a thin wrapper around a standalone component.<br />\n *\n * Please refer to the [Design documentation](https://wise.design/components/list-item#prompt) for details.\n */\nexport const Prompt = ({\n sentiment = Sentiment.NEUTRAL,\n mediaLabel,\n children,\n}: ListItemPromptProps) => {\n const { ids, props } = useContext<ListItemContextData>(ListItemContext);\n const isLongLivedMuted = props.disabled && Boolean(props.disabledPromptMessage);\n\n return (\n <InlinePrompt\n id={ids.prompt}\n sentiment={sentiment}\n mediaLabel={mediaLabel}\n muted={isLongLivedMuted}\n className=\"wds-list-item-prompt\"\n >\n {isLongLivedMuted ? props.disabledPromptMessage : children}\n </InlinePrompt>\n );\n};\n\nPrompt.displayName = 'ListItem.Prompt';\nexport default Prompt;\n"],"names":["Prompt","sentiment","Sentiment","NEUTRAL","mediaLabel","children","ids","props","useContext","ListItemContext","isLongLivedMuted","disabled","Boolean","disabledPromptMessage","_jsx","InlinePrompt","id","prompt","muted","className","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaO,MAAMA,MAAM,GAAGA,CAAC;EACrBC,SAAS,GAAGC,SAAS,CAACC,OAAO;EAC7BC,UAAU;AACVC,EAAAA;AAAQ,CACY,KAAI;EACxB,MAAM;IAAEC,GAAG;AAAEC,IAAAA;AAAK,GAAE,GAAGC,UAAU,CAAsBC,eAAe,CAAC;EACvE,MAAMC,gBAAgB,GAAGH,KAAK,CAACI,QAAQ,IAAIC,OAAO,CAACL,KAAK,CAACM,qBAAqB,CAAC;EAE/E,oBACEC,GAAA,CAACC,YAAY,EAAA;IACXC,EAAE,EAAEV,GAAG,CAACW,MAAO;AACfhB,IAAAA,SAAS,EAAEA,SAAU;AACrBG,IAAAA,UAAU,EAAEA,UAAW;AACvBc,IAAAA,KAAK,EAAER,gBAAiB;AACxBS,IAAAA,SAAS,EAAC,sBAAsB;AAAAd,IAAAA,QAAA,EAE/BK,gBAAgB,GAAGH,KAAK,CAACM,qBAAqB,GAAGR;AAAQ,GAC9C,CAAC;AAEnB;AAEAL,MAAM,CAACoB,WAAW,GAAG,iBAAiB;;;;"}
|
package/build/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
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var clsx = require('clsx');
|
|
6
|
+
var StatusIcon = require('../../statusIcon/StatusIcon.js');
|
|
7
|
+
var Body = require('../../body/Body.js');
|
|
8
|
+
var Button_resolver = require('../../button/Button.resolver.js');
|
|
9
|
+
require('../../common/theme.js');
|
|
10
|
+
require('../../common/direction.js');
|
|
11
|
+
require('../../common/propsValues/control.js');
|
|
12
|
+
var breakpoint = require('../../common/propsValues/breakpoint.js');
|
|
13
|
+
require('../../common/propsValues/size.js');
|
|
14
|
+
var typography = require('../../common/propsValues/typography.js');
|
|
15
|
+
require('../../common/propsValues/width.js');
|
|
16
|
+
require('../../common/propsValues/type.js');
|
|
17
|
+
require('../../common/propsValues/dateMode.js');
|
|
18
|
+
require('../../common/propsValues/monthFormat.js');
|
|
19
|
+
require('../../common/propsValues/position.js');
|
|
20
|
+
require('../../common/propsValues/layouts.js');
|
|
21
|
+
require('../../common/propsValues/status.js');
|
|
22
|
+
require('../../common/propsValues/sentiment.js');
|
|
23
|
+
require('../../common/propsValues/profileType.js');
|
|
24
|
+
require('../../common/propsValues/variant.js');
|
|
25
|
+
require('../../common/propsValues/scroll.js');
|
|
26
|
+
require('../../common/propsValues/markdownNodeType.js');
|
|
27
|
+
require('../../common/fileType.js');
|
|
28
|
+
var icons = require('@transferwise/icons');
|
|
29
|
+
require('react');
|
|
30
|
+
require('react-intl');
|
|
31
|
+
require('../../common/closeButton/CloseButton.messages.js');
|
|
32
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
33
|
+
var AvatarView = require('../../avatarView/AvatarView.js');
|
|
34
|
+
var Image = require('../../image/Image.js');
|
|
35
|
+
var PrimitivePrompt = require('../PrimitivePrompt/PrimitivePrompt.js');
|
|
36
|
+
var useScreenSize = require('../../common/hooks/useScreenSize.js');
|
|
37
|
+
|
|
38
|
+
const ActionPrompt = ({
|
|
39
|
+
sentiment = 'neutral',
|
|
40
|
+
title,
|
|
41
|
+
description,
|
|
42
|
+
onDismiss,
|
|
43
|
+
media,
|
|
44
|
+
action,
|
|
45
|
+
actionSecondary,
|
|
46
|
+
id,
|
|
47
|
+
className,
|
|
48
|
+
'data-testid': testId
|
|
49
|
+
}) => {
|
|
50
|
+
const isMobile = !useScreenSize.useScreenSize(breakpoint.Breakpoint.MEDIUM);
|
|
51
|
+
const renderMedia = () => {
|
|
52
|
+
if (media?.imgSrc) {
|
|
53
|
+
return /*#__PURE__*/jsxRuntime.jsx(Image.default, {
|
|
54
|
+
src: media.imgSrc,
|
|
55
|
+
className: "wds-action-prompt--media-image",
|
|
56
|
+
alt: media['aria-label'] ?? ''
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
if (media?.avatar) {
|
|
60
|
+
const badge = media.avatar.badge ? media.avatar.badge : sentiment === 'proposition' ? {} : {
|
|
61
|
+
status: sentiment
|
|
62
|
+
};
|
|
63
|
+
return /*#__PURE__*/jsxRuntime.jsx(AvatarView.default, {
|
|
64
|
+
...media.avatar,
|
|
65
|
+
badge: badge,
|
|
66
|
+
size: 48,
|
|
67
|
+
children: media.avatar.asset
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return sentiment === 'proposition' ? /*#__PURE__*/jsxRuntime.jsx(AvatarView.default, {
|
|
71
|
+
size: 48,
|
|
72
|
+
children: /*#__PURE__*/jsxRuntime.jsx(icons.GiftBox, {})
|
|
73
|
+
}) : /*#__PURE__*/jsxRuntime.jsx(StatusIcon.default, {
|
|
74
|
+
size: 48,
|
|
75
|
+
sentiment: sentiment
|
|
76
|
+
});
|
|
77
|
+
};
|
|
78
|
+
return /*#__PURE__*/jsxRuntime.jsx(PrimitivePrompt.PrimitivePrompt, {
|
|
79
|
+
id: id,
|
|
80
|
+
sentiment: sentiment,
|
|
81
|
+
"data-testid": testId,
|
|
82
|
+
className: clsx.clsx('wds-action-prompt', {
|
|
83
|
+
'wds-action-prompt--with-two-actions': !!actionSecondary
|
|
84
|
+
}, className),
|
|
85
|
+
media: renderMedia(),
|
|
86
|
+
actions: /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
87
|
+
children: [actionSecondary &&
|
|
88
|
+
/*#__PURE__*/
|
|
89
|
+
// @ts-expect-error onClick type mismatch
|
|
90
|
+
jsxRuntime.jsx(Button_resolver.default, {
|
|
91
|
+
v2: true,
|
|
92
|
+
size: "md",
|
|
93
|
+
priority: "secondary",
|
|
94
|
+
href: actionSecondary.href,
|
|
95
|
+
block: isMobile,
|
|
96
|
+
onClick: actionSecondary?.onClick,
|
|
97
|
+
children: actionSecondary.label
|
|
98
|
+
}), /*#__PURE__*/jsxRuntime.jsx(Button_resolver.default, {
|
|
99
|
+
v2: true,
|
|
100
|
+
size: "md",
|
|
101
|
+
priority: "primary",
|
|
102
|
+
href: action.href,
|
|
103
|
+
block: isMobile,
|
|
104
|
+
onClick: action.onClick,
|
|
105
|
+
children: action.label
|
|
106
|
+
})]
|
|
107
|
+
}),
|
|
108
|
+
onDismiss: onDismiss,
|
|
109
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
110
|
+
className: clsx.clsx('d-flex', 'flex-column', 'justify-content-center'),
|
|
111
|
+
children: [/*#__PURE__*/jsxRuntime.jsx(Body.default, {
|
|
112
|
+
type: typography.Typography.BODY_LARGE_BOLD,
|
|
113
|
+
children: title
|
|
114
|
+
}), description && /*#__PURE__*/jsxRuntime.jsx(Body.default, {
|
|
115
|
+
children: description
|
|
116
|
+
})]
|
|
117
|
+
})
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
|
|
121
|
+
exports.ActionPrompt = ActionPrompt;
|
|
122
|
+
exports.default = ActionPrompt;
|
|
123
|
+
//# sourceMappingURL=ActionPrompt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionPrompt.js","sources":["../../../src/prompt/ActionPrompt/ActionPrompt.tsx"],"sourcesContent":["import { ReactNode } from 'react';\nimport { clsx } from 'clsx';\n\nimport StatusIcon from '../../statusIcon';\nimport Body from '../../body';\nimport Button from '../../button';\nimport { Breakpoint, Typography } from '../../common';\nimport AvatarView, { AvatarViewProps } from '../../avatarView';\nimport Image from '../../image';\nimport { ButtonProps } from '../../button/Button.types';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\nimport { BadgeAssetsProps } from '../../badge';\nimport { GiftBox } from '@transferwise/icons';\nimport { useScreenSize } from '../../common/hooks/useScreenSize';\n\nexport type ActionPromptProps = {\n title: ReactNode;\n description?: ReactNode;\n media?: {\n imgSrc?: string;\n avatar?: Pick<AvatarViewProps, 'imgSrc' | 'profileName' | 'profileType'> & {\n asset?: AvatarViewProps['children'];\n badge?: Pick<BadgeAssetsProps, 'flagCode'>;\n };\n 'aria-label'?: string;\n };\n action: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid' | 'sentiment' | 'onDismiss'>;\n\nexport const ActionPrompt = ({\n sentiment = 'neutral',\n title,\n description,\n onDismiss,\n media,\n action,\n actionSecondary,\n id,\n className,\n 'data-testid': testId,\n}: ActionPromptProps) => {\n const isMobile = !useScreenSize(Breakpoint.MEDIUM);\n\n const renderMedia = () => {\n if (media?.imgSrc) {\n return (\n <Image\n src={media.imgSrc}\n className=\"wds-action-prompt--media-image\"\n alt={media['aria-label'] ?? ''}\n />\n );\n }\n if (media?.avatar) {\n const badge = media.avatar.badge\n ? media.avatar.badge\n : sentiment === 'proposition'\n ? {}\n : { status: sentiment };\n return (\n <AvatarView {...media.avatar} badge={badge} size={48}>\n {media.avatar.asset}\n </AvatarView>\n );\n }\n return sentiment === 'proposition' ? (\n <AvatarView size={48}>\n <GiftBox />\n </AvatarView>\n ) : (\n <StatusIcon size={48} sentiment={sentiment} />\n );\n };\n\n return (\n <PrimitivePrompt\n id={id}\n sentiment={sentiment}\n data-testid={testId}\n className={clsx(\n 'wds-action-prompt',\n { 'wds-action-prompt--with-two-actions': !!actionSecondary },\n className,\n )}\n media={renderMedia()}\n actions={\n <>\n {actionSecondary && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"secondary\"\n href={actionSecondary.href}\n block={isMobile}\n onClick={actionSecondary?.onClick}\n >\n {actionSecondary.label}\n </Button>\n )}\n {/* @ts-expect-error onClick type mismatch */}\n <Button\n v2\n size=\"md\"\n priority=\"primary\"\n href={action.href}\n block={isMobile}\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n </>\n }\n onDismiss={onDismiss}\n >\n <div className={clsx('d-flex', 'flex-column', 'justify-content-center')}>\n <Body type={Typography.BODY_LARGE_BOLD}>{title}</Body>\n {description && <Body>{description}</Body>}\n </div>\n </PrimitivePrompt>\n );\n};\n\nexport default ActionPrompt;\n"],"names":["ActionPrompt","sentiment","title","description","onDismiss","media","action","actionSecondary","id","className","testId","isMobile","useScreenSize","Breakpoint","MEDIUM","renderMedia","imgSrc","_jsx","Image","src","alt","avatar","badge","status","AvatarView","size","children","asset","GiftBox","StatusIcon","PrimitivePrompt","clsx","actions","_jsxs","_Fragment","Button","v2","priority","href","block","onClick","label","Body","type","Typography","BODY_LARGE_BOLD"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCO,MAAMA,YAAY,GAAGA,CAAC;AAC3BC,EAAAA,SAAS,GAAG,SAAS;EACrBC,KAAK;EACLC,WAAW;EACXC,SAAS;EACTC,KAAK;EACLC,MAAM;EACNC,eAAe;EACfC,EAAE;EACFC,SAAS;AACT,EAAA,aAAa,EAAEC;AAAM,CACH,KAAI;EACtB,MAAMC,QAAQ,GAAG,CAACC,2BAAa,CAACC,qBAAU,CAACC,MAAM,CAAC;EAElD,MAAMC,WAAW,GAAGA,MAAK;IACvB,IAAIV,KAAK,EAAEW,MAAM,EAAE;MACjB,oBACEC,cAAA,CAACC,aAAK,EAAA;QACJC,GAAG,EAAEd,KAAK,CAACW,MAAO;AAClBP,QAAAA,SAAS,EAAC,gCAAgC;AAC1CW,QAAAA,GAAG,EAAEf,KAAK,CAAC,YAAY,CAAC,IAAI;AAAG,OAAA,CAC/B;AAEN,IAAA;IACA,IAAIA,KAAK,EAAEgB,MAAM,EAAE;MACjB,MAAMC,KAAK,GAAGjB,KAAK,CAACgB,MAAM,CAACC,KAAK,GAC5BjB,KAAK,CAACgB,MAAM,CAACC,KAAK,GAClBrB,SAAS,KAAK,aAAa,GACzB,EAAE,GACF;AAAEsB,QAAAA,MAAM,EAAEtB;OAAW;MAC3B,oBACEgB,cAAA,CAACO,kBAAU,EAAA;QAAA,GAAKnB,KAAK,CAACgB,MAAM;AAAEC,QAAAA,KAAK,EAAEA,KAAM;AAACG,QAAAA,IAAI,EAAE,EAAG;AAAAC,QAAAA,QAAA,EAClDrB,KAAK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B6B,OAAO,EAAElC,MAAM,CAACkC,OAAQ;QAAAd,QAAA,EAEvBpB,MAAM,CAACmC;AAAK,OACP,CACV;AAAA,KAAA,CACD;AACDrC,IAAAA,SAAS,EAAEA,SAAU;AAAAsB,IAAAA,QAAA,eAErBO,eAAA,CAAA,KAAA,EAAA;MAAKxB,SAAS,EAAEsB,SAAI,CAAC,QAAQ,EAAE,aAAa,EAAE,wBAAwB,CAAE;MAAAL,QAAA,EAAA,cACtET,cAAA,CAACyB,YAAI,EAAA;QAACC,IAAI,EAAEC,qBAAU,CAACC,eAAgB;AAAAnB,QAAAA,QAAA,EAAExB;AAAK,OAAO,CACrD,EAACC,WAAW,iBAAIc,cAAA,CAACyB,YAAI,EAAA;AAAAhB,QAAAA,QAAA,EAAEvB;AAAW,OAAO,CAAC;KACvC;AACP,GAAiB,CAAC;AAEtB;;;;;"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { clsx } from 'clsx';
|
|
2
|
+
import StatusIcon from '../../statusIcon/StatusIcon.mjs';
|
|
3
|
+
import Body from '../../body/Body.mjs';
|
|
4
|
+
import Button from '../../button/Button.resolver.mjs';
|
|
5
|
+
import '../../common/theme.mjs';
|
|
6
|
+
import '../../common/direction.mjs';
|
|
7
|
+
import '../../common/propsValues/control.mjs';
|
|
8
|
+
import { Breakpoint } from '../../common/propsValues/breakpoint.mjs';
|
|
9
|
+
import '../../common/propsValues/size.mjs';
|
|
10
|
+
import { Typography } from '../../common/propsValues/typography.mjs';
|
|
11
|
+
import '../../common/propsValues/width.mjs';
|
|
12
|
+
import '../../common/propsValues/type.mjs';
|
|
13
|
+
import '../../common/propsValues/dateMode.mjs';
|
|
14
|
+
import '../../common/propsValues/monthFormat.mjs';
|
|
15
|
+
import '../../common/propsValues/position.mjs';
|
|
16
|
+
import '../../common/propsValues/layouts.mjs';
|
|
17
|
+
import '../../common/propsValues/status.mjs';
|
|
18
|
+
import '../../common/propsValues/sentiment.mjs';
|
|
19
|
+
import '../../common/propsValues/profileType.mjs';
|
|
20
|
+
import '../../common/propsValues/variant.mjs';
|
|
21
|
+
import '../../common/propsValues/scroll.mjs';
|
|
22
|
+
import '../../common/propsValues/markdownNodeType.mjs';
|
|
23
|
+
import '../../common/fileType.mjs';
|
|
24
|
+
import { GiftBox } from '@transferwise/icons';
|
|
25
|
+
import 'react';
|
|
26
|
+
import 'react-intl';
|
|
27
|
+
import '../../common/closeButton/CloseButton.messages.mjs';
|
|
28
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
29
|
+
import AvatarView from '../../avatarView/AvatarView.mjs';
|
|
30
|
+
import Image from '../../image/Image.mjs';
|
|
31
|
+
import { PrimitivePrompt } from '../PrimitivePrompt/PrimitivePrompt.mjs';
|
|
32
|
+
import { useScreenSize } from '../../common/hooks/useScreenSize.mjs';
|
|
33
|
+
|
|
34
|
+
const ActionPrompt = ({
|
|
35
|
+
sentiment = 'neutral',
|
|
36
|
+
title,
|
|
37
|
+
description,
|
|
38
|
+
onDismiss,
|
|
39
|
+
media,
|
|
40
|
+
action,
|
|
41
|
+
actionSecondary,
|
|
42
|
+
id,
|
|
43
|
+
className,
|
|
44
|
+
'data-testid': testId
|
|
45
|
+
}) => {
|
|
46
|
+
const isMobile = !useScreenSize(Breakpoint.MEDIUM);
|
|
47
|
+
const renderMedia = () => {
|
|
48
|
+
if (media?.imgSrc) {
|
|
49
|
+
return /*#__PURE__*/jsx(Image, {
|
|
50
|
+
src: media.imgSrc,
|
|
51
|
+
className: "wds-action-prompt--media-image",
|
|
52
|
+
alt: media['aria-label'] ?? ''
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (media?.avatar) {
|
|
56
|
+
const badge = media.avatar.badge ? media.avatar.badge : sentiment === 'proposition' ? {} : {
|
|
57
|
+
status: sentiment
|
|
58
|
+
};
|
|
59
|
+
return /*#__PURE__*/jsx(AvatarView, {
|
|
60
|
+
...media.avatar,
|
|
61
|
+
badge: badge,
|
|
62
|
+
size: 48,
|
|
63
|
+
children: media.avatar.asset
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
return sentiment === 'proposition' ? /*#__PURE__*/jsx(AvatarView, {
|
|
67
|
+
size: 48,
|
|
68
|
+
children: /*#__PURE__*/jsx(GiftBox, {})
|
|
69
|
+
}) : /*#__PURE__*/jsx(StatusIcon, {
|
|
70
|
+
size: 48,
|
|
71
|
+
sentiment: sentiment
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
return /*#__PURE__*/jsx(PrimitivePrompt, {
|
|
75
|
+
id: id,
|
|
76
|
+
sentiment: sentiment,
|
|
77
|
+
"data-testid": testId,
|
|
78
|
+
className: clsx('wds-action-prompt', {
|
|
79
|
+
'wds-action-prompt--with-two-actions': !!actionSecondary
|
|
80
|
+
}, className),
|
|
81
|
+
media: renderMedia(),
|
|
82
|
+
actions: /*#__PURE__*/jsxs(Fragment, {
|
|
83
|
+
children: [actionSecondary &&
|
|
84
|
+
/*#__PURE__*/
|
|
85
|
+
// @ts-expect-error onClick type mismatch
|
|
86
|
+
jsx(Button, {
|
|
87
|
+
v2: true,
|
|
88
|
+
size: "md",
|
|
89
|
+
priority: "secondary",
|
|
90
|
+
href: actionSecondary.href,
|
|
91
|
+
block: isMobile,
|
|
92
|
+
onClick: actionSecondary?.onClick,
|
|
93
|
+
children: actionSecondary.label
|
|
94
|
+
}), /*#__PURE__*/jsx(Button, {
|
|
95
|
+
v2: true,
|
|
96
|
+
size: "md",
|
|
97
|
+
priority: "primary",
|
|
98
|
+
href: action.href,
|
|
99
|
+
block: isMobile,
|
|
100
|
+
onClick: action.onClick,
|
|
101
|
+
children: action.label
|
|
102
|
+
})]
|
|
103
|
+
}),
|
|
104
|
+
onDismiss: onDismiss,
|
|
105
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
106
|
+
className: clsx('d-flex', 'flex-column', 'justify-content-center'),
|
|
107
|
+
children: [/*#__PURE__*/jsx(Body, {
|
|
108
|
+
type: Typography.BODY_LARGE_BOLD,
|
|
109
|
+
children: title
|
|
110
|
+
}), description && /*#__PURE__*/jsx(Body, {
|
|
111
|
+
children: description
|
|
112
|
+
})]
|
|
113
|
+
})
|
|
114
|
+
});
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
export { ActionPrompt, ActionPrompt as default };
|
|
118
|
+
//# sourceMappingURL=ActionPrompt.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionPrompt.mjs","sources":["../../../src/prompt/ActionPrompt/ActionPrompt.tsx"],"sourcesContent":["import { ReactNode } from 'react';\nimport { clsx } from 'clsx';\n\nimport StatusIcon from '../../statusIcon';\nimport Body from '../../body';\nimport Button from '../../button';\nimport { Breakpoint, Typography } from '../../common';\nimport AvatarView, { AvatarViewProps } from '../../avatarView';\nimport Image from '../../image';\nimport { ButtonProps } from '../../button/Button.types';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\nimport { BadgeAssetsProps } from '../../badge';\nimport { GiftBox } from '@transferwise/icons';\nimport { useScreenSize } from '../../common/hooks/useScreenSize';\n\nexport type ActionPromptProps = {\n title: ReactNode;\n description?: ReactNode;\n media?: {\n imgSrc?: string;\n avatar?: Pick<AvatarViewProps, 'imgSrc' | 'profileName' | 'profileType'> & {\n asset?: AvatarViewProps['children'];\n badge?: Pick<BadgeAssetsProps, 'flagCode'>;\n };\n 'aria-label'?: string;\n };\n action: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid' | 'sentiment' | 'onDismiss'>;\n\nexport const ActionPrompt = ({\n sentiment = 'neutral',\n title,\n description,\n onDismiss,\n media,\n action,\n actionSecondary,\n id,\n className,\n 'data-testid': testId,\n}: ActionPromptProps) => {\n const isMobile = !useScreenSize(Breakpoint.MEDIUM);\n\n const renderMedia = () => {\n if (media?.imgSrc) {\n return (\n <Image\n src={media.imgSrc}\n className=\"wds-action-prompt--media-image\"\n alt={media['aria-label'] ?? ''}\n />\n );\n }\n if (media?.avatar) {\n const badge = media.avatar.badge\n ? media.avatar.badge\n : sentiment === 'proposition'\n ? {}\n : { status: sentiment };\n return (\n <AvatarView {...media.avatar} badge={badge} size={48}>\n {media.avatar.asset}\n </AvatarView>\n );\n }\n return sentiment === 'proposition' ? (\n <AvatarView size={48}>\n <GiftBox />\n </AvatarView>\n ) : (\n <StatusIcon size={48} sentiment={sentiment} />\n );\n };\n\n return (\n <PrimitivePrompt\n id={id}\n sentiment={sentiment}\n data-testid={testId}\n className={clsx(\n 'wds-action-prompt',\n { 'wds-action-prompt--with-two-actions': !!actionSecondary },\n className,\n )}\n media={renderMedia()}\n actions={\n <>\n {actionSecondary && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"secondary\"\n href={actionSecondary.href}\n block={isMobile}\n onClick={actionSecondary?.onClick}\n >\n {actionSecondary.label}\n </Button>\n )}\n {/* @ts-expect-error onClick type mismatch */}\n <Button\n v2\n size=\"md\"\n priority=\"primary\"\n href={action.href}\n block={isMobile}\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n </>\n }\n onDismiss={onDismiss}\n >\n <div className={clsx('d-flex', 'flex-column', 'justify-content-center')}>\n <Body type={Typography.BODY_LARGE_BOLD}>{title}</Body>\n {description && <Body>{description}</Body>}\n </div>\n </PrimitivePrompt>\n );\n};\n\nexport default ActionPrompt;\n"],"names":["ActionPrompt","sentiment","title","description","onDismiss","media","action","actionSecondary","id","className","testId","isMobile","useScreenSize","Breakpoint","MEDIUM","renderMedia","imgSrc","_jsx","Image","src","alt","avatar","badge","status","AvatarView","size","children","asset","GiftBox","StatusIcon","PrimitivePrompt","clsx","actions","_jsxs","_Fragment","Button","v2","priority","href","block","onClick","label","Body","type","Typography","BODY_LARGE_BOLD"],"mappings":";;;;;;;;;;;;;;;;;;;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cACtET,GAAA,CAACyB,IAAI,EAAA;QAACC,IAAI,EAAEC,UAAU,CAACC,eAAgB;AAAAnB,QAAAA,QAAA,EAAExB;AAAK,OAAO,CACrD,EAACC,WAAW,iBAAIc,GAAA,CAACyB,IAAI,EAAA;AAAAhB,QAAAA,QAAA,EAAEvB;AAAW,OAAO,CAAC;KACvC;AACP,GAAiB,CAAC;AAEtB;;;;"}
|
|
@@ -18,26 +18,28 @@ const PrimitivePrompt = ({
|
|
|
18
18
|
...restProps
|
|
19
19
|
}) => {
|
|
20
20
|
const intl = reactIntl.useIntl();
|
|
21
|
-
return /*#__PURE__*/jsxRuntime.
|
|
21
|
+
return /*#__PURE__*/jsxRuntime.jsx(SentimentSurface.default, {
|
|
22
22
|
sentiment: sentiment,
|
|
23
23
|
className: clsx.clsx('wds-prompt', `wds-prompt--${sentiment}`, className),
|
|
24
24
|
...restProps,
|
|
25
|
-
children:
|
|
26
|
-
className:
|
|
25
|
+
children: /*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
26
|
+
className: clsx.clsx('wds-prompt__content-wrapper', {
|
|
27
|
+
'wds-prompt__content-wrapper--with-dismiss': !!onDismiss
|
|
28
|
+
}),
|
|
27
29
|
children: [/*#__PURE__*/jsxRuntime.jsx("div", {
|
|
28
30
|
className: clsx.clsx('wds-prompt__media-wrapper'),
|
|
29
31
|
children: media
|
|
30
|
-
}), children,
|
|
32
|
+
}), children, onDismiss && /*#__PURE__*/jsxRuntime.jsx(IconButton.default, {
|
|
33
|
+
size: 24,
|
|
34
|
+
priority: "secondary",
|
|
35
|
+
"aria-label": intl.formatMessage(CloseButton_messages.default.ariaLabel),
|
|
36
|
+
onClick: onDismiss,
|
|
37
|
+
children: /*#__PURE__*/jsxRuntime.jsx(icons.Cross, {})
|
|
38
|
+
}), actions && /*#__PURE__*/jsxRuntime.jsx("div", {
|
|
31
39
|
className: "wds-prompt__actions-wrapper",
|
|
32
40
|
children: actions
|
|
33
41
|
})]
|
|
34
|
-
})
|
|
35
|
-
size: 24,
|
|
36
|
-
priority: "secondary",
|
|
37
|
-
"aria-label": intl.formatMessage(CloseButton_messages.default.ariaLabel),
|
|
38
|
-
onClick: onDismiss,
|
|
39
|
-
children: /*#__PURE__*/jsxRuntime.jsx(icons.Cross, {})
|
|
40
|
-
})]
|
|
42
|
+
})
|
|
41
43
|
});
|
|
42
44
|
};
|
|
43
45
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePrompt.js","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { ReactNode } from 'react';\n\nexport type PrimitivePromptProps = {\n /**\n * The sentiment determines the colour scheme\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n children: ReactNode;\n};\n\n/**\n * PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.\n * Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */\nexport const PrimitivePrompt = ({\n sentiment = 'success',\n media,\n actions,\n onDismiss,\n className,\n children,\n ...restProps\n}: PrimitivePromptProps) => {\n const intl = useIntl();\n\n return (\n <SentimentSurface\n sentiment={sentiment}\n className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}\n {...restProps}\n >\n <div
|
|
1
|
+
{"version":3,"file":"PrimitivePrompt.js","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { ReactNode } from 'react';\n\nexport type PrimitivePromptProps = {\n /**\n * The sentiment determines the colour scheme\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n children: ReactNode;\n};\n\n/**\n * PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.\n * Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */\nexport const PrimitivePrompt = ({\n sentiment = 'success',\n media,\n actions,\n onDismiss,\n className,\n children,\n ...restProps\n}: PrimitivePromptProps) => {\n const intl = useIntl();\n\n return (\n <SentimentSurface\n sentiment={sentiment}\n className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}\n {...restProps}\n >\n <div\n className={clsx('wds-prompt__content-wrapper', {\n 'wds-prompt__content-wrapper--with-dismiss': !!onDismiss,\n })}\n >\n <div className={clsx('wds-prompt__media-wrapper')}>{media}</div>\n {children}\n {onDismiss && (\n <IconButton\n size={24}\n priority=\"secondary\"\n aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}\n onClick={onDismiss}\n >\n <Cross />\n </IconButton>\n )}\n {actions && <div className=\"wds-prompt__actions-wrapper\">{actions}</div>}\n </div>\n </SentimentSurface>\n );\n};\n"],"names":["PrimitivePrompt","sentiment","media","actions","onDismiss","className","children","restProps","intl","useIntl","_jsx","SentimentSurface","clsx","_jsxs","IconButton","size","priority","formatMessage","closeBtnMessages","ariaLabel","onClick","Cross"],"mappings":";;;;;;;;;;AAmCO,MAAMA,eAAe,GAAGA,CAAC;AAC9BC,EAAAA,SAAS,GAAG,SAAS;EACrBC,KAAK;EACLC,OAAO;EACPC,SAAS;EACTC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAS,CACS,KAAI;AACzB,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;EAEtB,oBACEC,cAAA,CAACC,wBAAgB,EAAA;AACfV,IAAAA,SAAS,EAAEA,SAAU;IACrBI,SAAS,EAAEO,SAAI,CAAC,YAAY,EAAE,eAAeX,SAAS,CAAA,CAAE,EAAEI,SAAS,CAAE;AAAA,IAAA,GACjEE,SAAS;AAAAD,IAAAA,QAAA,eAEbO,eAAA,CAAA,KAAA,EAAA;AACER,MAAAA,SAAS,EAAEO,SAAI,CAAC,6BAA6B,EAAE;QAC7C,2CAA2C,EAAE,CAAC,CAACR;AAChD,OAAA,CAAE;AAAAE,MAAAA,QAAA,gBAEHI,cAAA,CAAA,KAAA,EAAA;AAAKL,QAAAA,SAAS,EAAEO,SAAI,CAAC,2BAA2B,CAAE;AAAAN,QAAAA,QAAA,EAAEJ;OAAW,CAC/D,EAACI,QAAQ,EACRF,SAAS,iBACRM,cAAA,CAACI,kBAAU,EAAA;AACTC,QAAAA,IAAI,EAAE,EAAG;AACTC,QAAAA,QAAQ,EAAC,WAAW;AACpB,QAAA,YAAA,EAAYR,IAAI,CAACS,aAAa,CAACC,4BAAgB,CAACC,SAAS,CAAE;AAC3DC,QAAAA,OAAO,EAAEhB,SAAU;AAAAE,QAAAA,QAAA,eAEnBI,cAAA,CAACW,WAAK,EAAA,EAAA;AACR,OAAY,CACb,EACAlB,OAAO,iBAAIO,cAAA,CAAA,KAAA,EAAA;AAAKL,QAAAA,SAAS,EAAC,6BAA6B;AAAAC,QAAAA,QAAA,EAAEH;AAAO,OAAM,CAAC;KACrE;AACP,GAAkB,CAAC;AAEvB;;;;"}
|
|
@@ -4,7 +4,7 @@ import SentimentSurface from '../../sentimentSurface/SentimentSurface.mjs';
|
|
|
4
4
|
import IconButton from '../../iconButton/IconButton.mjs';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
6
|
import closeBtnMessages from '../../common/closeButton/CloseButton.messages.mjs';
|
|
7
|
-
import {
|
|
7
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
8
8
|
|
|
9
9
|
const PrimitivePrompt = ({
|
|
10
10
|
sentiment = 'success',
|
|
@@ -16,26 +16,28 @@ const PrimitivePrompt = ({
|
|
|
16
16
|
...restProps
|
|
17
17
|
}) => {
|
|
18
18
|
const intl = useIntl();
|
|
19
|
-
return /*#__PURE__*/
|
|
19
|
+
return /*#__PURE__*/jsx(SentimentSurface, {
|
|
20
20
|
sentiment: sentiment,
|
|
21
21
|
className: clsx('wds-prompt', `wds-prompt--${sentiment}`, className),
|
|
22
22
|
...restProps,
|
|
23
|
-
children:
|
|
24
|
-
className:
|
|
23
|
+
children: /*#__PURE__*/jsxs("div", {
|
|
24
|
+
className: clsx('wds-prompt__content-wrapper', {
|
|
25
|
+
'wds-prompt__content-wrapper--with-dismiss': !!onDismiss
|
|
26
|
+
}),
|
|
25
27
|
children: [/*#__PURE__*/jsx("div", {
|
|
26
28
|
className: clsx('wds-prompt__media-wrapper'),
|
|
27
29
|
children: media
|
|
28
|
-
}), children,
|
|
30
|
+
}), children, onDismiss && /*#__PURE__*/jsx(IconButton, {
|
|
31
|
+
size: 24,
|
|
32
|
+
priority: "secondary",
|
|
33
|
+
"aria-label": intl.formatMessage(closeBtnMessages.ariaLabel),
|
|
34
|
+
onClick: onDismiss,
|
|
35
|
+
children: /*#__PURE__*/jsx(Cross, {})
|
|
36
|
+
}), actions && /*#__PURE__*/jsx("div", {
|
|
29
37
|
className: "wds-prompt__actions-wrapper",
|
|
30
38
|
children: actions
|
|
31
39
|
})]
|
|
32
|
-
})
|
|
33
|
-
size: 24,
|
|
34
|
-
priority: "secondary",
|
|
35
|
-
"aria-label": intl.formatMessage(closeBtnMessages.ariaLabel),
|
|
36
|
-
onClick: onDismiss,
|
|
37
|
-
children: /*#__PURE__*/jsx(Cross, {})
|
|
38
|
-
})]
|
|
40
|
+
})
|
|
39
41
|
});
|
|
40
42
|
};
|
|
41
43
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PrimitivePrompt.mjs","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { ReactNode } from 'react';\n\nexport type PrimitivePromptProps = {\n /**\n * The sentiment determines the colour scheme\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n children: ReactNode;\n};\n\n/**\n * PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.\n * Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */\nexport const PrimitivePrompt = ({\n sentiment = 'success',\n media,\n actions,\n onDismiss,\n className,\n children,\n ...restProps\n}: PrimitivePromptProps) => {\n const intl = useIntl();\n\n return (\n <SentimentSurface\n sentiment={sentiment}\n className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}\n {...restProps}\n >\n <div
|
|
1
|
+
{"version":3,"file":"PrimitivePrompt.mjs","sources":["../../../src/prompt/PrimitivePrompt/PrimitivePrompt.tsx"],"sourcesContent":["import { Cross } from '@transferwise/icons';\nimport { clsx } from 'clsx';\nimport SentimentSurface, { Sentiment } from '../../sentimentSurface';\nimport IconButton from '../../iconButton';\nimport { useIntl } from 'react-intl';\nimport closeBtnMessages from '../../common/closeButton/CloseButton.messages';\nimport { ReactNode } from 'react';\n\nexport type PrimitivePromptProps = {\n /**\n * The sentiment determines the colour scheme\n * @default success\n */\n sentiment?: Sentiment;\n /**\n * Media to be displayed on the prompt (icon/image/etc).\n */\n media: ReactNode;\n /**\n * Any actions to be displayed on the prompt.\n */\n actions?: ReactNode;\n /**\n * Handler called when the close button is clicked. If not provided, then the close button is hidden.\n */\n onDismiss?: () => void;\n id?: string;\n className?: string;\n 'data-testid'?: string;\n children: ReactNode;\n};\n\n/**\n * PrimitivePrompt is a low-level component that provides the structure, sentiment support and styling for various prompts.\n * Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */\nexport const PrimitivePrompt = ({\n sentiment = 'success',\n media,\n actions,\n onDismiss,\n className,\n children,\n ...restProps\n}: PrimitivePromptProps) => {\n const intl = useIntl();\n\n return (\n <SentimentSurface\n sentiment={sentiment}\n className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}\n {...restProps}\n >\n <div\n className={clsx('wds-prompt__content-wrapper', {\n 'wds-prompt__content-wrapper--with-dismiss': !!onDismiss,\n })}\n >\n <div className={clsx('wds-prompt__media-wrapper')}>{media}</div>\n {children}\n {onDismiss && (\n <IconButton\n size={24}\n priority=\"secondary\"\n aria-label={intl.formatMessage(closeBtnMessages.ariaLabel)}\n onClick={onDismiss}\n >\n <Cross />\n </IconButton>\n )}\n {actions && <div className=\"wds-prompt__actions-wrapper\">{actions}</div>}\n </div>\n </SentimentSurface>\n );\n};\n"],"names":["PrimitivePrompt","sentiment","media","actions","onDismiss","className","children","restProps","intl","useIntl","_jsx","SentimentSurface","clsx","_jsxs","IconButton","size","priority","formatMessage","closeBtnMessages","ariaLabel","onClick","Cross"],"mappings":";;;;;;;;AAmCO,MAAMA,eAAe,GAAGA,CAAC;AAC9BC,EAAAA,SAAS,GAAG,SAAS;EACrBC,KAAK;EACLC,OAAO;EACPC,SAAS;EACTC,SAAS;EACTC,QAAQ;EACR,GAAGC;AAAS,CACS,KAAI;AACzB,EAAA,MAAMC,IAAI,GAAGC,OAA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