@transferwise/components 0.0.0-experimental-9050641 → 0.0.0-experimental-ce05ccb
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 +1 -1
- package/build/accordion/AccordionItem/AccordionItem.mjs +1 -1
- package/build/actionButton/ActionButton.js +1 -1
- package/build/actionButton/ActionButton.mjs +1 -1
- package/build/actionOption/ActionOption.js +1 -1
- package/build/actionOption/ActionOption.mjs +1 -1
- package/build/alert/Alert.js +1 -1
- package/build/alert/Alert.mjs +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.js +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs +1 -1
- package/build/avatar/Avatar.js +1 -1
- package/build/avatar/Avatar.mjs +1 -1
- package/build/avatarLayout/AvatarLayout.js +1 -1
- package/build/avatarLayout/AvatarLayout.mjs +1 -1
- package/build/avatarView/AvatarView.js +1 -1
- package/build/avatarView/AvatarView.mjs +1 -1
- package/build/avatarWrapper/AvatarWrapper.js +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs +1 -1
- package/build/badge/Badge.js +1 -1
- package/build/badge/Badge.mjs +1 -1
- package/build/button/Button.js +1 -1
- package/build/button/Button.mjs +1 -1
- package/build/button/LegacyButton.js +1 -1
- package/build/button/LegacyButton.mjs +1 -1
- package/build/button/classMap.js +1 -1
- package/build/button/classMap.mjs +1 -1
- package/build/button/legacyUtils/legacyUtils.js +1 -1
- package/build/button/legacyUtils/legacyUtils.mjs +1 -1
- package/build/card/Card.js +1 -1
- package/build/card/Card.mjs +1 -1
- package/build/checkbox/Checkbox.js +1 -1
- package/build/checkbox/Checkbox.mjs +1 -1
- package/build/chevron/Chevron.js +1 -1
- package/build/chevron/Chevron.mjs +1 -1
- package/build/chips/Chip.js +1 -1
- package/build/chips/Chip.mjs +1 -1
- package/build/circularButton/CircularButton.js +2 -2
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +2 -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/panel/Panel.js +1 -1
- package/build/common/panel/Panel.mjs +1 -1
- package/build/common/propsValues/breakpoint.js +12 -0
- package/build/common/propsValues/breakpoint.js.map +1 -0
- package/build/common/propsValues/breakpoint.mjs +12 -0
- package/build/common/propsValues/breakpoint.mjs.map +1 -0
- package/build/common/responsivePanel/ResponsivePanel.js +1 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +1 -1
- package/build/dateInput/DateInput.js +1 -1
- package/build/dateInput/DateInput.mjs +1 -1
- package/build/dateLookup/DateLookup.js +2 -2
- package/build/dateLookup/DateLookup.js.map +1 -1
- package/build/dateLookup/DateLookup.mjs +1 -1
- package/build/dateLookup/DateLookup.mjs.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.js +1 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.js +1 -1
- package/build/dateLookup/dateTrigger/DateTrigger.mjs +1 -1
- package/build/decision/Decision.js +3 -3
- package/build/decision/Decision.js.map +1 -1
- package/build/decision/Decision.mjs +1 -1
- package/build/decision/Decision.mjs.map +1 -1
- package/build/definitionList/DefinitionList.js +1 -1
- package/build/definitionList/DefinitionList.mjs +1 -1
- package/build/dimmer/Dimmer.js +1 -1
- package/build/dimmer/Dimmer.mjs +1 -1
- package/build/display/Display.js +1 -1
- package/build/display/Display.mjs +1 -1
- package/build/drawer/Drawer.js +1 -1
- package/build/drawer/Drawer.mjs +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +1 -1
- package/build/field/Field.js +1 -1
- package/build/field/Field.mjs +1 -1
- package/build/flowNavigation/FlowNavigation.js +3 -3
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs +1 -1
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/header/Header.js +1 -1
- package/build/header/Header.mjs +1 -1
- package/build/image/Image.js +1 -1
- package/build/image/Image.mjs +1 -1
- package/build/index.js +2 -2
- package/build/index.mjs +1 -1
- package/build/info/Info.js +1 -1
- package/build/info/Info.mjs +1 -1
- package/build/inlineAlert/InlineAlert.js +1 -1
- package/build/inlineAlert/InlineAlert.mjs +1 -1
- package/build/inputs/SearchInput.js +1 -1
- package/build/inputs/SearchInput.mjs +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 +1 -1
- package/build/instructionsList/InstructionsList.mjs +1 -1
- package/build/link/Link.js +1 -1
- package/build/link/Link.mjs +1 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +1 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +1 -1
- package/build/listItem/ListItem.js +1 -1
- package/build/listItem/ListItem.mjs +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js +1 -1
- package/build/listItem/Prompt/ListItemPrompt.mjs +1 -1
- package/build/loader/Loader.js +1 -1
- package/build/loader/Loader.mjs +1 -1
- package/build/logo/Logo.js +3 -3
- package/build/logo/Logo.js.map +1 -1
- package/build/logo/Logo.mjs +2 -2
- package/build/logo/Logo.mjs.map +1 -1
- package/build/main.css +477 -319
- package/build/markdown/Markdown.js +1 -1
- package/build/markdown/Markdown.mjs +1 -1
- package/build/modal/Modal.js +3 -3
- package/build/modal/Modal.js.map +1 -1
- package/build/modal/Modal.mjs +3 -3
- package/build/modal/Modal.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.js +1 -1
- package/build/moneyInput/MoneyInput.mjs +1 -1
- package/build/navigationOption/NavigationOption.js +1 -1
- package/build/navigationOption/NavigationOption.mjs +1 -1
- package/build/nudge/Nudge.js +1 -1
- package/build/nudge/Nudge.mjs +1 -1
- package/build/overlayHeader/OverlayHeader.js +1 -1
- package/build/overlayHeader/OverlayHeader.mjs +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +1 -1
- package/build/popover/Popover.js +1 -1
- package/build/popover/Popover.mjs +1 -1
- package/build/processIndicator/ProcessIndicator.js +1 -1
- package/build/processIndicator/ProcessIndicator.mjs +1 -1
- package/build/progressBar/ProgressBar.js +1 -1
- package/build/progressBar/ProgressBar.mjs +1 -1
- package/build/promoCard/PromoCard.js +1 -1
- package/build/promoCard/PromoCard.mjs +1 -1
- package/build/promoCard/PromoCardIndicator.js +1 -1
- package/build/promoCard/PromoCardIndicator.mjs +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.js +2 -2
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.mjs +2 -2
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
- package/build/prompt/CriticalBanner/CriticalBanner.js +83 -70
- package/build/prompt/CriticalBanner/CriticalBanner.js.map +1 -1
- package/build/prompt/CriticalBanner/CriticalBanner.mjs +83 -70
- package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.js +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.mjs +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +1 -1
- package/build/provider/Provider.js +1 -1
- package/build/provider/Provider.mjs +1 -1
- package/build/radio/Radio.js +1 -1
- package/build/radio/Radio.mjs +1 -1
- package/build/segmentedControl/SegmentedControl.js +1 -1
- package/build/segmentedControl/SegmentedControl.mjs +1 -1
- package/build/select/Select.js +1 -1
- package/build/select/Select.mjs +1 -1
- package/build/select/option/Option.js +1 -1
- package/build/select/option/Option.mjs +1 -1
- package/build/statusIcon/StatusIcon.js +2 -2
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +2 -2
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/stepper/Stepper.js +1 -1
- package/build/stepper/Stepper.mjs +1 -1
- package/build/sticky/Sticky.js +1 -1
- package/build/sticky/Sticky.mjs +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 +4 -2
- package/build/styles/common/baseCard/BaseCard.css +1 -1
- package/build/styles/container/Container.css +3 -3
- 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 +15 -13
- 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 +6 -6
- package/build/styles/css/navbar.css +62 -62
- package/build/styles/css/navs.css +2 -2
- package/build/styles/css/neptune.css +338 -270
- 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 +20 -8
- package/build/styles/css/wells.css +18 -4
- package/build/styles/dateInput/DateInput.css +1 -1
- package/build/styles/definitionList/DefinitionList.css +2 -2
- package/build/styles/drawer/Drawer.css +2 -2
- package/build/styles/flowNavigation/FlowNavigation.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 +47 -34
- package/build/styles/less/neptune-tokens.less +2 -2
- package/build/styles/main.css +477 -319
- package/build/styles/modal/Modal.css +20 -7
- package/build/styles/overlayHeader/OverlayHeader.css +1 -1
- 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/CriticalBanner/CriticalBanner.css +63 -1
- package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -1
- package/build/styles/props/custom-media.css +11 -23
- package/build/styles/props/neptune-tokens.css +1 -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 +15 -13
- 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 +6 -6
- 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 +338 -270
- 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 +20 -8
- package/build/styles/styles/less/wells.css +18 -4
- package/build/styles/styles/props/custom-media.css +11 -1
- 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 +1 -1
- package/build/summary/Summary.mjs +1 -1
- package/build/table/Table.js +1 -1
- package/build/table/Table.mjs +1 -1
- package/build/table/TableRow.js +1 -1
- package/build/table/TableRow.mjs +1 -1
- package/build/table/TableStatusText.js +1 -1
- package/build/table/TableStatusText.mjs +1 -1
- package/build/tabs/Tabs.js +1 -1
- package/build/tabs/Tabs.mjs +1 -1
- package/build/tile/Tile.js +1 -1
- package/build/tile/Tile.mjs +1 -1
- package/build/title/Title.js +1 -1
- package/build/title/Title.mjs +1 -1
- package/build/tooltip/Tooltip.js +1 -1
- package/build/tooltip/Tooltip.mjs +1 -1
- package/build/typeahead/Typeahead.js +1 -1
- package/build/typeahead/Typeahead.mjs +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/propsValues/breakpoint.d.ts +9 -0
- package/build/types/common/propsValues/breakpoint.d.ts.map +1 -0
- package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
- package/build/types/decision/Decision.d.ts.map +1 -1
- package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
- package/build/types/index.d.ts +1 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/logo/Logo.d.ts +1 -1
- package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
- package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts.map +1 -1
- package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
- package/build/upload/Upload.js +1 -1
- package/build/upload/Upload.mjs +1 -1
- package/build/upload/steps/completeStep/completeStep.js +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs +1 -1
- package/build/upload/steps/processingStep/processingStep.js +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +1 -1
- package/build/uploadInput/UploadInput.js +1 -1
- package/build/uploadInput/UploadInput.mjs +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js +1 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs +1 -1
- package/build/uploadInput/uploadButton/defaults.js +1 -1
- package/build/uploadInput/uploadButton/defaults.mjs +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs +1 -1
- package/package.json +3 -3
- package/src/accordion/Accordion.css +1 -1
- package/src/card/Card.css +2 -2
- package/src/carousel/Carousel.css +5 -5
- package/src/carousel/Carousel.less +3 -3
- package/src/circularButton/CircularButton.tsx +2 -3
- package/src/common/Option/Option.css +4 -2
- package/src/common/Option/Option.less +4 -2
- 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/propsValues/breakpoint.ts +8 -0
- package/src/common/responsivePanel/ResponsivePanel.test.js +2 -3
- package/src/container/Container.css +3 -3
- 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 +1 -2
- package/src/decision/Decision.tsx +1 -2
- package/src/definitionList/DefinitionList.css +2 -2
- package/src/definitionList/DefinitionList.less +2 -2
- package/src/drawer/Drawer.css +2 -2
- package/src/drawer/Drawer.less +3 -4
- package/src/flowNavigation/FlowNavigation.css +1 -1
- package/src/flowNavigation/FlowNavigation.less +1 -2
- package/src/flowNavigation/FlowNavigation.story.tsx +0 -3
- package/src/flowNavigation/FlowNavigation.test.js +1 -1
- package/src/flowNavigation/FlowNavigation.tsx +1 -2
- package/src/index.ts +1 -1
- 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.tsx +1 -1
- package/src/main.css +477 -319
- package/src/modal/Modal.css +20 -7
- package/src/modal/Modal.less +19 -7
- package/src/modal/Modal.tsx +2 -2
- package/src/overlayHeader/OverlayHeader.css +1 -1
- package/src/overlayHeader/OverlayHeader.less +2 -3
- package/src/popover/Popover.css +3 -3
- package/src/popover/Popover.test.tsx +1 -2
- package/src/promoCard/PromoCard.css +1 -1
- package/src/prompt/ActionPrompt/ActionPrompt.css +1 -1
- package/src/prompt/ActionPrompt/ActionPrompt.less +1 -1
- package/src/prompt/ActionPrompt/ActionPrompt.test.tsx +6 -37
- package/src/prompt/ActionPrompt/ActionPrompt.tsx +2 -3
- package/src/prompt/CriticalBanner/CriticalBanner.accessibility.docs.mdx +9 -0
- package/src/prompt/CriticalBanner/CriticalBanner.css +63 -1
- package/src/prompt/CriticalBanner/CriticalBanner.less +96 -2
- package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +156 -169
- package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +25 -6
- package/src/prompt/CriticalBanner/CriticalBanner.test.tsx +37 -0
- package/src/prompt/CriticalBanner/CriticalBanner.tsx +98 -81
- package/src/prompt/CriticalBanner/CriticalBanner.vars.less +1 -0
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -1
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +1 -1
- package/src/select/Select.test.tsx +1 -1
- package/src/snackbar/Snackbar.css +2 -2
- package/src/statusIcon/StatusIcon.tsx +2 -3
- package/src/stepper/Stepper.css +2 -2
- package/src/styles/less/accordion.css +4 -4
- package/src/styles/less/addons/_display-utilities.less +27 -13
- 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/core/_typography-utilities.less +22 -10
- 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 +15 -13
- package/src/styles/less/flex.less +3 -1
- 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 +6 -6
- package/src/styles/less/modals.less +4 -4
- 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 +0 -1
- package/src/styles/less/neptune.css +338 -270
- package/src/styles/less/panels.css +9 -9
- package/src/styles/less/popovers.css +13 -13
- package/src/styles/less/popovers.less +6 -6
- 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 +20 -8
- package/src/styles/less/utilities.less +14 -6
- package/src/styles/less/wells.css +18 -4
- package/src/styles/less/wells.less +5 -3
- package/src/styles/props/custom-media.css +11 -1
- package/src/styles/variables/legacy-variables.less +47 -4
- package/src/table/Table.css +1 -1
- package/src/tabs/Tabs.css +2 -2
- package/src/typeahead/Typeahead.css +1 -1
- package/src/uploadInput/uploadItem/UploadItem.less +2 -2
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { useState, useEffect, useRef, type ReactNode } from 'react';
|
|
1
|
+
import { useState, useEffect, useMemo, useRef, type ReactNode } from 'react';
|
|
2
2
|
import { createPortal } from 'react-dom';
|
|
3
3
|
import { Meta, StoryObj, Decorator } from '@storybook/react-webpack5';
|
|
4
4
|
import { fn } from 'storybook/test';
|
|
5
5
|
import { Bank, Briefcase, Star, Travel } from '@transferwise/icons';
|
|
6
6
|
import Button from '../../button';
|
|
7
7
|
import { CriticalBanner, type CriticalBannerProps } from './CriticalBanner';
|
|
8
|
-
import { withVariantConfig } from '../../../.storybook/helpers';
|
|
9
8
|
|
|
10
9
|
/**
|
|
11
10
|
* **Design guidance**: <a href="https://wise.design/components/critical-banner" target="_blank">wise.design/components/critical-banner</a>
|
|
@@ -120,6 +119,43 @@ const previewArgTypes = {
|
|
|
120
119
|
},
|
|
121
120
|
} as const;
|
|
122
121
|
|
|
122
|
+
const hiddenArgTypes = {
|
|
123
|
+
sentiment: { table: { disable: true } },
|
|
124
|
+
title: { table: { disable: true } },
|
|
125
|
+
description: { table: { disable: true } },
|
|
126
|
+
action: { table: { disable: true } },
|
|
127
|
+
actionSecondary: { table: { disable: true } },
|
|
128
|
+
media: { table: { disable: true } },
|
|
129
|
+
expanded: { table: { disable: true } },
|
|
130
|
+
onToggle: { table: { disable: true } },
|
|
131
|
+
id: { table: { disable: true } },
|
|
132
|
+
className: { table: { disable: true } },
|
|
133
|
+
'data-testid': { table: { disable: true } },
|
|
134
|
+
} as const;
|
|
135
|
+
|
|
136
|
+
const AnimatedEntryPreview = (args: CriticalBannerProps) => {
|
|
137
|
+
const { id = 'animated-entry' } = args;
|
|
138
|
+
const [bannerInstance, setBannerInstance] = useState(0);
|
|
139
|
+
const animatedBanner = useMemo(
|
|
140
|
+
() => ({
|
|
141
|
+
...args,
|
|
142
|
+
id: `${id}-${bannerInstance}`,
|
|
143
|
+
}),
|
|
144
|
+
[args, bannerInstance, id],
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
return (
|
|
148
|
+
<>
|
|
149
|
+
<CriticalBanner key={animatedBanner.id} {...animatedBanner} />
|
|
150
|
+
<div className="p-t-3">
|
|
151
|
+
<Button block v2 onClick={() => setBannerInstance((current) => current + 1)}>
|
|
152
|
+
Replay
|
|
153
|
+
</Button>
|
|
154
|
+
</div>
|
|
155
|
+
</>
|
|
156
|
+
);
|
|
157
|
+
};
|
|
158
|
+
|
|
123
159
|
/** Renders children inside an iframe that inherits the parent page's stylesheets. */
|
|
124
160
|
function IframeContainer({ width, children }: { width: number; children: ReactNode }) {
|
|
125
161
|
const iframeRef = useRef<HTMLIFrameElement>(null);
|
|
@@ -132,25 +168,11 @@ function IframeContainer({ width, children }: { width: number; children: ReactNo
|
|
|
132
168
|
const doc = iframe.contentDocument;
|
|
133
169
|
if (!doc) return;
|
|
134
170
|
|
|
135
|
-
doc.head.
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
link.rel = 'stylesheet';
|
|
141
|
-
link.href = sheet.href;
|
|
142
|
-
doc.head.appendChild(link);
|
|
143
|
-
} else if (sheet.cssRules) {
|
|
144
|
-
const style = doc.createElement('style');
|
|
145
|
-
style.textContent = Array.from(sheet.cssRules)
|
|
146
|
-
.map((r) => r.cssText)
|
|
147
|
-
.join('\n');
|
|
148
|
-
doc.head.appendChild(style);
|
|
149
|
-
}
|
|
150
|
-
} catch {
|
|
151
|
-
// Skip cross-origin sheets
|
|
152
|
-
}
|
|
153
|
-
});
|
|
171
|
+
doc.head.replaceChildren(
|
|
172
|
+
...Array.from(document.head.querySelectorAll('link[rel="stylesheet"], style')).map((node) =>
|
|
173
|
+
node.cloneNode(true),
|
|
174
|
+
),
|
|
175
|
+
);
|
|
154
176
|
|
|
155
177
|
doc.body.style.margin = '0';
|
|
156
178
|
setMountNode(doc.body);
|
|
@@ -174,18 +196,20 @@ function IframeContainer({ width, children }: { width: number; children: ReactNo
|
|
|
174
196
|
);
|
|
175
197
|
}
|
|
176
198
|
|
|
177
|
-
const ContainerDecorator
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
199
|
+
const ContainerDecorator =
|
|
200
|
+
(gap = '1rem'): Decorator =>
|
|
201
|
+
(Story) => (
|
|
202
|
+
<div
|
|
203
|
+
style={{
|
|
204
|
+
width: '100%',
|
|
205
|
+
display: 'flex',
|
|
206
|
+
flexDirection: 'column',
|
|
207
|
+
gap,
|
|
208
|
+
}}
|
|
209
|
+
>
|
|
210
|
+
<Story />
|
|
211
|
+
</div>
|
|
212
|
+
);
|
|
189
213
|
|
|
190
214
|
/**
|
|
191
215
|
* Interactive playground with all controls.
|
|
@@ -224,7 +248,7 @@ export const Playground: StoryObj<PreviewStoryArgs> = {
|
|
|
224
248
|
* There are four sentiments, with negative being the default.
|
|
225
249
|
*/
|
|
226
250
|
export const Sentiments: Story = {
|
|
227
|
-
decorators: [ContainerDecorator],
|
|
251
|
+
decorators: [ContainerDecorator('2rem')],
|
|
228
252
|
parameters: {
|
|
229
253
|
docs: {
|
|
230
254
|
source: {
|
|
@@ -235,19 +259,7 @@ export const Sentiments: Story = {
|
|
|
235
259
|
},
|
|
236
260
|
},
|
|
237
261
|
},
|
|
238
|
-
argTypes:
|
|
239
|
-
sentiment: { table: { disable: true } },
|
|
240
|
-
title: { table: { disable: true } },
|
|
241
|
-
description: { table: { disable: true } },
|
|
242
|
-
action: { table: { disable: true } },
|
|
243
|
-
actionSecondary: { table: { disable: true } },
|
|
244
|
-
media: { table: { disable: true } },
|
|
245
|
-
expanded: { table: { disable: true } },
|
|
246
|
-
onToggle: { table: { disable: true } },
|
|
247
|
-
id: { table: { disable: true } },
|
|
248
|
-
className: { table: { disable: true } },
|
|
249
|
-
'data-testid': { table: { disable: true } },
|
|
250
|
-
},
|
|
262
|
+
argTypes: hiddenArgTypes,
|
|
251
263
|
render: function Render() {
|
|
252
264
|
return (
|
|
253
265
|
<>
|
|
@@ -270,7 +282,7 @@ export const Sentiments: Story = {
|
|
|
270
282
|
* Banners can have just a primary action, both primary and secondary, or no actions at all.
|
|
271
283
|
*/
|
|
272
284
|
export const Actions: Story = {
|
|
273
|
-
decorators: [ContainerDecorator],
|
|
285
|
+
decorators: [ContainerDecorator('2rem')],
|
|
274
286
|
parameters: {
|
|
275
287
|
docs: {
|
|
276
288
|
source: {
|
|
@@ -288,19 +300,7 @@ export const Actions: Story = {
|
|
|
288
300
|
},
|
|
289
301
|
},
|
|
290
302
|
},
|
|
291
|
-
argTypes:
|
|
292
|
-
sentiment: { table: { disable: true } },
|
|
293
|
-
title: { table: { disable: true } },
|
|
294
|
-
description: { table: { disable: true } },
|
|
295
|
-
action: { table: { disable: true } },
|
|
296
|
-
actionSecondary: { table: { disable: true } },
|
|
297
|
-
media: { table: { disable: true } },
|
|
298
|
-
expanded: { table: { disable: true } },
|
|
299
|
-
onToggle: { table: { disable: true } },
|
|
300
|
-
id: { table: { disable: true } },
|
|
301
|
-
className: { table: { disable: true } },
|
|
302
|
-
'data-testid': { table: { disable: true } },
|
|
303
|
-
},
|
|
303
|
+
argTypes: hiddenArgTypes,
|
|
304
304
|
render: function Render() {
|
|
305
305
|
return (
|
|
306
306
|
<>
|
|
@@ -327,7 +327,7 @@ export const Actions: Story = {
|
|
|
327
327
|
* Each sentiment has a default status icon. Override it with a custom image or an AvatarView.
|
|
328
328
|
*/
|
|
329
329
|
export const MediaTypes: Story = {
|
|
330
|
-
decorators: [ContainerDecorator],
|
|
330
|
+
decorators: [ContainerDecorator('2rem')],
|
|
331
331
|
parameters: {
|
|
332
332
|
docs: {
|
|
333
333
|
source: {
|
|
@@ -351,19 +351,7 @@ export const MediaTypes: Story = {
|
|
|
351
351
|
},
|
|
352
352
|
},
|
|
353
353
|
},
|
|
354
|
-
argTypes:
|
|
355
|
-
sentiment: { table: { disable: true } },
|
|
356
|
-
title: { table: { disable: true } },
|
|
357
|
-
description: { table: { disable: true } },
|
|
358
|
-
action: { table: { disable: true } },
|
|
359
|
-
actionSecondary: { table: { disable: true } },
|
|
360
|
-
media: { table: { disable: true } },
|
|
361
|
-
expanded: { table: { disable: true } },
|
|
362
|
-
onToggle: { table: { disable: true } },
|
|
363
|
-
id: { table: { disable: true } },
|
|
364
|
-
className: { table: { disable: true } },
|
|
365
|
-
'data-testid': { table: { disable: true } },
|
|
366
|
-
},
|
|
354
|
+
argTypes: hiddenArgTypes,
|
|
367
355
|
render: function Render() {
|
|
368
356
|
const [expandedStates, setExpandedStates] = useState<Record<string, boolean>>({
|
|
369
357
|
default: true,
|
|
@@ -445,6 +433,31 @@ export const MediaTypes: Story = {
|
|
|
445
433
|
* When the banner is shown on wider screens, it will always be fully expanded.
|
|
446
434
|
*/
|
|
447
435
|
export const Expanded: Story = {
|
|
436
|
+
argTypes: hiddenArgTypes,
|
|
437
|
+
render: function Render() {
|
|
438
|
+
const [expanded, setExpanded] = useState(true);
|
|
439
|
+
|
|
440
|
+
return (
|
|
441
|
+
<>
|
|
442
|
+
<div className="p-b-3">
|
|
443
|
+
<Button v2 onClick={() => setExpanded(!expanded)}>
|
|
444
|
+
{expanded ? 'Collapse externally' : 'Expand externally'}
|
|
445
|
+
</Button>
|
|
446
|
+
</div>
|
|
447
|
+
<IframeContainer width={350}>
|
|
448
|
+
<CriticalBanner
|
|
449
|
+
sentiment="negative"
|
|
450
|
+
title="Your account requires verification"
|
|
451
|
+
description="Please verify your identity to continue using all features. This process typically takes 2–3 minutes."
|
|
452
|
+
action={{ label: 'Verify now', onClick: fn() }}
|
|
453
|
+
actionSecondary={{ label: 'Learn more', onClick: fn() }}
|
|
454
|
+
expanded={expanded}
|
|
455
|
+
onToggle={() => setExpanded(!expanded)}
|
|
456
|
+
/>
|
|
457
|
+
</IframeContainer>
|
|
458
|
+
</>
|
|
459
|
+
);
|
|
460
|
+
},
|
|
448
461
|
parameters: {
|
|
449
462
|
docs: {
|
|
450
463
|
source: {
|
|
@@ -462,41 +475,6 @@ export const Expanded: Story = {
|
|
|
462
475
|
},
|
|
463
476
|
},
|
|
464
477
|
},
|
|
465
|
-
argTypes: {
|
|
466
|
-
sentiment: { table: { disable: true } },
|
|
467
|
-
title: { table: { disable: true } },
|
|
468
|
-
description: { table: { disable: true } },
|
|
469
|
-
action: { table: { disable: true } },
|
|
470
|
-
actionSecondary: { table: { disable: true } },
|
|
471
|
-
media: { table: { disable: true } },
|
|
472
|
-
expanded: { table: { disable: true } },
|
|
473
|
-
onToggle: { table: { disable: true } },
|
|
474
|
-
id: { table: { disable: true } },
|
|
475
|
-
className: { table: { disable: true } },
|
|
476
|
-
'data-testid': { table: { disable: true } },
|
|
477
|
-
},
|
|
478
|
-
render: function Render() {
|
|
479
|
-
const [expanded, setExpanded] = useState(true);
|
|
480
|
-
|
|
481
|
-
return (
|
|
482
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '1rem', width: '100%' }}>
|
|
483
|
-
<div>
|
|
484
|
-
<Button v2 onClick={() => setExpanded(!expanded)}>
|
|
485
|
-
{expanded ? 'Collapse externally' : 'Expand externally'}
|
|
486
|
-
</Button>
|
|
487
|
-
</div>
|
|
488
|
-
<CriticalBanner
|
|
489
|
-
sentiment="negative"
|
|
490
|
-
title="Your account requires verification"
|
|
491
|
-
description="Please verify your identity to continue using all features. This process typically takes 2–3 minutes."
|
|
492
|
-
action={{ label: 'Verify now', onClick: fn() }}
|
|
493
|
-
actionSecondary={{ label: 'Learn more', onClick: fn() }}
|
|
494
|
-
expanded={expanded}
|
|
495
|
-
onToggle={() => setExpanded(!expanded)}
|
|
496
|
-
/>
|
|
497
|
-
</div>
|
|
498
|
-
);
|
|
499
|
-
},
|
|
500
478
|
};
|
|
501
479
|
|
|
502
480
|
/**
|
|
@@ -504,27 +482,15 @@ export const Expanded: Story = {
|
|
|
504
482
|
* is clamped to 2 lines. With a title, only the title is shown when collapsed.
|
|
505
483
|
*/
|
|
506
484
|
export const CollapsedBehaviour: Story = {
|
|
507
|
-
decorators: [ContainerDecorator],
|
|
485
|
+
decorators: [ContainerDecorator()],
|
|
508
486
|
|
|
509
|
-
argTypes:
|
|
510
|
-
sentiment: { table: { disable: true } },
|
|
511
|
-
title: { table: { disable: true } },
|
|
512
|
-
description: { table: { disable: true } },
|
|
513
|
-
action: { table: { disable: true } },
|
|
514
|
-
actionSecondary: { table: { disable: true } },
|
|
515
|
-
media: { table: { disable: true } },
|
|
516
|
-
expanded: { table: { disable: true } },
|
|
517
|
-
onToggle: { table: { disable: true } },
|
|
518
|
-
id: { table: { disable: true } },
|
|
519
|
-
className: { table: { disable: true } },
|
|
520
|
-
'data-testid': { table: { disable: true } },
|
|
521
|
-
},
|
|
487
|
+
argTypes: hiddenArgTypes,
|
|
522
488
|
render: function Render() {
|
|
523
489
|
const [expanded1, setExpanded1] = useState(false);
|
|
524
490
|
const [expanded2, setExpanded2] = useState(false);
|
|
525
491
|
|
|
526
492
|
return (
|
|
527
|
-
|
|
493
|
+
<IframeContainer width={650}>
|
|
528
494
|
<CriticalBanner
|
|
529
495
|
sentiment="negative"
|
|
530
496
|
title="Collapsed with title"
|
|
@@ -534,22 +500,21 @@ export const CollapsedBehaviour: Story = {
|
|
|
534
500
|
onToggle={() => setExpanded1(!expanded1)}
|
|
535
501
|
/>
|
|
536
502
|
<CriticalBanner
|
|
503
|
+
className="m-t-3"
|
|
537
504
|
sentiment="warning"
|
|
538
505
|
description="When there is no title, the description stays visible but is clamped to a maximum of two lines. This ensures the user always sees some context even in the collapsed state, because there is no title to summarise the message."
|
|
539
506
|
action={{ label: 'Take action', onClick: fn() }}
|
|
540
507
|
expanded={expanded2}
|
|
541
508
|
onToggle={() => setExpanded2(!expanded2)}
|
|
542
509
|
/>
|
|
543
|
-
|
|
510
|
+
</IframeContainer>
|
|
544
511
|
);
|
|
545
512
|
},
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
canvas: { sourceState: 'hidden' },
|
|
550
|
-
},
|
|
513
|
+
parameters: {
|
|
514
|
+
docs: {
|
|
515
|
+
canvas: { sourceState: 'hidden' },
|
|
551
516
|
},
|
|
552
|
-
}
|
|
517
|
+
},
|
|
553
518
|
};
|
|
554
519
|
|
|
555
520
|
/**
|
|
@@ -563,27 +528,15 @@ export const Responsiveness: Story = {
|
|
|
563
528
|
canvas: { sourceState: 'hidden' },
|
|
564
529
|
},
|
|
565
530
|
},
|
|
566
|
-
argTypes:
|
|
567
|
-
sentiment: { table: { disable: true } },
|
|
568
|
-
title: { table: { disable: true } },
|
|
569
|
-
description: { table: { disable: true } },
|
|
570
|
-
action: { table: { disable: true } },
|
|
571
|
-
actionSecondary: { table: { disable: true } },
|
|
572
|
-
media: { table: { disable: true } },
|
|
573
|
-
expanded: { table: { disable: true } },
|
|
574
|
-
onToggle: { table: { disable: true } },
|
|
575
|
-
id: { table: { disable: true } },
|
|
576
|
-
className: { table: { disable: true } },
|
|
577
|
-
'data-testid': { table: { disable: true } },
|
|
578
|
-
},
|
|
531
|
+
argTypes: hiddenArgTypes,
|
|
579
532
|
render: function Render() {
|
|
580
533
|
return (
|
|
581
|
-
<div style={{ display: 'flex', gap: 16, alignItems: 'start', minWidth:
|
|
582
|
-
{[200, 350,
|
|
534
|
+
<div style={{ display: 'flex', gap: 16, alignItems: 'start', minWidth: 1700 }}>
|
|
535
|
+
{[200, 350, 800].map((width) => (
|
|
583
536
|
<IframeContainer key={width} width={width}>
|
|
584
537
|
<CriticalBanner
|
|
585
538
|
sentiment="warning"
|
|
586
|
-
title=
|
|
539
|
+
title={`At ${width}px the buttons are ${width === 200 ? 'stacked' : width === 350 ? 'full-width' : 'left-aligned'}`}
|
|
587
540
|
description="Please verify your identity to continue using all features."
|
|
588
541
|
action={{ label: 'Verify now', onClick: fn() }}
|
|
589
542
|
actionSecondary={{ label: 'Learn more', onClick: fn() }}
|
|
@@ -595,6 +548,50 @@ export const Responsiveness: Story = {
|
|
|
595
548
|
},
|
|
596
549
|
};
|
|
597
550
|
|
|
551
|
+
/**
|
|
552
|
+
* Mobile viewport regression test for the overhang.
|
|
553
|
+
* The overhang is always applied below 600px.
|
|
554
|
+
*/
|
|
555
|
+
export const MobileOverhang: Story = {
|
|
556
|
+
argTypes: hiddenArgTypes,
|
|
557
|
+
render: function Render() {
|
|
558
|
+
return (
|
|
559
|
+
<div style={{ width: 350 }}>
|
|
560
|
+
<CriticalBanner
|
|
561
|
+
sentiment="negative"
|
|
562
|
+
title="Your account requires verification"
|
|
563
|
+
description="Please verify your identity to continue using all features."
|
|
564
|
+
action={{ label: 'Verify now', onClick: fn() }}
|
|
565
|
+
/>
|
|
566
|
+
</div>
|
|
567
|
+
);
|
|
568
|
+
},
|
|
569
|
+
parameters: {
|
|
570
|
+
docs: {
|
|
571
|
+
canvas: { sourceState: 'hidden' },
|
|
572
|
+
},
|
|
573
|
+
},
|
|
574
|
+
};
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Mobile-only entry animation: the banner reveals from above.
|
|
578
|
+
*/
|
|
579
|
+
export const AnimatedEntry: Story = {
|
|
580
|
+
args: {
|
|
581
|
+
title: 'Your account is restricted.',
|
|
582
|
+
description: 'Review your personal details to get your account active again.',
|
|
583
|
+
action: { label: 'Review details', onClick: fn() },
|
|
584
|
+
},
|
|
585
|
+
argTypes: hiddenArgTypes,
|
|
586
|
+
render: (args) => <AnimatedEntryPreview {...args} />,
|
|
587
|
+
parameters: {
|
|
588
|
+
layout: 'fullscreen',
|
|
589
|
+
docs: {
|
|
590
|
+
canvas: { sourceState: 'hidden' },
|
|
591
|
+
},
|
|
592
|
+
},
|
|
593
|
+
};
|
|
594
|
+
|
|
598
595
|
/**
|
|
599
596
|
* The text container is capped at 480px for optimal readability, even though
|
|
600
597
|
* the banner itself stretches to the full available width.
|
|
@@ -605,31 +602,21 @@ export const ParagraphWidth: Story = {
|
|
|
605
602
|
canvas: { sourceState: 'hidden' },
|
|
606
603
|
},
|
|
607
604
|
},
|
|
608
|
-
argTypes:
|
|
609
|
-
sentiment: { table: { disable: true } },
|
|
610
|
-
title: { table: { disable: true } },
|
|
611
|
-
description: { table: { disable: true } },
|
|
612
|
-
action: { table: { disable: true } },
|
|
613
|
-
actionSecondary: { table: { disable: true } },
|
|
614
|
-
media: { table: { disable: true } },
|
|
615
|
-
expanded: { table: { disable: true } },
|
|
616
|
-
onToggle: { table: { disable: true } },
|
|
617
|
-
id: { table: { disable: true } },
|
|
618
|
-
className: { table: { disable: true } },
|
|
619
|
-
'data-testid': { table: { disable: true } },
|
|
620
|
-
},
|
|
605
|
+
argTypes: hiddenArgTypes,
|
|
621
606
|
render: function Render() {
|
|
622
607
|
const [expanded, setExpanded] = useState(true);
|
|
623
608
|
|
|
624
609
|
return (
|
|
625
|
-
<
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
610
|
+
<IframeContainer width={1000}>
|
|
611
|
+
<CriticalBanner
|
|
612
|
+
sentiment="negative"
|
|
613
|
+
title="The text container is capped at 480px for optimal readability, even though the banner itself stretches to the full available width."
|
|
614
|
+
description="To restore access, you'll need to verify your identity. This involves confirming your personal details and uploading a valid government-issued ID. The process typically takes 2–3 minutes, and your account will be restored immediately after successful verification."
|
|
615
|
+
action={{ label: 'Verify now', onClick: fn() }}
|
|
616
|
+
expanded={expanded}
|
|
617
|
+
onToggle={() => setExpanded(!expanded)}
|
|
618
|
+
/>
|
|
619
|
+
</IframeContainer>
|
|
633
620
|
);
|
|
634
621
|
},
|
|
635
622
|
};
|
|
@@ -25,7 +25,7 @@ const ANIMATION_DURATION = 200; // 150ms animation + 50ms buffer
|
|
|
25
25
|
const longDescription =
|
|
26
26
|
'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.';
|
|
27
27
|
|
|
28
|
-
function AllVariants() {
|
|
28
|
+
function AllVariants({ gap = '1rem' }: { gap?: string }) {
|
|
29
29
|
const [states, setStates] = useState({
|
|
30
30
|
negativeExpanded: true,
|
|
31
31
|
negativeCollapsed: false,
|
|
@@ -42,7 +42,7 @@ function AllVariants() {
|
|
|
42
42
|
setStates((prev) => ({ ...prev, [key]: !prev[key] }));
|
|
43
43
|
|
|
44
44
|
return (
|
|
45
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap
|
|
45
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap, width: '100%' }}>
|
|
46
46
|
<CriticalBanner
|
|
47
47
|
sentiment="negative"
|
|
48
48
|
title="Negative — expanded"
|
|
@@ -133,10 +133,29 @@ export const Variants: Story = {
|
|
|
133
133
|
|
|
134
134
|
/** Mobile viewport regression test with all variants. */
|
|
135
135
|
export const MobileVariants: Story = {
|
|
136
|
-
render: () => <AllVariants />,
|
|
136
|
+
render: () => <AllVariants gap="2rem" />,
|
|
137
137
|
...withVariantConfig(['mobile']),
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
+
/** Mobile entry animation visual regression test. */
|
|
141
|
+
export const AnimatedEntryMobile: Story = {
|
|
142
|
+
render: function Render() {
|
|
143
|
+
return (
|
|
144
|
+
<CriticalBanner
|
|
145
|
+
sentiment="negative"
|
|
146
|
+
title="Your account is restricted."
|
|
147
|
+
description="Review your personal details to get your account active again."
|
|
148
|
+
action={{ label: 'Review details', onClick: fn() }}
|
|
149
|
+
/>
|
|
150
|
+
);
|
|
151
|
+
},
|
|
152
|
+
...withVariantConfig(['mobile'], {
|
|
153
|
+
parameters: {
|
|
154
|
+
chromatic: { pauseAnimationAtEnd: true },
|
|
155
|
+
},
|
|
156
|
+
}),
|
|
157
|
+
};
|
|
158
|
+
|
|
140
159
|
/**
|
|
141
160
|
* Tests keyboard navigation and interaction:
|
|
142
161
|
* - Tab focuses the first chevron toggle button
|
|
@@ -150,7 +169,7 @@ export const KeyboardInteraction: Story = {
|
|
|
150
169
|
const [expanded2, setExpanded2] = useState(false);
|
|
151
170
|
|
|
152
171
|
return (
|
|
153
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '
|
|
172
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '2rem', width: '100%' }}>
|
|
154
173
|
<CriticalBanner
|
|
155
174
|
sentiment="negative"
|
|
156
175
|
title="First banner"
|
|
@@ -289,7 +308,7 @@ export const RTL: Story = {
|
|
|
289
308
|
|
|
290
309
|
/** 400% zoom regression test with all variants. */
|
|
291
310
|
export const Zoom400: Story = {
|
|
292
|
-
render: () => <AllVariants />,
|
|
311
|
+
render: () => <AllVariants gap="2rem" />,
|
|
293
312
|
...withVariantConfig(['400%']),
|
|
294
313
|
};
|
|
295
314
|
|
|
@@ -353,7 +372,7 @@ export const MultiLineTitleAnimation: Story = {
|
|
|
353
372
|
export const UncontrolledState: Story = {
|
|
354
373
|
render: function Render() {
|
|
355
374
|
return (
|
|
356
|
-
<div style={{ display: 'flex', flexDirection: 'column', gap: '
|
|
375
|
+
<div style={{ display: 'flex', flexDirection: 'column', gap: '2rem', width: '100%' }}>
|
|
357
376
|
<CriticalBanner
|
|
358
377
|
sentiment="negative"
|
|
359
378
|
title="Uncontrolled banner (no onToggle)"
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* eslint-disable testing-library/no-container */
|
|
2
|
+
import { mockMatchMedia, mockResizeObserver, render, screen } from '../../test-utils';
|
|
3
|
+
import { resetLiveRegionAnnouncementQueue } from '../../common/liveRegion/LiveRegion';
|
|
4
|
+
import { CriticalBanner, CriticalBannerProps } from './CriticalBanner';
|
|
5
|
+
|
|
6
|
+
mockMatchMedia();
|
|
7
|
+
mockResizeObserver();
|
|
8
|
+
|
|
9
|
+
describe('CriticalBanner', () => {
|
|
10
|
+
const defaultProps: CriticalBannerProps = {
|
|
11
|
+
description: 'Please verify your identity to continue using all features.',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
beforeEach(() => {
|
|
15
|
+
resetLiveRegionAnnouncementQueue();
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
it('applies mobile overhang classes by default', () => {
|
|
19
|
+
const { container } = render(
|
|
20
|
+
<CriticalBanner {...defaultProps} data-testid="critical-banner" />,
|
|
21
|
+
);
|
|
22
|
+
|
|
23
|
+
expect(screen.getByTestId('critical-banner')).toBeInTheDocument();
|
|
24
|
+
expect(container.querySelector('.wds-critical-banner-overhang')).toBeInTheDocument();
|
|
25
|
+
expect(container.querySelector('.wds-critical-banner-overhang-query')).toBeInTheDocument();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
it('wraps the banner in the css entry animation structure', () => {
|
|
29
|
+
const { container } = render(
|
|
30
|
+
<CriticalBanner {...defaultProps} data-testid="critical-banner" />,
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
expect(screen.getByTestId('critical-banner')).toBeInTheDocument();
|
|
34
|
+
expect(container.querySelector('.wds-critical-banner__entry-mask')).toBeInTheDocument();
|
|
35
|
+
expect(container.querySelector('.wds-critical-banner__entry-track')).toBeInTheDocument();
|
|
36
|
+
});
|
|
37
|
+
});
|