@transferwise/components 0.0.0-experimental-4c97d70 → 0.0.0-experimental-a322f91
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 +2 -1
- package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
- package/build/accordion/AccordionItem/AccordionItem.mjs +2 -1
- package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
- package/build/actionButton/ActionButton.js +2 -1
- package/build/actionButton/ActionButton.js.map +1 -1
- package/build/actionButton/ActionButton.mjs +2 -1
- package/build/actionButton/ActionButton.mjs.map +1 -1
- package/build/actionOption/ActionOption.js +2 -1
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs +2 -1
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/alert/Alert.js +2 -1
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +2 -1
- package/build/alert/Alert.mjs.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.js +2 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs +2 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
- package/build/avatar/Avatar.js +2 -1
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs +2 -1
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatarLayout/AvatarLayout.js +1 -1
- package/build/avatarLayout/AvatarLayout.mjs +1 -1
- package/build/avatarView/AvatarView.js +2 -1
- package/build/avatarView/AvatarView.js.map +1 -1
- package/build/avatarView/AvatarView.mjs +2 -1
- package/build/avatarView/AvatarView.mjs.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.js +2 -1
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs +2 -1
- package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
- package/build/badge/Badge.js +2 -1
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs +2 -1
- package/build/badge/Badge.mjs.map +1 -1
- package/build/badge/BadgeAssets.js +2 -1
- package/build/badge/BadgeAssets.js.map +1 -1
- package/build/badge/BadgeAssets.mjs +2 -1
- package/build/badge/BadgeAssets.mjs.map +1 -1
- package/build/button/Button.js +2 -1
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +2 -1
- package/build/button/Button.mjs.map +1 -1
- package/build/button/LegacyButton.js +2 -1
- package/build/button/LegacyButton.js.map +1 -1
- package/build/button/LegacyButton.mjs +2 -1
- package/build/button/LegacyButton.mjs.map +1 -1
- package/build/button/classMap.js +2 -1
- package/build/button/classMap.js.map +1 -1
- package/build/button/classMap.mjs +2 -1
- package/build/button/classMap.mjs.map +1 -1
- package/build/button/legacyUtils/legacyUtils.js +2 -1
- package/build/button/legacyUtils/legacyUtils.js.map +1 -1
- package/build/button/legacyUtils/legacyUtils.mjs +2 -1
- package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
- package/build/card/Card.js +2 -1
- package/build/card/Card.js.map +1 -1
- package/build/card/Card.mjs +2 -1
- package/build/card/Card.mjs.map +1 -1
- package/build/checkbox/Checkbox.js +2 -1
- package/build/checkbox/Checkbox.js.map +1 -1
- package/build/checkbox/Checkbox.mjs +2 -1
- package/build/checkbox/Checkbox.mjs.map +1 -1
- package/build/chevron/Chevron.js +2 -1
- package/build/chevron/Chevron.js.map +1 -1
- package/build/chevron/Chevron.mjs +2 -1
- package/build/chevron/Chevron.mjs.map +1 -1
- package/build/chips/Chip.js +2 -1
- package/build/chips/Chip.js.map +1 -1
- package/build/chips/Chip.mjs +2 -1
- package/build/chips/Chip.mjs.map +1 -1
- package/build/circularButton/CircularButton.js +3 -2
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +3 -2
- package/build/circularButton/CircularButton.mjs.map +1 -1
- package/build/common/bottomSheet/BottomSheet.js +2 -2
- package/build/common/bottomSheet/BottomSheet.js.map +1 -1
- package/build/common/bottomSheet/BottomSheet.mjs +2 -2
- package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
- package/build/common/circle/Circle.js +2 -2
- package/build/common/circle/Circle.js.map +1 -1
- package/build/common/circle/Circle.mjs +2 -2
- package/build/common/circle/Circle.mjs.map +1 -1
- package/build/common/hooks/useLayout/useLayout.js +6 -6
- package/build/common/hooks/useLayout/useLayout.js.map +1 -1
- package/build/common/hooks/useLayout/useLayout.mjs +1 -1
- package/build/common/hooks/useLayout/useLayout.mjs.map +1 -1
- package/build/common/hooks/useScreenSize.js.map +1 -1
- package/build/common/hooks/useScreenSize.mjs.map +1 -1
- package/build/common/locale/index.js +9 -4
- package/build/common/locale/index.js.map +1 -1
- package/build/common/locale/index.mjs +9 -4
- package/build/common/locale/index.mjs.map +1 -1
- package/build/common/panel/Panel.js +51 -55
- package/build/common/panel/Panel.js.map +1 -1
- package/build/common/panel/Panel.mjs +56 -60
- package/build/common/panel/Panel.mjs.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.js +2 -1
- package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs +2 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +2 -1
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +2 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/dateInput/DateInput.js +2 -2
- package/build/dateInput/DateInput.mjs +2 -2
- package/build/dateLookup/DateLookup.js +3 -3
- package/build/dateLookup/DateLookup.js.map +1 -1
- package/build/dateLookup/DateLookup.mjs +2 -2
- package/build/dateLookup/DateLookup.mjs.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.js +2 -1
- package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs +2 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.js +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.mjs +1 -1
- package/build/decision/Decision.js +4 -3
- package/build/decision/Decision.js.map +1 -1
- package/build/decision/Decision.mjs +2 -1
- package/build/decision/Decision.mjs.map +1 -1
- package/build/definitionList/DefinitionList.js +2 -1
- package/build/definitionList/DefinitionList.js.map +1 -1
- package/build/definitionList/DefinitionList.mjs +2 -1
- package/build/definitionList/DefinitionList.mjs.map +1 -1
- package/build/dimmer/Dimmer.js +2 -1
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/Dimmer.mjs +2 -1
- package/build/dimmer/Dimmer.mjs.map +1 -1
- package/build/display/Display.js +2 -1
- package/build/display/Display.js.map +1 -1
- package/build/display/Display.mjs +2 -1
- package/build/display/Display.mjs.map +1 -1
- package/build/drawer/Drawer.js +2 -1
- package/build/drawer/Drawer.js.map +1 -1
- package/build/drawer/Drawer.mjs +2 -1
- package/build/drawer/Drawer.mjs.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +5 -4
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +5 -4
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
- package/build/field/Field.js +6 -6
- package/build/field/Field.mjs +6 -6
- package/build/flowNavigation/FlowNavigation.js +4 -3
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs +2 -1
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/header/Header.js +2 -1
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs +2 -1
- package/build/header/Header.mjs.map +1 -1
- package/build/i18n/en.json +0 -2
- package/build/i18n/en.json.js +0 -2
- package/build/i18n/en.json.js.map +1 -1
- package/build/i18n/en.json.mjs +0 -2
- package/build/i18n/en.json.mjs.map +1 -1
- package/build/image/Image.js +1 -1
- package/build/image/Image.mjs +1 -1
- package/build/index.js +2 -4
- package/build/index.js.map +1 -1
- package/build/index.mjs +1 -2
- package/build/index.mjs.map +1 -1
- package/build/info/Info.js +2 -1
- package/build/info/Info.js.map +1 -1
- package/build/info/Info.mjs +2 -1
- package/build/info/Info.mjs.map +1 -1
- package/build/inlineAlert/InlineAlert.js +2 -1
- package/build/inlineAlert/InlineAlert.js.map +1 -1
- package/build/inlineAlert/InlineAlert.mjs +2 -1
- package/build/inlineAlert/InlineAlert.mjs.map +1 -1
- package/build/inputs/SearchInput.js +2 -1
- package/build/inputs/SearchInput.js.map +1 -1
- package/build/inputs/SearchInput.mjs +2 -1
- package/build/inputs/SearchInput.mjs.map +1 -1
- package/build/inputs/SelectInput/SelectInput.js +2 -2
- package/build/inputs/SelectInput/SelectInput.js.map +1 -1
- package/build/inputs/SelectInput/SelectInput.mjs +1 -1
- package/build/inputs/SelectInput/SelectInput.mjs.map +1 -1
- package/build/instructionsList/InstructionsList.js +2 -1
- package/build/instructionsList/InstructionsList.js.map +1 -1
- package/build/instructionsList/InstructionsList.mjs +2 -1
- package/build/instructionsList/InstructionsList.mjs.map +1 -1
- package/build/link/Link.js +2 -1
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.mjs +2 -1
- package/build/link/Link.mjs.map +1 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +2 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +1 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +2 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +1 -1
- package/build/listItem/ListItem.js +2 -1
- package/build/listItem/ListItem.js.map +1 -1
- package/build/listItem/ListItem.mjs +2 -1
- package/build/listItem/ListItem.mjs.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js +6 -6
- package/build/listItem/Prompt/ListItemPrompt.mjs +6 -6
- package/build/loader/Loader.js +2 -1
- package/build/loader/Loader.js.map +1 -1
- package/build/loader/Loader.mjs +2 -1
- package/build/loader/Loader.mjs.map +1 -1
- package/build/logo/Logo.js +1 -1
- package/build/logo/Logo.js.map +1 -1
- package/build/logo/Logo.mjs +1 -1
- package/build/logo/Logo.mjs.map +1 -1
- package/build/main.css +351 -418
- package/build/markdown/Markdown.js +2 -1
- package/build/markdown/Markdown.js.map +1 -1
- package/build/markdown/Markdown.mjs +2 -1
- package/build/markdown/Markdown.mjs.map +1 -1
- package/build/modal/Modal.js +2 -1
- package/build/modal/Modal.js.map +1 -1
- package/build/modal/Modal.mjs +2 -1
- package/build/modal/Modal.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.js +29 -13
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +31 -15
- package/build/moneyInput/MoneyInput.mjs.map +1 -1
- package/build/moneyInput/currencyFormatting.js +8 -2
- package/build/moneyInput/currencyFormatting.js.map +1 -1
- package/build/moneyInput/currencyFormatting.mjs +5 -4
- package/build/moneyInput/currencyFormatting.mjs.map +1 -1
- package/build/navigationOption/NavigationOption.js +2 -1
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOption/NavigationOption.mjs +2 -1
- package/build/navigationOption/NavigationOption.mjs.map +1 -1
- package/build/nudge/Nudge.js +2 -1
- package/build/nudge/Nudge.js.map +1 -1
- package/build/nudge/Nudge.mjs +2 -1
- package/build/nudge/Nudge.mjs.map +1 -1
- package/build/overlayHeader/OverlayHeader.js +2 -1
- package/build/overlayHeader/OverlayHeader.js.map +1 -1
- package/build/overlayHeader/OverlayHeader.mjs +2 -1
- package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +2 -1
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +2 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/popover/Popover.js +2 -1
- package/build/popover/Popover.js.map +1 -1
- package/build/popover/Popover.mjs +2 -1
- package/build/popover/Popover.mjs.map +1 -1
- package/build/processIndicator/ProcessIndicator.js +2 -1
- package/build/processIndicator/ProcessIndicator.js.map +1 -1
- package/build/processIndicator/ProcessIndicator.mjs +2 -1
- package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
- package/build/progressBar/ProgressBar.js +2 -1
- package/build/progressBar/ProgressBar.js.map +1 -1
- package/build/progressBar/ProgressBar.mjs +2 -1
- package/build/progressBar/ProgressBar.mjs.map +1 -1
- package/build/promoCard/PromoCard.js +2 -1
- package/build/promoCard/PromoCard.js.map +1 -1
- package/build/promoCard/PromoCard.mjs +2 -1
- package/build/promoCard/PromoCard.mjs.map +1 -1
- package/build/promoCard/PromoCardIndicator.js +2 -1
- package/build/promoCard/PromoCardIndicator.js.map +1 -1
- package/build/promoCard/PromoCardIndicator.mjs +2 -1
- package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.js +43 -10
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.mjs +42 -9
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.js +2 -1
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.mjs +2 -1
- package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js +2 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +2 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js +0 -2
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs +0 -2
- package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
- package/build/provider/Provider.js +1 -1
- package/build/provider/Provider.mjs +1 -1
- package/build/radio/Radio.js +2 -1
- package/build/radio/Radio.js.map +1 -1
- package/build/radio/Radio.mjs +2 -1
- package/build/radio/Radio.mjs.map +1 -1
- package/build/segmentedControl/SegmentedControl.js +2 -1
- package/build/segmentedControl/SegmentedControl.js.map +1 -1
- package/build/segmentedControl/SegmentedControl.mjs +2 -1
- package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
- package/build/select/Select.js +3 -2
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +3 -2
- package/build/select/Select.mjs.map +1 -1
- package/build/select/option/Option.js +2 -1
- package/build/select/option/Option.js.map +1 -1
- package/build/select/option/Option.mjs +2 -1
- package/build/select/option/Option.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js +3 -2
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +3 -2
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/stepper/Stepper.js +2 -1
- package/build/stepper/Stepper.js.map +1 -1
- package/build/stepper/Stepper.mjs +2 -1
- package/build/stepper/Stepper.mjs.map +1 -1
- package/build/sticky/Sticky.js +2 -1
- package/build/sticky/Sticky.js.map +1 -1
- package/build/sticky/Sticky.mjs +2 -1
- package/build/sticky/Sticky.mjs.map +1 -1
- package/build/styles/accordion/Accordion.css +1 -1
- package/build/styles/card/Card.css +2 -2
- package/build/styles/carousel/Carousel.css +5 -5
- package/build/styles/common/Option/Option.css +1 -1
- package/build/styles/common/baseCard/BaseCard.css +1 -1
- package/build/styles/criticalBanner/CriticalCommsBanner.css +1 -1
- package/build/styles/css/accordion.css +4 -4
- package/build/styles/css/button-groups.css +6 -6
- package/build/styles/css/buttons.css +1 -1
- package/build/styles/css/circles.css +1 -1
- package/build/styles/css/column-layout.css +4 -4
- package/build/styles/css/decision.css +4 -4
- package/build/styles/css/dropdowns.css +10 -10
- package/build/styles/css/droppable.css +8 -8
- package/build/styles/css/flex.css +14 -14
- package/build/styles/css/footer.css +3 -3
- package/build/styles/css/grid.css +19 -19
- package/build/styles/css/input-groups.css +12 -12
- package/build/styles/css/list-group.css +8 -8
- package/build/styles/css/modals.css +3 -3
- package/build/styles/css/navbar.css +62 -62
- package/build/styles/css/navs.css +2 -2
- package/build/styles/css/neptune.css +280 -269
- package/build/styles/css/panels.css +9 -9
- package/build/styles/css/popovers.css +13 -13
- package/build/styles/css/select.css +1 -1
- package/build/styles/css/sequences.css +6 -6
- package/build/styles/css/table.css +6 -6
- package/build/styles/css/utilities.css +4 -4
- package/build/styles/css/wells.css +4 -4
- package/build/styles/dateInput/DateInput.css +1 -1
- package/build/styles/definitionList/DefinitionList.css +2 -2
- package/build/styles/drawer/Drawer.css +1 -1
- package/build/styles/inputs/Input.css +3 -3
- package/build/styles/inputs/SelectInput/Options/SelectInputOptions.css +2 -2
- package/build/styles/inputs/SelectInput/SelectInput.css +2 -2
- package/build/styles/inputs/TextArea.css +3 -3
- package/build/styles/less/legacy-variables.less +34 -47
- package/build/styles/less/neptune-tokens.less +5 -4
- package/build/styles/logo/Logo.css +2 -2
- package/build/styles/main.css +351 -418
- package/build/styles/modal/Modal.css +5 -5
- package/build/styles/popover/Popover.css +3 -3
- package/build/styles/promoCard/PromoCard.css +1 -1
- package/build/styles/prompt/ActionPrompt/ActionPrompt.css +1 -1
- package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -1
- package/build/styles/props/custom-media.css +23 -11
- package/build/styles/props/neptune-tokens.css +3 -2
- package/build/styles/select/Select.css +2 -1
- package/build/styles/snackbar/Snackbar.css +2 -2
- package/build/styles/stepper/Stepper.css +2 -2
- package/build/styles/styles/less/accordion.css +4 -4
- package/build/styles/styles/less/button-groups.css +6 -6
- package/build/styles/styles/less/buttons.css +1 -1
- package/build/styles/styles/less/circles.css +1 -1
- package/build/styles/styles/less/column-layout.css +4 -4
- package/build/styles/styles/less/decision.css +4 -4
- package/build/styles/styles/less/dropdowns.css +10 -10
- package/build/styles/styles/less/droppable.css +8 -8
- package/build/styles/styles/less/flex.css +14 -14
- package/build/styles/styles/less/footer.css +3 -3
- package/build/styles/styles/less/forms/bootstrap-forms.css +9 -9
- package/build/styles/styles/less/grid.css +19 -19
- package/build/styles/styles/less/input-groups.css +12 -12
- package/build/styles/styles/less/list-group.css +8 -8
- package/build/styles/styles/less/modals.css +3 -3
- package/build/styles/styles/less/navbar.css +62 -62
- package/build/styles/styles/less/navs.css +2 -2
- package/build/styles/styles/less/neptune.css +280 -269
- package/build/styles/styles/less/panels.css +9 -9
- package/build/styles/styles/less/popovers.css +13 -13
- package/build/styles/styles/less/select.css +1 -1
- package/build/styles/styles/less/sequences.css +6 -6
- package/build/styles/styles/less/table.css +6 -6
- package/build/styles/styles/less/utilities.css +4 -4
- package/build/styles/styles/less/wells.css +4 -4
- package/build/styles/styles/props/custom-media.css +1 -11
- package/build/styles/table/Table.css +1 -1
- package/build/styles/tabs/Tabs.css +2 -2
- package/build/styles/typeahead/Typeahead.css +1 -1
- package/build/summary/Summary.js +2 -1
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.mjs +2 -1
- package/build/summary/Summary.mjs.map +1 -1
- package/build/table/Table.js +2 -1
- package/build/table/Table.js.map +1 -1
- package/build/table/Table.mjs +2 -1
- package/build/table/Table.mjs.map +1 -1
- package/build/table/TableRow.js +2 -1
- package/build/table/TableRow.js.map +1 -1
- package/build/table/TableRow.mjs +2 -1
- package/build/table/TableRow.mjs.map +1 -1
- package/build/table/TableStatusText.js +2 -1
- package/build/table/TableStatusText.js.map +1 -1
- package/build/table/TableStatusText.mjs +2 -1
- package/build/table/TableStatusText.mjs.map +1 -1
- package/build/tabs/Tabs.js +2 -1
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +2 -1
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/tile/Tile.js +2 -1
- package/build/tile/Tile.js.map +1 -1
- package/build/tile/Tile.mjs +2 -1
- package/build/tile/Tile.mjs.map +1 -1
- package/build/title/Title.js +2 -1
- package/build/title/Title.js.map +1 -1
- package/build/title/Title.mjs +2 -1
- package/build/title/Title.mjs.map +1 -1
- package/build/tooltip/Tooltip.js +31 -51
- package/build/tooltip/Tooltip.js.map +1 -1
- package/build/tooltip/Tooltip.mjs +32 -52
- package/build/tooltip/Tooltip.mjs.map +1 -1
- package/build/typeahead/Typeahead.js +6 -6
- package/build/typeahead/Typeahead.mjs +6 -6
- package/build/types/badge/BadgeAssets.d.ts.map +1 -1
- package/build/types/circularButton/CircularButton.d.ts.map +1 -1
- package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
- package/build/types/common/hooks/useScreenSize.d.ts +1 -1
- package/build/types/common/hooks/useScreenSize.d.ts.map +1 -1
- package/build/types/common/index.d.ts +1 -1
- package/build/types/common/index.d.ts.map +1 -1
- 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/dateLookup/DateLookup.d.ts.map +1 -1
- package/build/types/decision/Decision.d.ts.map +1 -1
- package/build/types/expressiveMoneyInput/currencySelector/CurrencySelector.d.ts.map +1 -1
- package/build/types/flowNavigation/FlowNavigation.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/logo/Logo.d.ts +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts +6 -0
- package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
- package/build/types/moneyInput/currencyFormatting.d.ts +4 -3
- package/build/types/moneyInput/currencyFormatting.d.ts.map +1 -1
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +11 -2
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +3 -8
- package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
- package/build/types/prompt/index.d.ts +0 -2
- package/build/types/prompt/index.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/build/types/test-utils/index.d.ts +0 -4
- 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 +2 -1
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs +2 -1
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/completeStep/completeStep.js +2 -1
- package/build/upload/steps/completeStep/completeStep.js.map +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs +2 -1
- package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
- package/build/upload/steps/processingStep/processingStep.js +2 -1
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +2 -1
- package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +2 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +2 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js +2 -1
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +2 -1
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js +2 -1
- package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs +2 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
- package/build/uploadInput/uploadButton/defaults.js +2 -1
- package/build/uploadInput/uploadButton/defaults.js.map +1 -1
- package/build/uploadInput/uploadButton/defaults.mjs +2 -1
- package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +2 -1
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +2 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js +2 -1
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs +2 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +20 -22
- package/src/accordion/Accordion.css +1 -1
- package/src/avatarView/AvatarView.story.tsx +1 -1
- package/src/avatarView/AvatarView.test.story.tsx +108 -1
- package/src/badge/BadgeAssets.tsx +2 -0
- package/src/card/Card.css +2 -2
- package/src/carousel/Carousel.css +5 -5
- package/src/circularButton/CircularButton.tsx +3 -2
- package/src/common/Option/Option.css +1 -1
- package/src/common/baseCard/BaseCard.css +1 -1
- package/src/common/bottomSheet/BottomSheet.tsx +2 -2
- package/src/common/circle/Circle.tsx +2 -2
- package/src/common/hooks/useLayout/useLayout.ts +1 -1
- package/src/common/hooks/useScreenSize.ts +1 -1
- package/src/common/index.ts +1 -1
- package/src/common/locale/index.test.ts +13 -4
- package/src/common/locale/index.ts +9 -3
- package/src/common/panel/Panel.tsx +56 -49
- package/src/common/responsivePanel/ResponsivePanel.test.js +3 -2
- package/src/criticalBanner/CriticalCommsBanner.css +1 -1
- package/src/dateInput/DateInput.css +1 -1
- package/src/dateLookup/DateLookup.tsx +1 -1
- package/src/decision/Decision.test.tsx +2 -1
- package/src/decision/Decision.tsx +2 -1
- package/src/definitionList/DefinitionList.css +2 -2
- package/src/definitionList/DefinitionList.less +2 -2
- package/src/drawer/Drawer.css +1 -1
- package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +18 -0
- package/src/expressiveMoneyInput/currencySelector/CurrencySelector.test.tsx +119 -1
- package/src/expressiveMoneyInput/currencySelector/CurrencySelector.tsx +4 -3
- package/src/flowNavigation/FlowNavigation.test.js +1 -1
- package/src/flowNavigation/FlowNavigation.tsx +2 -1
- package/src/i18n/en.json +0 -2
- package/src/index.ts +3 -3
- package/src/inputs/Input.css +3 -3
- package/src/inputs/SelectInput/Options/SelectInputOptions.css +2 -2
- package/src/inputs/SelectInput/SelectInput.css +2 -2
- package/src/inputs/SelectInput/SelectInput.tsx +1 -1
- package/src/inputs/TextArea.css +3 -3
- package/src/logo/Logo.css +2 -2
- package/src/logo/Logo.story.tsx +3 -3
- package/src/logo/Logo.tsx +1 -1
- package/src/main.css +351 -418
- package/src/main.less +1 -3
- package/src/modal/Modal.css +5 -5
- package/src/moneyInput/MoneyInput.story.tsx +10 -1
- package/src/moneyInput/MoneyInput.test.story.tsx +141 -1
- package/src/moneyInput/MoneyInput.test.tsx +45 -0
- package/src/moneyInput/MoneyInput.tsx +27 -3
- package/src/moneyInput/currencyFormatting.ts +11 -5
- package/src/popover/Popover.css +3 -3
- package/src/popover/Popover.test.tsx +2 -1
- package/src/promoCard/PromoCard.css +1 -1
- package/src/prompt/ActionPrompt/ActionPrompt.css +1 -1
- package/src/prompt/ActionPrompt/ActionPrompt.test.tsx +3 -3
- package/src/prompt/ActionPrompt/ActionPrompt.tsx +64 -10
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -1
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +2 -9
- package/src/prompt/index.ts +0 -4
- package/src/section/Section.story.tsx +2 -8
- package/src/select/Select.css +2 -1
- package/src/select/Select.less +6 -5
- package/src/select/Select.test.story.tsx +59 -0
- package/src/select/Select.test.tsx +1 -1
- package/src/select/Select.tsx +1 -1
- package/src/sentimentSurface/SentimentSurface.story.tsx +17 -43
- package/src/snackbar/Snackbar.css +2 -2
- package/src/statusIcon/StatusIcon.test.tsx +0 -2
- package/src/statusIcon/StatusIcon.tsx +3 -2
- package/src/stepper/Stepper.css +2 -2
- package/src/styles/less/accordion.css +4 -4
- package/src/styles/less/button-groups.css +6 -6
- package/src/styles/less/buttons.css +1 -1
- package/src/styles/less/circles.css +1 -1
- package/src/styles/less/column-layout.css +4 -4
- package/src/styles/less/decision.css +4 -4
- package/src/styles/less/dropdowns.css +10 -10
- package/src/styles/less/droppable.css +8 -8
- package/src/styles/less/flex.css +14 -14
- package/src/styles/less/footer.css +3 -3
- package/src/styles/less/forms/bootstrap-forms.css +9 -9
- package/src/styles/less/forms/bootstrap-forms.less +1 -1
- package/src/styles/less/grid.css +19 -19
- package/src/styles/less/input-groups.css +12 -12
- package/src/styles/less/list-group.css +8 -8
- package/src/styles/less/modals.css +3 -3
- package/src/styles/less/navbar.css +62 -62
- package/src/styles/less/navbar.less +2 -2
- package/src/styles/less/navs.css +2 -2
- package/src/styles/less/neptune.bundle.less +1 -0
- package/src/styles/less/neptune.css +280 -269
- package/src/styles/less/panels.css +9 -9
- package/src/styles/less/popovers.css +13 -13
- package/src/styles/less/select.css +1 -1
- package/src/styles/less/sequences.css +6 -6
- package/src/styles/less/table.css +6 -6
- package/src/styles/less/table.less +1 -1
- package/src/styles/less/utilities.css +4 -4
- package/src/styles/less/wells.css +4 -4
- package/src/styles/props/custom-media.css +1 -11
- package/src/styles/variables/legacy-variables.less +4 -47
- package/src/table/Table.css +1 -1
- package/src/tabs/Tabs.css +2 -2
- package/src/tooltip/Tooltip.tsx +26 -45
- package/src/typeahead/Typeahead.css +1 -1
- package/build/common/propsValues/breakpoint.js +0 -12
- package/build/common/propsValues/breakpoint.js.map +0 -1
- package/build/common/propsValues/breakpoint.mjs +0 -12
- package/build/common/propsValues/breakpoint.mjs.map +0 -1
- package/build/prompt/CriticalBanner/CriticalBanner.js +0 -143
- package/build/prompt/CriticalBanner/CriticalBanner.js.map +0 -1
- package/build/prompt/CriticalBanner/CriticalBanner.mjs +0 -141
- package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +0 -1
- package/build/prompt/CriticalBanner/helpers.js +0 -29
- package/build/prompt/CriticalBanner/helpers.js.map +0 -1
- package/build/prompt/CriticalBanner/helpers.mjs +0 -26
- package/build/prompt/CriticalBanner/helpers.mjs.map +0 -1
- package/build/prompt/common/Expander/Expander.js +0 -47
- package/build/prompt/common/Expander/Expander.js.map +0 -1
- package/build/prompt/common/Expander/Expander.messages.js +0 -17
- package/build/prompt/common/Expander/Expander.messages.js.map +0 -1
- package/build/prompt/common/Expander/Expander.messages.mjs +0 -13
- package/build/prompt/common/Expander/Expander.messages.mjs.map +0 -1
- package/build/prompt/common/Expander/Expander.mjs +0 -44
- package/build/prompt/common/Expander/Expander.mjs.map +0 -1
- package/build/prompt/helpers/promptMedia.js +0 -52
- package/build/prompt/helpers/promptMedia.js.map +0 -1
- package/build/prompt/helpers/promptMedia.mjs +0 -50
- package/build/prompt/helpers/promptMedia.mjs.map +0 -1
- package/build/styles/prompt/CriticalBanner/CriticalBanner.css +0 -59
- package/build/styles/prompt/common/Expander/Expander.css +0 -8
- package/build/types/common/propsValues/breakpoint.d.ts +0 -9
- package/build/types/common/propsValues/breakpoint.d.ts.map +0 -1
- package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts +0 -33
- package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts.map +0 -1
- package/build/types/prompt/CriticalBanner/helpers.d.ts +0 -18
- package/build/types/prompt/CriticalBanner/helpers.d.ts.map +0 -1
- package/build/types/prompt/CriticalBanner/index.d.ts +0 -3
- package/build/types/prompt/CriticalBanner/index.d.ts.map +0 -1
- package/build/types/prompt/common/Expander/Expander.d.ts +0 -20
- package/build/types/prompt/common/Expander/Expander.d.ts.map +0 -1
- package/build/types/prompt/common/Expander/Expander.messages.d.ts +0 -14
- package/build/types/prompt/common/Expander/Expander.messages.d.ts.map +0 -1
- package/build/types/prompt/helpers/promptMedia.d.ts +0 -22
- package/build/types/prompt/helpers/promptMedia.d.ts.map +0 -1
- package/src/common/propsValues/breakpoint.ts +0 -8
- package/src/prompt/CriticalBanner/CriticalBanner.accessibility.docs.mdx +0 -113
- package/src/prompt/CriticalBanner/CriticalBanner.css +0 -59
- package/src/prompt/CriticalBanner/CriticalBanner.less +0 -64
- package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +0 -632
- package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +0 -285
- package/src/prompt/CriticalBanner/CriticalBanner.tsx +0 -182
- package/src/prompt/CriticalBanner/helpers.ts +0 -39
- package/src/prompt/CriticalBanner/index.ts +0 -2
- package/src/prompt/common/Expander/Expander.css +0 -8
- package/src/prompt/common/Expander/Expander.less +0 -9
- package/src/prompt/common/Expander/Expander.messages.ts +0 -14
- package/src/prompt/common/Expander/Expander.test.tsx +0 -167
- package/src/prompt/common/Expander/Expander.tsx +0 -83
- package/src/prompt/helpers/promptMedia.tsx +0 -79
|
@@ -1,285 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,182 +0,0 @@
|
|
|
1
|
-
import { 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
|
-
} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid'>;
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* A full-width, non-dismissible banner for critical messages such as account blocks or
|
|
38
|
-
* time-sensitive actions that require immediate user attention.
|
|
39
|
-
|
|
40
|
-
* @see {@link https://wise.design/components/critical-banner Design Spec}
|
|
41
|
-
*/
|
|
42
|
-
export const CriticalBanner = ({
|
|
43
|
-
sentiment = 'negative',
|
|
44
|
-
title,
|
|
45
|
-
description,
|
|
46
|
-
media = {},
|
|
47
|
-
action,
|
|
48
|
-
actionSecondary,
|
|
49
|
-
expanded = true,
|
|
50
|
-
onToggle,
|
|
51
|
-
id,
|
|
52
|
-
className,
|
|
53
|
-
'data-testid': testId,
|
|
54
|
-
}: CriticalBannerProps) => {
|
|
55
|
-
const isMobile = !useScreenSize(Breakpoint.EXTRA_SMALL);
|
|
56
|
-
const resolvedExpanded = !isMobile || expanded;
|
|
57
|
-
const hasActions = action ?? actionSecondary;
|
|
58
|
-
const mediaId = useId();
|
|
59
|
-
const titleId = useId();
|
|
60
|
-
const descId = useId();
|
|
61
|
-
|
|
62
|
-
const ariaLabelledByIds = [
|
|
63
|
-
media['aria-hidden'] ? undefined : mediaId,
|
|
64
|
-
!title ? undefined : titleId,
|
|
65
|
-
]
|
|
66
|
-
.filter(Boolean)
|
|
67
|
-
.join(' ');
|
|
68
|
-
|
|
69
|
-
return (
|
|
70
|
-
<LiveRegion
|
|
71
|
-
aria-live="assertive"
|
|
72
|
-
announceOnChange={buildAnnouncementString({
|
|
73
|
-
title,
|
|
74
|
-
description,
|
|
75
|
-
expanded: resolvedExpanded,
|
|
76
|
-
actionLabel: action?.label,
|
|
77
|
-
actionSecondaryLabel: actionSecondary?.label,
|
|
78
|
-
})}
|
|
79
|
-
>
|
|
80
|
-
<PrimitivePrompt
|
|
81
|
-
id={id}
|
|
82
|
-
sentiment={sentiment}
|
|
83
|
-
emphasis={sentiment === 'neutral' ? 'base' : 'elevated'}
|
|
84
|
-
data-testid={testId}
|
|
85
|
-
className={clsx(
|
|
86
|
-
'wds-critical-banner',
|
|
87
|
-
{
|
|
88
|
-
'wds-critical-banner__mobile--collapsed': !resolvedExpanded,
|
|
89
|
-
'wds-critical-banner--with-two-actions': !!actionSecondary,
|
|
90
|
-
},
|
|
91
|
-
className,
|
|
92
|
-
)}
|
|
93
|
-
media={renderPromptMedia({
|
|
94
|
-
media,
|
|
95
|
-
sentiment,
|
|
96
|
-
mediaId,
|
|
97
|
-
imgClassName: 'wds-critical-banner--media-image',
|
|
98
|
-
})}
|
|
99
|
-
actions={
|
|
100
|
-
shouldShowWhenExpanded({ expanded: resolvedExpanded, hasContent: !!hasActions }) ? (
|
|
101
|
-
<>
|
|
102
|
-
{actionSecondary && (
|
|
103
|
-
// @ts-expect-error onClick type mismatch
|
|
104
|
-
<Button
|
|
105
|
-
v2
|
|
106
|
-
size="md"
|
|
107
|
-
priority="secondary"
|
|
108
|
-
href={actionSecondary.href}
|
|
109
|
-
block={isMobile}
|
|
110
|
-
onClick={actionSecondary?.onClick}
|
|
111
|
-
>
|
|
112
|
-
{actionSecondary.label}
|
|
113
|
-
</Button>
|
|
114
|
-
)}
|
|
115
|
-
{action && (
|
|
116
|
-
// @ts-expect-error onClick type mismatch
|
|
117
|
-
<Button
|
|
118
|
-
v2
|
|
119
|
-
size="md"
|
|
120
|
-
priority="primary"
|
|
121
|
-
href={action.href}
|
|
122
|
-
block={isMobile}
|
|
123
|
-
onClick={action.onClick}
|
|
124
|
-
>
|
|
125
|
-
{action.label}
|
|
126
|
-
</Button>
|
|
127
|
-
)}
|
|
128
|
-
</>
|
|
129
|
-
) : undefined
|
|
130
|
-
}
|
|
131
|
-
role="region"
|
|
132
|
-
aria-labelledby={ariaLabelledByIds}
|
|
133
|
-
aria-describedby={descId}
|
|
134
|
-
>
|
|
135
|
-
<div
|
|
136
|
-
className={clsx(
|
|
137
|
-
'd-flex',
|
|
138
|
-
'flex-column',
|
|
139
|
-
'justify-content-center',
|
|
140
|
-
'wds-critical-banner__text-wrapper',
|
|
141
|
-
)}
|
|
142
|
-
>
|
|
143
|
-
{title && (
|
|
144
|
-
<Body
|
|
145
|
-
id={titleId}
|
|
146
|
-
type={Typography.BODY_LARGE_BOLD}
|
|
147
|
-
className={clsx('wds-critical-banner__content', {
|
|
148
|
-
'wds-critical-banner__title--collapsed': !resolvedExpanded,
|
|
149
|
-
})}
|
|
150
|
-
>
|
|
151
|
-
{title}
|
|
152
|
-
</Body>
|
|
153
|
-
)}
|
|
154
|
-
{shouldShowWhenExpanded({
|
|
155
|
-
expanded: resolvedExpanded,
|
|
156
|
-
hasContent: !!description,
|
|
157
|
-
alwaysShow: !title,
|
|
158
|
-
}) && (
|
|
159
|
-
<Body
|
|
160
|
-
id={descId}
|
|
161
|
-
className={clsx('wds-critical-banner__content', {
|
|
162
|
-
'wds-critical-banner__description--collapsed': !resolvedExpanded && !title,
|
|
163
|
-
})}
|
|
164
|
-
>
|
|
165
|
-
{description}
|
|
166
|
-
</Body>
|
|
167
|
-
)}
|
|
168
|
-
</div>
|
|
169
|
-
{isMobile && (
|
|
170
|
-
<ExpanderToggle
|
|
171
|
-
expanded={expanded}
|
|
172
|
-
size={24}
|
|
173
|
-
className="wds-critical-banner__toggle"
|
|
174
|
-
onToggle={onToggle}
|
|
175
|
-
/>
|
|
176
|
-
)}
|
|
177
|
-
</PrimitivePrompt>
|
|
178
|
-
</LiveRegion>
|
|
179
|
-
);
|
|
180
|
-
};
|
|
181
|
-
|
|
182
|
-
export default CriticalBanner;
|
|
@@ -1,39 +0,0 @@
|
|
|
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,14 +0,0 @@
|
|
|
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
|
-
});
|