@transferwise/components 0.0.0-experimental-4c97d70 → 0.0.0-experimental-a322f91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (647) hide show
  1. package/build/accordion/AccordionItem/AccordionItem.js +2 -1
  2. package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
  3. package/build/accordion/AccordionItem/AccordionItem.mjs +2 -1
  4. package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
  5. package/build/actionButton/ActionButton.js +2 -1
  6. package/build/actionButton/ActionButton.js.map +1 -1
  7. package/build/actionButton/ActionButton.mjs +2 -1
  8. package/build/actionButton/ActionButton.mjs.map +1 -1
  9. package/build/actionOption/ActionOption.js +2 -1
  10. package/build/actionOption/ActionOption.js.map +1 -1
  11. package/build/actionOption/ActionOption.mjs +2 -1
  12. package/build/actionOption/ActionOption.mjs.map +1 -1
  13. package/build/alert/Alert.js +2 -1
  14. package/build/alert/Alert.js.map +1 -1
  15. package/build/alert/Alert.mjs +2 -1
  16. package/build/alert/Alert.mjs.map +1 -1
  17. package/build/alert/inlineMarkdown/InlineMarkdown.js +2 -1
  18. package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
  19. package/build/alert/inlineMarkdown/InlineMarkdown.mjs +2 -1
  20. package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
  21. package/build/avatar/Avatar.js +2 -1
  22. package/build/avatar/Avatar.js.map +1 -1
  23. package/build/avatar/Avatar.mjs +2 -1
  24. package/build/avatar/Avatar.mjs.map +1 -1
  25. package/build/avatarLayout/AvatarLayout.js +1 -1
  26. package/build/avatarLayout/AvatarLayout.mjs +1 -1
  27. package/build/avatarView/AvatarView.js +2 -1
  28. package/build/avatarView/AvatarView.js.map +1 -1
  29. package/build/avatarView/AvatarView.mjs +2 -1
  30. package/build/avatarView/AvatarView.mjs.map +1 -1
  31. package/build/avatarWrapper/AvatarWrapper.js +2 -1
  32. package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
  33. package/build/avatarWrapper/AvatarWrapper.mjs +2 -1
  34. package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
  35. package/build/badge/Badge.js +2 -1
  36. package/build/badge/Badge.js.map +1 -1
  37. package/build/badge/Badge.mjs +2 -1
  38. package/build/badge/Badge.mjs.map +1 -1
  39. package/build/badge/BadgeAssets.js +2 -1
  40. package/build/badge/BadgeAssets.js.map +1 -1
  41. package/build/badge/BadgeAssets.mjs +2 -1
  42. package/build/badge/BadgeAssets.mjs.map +1 -1
  43. package/build/button/Button.js +2 -1
  44. package/build/button/Button.js.map +1 -1
  45. package/build/button/Button.mjs +2 -1
  46. package/build/button/Button.mjs.map +1 -1
  47. package/build/button/LegacyButton.js +2 -1
  48. package/build/button/LegacyButton.js.map +1 -1
  49. package/build/button/LegacyButton.mjs +2 -1
  50. package/build/button/LegacyButton.mjs.map +1 -1
  51. package/build/button/classMap.js +2 -1
  52. package/build/button/classMap.js.map +1 -1
  53. package/build/button/classMap.mjs +2 -1
  54. package/build/button/classMap.mjs.map +1 -1
  55. package/build/button/legacyUtils/legacyUtils.js +2 -1
  56. package/build/button/legacyUtils/legacyUtils.js.map +1 -1
  57. package/build/button/legacyUtils/legacyUtils.mjs +2 -1
  58. package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
  59. package/build/card/Card.js +2 -1
  60. package/build/card/Card.js.map +1 -1
  61. package/build/card/Card.mjs +2 -1
  62. package/build/card/Card.mjs.map +1 -1
  63. package/build/checkbox/Checkbox.js +2 -1
  64. package/build/checkbox/Checkbox.js.map +1 -1
  65. package/build/checkbox/Checkbox.mjs +2 -1
  66. package/build/checkbox/Checkbox.mjs.map +1 -1
  67. package/build/chevron/Chevron.js +2 -1
  68. package/build/chevron/Chevron.js.map +1 -1
  69. package/build/chevron/Chevron.mjs +2 -1
  70. package/build/chevron/Chevron.mjs.map +1 -1
  71. package/build/chips/Chip.js +2 -1
  72. package/build/chips/Chip.js.map +1 -1
  73. package/build/chips/Chip.mjs +2 -1
  74. package/build/chips/Chip.mjs.map +1 -1
  75. package/build/circularButton/CircularButton.js +3 -2
  76. package/build/circularButton/CircularButton.js.map +1 -1
  77. package/build/circularButton/CircularButton.mjs +3 -2
  78. package/build/circularButton/CircularButton.mjs.map +1 -1
  79. package/build/common/bottomSheet/BottomSheet.js +2 -2
  80. package/build/common/bottomSheet/BottomSheet.js.map +1 -1
  81. package/build/common/bottomSheet/BottomSheet.mjs +2 -2
  82. package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
  83. package/build/common/circle/Circle.js +2 -2
  84. package/build/common/circle/Circle.js.map +1 -1
  85. package/build/common/circle/Circle.mjs +2 -2
  86. package/build/common/circle/Circle.mjs.map +1 -1
  87. package/build/common/hooks/useLayout/useLayout.js +6 -6
  88. package/build/common/hooks/useLayout/useLayout.js.map +1 -1
  89. package/build/common/hooks/useLayout/useLayout.mjs +1 -1
  90. package/build/common/hooks/useLayout/useLayout.mjs.map +1 -1
  91. package/build/common/hooks/useScreenSize.js.map +1 -1
  92. package/build/common/hooks/useScreenSize.mjs.map +1 -1
  93. package/build/common/locale/index.js +9 -4
  94. package/build/common/locale/index.js.map +1 -1
  95. package/build/common/locale/index.mjs +9 -4
  96. package/build/common/locale/index.mjs.map +1 -1
  97. package/build/common/panel/Panel.js +51 -55
  98. package/build/common/panel/Panel.js.map +1 -1
  99. package/build/common/panel/Panel.mjs +56 -60
  100. package/build/common/panel/Panel.mjs.map +1 -1
  101. package/build/common/responsivePanel/ResponsivePanel.js +2 -1
  102. package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
  103. package/build/common/responsivePanel/ResponsivePanel.mjs +2 -1
  104. package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
  105. package/build/criticalBanner/CriticalCommsBanner.js +2 -1
  106. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  107. package/build/criticalBanner/CriticalCommsBanner.mjs +2 -1
  108. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  109. package/build/dateInput/DateInput.js +2 -2
  110. package/build/dateInput/DateInput.mjs +2 -2
  111. package/build/dateLookup/DateLookup.js +3 -3
  112. package/build/dateLookup/DateLookup.js.map +1 -1
  113. package/build/dateLookup/DateLookup.mjs +2 -2
  114. package/build/dateLookup/DateLookup.mjs.map +1 -1
  115. package/build/dateLookup/dateHeader/DateHeader.js +2 -1
  116. package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
  117. package/build/dateLookup/dateHeader/DateHeader.mjs +2 -1
  118. package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
  119. package/build/dateLookup/dateTrigger/DateTrigger.js +1 -1
  120. package/build/dateLookup/dateTrigger/DateTrigger.mjs +1 -1
  121. package/build/decision/Decision.js +4 -3
  122. package/build/decision/Decision.js.map +1 -1
  123. package/build/decision/Decision.mjs +2 -1
  124. package/build/decision/Decision.mjs.map +1 -1
  125. package/build/definitionList/DefinitionList.js +2 -1
  126. package/build/definitionList/DefinitionList.js.map +1 -1
  127. package/build/definitionList/DefinitionList.mjs +2 -1
  128. package/build/definitionList/DefinitionList.mjs.map +1 -1
  129. package/build/dimmer/Dimmer.js +2 -1
  130. package/build/dimmer/Dimmer.js.map +1 -1
  131. package/build/dimmer/Dimmer.mjs +2 -1
  132. package/build/dimmer/Dimmer.mjs.map +1 -1
  133. package/build/display/Display.js +2 -1
  134. package/build/display/Display.js.map +1 -1
  135. package/build/display/Display.mjs +2 -1
  136. package/build/display/Display.mjs.map +1 -1
  137. package/build/drawer/Drawer.js +2 -1
  138. package/build/drawer/Drawer.js.map +1 -1
  139. package/build/drawer/Drawer.mjs +2 -1
  140. package/build/drawer/Drawer.mjs.map +1 -1
  141. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +5 -4
  142. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
  143. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +5 -4
  144. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
  145. package/build/field/Field.js +6 -6
  146. package/build/field/Field.mjs +6 -6
  147. package/build/flowNavigation/FlowNavigation.js +4 -3
  148. package/build/flowNavigation/FlowNavigation.js.map +1 -1
  149. package/build/flowNavigation/FlowNavigation.mjs +2 -1
  150. package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
  151. package/build/header/Header.js +2 -1
  152. package/build/header/Header.js.map +1 -1
  153. package/build/header/Header.mjs +2 -1
  154. package/build/header/Header.mjs.map +1 -1
  155. package/build/i18n/en.json +0 -2
  156. package/build/i18n/en.json.js +0 -2
  157. package/build/i18n/en.json.js.map +1 -1
  158. package/build/i18n/en.json.mjs +0 -2
  159. package/build/i18n/en.json.mjs.map +1 -1
  160. package/build/image/Image.js +1 -1
  161. package/build/image/Image.mjs +1 -1
  162. package/build/index.js +2 -4
  163. package/build/index.js.map +1 -1
  164. package/build/index.mjs +1 -2
  165. package/build/index.mjs.map +1 -1
  166. package/build/info/Info.js +2 -1
  167. package/build/info/Info.js.map +1 -1
  168. package/build/info/Info.mjs +2 -1
  169. package/build/info/Info.mjs.map +1 -1
  170. package/build/inlineAlert/InlineAlert.js +2 -1
  171. package/build/inlineAlert/InlineAlert.js.map +1 -1
  172. package/build/inlineAlert/InlineAlert.mjs +2 -1
  173. package/build/inlineAlert/InlineAlert.mjs.map +1 -1
  174. package/build/inputs/SearchInput.js +2 -1
  175. package/build/inputs/SearchInput.js.map +1 -1
  176. package/build/inputs/SearchInput.mjs +2 -1
  177. package/build/inputs/SearchInput.mjs.map +1 -1
  178. package/build/inputs/SelectInput/SelectInput.js +2 -2
  179. package/build/inputs/SelectInput/SelectInput.js.map +1 -1
  180. package/build/inputs/SelectInput/SelectInput.mjs +1 -1
  181. package/build/inputs/SelectInput/SelectInput.mjs.map +1 -1
  182. package/build/instructionsList/InstructionsList.js +2 -1
  183. package/build/instructionsList/InstructionsList.js.map +1 -1
  184. package/build/instructionsList/InstructionsList.mjs +2 -1
  185. package/build/instructionsList/InstructionsList.mjs.map +1 -1
  186. package/build/link/Link.js +2 -1
  187. package/build/link/Link.js.map +1 -1
  188. package/build/link/Link.mjs +2 -1
  189. package/build/link/Link.mjs.map +1 -1
  190. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +2 -1
  191. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +1 -1
  192. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +2 -1
  193. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +1 -1
  194. package/build/listItem/ListItem.js +2 -1
  195. package/build/listItem/ListItem.js.map +1 -1
  196. package/build/listItem/ListItem.mjs +2 -1
  197. package/build/listItem/ListItem.mjs.map +1 -1
  198. package/build/listItem/Prompt/ListItemPrompt.js +6 -6
  199. package/build/listItem/Prompt/ListItemPrompt.mjs +6 -6
  200. package/build/loader/Loader.js +2 -1
  201. package/build/loader/Loader.js.map +1 -1
  202. package/build/loader/Loader.mjs +2 -1
  203. package/build/loader/Loader.mjs.map +1 -1
  204. package/build/logo/Logo.js +1 -1
  205. package/build/logo/Logo.js.map +1 -1
  206. package/build/logo/Logo.mjs +1 -1
  207. package/build/logo/Logo.mjs.map +1 -1
  208. package/build/main.css +351 -418
  209. package/build/markdown/Markdown.js +2 -1
  210. package/build/markdown/Markdown.js.map +1 -1
  211. package/build/markdown/Markdown.mjs +2 -1
  212. package/build/markdown/Markdown.mjs.map +1 -1
  213. package/build/modal/Modal.js +2 -1
  214. package/build/modal/Modal.js.map +1 -1
  215. package/build/modal/Modal.mjs +2 -1
  216. package/build/modal/Modal.mjs.map +1 -1
  217. package/build/moneyInput/MoneyInput.js +29 -13
  218. package/build/moneyInput/MoneyInput.js.map +1 -1
  219. package/build/moneyInput/MoneyInput.mjs +31 -15
  220. package/build/moneyInput/MoneyInput.mjs.map +1 -1
  221. package/build/moneyInput/currencyFormatting.js +8 -2
  222. package/build/moneyInput/currencyFormatting.js.map +1 -1
  223. package/build/moneyInput/currencyFormatting.mjs +5 -4
  224. package/build/moneyInput/currencyFormatting.mjs.map +1 -1
  225. package/build/navigationOption/NavigationOption.js +2 -1
  226. package/build/navigationOption/NavigationOption.js.map +1 -1
  227. package/build/navigationOption/NavigationOption.mjs +2 -1
  228. package/build/navigationOption/NavigationOption.mjs.map +1 -1
  229. package/build/nudge/Nudge.js +2 -1
  230. package/build/nudge/Nudge.js.map +1 -1
  231. package/build/nudge/Nudge.mjs +2 -1
  232. package/build/nudge/Nudge.mjs.map +1 -1
  233. package/build/overlayHeader/OverlayHeader.js +2 -1
  234. package/build/overlayHeader/OverlayHeader.js.map +1 -1
  235. package/build/overlayHeader/OverlayHeader.mjs +2 -1
  236. package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
  237. package/build/phoneNumberInput/PhoneNumberInput.js +2 -1
  238. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  239. package/build/phoneNumberInput/PhoneNumberInput.mjs +2 -1
  240. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  241. package/build/popover/Popover.js +2 -1
  242. package/build/popover/Popover.js.map +1 -1
  243. package/build/popover/Popover.mjs +2 -1
  244. package/build/popover/Popover.mjs.map +1 -1
  245. package/build/processIndicator/ProcessIndicator.js +2 -1
  246. package/build/processIndicator/ProcessIndicator.js.map +1 -1
  247. package/build/processIndicator/ProcessIndicator.mjs +2 -1
  248. package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
  249. package/build/progressBar/ProgressBar.js +2 -1
  250. package/build/progressBar/ProgressBar.js.map +1 -1
  251. package/build/progressBar/ProgressBar.mjs +2 -1
  252. package/build/progressBar/ProgressBar.mjs.map +1 -1
  253. package/build/promoCard/PromoCard.js +2 -1
  254. package/build/promoCard/PromoCard.js.map +1 -1
  255. package/build/promoCard/PromoCard.mjs +2 -1
  256. package/build/promoCard/PromoCard.mjs.map +1 -1
  257. package/build/promoCard/PromoCardIndicator.js +2 -1
  258. package/build/promoCard/PromoCardIndicator.js.map +1 -1
  259. package/build/promoCard/PromoCardIndicator.mjs +2 -1
  260. package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
  261. package/build/prompt/ActionPrompt/ActionPrompt.js +43 -10
  262. package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
  263. package/build/prompt/ActionPrompt/ActionPrompt.mjs +42 -9
  264. package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
  265. package/build/prompt/InfoPrompt/InfoPrompt.js +2 -1
  266. package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
  267. package/build/prompt/InfoPrompt/InfoPrompt.mjs +2 -1
  268. package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
  269. package/build/prompt/InlinePrompt/InlinePrompt.js +2 -1
  270. package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
  271. package/build/prompt/InlinePrompt/InlinePrompt.mjs +2 -1
  272. package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
  273. package/build/prompt/PrimitivePrompt/PrimitivePrompt.js +0 -2
  274. package/build/prompt/PrimitivePrompt/PrimitivePrompt.js.map +1 -1
  275. package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs +0 -2
  276. package/build/prompt/PrimitivePrompt/PrimitivePrompt.mjs.map +1 -1
  277. package/build/provider/Provider.js +1 -1
  278. package/build/provider/Provider.mjs +1 -1
  279. package/build/radio/Radio.js +2 -1
  280. package/build/radio/Radio.js.map +1 -1
  281. package/build/radio/Radio.mjs +2 -1
  282. package/build/radio/Radio.mjs.map +1 -1
  283. package/build/segmentedControl/SegmentedControl.js +2 -1
  284. package/build/segmentedControl/SegmentedControl.js.map +1 -1
  285. package/build/segmentedControl/SegmentedControl.mjs +2 -1
  286. package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
  287. package/build/select/Select.js +3 -2
  288. package/build/select/Select.js.map +1 -1
  289. package/build/select/Select.mjs +3 -2
  290. package/build/select/Select.mjs.map +1 -1
  291. package/build/select/option/Option.js +2 -1
  292. package/build/select/option/Option.js.map +1 -1
  293. package/build/select/option/Option.mjs +2 -1
  294. package/build/select/option/Option.mjs.map +1 -1
  295. package/build/statusIcon/StatusIcon.js +3 -2
  296. package/build/statusIcon/StatusIcon.js.map +1 -1
  297. package/build/statusIcon/StatusIcon.mjs +3 -2
  298. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  299. package/build/stepper/Stepper.js +2 -1
  300. package/build/stepper/Stepper.js.map +1 -1
  301. package/build/stepper/Stepper.mjs +2 -1
  302. package/build/stepper/Stepper.mjs.map +1 -1
  303. package/build/sticky/Sticky.js +2 -1
  304. package/build/sticky/Sticky.js.map +1 -1
  305. package/build/sticky/Sticky.mjs +2 -1
  306. package/build/sticky/Sticky.mjs.map +1 -1
  307. package/build/styles/accordion/Accordion.css +1 -1
  308. package/build/styles/card/Card.css +2 -2
  309. package/build/styles/carousel/Carousel.css +5 -5
  310. package/build/styles/common/Option/Option.css +1 -1
  311. package/build/styles/common/baseCard/BaseCard.css +1 -1
  312. package/build/styles/criticalBanner/CriticalCommsBanner.css +1 -1
  313. package/build/styles/css/accordion.css +4 -4
  314. package/build/styles/css/button-groups.css +6 -6
  315. package/build/styles/css/buttons.css +1 -1
  316. package/build/styles/css/circles.css +1 -1
  317. package/build/styles/css/column-layout.css +4 -4
  318. package/build/styles/css/decision.css +4 -4
  319. package/build/styles/css/dropdowns.css +10 -10
  320. package/build/styles/css/droppable.css +8 -8
  321. package/build/styles/css/flex.css +14 -14
  322. package/build/styles/css/footer.css +3 -3
  323. package/build/styles/css/grid.css +19 -19
  324. package/build/styles/css/input-groups.css +12 -12
  325. package/build/styles/css/list-group.css +8 -8
  326. package/build/styles/css/modals.css +3 -3
  327. package/build/styles/css/navbar.css +62 -62
  328. package/build/styles/css/navs.css +2 -2
  329. package/build/styles/css/neptune.css +280 -269
  330. package/build/styles/css/panels.css +9 -9
  331. package/build/styles/css/popovers.css +13 -13
  332. package/build/styles/css/select.css +1 -1
  333. package/build/styles/css/sequences.css +6 -6
  334. package/build/styles/css/table.css +6 -6
  335. package/build/styles/css/utilities.css +4 -4
  336. package/build/styles/css/wells.css +4 -4
  337. package/build/styles/dateInput/DateInput.css +1 -1
  338. package/build/styles/definitionList/DefinitionList.css +2 -2
  339. package/build/styles/drawer/Drawer.css +1 -1
  340. package/build/styles/inputs/Input.css +3 -3
  341. package/build/styles/inputs/SelectInput/Options/SelectInputOptions.css +2 -2
  342. package/build/styles/inputs/SelectInput/SelectInput.css +2 -2
  343. package/build/styles/inputs/TextArea.css +3 -3
  344. package/build/styles/less/legacy-variables.less +34 -47
  345. package/build/styles/less/neptune-tokens.less +5 -4
  346. package/build/styles/logo/Logo.css +2 -2
  347. package/build/styles/main.css +351 -418
  348. package/build/styles/modal/Modal.css +5 -5
  349. package/build/styles/popover/Popover.css +3 -3
  350. package/build/styles/promoCard/PromoCard.css +1 -1
  351. package/build/styles/prompt/ActionPrompt/ActionPrompt.css +1 -1
  352. package/build/styles/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -1
  353. package/build/styles/props/custom-media.css +23 -11
  354. package/build/styles/props/neptune-tokens.css +3 -2
  355. package/build/styles/select/Select.css +2 -1
  356. package/build/styles/snackbar/Snackbar.css +2 -2
  357. package/build/styles/stepper/Stepper.css +2 -2
  358. package/build/styles/styles/less/accordion.css +4 -4
  359. package/build/styles/styles/less/button-groups.css +6 -6
  360. package/build/styles/styles/less/buttons.css +1 -1
  361. package/build/styles/styles/less/circles.css +1 -1
  362. package/build/styles/styles/less/column-layout.css +4 -4
  363. package/build/styles/styles/less/decision.css +4 -4
  364. package/build/styles/styles/less/dropdowns.css +10 -10
  365. package/build/styles/styles/less/droppable.css +8 -8
  366. package/build/styles/styles/less/flex.css +14 -14
  367. package/build/styles/styles/less/footer.css +3 -3
  368. package/build/styles/styles/less/forms/bootstrap-forms.css +9 -9
  369. package/build/styles/styles/less/grid.css +19 -19
  370. package/build/styles/styles/less/input-groups.css +12 -12
  371. package/build/styles/styles/less/list-group.css +8 -8
  372. package/build/styles/styles/less/modals.css +3 -3
  373. package/build/styles/styles/less/navbar.css +62 -62
  374. package/build/styles/styles/less/navs.css +2 -2
  375. package/build/styles/styles/less/neptune.css +280 -269
  376. package/build/styles/styles/less/panels.css +9 -9
  377. package/build/styles/styles/less/popovers.css +13 -13
  378. package/build/styles/styles/less/select.css +1 -1
  379. package/build/styles/styles/less/sequences.css +6 -6
  380. package/build/styles/styles/less/table.css +6 -6
  381. package/build/styles/styles/less/utilities.css +4 -4
  382. package/build/styles/styles/less/wells.css +4 -4
  383. package/build/styles/styles/props/custom-media.css +1 -11
  384. package/build/styles/table/Table.css +1 -1
  385. package/build/styles/tabs/Tabs.css +2 -2
  386. package/build/styles/typeahead/Typeahead.css +1 -1
  387. package/build/summary/Summary.js +2 -1
  388. package/build/summary/Summary.js.map +1 -1
  389. package/build/summary/Summary.mjs +2 -1
  390. package/build/summary/Summary.mjs.map +1 -1
  391. package/build/table/Table.js +2 -1
  392. package/build/table/Table.js.map +1 -1
  393. package/build/table/Table.mjs +2 -1
  394. package/build/table/Table.mjs.map +1 -1
  395. package/build/table/TableRow.js +2 -1
  396. package/build/table/TableRow.js.map +1 -1
  397. package/build/table/TableRow.mjs +2 -1
  398. package/build/table/TableRow.mjs.map +1 -1
  399. package/build/table/TableStatusText.js +2 -1
  400. package/build/table/TableStatusText.js.map +1 -1
  401. package/build/table/TableStatusText.mjs +2 -1
  402. package/build/table/TableStatusText.mjs.map +1 -1
  403. package/build/tabs/Tabs.js +2 -1
  404. package/build/tabs/Tabs.js.map +1 -1
  405. package/build/tabs/Tabs.mjs +2 -1
  406. package/build/tabs/Tabs.mjs.map +1 -1
  407. package/build/tile/Tile.js +2 -1
  408. package/build/tile/Tile.js.map +1 -1
  409. package/build/tile/Tile.mjs +2 -1
  410. package/build/tile/Tile.mjs.map +1 -1
  411. package/build/title/Title.js +2 -1
  412. package/build/title/Title.js.map +1 -1
  413. package/build/title/Title.mjs +2 -1
  414. package/build/title/Title.mjs.map +1 -1
  415. package/build/tooltip/Tooltip.js +31 -51
  416. package/build/tooltip/Tooltip.js.map +1 -1
  417. package/build/tooltip/Tooltip.mjs +32 -52
  418. package/build/tooltip/Tooltip.mjs.map +1 -1
  419. package/build/typeahead/Typeahead.js +6 -6
  420. package/build/typeahead/Typeahead.mjs +6 -6
  421. package/build/types/badge/BadgeAssets.d.ts.map +1 -1
  422. package/build/types/circularButton/CircularButton.d.ts.map +1 -1
  423. package/build/types/common/bottomSheet/BottomSheet.d.ts.map +1 -1
  424. package/build/types/common/hooks/useScreenSize.d.ts +1 -1
  425. package/build/types/common/hooks/useScreenSize.d.ts.map +1 -1
  426. package/build/types/common/index.d.ts +1 -1
  427. package/build/types/common/index.d.ts.map +1 -1
  428. package/build/types/common/locale/index.d.ts +1 -1
  429. package/build/types/common/locale/index.d.ts.map +1 -1
  430. package/build/types/common/panel/Panel.d.ts.map +1 -1
  431. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  432. package/build/types/decision/Decision.d.ts.map +1 -1
  433. package/build/types/expressiveMoneyInput/currencySelector/CurrencySelector.d.ts.map +1 -1
  434. package/build/types/flowNavigation/FlowNavigation.d.ts.map +1 -1
  435. package/build/types/index.d.ts +4 -3
  436. package/build/types/index.d.ts.map +1 -1
  437. package/build/types/logo/Logo.d.ts +1 -1
  438. package/build/types/moneyInput/MoneyInput.d.ts +6 -0
  439. package/build/types/moneyInput/MoneyInput.d.ts.map +1 -1
  440. package/build/types/moneyInput/currencyFormatting.d.ts +4 -3
  441. package/build/types/moneyInput/currencyFormatting.d.ts.map +1 -1
  442. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +11 -2
  443. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts.map +1 -1
  444. package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts +3 -8
  445. package/build/types/prompt/PrimitivePrompt/PrimitivePrompt.d.ts.map +1 -1
  446. package/build/types/prompt/index.d.ts +0 -2
  447. package/build/types/prompt/index.d.ts.map +1 -1
  448. package/build/types/statusIcon/StatusIcon.d.ts.map +1 -1
  449. package/build/types/test-utils/index.d.ts +0 -4
  450. package/build/types/test-utils/index.d.ts.map +1 -1
  451. package/build/types/tooltip/Tooltip.d.ts.map +1 -1
  452. package/build/upload/Upload.js +2 -1
  453. package/build/upload/Upload.js.map +1 -1
  454. package/build/upload/Upload.mjs +2 -1
  455. package/build/upload/Upload.mjs.map +1 -1
  456. package/build/upload/steps/completeStep/completeStep.js +2 -1
  457. package/build/upload/steps/completeStep/completeStep.js.map +1 -1
  458. package/build/upload/steps/completeStep/completeStep.mjs +2 -1
  459. package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
  460. package/build/upload/steps/processingStep/processingStep.js +2 -1
  461. package/build/upload/steps/processingStep/processingStep.js.map +1 -1
  462. package/build/upload/steps/processingStep/processingStep.mjs +2 -1
  463. package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
  464. package/build/upload/steps/uploadImageStep/uploadImageStep.js +2 -1
  465. package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
  466. package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +2 -1
  467. package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
  468. package/build/uploadInput/UploadInput.js +2 -1
  469. package/build/uploadInput/UploadInput.js.map +1 -1
  470. package/build/uploadInput/UploadInput.mjs +2 -1
  471. package/build/uploadInput/UploadInput.mjs.map +1 -1
  472. package/build/uploadInput/uploadButton/UploadButton.js +2 -1
  473. package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
  474. package/build/uploadInput/uploadButton/UploadButton.mjs +2 -1
  475. package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
  476. package/build/uploadInput/uploadButton/defaults.js +2 -1
  477. package/build/uploadInput/uploadButton/defaults.js.map +1 -1
  478. package/build/uploadInput/uploadButton/defaults.mjs +2 -1
  479. package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
  480. package/build/uploadInput/uploadItem/UploadItem.js +2 -1
  481. package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
  482. package/build/uploadInput/uploadItem/UploadItem.mjs +2 -1
  483. package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
  484. package/build/withDisplayFormat/WithDisplayFormat.js +2 -1
  485. package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
  486. package/build/withDisplayFormat/WithDisplayFormat.mjs +2 -1
  487. package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
  488. package/package.json +20 -22
  489. package/src/accordion/Accordion.css +1 -1
  490. package/src/avatarView/AvatarView.story.tsx +1 -1
  491. package/src/avatarView/AvatarView.test.story.tsx +108 -1
  492. package/src/badge/BadgeAssets.tsx +2 -0
  493. package/src/card/Card.css +2 -2
  494. package/src/carousel/Carousel.css +5 -5
  495. package/src/circularButton/CircularButton.tsx +3 -2
  496. package/src/common/Option/Option.css +1 -1
  497. package/src/common/baseCard/BaseCard.css +1 -1
  498. package/src/common/bottomSheet/BottomSheet.tsx +2 -2
  499. package/src/common/circle/Circle.tsx +2 -2
  500. package/src/common/hooks/useLayout/useLayout.ts +1 -1
  501. package/src/common/hooks/useScreenSize.ts +1 -1
  502. package/src/common/index.ts +1 -1
  503. package/src/common/locale/index.test.ts +13 -4
  504. package/src/common/locale/index.ts +9 -3
  505. package/src/common/panel/Panel.tsx +56 -49
  506. package/src/common/responsivePanel/ResponsivePanel.test.js +3 -2
  507. package/src/criticalBanner/CriticalCommsBanner.css +1 -1
  508. package/src/dateInput/DateInput.css +1 -1
  509. package/src/dateLookup/DateLookup.tsx +1 -1
  510. package/src/decision/Decision.test.tsx +2 -1
  511. package/src/decision/Decision.tsx +2 -1
  512. package/src/definitionList/DefinitionList.css +2 -2
  513. package/src/definitionList/DefinitionList.less +2 -2
  514. package/src/drawer/Drawer.css +1 -1
  515. package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +18 -0
  516. package/src/expressiveMoneyInput/currencySelector/CurrencySelector.test.tsx +119 -1
  517. package/src/expressiveMoneyInput/currencySelector/CurrencySelector.tsx +4 -3
  518. package/src/flowNavigation/FlowNavigation.test.js +1 -1
  519. package/src/flowNavigation/FlowNavigation.tsx +2 -1
  520. package/src/i18n/en.json +0 -2
  521. package/src/index.ts +3 -3
  522. package/src/inputs/Input.css +3 -3
  523. package/src/inputs/SelectInput/Options/SelectInputOptions.css +2 -2
  524. package/src/inputs/SelectInput/SelectInput.css +2 -2
  525. package/src/inputs/SelectInput/SelectInput.tsx +1 -1
  526. package/src/inputs/TextArea.css +3 -3
  527. package/src/logo/Logo.css +2 -2
  528. package/src/logo/Logo.story.tsx +3 -3
  529. package/src/logo/Logo.tsx +1 -1
  530. package/src/main.css +351 -418
  531. package/src/main.less +1 -3
  532. package/src/modal/Modal.css +5 -5
  533. package/src/moneyInput/MoneyInput.story.tsx +10 -1
  534. package/src/moneyInput/MoneyInput.test.story.tsx +141 -1
  535. package/src/moneyInput/MoneyInput.test.tsx +45 -0
  536. package/src/moneyInput/MoneyInput.tsx +27 -3
  537. package/src/moneyInput/currencyFormatting.ts +11 -5
  538. package/src/popover/Popover.css +3 -3
  539. package/src/popover/Popover.test.tsx +2 -1
  540. package/src/promoCard/PromoCard.css +1 -1
  541. package/src/prompt/ActionPrompt/ActionPrompt.css +1 -1
  542. package/src/prompt/ActionPrompt/ActionPrompt.test.tsx +3 -3
  543. package/src/prompt/ActionPrompt/ActionPrompt.tsx +64 -10
  544. package/src/prompt/PrimitivePrompt/PrimitivePrompt.css +1 -1
  545. package/src/prompt/PrimitivePrompt/PrimitivePrompt.tsx +2 -9
  546. package/src/prompt/index.ts +0 -4
  547. package/src/section/Section.story.tsx +2 -8
  548. package/src/select/Select.css +2 -1
  549. package/src/select/Select.less +6 -5
  550. package/src/select/Select.test.story.tsx +59 -0
  551. package/src/select/Select.test.tsx +1 -1
  552. package/src/select/Select.tsx +1 -1
  553. package/src/sentimentSurface/SentimentSurface.story.tsx +17 -43
  554. package/src/snackbar/Snackbar.css +2 -2
  555. package/src/statusIcon/StatusIcon.test.tsx +0 -2
  556. package/src/statusIcon/StatusIcon.tsx +3 -2
  557. package/src/stepper/Stepper.css +2 -2
  558. package/src/styles/less/accordion.css +4 -4
  559. package/src/styles/less/button-groups.css +6 -6
  560. package/src/styles/less/buttons.css +1 -1
  561. package/src/styles/less/circles.css +1 -1
  562. package/src/styles/less/column-layout.css +4 -4
  563. package/src/styles/less/decision.css +4 -4
  564. package/src/styles/less/dropdowns.css +10 -10
  565. package/src/styles/less/droppable.css +8 -8
  566. package/src/styles/less/flex.css +14 -14
  567. package/src/styles/less/footer.css +3 -3
  568. package/src/styles/less/forms/bootstrap-forms.css +9 -9
  569. package/src/styles/less/forms/bootstrap-forms.less +1 -1
  570. package/src/styles/less/grid.css +19 -19
  571. package/src/styles/less/input-groups.css +12 -12
  572. package/src/styles/less/list-group.css +8 -8
  573. package/src/styles/less/modals.css +3 -3
  574. package/src/styles/less/navbar.css +62 -62
  575. package/src/styles/less/navbar.less +2 -2
  576. package/src/styles/less/navs.css +2 -2
  577. package/src/styles/less/neptune.bundle.less +1 -0
  578. package/src/styles/less/neptune.css +280 -269
  579. package/src/styles/less/panels.css +9 -9
  580. package/src/styles/less/popovers.css +13 -13
  581. package/src/styles/less/select.css +1 -1
  582. package/src/styles/less/sequences.css +6 -6
  583. package/src/styles/less/table.css +6 -6
  584. package/src/styles/less/table.less +1 -1
  585. package/src/styles/less/utilities.css +4 -4
  586. package/src/styles/less/wells.css +4 -4
  587. package/src/styles/props/custom-media.css +1 -11
  588. package/src/styles/variables/legacy-variables.less +4 -47
  589. package/src/table/Table.css +1 -1
  590. package/src/tabs/Tabs.css +2 -2
  591. package/src/tooltip/Tooltip.tsx +26 -45
  592. package/src/typeahead/Typeahead.css +1 -1
  593. package/build/common/propsValues/breakpoint.js +0 -12
  594. package/build/common/propsValues/breakpoint.js.map +0 -1
  595. package/build/common/propsValues/breakpoint.mjs +0 -12
  596. package/build/common/propsValues/breakpoint.mjs.map +0 -1
  597. package/build/prompt/CriticalBanner/CriticalBanner.js +0 -143
  598. package/build/prompt/CriticalBanner/CriticalBanner.js.map +0 -1
  599. package/build/prompt/CriticalBanner/CriticalBanner.mjs +0 -141
  600. package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +0 -1
  601. package/build/prompt/CriticalBanner/helpers.js +0 -29
  602. package/build/prompt/CriticalBanner/helpers.js.map +0 -1
  603. package/build/prompt/CriticalBanner/helpers.mjs +0 -26
  604. package/build/prompt/CriticalBanner/helpers.mjs.map +0 -1
  605. package/build/prompt/common/Expander/Expander.js +0 -47
  606. package/build/prompt/common/Expander/Expander.js.map +0 -1
  607. package/build/prompt/common/Expander/Expander.messages.js +0 -17
  608. package/build/prompt/common/Expander/Expander.messages.js.map +0 -1
  609. package/build/prompt/common/Expander/Expander.messages.mjs +0 -13
  610. package/build/prompt/common/Expander/Expander.messages.mjs.map +0 -1
  611. package/build/prompt/common/Expander/Expander.mjs +0 -44
  612. package/build/prompt/common/Expander/Expander.mjs.map +0 -1
  613. package/build/prompt/helpers/promptMedia.js +0 -52
  614. package/build/prompt/helpers/promptMedia.js.map +0 -1
  615. package/build/prompt/helpers/promptMedia.mjs +0 -50
  616. package/build/prompt/helpers/promptMedia.mjs.map +0 -1
  617. package/build/styles/prompt/CriticalBanner/CriticalBanner.css +0 -59
  618. package/build/styles/prompt/common/Expander/Expander.css +0 -8
  619. package/build/types/common/propsValues/breakpoint.d.ts +0 -9
  620. package/build/types/common/propsValues/breakpoint.d.ts.map +0 -1
  621. package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts +0 -33
  622. package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts.map +0 -1
  623. package/build/types/prompt/CriticalBanner/helpers.d.ts +0 -18
  624. package/build/types/prompt/CriticalBanner/helpers.d.ts.map +0 -1
  625. package/build/types/prompt/CriticalBanner/index.d.ts +0 -3
  626. package/build/types/prompt/CriticalBanner/index.d.ts.map +0 -1
  627. package/build/types/prompt/common/Expander/Expander.d.ts +0 -20
  628. package/build/types/prompt/common/Expander/Expander.d.ts.map +0 -1
  629. package/build/types/prompt/common/Expander/Expander.messages.d.ts +0 -14
  630. package/build/types/prompt/common/Expander/Expander.messages.d.ts.map +0 -1
  631. package/build/types/prompt/helpers/promptMedia.d.ts +0 -22
  632. package/build/types/prompt/helpers/promptMedia.d.ts.map +0 -1
  633. package/src/common/propsValues/breakpoint.ts +0 -8
  634. package/src/prompt/CriticalBanner/CriticalBanner.accessibility.docs.mdx +0 -113
  635. package/src/prompt/CriticalBanner/CriticalBanner.css +0 -59
  636. package/src/prompt/CriticalBanner/CriticalBanner.less +0 -64
  637. package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +0 -632
  638. package/src/prompt/CriticalBanner/CriticalBanner.test.story.tsx +0 -285
  639. package/src/prompt/CriticalBanner/CriticalBanner.tsx +0 -182
  640. package/src/prompt/CriticalBanner/helpers.ts +0 -39
  641. package/src/prompt/CriticalBanner/index.ts +0 -2
  642. package/src/prompt/common/Expander/Expander.css +0 -8
  643. package/src/prompt/common/Expander/Expander.less +0 -9
  644. package/src/prompt/common/Expander/Expander.messages.ts +0 -14
  645. package/src/prompt/common/Expander/Expander.test.tsx +0 -167
  646. package/src/prompt/common/Expander/Expander.tsx +0 -83
  647. package/src/prompt/helpers/promptMedia.tsx +0 -79
@@ -1,632 +0,0 @@
1
- import { useState, useEffect, useRef, type ReactNode } from 'react';
2
- import { createPortal } from 'react-dom';
3
- import { Meta, StoryObj, Decorator } from '@storybook/react-webpack5';
4
- import { fn } from 'storybook/test';
5
- import { Bank, Briefcase, Star, Travel } from '@transferwise/icons';
6
- import Button from '../../button';
7
- import { CriticalBanner, type CriticalBannerProps } from './CriticalBanner';
8
-
9
- /**
10
- * **Design guidance**: <a href="https://wise.design/components/critical-banner" target="_blank">wise.design/components/critical-banner</a>
11
- */
12
- const meta = {
13
- component: CriticalBanner,
14
- title: 'Prompts/CriticalBanner',
15
- tags: ['new'],
16
- parameters: { docs: { toc: true } },
17
- args: {
18
- title: 'Your account requires verification',
19
- description: 'Please verify your identity to continue using all features.',
20
- sentiment: 'negative',
21
- expanded: true,
22
- action: { label: 'Verify now', onClick: fn() },
23
- actionSecondary: undefined,
24
- media: undefined,
25
- id: undefined,
26
- className: undefined,
27
- 'data-testid': undefined,
28
- onToggle: fn(),
29
- },
30
- argTypes: {
31
- sentiment: {
32
- control: 'radio',
33
- options: ['negative', 'warning', 'neutral', 'success'],
34
- },
35
- title: {
36
- control: 'text',
37
- table: { type: { summary: 'ReactNode' } },
38
- },
39
- description: {
40
- control: 'text',
41
- table: { type: { summary: 'ReactNode' } },
42
- },
43
- expanded: { control: 'boolean' },
44
- media: {
45
- control: false,
46
- description: 'Replaces the default Status Icon with a custom image or AvatarView.',
47
- table: {
48
- type: {
49
- summary: 'PromptMedia',
50
- detail:
51
- '{ imgSrc?: string; avatar?: { imgSrc?: string; profileName?: string; profileType?: string; asset?: ReactNode; badge?: { flagCode: string } }; aria-label?: string }',
52
- },
53
- },
54
- },
55
- action: {
56
- control: false,
57
- table: {
58
- type: {
59
- summary: 'CriticalBannerAction',
60
- detail: '{ label: ReactNode; onClick?: () => void; href?: string; target?: string }',
61
- },
62
- },
63
- },
64
- actionSecondary: {
65
- control: false,
66
- table: {
67
- type: {
68
- summary: 'CriticalBannerActionSecondary',
69
- detail: '{ label: ReactNode; onClick?: () => void; href?: string; target?: string }',
70
- },
71
- },
72
- },
73
- id: { table: { category: 'Common' } },
74
- className: { table: { category: 'Common' } },
75
- 'data-testid': { table: { category: 'Common' } },
76
- onToggle: { table: { disable: true } },
77
- },
78
- } satisfies Meta<typeof CriticalBanner>;
79
-
80
- export default meta;
81
- type Story = StoryObj<typeof CriticalBanner>;
82
-
83
- type PreviewStoryArgs = CriticalBannerProps & {
84
- previewMedia: CriticalBannerProps['media'];
85
- previewSecondaryAction: boolean;
86
- };
87
-
88
- const MEDIA_OPTIONS: Record<string, CriticalBannerProps['media']> = {
89
- undefined,
90
- 'Custom image': { imgSrc: '../../wise-card.svg' },
91
- 'Avatar: Photo': { avatar: { imgSrc: '../../avatar-rectangle-fox.webp' } },
92
- 'Avatar: Business (GB)': {
93
- avatar: { profileType: 'BUSINESS', badge: { flagCode: 'GB' } },
94
- },
95
- 'Avatar: Personal (EU)': {
96
- avatar: { profileType: 'PERSONAL', badge: { flagCode: 'EU' } },
97
- },
98
- 'Avatar: Bank icon': { avatar: { asset: <Bank /> } },
99
- 'Avatar: Star icon': { avatar: { asset: <Star /> } },
100
- 'Avatar: Travel icon': { avatar: { asset: <Travel /> } },
101
- 'Avatar: Briefcase icon': { avatar: { asset: <Briefcase /> } },
102
- 'Avatar: Initials': { avatar: { profileName: 'John Doe' } },
103
- };
104
-
105
- const previewArgTypes = {
106
- previewMedia: {
107
- name: 'Preview with `media`',
108
- control: 'select',
109
- options: Object.keys(MEDIA_OPTIONS),
110
- mapping: MEDIA_OPTIONS,
111
- table: { category: 'Storybook Preview' },
112
- },
113
- previewSecondaryAction: {
114
- name: 'Preview with `actionSecondary`',
115
- control: 'boolean',
116
- table: { category: 'Storybook Preview' },
117
- },
118
- } as const;
119
-
120
- /** Renders children inside an iframe that inherits the parent page's stylesheets. */
121
- function IframeContainer({ width, children }: { width: number; children: ReactNode }) {
122
- const iframeRef = useRef<HTMLIFrameElement>(null);
123
- const [mountNode, setMountNode] = useState<HTMLElement | null>(null);
124
-
125
- useEffect(() => {
126
- const iframe = iframeRef.current;
127
- if (!iframe) return;
128
-
129
- const doc = iframe.contentDocument;
130
- if (!doc) return;
131
-
132
- doc.head.innerHTML = '';
133
- Array.from(document.styleSheets).forEach((sheet) => {
134
- try {
135
- if (sheet.href) {
136
- const link = doc.createElement('link');
137
- link.rel = 'stylesheet';
138
- link.href = sheet.href;
139
- doc.head.appendChild(link);
140
- } else if (sheet.cssRules) {
141
- const style = doc.createElement('style');
142
- style.textContent = Array.from(sheet.cssRules)
143
- .map((r) => r.cssText)
144
- .join('\n');
145
- doc.head.appendChild(style);
146
- }
147
- } catch {
148
- // Skip cross-origin sheets
149
- }
150
- });
151
-
152
- doc.body.style.margin = '0';
153
- setMountNode(doc.body);
154
- }, []);
155
-
156
- return (
157
- <iframe
158
- ref={iframeRef}
159
- title={`${width}px preview`}
160
- sandbox="allow-same-origin"
161
- style={{
162
- width,
163
- height: 300,
164
- border: '1px solid var(--color-border-neutral)',
165
- borderRadius: 8,
166
- overflow: 'hidden',
167
- }}
168
- >
169
- {mountNode && createPortal(children, mountNode)}
170
- </iframe>
171
- );
172
- }
173
-
174
- const ContainerDecorator: Decorator = (Story) => (
175
- <div
176
- style={{
177
- width: '100%',
178
- display: 'flex',
179
- flexDirection: 'column',
180
- gap: '1rem',
181
- }}
182
- >
183
- <Story />
184
- </div>
185
- );
186
-
187
- /**
188
- * Interactive playground with all controls.
189
- */
190
- export const Playground: StoryObj<PreviewStoryArgs> = {
191
- args: {
192
- previewMedia: undefined,
193
- previewSecondaryAction: true,
194
- },
195
- argTypes: {
196
- ...previewArgTypes,
197
- },
198
- render: function Render(args: PreviewStoryArgs) {
199
- const { previewMedia, previewSecondaryAction, ...props } = args;
200
- const [expanded, setExpanded] = useState(args.expanded);
201
-
202
- useEffect(() => {
203
- setExpanded(args.expanded);
204
- }, [args.expanded]);
205
-
206
- return (
207
- <CriticalBanner
208
- {...props}
209
- expanded={expanded}
210
- media={previewMedia}
211
- actionSecondary={
212
- previewSecondaryAction ? { label: 'Learn more', onClick: fn() } : undefined
213
- }
214
- onToggle={() => setExpanded(!expanded)}
215
- />
216
- );
217
- },
218
- };
219
-
220
- /**
221
- * There are four sentiments, with negative being the default.
222
- */
223
- export const Sentiments: Story = {
224
- decorators: [ContainerDecorator],
225
- parameters: {
226
- docs: {
227
- source: {
228
- code: `<CriticalBanner sentiment="negative" ... />
229
- <CriticalBanner sentiment="warning" ... />
230
- <CriticalBanner sentiment="neutral" ... />
231
- <CriticalBanner sentiment="success" ... />`,
232
- },
233
- },
234
- },
235
- argTypes: {
236
- sentiment: { table: { disable: true } },
237
- title: { table: { disable: true } },
238
- description: { table: { disable: true } },
239
- action: { table: { disable: true } },
240
- actionSecondary: { table: { disable: true } },
241
- media: { table: { disable: true } },
242
- expanded: { table: { disable: true } },
243
- onToggle: { table: { disable: true } },
244
- id: { table: { disable: true } },
245
- className: { table: { disable: true } },
246
- 'data-testid': { table: { disable: true } },
247
- },
248
- render: function Render() {
249
- return (
250
- <>
251
- {(['negative', 'warning', 'neutral', 'success'] as const).map((sentiment) => (
252
- <CriticalBanner
253
- key={sentiment}
254
- sentiment={sentiment}
255
- title={`This is a critical banner with ${sentiment} sentiment`}
256
- description="Complete the required action to regain full access."
257
- action={{ label: 'Take action', onClick: fn() }}
258
- actionSecondary={{ label: 'Learn more', onClick: fn() }}
259
- />
260
- ))}
261
- </>
262
- );
263
- },
264
- };
265
-
266
- /**
267
- * Banners can have just a primary action, both primary and secondary, or no actions at all.
268
- */
269
- export const Actions: Story = {
270
- decorators: [ContainerDecorator],
271
- parameters: {
272
- docs: {
273
- source: {
274
- code: `<CriticalBanner
275
- title="..."
276
- />
277
- <CriticalBanner
278
- title="..."
279
- action={{ label: 'Verify identity', onClick: () => {} }} />
280
- <CriticalBanner
281
- title="..."
282
- action={{ label: 'Verify now', onClick: () => {} }}
283
- actionSecondary={{ label: 'Contact support', onClick: () => {} }}
284
- />`,
285
- },
286
- },
287
- },
288
- argTypes: {
289
- sentiment: { table: { disable: true } },
290
- title: { table: { disable: true } },
291
- description: { table: { disable: true } },
292
- action: { table: { disable: true } },
293
- actionSecondary: { table: { disable: true } },
294
- media: { table: { disable: true } },
295
- expanded: { table: { disable: true } },
296
- onToggle: { table: { disable: true } },
297
- id: { table: { disable: true } },
298
- className: { table: { disable: true } },
299
- 'data-testid': { table: { disable: true } },
300
- },
301
- render: function Render() {
302
- return (
303
- <>
304
- <CriticalBanner sentiment="negative" title="No actions" />
305
- <CriticalBanner
306
- sentiment="warning"
307
- title="Primary action only"
308
- action={{ label: 'Verify identity', onClick: fn() }}
309
- />
310
- <CriticalBanner
311
- sentiment="success"
312
- title="Primary and secondary actions"
313
- action={{ label: 'Verify now', onClick: fn() }}
314
- actionSecondary={{ label: 'Contact support', onClick: fn() }}
315
- />
316
- </>
317
- );
318
- },
319
- };
320
-
321
- /**
322
- * Each sentiment has a default status icon. Override it with a custom image or an AvatarView.
323
- */
324
- export const MediaTypes: Story = {
325
- decorators: [ContainerDecorator],
326
- parameters: {
327
- docs: {
328
- source: {
329
- code: `{/* Default — sentiment icon */}
330
- <CriticalBanner sentiment="neutral" />
331
-
332
- {/* Custom image */}
333
- <CriticalBanner media={{ imgSrc: '/card.svg', 'aria-label': 'Wise card' }} ... />
334
-
335
- {/* Avatar with photo */}
336
- <CriticalBanner media={{ avatar: { imgSrc: '/photo.webp' } }} ... />
337
-
338
- {/* Avatar with initials */}
339
- <CriticalBanner media={{ avatar: { profileName: 'John Doe' } }} ... />
340
-
341
- {/* Avatar with custom icon */}
342
- <CriticalBanner media={{ avatar: { asset: <Bank /> } }} ... />
343
-
344
- {/* Business Profile with flag badge */}
345
- <CriticalBanner media={{ avatar: { profileType: 'BUSINESS', badge: { flagCode: 'GB' } } }} ... />`,
346
- },
347
- },
348
- },
349
- argTypes: {
350
- sentiment: { table: { disable: true } },
351
- title: { table: { disable: true } },
352
- description: { table: { disable: true } },
353
- action: { table: { disable: true } },
354
- actionSecondary: { table: { disable: true } },
355
- media: { table: { disable: true } },
356
- expanded: { table: { disable: true } },
357
- onToggle: { table: { disable: true } },
358
- id: { table: { disable: true } },
359
- className: { table: { disable: true } },
360
- 'data-testid': { table: { disable: true } },
361
- },
362
- render: function Render() {
363
- const [expandedStates, setExpandedStates] = useState<Record<string, boolean>>({
364
- default: true,
365
- image: true,
366
- avatarPhoto: true,
367
- avatarInitials: true,
368
- avatarIcon: true,
369
- businessBadge: true,
370
- personalBadge: true,
371
- });
372
-
373
- const toggle = (key: string) => setExpandedStates((prev) => ({ ...prev, [key]: !prev[key] }));
374
-
375
- return (
376
- <>
377
- <CriticalBanner
378
- sentiment="neutral"
379
- title="Default status icon"
380
- description="When no media is provided, the sentiment's default icon is displayed."
381
- action={{ label: 'Continue', onClick: fn() }}
382
- expanded={expandedStates.default}
383
- onToggle={() => toggle('default')}
384
- />
385
- <CriticalBanner
386
- sentiment="neutral"
387
- title="Custom image"
388
- description="Your card has been blocked for security reasons."
389
- media={{ imgSrc: '../../wise-card.svg', 'aria-label': 'Wise debit card' }}
390
- action={{ label: 'Unblock card', onClick: fn() }}
391
- expanded={expandedStates.image}
392
- onToggle={() => toggle('image')}
393
- />
394
- <CriticalBanner
395
- sentiment="neutral"
396
- title="Avatar with photo"
397
- description="The default badge is the status icon for the sentiment."
398
- media={{ avatar: { imgSrc: '../../avatar-rectangle-fox.webp' } }}
399
- action={{ label: 'Update photo', onClick: fn() }}
400
- expanded={expandedStates.avatarPhoto}
401
- onToggle={() => toggle('avatarPhoto')}
402
- />
403
- <CriticalBanner
404
- sentiment="neutral"
405
- title="Avatar with initials"
406
- description="The default badge is the status icon for the sentiment."
407
- media={{ avatar: { profileName: 'John Doe' } }}
408
- action={{ label: 'Complete profile', onClick: fn() }}
409
- expanded={expandedStates.avatarInitials}
410
- onToggle={() => toggle('avatarInitials')}
411
- />
412
- <CriticalBanner
413
- sentiment="neutral"
414
- title="Avatar with custom icon"
415
- description="The default badge is the status icon for the sentiment."
416
- media={{ avatar: { asset: <Bank title="Bank account" /> } }}
417
- action={{ label: 'Connect bank', onClick: fn() }}
418
- expanded={expandedStates.avatarIcon}
419
- onToggle={() => toggle('avatarIcon')}
420
- />
421
- <CriticalBanner
422
- sentiment="neutral"
423
- title="Business profile with badge"
424
- description="Your business account requires additional documentation."
425
- media={{ avatar: { profileType: 'BUSINESS', badge: { flagCode: 'GB' } } }}
426
- action={{ label: 'Upload documents', onClick: fn() }}
427
- expanded={expandedStates.businessBadge}
428
- onToggle={() => toggle('businessBadge')}
429
- />
430
- </>
431
- );
432
- },
433
- };
434
-
435
- /**
436
- * The banner can be fully controlled — the parent can pass in the `expanded` state.
437
- * Clicking the chevron calls `onToggle`, and external buttons can also toggle expansion.
438
- * We recommend tracking the state that the user has set `expanded` to and keeping it there on page refresh.
439
- */
440
- export const Expanded: Story = {
441
- parameters: {
442
- docs: {
443
- source: {
444
- code: `const [expanded, setExpanded] = useState(true);
445
-
446
- <Button onClick={() => setExpanded(!expanded)}>
447
- {expanded ? 'Collapse' : 'Expand'}
448
- </Button>
449
-
450
- <CriticalBanner
451
- ...
452
- expanded={expanded}
453
- onToggle={() => setExpanded(!expanded)}
454
- />`,
455
- },
456
- },
457
- },
458
- argTypes: {
459
- sentiment: { table: { disable: true } },
460
- title: { table: { disable: true } },
461
- description: { table: { disable: true } },
462
- action: { table: { disable: true } },
463
- actionSecondary: { table: { disable: true } },
464
- media: { table: { disable: true } },
465
- expanded: { table: { disable: true } },
466
- onToggle: { table: { disable: true } },
467
- id: { table: { disable: true } },
468
- className: { table: { disable: true } },
469
- 'data-testid': { table: { disable: true } },
470
- },
471
- render: function Render() {
472
- const [expanded, setExpanded] = useState(true);
473
-
474
- return (
475
- <div style={{ display: 'flex', flexDirection: 'column', gap: '1rem', width: '100%' }}>
476
- <div>
477
- <Button v2 onClick={() => setExpanded(!expanded)}>
478
- {expanded ? 'Collapse externally' : 'Expand externally'}
479
- </Button>
480
- </div>
481
- <CriticalBanner
482
- sentiment="negative"
483
- title="Your account requires verification"
484
- description="Please verify your identity to continue using all features. This process typically takes 2–3 minutes."
485
- action={{ label: 'Verify now', onClick: fn() }}
486
- actionSecondary={{ label: 'Learn more', onClick: fn() }}
487
- expanded={expanded}
488
- onToggle={() => setExpanded(!expanded)}
489
- />
490
- </div>
491
- );
492
- },
493
- };
494
-
495
- /**
496
- * When the banner has no title, the description remains visible when collapsed and
497
- * is clamped to 2 lines. With a title, only the title is shown when collapsed.
498
- */
499
- export const CollapsedBehaviour: Story = {
500
- decorators: [ContainerDecorator],
501
- parameters: {
502
- docs: {
503
- canvas: { sourceState: 'hidden' },
504
- },
505
- },
506
- argTypes: {
507
- sentiment: { table: { disable: true } },
508
- title: { table: { disable: true } },
509
- description: { table: { disable: true } },
510
- action: { table: { disable: true } },
511
- actionSecondary: { table: { disable: true } },
512
- media: { table: { disable: true } },
513
- expanded: { table: { disable: true } },
514
- onToggle: { table: { disable: true } },
515
- id: { table: { disable: true } },
516
- className: { table: { disable: true } },
517
- 'data-testid': { table: { disable: true } },
518
- },
519
- render: function Render() {
520
- const [expanded1, setExpanded1] = useState(false);
521
- const [expanded2, setExpanded2] = useState(false);
522
-
523
- return (
524
- <>
525
- <CriticalBanner
526
- sentiment="negative"
527
- title="Collapsed with title"
528
- description="This description is hidden when collapsed because the title provides enough context."
529
- action={{ label: 'Take action', onClick: fn() }}
530
- expanded={expanded1}
531
- onToggle={() => setExpanded1(!expanded1)}
532
- />
533
- <CriticalBanner
534
- sentiment="warning"
535
- 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."
536
- action={{ label: 'Take action', onClick: fn() }}
537
- expanded={expanded2}
538
- onToggle={() => setExpanded2(!expanded2)}
539
- />
540
- </>
541
- );
542
- },
543
- };
544
-
545
- /**
546
- * Above 480px the collapse toggle disappears and the banner is always fully expanded. The buttons are not block displayed.
547
- * Below 480px the user can collapse and expand the banner and the buttons are displayed as block elements.
548
- * Eventually the buttons stack.
549
- */
550
- export const Responsiveness: Story = {
551
- parameters: {
552
- docs: {
553
- canvas: { sourceState: 'hidden' },
554
- },
555
- },
556
- argTypes: {
557
- sentiment: { table: { disable: true } },
558
- title: { table: { disable: true } },
559
- description: { table: { disable: true } },
560
- action: { table: { disable: true } },
561
- actionSecondary: { table: { disable: true } },
562
- media: { table: { disable: true } },
563
- expanded: { table: { disable: true } },
564
- onToggle: { table: { disable: true } },
565
- id: { table: { disable: true } },
566
- className: { table: { disable: true } },
567
- 'data-testid': { table: { disable: true } },
568
- },
569
- render: function Render() {
570
- return (
571
- <div style={{ display: 'flex', gap: 16, alignItems: 'start', minWidth: 1500 }}>
572
- {[200, 350, 600].map((width) => (
573
- <IframeContainer key={width} width={width}>
574
- <CriticalBanner
575
- sentiment="warning"
576
- title="Your account requires verification"
577
- description="Please verify your identity to continue using all features."
578
- action={{ label: 'Verify now', onClick: fn() }}
579
- actionSecondary={{ label: 'Learn more', onClick: fn() }}
580
- />
581
- </IframeContainer>
582
- ))}
583
- </div>
584
- );
585
- },
586
- };
587
-
588
- /**
589
- * The text container is capped at 480px for optimal readability, even though
590
- * the banner itself stretches to the full available width.
591
- */
592
- export const ParagraphWidth: Story = {
593
- parameters: {
594
- docs: {
595
- canvas: { sourceState: 'hidden' },
596
- },
597
- },
598
- argTypes: {
599
- sentiment: { table: { disable: true } },
600
- title: { table: { disable: true } },
601
- description: { table: { disable: true } },
602
- action: { table: { disable: true } },
603
- actionSecondary: { table: { disable: true } },
604
- media: { table: { disable: true } },
605
- expanded: { table: { disable: true } },
606
- onToggle: { table: { disable: true } },
607
- id: { table: { disable: true } },
608
- className: { table: { disable: true } },
609
- 'data-testid': { table: { disable: true } },
610
- },
611
- decorators: [
612
- (Story) => (
613
- <div style={{ minWidth: 1000 }}>
614
- <Story />
615
- </div>
616
- ),
617
- ],
618
- render: function Render() {
619
- const [expanded, setExpanded] = useState(true);
620
-
621
- return (
622
- <CriticalBanner
623
- sentiment="negative"
624
- title="The text container is capped at 480px for optimal readability, even though the banner itself stretches to the full available width."
625
- 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."
626
- action={{ label: 'Verify now', onClick: fn() }}
627
- expanded={expanded}
628
- onToggle={() => setExpanded(!expanded)}
629
- />
630
- );
631
- },
632
- };