@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.
Files changed (425) hide show
  1. package/build/accordion/AccordionItem/AccordionItem.js +1 -1
  2. package/build/accordion/AccordionItem/AccordionItem.mjs +1 -1
  3. package/build/actionButton/ActionButton.js +1 -1
  4. package/build/actionButton/ActionButton.mjs +1 -1
  5. package/build/actionOption/ActionOption.js +1 -1
  6. package/build/actionOption/ActionOption.mjs +1 -1
  7. package/build/alert/Alert.js +1 -1
  8. package/build/alert/Alert.mjs +1 -1
  9. package/build/alert/inlineMarkdown/InlineMarkdown.js +1 -1
  10. package/build/alert/inlineMarkdown/InlineMarkdown.mjs +1 -1
  11. package/build/avatar/Avatar.js +1 -1
  12. package/build/avatar/Avatar.mjs +1 -1
  13. package/build/avatarLayout/AvatarLayout.js +1 -1
  14. package/build/avatarLayout/AvatarLayout.mjs +1 -1
  15. package/build/avatarView/AvatarView.js +1 -1
  16. package/build/avatarView/AvatarView.mjs +1 -1
  17. package/build/avatarWrapper/AvatarWrapper.js +1 -1
  18. package/build/avatarWrapper/AvatarWrapper.mjs +1 -1
  19. package/build/badge/Badge.js +1 -1
  20. package/build/badge/Badge.mjs +1 -1
  21. package/build/button/Button.js +1 -1
  22. package/build/button/Button.mjs +1 -1
  23. package/build/button/LegacyButton.js +1 -1
  24. package/build/button/LegacyButton.mjs +1 -1
  25. package/build/button/classMap.js +1 -1
  26. package/build/button/classMap.mjs +1 -1
  27. package/build/button/legacyUtils/legacyUtils.js +1 -1
  28. package/build/button/legacyUtils/legacyUtils.mjs +1 -1
  29. package/build/card/Card.js +1 -1
  30. package/build/card/Card.mjs +1 -1
  31. package/build/checkbox/Checkbox.js +1 -1
  32. package/build/checkbox/Checkbox.mjs +1 -1
  33. package/build/chevron/Chevron.js +1 -1
  34. package/build/chevron/Chevron.mjs +1 -1
  35. package/build/chips/Chip.js +1 -1
  36. package/build/chips/Chip.mjs +1 -1
  37. package/build/circularButton/CircularButton.js +2 -2
  38. package/build/circularButton/CircularButton.js.map +1 -1
  39. package/build/circularButton/CircularButton.mjs +2 -2
  40. package/build/circularButton/CircularButton.mjs.map +1 -1
  41. package/build/common/bottomSheet/BottomSheet.js +2 -2
  42. package/build/common/bottomSheet/BottomSheet.js.map +1 -1
  43. package/build/common/bottomSheet/BottomSheet.mjs +2 -2
  44. package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
  45. package/build/common/circle/Circle.js +2 -2
  46. package/build/common/circle/Circle.js.map +1 -1
  47. package/build/common/circle/Circle.mjs +2 -2
  48. package/build/common/circle/Circle.mjs.map +1 -1
  49. package/build/common/hooks/useLayout/useLayout.js +6 -6
  50. package/build/common/hooks/useLayout/useLayout.js.map +1 -1
  51. package/build/common/hooks/useLayout/useLayout.mjs +1 -1
  52. package/build/common/hooks/useLayout/useLayout.mjs.map +1 -1
  53. package/build/common/hooks/useScreenSize.js.map +1 -1
  54. package/build/common/hooks/useScreenSize.mjs.map +1 -1
  55. package/build/common/panel/Panel.js +1 -1
  56. package/build/common/panel/Panel.mjs +1 -1
  57. package/build/common/propsValues/breakpoint.js +12 -0
  58. package/build/common/propsValues/breakpoint.js.map +1 -0
  59. package/build/common/propsValues/breakpoint.mjs +12 -0
  60. package/build/common/propsValues/breakpoint.mjs.map +1 -0
  61. package/build/common/responsivePanel/ResponsivePanel.js +1 -1
  62. package/build/common/responsivePanel/ResponsivePanel.mjs +1 -1
  63. package/build/criticalBanner/CriticalCommsBanner.js +1 -1
  64. package/build/criticalBanner/CriticalCommsBanner.mjs +1 -1
  65. package/build/dateInput/DateInput.js +1 -1
  66. package/build/dateInput/DateInput.mjs +1 -1
  67. package/build/dateLookup/DateLookup.js +2 -2
  68. package/build/dateLookup/DateLookup.js.map +1 -1
  69. package/build/dateLookup/DateLookup.mjs +1 -1
  70. package/build/dateLookup/DateLookup.mjs.map +1 -1
  71. package/build/dateLookup/dateHeader/DateHeader.js +1 -1
  72. package/build/dateLookup/dateHeader/DateHeader.mjs +1 -1
  73. package/build/dateLookup/dateTrigger/DateTrigger.js +1 -1
  74. package/build/dateLookup/dateTrigger/DateTrigger.mjs +1 -1
  75. package/build/decision/Decision.js +3 -3
  76. package/build/decision/Decision.js.map +1 -1
  77. package/build/decision/Decision.mjs +1 -1
  78. package/build/decision/Decision.mjs.map +1 -1
  79. package/build/definitionList/DefinitionList.js +1 -1
  80. package/build/definitionList/DefinitionList.mjs +1 -1
  81. package/build/dimmer/Dimmer.js +1 -1
  82. package/build/dimmer/Dimmer.mjs +1 -1
  83. package/build/display/Display.js +1 -1
  84. package/build/display/Display.mjs +1 -1
  85. package/build/drawer/Drawer.js +1 -1
  86. package/build/drawer/Drawer.mjs +1 -1
  87. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +1 -1
  88. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +1 -1
  89. package/build/field/Field.js +1 -1
  90. package/build/field/Field.mjs +1 -1
  91. package/build/flowNavigation/FlowNavigation.js +3 -3
  92. package/build/flowNavigation/FlowNavigation.js.map +1 -1
  93. package/build/flowNavigation/FlowNavigation.mjs +1 -1
  94. package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
  95. package/build/header/Header.js +1 -1
  96. package/build/header/Header.mjs +1 -1
  97. package/build/image/Image.js +1 -1
  98. package/build/image/Image.mjs +1 -1
  99. package/build/index.js +2 -2
  100. package/build/index.mjs +1 -1
  101. package/build/info/Info.js +1 -1
  102. package/build/info/Info.mjs +1 -1
  103. package/build/inlineAlert/InlineAlert.js +1 -1
  104. package/build/inlineAlert/InlineAlert.mjs +1 -1
  105. package/build/inputs/SearchInput.js +1 -1
  106. package/build/inputs/SearchInput.mjs +1 -1
  107. package/build/inputs/SelectInput/SelectInput.js +2 -2
  108. package/build/inputs/SelectInput/SelectInput.js.map +1 -1
  109. package/build/inputs/SelectInput/SelectInput.mjs +1 -1
  110. package/build/inputs/SelectInput/SelectInput.mjs.map +1 -1
  111. package/build/instructionsList/InstructionsList.js +1 -1
  112. package/build/instructionsList/InstructionsList.mjs +1 -1
  113. package/build/link/Link.js +1 -1
  114. package/build/link/Link.mjs +1 -1
  115. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +1 -1
  116. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +1 -1
  117. package/build/listItem/ListItem.js +1 -1
  118. package/build/listItem/ListItem.mjs +1 -1
  119. package/build/listItem/Prompt/ListItemPrompt.js +1 -1
  120. package/build/listItem/Prompt/ListItemPrompt.mjs +1 -1
  121. package/build/loader/Loader.js +1 -1
  122. package/build/loader/Loader.mjs +1 -1
  123. package/build/logo/Logo.js +3 -3
  124. package/build/logo/Logo.js.map +1 -1
  125. package/build/logo/Logo.mjs +2 -2
  126. package/build/logo/Logo.mjs.map +1 -1
  127. package/build/main.css +477 -319
  128. package/build/markdown/Markdown.js +1 -1
  129. package/build/markdown/Markdown.mjs +1 -1
  130. package/build/modal/Modal.js +3 -3
  131. package/build/modal/Modal.js.map +1 -1
  132. package/build/modal/Modal.mjs +3 -3
  133. package/build/modal/Modal.mjs.map +1 -1
  134. package/build/moneyInput/MoneyInput.js +1 -1
  135. package/build/moneyInput/MoneyInput.mjs +1 -1
  136. package/build/navigationOption/NavigationOption.js +1 -1
  137. package/build/navigationOption/NavigationOption.mjs +1 -1
  138. package/build/nudge/Nudge.js +1 -1
  139. package/build/nudge/Nudge.mjs +1 -1
  140. package/build/overlayHeader/OverlayHeader.js +1 -1
  141. package/build/overlayHeader/OverlayHeader.mjs +1 -1
  142. package/build/phoneNumberInput/PhoneNumberInput.js +1 -1
  143. package/build/phoneNumberInput/PhoneNumberInput.mjs +1 -1
  144. package/build/popover/Popover.js +1 -1
  145. package/build/popover/Popover.mjs +1 -1
  146. package/build/processIndicator/ProcessIndicator.js +1 -1
  147. package/build/processIndicator/ProcessIndicator.mjs +1 -1
  148. package/build/progressBar/ProgressBar.js +1 -1
  149. package/build/progressBar/ProgressBar.mjs +1 -1
  150. package/build/promoCard/PromoCard.js +1 -1
  151. package/build/promoCard/PromoCard.mjs +1 -1
  152. package/build/promoCard/PromoCardIndicator.js +1 -1
  153. package/build/promoCard/PromoCardIndicator.mjs +1 -1
  154. package/build/prompt/ActionPrompt/ActionPrompt.js +2 -2
  155. package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
  156. package/build/prompt/ActionPrompt/ActionPrompt.mjs +2 -2
  157. package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
  158. package/build/prompt/CriticalBanner/CriticalBanner.js +83 -70
  159. package/build/prompt/CriticalBanner/CriticalBanner.js.map +1 -1
  160. package/build/prompt/CriticalBanner/CriticalBanner.mjs +83 -70
  161. package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +1 -1
  162. package/build/prompt/InfoPrompt/InfoPrompt.js +1 -1
  163. package/build/prompt/InfoPrompt/InfoPrompt.mjs +1 -1
  164. package/build/prompt/InlinePrompt/InlinePrompt.js +1 -1
  165. package/build/prompt/InlinePrompt/InlinePrompt.mjs +1 -1
  166. package/build/provider/Provider.js +1 -1
  167. package/build/provider/Provider.mjs +1 -1
  168. package/build/radio/Radio.js +1 -1
  169. package/build/radio/Radio.mjs +1 -1
  170. package/build/segmentedControl/SegmentedControl.js +1 -1
  171. package/build/segmentedControl/SegmentedControl.mjs +1 -1
  172. package/build/select/Select.js +1 -1
  173. package/build/select/Select.mjs +1 -1
  174. package/build/select/option/Option.js +1 -1
  175. package/build/select/option/Option.mjs +1 -1
  176. package/build/statusIcon/StatusIcon.js +2 -2
  177. package/build/statusIcon/StatusIcon.js.map +1 -1
  178. package/build/statusIcon/StatusIcon.mjs +2 -2
  179. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  180. package/build/stepper/Stepper.js +1 -1
  181. package/build/stepper/Stepper.mjs +1 -1
  182. package/build/sticky/Sticky.js +1 -1
  183. package/build/sticky/Sticky.mjs +1 -1
  184. package/build/styles/accordion/Accordion.css +1 -1
  185. package/build/styles/card/Card.css +2 -2
  186. package/build/styles/carousel/Carousel.css +5 -5
  187. package/build/styles/common/Option/Option.css +4 -2
  188. package/build/styles/common/baseCard/BaseCard.css +1 -1
  189. package/build/styles/container/Container.css +3 -3
  190. package/build/styles/criticalBanner/CriticalCommsBanner.css +1 -1
  191. package/build/styles/css/accordion.css +4 -4
  192. package/build/styles/css/button-groups.css +6 -6
  193. package/build/styles/css/buttons.css +1 -1
  194. package/build/styles/css/circles.css +1 -1
  195. package/build/styles/css/column-layout.css +4 -4
  196. package/build/styles/css/decision.css +4 -4
  197. package/build/styles/css/dropdowns.css +10 -10
  198. package/build/styles/css/droppable.css +8 -8
  199. package/build/styles/css/flex.css +15 -13
  200. package/build/styles/css/footer.css +3 -3
  201. package/build/styles/css/grid.css +19 -19
  202. package/build/styles/css/input-groups.css +12 -12
  203. package/build/styles/css/list-group.css +8 -8
  204. package/build/styles/css/modals.css +6 -6
  205. package/build/styles/css/navbar.css +62 -62
  206. package/build/styles/css/navs.css +2 -2
  207. package/build/styles/css/neptune.css +338 -270
  208. package/build/styles/css/panels.css +9 -9
  209. package/build/styles/css/popovers.css +13 -13
  210. package/build/styles/css/select.css +1 -1
  211. package/build/styles/css/sequences.css +6 -6
  212. package/build/styles/css/table.css +6 -6
  213. package/build/styles/css/utilities.css +20 -8
  214. package/build/styles/css/wells.css +18 -4
  215. package/build/styles/dateInput/DateInput.css +1 -1
  216. package/build/styles/definitionList/DefinitionList.css +2 -2
  217. package/build/styles/drawer/Drawer.css +2 -2
  218. package/build/styles/flowNavigation/FlowNavigation.css +1 -1
  219. package/build/styles/inputs/Input.css +3 -3
  220. package/build/styles/inputs/SelectInput/Options/SelectInputOptions.css +2 -2
  221. package/build/styles/inputs/SelectInput/SelectInput.css +2 -2
  222. package/build/styles/inputs/TextArea.css +3 -3
  223. package/build/styles/less/legacy-variables.less +47 -34
  224. package/build/styles/less/neptune-tokens.less +2 -2
  225. package/build/styles/main.css +477 -319
  226. package/build/styles/modal/Modal.css +20 -7
  227. package/build/styles/overlayHeader/OverlayHeader.css +1 -1
  228. package/build/styles/popover/Popover.css +3 -3
  229. package/build/styles/promoCard/PromoCard.css +1 -1
  230. package/build/styles/prompt/ActionPrompt/ActionPrompt.css +1 -1
  231. package/build/styles/prompt/CriticalBanner/CriticalBanner.css +63 -1
  232. package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -1
  233. package/build/styles/props/custom-media.css +11 -23
  234. package/build/styles/props/neptune-tokens.css +1 -1
  235. package/build/styles/snackbar/Snackbar.css +2 -2
  236. package/build/styles/stepper/Stepper.css +2 -2
  237. package/build/styles/styles/less/accordion.css +4 -4
  238. package/build/styles/styles/less/button-groups.css +6 -6
  239. package/build/styles/styles/less/buttons.css +1 -1
  240. package/build/styles/styles/less/circles.css +1 -1
  241. package/build/styles/styles/less/column-layout.css +4 -4
  242. package/build/styles/styles/less/decision.css +4 -4
  243. package/build/styles/styles/less/dropdowns.css +10 -10
  244. package/build/styles/styles/less/droppable.css +8 -8
  245. package/build/styles/styles/less/flex.css +15 -13
  246. package/build/styles/styles/less/footer.css +3 -3
  247. package/build/styles/styles/less/forms/bootstrap-forms.css +9 -9
  248. package/build/styles/styles/less/grid.css +19 -19
  249. package/build/styles/styles/less/input-groups.css +12 -12
  250. package/build/styles/styles/less/list-group.css +8 -8
  251. package/build/styles/styles/less/modals.css +6 -6
  252. package/build/styles/styles/less/navbar.css +62 -62
  253. package/build/styles/styles/less/navs.css +2 -2
  254. package/build/styles/styles/less/neptune.css +338 -270
  255. package/build/styles/styles/less/panels.css +9 -9
  256. package/build/styles/styles/less/popovers.css +13 -13
  257. package/build/styles/styles/less/select.css +1 -1
  258. package/build/styles/styles/less/sequences.css +6 -6
  259. package/build/styles/styles/less/table.css +6 -6
  260. package/build/styles/styles/less/utilities.css +20 -8
  261. package/build/styles/styles/less/wells.css +18 -4
  262. package/build/styles/styles/props/custom-media.css +11 -1
  263. package/build/styles/table/Table.css +1 -1
  264. package/build/styles/tabs/Tabs.css +2 -2
  265. package/build/styles/typeahead/Typeahead.css +1 -1
  266. package/build/summary/Summary.js +1 -1
  267. package/build/summary/Summary.mjs +1 -1
  268. package/build/table/Table.js +1 -1
  269. package/build/table/Table.mjs +1 -1
  270. package/build/table/TableRow.js +1 -1
  271. package/build/table/TableRow.mjs +1 -1
  272. package/build/table/TableStatusText.js +1 -1
  273. package/build/table/TableStatusText.mjs +1 -1
  274. package/build/tabs/Tabs.js +1 -1
  275. package/build/tabs/Tabs.mjs +1 -1
  276. package/build/tile/Tile.js +1 -1
  277. package/build/tile/Tile.mjs +1 -1
  278. package/build/title/Title.js +1 -1
  279. package/build/title/Title.mjs +1 -1
  280. package/build/tooltip/Tooltip.js +1 -1
  281. package/build/tooltip/Tooltip.mjs +1 -1
  282. package/build/typeahead/Typeahead.js +1 -1
  283. package/build/typeahead/Typeahead.mjs +1 -1
  284. package/build/types/circularButton/CircularButton.d.ts.map +1 -1
  285. package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
  286. package/build/types/common/hooks/useScreenSize.d.ts +1 -1
  287. package/build/types/common/hooks/useScreenSize.d.ts.map +1 -1
  288. package/build/types/common/index.d.ts +1 -1
  289. package/build/types/common/index.d.ts.map +1 -1
  290. package/build/types/common/propsValues/breakpoint.d.ts +9 -0
  291. package/build/types/common/propsValues/breakpoint.d.ts.map +1 -0
  292. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  293. package/build/types/decision/Decision.d.ts.map +1 -1
  294. package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
  295. package/build/types/index.d.ts +1 -2
  296. package/build/types/index.d.ts.map +1 -1
  297. package/build/types/logo/Logo.d.ts +1 -1
  298. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
  299. package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts.map +1 -1
  300. package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
  301. package/build/upload/Upload.js +1 -1
  302. package/build/upload/Upload.mjs +1 -1
  303. package/build/upload/steps/completeStep/completeStep.js +1 -1
  304. package/build/upload/steps/completeStep/completeStep.mjs +1 -1
  305. package/build/upload/steps/processingStep/processingStep.js +1 -1
  306. package/build/upload/steps/processingStep/processingStep.mjs +1 -1
  307. package/build/upload/steps/uploadImageStep/uploadImageStep.js +1 -1
  308. package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +1 -1
  309. package/build/uploadInput/UploadInput.js +1 -1
  310. package/build/uploadInput/UploadInput.mjs +1 -1
  311. package/build/uploadInput/uploadButton/UploadButton.js +1 -1
  312. package/build/uploadInput/uploadButton/UploadButton.mjs +1 -1
  313. package/build/uploadInput/uploadButton/defaults.js +1 -1
  314. package/build/uploadInput/uploadButton/defaults.mjs +1 -1
  315. package/build/uploadInput/uploadItem/UploadItem.js +1 -1
  316. package/build/uploadInput/uploadItem/UploadItem.mjs +1 -1
  317. package/build/withDisplayFormat/WithDisplayFormat.js +1 -1
  318. package/build/withDisplayFormat/WithDisplayFormat.mjs +1 -1
  319. package/package.json +3 -3
  320. package/src/accordion/Accordion.css +1 -1
  321. package/src/card/Card.css +2 -2
  322. package/src/carousel/Carousel.css +5 -5
  323. package/src/carousel/Carousel.less +3 -3
  324. package/src/circularButton/CircularButton.tsx +2 -3
  325. package/src/common/Option/Option.css +4 -2
  326. package/src/common/Option/Option.less +4 -2
  327. package/src/common/baseCard/BaseCard.css +1 -1
  328. package/src/common/bottomSheet/BottomSheet.tsx +2 -2
  329. package/src/common/circle/Circle.tsx +2 -2
  330. package/src/common/hooks/useLayout/useLayout.ts +1 -1
  331. package/src/common/hooks/useScreenSize.ts +1 -1
  332. package/src/common/index.ts +1 -1
  333. package/src/common/propsValues/breakpoint.ts +8 -0
  334. package/src/common/responsivePanel/ResponsivePanel.test.js +2 -3
  335. package/src/container/Container.css +3 -3
  336. package/src/criticalBanner/CriticalCommsBanner.css +1 -1
  337. package/src/dateInput/DateInput.css +1 -1
  338. package/src/dateLookup/DateLookup.tsx +1 -1
  339. package/src/decision/Decision.test.tsx +1 -2
  340. package/src/decision/Decision.tsx +1 -2
  341. package/src/definitionList/DefinitionList.css +2 -2
  342. package/src/definitionList/DefinitionList.less +2 -2
  343. package/src/drawer/Drawer.css +2 -2
  344. package/src/drawer/Drawer.less +3 -4
  345. package/src/flowNavigation/FlowNavigation.css +1 -1
  346. package/src/flowNavigation/FlowNavigation.less +1 -2
  347. package/src/flowNavigation/FlowNavigation.story.tsx +0 -3
  348. package/src/flowNavigation/FlowNavigation.test.js +1 -1
  349. package/src/flowNavigation/FlowNavigation.tsx +1 -2
  350. package/src/index.ts +1 -1
  351. package/src/inputs/Input.css +3 -3
  352. package/src/inputs/SelectInput/Options/SelectInputOptions.css +2 -2
  353. package/src/inputs/SelectInput/SelectInput.css +2 -2
  354. package/src/inputs/SelectInput/SelectInput.tsx +1 -1
  355. package/src/inputs/TextArea.css +3 -3
  356. package/src/logo/Logo.tsx +1 -1
  357. package/src/main.css +477 -319
  358. package/src/modal/Modal.css +20 -7
  359. package/src/modal/Modal.less +19 -7
  360. package/src/modal/Modal.tsx +2 -2
  361. package/src/overlayHeader/OverlayHeader.css +1 -1
  362. package/src/overlayHeader/OverlayHeader.less +2 -3
  363. package/src/popover/Popover.css +3 -3
  364. package/src/popover/Popover.test.tsx +1 -2
  365. package/src/promoCard/PromoCard.css +1 -1
  366. package/src/prompt/ActionPrompt/ActionPrompt.css +1 -1
  367. package/src/prompt/ActionPrompt/ActionPrompt.less +1 -1
  368. package/src/prompt/ActionPrompt/ActionPrompt.test.tsx +6 -37
  369. package/src/prompt/ActionPrompt/ActionPrompt.tsx +2 -3
  370. package/src/prompt/CriticalBanner/CriticalBanner.accessibility.docs.mdx +9 -0
  371. package/src/prompt/CriticalBanner/CriticalBanner.css +63 -1
  372. package/src/prompt/CriticalBanner/CriticalBanner.less +96 -2
  373. package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +156 -169
  374. package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +25 -6
  375. package/src/prompt/CriticalBanner/CriticalBanner.test.tsx +37 -0
  376. package/src/prompt/CriticalBanner/CriticalBanner.tsx +98 -81
  377. package/src/prompt/CriticalBanner/CriticalBanner.vars.less +1 -0
  378. package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -1
  379. package/src/prompt/PrimitivePrompt/PrimitivePrompt.less +1 -1
  380. package/src/select/Select.test.tsx +1 -1
  381. package/src/snackbar/Snackbar.css +2 -2
  382. package/src/statusIcon/StatusIcon.tsx +2 -3
  383. package/src/stepper/Stepper.css +2 -2
  384. package/src/styles/less/accordion.css +4 -4
  385. package/src/styles/less/addons/_display-utilities.less +27 -13
  386. package/src/styles/less/button-groups.css +6 -6
  387. package/src/styles/less/buttons.css +1 -1
  388. package/src/styles/less/circles.css +1 -1
  389. package/src/styles/less/column-layout.css +4 -4
  390. package/src/styles/less/core/_typography-utilities.less +22 -10
  391. package/src/styles/less/decision.css +4 -4
  392. package/src/styles/less/dropdowns.css +10 -10
  393. package/src/styles/less/droppable.css +8 -8
  394. package/src/styles/less/flex.css +15 -13
  395. package/src/styles/less/flex.less +3 -1
  396. package/src/styles/less/footer.css +3 -3
  397. package/src/styles/less/forms/bootstrap-forms.css +9 -9
  398. package/src/styles/less/forms/bootstrap-forms.less +1 -1
  399. package/src/styles/less/grid.css +19 -19
  400. package/src/styles/less/input-groups.css +12 -12
  401. package/src/styles/less/list-group.css +8 -8
  402. package/src/styles/less/modals.css +6 -6
  403. package/src/styles/less/modals.less +4 -4
  404. package/src/styles/less/navbar.css +62 -62
  405. package/src/styles/less/navbar.less +2 -2
  406. package/src/styles/less/navs.css +2 -2
  407. package/src/styles/less/neptune.bundle.less +0 -1
  408. package/src/styles/less/neptune.css +338 -270
  409. package/src/styles/less/panels.css +9 -9
  410. package/src/styles/less/popovers.css +13 -13
  411. package/src/styles/less/popovers.less +6 -6
  412. package/src/styles/less/select.css +1 -1
  413. package/src/styles/less/sequences.css +6 -6
  414. package/src/styles/less/table.css +6 -6
  415. package/src/styles/less/table.less +1 -1
  416. package/src/styles/less/utilities.css +20 -8
  417. package/src/styles/less/utilities.less +14 -6
  418. package/src/styles/less/wells.css +18 -4
  419. package/src/styles/less/wells.less +5 -3
  420. package/src/styles/props/custom-media.css +11 -1
  421. package/src/styles/variables/legacy-variables.less +47 -4
  422. package/src/table/Table.css +1 -1
  423. package/src/tabs/Tabs.css +2 -2
  424. package/src/typeahead/Typeahead.css +1 -1
  425. 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.innerHTML = '';
136
- Array.from(document.styleSheets).forEach((sheet) => {
137
- try {
138
- if (sheet.href) {
139
- const link = doc.createElement('link');
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: Decorator = (Story) => (
178
- <div
179
- style={{
180
- width: '100%',
181
- display: 'flex',
182
- flexDirection: 'column',
183
- gap: '1rem',
184
- }}
185
- >
186
- <Story />
187
- </div>
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
- ...withVariantConfig(['mobile'], {
547
- parameters: {
548
- docs: {
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: 1500 }}>
582
- {[200, 350, 600].map((width) => (
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="Your account requires verification"
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
- <CriticalBanner
626
- sentiment="negative"
627
- title="The text container is capped at 480px for optimal readability, even though the banner itself stretches to the full available width."
628
- 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."
629
- action={{ label: 'Verify now', onClick: fn() }}
630
- expanded={expanded}
631
- onToggle={() => setExpanded(!expanded)}
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: '1rem', width: '100%' }}>
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: '1rem', width: '100%' }}>
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: '1rem', width: '100%' }}>
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
+ });