@transferwise/components 0.0.0-experimental-c7da7db → 0.0.0-experimental-24a0a12
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/accordion/AccordionItem/AccordionItem.js +0 -1
- package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
- package/build/accordion/AccordionItem/AccordionItem.mjs +0 -1
- package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
- package/build/actionButton/ActionButton.js +0 -1
- package/build/actionButton/ActionButton.js.map +1 -1
- package/build/actionButton/ActionButton.mjs +0 -1
- package/build/actionButton/ActionButton.mjs.map +1 -1
- package/build/actionOption/ActionOption.js +0 -1
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs +0 -1
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/alert/Alert.js +0 -1
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +0 -1
- package/build/alert/Alert.mjs.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.js +0 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs +0 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
- package/build/avatar/Avatar.js +0 -1
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs +0 -1
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatarView/AvatarView.js +0 -1
- package/build/avatarView/AvatarView.js.map +1 -1
- package/build/avatarView/AvatarView.mjs +0 -1
- package/build/avatarView/AvatarView.mjs.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.js +0 -1
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs +0 -1
- package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
- package/build/badge/Badge.js +0 -1
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs +0 -1
- package/build/badge/Badge.mjs.map +1 -1
- package/build/button/Button.js +0 -1
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +0 -1
- package/build/button/Button.mjs.map +1 -1
- package/build/button/LegacyButton.js +0 -1
- package/build/button/LegacyButton.js.map +1 -1
- package/build/button/LegacyButton.mjs +0 -1
- package/build/button/LegacyButton.mjs.map +1 -1
- package/build/button/classMap.js +0 -1
- package/build/button/classMap.js.map +1 -1
- package/build/button/classMap.mjs +0 -1
- package/build/button/classMap.mjs.map +1 -1
- package/build/button/legacyUtils/legacyUtils.js +0 -1
- package/build/button/legacyUtils/legacyUtils.js.map +1 -1
- package/build/button/legacyUtils/legacyUtils.mjs +0 -1
- package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
- package/build/card/Card.js +0 -1
- package/build/card/Card.js.map +1 -1
- package/build/card/Card.mjs +0 -1
- package/build/card/Card.mjs.map +1 -1
- package/build/checkbox/Checkbox.js +0 -1
- package/build/checkbox/Checkbox.js.map +1 -1
- package/build/checkbox/Checkbox.mjs +0 -1
- package/build/checkbox/Checkbox.mjs.map +1 -1
- package/build/chevron/Chevron.js +0 -1
- package/build/chevron/Chevron.js.map +1 -1
- package/build/chevron/Chevron.mjs +0 -1
- package/build/chevron/Chevron.mjs.map +1 -1
- package/build/chips/Chip.js +0 -1
- package/build/chips/Chip.js.map +1 -1
- package/build/chips/Chip.mjs +0 -1
- package/build/chips/Chip.mjs.map +1 -1
- package/build/circularButton/CircularButton.js +0 -1
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +0 -1
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/locale/index.js +4 -9
- package/build/common/locale/index.js.map +1 -1
- package/build/common/locale/index.mjs +4 -9
- package/build/common/locale/index.mjs.map +1 -1
- package/build/common/panel/Panel.js +56 -41
- package/build/common/panel/Panel.js.map +1 -1
- package/build/common/panel/Panel.mjs +61 -46
- package/build/common/panel/Panel.mjs.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.js +0 -1
- package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs +0 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +0 -1
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +0 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/dateInput/DateInput.js +1 -1
- package/build/dateInput/DateInput.mjs +1 -1
- package/build/dateLookup/DateLookup.js +1 -1
- package/build/dateLookup/DateLookup.mjs +1 -1
- package/build/dateLookup/dateHeader/DateHeader.js +0 -1
- package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs +0 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
- package/build/decision/Decision.js +0 -1
- package/build/decision/Decision.js.map +1 -1
- package/build/decision/Decision.mjs +0 -1
- package/build/decision/Decision.mjs.map +1 -1
- package/build/definitionList/DefinitionList.js +0 -1
- package/build/definitionList/DefinitionList.js.map +1 -1
- package/build/definitionList/DefinitionList.mjs +0 -1
- package/build/definitionList/DefinitionList.mjs.map +1 -1
- package/build/dimmer/Dimmer.js +0 -1
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/Dimmer.mjs +0 -1
- package/build/dimmer/Dimmer.mjs.map +1 -1
- package/build/display/Display.js +0 -1
- package/build/display/Display.js.map +1 -1
- package/build/display/Display.mjs +0 -1
- package/build/display/Display.mjs.map +1 -1
- package/build/drawer/Drawer.js +0 -1
- package/build/drawer/Drawer.js.map +1 -1
- package/build/drawer/Drawer.mjs +0 -1
- package/build/drawer/Drawer.mjs.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +3 -4
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +3 -4
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
- package/build/field/Field.js +5 -5
- package/build/field/Field.mjs +5 -5
- package/build/flowNavigation/FlowNavigation.js +0 -1
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs +0 -1
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/header/Header.js +0 -1
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs +0 -1
- package/build/header/Header.mjs.map +1 -1
- package/build/i18n/en.json +2 -0
- package/build/i18n/en.json.js +2 -0
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +2 -0
- package/build/i18n/en.json.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/info/Info.js +0 -1
- package/build/info/Info.js.map +1 -1
- package/build/info/Info.mjs +0 -1
- package/build/info/Info.mjs.map +1 -1
- package/build/inlineAlert/InlineAlert.js +0 -1
- package/build/inlineAlert/InlineAlert.js.map +1 -1
- package/build/inlineAlert/InlineAlert.mjs +0 -1
- package/build/inlineAlert/InlineAlert.mjs.map +1 -1
- package/build/inputs/SearchInput.js +0 -1
- package/build/inputs/SearchInput.js.map +1 -1
- package/build/inputs/SearchInput.mjs +0 -1
- package/build/inputs/SearchInput.mjs.map +1 -1
- package/build/instructionsList/InstructionsList.js +0 -1
- package/build/instructionsList/InstructionsList.js.map +1 -1
- package/build/instructionsList/InstructionsList.mjs +0 -1
- package/build/instructionsList/InstructionsList.mjs.map +1 -1
- package/build/link/Link.js +0 -1
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.mjs +0 -1
- package/build/link/Link.mjs.map +1 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +0 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +1 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +0 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +1 -1
- package/build/listItem/ListItem.js +0 -1
- package/build/listItem/ListItem.js.map +1 -1
- package/build/listItem/ListItem.mjs +0 -1
- package/build/listItem/ListItem.mjs.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js +5 -5
- package/build/listItem/Prompt/ListItemPrompt.mjs +5 -5
- package/build/loader/Loader.js +0 -1
- package/build/loader/Loader.js.map +1 -1
- package/build/loader/Loader.mjs +0 -1
- package/build/loader/Loader.mjs.map +1 -1
- package/build/main.css +130 -51
- package/build/markdown/Markdown.js +0 -1
- package/build/markdown/Markdown.js.map +1 -1
- package/build/markdown/Markdown.mjs +0 -1
- package/build/markdown/Markdown.mjs.map +1 -1
- package/build/modal/Modal.js +0 -1
- package/build/modal/Modal.js.map +1 -1
- package/build/modal/Modal.mjs +0 -1
- package/build/modal/Modal.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.js +12 -28
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +14 -30
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/moneyInput/currencyFormatting.js +2 -8
- package/build/moneyInput/currencyFormatting.js.map +1 -1
- package/build/moneyInput/currencyFormatting.mjs +4 -5
- package/build/moneyInput/currencyFormatting.mjs.map +1 -1
- package/build/navigationOption/NavigationOption.js +0 -1
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOption/NavigationOption.mjs +0 -1
- package/build/navigationOption/NavigationOption.mjs.map +1 -1
- package/build/nudge/Nudge.js +0 -1
- package/build/nudge/Nudge.js.map +1 -1
- package/build/nudge/Nudge.mjs +0 -1
- package/build/nudge/Nudge.mjs.map +1 -1
- package/build/overlayHeader/OverlayHeader.js +0 -1
- package/build/overlayHeader/OverlayHeader.js.map +1 -1
- package/build/overlayHeader/OverlayHeader.mjs +0 -1
- package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +0 -1
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +0 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/popover/Popover.js +0 -1
- package/build/popover/Popover.js.map +1 -1
- package/build/popover/Popover.mjs +0 -1
- package/build/popover/Popover.mjs.map +1 -1
- package/build/processIndicator/ProcessIndicator.js +0 -1
- package/build/processIndicator/ProcessIndicator.js.map +1 -1
- package/build/processIndicator/ProcessIndicator.mjs +0 -1
- package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
- package/build/progressBar/ProgressBar.js +0 -1
- package/build/progressBar/ProgressBar.js.map +1 -1
- package/build/progressBar/ProgressBar.mjs +0 -1
- package/build/progressBar/ProgressBar.mjs.map +1 -1
- package/build/promoCard/PromoCard.js +0 -1
- package/build/promoCard/PromoCard.js.map +1 -1
- package/build/promoCard/PromoCard.mjs +0 -1
- package/build/promoCard/PromoCard.mjs.map +1 -1
- package/build/promoCard/PromoCardIndicator.js +0 -1
- package/build/promoCard/PromoCardIndicator.js.map +1 -1
- package/build/promoCard/PromoCardIndicator.mjs +0 -1
- package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.js +8 -41
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.mjs +8 -41
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
- package/build/prompt/CriticalBanner/CriticalBanner.js +148 -0
- package/build/prompt/CriticalBanner/CriticalBanner.js.map +1 -0
- package/build/prompt/CriticalBanner/CriticalBanner.mjs +146 -0
- package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +1 -0
- package/build/prompt/CriticalBanner/helpers.js +29 -0
- package/build/prompt/CriticalBanner/helpers.js.map +1 -0
- package/build/prompt/CriticalBanner/helpers.mjs +26 -0
- package/build/prompt/CriticalBanner/helpers.mjs.map +1 -0
- package/build/prompt/InfoPrompt/InfoPrompt.js +0 -1
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.mjs +0 -1
- package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js +0 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +0 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js +2 -0
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs +2 -0
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
- package/build/prompt/common/Expander/Expander.js +47 -0
- package/build/prompt/common/Expander/Expander.js.map +1 -0
- package/build/prompt/common/Expander/Expander.messages.js +17 -0
- package/build/prompt/common/Expander/Expander.messages.js.map +1 -0
- package/build/prompt/common/Expander/Expander.messages.mjs +13 -0
- package/build/prompt/common/Expander/Expander.messages.mjs.map +1 -0
- package/build/prompt/common/Expander/Expander.mjs +44 -0
- package/build/prompt/common/Expander/Expander.mjs.map +1 -0
- package/build/prompt/helpers/promptMedia.js +52 -0
- package/build/prompt/helpers/promptMedia.js.map +1 -0
- package/build/prompt/helpers/promptMedia.mjs +50 -0
- package/build/prompt/helpers/promptMedia.mjs.map +1 -0
- package/build/radio/Radio.js +0 -1
- package/build/radio/Radio.js.map +1 -1
- package/build/radio/Radio.mjs +0 -1
- package/build/radio/Radio.mjs.map +1 -1
- package/build/segmentedControl/SegmentedControl.js +0 -1
- package/build/segmentedControl/SegmentedControl.js.map +1 -1
- package/build/segmentedControl/SegmentedControl.mjs +0 -1
- package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
- package/build/select/Select.js +0 -1
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +0 -1
- package/build/select/Select.mjs.map +1 -1
- package/build/select/option/Option.js +0 -1
- package/build/select/option/Option.js.map +1 -1
- package/build/select/option/Option.mjs +0 -1
- package/build/select/option/Option.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js +0 -1
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +0 -1
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/stepper/Stepper.js +0 -1
- package/build/stepper/Stepper.js.map +1 -1
- package/build/stepper/Stepper.mjs +0 -1
- package/build/stepper/Stepper.mjs.map +1 -1
- package/build/sticky/Sticky.js +0 -1
- package/build/sticky/Sticky.js.map +1 -1
- package/build/sticky/Sticky.mjs +0 -1
- package/build/sticky/Sticky.mjs.map +1 -1
- package/build/styles/css/neptune.css +22 -22
- package/build/styles/less/neptune-tokens.less +4 -4
- package/build/styles/main.css +130 -51
- package/build/styles/prompt/CriticalBanner/CriticalBanner.css +59 -0
- package/build/styles/prompt/common/Expander/Expander.css +8 -0
- package/build/styles/props/neptune-tokens.css +2 -2
- package/build/styles/styles/less/neptune.css +22 -22
- package/build/summary/Summary.js +0 -1
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.mjs +0 -1
- package/build/summary/Summary.mjs.map +1 -1
- package/build/table/Table.js +0 -1
- package/build/table/Table.js.map +1 -1
- package/build/table/Table.mjs +0 -1
- package/build/table/Table.mjs.map +1 -1
- package/build/table/TableRow.js +0 -1
- package/build/table/TableRow.js.map +1 -1
- package/build/table/TableRow.mjs +0 -1
- package/build/table/TableRow.mjs.map +1 -1
- package/build/table/TableStatusText.js +0 -1
- package/build/table/TableStatusText.js.map +1 -1
- package/build/table/TableStatusText.mjs +0 -1
- package/build/table/TableStatusText.mjs.map +1 -1
- package/build/tabs/Tabs.js +0 -1
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +0 -1
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/tile/Tile.js +0 -1
- package/build/tile/Tile.js.map +1 -1
- package/build/tile/Tile.mjs +0 -1
- package/build/tile/Tile.mjs.map +1 -1
- package/build/title/Title.js +0 -1
- package/build/title/Title.js.map +1 -1
- package/build/title/Title.mjs +0 -1
- package/build/title/Title.mjs.map +1 -1
- package/build/tooltip/Tooltip.js +50 -30
- package/build/tooltip/Tooltip.js.map +1 -1
- package/build/tooltip/Tooltip.mjs +51 -31
- package/build/tooltip/Tooltip.mjs.map +1 -1
- package/build/typeahead/Typeahead.js +5 -5
- package/build/typeahead/Typeahead.mjs +5 -5
- package/build/types/common/locale/index.d.ts +1 -1
- package/build/types/common/locale/index.d.ts.map +1 -1
- package/build/types/common/panel/Panel.d.ts.map +1 -1
- package/build/types/expressiveMoneyInput/currencySelector/CurrencySelector.d.ts.map +1 -1
- package/build/types/index.d.ts +2 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts +0 -6
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/moneyInput/currencyFormatting.d.ts +3 -4
- package/build/types/moneyInput/currencyFormatting.d.ts.map +1 -1
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +2 -11
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
- package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts +40 -0
- package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts.map +1 -0
- package/build/types/prompt/CriticalBanner/helpers.d.ts +18 -0
- package/build/types/prompt/CriticalBanner/helpers.d.ts.map +1 -0
- package/build/types/prompt/CriticalBanner/index.d.ts +3 -0
- package/build/types/prompt/CriticalBanner/index.d.ts.map +1 -0
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +8 -3
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
- package/build/types/prompt/common/Expander/Expander.d.ts +20 -0
- package/build/types/prompt/common/Expander/Expander.d.ts.map +1 -0
- package/build/types/prompt/common/Expander/Expander.messages.d.ts +14 -0
- package/build/types/prompt/common/Expander/Expander.messages.d.ts.map +1 -0
- package/build/types/prompt/helpers/promptMedia.d.ts +22 -0
- package/build/types/prompt/helpers/promptMedia.d.ts.map +1 -0
- package/build/types/prompt/index.d.ts +2 -0
- package/build/types/prompt/index.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +4 -0
- package/build/types/test-utils/index.d.ts.map +1 -1
- package/build/types/tooltip/Tooltip.d.ts.map +1 -1
- package/build/upload/Upload.js +0 -1
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs +0 -1
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/completeStep/completeStep.js +0 -1
- package/build/upload/steps/completeStep/completeStep.js.map +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs +0 -1
- package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
- package/build/upload/steps/processingStep/processingStep.js +0 -1
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +0 -1
- package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +0 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +0 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js +0 -1
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +0 -1
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js +0 -1
- package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs +0 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
- package/build/uploadInput/uploadButton/defaults.js +0 -1
- package/build/uploadInput/uploadButton/defaults.js.map +1 -1
- package/build/uploadInput/uploadButton/defaults.mjs +0 -1
- package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +0 -1
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +0 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js +0 -1
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs +0 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +16 -14
- package/src/common/locale/index.test.ts +4 -13
- package/src/common/locale/index.ts +3 -9
- package/src/common/panel/Panel.tsx +50 -42
- package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +0 -18
- package/src/expressiveMoneyInput/currencySelector/CurrencySelector.test.tsx +1 -119
- package/src/expressiveMoneyInput/currencySelector/CurrencySelector.tsx +3 -4
- package/src/i18n/en.json +2 -0
- package/src/index.ts +2 -2
- package/src/main.css +130 -51
- package/src/main.less +3 -1
- package/src/moneyInput/MoneyInput.story.tsx +1 -10
- package/src/moneyInput/MoneyInput.test.story.tsx +1 -141
- package/src/moneyInput/MoneyInput.test.tsx +0 -45
- package/src/moneyInput/MoneyInput.tsx +3 -27
- package/src/moneyInput/currencyFormatting.ts +5 -11
- package/src/prompt/ActionPrompt/ActionPrompt.tsx +9 -62
- package/src/prompt/CriticalBanner/CriticalBanner.accessibility.docs.mdx +131 -0
- package/src/prompt/CriticalBanner/CriticalBanner.css +59 -0
- package/src/prompt/CriticalBanner/CriticalBanner.less +64 -0
- package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +645 -0
- package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +285 -0
- package/src/prompt/CriticalBanner/CriticalBanner.tsx +194 -0
- package/src/prompt/CriticalBanner/helpers.ts +39 -0
- package/src/prompt/CriticalBanner/index.ts +2 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +9 -2
- package/src/prompt/common/Expander/Expander.css +8 -0
- package/src/prompt/common/Expander/Expander.less +9 -0
- package/src/prompt/common/Expander/Expander.messages.ts +14 -0
- package/src/prompt/common/Expander/Expander.test.tsx +167 -0
- package/src/prompt/common/Expander/Expander.tsx +83 -0
- package/src/prompt/helpers/promptMedia.tsx +79 -0
- package/src/prompt/index.ts +4 -0
- package/src/sentimentSurface/SentimentSurface.story.tsx +43 -17
- package/src/styles/less/neptune.css +22 -22
- package/src/tooltip/Tooltip.tsx +45 -26
|
@@ -0,0 +1,285 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import { Meta, StoryObj } from '@storybook/react-webpack5';
|
|
3
|
+
import { expect, fn, userEvent, within } from 'storybook/test';
|
|
4
|
+
import { Bank } from '@transferwise/icons';
|
|
5
|
+
import Button from '../../button';
|
|
6
|
+
import { withVariantConfig } from '../../../.storybook/helpers';
|
|
7
|
+
import { CriticalBanner } from './CriticalBanner';
|
|
8
|
+
|
|
9
|
+
const meta: Meta<typeof CriticalBanner> = {
|
|
10
|
+
component: CriticalBanner,
|
|
11
|
+
title: 'Prompts/CriticalBanner/Tests',
|
|
12
|
+
tags: ['!autodocs', '!manifest'],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
type Story = StoryObj<typeof CriticalBanner>;
|
|
17
|
+
|
|
18
|
+
const wait = async (ms: number) =>
|
|
19
|
+
new Promise<void>((resolve) => {
|
|
20
|
+
setTimeout(resolve, ms);
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
const longDescription =
|
|
24
|
+
'We have detected unusual activity on your account that does not match your typical usage patterns. To protect your funds and personal information, we have temporarily restricted access. Please verify your identity to restore full access to your account.';
|
|
25
|
+
|
|
26
|
+
function AllVariants() {
|
|
27
|
+
const [states, setStates] = useState({
|
|
28
|
+
negativeExpanded: true,
|
|
29
|
+
negativeCollapsed: false,
|
|
30
|
+
warningExpanded: true,
|
|
31
|
+
warningCollapsed: false,
|
|
32
|
+
neutralExpanded: true,
|
|
33
|
+
successExpanded: true,
|
|
34
|
+
noTitle: false,
|
|
35
|
+
withMedia: true,
|
|
36
|
+
withBothActions: true,
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
const toggle = (key: keyof typeof states) =>
|
|
40
|
+
setStates((prev) => ({ ...prev, [key]: !prev[key] }));
|
|
41
|
+
|
|
42
|
+
return (
|
|
43
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem', width: '100%' }}>
|
|
44
|
+
<CriticalBanner
|
|
45
|
+
sentiment="negative"
|
|
46
|
+
title="Negative — expanded"
|
|
47
|
+
description="Your account has been temporarily blocked due to unusual activity."
|
|
48
|
+
action={{ label: 'Verify now', onClick: fn() }}
|
|
49
|
+
actionSecondary={{ label: 'Learn more', onClick: fn() }}
|
|
50
|
+
expanded={states.negativeExpanded}
|
|
51
|
+
onToggle={() => toggle('negativeExpanded')}
|
|
52
|
+
/>
|
|
53
|
+
<CriticalBanner
|
|
54
|
+
sentiment="negative"
|
|
55
|
+
title="Negative — collapsed"
|
|
56
|
+
description="Your account has been temporarily blocked."
|
|
57
|
+
action={{ label: 'Verify now', onClick: fn() }}
|
|
58
|
+
expanded={states.negativeCollapsed}
|
|
59
|
+
onToggle={() => toggle('negativeCollapsed')}
|
|
60
|
+
/>
|
|
61
|
+
<CriticalBanner
|
|
62
|
+
sentiment="warning"
|
|
63
|
+
title="Warning — expanded"
|
|
64
|
+
description="Your account is at risk of being blocked within 7 days."
|
|
65
|
+
action={{ label: 'Take action', onClick: fn() }}
|
|
66
|
+
expanded={states.warningExpanded}
|
|
67
|
+
onToggle={() => toggle('warningExpanded')}
|
|
68
|
+
/>
|
|
69
|
+
<CriticalBanner
|
|
70
|
+
sentiment="warning"
|
|
71
|
+
title="Warning — collapsed"
|
|
72
|
+
description="Your account is at risk."
|
|
73
|
+
action={{ label: 'Take action', onClick: fn() }}
|
|
74
|
+
expanded={states.warningCollapsed}
|
|
75
|
+
onToggle={() => toggle('warningCollapsed')}
|
|
76
|
+
/>
|
|
77
|
+
<CriticalBanner
|
|
78
|
+
sentiment="neutral"
|
|
79
|
+
title="Neutral — expanded"
|
|
80
|
+
description="Your account needs attention."
|
|
81
|
+
action={{ label: 'Review', onClick: fn() }}
|
|
82
|
+
expanded={states.neutralExpanded}
|
|
83
|
+
onToggle={() => toggle('neutralExpanded')}
|
|
84
|
+
/>
|
|
85
|
+
<CriticalBanner
|
|
86
|
+
sentiment="success"
|
|
87
|
+
title="Success — expanded"
|
|
88
|
+
description="Your account has been restored."
|
|
89
|
+
action={{ label: 'Continue', onClick: fn() }}
|
|
90
|
+
expanded={states.successExpanded}
|
|
91
|
+
onToggle={() => toggle('successExpanded')}
|
|
92
|
+
/>
|
|
93
|
+
<CriticalBanner
|
|
94
|
+
sentiment="negative"
|
|
95
|
+
description={longDescription}
|
|
96
|
+
action={{ label: 'Verify now', onClick: fn() }}
|
|
97
|
+
expanded={states.noTitle}
|
|
98
|
+
onToggle={() => toggle('noTitle')}
|
|
99
|
+
/>
|
|
100
|
+
<CriticalBanner
|
|
101
|
+
sentiment="warning"
|
|
102
|
+
title="With custom media"
|
|
103
|
+
description="Re-link your bank account to continue receiving transfers."
|
|
104
|
+
media={{ avatar: { asset: <Bank title="Bank account" /> } }}
|
|
105
|
+
action={{ label: 'Connect bank', onClick: fn() }}
|
|
106
|
+
expanded={states.withMedia}
|
|
107
|
+
onToggle={() => toggle('withMedia')}
|
|
108
|
+
/>
|
|
109
|
+
<CriticalBanner
|
|
110
|
+
sentiment="negative"
|
|
111
|
+
title="Both actions"
|
|
112
|
+
description="We've blocked your account due to unusual activity."
|
|
113
|
+
action={{ label: 'Verify now', onClick: fn() }}
|
|
114
|
+
actionSecondary={{ label: 'Contact support', onClick: fn() }}
|
|
115
|
+
expanded={states.withBothActions}
|
|
116
|
+
onToggle={() => toggle('withBothActions')}
|
|
117
|
+
/>
|
|
118
|
+
</div>
|
|
119
|
+
);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* All four sentiments in both expanded and collapsed states, with and without
|
|
124
|
+
* title, media variants, and action combinations. Used for Chromatic visual
|
|
125
|
+
* regression across default, dark, bright-green, and forest-green themes.
|
|
126
|
+
*/
|
|
127
|
+
export const Variants: Story = {
|
|
128
|
+
render: () => <AllVariants />,
|
|
129
|
+
...withVariantConfig(['default', 'dark', 'bright-green', 'forest-green']),
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
/** Mobile viewport regression test with all variants. */
|
|
133
|
+
export const MobileVariants: Story = {
|
|
134
|
+
render: () => <AllVariants />,
|
|
135
|
+
...withVariantConfig(['mobile']),
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* Tests keyboard navigation and interaction:
|
|
140
|
+
* - Tab focuses the first chevron toggle button
|
|
141
|
+
* - Enter toggles expanded/collapsed state
|
|
142
|
+
* - Tab moves focus to the action button (when expanded)
|
|
143
|
+
* - Tab moves to the next banner's toggle
|
|
144
|
+
*/
|
|
145
|
+
export const KeyboardInteraction: Story = {
|
|
146
|
+
render: function Render() {
|
|
147
|
+
const [expanded1, setExpanded1] = useState(true);
|
|
148
|
+
const [expanded2, setExpanded2] = useState(false);
|
|
149
|
+
|
|
150
|
+
return (
|
|
151
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem', width: '100%' }}>
|
|
152
|
+
<CriticalBanner
|
|
153
|
+
sentiment="negative"
|
|
154
|
+
title="First banner"
|
|
155
|
+
description="This banner starts expanded."
|
|
156
|
+
action={{ label: 'Verify now', onClick: fn() }}
|
|
157
|
+
expanded={expanded1}
|
|
158
|
+
onToggle={() => setExpanded1(!expanded1)}
|
|
159
|
+
/>
|
|
160
|
+
<CriticalBanner
|
|
161
|
+
sentiment="warning"
|
|
162
|
+
title="Second banner"
|
|
163
|
+
description="This banner starts collapsed."
|
|
164
|
+
action={{ label: 'Take action', onClick: fn() }}
|
|
165
|
+
expanded={expanded2}
|
|
166
|
+
onToggle={() => setExpanded2(!expanded2)}
|
|
167
|
+
/>
|
|
168
|
+
</div>
|
|
169
|
+
);
|
|
170
|
+
},
|
|
171
|
+
play: async ({ canvasElement }) => {
|
|
172
|
+
const canvas = within(canvasElement);
|
|
173
|
+
|
|
174
|
+
// Wait for the collapse button to appear (viewport change needs time to apply)
|
|
175
|
+
const collapseBtn = await canvas.findByRole('button', { name: /^collapse$/i });
|
|
176
|
+
|
|
177
|
+
// Tab to first toggle (Collapse button since first banner is expanded)
|
|
178
|
+
await userEvent.tab();
|
|
179
|
+
await expect(collapseBtn).toHaveFocus();
|
|
180
|
+
|
|
181
|
+
// Enter collapses the first banner
|
|
182
|
+
await userEvent.keyboard(' ');
|
|
183
|
+
await wait(400);
|
|
184
|
+
|
|
185
|
+
// After collapsing, the button label changes to "Expand"
|
|
186
|
+
const expandBtns = canvas.getAllByRole('button', { name: /^expand$/i });
|
|
187
|
+
await expect(expandBtns).toHaveLength(2);
|
|
188
|
+
|
|
189
|
+
// Tab to the action button — but since banner is now collapsed, actions are hidden.
|
|
190
|
+
// So tab goes to the next banner's toggle (Expand).
|
|
191
|
+
await userEvent.tab();
|
|
192
|
+
await wait(400);
|
|
193
|
+
await expect(expandBtns[1]).toHaveFocus();
|
|
194
|
+
|
|
195
|
+
// Space expands the second banner
|
|
196
|
+
await userEvent.keyboard(' ');
|
|
197
|
+
await wait(400);
|
|
198
|
+
|
|
199
|
+
// Now the second banner has a Collapse button
|
|
200
|
+
const secondCollapse = canvas.getByRole('button', { name: /^collapse$/i });
|
|
201
|
+
await expect(secondCollapse).toHaveFocus();
|
|
202
|
+
|
|
203
|
+
// Tab to the second banner's action button (now visible)
|
|
204
|
+
await userEvent.tab();
|
|
205
|
+
await wait(400);
|
|
206
|
+
const actionBtn = canvas.getByRole('button', { name: /^take action$/i });
|
|
207
|
+
await expect(actionBtn).toHaveFocus();
|
|
208
|
+
},
|
|
209
|
+
...withVariantConfig(['mobile']),
|
|
210
|
+
parameters: {
|
|
211
|
+
...withVariantConfig(['mobile']).parameters,
|
|
212
|
+
viewport: {
|
|
213
|
+
defaultViewport: 'mobile2',
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* CriticalBanner uses `aria-live="assertive"` to immediately announce content to screen readers.
|
|
220
|
+
* Toggle the banner on/off and expand/collapse to hear how announcements change.
|
|
221
|
+
*/
|
|
222
|
+
export const LiveRegionAnnouncements: Story = {
|
|
223
|
+
render: function Render() {
|
|
224
|
+
const [visible, setVisible] = useState(false);
|
|
225
|
+
const [expanded, setExpanded] = useState(false);
|
|
226
|
+
|
|
227
|
+
return (
|
|
228
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem', width: '100%' }}>
|
|
229
|
+
<div>
|
|
230
|
+
<Button v2 onClick={() => setVisible(!visible)}>
|
|
231
|
+
{visible ? 'Hide banner' : 'Show banner'}
|
|
232
|
+
</Button>
|
|
233
|
+
</div>
|
|
234
|
+
{visible && (
|
|
235
|
+
<CriticalBanner
|
|
236
|
+
sentiment="negative"
|
|
237
|
+
title="Your account requires verification"
|
|
238
|
+
description="Please verify your identity to continue using all features."
|
|
239
|
+
action={{ label: 'Verify now', onClick: fn() }}
|
|
240
|
+
actionSecondary={{ label: 'Learn more', onClick: fn() }}
|
|
241
|
+
expanded={expanded}
|
|
242
|
+
onToggle={() => setExpanded(!expanded)}
|
|
243
|
+
/>
|
|
244
|
+
)}
|
|
245
|
+
</div>
|
|
246
|
+
);
|
|
247
|
+
},
|
|
248
|
+
};
|
|
249
|
+
|
|
250
|
+
/** Right-to-left layout regression test. */
|
|
251
|
+
export const RTL: Story = {
|
|
252
|
+
render: function Render() {
|
|
253
|
+
const [expanded, setExpanded] = useState(true);
|
|
254
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
255
|
+
|
|
256
|
+
return (
|
|
257
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem', width: '100%' }}>
|
|
258
|
+
<CriticalBanner
|
|
259
|
+
sentiment="negative"
|
|
260
|
+
title="Your account requires verification"
|
|
261
|
+
description="Please verify your identity to continue using all features."
|
|
262
|
+
action={{ label: 'Verify now', onClick: fn() }}
|
|
263
|
+
actionSecondary={{ label: 'Learn more', onClick: fn() }}
|
|
264
|
+
expanded={expanded}
|
|
265
|
+
onToggle={() => setExpanded(!expanded)}
|
|
266
|
+
/>
|
|
267
|
+
<CriticalBanner
|
|
268
|
+
sentiment="warning"
|
|
269
|
+
title="Collapsed state"
|
|
270
|
+
description="This banner is collapsed."
|
|
271
|
+
action={{ label: 'Take action', onClick: fn() }}
|
|
272
|
+
expanded={collapsed}
|
|
273
|
+
onToggle={() => setCollapsed(!collapsed)}
|
|
274
|
+
/>
|
|
275
|
+
</div>
|
|
276
|
+
);
|
|
277
|
+
},
|
|
278
|
+
...withVariantConfig(['rtl']),
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
/** 400% zoom regression test with all variants. */
|
|
282
|
+
export const Zoom400: Story = {
|
|
283
|
+
render: () => <AllVariants />,
|
|
284
|
+
...withVariantConfig(['400%']),
|
|
285
|
+
};
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
import { AriaAttributes, ReactNode, useId } from 'react';
|
|
2
|
+
import { clsx } from 'clsx';
|
|
3
|
+
|
|
4
|
+
import Body from '../../body';
|
|
5
|
+
import Button from '../../button';
|
|
6
|
+
import { Breakpoint, LiveRegion, Typography } from '../../common';
|
|
7
|
+
import { ButtonProps } from '../../button/Button.types';
|
|
8
|
+
import { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';
|
|
9
|
+
import { useScreenSize } from '../../common/hooks/useScreenSize';
|
|
10
|
+
|
|
11
|
+
import { renderPromptMedia, PromptMedia } from '../helpers/promptMedia';
|
|
12
|
+
import { shouldShowWhenExpanded, ExpanderToggle } from '../common/Expander/Expander';
|
|
13
|
+
import { buildAnnouncementString } from './helpers';
|
|
14
|
+
|
|
15
|
+
export type CriticalBannerProps = {
|
|
16
|
+
title?: ReactNode;
|
|
17
|
+
description?: ReactNode;
|
|
18
|
+
media?: PromptMedia;
|
|
19
|
+
action?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {
|
|
20
|
+
label: ButtonProps['children'];
|
|
21
|
+
};
|
|
22
|
+
actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {
|
|
23
|
+
label: ButtonProps['children'];
|
|
24
|
+
};
|
|
25
|
+
sentiment?: Exclude<PrimitivePromptProps['sentiment'], 'proposition'>;
|
|
26
|
+
/**
|
|
27
|
+
* Controls whether the description and actions are visible.
|
|
28
|
+
* When collapsed with a title, only the title is shown.
|
|
29
|
+
* When collapsed without a title, the description is trimmed to 2 lines.
|
|
30
|
+
*/
|
|
31
|
+
expanded?: boolean;
|
|
32
|
+
/** Called when the user clicks the chevron toggle. */
|
|
33
|
+
onToggle?: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* Overrides the default labelling derived from `title` and `description`.
|
|
36
|
+
*
|
|
37
|
+
* **NB:** When provided, the default `aria-labelledby` / `aria-describedby`
|
|
38
|
+
* attributes are removed — include all necessary context in the label.
|
|
39
|
+
*/
|
|
40
|
+
'aria-label'?: AriaAttributes['aria-label'];
|
|
41
|
+
} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid'>;
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A full-width, non-dismissible banner for critical messages such as account blocks or
|
|
45
|
+
* time-sensitive actions that require immediate user attention.
|
|
46
|
+
|
|
47
|
+
* @see {@link https://wise.design/components/critical-banner Design Spec}
|
|
48
|
+
*/
|
|
49
|
+
export const CriticalBanner = ({
|
|
50
|
+
sentiment = 'negative',
|
|
51
|
+
title,
|
|
52
|
+
description,
|
|
53
|
+
media = {},
|
|
54
|
+
action,
|
|
55
|
+
actionSecondary,
|
|
56
|
+
expanded = true,
|
|
57
|
+
onToggle,
|
|
58
|
+
id,
|
|
59
|
+
className,
|
|
60
|
+
'data-testid': testId,
|
|
61
|
+
'aria-label': ariaLabel,
|
|
62
|
+
}: CriticalBannerProps) => {
|
|
63
|
+
const isMobile = !useScreenSize(Breakpoint.EXTRA_SMALL);
|
|
64
|
+
const resolvedExpanded = !isMobile || expanded;
|
|
65
|
+
const hasActions = action ?? actionSecondary;
|
|
66
|
+
const mediaId = useId();
|
|
67
|
+
const titleId = useId();
|
|
68
|
+
const descId = useId();
|
|
69
|
+
|
|
70
|
+
const ariaLabelledByIds = [
|
|
71
|
+
media['aria-hidden'] ? undefined : mediaId,
|
|
72
|
+
ariaLabel || !title ? undefined : titleId,
|
|
73
|
+
]
|
|
74
|
+
.filter(Boolean)
|
|
75
|
+
.join(' ');
|
|
76
|
+
|
|
77
|
+
return (
|
|
78
|
+
<LiveRegion
|
|
79
|
+
aria-live="assertive"
|
|
80
|
+
announceOnChange={buildAnnouncementString({
|
|
81
|
+
title,
|
|
82
|
+
description,
|
|
83
|
+
expanded: resolvedExpanded,
|
|
84
|
+
actionLabel: action?.label,
|
|
85
|
+
actionSecondaryLabel: actionSecondary?.label,
|
|
86
|
+
})}
|
|
87
|
+
>
|
|
88
|
+
<PrimitivePrompt
|
|
89
|
+
id={id}
|
|
90
|
+
sentiment={sentiment}
|
|
91
|
+
emphasis={sentiment === 'neutral' ? 'base' : 'elevated'}
|
|
92
|
+
data-testid={testId}
|
|
93
|
+
className={clsx(
|
|
94
|
+
'wds-critical-banner',
|
|
95
|
+
{
|
|
96
|
+
'wds-critical-banner__mobile--collapsed': !resolvedExpanded,
|
|
97
|
+
'wds-critical-banner--with-two-actions': !!actionSecondary,
|
|
98
|
+
},
|
|
99
|
+
className,
|
|
100
|
+
)}
|
|
101
|
+
media={renderPromptMedia({
|
|
102
|
+
media,
|
|
103
|
+
sentiment,
|
|
104
|
+
mediaId,
|
|
105
|
+
imgClassName: 'wds-critical-banner--media-image',
|
|
106
|
+
})}
|
|
107
|
+
actions={
|
|
108
|
+
shouldShowWhenExpanded({ expanded: resolvedExpanded, hasContent: !!hasActions }) ? (
|
|
109
|
+
<>
|
|
110
|
+
{actionSecondary && (
|
|
111
|
+
// @ts-expect-error onClick type mismatch
|
|
112
|
+
<Button
|
|
113
|
+
v2
|
|
114
|
+
size="md"
|
|
115
|
+
priority="secondary"
|
|
116
|
+
href={actionSecondary.href}
|
|
117
|
+
block={isMobile}
|
|
118
|
+
onClick={actionSecondary?.onClick}
|
|
119
|
+
>
|
|
120
|
+
{actionSecondary.label}
|
|
121
|
+
</Button>
|
|
122
|
+
)}
|
|
123
|
+
{action && (
|
|
124
|
+
// @ts-expect-error onClick type mismatch
|
|
125
|
+
<Button
|
|
126
|
+
v2
|
|
127
|
+
size="md"
|
|
128
|
+
priority="primary"
|
|
129
|
+
href={action.href}
|
|
130
|
+
block={isMobile}
|
|
131
|
+
onClick={action.onClick}
|
|
132
|
+
>
|
|
133
|
+
{action.label}
|
|
134
|
+
</Button>
|
|
135
|
+
)}
|
|
136
|
+
</>
|
|
137
|
+
) : undefined
|
|
138
|
+
}
|
|
139
|
+
role="region"
|
|
140
|
+
{...(ariaLabel
|
|
141
|
+
? { 'aria-label': ariaLabel }
|
|
142
|
+
: {
|
|
143
|
+
'aria-labelledby': ariaLabelledByIds,
|
|
144
|
+
'aria-describedby': descId,
|
|
145
|
+
})}
|
|
146
|
+
>
|
|
147
|
+
<div
|
|
148
|
+
className={clsx(
|
|
149
|
+
'd-flex',
|
|
150
|
+
'flex-column',
|
|
151
|
+
'justify-content-center',
|
|
152
|
+
'wds-critical-banner__text-wrapper',
|
|
153
|
+
)}
|
|
154
|
+
>
|
|
155
|
+
{title && (
|
|
156
|
+
<Body
|
|
157
|
+
id={titleId}
|
|
158
|
+
type={Typography.BODY_LARGE_BOLD}
|
|
159
|
+
className={clsx('wds-critical-banner__content', {
|
|
160
|
+
'wds-critical-banner__title--collapsed': !resolvedExpanded,
|
|
161
|
+
})}
|
|
162
|
+
>
|
|
163
|
+
{title}
|
|
164
|
+
</Body>
|
|
165
|
+
)}
|
|
166
|
+
{shouldShowWhenExpanded({
|
|
167
|
+
expanded: resolvedExpanded,
|
|
168
|
+
hasContent: !!description,
|
|
169
|
+
alwaysShow: !title,
|
|
170
|
+
}) && (
|
|
171
|
+
<Body
|
|
172
|
+
id={descId}
|
|
173
|
+
className={clsx('wds-critical-banner__content', {
|
|
174
|
+
'wds-critical-banner__description--collapsed': !resolvedExpanded && !title,
|
|
175
|
+
})}
|
|
176
|
+
>
|
|
177
|
+
{description}
|
|
178
|
+
</Body>
|
|
179
|
+
)}
|
|
180
|
+
</div>
|
|
181
|
+
{isMobile && (
|
|
182
|
+
<ExpanderToggle
|
|
183
|
+
expanded={expanded}
|
|
184
|
+
size={24}
|
|
185
|
+
className="wds-critical-banner__toggle"
|
|
186
|
+
onToggle={onToggle}
|
|
187
|
+
/>
|
|
188
|
+
)}
|
|
189
|
+
</PrimitivePrompt>
|
|
190
|
+
</LiveRegion>
|
|
191
|
+
);
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
export default CriticalBanner;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Helper to extract string from ReactNode for announcements.
|
|
5
|
+
* Complex ReactNodes (JSX elements) return empty string.
|
|
6
|
+
*/
|
|
7
|
+
export const getStringValue = (node: ReactNode): string => {
|
|
8
|
+
if (typeof node === 'string' || typeof node === 'number') {
|
|
9
|
+
return String(node);
|
|
10
|
+
}
|
|
11
|
+
return '';
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* Builds the announcement string from visible content only.
|
|
16
|
+
* Content visibility depends on expanded state and presence of title.
|
|
17
|
+
*/
|
|
18
|
+
export const buildAnnouncementString = ({
|
|
19
|
+
title,
|
|
20
|
+
description,
|
|
21
|
+
expanded,
|
|
22
|
+
actionLabel,
|
|
23
|
+
actionSecondaryLabel,
|
|
24
|
+
}: {
|
|
25
|
+
title?: ReactNode;
|
|
26
|
+
description?: ReactNode;
|
|
27
|
+
expanded: boolean;
|
|
28
|
+
actionLabel?: ReactNode;
|
|
29
|
+
actionSecondaryLabel?: ReactNode;
|
|
30
|
+
}): string => {
|
|
31
|
+
return [
|
|
32
|
+
title ? getStringValue(title) : undefined,
|
|
33
|
+
description && (expanded || !title) ? getStringValue(description) : undefined,
|
|
34
|
+
expanded && actionLabel ? getStringValue(actionLabel) : undefined,
|
|
35
|
+
expanded && actionSecondaryLabel ? getStringValue(actionSecondaryLabel) : undefined,
|
|
36
|
+
]
|
|
37
|
+
.filter(Boolean)
|
|
38
|
+
.join('|');
|
|
39
|
+
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Cross } from '@transferwise/icons';
|
|
2
2
|
import { clsx } from 'clsx';
|
|
3
|
-
import SentimentSurface, { Sentiment } from '../../sentimentSurface';
|
|
3
|
+
import SentimentSurface, { Emphasis, Sentiment } from '../../sentimentSurface';
|
|
4
4
|
import IconButton from '../../iconButton';
|
|
5
5
|
import { useIntl } from 'react-intl';
|
|
6
6
|
import closeBtnMessages from '../../common/closeButton/CloseButton.messages';
|
|
@@ -8,10 +8,15 @@ import { HTMLAttributes, ReactNode } from 'react';
|
|
|
8
8
|
|
|
9
9
|
export type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {
|
|
10
10
|
/**
|
|
11
|
-
* The sentiment determines the colour scheme
|
|
11
|
+
* The sentiment determines the colour scheme.
|
|
12
12
|
* @default success
|
|
13
13
|
*/
|
|
14
14
|
sentiment?: Sentiment;
|
|
15
|
+
/**
|
|
16
|
+
* The emphasis level affecting background and text contrast.
|
|
17
|
+
* @default 'base
|
|
18
|
+
*/
|
|
19
|
+
emphasis?: Emphasis;
|
|
15
20
|
/**
|
|
16
21
|
* Media to be displayed on the prompt (icon/image/etc).
|
|
17
22
|
*/
|
|
@@ -35,6 +40,7 @@ export type PrimitivePromptProps = HTMLAttributes<HTMLDivElement> & {
|
|
|
35
40
|
* Uses several css variables to handle styling from within the consuming component, e.g. --Prompt-padding. */
|
|
36
41
|
export const PrimitivePrompt = ({
|
|
37
42
|
sentiment = 'success',
|
|
43
|
+
emphasis = 'base',
|
|
38
44
|
media,
|
|
39
45
|
actions,
|
|
40
46
|
onDismiss,
|
|
@@ -47,6 +53,7 @@ export const PrimitivePrompt = ({
|
|
|
47
53
|
return (
|
|
48
54
|
<SentimentSurface
|
|
49
55
|
sentiment={sentiment}
|
|
56
|
+
emphasis={emphasis}
|
|
50
57
|
className={clsx('wds-prompt', `wds-prompt--${sentiment}`, className)}
|
|
51
58
|
{...restProps}
|
|
52
59
|
>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { defineMessages } from 'react-intl';
|
|
2
|
+
|
|
3
|
+
export default defineMessages({
|
|
4
|
+
expandAriaLabel: {
|
|
5
|
+
id: 'neptune.Expander.expandAriaLabel',
|
|
6
|
+
defaultMessage: 'Expand',
|
|
7
|
+
description: 'Expand button for expander',
|
|
8
|
+
},
|
|
9
|
+
collapseAriaLabel: {
|
|
10
|
+
id: 'neptune.Expander.collapseAriaLabel',
|
|
11
|
+
defaultMessage: 'Collapse',
|
|
12
|
+
description: 'Collapse button for expander',
|
|
13
|
+
},
|
|
14
|
+
});
|