@transferwise/components 0.0.0-experimental-4c97d70 → 0.0.0-experimental-862fadc
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 -0
- package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
- package/build/accordion/AccordionItem/AccordionItem.mjs +1 -0
- package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
- package/build/actionButton/ActionButton.js +1 -0
- package/build/actionButton/ActionButton.js.map +1 -1
- package/build/actionButton/ActionButton.mjs +1 -0
- package/build/actionButton/ActionButton.mjs.map +1 -1
- package/build/actionOption/ActionOption.js +1 -0
- package/build/actionOption/ActionOption.js.map +1 -1
- package/build/actionOption/ActionOption.mjs +1 -0
- package/build/actionOption/ActionOption.mjs.map +1 -1
- package/build/alert/Alert.js +1 -0
- package/build/alert/Alert.js.map +1 -1
- package/build/alert/Alert.mjs +1 -0
- package/build/alert/Alert.mjs.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.js +1 -0
- package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs +1 -0
- package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
- package/build/avatar/Avatar.js +1 -0
- package/build/avatar/Avatar.js.map +1 -1
- package/build/avatar/Avatar.mjs +1 -0
- package/build/avatar/Avatar.mjs.map +1 -1
- package/build/avatarView/AvatarView.js +1 -0
- package/build/avatarView/AvatarView.js.map +1 -1
- package/build/avatarView/AvatarView.mjs +1 -0
- package/build/avatarView/AvatarView.mjs.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.js +1 -0
- package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
- package/build/avatarWrapper/AvatarWrapper.mjs +1 -0
- package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
- package/build/badge/Badge.js +1 -0
- package/build/badge/Badge.js.map +1 -1
- package/build/badge/Badge.mjs +1 -0
- 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 +1 -0
- package/build/button/Button.js.map +1 -1
- package/build/button/Button.mjs +1 -0
- package/build/button/Button.mjs.map +1 -1
- package/build/button/LegacyButton.js +1 -0
- package/build/button/LegacyButton.js.map +1 -1
- package/build/button/LegacyButton.mjs +1 -0
- package/build/button/LegacyButton.mjs.map +1 -1
- package/build/button/classMap.js +1 -0
- package/build/button/classMap.js.map +1 -1
- package/build/button/classMap.mjs +1 -0
- package/build/button/classMap.mjs.map +1 -1
- package/build/button/legacyUtils/legacyUtils.js +1 -0
- package/build/button/legacyUtils/legacyUtils.js.map +1 -1
- package/build/button/legacyUtils/legacyUtils.mjs +1 -0
- package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
- package/build/card/Card.js +1 -0
- package/build/card/Card.js.map +1 -1
- package/build/card/Card.mjs +1 -0
- package/build/card/Card.mjs.map +1 -1
- package/build/checkbox/Checkbox.js +1 -0
- package/build/checkbox/Checkbox.js.map +1 -1
- package/build/checkbox/Checkbox.mjs +1 -0
- package/build/checkbox/Checkbox.mjs.map +1 -1
- package/build/chevron/Chevron.js +1 -0
- package/build/chevron/Chevron.js.map +1 -1
- package/build/chevron/Chevron.mjs +1 -0
- package/build/chevron/Chevron.mjs.map +1 -1
- package/build/chips/Chip.js +1 -0
- package/build/chips/Chip.js.map +1 -1
- package/build/chips/Chip.mjs +1 -0
- package/build/chips/Chip.mjs.map +1 -1
- package/build/circularButton/CircularButton.js +1 -0
- package/build/circularButton/CircularButton.js.map +1 -1
- package/build/circularButton/CircularButton.mjs +1 -0
- package/build/circularButton/CircularButton.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 +50 -54
- package/build/common/panel/Panel.js.map +1 -1
- package/build/common/panel/Panel.mjs +55 -59
- package/build/common/panel/Panel.mjs.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.js +1 -0
- package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
- package/build/common/responsivePanel/ResponsivePanel.mjs +1 -0
- package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.js +1 -0
- package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
- package/build/criticalBanner/CriticalCommsBanner.mjs +1 -0
- package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
- package/build/dateInput/DateInput.js +1 -1
- package/build/dateInput/DateInput.mjs +1 -1
- package/build/dateLookup/DateLookup.js +1 -1
- package/build/dateLookup/DateLookup.mjs +1 -1
- package/build/dateLookup/dateHeader/DateHeader.js +1 -0
- package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
- package/build/dateLookup/dateHeader/DateHeader.mjs +1 -0
- package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
- package/build/decision/Decision.js +1 -0
- package/build/decision/Decision.js.map +1 -1
- package/build/decision/Decision.mjs +1 -0
- package/build/decision/Decision.mjs.map +1 -1
- package/build/definitionList/DefinitionList.js +1 -0
- package/build/definitionList/DefinitionList.js.map +1 -1
- package/build/definitionList/DefinitionList.mjs +1 -0
- package/build/definitionList/DefinitionList.mjs.map +1 -1
- package/build/dimmer/Dimmer.js +1 -0
- package/build/dimmer/Dimmer.js.map +1 -1
- package/build/dimmer/Dimmer.mjs +1 -0
- package/build/dimmer/Dimmer.mjs.map +1 -1
- package/build/display/Display.js +1 -0
- package/build/display/Display.js.map +1 -1
- package/build/display/Display.mjs +1 -0
- package/build/display/Display.mjs.map +1 -1
- package/build/drawer/Drawer.js +1 -0
- package/build/drawer/Drawer.js.map +1 -1
- package/build/drawer/Drawer.mjs +1 -0
- package/build/drawer/Drawer.mjs.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +4 -3
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +4 -3
- package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
- package/build/field/Field.js +5 -5
- package/build/field/Field.mjs +5 -5
- package/build/flowNavigation/FlowNavigation.js +1 -0
- package/build/flowNavigation/FlowNavigation.js.map +1 -1
- package/build/flowNavigation/FlowNavigation.mjs +1 -0
- package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
- package/build/header/Header.js +1 -0
- package/build/header/Header.js.map +1 -1
- package/build/header/Header.mjs +1 -0
- 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/index.js +0 -2
- package/build/index.js.map +1 -1
- package/build/index.mjs +0 -1
- package/build/index.mjs.map +1 -1
- package/build/info/Info.js +1 -0
- package/build/info/Info.js.map +1 -1
- package/build/info/Info.mjs +1 -0
- package/build/info/Info.mjs.map +1 -1
- package/build/inlineAlert/InlineAlert.js +1 -0
- package/build/inlineAlert/InlineAlert.js.map +1 -1
- package/build/inlineAlert/InlineAlert.mjs +1 -0
- package/build/inlineAlert/InlineAlert.mjs.map +1 -1
- package/build/inputs/SearchInput.js +1 -0
- package/build/inputs/SearchInput.js.map +1 -1
- package/build/inputs/SearchInput.mjs +1 -0
- package/build/inputs/SearchInput.mjs.map +1 -1
- package/build/instructionsList/InstructionsList.js +1 -0
- package/build/instructionsList/InstructionsList.js.map +1 -1
- package/build/instructionsList/InstructionsList.mjs +1 -0
- package/build/instructionsList/InstructionsList.mjs.map +1 -1
- package/build/link/Link.js +1 -0
- package/build/link/Link.js.map +1 -1
- package/build/link/Link.mjs +1 -0
- package/build/link/Link.mjs.map +1 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +1 -0
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +1 -1
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +1 -0
- package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +1 -1
- package/build/listItem/ListItem.js +1 -0
- package/build/listItem/ListItem.js.map +1 -1
- package/build/listItem/ListItem.mjs +1 -0
- package/build/listItem/ListItem.mjs.map +1 -1
- package/build/listItem/Prompt/ListItemPrompt.js +5 -5
- package/build/listItem/Prompt/ListItemPrompt.mjs +5 -5
- package/build/loader/Loader.js +1 -0
- package/build/loader/Loader.js.map +1 -1
- package/build/loader/Loader.mjs +1 -0
- package/build/loader/Loader.mjs.map +1 -1
- package/build/main.css +66 -133
- package/build/markdown/Markdown.js +1 -0
- package/build/markdown/Markdown.js.map +1 -1
- package/build/markdown/Markdown.mjs +1 -0
- package/build/markdown/Markdown.mjs.map +1 -1
- package/build/modal/Modal.js +1 -0
- package/build/modal/Modal.js.map +1 -1
- package/build/modal/Modal.mjs +1 -0
- package/build/modal/Modal.mjs.map +1 -1
- package/build/moneyInput/MoneyInput.js +28 -12
- package/build/moneyInput/MoneyInput.js.map +1 -1
- package/build/moneyInput/MoneyInput.mjs +30 -14
- 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 +1 -0
- package/build/navigationOption/NavigationOption.js.map +1 -1
- package/build/navigationOption/NavigationOption.mjs +1 -0
- package/build/navigationOption/NavigationOption.mjs.map +1 -1
- package/build/nudge/Nudge.js +1 -0
- package/build/nudge/Nudge.js.map +1 -1
- package/build/nudge/Nudge.mjs +1 -0
- package/build/nudge/Nudge.mjs.map +1 -1
- package/build/overlayHeader/OverlayHeader.js +1 -0
- package/build/overlayHeader/OverlayHeader.js.map +1 -1
- package/build/overlayHeader/OverlayHeader.mjs +1 -0
- package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.js +1 -0
- package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
- package/build/phoneNumberInput/PhoneNumberInput.mjs +1 -0
- package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
- package/build/popover/Popover.js +1 -0
- package/build/popover/Popover.js.map +1 -1
- package/build/popover/Popover.mjs +1 -0
- package/build/popover/Popover.mjs.map +1 -1
- package/build/processIndicator/ProcessIndicator.js +1 -0
- package/build/processIndicator/ProcessIndicator.js.map +1 -1
- package/build/processIndicator/ProcessIndicator.mjs +1 -0
- package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
- package/build/progressBar/ProgressBar.js +1 -0
- package/build/progressBar/ProgressBar.js.map +1 -1
- package/build/progressBar/ProgressBar.mjs +1 -0
- package/build/progressBar/ProgressBar.mjs.map +1 -1
- package/build/promoCard/PromoCard.js +1 -0
- package/build/promoCard/PromoCard.js.map +1 -1
- package/build/promoCard/PromoCard.mjs +1 -0
- package/build/promoCard/PromoCard.mjs.map +1 -1
- package/build/promoCard/PromoCardIndicator.js +1 -0
- package/build/promoCard/PromoCardIndicator.js.map +1 -1
- package/build/promoCard/PromoCardIndicator.mjs +1 -0
- package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.js +41 -8
- package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
- package/build/prompt/ActionPrompt/ActionPrompt.mjs +41 -8
- package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.js +1 -0
- package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
- package/build/prompt/InfoPrompt/InfoPrompt.mjs +1 -0
- package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.js +1 -0
- package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
- package/build/prompt/InlinePrompt/InlinePrompt.mjs +1 -0
- 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/radio/Radio.js +1 -0
- package/build/radio/Radio.js.map +1 -1
- package/build/radio/Radio.mjs +1 -0
- package/build/radio/Radio.mjs.map +1 -1
- package/build/segmentedControl/SegmentedControl.js +1 -0
- package/build/segmentedControl/SegmentedControl.js.map +1 -1
- package/build/segmentedControl/SegmentedControl.mjs +1 -0
- package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
- package/build/select/Select.js +2 -1
- package/build/select/Select.js.map +1 -1
- package/build/select/Select.mjs +2 -1
- package/build/select/Select.mjs.map +1 -1
- package/build/select/option/Option.js +1 -0
- package/build/select/option/Option.js.map +1 -1
- package/build/select/option/Option.mjs +1 -0
- package/build/select/option/Option.mjs.map +1 -1
- package/build/statusIcon/StatusIcon.js +1 -0
- package/build/statusIcon/StatusIcon.js.map +1 -1
- package/build/statusIcon/StatusIcon.mjs +1 -0
- package/build/statusIcon/StatusIcon.mjs.map +1 -1
- package/build/stepper/Stepper.js +1 -0
- package/build/stepper/Stepper.js.map +1 -1
- package/build/stepper/Stepper.mjs +1 -0
- package/build/stepper/Stepper.mjs.map +1 -1
- package/build/sticky/Sticky.js +1 -0
- package/build/sticky/Sticky.js.map +1 -1
- package/build/sticky/Sticky.mjs +1 -0
- package/build/sticky/Sticky.mjs.map +1 -1
- package/build/styles/css/neptune.css +33 -22
- package/build/styles/less/neptune-tokens.less +5 -4
- package/build/styles/main.css +66 -133
- package/build/styles/modal/Modal.css +2 -2
- package/build/styles/props/neptune-tokens.css +3 -2
- package/build/styles/select/Select.css +2 -1
- package/build/styles/styles/less/neptune.css +33 -22
- package/build/summary/Summary.js +1 -0
- package/build/summary/Summary.js.map +1 -1
- package/build/summary/Summary.mjs +1 -0
- package/build/summary/Summary.mjs.map +1 -1
- package/build/table/Table.js +1 -0
- package/build/table/Table.js.map +1 -1
- package/build/table/Table.mjs +1 -0
- package/build/table/Table.mjs.map +1 -1
- package/build/table/TableRow.js +1 -0
- package/build/table/TableRow.js.map +1 -1
- package/build/table/TableRow.mjs +1 -0
- package/build/table/TableRow.mjs.map +1 -1
- package/build/table/TableStatusText.js +1 -0
- package/build/table/TableStatusText.js.map +1 -1
- package/build/table/TableStatusText.mjs +1 -0
- package/build/table/TableStatusText.mjs.map +1 -1
- package/build/tabs/Tabs.js +1 -0
- package/build/tabs/Tabs.js.map +1 -1
- package/build/tabs/Tabs.mjs +1 -0
- package/build/tabs/Tabs.mjs.map +1 -1
- package/build/tile/Tile.js +1 -0
- package/build/tile/Tile.js.map +1 -1
- package/build/tile/Tile.mjs +1 -0
- package/build/tile/Tile.mjs.map +1 -1
- package/build/title/Title.js +1 -0
- package/build/title/Title.js.map +1 -1
- package/build/title/Title.mjs +1 -0
- package/build/title/Title.mjs.map +1 -1
- package/build/tooltip/Tooltip.js +30 -50
- package/build/tooltip/Tooltip.js.map +1 -1
- package/build/tooltip/Tooltip.mjs +31 -51
- package/build/tooltip/Tooltip.mjs.map +1 -1
- package/build/typeahead/Typeahead.js +5 -5
- package/build/typeahead/Typeahead.mjs +5 -5
- package/build/types/badge/BadgeAssets.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/expressiveMoneyInput/currencySelector/CurrencySelector.d.ts.map +1 -1
- package/build/types/index.d.ts +2 -2
- package/build/types/index.d.ts.map +1 -1
- package/build/types/moneyInput/MoneyInput.d.ts +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/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 +1 -0
- package/build/upload/Upload.js.map +1 -1
- package/build/upload/Upload.mjs +1 -0
- package/build/upload/Upload.mjs.map +1 -1
- package/build/upload/steps/completeStep/completeStep.js +1 -0
- package/build/upload/steps/completeStep/completeStep.js.map +1 -1
- package/build/upload/steps/completeStep/completeStep.mjs +1 -0
- package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
- package/build/upload/steps/processingStep/processingStep.js +1 -0
- package/build/upload/steps/processingStep/processingStep.js.map +1 -1
- package/build/upload/steps/processingStep/processingStep.mjs +1 -0
- package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.js +1 -0
- package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +1 -0
- package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
- package/build/uploadInput/UploadInput.js +1 -0
- package/build/uploadInput/UploadInput.js.map +1 -1
- package/build/uploadInput/UploadInput.mjs +1 -0
- package/build/uploadInput/UploadInput.mjs.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.js +1 -0
- package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
- package/build/uploadInput/uploadButton/UploadButton.mjs +1 -0
- package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
- package/build/uploadInput/uploadButton/defaults.js +1 -0
- package/build/uploadInput/uploadButton/defaults.js.map +1 -1
- package/build/uploadInput/uploadButton/defaults.mjs +1 -0
- package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.js +1 -0
- package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
- package/build/uploadInput/uploadItem/UploadItem.mjs +1 -0
- package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.js +1 -0
- package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
- package/build/withDisplayFormat/WithDisplayFormat.mjs +1 -0
- package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
- package/package.json +19 -21
- 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/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/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/i18n/en.json +0 -2
- package/src/index.ts +2 -2
- package/src/main.css +66 -133
- package/src/main.less +1 -3
- package/src/modal/Modal.css +2 -2
- package/src/modal/Modal.less +1 -1
- 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/prompt/ActionPrompt/ActionPrompt.tsx +62 -9
- package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +2 -9
- package/src/prompt/index.ts +0 -4
- 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.tsx +1 -1
- package/src/sentimentSurface/SentimentSurface.story.tsx +17 -43
- package/src/styles/less/neptune.css +33 -22
- package/src/tooltip/Tooltip.tsx +26 -45
- 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/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/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,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Do not edit directly
|
|
3
|
-
* Generated on
|
|
2
|
+
* Do not edit directly, this file was auto-generated.
|
|
3
|
+
* Generated on Fri, 10 Apr 2026 14:46:00 GMT
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
:root {
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
--radius-small: 10px;
|
|
54
54
|
--radius-medium: 16px;
|
|
55
55
|
--radius-large: 24px;
|
|
56
|
+
--radius-xlarge: 32px;
|
|
56
57
|
--size-4: 4px;
|
|
57
58
|
--size-5: 5px;
|
|
58
59
|
--size-8: 8px;
|
|
@@ -142,8 +143,8 @@
|
|
|
142
143
|
}
|
|
143
144
|
|
|
144
145
|
/**
|
|
145
|
-
* Do not edit directly
|
|
146
|
-
* Generated on
|
|
146
|
+
* Do not edit directly, this file was auto-generated.
|
|
147
|
+
* Generated on Fri, 10 Apr 2026 14:46:00 GMT
|
|
147
148
|
*/
|
|
148
149
|
|
|
149
150
|
.np-theme-personal {
|
|
@@ -236,6 +237,7 @@
|
|
|
236
237
|
--radius-small: 10px;
|
|
237
238
|
--radius-medium: 16px;
|
|
238
239
|
--radius-large: 24px;
|
|
240
|
+
--radius-xlarge: 32px;
|
|
239
241
|
--size-4: 4px;
|
|
240
242
|
--size-5: 5px;
|
|
241
243
|
--size-8: 8px;
|
|
@@ -391,8 +393,8 @@
|
|
|
391
393
|
}
|
|
392
394
|
|
|
393
395
|
/**
|
|
394
|
-
* Do not edit directly
|
|
395
|
-
* Generated on
|
|
396
|
+
* Do not edit directly, this file was auto-generated.
|
|
397
|
+
* Generated on Fri, 10 Apr 2026 14:46:00 GMT
|
|
396
398
|
*/
|
|
397
399
|
|
|
398
400
|
.np-theme-personal--forest-green {
|
|
@@ -485,6 +487,7 @@
|
|
|
485
487
|
--radius-small: 10px;
|
|
486
488
|
--radius-medium: 16px;
|
|
487
489
|
--radius-large: 24px;
|
|
490
|
+
--radius-xlarge: 32px;
|
|
488
491
|
--size-4: 4px;
|
|
489
492
|
--size-5: 5px;
|
|
490
493
|
--size-8: 8px;
|
|
@@ -640,8 +643,8 @@
|
|
|
640
643
|
}
|
|
641
644
|
|
|
642
645
|
/**
|
|
643
|
-
* Do not edit directly
|
|
644
|
-
* Generated on
|
|
646
|
+
* Do not edit directly, this file was auto-generated.
|
|
647
|
+
* Generated on Fri, 10 Apr 2026 14:46:00 GMT
|
|
645
648
|
*/
|
|
646
649
|
|
|
647
650
|
.np-theme-personal--bright-green {
|
|
@@ -734,6 +737,7 @@
|
|
|
734
737
|
--radius-small: 10px;
|
|
735
738
|
--radius-medium: 16px;
|
|
736
739
|
--radius-large: 24px;
|
|
740
|
+
--radius-xlarge: 32px;
|
|
737
741
|
--size-4: 4px;
|
|
738
742
|
--size-5: 5px;
|
|
739
743
|
--size-8: 8px;
|
|
@@ -889,8 +893,8 @@
|
|
|
889
893
|
}
|
|
890
894
|
|
|
891
895
|
/**
|
|
892
|
-
* Do not edit directly
|
|
893
|
-
* Generated on
|
|
896
|
+
* Do not edit directly, this file was auto-generated.
|
|
897
|
+
* Generated on Fri, 10 Apr 2026 14:46:00 GMT
|
|
894
898
|
*/
|
|
895
899
|
|
|
896
900
|
.np-theme-personal--dark {
|
|
@@ -983,6 +987,7 @@
|
|
|
983
987
|
--radius-small: 10px;
|
|
984
988
|
--radius-medium: 16px;
|
|
985
989
|
--radius-large: 24px;
|
|
990
|
+
--radius-xlarge: 32px;
|
|
986
991
|
--size-4: 4px;
|
|
987
992
|
--size-5: 5px;
|
|
988
993
|
--size-8: 8px;
|
|
@@ -1138,8 +1143,8 @@
|
|
|
1138
1143
|
}
|
|
1139
1144
|
|
|
1140
1145
|
/**
|
|
1141
|
-
* Do not edit directly
|
|
1142
|
-
* Generated on
|
|
1146
|
+
* Do not edit directly, this file was auto-generated.
|
|
1147
|
+
* Generated on Fri, 10 Apr 2026 14:46:00 GMT
|
|
1143
1148
|
*/
|
|
1144
1149
|
|
|
1145
1150
|
.np-theme-platform {
|
|
@@ -1232,6 +1237,7 @@
|
|
|
1232
1237
|
--radius-small: 10px;
|
|
1233
1238
|
--radius-medium: 16px;
|
|
1234
1239
|
--radius-large: 24px;
|
|
1240
|
+
--radius-xlarge: 32px;
|
|
1235
1241
|
--size-4: 4px;
|
|
1236
1242
|
--size-5: 5px;
|
|
1237
1243
|
--size-8: 8px;
|
|
@@ -1321,8 +1327,8 @@
|
|
|
1321
1327
|
}
|
|
1322
1328
|
|
|
1323
1329
|
/**
|
|
1324
|
-
* Do not edit directly
|
|
1325
|
-
* Generated on
|
|
1330
|
+
* Do not edit directly, this file was auto-generated.
|
|
1331
|
+
* Generated on Fri, 10 Apr 2026 14:46:00 GMT
|
|
1326
1332
|
*/
|
|
1327
1333
|
|
|
1328
1334
|
.np-theme-platform--forest-green {
|
|
@@ -1415,6 +1421,7 @@
|
|
|
1415
1421
|
--radius-small: 10px;
|
|
1416
1422
|
--radius-medium: 16px;
|
|
1417
1423
|
--radius-large: 24px;
|
|
1424
|
+
--radius-xlarge: 32px;
|
|
1418
1425
|
--size-4: 4px;
|
|
1419
1426
|
--size-5: 5px;
|
|
1420
1427
|
--size-8: 8px;
|
|
@@ -1504,8 +1511,8 @@
|
|
|
1504
1511
|
}
|
|
1505
1512
|
|
|
1506
1513
|
/**
|
|
1507
|
-
* Do not edit directly
|
|
1508
|
-
* Generated on
|
|
1514
|
+
* Do not edit directly, this file was auto-generated.
|
|
1515
|
+
* Generated on Fri, 10 Apr 2026 14:46:00 GMT
|
|
1509
1516
|
*/
|
|
1510
1517
|
|
|
1511
1518
|
.np-theme-business {
|
|
@@ -1599,6 +1606,7 @@
|
|
|
1599
1606
|
--radius-small: 10px;
|
|
1600
1607
|
--radius-medium: 16px;
|
|
1601
1608
|
--radius-large: 24px;
|
|
1609
|
+
--radius-xlarge: 32px;
|
|
1602
1610
|
--size-4: 4px;
|
|
1603
1611
|
--size-5: 5px;
|
|
1604
1612
|
--size-8: 8px;
|
|
@@ -1688,8 +1696,8 @@
|
|
|
1688
1696
|
}
|
|
1689
1697
|
|
|
1690
1698
|
/**
|
|
1691
|
-
* Do not edit directly
|
|
1692
|
-
* Generated on
|
|
1699
|
+
* Do not edit directly, this file was auto-generated.
|
|
1700
|
+
* Generated on Fri, 10 Apr 2026 14:46:00 GMT
|
|
1693
1701
|
*/
|
|
1694
1702
|
|
|
1695
1703
|
.np-theme-business--dark {
|
|
@@ -1783,6 +1791,7 @@
|
|
|
1783
1791
|
--radius-small: 10px;
|
|
1784
1792
|
--radius-medium: 16px;
|
|
1785
1793
|
--radius-large: 24px;
|
|
1794
|
+
--radius-xlarge: 32px;
|
|
1786
1795
|
--size-4: 4px;
|
|
1787
1796
|
--size-5: 5px;
|
|
1788
1797
|
--size-8: 8px;
|
|
@@ -1872,8 +1881,8 @@
|
|
|
1872
1881
|
}
|
|
1873
1882
|
|
|
1874
1883
|
/**
|
|
1875
|
-
* Do not edit directly
|
|
1876
|
-
* Generated on
|
|
1884
|
+
* Do not edit directly, this file was auto-generated.
|
|
1885
|
+
* Generated on Fri, 10 Apr 2026 14:46:00 GMT
|
|
1877
1886
|
*/
|
|
1878
1887
|
|
|
1879
1888
|
.np-theme-business--forest-green {
|
|
@@ -1967,6 +1976,7 @@
|
|
|
1967
1976
|
--radius-small: 10px;
|
|
1968
1977
|
--radius-medium: 16px;
|
|
1969
1978
|
--radius-large: 24px;
|
|
1979
|
+
--radius-xlarge: 32px;
|
|
1970
1980
|
--size-4: 4px;
|
|
1971
1981
|
--size-5: 5px;
|
|
1972
1982
|
--size-8: 8px;
|
|
@@ -2056,8 +2066,8 @@
|
|
|
2056
2066
|
}
|
|
2057
2067
|
|
|
2058
2068
|
/**
|
|
2059
|
-
* Do not edit directly
|
|
2060
|
-
* Generated on
|
|
2069
|
+
* Do not edit directly, this file was auto-generated.
|
|
2070
|
+
* Generated on Fri, 10 Apr 2026 14:46:01 GMT
|
|
2061
2071
|
*/
|
|
2062
2072
|
|
|
2063
2073
|
.np-theme-business--bright-green {
|
|
@@ -2151,6 +2161,7 @@
|
|
|
2151
2161
|
--radius-small: 10px;
|
|
2152
2162
|
--radius-medium: 16px;
|
|
2153
2163
|
--radius-large: 24px;
|
|
2164
|
+
--radius-xlarge: 32px;
|
|
2154
2165
|
--size-4: 4px;
|
|
2155
2166
|
--size-5: 5px;
|
|
2156
2167
|
--size-8: 8px;
|
package/src/tooltip/Tooltip.tsx
CHANGED
|
@@ -1,17 +1,22 @@
|
|
|
1
|
-
|
|
1
|
+
import {
|
|
2
|
+
arrow as arrowMiddleware,
|
|
3
|
+
autoUpdate,
|
|
4
|
+
flip,
|
|
5
|
+
offset,
|
|
6
|
+
useFloating,
|
|
7
|
+
} from '@floating-ui/react';
|
|
2
8
|
import { clsx } from 'clsx';
|
|
3
9
|
import {
|
|
4
10
|
AriaAttributes,
|
|
11
|
+
CSSProperties,
|
|
5
12
|
PropsWithChildren,
|
|
6
13
|
ReactElement,
|
|
7
14
|
ReactNode,
|
|
8
15
|
cloneElement,
|
|
9
|
-
useEffect,
|
|
10
16
|
useId,
|
|
11
17
|
useRef,
|
|
12
18
|
useState,
|
|
13
19
|
} from 'react';
|
|
14
|
-
import { usePopper } from 'react-popper';
|
|
15
20
|
|
|
16
21
|
import { CommonProps, Position } from '../common';
|
|
17
22
|
import {
|
|
@@ -36,48 +41,30 @@ const Tooltip = ({
|
|
|
36
41
|
className,
|
|
37
42
|
}: TooltipProps) => {
|
|
38
43
|
const [open, setOpen] = useState(false);
|
|
39
|
-
const
|
|
40
|
-
const [arrowElement, setArrowElement] = useState(null);
|
|
41
|
-
const [popperElement, setPopperElement] = useState(null);
|
|
44
|
+
const arrowRef = useRef<HTMLDivElement | null>(null);
|
|
42
45
|
|
|
43
46
|
const fallbackId = useId();
|
|
44
47
|
const tooltipId = id ?? fallbackId;
|
|
45
|
-
const modifiers = [];
|
|
46
|
-
|
|
47
|
-
modifiers.push({
|
|
48
|
-
name: 'arrow',
|
|
49
|
-
options: {
|
|
50
|
-
element: arrowElement,
|
|
51
|
-
options: {
|
|
52
|
-
padding: 8, // 8px from the edges of the popper
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
});
|
|
56
|
-
// This lets you displace a popper element from its reference element.
|
|
57
|
-
modifiers.push({ name: 'offset', options: { offset: [0, 16] } });
|
|
58
|
-
modifiers.push({
|
|
59
|
-
name: 'flip',
|
|
60
|
-
options: {
|
|
61
|
-
fallbackPlacements: Position.TOP,
|
|
62
|
-
},
|
|
63
|
-
});
|
|
64
48
|
|
|
65
|
-
const {
|
|
49
|
+
const { refs, floatingStyles, placement, middlewareData } = useFloating({
|
|
66
50
|
placement: position,
|
|
67
|
-
|
|
51
|
+
middleware: [
|
|
52
|
+
offset(16),
|
|
53
|
+
flip({ fallbackPlacements: [Position.TOP] }),
|
|
54
|
+
arrowMiddleware({ element: arrowRef, padding: 8 }),
|
|
55
|
+
],
|
|
56
|
+
whileElementsMounted: open ? autoUpdate : undefined,
|
|
57
|
+
open,
|
|
68
58
|
});
|
|
69
59
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
forceUpdate();
|
|
75
|
-
}
|
|
76
|
-
}, [open]);
|
|
60
|
+
const arrowStyle: CSSProperties = {
|
|
61
|
+
...(middlewareData.arrow?.x != null ? { left: middlewareData.arrow.x } : {}),
|
|
62
|
+
...(middlewareData.arrow?.y != null ? { top: middlewareData.arrow.y } : {}),
|
|
63
|
+
};
|
|
77
64
|
|
|
78
65
|
return (
|
|
79
66
|
<span
|
|
80
|
-
ref={
|
|
67
|
+
ref={refs.setReference}
|
|
81
68
|
className="tw-tooltip-container"
|
|
82
69
|
onMouseOver={() => setOpen(true)}
|
|
83
70
|
onFocus={() => setOpen(true)}
|
|
@@ -90,28 +77,22 @@ const Tooltip = ({
|
|
|
90
77
|
})
|
|
91
78
|
: null}
|
|
92
79
|
<div
|
|
93
|
-
|
|
94
|
-
ref={setPopperElement}
|
|
80
|
+
ref={refs.setFloating}
|
|
95
81
|
className={clsx(
|
|
96
82
|
'np-tooltip',
|
|
97
83
|
'np-panel',
|
|
98
84
|
open ? `np-panel--open np-tooltip--open` : null,
|
|
99
85
|
className,
|
|
100
86
|
)}
|
|
101
|
-
style={
|
|
102
|
-
{
|
|
87
|
+
style={floatingStyles}
|
|
88
|
+
data-popper-placement={placement}
|
|
103
89
|
aria-hidden={!open}
|
|
104
90
|
role="tooltip"
|
|
105
91
|
id={`${tooltipId}-tooltip`}
|
|
106
92
|
>
|
|
107
93
|
<div className="np-panel__content tooltip-inner">
|
|
108
94
|
{label}
|
|
109
|
-
<div
|
|
110
|
-
// @ts-expect-error
|
|
111
|
-
ref={setArrowElement}
|
|
112
|
-
className={clsx('np-panel__arrow')}
|
|
113
|
-
style={styles.arrow}
|
|
114
|
-
/>
|
|
95
|
+
<div ref={arrowRef} className={clsx('np-panel__arrow')} style={arrowStyle} />
|
|
115
96
|
</div>
|
|
116
97
|
</div>
|
|
117
98
|
</span>
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var React = require('react');
|
|
4
|
-
var clsx = require('clsx');
|
|
5
|
-
var Body = require('../../body/Body.js');
|
|
6
|
-
var Button_resolver = require('../../button/Button.resolver.js');
|
|
7
|
-
require('../../common/theme.js');
|
|
8
|
-
require('../../common/direction.js');
|
|
9
|
-
require('../../common/propsValues/control.js');
|
|
10
|
-
var breakpoint = require('../../common/propsValues/breakpoint.js');
|
|
11
|
-
require('../../common/propsValues/size.js');
|
|
12
|
-
var typography = require('../../common/propsValues/typography.js');
|
|
13
|
-
require('../../common/propsValues/width.js');
|
|
14
|
-
require('../../common/propsValues/type.js');
|
|
15
|
-
require('../../common/propsValues/dateMode.js');
|
|
16
|
-
require('../../common/propsValues/monthFormat.js');
|
|
17
|
-
require('../../common/propsValues/position.js');
|
|
18
|
-
require('../../common/propsValues/layouts.js');
|
|
19
|
-
require('../../common/propsValues/status.js');
|
|
20
|
-
require('../../common/propsValues/sentiment.js');
|
|
21
|
-
require('../../common/propsValues/profileType.js');
|
|
22
|
-
require('../../common/propsValues/variant.js');
|
|
23
|
-
require('../../common/propsValues/scroll.js');
|
|
24
|
-
require('../../common/propsValues/markdownNodeType.js');
|
|
25
|
-
require('../../common/fileType.js');
|
|
26
|
-
require('@transferwise/icons');
|
|
27
|
-
require('react-intl');
|
|
28
|
-
require('../../common/closeButton/CloseButton.messages.js');
|
|
29
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
30
|
-
var LiveRegion = require('../../common/liveRegion/LiveRegion.js');
|
|
31
|
-
var PrimitivePrompt = require('../PrimitivePrompt/PrimitivePrompt.js');
|
|
32
|
-
var useScreenSize = require('../../common/hooks/useScreenSize.js');
|
|
33
|
-
var promptMedia = require('../helpers/promptMedia.js');
|
|
34
|
-
var Expander = require('../common/Expander/Expander.js');
|
|
35
|
-
var helpers = require('./helpers.js');
|
|
36
|
-
|
|
37
|
-
const CriticalBanner = ({
|
|
38
|
-
sentiment = 'negative',
|
|
39
|
-
title,
|
|
40
|
-
description,
|
|
41
|
-
media = {},
|
|
42
|
-
action,
|
|
43
|
-
actionSecondary,
|
|
44
|
-
expanded = true,
|
|
45
|
-
onToggle,
|
|
46
|
-
id,
|
|
47
|
-
className,
|
|
48
|
-
'data-testid': testId
|
|
49
|
-
}) => {
|
|
50
|
-
const isMobile = !useScreenSize.useScreenSize(breakpoint.Breakpoint.EXTRA_SMALL);
|
|
51
|
-
const resolvedExpanded = !isMobile || expanded;
|
|
52
|
-
const hasActions = action ?? actionSecondary;
|
|
53
|
-
const mediaId = React.useId();
|
|
54
|
-
const titleId = React.useId();
|
|
55
|
-
const descId = React.useId();
|
|
56
|
-
const ariaLabelledByIds = [media['aria-hidden'] ? undefined : mediaId, !title ? undefined : titleId].filter(Boolean).join(' ');
|
|
57
|
-
return /*#__PURE__*/jsxRuntime.jsx(LiveRegion.LiveRegion, {
|
|
58
|
-
"aria-live": "assertive",
|
|
59
|
-
announceOnChange: helpers.buildAnnouncementString({
|
|
60
|
-
title,
|
|
61
|
-
description,
|
|
62
|
-
expanded: resolvedExpanded,
|
|
63
|
-
actionLabel: action?.label,
|
|
64
|
-
actionSecondaryLabel: actionSecondary?.label
|
|
65
|
-
}),
|
|
66
|
-
children: /*#__PURE__*/jsxRuntime.jsxs(PrimitivePrompt.PrimitivePrompt, {
|
|
67
|
-
id: id,
|
|
68
|
-
sentiment: sentiment,
|
|
69
|
-
emphasis: sentiment === 'neutral' ? 'base' : 'elevated',
|
|
70
|
-
"data-testid": testId,
|
|
71
|
-
className: clsx.clsx('wds-critical-banner', {
|
|
72
|
-
'wds-critical-banner__mobile--collapsed': !resolvedExpanded,
|
|
73
|
-
'wds-critical-banner--with-two-actions': !!actionSecondary
|
|
74
|
-
}, className),
|
|
75
|
-
media: promptMedia.renderPromptMedia({
|
|
76
|
-
media,
|
|
77
|
-
sentiment,
|
|
78
|
-
mediaId,
|
|
79
|
-
imgClassName: 'wds-critical-banner--media-image'
|
|
80
|
-
}),
|
|
81
|
-
actions: Expander.shouldShowWhenExpanded({
|
|
82
|
-
expanded: resolvedExpanded,
|
|
83
|
-
hasContent: !!hasActions
|
|
84
|
-
}) ? /*#__PURE__*/jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
85
|
-
children: [actionSecondary &&
|
|
86
|
-
/*#__PURE__*/
|
|
87
|
-
// @ts-expect-error onClick type mismatch
|
|
88
|
-
jsxRuntime.jsx(Button_resolver.default, {
|
|
89
|
-
v2: true,
|
|
90
|
-
size: "md",
|
|
91
|
-
priority: "secondary",
|
|
92
|
-
href: actionSecondary.href,
|
|
93
|
-
block: isMobile,
|
|
94
|
-
onClick: actionSecondary?.onClick,
|
|
95
|
-
children: actionSecondary.label
|
|
96
|
-
}), action &&
|
|
97
|
-
/*#__PURE__*/
|
|
98
|
-
// @ts-expect-error onClick type mismatch
|
|
99
|
-
jsxRuntime.jsx(Button_resolver.default, {
|
|
100
|
-
v2: true,
|
|
101
|
-
size: "md",
|
|
102
|
-
priority: "primary",
|
|
103
|
-
href: action.href,
|
|
104
|
-
block: isMobile,
|
|
105
|
-
onClick: action.onClick,
|
|
106
|
-
children: action.label
|
|
107
|
-
})]
|
|
108
|
-
}) : undefined,
|
|
109
|
-
role: "region",
|
|
110
|
-
"aria-labelledby": ariaLabelledByIds,
|
|
111
|
-
"aria-describedby": descId,
|
|
112
|
-
children: [/*#__PURE__*/jsxRuntime.jsxs("div", {
|
|
113
|
-
className: clsx.clsx('d-flex', 'flex-column', 'justify-content-center', 'wds-critical-banner__text-wrapper'),
|
|
114
|
-
children: [title && /*#__PURE__*/jsxRuntime.jsx(Body.default, {
|
|
115
|
-
id: titleId,
|
|
116
|
-
type: typography.Typography.BODY_LARGE_BOLD,
|
|
117
|
-
className: clsx.clsx('wds-critical-banner__content', {
|
|
118
|
-
'wds-critical-banner__title--collapsed': !resolvedExpanded
|
|
119
|
-
}),
|
|
120
|
-
children: title
|
|
121
|
-
}), Expander.shouldShowWhenExpanded({
|
|
122
|
-
expanded: resolvedExpanded,
|
|
123
|
-
hasContent: !!description,
|
|
124
|
-
alwaysShow: !title
|
|
125
|
-
}) && /*#__PURE__*/jsxRuntime.jsx(Body.default, {
|
|
126
|
-
id: descId,
|
|
127
|
-
className: clsx.clsx('wds-critical-banner__content', {
|
|
128
|
-
'wds-critical-banner__description--collapsed': !resolvedExpanded && !title
|
|
129
|
-
}),
|
|
130
|
-
children: description
|
|
131
|
-
})]
|
|
132
|
-
}), isMobile && /*#__PURE__*/jsxRuntime.jsx(Expander.ExpanderToggle, {
|
|
133
|
-
expanded: expanded,
|
|
134
|
-
size: 24,
|
|
135
|
-
className: "wds-critical-banner__toggle",
|
|
136
|
-
onToggle: onToggle
|
|
137
|
-
})]
|
|
138
|
-
})
|
|
139
|
-
});
|
|
140
|
-
};
|
|
141
|
-
|
|
142
|
-
exports.CriticalBanner = CriticalBanner;
|
|
143
|
-
//# sourceMappingURL=CriticalBanner.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CriticalBanner.js","sources":["../../../src/prompt/CriticalBanner/CriticalBanner.tsx"],"sourcesContent":["import { ReactNode, useId } from 'react';\nimport { clsx } from 'clsx';\n\nimport Body from '../../body';\nimport Button from '../../button';\nimport { Breakpoint, LiveRegion, Typography } from '../../common';\nimport { ButtonProps } from '../../button/Button.types';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\nimport { useScreenSize } from '../../common/hooks/useScreenSize';\n\nimport { renderPromptMedia, PromptMedia } from '../helpers/promptMedia';\nimport { shouldShowWhenExpanded, ExpanderToggle } from '../common/Expander/Expander';\nimport { buildAnnouncementString } from './helpers';\n\nexport type CriticalBannerProps = {\n title?: ReactNode;\n description?: ReactNode;\n media?: PromptMedia;\n action?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n sentiment?: Exclude<PrimitivePromptProps['sentiment'], 'proposition'>;\n /**\n * Controls whether the description and actions are visible.\n * When collapsed with a title, only the title is shown.\n * When collapsed without a title, the description is trimmed to 2 lines.\n */\n expanded?: boolean;\n /** Called when the user clicks the chevron toggle. */\n onToggle?: () => void;\n} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid'>;\n\n/**\n * A full-width, non-dismissible banner for critical messages such as account blocks or\n * time-sensitive actions that require immediate user attention.\n\n * @see {@link https://wise.design/components/critical-banner Design Spec}\n */\nexport const CriticalBanner = ({\n sentiment = 'negative',\n title,\n description,\n media = {},\n action,\n actionSecondary,\n expanded = true,\n onToggle,\n id,\n className,\n 'data-testid': testId,\n}: CriticalBannerProps) => {\n const isMobile = !useScreenSize(Breakpoint.EXTRA_SMALL);\n const resolvedExpanded = !isMobile || expanded;\n const hasActions = action ?? actionSecondary;\n const mediaId = useId();\n const titleId = useId();\n const descId = useId();\n\n const ariaLabelledByIds = [\n media['aria-hidden'] ? undefined : mediaId,\n !title ? undefined : titleId,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <LiveRegion\n aria-live=\"assertive\"\n announceOnChange={buildAnnouncementString({\n title,\n description,\n expanded: resolvedExpanded,\n actionLabel: action?.label,\n actionSecondaryLabel: actionSecondary?.label,\n })}\n >\n <PrimitivePrompt\n id={id}\n sentiment={sentiment}\n emphasis={sentiment === 'neutral' ? 'base' : 'elevated'}\n data-testid={testId}\n className={clsx(\n 'wds-critical-banner',\n {\n 'wds-critical-banner__mobile--collapsed': !resolvedExpanded,\n 'wds-critical-banner--with-two-actions': !!actionSecondary,\n },\n className,\n )}\n media={renderPromptMedia({\n media,\n sentiment,\n mediaId,\n imgClassName: 'wds-critical-banner--media-image',\n })}\n actions={\n shouldShowWhenExpanded({ expanded: resolvedExpanded, hasContent: !!hasActions }) ? (\n <>\n {actionSecondary && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"secondary\"\n href={actionSecondary.href}\n block={isMobile}\n onClick={actionSecondary?.onClick}\n >\n {actionSecondary.label}\n </Button>\n )}\n {action && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"primary\"\n href={action.href}\n block={isMobile}\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n )}\n </>\n ) : undefined\n }\n role=\"region\"\n aria-labelledby={ariaLabelledByIds}\n aria-describedby={descId}\n >\n <div\n className={clsx(\n 'd-flex',\n 'flex-column',\n 'justify-content-center',\n 'wds-critical-banner__text-wrapper',\n )}\n >\n {title && (\n <Body\n id={titleId}\n type={Typography.BODY_LARGE_BOLD}\n className={clsx('wds-critical-banner__content', {\n 'wds-critical-banner__title--collapsed': !resolvedExpanded,\n })}\n >\n {title}\n </Body>\n )}\n {shouldShowWhenExpanded({\n expanded: resolvedExpanded,\n hasContent: !!description,\n alwaysShow: !title,\n }) && (\n <Body\n id={descId}\n className={clsx('wds-critical-banner__content', {\n 'wds-critical-banner__description--collapsed': !resolvedExpanded && !title,\n })}\n >\n {description}\n </Body>\n )}\n </div>\n {isMobile && (\n <ExpanderToggle\n expanded={expanded}\n size={24}\n className=\"wds-critical-banner__toggle\"\n onToggle={onToggle}\n />\n )}\n </PrimitivePrompt>\n </LiveRegion>\n );\n};\n\nexport default CriticalBanner;\n"],"names":["CriticalBanner","sentiment","title","description","media","action","actionSecondary","expanded","onToggle","id","className","testId","isMobile","useScreenSize","Breakpoint","EXTRA_SMALL","resolvedExpanded","hasActions","mediaId","useId","titleId","descId","ariaLabelledByIds","undefined","filter","Boolean","join","_jsx","LiveRegion","announceOnChange","buildAnnouncementString","actionLabel","label","actionSecondaryLabel","children","_jsxs","PrimitivePrompt","emphasis","clsx","renderPromptMedia","imgClassName","actions","shouldShowWhenExpanded","hasContent","_Fragment","Button","v2","size","priority","href","block","onClick","role","Body","type","Typography","BODY_LARGE_BOLD","alwaysShow","ExpanderToggle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCO,MAAMA,cAAc,GAAGA,CAAC;AAC7BC,EAAAA,SAAS,GAAG,UAAU;EACtBC,KAAK;EACLC,WAAW;EACXC,KAAK,GAAG,EAAE;EACVC,MAAM;EACNC,eAAe;AACfC,EAAAA,QAAQ,GAAG,IAAI;EACfC,QAAQ;EACRC,EAAE;EACFC,SAAS;AACT,EAAA,aAAa,EAAEC;AAAM,CACD,KAAI;EACxB,MAAMC,QAAQ,GAAG,CAACC,2BAAa,CAACC,qBAAU,CAACC,WAAW,CAAC;AACvD,EAAA,MAAMC,gBAAgB,GAAG,CAACJ,QAAQ,IAAIL,QAAQ;AAC9C,EAAA,MAAMU,UAAU,GAAGZ,MAAM,IAAIC,eAAe;AAC5C,EAAA,MAAMY,OAAO,GAAGC,WAAK,EAAE;AACvB,EAAA,MAAMC,OAAO,GAAGD,WAAK,EAAE;AACvB,EAAA,MAAME,MAAM,GAAGF,WAAK,EAAE;AAEtB,EAAA,MAAMG,iBAAiB,GAAG,CACxBlB,KAAK,CAAC,aAAa,CAAC,GAAGmB,SAAS,GAAGL,OAAO,EAC1C,CAAChB,KAAK,GAAGqB,SAAS,GAAGH,OAAO,CAC7B,CACEI,MAAM,CAACC,OAAO,CAAC,CACfC,IAAI,CAAC,GAAG,CAAC;EAEZ,oBACEC,cAAA,CAACC,qBAAU,EAAA;AACT,IAAA,WAAA,EAAU,WAAW;IACrBC,gBAAgB,EAAEC,+BAAuB,CAAC;MACxC5B,KAAK;MACLC,WAAW;AACXI,MAAAA,QAAQ,EAAES,gBAAgB;MAC1Be,WAAW,EAAE1B,MAAM,EAAE2B,KAAK;MAC1BC,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SAAS,EAAC,6BAA6B;AACvCF,QAAAA,QAAQ,EAAEA;AAAS,OAAA,CAEtB;KACc;AACnB,GAAY,CAAC;AAEjB;;;;"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { useId } from 'react';
|
|
2
|
-
import { clsx } from 'clsx';
|
|
3
|
-
import Body from '../../body/Body.mjs';
|
|
4
|
-
import Button from '../../button/Button.resolver.mjs';
|
|
5
|
-
import '../../common/theme.mjs';
|
|
6
|
-
import '../../common/direction.mjs';
|
|
7
|
-
import '../../common/propsValues/control.mjs';
|
|
8
|
-
import { Breakpoint } from '../../common/propsValues/breakpoint.mjs';
|
|
9
|
-
import '../../common/propsValues/size.mjs';
|
|
10
|
-
import { Typography } from '../../common/propsValues/typography.mjs';
|
|
11
|
-
import '../../common/propsValues/width.mjs';
|
|
12
|
-
import '../../common/propsValues/type.mjs';
|
|
13
|
-
import '../../common/propsValues/dateMode.mjs';
|
|
14
|
-
import '../../common/propsValues/monthFormat.mjs';
|
|
15
|
-
import '../../common/propsValues/position.mjs';
|
|
16
|
-
import '../../common/propsValues/layouts.mjs';
|
|
17
|
-
import '../../common/propsValues/status.mjs';
|
|
18
|
-
import '../../common/propsValues/sentiment.mjs';
|
|
19
|
-
import '../../common/propsValues/profileType.mjs';
|
|
20
|
-
import '../../common/propsValues/variant.mjs';
|
|
21
|
-
import '../../common/propsValues/scroll.mjs';
|
|
22
|
-
import '../../common/propsValues/markdownNodeType.mjs';
|
|
23
|
-
import '../../common/fileType.mjs';
|
|
24
|
-
import '@transferwise/icons';
|
|
25
|
-
import 'react-intl';
|
|
26
|
-
import '../../common/closeButton/CloseButton.messages.mjs';
|
|
27
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
28
|
-
import { LiveRegion } from '../../common/liveRegion/LiveRegion.mjs';
|
|
29
|
-
import { PrimitivePrompt } from '../PrimitivePrompt/PrimitivePrompt.mjs';
|
|
30
|
-
import { useScreenSize } from '../../common/hooks/useScreenSize.mjs';
|
|
31
|
-
import { renderPromptMedia } from '../helpers/promptMedia.mjs';
|
|
32
|
-
import { shouldShowWhenExpanded, ExpanderToggle } from '../common/Expander/Expander.mjs';
|
|
33
|
-
import { buildAnnouncementString } from './helpers.mjs';
|
|
34
|
-
|
|
35
|
-
const CriticalBanner = ({
|
|
36
|
-
sentiment = 'negative',
|
|
37
|
-
title,
|
|
38
|
-
description,
|
|
39
|
-
media = {},
|
|
40
|
-
action,
|
|
41
|
-
actionSecondary,
|
|
42
|
-
expanded = true,
|
|
43
|
-
onToggle,
|
|
44
|
-
id,
|
|
45
|
-
className,
|
|
46
|
-
'data-testid': testId
|
|
47
|
-
}) => {
|
|
48
|
-
const isMobile = !useScreenSize(Breakpoint.EXTRA_SMALL);
|
|
49
|
-
const resolvedExpanded = !isMobile || expanded;
|
|
50
|
-
const hasActions = action ?? actionSecondary;
|
|
51
|
-
const mediaId = useId();
|
|
52
|
-
const titleId = useId();
|
|
53
|
-
const descId = useId();
|
|
54
|
-
const ariaLabelledByIds = [media['aria-hidden'] ? undefined : mediaId, !title ? undefined : titleId].filter(Boolean).join(' ');
|
|
55
|
-
return /*#__PURE__*/jsx(LiveRegion, {
|
|
56
|
-
"aria-live": "assertive",
|
|
57
|
-
announceOnChange: buildAnnouncementString({
|
|
58
|
-
title,
|
|
59
|
-
description,
|
|
60
|
-
expanded: resolvedExpanded,
|
|
61
|
-
actionLabel: action?.label,
|
|
62
|
-
actionSecondaryLabel: actionSecondary?.label
|
|
63
|
-
}),
|
|
64
|
-
children: /*#__PURE__*/jsxs(PrimitivePrompt, {
|
|
65
|
-
id: id,
|
|
66
|
-
sentiment: sentiment,
|
|
67
|
-
emphasis: sentiment === 'neutral' ? 'base' : 'elevated',
|
|
68
|
-
"data-testid": testId,
|
|
69
|
-
className: clsx('wds-critical-banner', {
|
|
70
|
-
'wds-critical-banner__mobile--collapsed': !resolvedExpanded,
|
|
71
|
-
'wds-critical-banner--with-two-actions': !!actionSecondary
|
|
72
|
-
}, className),
|
|
73
|
-
media: renderPromptMedia({
|
|
74
|
-
media,
|
|
75
|
-
sentiment,
|
|
76
|
-
mediaId,
|
|
77
|
-
imgClassName: 'wds-critical-banner--media-image'
|
|
78
|
-
}),
|
|
79
|
-
actions: shouldShowWhenExpanded({
|
|
80
|
-
expanded: resolvedExpanded,
|
|
81
|
-
hasContent: !!hasActions
|
|
82
|
-
}) ? /*#__PURE__*/jsxs(Fragment, {
|
|
83
|
-
children: [actionSecondary &&
|
|
84
|
-
/*#__PURE__*/
|
|
85
|
-
// @ts-expect-error onClick type mismatch
|
|
86
|
-
jsx(Button, {
|
|
87
|
-
v2: true,
|
|
88
|
-
size: "md",
|
|
89
|
-
priority: "secondary",
|
|
90
|
-
href: actionSecondary.href,
|
|
91
|
-
block: isMobile,
|
|
92
|
-
onClick: actionSecondary?.onClick,
|
|
93
|
-
children: actionSecondary.label
|
|
94
|
-
}), action &&
|
|
95
|
-
/*#__PURE__*/
|
|
96
|
-
// @ts-expect-error onClick type mismatch
|
|
97
|
-
jsx(Button, {
|
|
98
|
-
v2: true,
|
|
99
|
-
size: "md",
|
|
100
|
-
priority: "primary",
|
|
101
|
-
href: action.href,
|
|
102
|
-
block: isMobile,
|
|
103
|
-
onClick: action.onClick,
|
|
104
|
-
children: action.label
|
|
105
|
-
})]
|
|
106
|
-
}) : undefined,
|
|
107
|
-
role: "region",
|
|
108
|
-
"aria-labelledby": ariaLabelledByIds,
|
|
109
|
-
"aria-describedby": descId,
|
|
110
|
-
children: [/*#__PURE__*/jsxs("div", {
|
|
111
|
-
className: clsx('d-flex', 'flex-column', 'justify-content-center', 'wds-critical-banner__text-wrapper'),
|
|
112
|
-
children: [title && /*#__PURE__*/jsx(Body, {
|
|
113
|
-
id: titleId,
|
|
114
|
-
type: Typography.BODY_LARGE_BOLD,
|
|
115
|
-
className: clsx('wds-critical-banner__content', {
|
|
116
|
-
'wds-critical-banner__title--collapsed': !resolvedExpanded
|
|
117
|
-
}),
|
|
118
|
-
children: title
|
|
119
|
-
}), shouldShowWhenExpanded({
|
|
120
|
-
expanded: resolvedExpanded,
|
|
121
|
-
hasContent: !!description,
|
|
122
|
-
alwaysShow: !title
|
|
123
|
-
}) && /*#__PURE__*/jsx(Body, {
|
|
124
|
-
id: descId,
|
|
125
|
-
className: clsx('wds-critical-banner__content', {
|
|
126
|
-
'wds-critical-banner__description--collapsed': !resolvedExpanded && !title
|
|
127
|
-
}),
|
|
128
|
-
children: description
|
|
129
|
-
})]
|
|
130
|
-
}), isMobile && /*#__PURE__*/jsx(ExpanderToggle, {
|
|
131
|
-
expanded: expanded,
|
|
132
|
-
size: 24,
|
|
133
|
-
className: "wds-critical-banner__toggle",
|
|
134
|
-
onToggle: onToggle
|
|
135
|
-
})]
|
|
136
|
-
})
|
|
137
|
-
});
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
export { CriticalBanner };
|
|
141
|
-
//# sourceMappingURL=CriticalBanner.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CriticalBanner.mjs","sources":["../../../src/prompt/CriticalBanner/CriticalBanner.tsx"],"sourcesContent":["import { ReactNode, useId } from 'react';\nimport { clsx } from 'clsx';\n\nimport Body from '../../body';\nimport Button from '../../button';\nimport { Breakpoint, LiveRegion, Typography } from '../../common';\nimport { ButtonProps } from '../../button/Button.types';\nimport { PrimitivePrompt, PrimitivePromptProps } from '../PrimitivePrompt';\nimport { useScreenSize } from '../../common/hooks/useScreenSize';\n\nimport { renderPromptMedia, PromptMedia } from '../helpers/promptMedia';\nimport { shouldShowWhenExpanded, ExpanderToggle } from '../common/Expander/Expander';\nimport { buildAnnouncementString } from './helpers';\n\nexport type CriticalBannerProps = {\n title?: ReactNode;\n description?: ReactNode;\n media?: PromptMedia;\n action?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n actionSecondary?: Pick<ButtonProps, 'onClick' | 'href' | 'target'> & {\n label: ButtonProps['children'];\n };\n sentiment?: Exclude<PrimitivePromptProps['sentiment'], 'proposition'>;\n /**\n * Controls whether the description and actions are visible.\n * When collapsed with a title, only the title is shown.\n * When collapsed without a title, the description is trimmed to 2 lines.\n */\n expanded?: boolean;\n /** Called when the user clicks the chevron toggle. */\n onToggle?: () => void;\n} & Pick<PrimitivePromptProps, 'id' | 'className' | 'data-testid'>;\n\n/**\n * A full-width, non-dismissible banner for critical messages such as account blocks or\n * time-sensitive actions that require immediate user attention.\n\n * @see {@link https://wise.design/components/critical-banner Design Spec}\n */\nexport const CriticalBanner = ({\n sentiment = 'negative',\n title,\n description,\n media = {},\n action,\n actionSecondary,\n expanded = true,\n onToggle,\n id,\n className,\n 'data-testid': testId,\n}: CriticalBannerProps) => {\n const isMobile = !useScreenSize(Breakpoint.EXTRA_SMALL);\n const resolvedExpanded = !isMobile || expanded;\n const hasActions = action ?? actionSecondary;\n const mediaId = useId();\n const titleId = useId();\n const descId = useId();\n\n const ariaLabelledByIds = [\n media['aria-hidden'] ? undefined : mediaId,\n !title ? undefined : titleId,\n ]\n .filter(Boolean)\n .join(' ');\n\n return (\n <LiveRegion\n aria-live=\"assertive\"\n announceOnChange={buildAnnouncementString({\n title,\n description,\n expanded: resolvedExpanded,\n actionLabel: action?.label,\n actionSecondaryLabel: actionSecondary?.label,\n })}\n >\n <PrimitivePrompt\n id={id}\n sentiment={sentiment}\n emphasis={sentiment === 'neutral' ? 'base' : 'elevated'}\n data-testid={testId}\n className={clsx(\n 'wds-critical-banner',\n {\n 'wds-critical-banner__mobile--collapsed': !resolvedExpanded,\n 'wds-critical-banner--with-two-actions': !!actionSecondary,\n },\n className,\n )}\n media={renderPromptMedia({\n media,\n sentiment,\n mediaId,\n imgClassName: 'wds-critical-banner--media-image',\n })}\n actions={\n shouldShowWhenExpanded({ expanded: resolvedExpanded, hasContent: !!hasActions }) ? (\n <>\n {actionSecondary && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"secondary\"\n href={actionSecondary.href}\n block={isMobile}\n onClick={actionSecondary?.onClick}\n >\n {actionSecondary.label}\n </Button>\n )}\n {action && (\n // @ts-expect-error onClick type mismatch\n <Button\n v2\n size=\"md\"\n priority=\"primary\"\n href={action.href}\n block={isMobile}\n onClick={action.onClick}\n >\n {action.label}\n </Button>\n )}\n </>\n ) : undefined\n }\n role=\"region\"\n aria-labelledby={ariaLabelledByIds}\n aria-describedby={descId}\n >\n <div\n className={clsx(\n 'd-flex',\n 'flex-column',\n 'justify-content-center',\n 'wds-critical-banner__text-wrapper',\n )}\n >\n {title && (\n <Body\n id={titleId}\n type={Typography.BODY_LARGE_BOLD}\n className={clsx('wds-critical-banner__content', {\n 'wds-critical-banner__title--collapsed': !resolvedExpanded,\n })}\n >\n {title}\n </Body>\n )}\n {shouldShowWhenExpanded({\n expanded: resolvedExpanded,\n hasContent: !!description,\n alwaysShow: !title,\n }) && (\n <Body\n id={descId}\n className={clsx('wds-critical-banner__content', {\n 'wds-critical-banner__description--collapsed': !resolvedExpanded && !title,\n })}\n >\n {description}\n </Body>\n )}\n </div>\n {isMobile && (\n <ExpanderToggle\n expanded={expanded}\n size={24}\n className=\"wds-critical-banner__toggle\"\n onToggle={onToggle}\n />\n )}\n </PrimitivePrompt>\n </LiveRegion>\n );\n};\n\nexport default CriticalBanner;\n"],"names":["CriticalBanner","sentiment","title","description","media","action","actionSecondary","expanded","onToggle","id","className","testId","isMobile","useScreenSize","Breakpoint","EXTRA_SMALL","resolvedExpanded","hasActions","mediaId","useId","titleId","descId","ariaLabelledByIds","undefined","filter","Boolean","join","_jsx","LiveRegion","announceOnChange","buildAnnouncementString","actionLabel","label","actionSecondaryLabel","children","_jsxs","PrimitivePrompt","emphasis","clsx","renderPromptMedia","imgClassName","actions","shouldShowWhenExpanded","hasContent","_Fragment","Button","v2","size","priority","href","block","onClick","role","Body","type","Typography","BODY_LARGE_BOLD","alwaysShow","ExpanderToggle"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyCO,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