@transferwise/components 46.124.1 → 46.126.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/avatarView/AvatarView.js.map +1 -1
- package/build/avatarView/AvatarView.mjs.map +1 -1
- package/build/common/locale/index.js +13 -0
- package/build/common/locale/index.js.map +1 -1
- package/build/common/locale/index.mjs +13 -1
- package/build/common/locale/index.mjs.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +31 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +32 -2
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
- package/build/field/Field.js +11 -0
- package/build/field/Field.js.map +1 -1
- package/build/field/Field.mjs +11 -0
- package/build/field/Field.mjs.map +1 -1
- package/build/index.js +5 -0
- package/build/index.js.map +1 -1
- package/build/index.mjs +3 -1
- package/build/index.mjs.map +1 -1
- package/build/inputs/Input.js.map +1 -1
- package/build/inputs/Input.mjs.map +1 -1
- package/build/inputs/SearchInput.js.map +1 -1
- package/build/inputs/SearchInput.mjs.map +1 -1
- package/build/inputs/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput.mjs.map +1 -1
- package/build/inputs/TextArea.js.map +1 -1
- package/build/inputs/TextArea.mjs.map +1 -1
- package/build/listItem/ListItem.js +2 -2
- package/build/listItem/ListItem.js.map +1 -1
- package/build/listItem/ListItem.mjs +2 -2
- package/build/listItem/ListItem.mjs.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js +11 -0
- package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs +11 -0
- package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
- package/build/main.css +63 -2
- package/build/moneyInput/MoneyInput.js +6 -1
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +6 -1
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.js +146 -0
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -0
- package/build/prompt/ActionPrompt/ActionPrompt.mjs +141 -0
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -0
- package/build/prompt/InfoPrompt/InfoPrompt.js +113 -0
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -0
- package/build/prompt/InfoPrompt/InfoPrompt.mjs +111 -0
- package/build/prompt/InfoPrompt/InfoPrompt.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/radioOption/RadioOption.js.map +1 -1
- package/build/radioOption/RadioOption.mjs.map +1 -1
- package/build/slidingPanel/SlidingPanel.js.map +1 -1
- package/build/slidingPanel/SlidingPanel.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js +2 -0
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +2 -0
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/styles/main.css +63 -2
- package/build/styles/prompt/ActionPrompt/ActionPrompt.css +21 -0
- package/build/styles/prompt/InfoPrompt/InfoPrompt.css +31 -0
- package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +11 -2
- package/build/table/TableCell.js.map +1 -1
- package/build/table/TableCell.mjs.map +1 -1
- 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 +11 -0
- package/build/typeahead/Typeahead.js.map +1 -1
- package/build/typeahead/Typeahead.mjs +11 -0
- package/build/typeahead/Typeahead.mjs.map +1 -1
- package/build/types/avatarView/AvatarView.d.ts +1 -1
- package/build/types/avatarView/AvatarView.d.ts.map +1 -1
- package/build/types/common/locale/index.d.ts +8 -0
- package/build/types/common/locale/index.d.ts.map +1 -1
- package/build/types/expressiveMoneyInput/currencySelector/CurrencySelector.d.ts.map +1 -1
- package/build/types/index.d.ts +4 -3
- package/build/types/index.d.ts.map +1 -1
- package/build/types/inputs/Input.d.ts.map +1 -1
- package/build/types/inputs/SearchInput.d.ts.map +1 -1
- package/build/types/inputs/SelectInput.d.ts +1 -1
- package/build/types/inputs/SelectInput.d.ts.map +1 -1
- package/build/types/inputs/TextArea.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveAnchor/PrimitiveAnchor.types.d.ts.map +1 -1
- package/build/types/primitives/PrimitiveButton/PrimitiveButton.types.d.ts.map +1 -1
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +28 -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/InfoPrompt/InfoPrompt.d.ts +56 -0
- package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -0
- package/build/types/prompt/InfoPrompt/index.d.ts +3 -0
- package/build/types/prompt/InfoPrompt/index.d.ts.map +1 -0
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +5 -5
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
- package/build/types/prompt/index.d.ts +4 -0
- package/build/types/prompt/index.d.ts.map +1 -1
- package/build/types/radioOption/RadioOption.d.ts.map +1 -1
- package/build/types/slidingPanel/SlidingPanel.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts +2 -1
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/build/types/table/TableCell.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/build/types/withDisplayFormat/WithDisplayFormat.d.ts.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +2 -3
- package/src/actionButton/ActionButton.story.tsx +2 -9
- package/src/avatar/Avatar.story.tsx +2 -8
- package/src/avatarLayout/AvatarLayout.story.tsx +3 -3
- package/src/avatarView/AvatarView.story.tsx +29 -24
- package/src/avatarView/AvatarView.tsx +1 -1
- 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/bottomSheet/BottomSheet.test.story.tsx +98 -0
- package/src/common/circle/Circle.story.tsx +3 -14
- package/src/common/locale/{index.spec.ts → index.test.ts} +36 -1
- package/src/common/locale/index.ts +13 -0
- 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/expressiveMoneyInput/currencySelector/CurrencySelector.tsx +5 -1
- package/src/header/{Header.tests.story.tsx → Header.test.story.tsx} +5 -10
- package/src/index.ts +4 -2
- package/src/info/Info.story.tsx +4 -20
- package/src/inputs/Input.tsx +8 -9
- package/src/inputs/SearchInput.tsx +8 -9
- package/src/inputs/SelectInput.test.story.tsx +86 -0
- package/src/inputs/SelectInput.tsx +1 -1
- package/src/inputs/TextArea.tsx +6 -7
- package/src/listItem/ListItem.tsx +2 -2
- 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 +63 -2
- package/src/main.less +3 -1
- package/src/modal/Modal.story.tsx +6 -31
- package/src/moneyInput/MoneyInput.test.story.tsx +104 -0
- package/src/moneyInput/MoneyInput.tsx +20 -2
- package/src/primitives/PrimitiveAnchor/PrimitiveAnchor.types.ts +1 -3
- package/src/primitives/PrimitiveButton/PrimitiveButton.types.ts +1 -3
- package/src/prompt/ActionPrompt/ActionPrompt.accessibility.docs.mdx +65 -0
- package/src/prompt/ActionPrompt/ActionPrompt.css +21 -0
- package/src/prompt/ActionPrompt/ActionPrompt.less +23 -0
- package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +187 -0
- package/src/prompt/ActionPrompt/ActionPrompt.test.story.tsx +147 -0
- package/src/prompt/ActionPrompt/ActionPrompt.test.tsx +251 -0
- package/src/prompt/ActionPrompt/ActionPrompt.tsx +170 -0
- package/src/prompt/ActionPrompt/index.ts +2 -0
- package/src/prompt/InfoPrompt/InfoPrompt.css +31 -0
- package/src/prompt/InfoPrompt/InfoPrompt.less +37 -0
- package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +312 -0
- package/src/prompt/InfoPrompt/InfoPrompt.test.story.tsx +246 -0
- package/src/prompt/InfoPrompt/InfoPrompt.test.tsx +224 -0
- package/src/prompt/InfoPrompt/InfoPrompt.tsx +148 -0
- package/src/prompt/InfoPrompt/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 +13 -3
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.test.tsx +161 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +20 -16
- package/src/prompt/index.ts +8 -0
- package/src/radioOption/RadioOption.tsx +2 -1
- package/src/slidingPanel/SlidingPanel.tsx +4 -2
- package/src/snackbar/{Snackbar.tests.story.tsx → Snackbar.test.story.tsx} +6 -32
- package/src/{ssr.spec.tsx → ssr.test.tsx} +3 -0
- package/src/statusIcon/StatusIcon.story.tsx +5 -9
- package/src/statusIcon/StatusIcon.tsx +8 -1
- package/src/table/TableCell.tsx +1 -3
- 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/withDisplayFormat/WithDisplayFormat.tsx +13 -14
- 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/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/inputs/{SelectInput.spec.tsx → SelectInput.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/{MoneyInput.spec.tsx → MoneyInput.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
|
@@ -11,9 +11,7 @@ export type PrimitiveButtonElementRef = React.Ref<HTMLButtonElement>;
|
|
|
11
11
|
* Properties for the Button component.
|
|
12
12
|
*/
|
|
13
13
|
export interface PrimitiveButtonProps
|
|
14
|
-
extends BasePrimitiveProps,
|
|
15
|
-
StyleProp,
|
|
16
|
-
PrimitiveButtonAttributes {
|
|
14
|
+
extends BasePrimitiveProps, StyleProp, PrimitiveButtonAttributes {
|
|
17
15
|
/** Content of the button */
|
|
18
16
|
children?: ReactNode;
|
|
19
17
|
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Meta, Canvas, Source } from '@storybook/addon-docs/blocks';
|
|
2
|
+
|
|
3
|
+
<Meta title="Prompts/ActionPrompt/Accessibility" />
|
|
4
|
+
|
|
5
|
+
# Accessibility
|
|
6
|
+
|
|
7
|
+
Under the hood, `ActionPrompt` is marked as `role="region"` for a section of content that users might want to navigate to directly.
|
|
8
|
+
|
|
9
|
+
By default, it's labelled by the `media` asset and `title`, as well as described by the `description` if one is provided.
|
|
10
|
+
|
|
11
|
+
## Announcement Behaviour
|
|
12
|
+
|
|
13
|
+
`ActionPrompt` should be treated as a hint or suggestion as part of the product UX. Even the negative variant still serves as a non-critical message. Therefore, it shouldn't be announced via screen reader—neither assertively (`role="alert"`) nor politely (`role="status"`).
|
|
14
|
+
|
|
15
|
+
**Note:** For immediate user feedback, use [InfoPrompt](?path=/docs/prompts-infoprompt--docs) or [InlinePrompt](https://storybook.wise.design/?path=/docs/prompts-inlineprompt--docs) instead.
|
|
16
|
+
|
|
17
|
+
If you want to provide a custom label for screen readers, you can use the `aria-label` prop. Make sure to include all necessary information in it, because when provided, the default labelling will be removed.
|
|
18
|
+
|
|
19
|
+
<Source
|
|
20
|
+
dark
|
|
21
|
+
code={`
|
|
22
|
+
<ActionPrompt
|
|
23
|
+
aria-label="JFYI: Henry requested 30 USD for lunch"
|
|
24
|
+
media={{ avatar: { imgSrc: 'profile-photo.webp' } }}
|
|
25
|
+
title="Henry requested 30 USD"
|
|
26
|
+
description="Lunch date"
|
|
27
|
+
...
|
|
28
|
+
/>
|
|
29
|
+
`}
|
|
30
|
+
/>
|
|
31
|
+
|
|
32
|
+
## Media
|
|
33
|
+
|
|
34
|
+
You can use the `aria-hidden` attribute on media assets to hide them from screen readers if they're not providing any additional information. This is useful when the media is purely decorative or when its content is already conveyed through other means (e.g., text).
|
|
35
|
+
|
|
36
|
+
<Source
|
|
37
|
+
dark
|
|
38
|
+
code={`
|
|
39
|
+
<ActionPrompt
|
|
40
|
+
media={{
|
|
41
|
+
'aria-hidden': true,
|
|
42
|
+
avatar: { asset: <People /> },
|
|
43
|
+
}}
|
|
44
|
+
title="Sync contacts for a faster experience"
|
|
45
|
+
...
|
|
46
|
+
/>
|
|
47
|
+
`}
|
|
48
|
+
/>
|
|
49
|
+
|
|
50
|
+
You can also use `aria-label` on media assets to provide a custom label for screen readers.
|
|
51
|
+
|
|
52
|
+
<Source
|
|
53
|
+
dark
|
|
54
|
+
code={`
|
|
55
|
+
<ActionPrompt
|
|
56
|
+
media={{
|
|
57
|
+
'aria-label': 'Henry Adams photo',
|
|
58
|
+
avatar: { imgSrc: 'profile-photo.webp' },
|
|
59
|
+
}}
|
|
60
|
+
title="Henry requested 30 USD"
|
|
61
|
+
description="Lunch date"
|
|
62
|
+
...
|
|
63
|
+
/>
|
|
64
|
+
`}
|
|
65
|
+
/>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
.wds-action-prompt {
|
|
2
|
+
--Prompt-padding: var(--size-16);
|
|
3
|
+
--Prompt-actions-gap: var(--size-8);
|
|
4
|
+
--Prompt-gap: var(--size-10) var(--size-16);
|
|
5
|
+
--Prompt-border-radius: var(--radius-large);
|
|
6
|
+
}
|
|
7
|
+
.wds-action-prompt--media-image {
|
|
8
|
+
width: 48px;
|
|
9
|
+
width: var(--size-48);
|
|
10
|
+
height: 48px;
|
|
11
|
+
height: var(--size-48);
|
|
12
|
+
-o-object-fit: contain;
|
|
13
|
+
object-fit: contain;
|
|
14
|
+
}
|
|
15
|
+
@media (max-width: 767px) {
|
|
16
|
+
.wds-action-prompt--with-two-actions .wds-prompt__actions-wrapper .wds-Button {
|
|
17
|
+
flex: 1 1 calc(50% - (var(--Prompt-actions-gap) / 2));
|
|
18
|
+
min-width: -moz-fit-content;
|
|
19
|
+
min-width: fit-content;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
.wds-action-prompt {
|
|
2
|
+
--Prompt-padding: var(--size-16);
|
|
3
|
+
--Prompt-actions-gap: var(--size-8);
|
|
4
|
+
--Prompt-gap: var(--size-10) var(--size-16);
|
|
5
|
+
--Prompt-border-radius: var(--radius-large);
|
|
6
|
+
|
|
7
|
+
&--media-image {
|
|
8
|
+
width: var(--size-48);
|
|
9
|
+
height: var(--size-48);
|
|
10
|
+
object-fit: contain;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
&--with-two-actions {
|
|
14
|
+
@media (--screen-sm-max) {
|
|
15
|
+
.wds-prompt__actions-wrapper {
|
|
16
|
+
.wds-Button {
|
|
17
|
+
flex: 1 1 calc(50% - (var(--Prompt-actions-gap) / 2));
|
|
18
|
+
min-width: fit-content;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { ReactElement, useState } from 'react';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
|
+
import { fn } from 'storybook/test';
|
|
4
|
+
import { Bank, Freeze, People } from '@transferwise/icons';
|
|
5
|
+
import { ActionPrompt } from './ActionPrompt';
|
|
6
|
+
import { lorem10 } from '../../test-utils';
|
|
7
|
+
import Body from '../../body';
|
|
8
|
+
import { action } from 'storybook/actions';
|
|
9
|
+
import Title from '../../title';
|
|
10
|
+
import { withVariantConfig } from '../../../.storybook/helpers';
|
|
11
|
+
|
|
12
|
+
const meta: Meta<typeof ActionPrompt> = {
|
|
13
|
+
title: 'Prompts/ActionPrompt',
|
|
14
|
+
component: ActionPrompt,
|
|
15
|
+
tags: ['new'],
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof ActionPrompt>;
|
|
20
|
+
|
|
21
|
+
const withComponentGrid =
|
|
22
|
+
({ maxWidth = 'auto', gap = '1rem' } = {}) =>
|
|
23
|
+
(Story: () => ReactElement) => (
|
|
24
|
+
<div
|
|
25
|
+
style={{
|
|
26
|
+
width: '100%',
|
|
27
|
+
display: 'flex',
|
|
28
|
+
flexDirection: 'column',
|
|
29
|
+
justifyContent: 'flex-start',
|
|
30
|
+
alignItems: 'flex-start',
|
|
31
|
+
alignContent: 'flex-start',
|
|
32
|
+
gap,
|
|
33
|
+
maxWidth,
|
|
34
|
+
}}
|
|
35
|
+
>
|
|
36
|
+
<Story />
|
|
37
|
+
</div>
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
export const AllSentiments: Story = {
|
|
41
|
+
render: () => {
|
|
42
|
+
return (
|
|
43
|
+
<>
|
|
44
|
+
{(['negative', 'warning', 'neutral', 'success', 'proposition'] as const).map(
|
|
45
|
+
(sentiment) => (
|
|
46
|
+
<ActionPrompt
|
|
47
|
+
key={sentiment}
|
|
48
|
+
sentiment={sentiment}
|
|
49
|
+
title="Title"
|
|
50
|
+
description={lorem10}
|
|
51
|
+
action={{ label: 'Primary', onClick: fn() }}
|
|
52
|
+
actionSecondary={{ label: 'Secondary', onClick: fn() }}
|
|
53
|
+
className="m-b-2"
|
|
54
|
+
onDismiss={fn()}
|
|
55
|
+
/>
|
|
56
|
+
),
|
|
57
|
+
)}
|
|
58
|
+
</>
|
|
59
|
+
);
|
|
60
|
+
},
|
|
61
|
+
decorators: [withComponentGrid()],
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const Mobile: Story = {
|
|
65
|
+
...AllSentiments,
|
|
66
|
+
...withVariantConfig(['mobile'], AllSentiments),
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const PrimaryActionOnly: Story = {
|
|
70
|
+
args: {
|
|
71
|
+
sentiment: 'proposition',
|
|
72
|
+
title: 'Payment successful',
|
|
73
|
+
description: 'Your money is on its way',
|
|
74
|
+
action: { label: 'View details', onClick: fn() },
|
|
75
|
+
onDismiss: fn(),
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
export const WithoutDescription: Story = {
|
|
80
|
+
render: () => {
|
|
81
|
+
return (
|
|
82
|
+
<>
|
|
83
|
+
<ActionPrompt
|
|
84
|
+
sentiment="warning"
|
|
85
|
+
title="Session expiring soon"
|
|
86
|
+
action={{ label: 'Stay logged in', onClick: fn() }}
|
|
87
|
+
actionSecondary={{ label: 'Log out', onClick: fn() }}
|
|
88
|
+
onDismiss={fn()}
|
|
89
|
+
/>
|
|
90
|
+
<ActionPrompt
|
|
91
|
+
sentiment="success"
|
|
92
|
+
title="Session expiring soon"
|
|
93
|
+
action={{ label: 'Stay logged in', onClick: fn() }}
|
|
94
|
+
/>
|
|
95
|
+
<ActionPrompt
|
|
96
|
+
title="Session expiring soon"
|
|
97
|
+
action={{ label: 'Stay logged in', onClick: fn() }}
|
|
98
|
+
/>
|
|
99
|
+
</>
|
|
100
|
+
);
|
|
101
|
+
},
|
|
102
|
+
decorators: [withComponentGrid()],
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
export const Media: Story = {
|
|
106
|
+
render: () => {
|
|
107
|
+
return (
|
|
108
|
+
<>
|
|
109
|
+
<ActionPrompt
|
|
110
|
+
sentiment="neutral"
|
|
111
|
+
title="Custom image"
|
|
112
|
+
description={lorem10}
|
|
113
|
+
media={{ imgSrc: '../../wise-card.svg' }}
|
|
114
|
+
action={{ label: 'Invite now', onClick: fn() }}
|
|
115
|
+
/>
|
|
116
|
+
<ActionPrompt
|
|
117
|
+
sentiment="neutral"
|
|
118
|
+
title="Profile Image"
|
|
119
|
+
description={lorem10}
|
|
120
|
+
media={{ avatar: { imgSrc: '../../avatar-rectangle-fox.webp' } }}
|
|
121
|
+
action={{ label: 'Invite now', onClick: fn() }}
|
|
122
|
+
/>
|
|
123
|
+
<ActionPrompt
|
|
124
|
+
sentiment="proposition"
|
|
125
|
+
title="Business Profile"
|
|
126
|
+
description={lorem10}
|
|
127
|
+
media={{ avatar: { profileType: 'BUSINESS', badge: { flagCode: 'GB' } } }}
|
|
128
|
+
action={{ label: 'Invite now', onClick: fn() }}
|
|
129
|
+
/>
|
|
130
|
+
<ActionPrompt
|
|
131
|
+
sentiment="negative"
|
|
132
|
+
title="Personal Profile"
|
|
133
|
+
description={lorem10}
|
|
134
|
+
media={{ avatar: { profileType: 'PERSONAL', badge: { flagCode: 'EU' } } }}
|
|
135
|
+
action={{ label: 'Invite now', onClick: fn() }}
|
|
136
|
+
/>
|
|
137
|
+
<ActionPrompt
|
|
138
|
+
sentiment="warning"
|
|
139
|
+
title="Custom Icon"
|
|
140
|
+
description={lorem10}
|
|
141
|
+
media={{ avatar: { asset: <Bank /> } }}
|
|
142
|
+
action={{ label: 'Invite now', onClick: fn() }}
|
|
143
|
+
/>
|
|
144
|
+
<ActionPrompt
|
|
145
|
+
sentiment="success"
|
|
146
|
+
title="Initials"
|
|
147
|
+
description={lorem10}
|
|
148
|
+
media={{ avatar: { profileName: 'John Doe' } }}
|
|
149
|
+
action={{ label: 'Invite now', onClick: fn() }}
|
|
150
|
+
actionSecondary={{ label: 'Maybe later', onClick: fn() }}
|
|
151
|
+
/>
|
|
152
|
+
</>
|
|
153
|
+
);
|
|
154
|
+
},
|
|
155
|
+
decorators: [withComponentGrid()],
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
export const OnDismiss: Story = {
|
|
159
|
+
render: () => {
|
|
160
|
+
const [showNeutralPrompt, setShowNeutralPrompt] = useState(true);
|
|
161
|
+
const [showSuccessPrompt, setShowSuccessPrompt] = useState(true);
|
|
162
|
+
|
|
163
|
+
return (
|
|
164
|
+
<>
|
|
165
|
+
{showNeutralPrompt && (
|
|
166
|
+
<ActionPrompt
|
|
167
|
+
sentiment="proposition"
|
|
168
|
+
title="Payment successful"
|
|
169
|
+
description="Your money is on its way"
|
|
170
|
+
action={{ label: 'View details', onClick: fn() }}
|
|
171
|
+
className="m-b-2"
|
|
172
|
+
onDismiss={() => setShowNeutralPrompt(false)}
|
|
173
|
+
/>
|
|
174
|
+
)}
|
|
175
|
+
{showSuccessPrompt && (
|
|
176
|
+
<ActionPrompt
|
|
177
|
+
sentiment="success"
|
|
178
|
+
title="Payment successful"
|
|
179
|
+
description="Your money is on its way"
|
|
180
|
+
action={{ label: 'View details', onClick: fn() }}
|
|
181
|
+
onDismiss={() => setShowSuccessPrompt(false)}
|
|
182
|
+
/>
|
|
183
|
+
)}
|
|
184
|
+
</>
|
|
185
|
+
);
|
|
186
|
+
},
|
|
187
|
+
};
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
import { Freeze, People } from '@transferwise/icons';
|
|
2
|
+
import { action } from 'storybook/actions';
|
|
3
|
+
import ActionPrompt from './ActionPrompt';
|
|
4
|
+
import { Body, Title } from '../..';
|
|
5
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Prompts/ActionPrompt/Tests',
|
|
9
|
+
component: ActionPrompt,
|
|
10
|
+
tags: ['!manifest', '!autodocs'],
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj<typeof ActionPrompt>;
|
|
14
|
+
|
|
15
|
+
export const VariousA11yFeatures: Story = {
|
|
16
|
+
name: 'Various a11y features',
|
|
17
|
+
render: () => {
|
|
18
|
+
return (
|
|
19
|
+
<Body>
|
|
20
|
+
<Title type="title-body">Neutral Prompt with Avatar Image and Custom label for media</Title>
|
|
21
|
+
<ActionPrompt
|
|
22
|
+
className="m-b-2"
|
|
23
|
+
sentiment="neutral"
|
|
24
|
+
media={{
|
|
25
|
+
'aria-label': 'Henry Profile Photo',
|
|
26
|
+
avatar: { imgSrc: '../../avatar-square-dude.webp' },
|
|
27
|
+
}}
|
|
28
|
+
title="Henry requested 30 USD"
|
|
29
|
+
description="Lunch date"
|
|
30
|
+
action={{
|
|
31
|
+
label: 'Sent',
|
|
32
|
+
onClick: () => {
|
|
33
|
+
action('send');
|
|
34
|
+
},
|
|
35
|
+
}}
|
|
36
|
+
actionSecondary={{
|
|
37
|
+
label: 'Decline',
|
|
38
|
+
onClick: () => {
|
|
39
|
+
action('decline');
|
|
40
|
+
},
|
|
41
|
+
}}
|
|
42
|
+
onDismiss={() => action('dismiss')}
|
|
43
|
+
/>
|
|
44
|
+
|
|
45
|
+
<Title type="title-body">Warning Prompt</Title>
|
|
46
|
+
<ActionPrompt
|
|
47
|
+
className="m-b-2"
|
|
48
|
+
sentiment="warning"
|
|
49
|
+
media={{
|
|
50
|
+
'aria-label': 'Image of beautiful Business Wise Card',
|
|
51
|
+
imgSrc: '../../wise-card.svg',
|
|
52
|
+
}}
|
|
53
|
+
title="Your Wise Card expires soon"
|
|
54
|
+
description="Renew your card to keep spending"
|
|
55
|
+
action={{
|
|
56
|
+
label: 'Renew card',
|
|
57
|
+
onClick: () => {
|
|
58
|
+
action('renew');
|
|
59
|
+
},
|
|
60
|
+
}}
|
|
61
|
+
actionSecondary={{
|
|
62
|
+
label: 'Notify later',
|
|
63
|
+
onClick: () => {
|
|
64
|
+
action('notifyLater');
|
|
65
|
+
},
|
|
66
|
+
}}
|
|
67
|
+
onDismiss={() => action('dismiss')}
|
|
68
|
+
/>
|
|
69
|
+
|
|
70
|
+
<Title type="title-body">Warning Prompt Avatar Icon</Title>
|
|
71
|
+
<ActionPrompt
|
|
72
|
+
className="m-b-2"
|
|
73
|
+
sentiment="warning"
|
|
74
|
+
media={{ avatar: { asset: <Freeze /> } }}
|
|
75
|
+
title="Your Wise Card expires soon"
|
|
76
|
+
description="Renew your card to keep spending"
|
|
77
|
+
action={{
|
|
78
|
+
label: 'Renew card',
|
|
79
|
+
onClick: () => {
|
|
80
|
+
action('renew');
|
|
81
|
+
},
|
|
82
|
+
}}
|
|
83
|
+
onDismiss={() => {
|
|
84
|
+
action('dismiss');
|
|
85
|
+
}}
|
|
86
|
+
/>
|
|
87
|
+
|
|
88
|
+
<Title type="title-body">Proposition Prompt Avatar Icon</Title>
|
|
89
|
+
<ActionPrompt
|
|
90
|
+
className="m-b-2"
|
|
91
|
+
sentiment="proposition"
|
|
92
|
+
media={{ avatar: { asset: <People /> } }}
|
|
93
|
+
title="Sync contacts for a faster experience"
|
|
94
|
+
description="Find contacts on Wise — it’s simple, secure and you pick who you add."
|
|
95
|
+
action={{
|
|
96
|
+
label: 'Sync contacts',
|
|
97
|
+
onClick: () => {
|
|
98
|
+
action('sync');
|
|
99
|
+
},
|
|
100
|
+
}}
|
|
101
|
+
onDismiss={() => {
|
|
102
|
+
action('dismiss');
|
|
103
|
+
}}
|
|
104
|
+
/>
|
|
105
|
+
|
|
106
|
+
<Title type="title-body">Negative Prompt Avatar Icon + muted media</Title>
|
|
107
|
+
<ActionPrompt
|
|
108
|
+
className="m-b-2"
|
|
109
|
+
sentiment="negative"
|
|
110
|
+
media={{ avatar: { asset: <People /> }, 'aria-hidden': true }}
|
|
111
|
+
title="Sync contacts for a faster experience"
|
|
112
|
+
description="Find contacts on Wise — it’s simple, secure and you pick who you add."
|
|
113
|
+
action={{
|
|
114
|
+
label: 'Sync contacts',
|
|
115
|
+
onClick: () => {
|
|
116
|
+
action('sync');
|
|
117
|
+
},
|
|
118
|
+
}}
|
|
119
|
+
onDismiss={() => {
|
|
120
|
+
action('dismiss');
|
|
121
|
+
}}
|
|
122
|
+
/>
|
|
123
|
+
|
|
124
|
+
<Title type="title-body">
|
|
125
|
+
Negative Prompt + override content with custom message via aria-label
|
|
126
|
+
</Title>
|
|
127
|
+
<ActionPrompt
|
|
128
|
+
className="m-b-2"
|
|
129
|
+
aria-label="hey customer, here is custom message"
|
|
130
|
+
sentiment="negative"
|
|
131
|
+
media={{ avatar: { asset: <People /> } }}
|
|
132
|
+
title="Sync contacts for a faster experience"
|
|
133
|
+
description="Find contacts on Wise — it’s simple, secure and you pick who you add."
|
|
134
|
+
action={{
|
|
135
|
+
label: 'Sync contacts',
|
|
136
|
+
onClick: () => {
|
|
137
|
+
action('sync');
|
|
138
|
+
},
|
|
139
|
+
}}
|
|
140
|
+
onDismiss={() => {
|
|
141
|
+
action('dismiss');
|
|
142
|
+
}}
|
|
143
|
+
/>
|
|
144
|
+
</Body>
|
|
145
|
+
);
|
|
146
|
+
},
|
|
147
|
+
};
|