@transferwise/components 46.134.0 → 46.135.0

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 (341) hide show
  1. package/build/accordion/AccordionItem/AccordionItem.js +1 -0
  2. package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
  3. package/build/accordion/AccordionItem/AccordionItem.mjs +1 -0
  4. package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
  5. package/build/actionButton/ActionButton.js +1 -0
  6. package/build/actionButton/ActionButton.js.map +1 -1
  7. package/build/actionButton/ActionButton.mjs +1 -0
  8. package/build/actionButton/ActionButton.mjs.map +1 -1
  9. package/build/actionOption/ActionOption.js +1 -0
  10. package/build/actionOption/ActionOption.js.map +1 -1
  11. package/build/actionOption/ActionOption.mjs +1 -0
  12. package/build/actionOption/ActionOption.mjs.map +1 -1
  13. package/build/alert/Alert.js +1 -0
  14. package/build/alert/Alert.js.map +1 -1
  15. package/build/alert/Alert.mjs +1 -0
  16. package/build/alert/Alert.mjs.map +1 -1
  17. package/build/alert/inlineMarkdown/InlineMarkdown.js +1 -0
  18. package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
  19. package/build/alert/inlineMarkdown/InlineMarkdown.mjs +1 -0
  20. package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
  21. package/build/avatar/Avatar.js +1 -0
  22. package/build/avatar/Avatar.js.map +1 -1
  23. package/build/avatar/Avatar.mjs +1 -0
  24. package/build/avatar/Avatar.mjs.map +1 -1
  25. package/build/avatarView/AvatarView.js +1 -0
  26. package/build/avatarView/AvatarView.js.map +1 -1
  27. package/build/avatarView/AvatarView.mjs +1 -0
  28. package/build/avatarView/AvatarView.mjs.map +1 -1
  29. package/build/avatarWrapper/AvatarWrapper.js +1 -0
  30. package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
  31. package/build/avatarWrapper/AvatarWrapper.mjs +1 -0
  32. package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
  33. package/build/badge/Badge.js +1 -0
  34. package/build/badge/Badge.js.map +1 -1
  35. package/build/badge/Badge.mjs +1 -0
  36. package/build/badge/Badge.mjs.map +1 -1
  37. package/build/button/Button.js +1 -0
  38. package/build/button/Button.js.map +1 -1
  39. package/build/button/Button.mjs +1 -0
  40. package/build/button/Button.mjs.map +1 -1
  41. package/build/button/LegacyButton.js +1 -0
  42. package/build/button/LegacyButton.js.map +1 -1
  43. package/build/button/LegacyButton.mjs +1 -0
  44. package/build/button/LegacyButton.mjs.map +1 -1
  45. package/build/button/classMap.js +1 -0
  46. package/build/button/classMap.js.map +1 -1
  47. package/build/button/classMap.mjs +1 -0
  48. package/build/button/classMap.mjs.map +1 -1
  49. package/build/button/legacyUtils/legacyUtils.js +1 -0
  50. package/build/button/legacyUtils/legacyUtils.js.map +1 -1
  51. package/build/button/legacyUtils/legacyUtils.mjs +1 -0
  52. package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
  53. package/build/card/Card.js +1 -0
  54. package/build/card/Card.js.map +1 -1
  55. package/build/card/Card.mjs +1 -0
  56. package/build/card/Card.mjs.map +1 -1
  57. package/build/checkbox/Checkbox.js +1 -0
  58. package/build/checkbox/Checkbox.js.map +1 -1
  59. package/build/checkbox/Checkbox.mjs +1 -0
  60. package/build/checkbox/Checkbox.mjs.map +1 -1
  61. package/build/chevron/Chevron.js +1 -0
  62. package/build/chevron/Chevron.js.map +1 -1
  63. package/build/chevron/Chevron.mjs +1 -0
  64. package/build/chevron/Chevron.mjs.map +1 -1
  65. package/build/chips/Chip.js +1 -0
  66. package/build/chips/Chip.js.map +1 -1
  67. package/build/chips/Chip.mjs +1 -0
  68. package/build/chips/Chip.mjs.map +1 -1
  69. package/build/circularButton/CircularButton.js +1 -0
  70. package/build/circularButton/CircularButton.js.map +1 -1
  71. package/build/circularButton/CircularButton.mjs +1 -0
  72. package/build/circularButton/CircularButton.mjs.map +1 -1
  73. package/build/common/locale/index.js +9 -4
  74. package/build/common/locale/index.js.map +1 -1
  75. package/build/common/locale/index.mjs +9 -4
  76. package/build/common/locale/index.mjs.map +1 -1
  77. package/build/common/panel/Panel.js +1 -0
  78. package/build/common/panel/Panel.js.map +1 -1
  79. package/build/common/panel/Panel.mjs +1 -0
  80. package/build/common/panel/Panel.mjs.map +1 -1
  81. package/build/common/responsivePanel/ResponsivePanel.js +1 -0
  82. package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
  83. package/build/common/responsivePanel/ResponsivePanel.mjs +1 -0
  84. package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
  85. package/build/criticalBanner/CriticalCommsBanner.js +1 -0
  86. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  87. package/build/criticalBanner/CriticalCommsBanner.mjs +1 -0
  88. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  89. package/build/dateInput/DateInput.js +1 -1
  90. package/build/dateInput/DateInput.mjs +1 -1
  91. package/build/dateLookup/DateLookup.js +1 -1
  92. package/build/dateLookup/DateLookup.mjs +1 -1
  93. package/build/dateLookup/dateHeader/DateHeader.js +1 -0
  94. package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
  95. package/build/dateLookup/dateHeader/DateHeader.mjs +1 -0
  96. package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
  97. package/build/decision/Decision.js +1 -0
  98. package/build/decision/Decision.js.map +1 -1
  99. package/build/decision/Decision.mjs +1 -0
  100. package/build/decision/Decision.mjs.map +1 -1
  101. package/build/definitionList/DefinitionList.js +1 -0
  102. package/build/definitionList/DefinitionList.js.map +1 -1
  103. package/build/definitionList/DefinitionList.mjs +1 -0
  104. package/build/definitionList/DefinitionList.mjs.map +1 -1
  105. package/build/dimmer/Dimmer.js +1 -0
  106. package/build/dimmer/Dimmer.js.map +1 -1
  107. package/build/dimmer/Dimmer.mjs +1 -0
  108. package/build/dimmer/Dimmer.mjs.map +1 -1
  109. package/build/display/Display.js +1 -0
  110. package/build/display/Display.js.map +1 -1
  111. package/build/display/Display.mjs +1 -0
  112. package/build/display/Display.mjs.map +1 -1
  113. package/build/drawer/Drawer.js +1 -0
  114. package/build/drawer/Drawer.js.map +1 -1
  115. package/build/drawer/Drawer.mjs +1 -0
  116. package/build/drawer/Drawer.mjs.map +1 -1
  117. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js +4 -3
  118. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.js.map +1 -1
  119. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs +4 -3
  120. package/build/expressiveMoneyInput/currencySelector/CurrencySelector.mjs.map +1 -1
  121. package/build/field/Field.js +1 -0
  122. package/build/field/Field.js.map +1 -1
  123. package/build/field/Field.mjs +1 -0
  124. package/build/field/Field.mjs.map +1 -1
  125. package/build/flowNavigation/FlowNavigation.js +1 -0
  126. package/build/flowNavigation/FlowNavigation.js.map +1 -1
  127. package/build/flowNavigation/FlowNavigation.mjs +1 -0
  128. package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
  129. package/build/header/Header.js +1 -0
  130. package/build/header/Header.js.map +1 -1
  131. package/build/header/Header.mjs +1 -0
  132. package/build/header/Header.mjs.map +1 -1
  133. package/build/info/Info.js +1 -0
  134. package/build/info/Info.js.map +1 -1
  135. package/build/info/Info.mjs +1 -0
  136. package/build/info/Info.mjs.map +1 -1
  137. package/build/inlineAlert/InlineAlert.js +1 -0
  138. package/build/inlineAlert/InlineAlert.js.map +1 -1
  139. package/build/inlineAlert/InlineAlert.mjs +1 -0
  140. package/build/inlineAlert/InlineAlert.mjs.map +1 -1
  141. package/build/inputs/SearchInput.js +1 -0
  142. package/build/inputs/SearchInput.js.map +1 -1
  143. package/build/inputs/SearchInput.mjs +1 -0
  144. package/build/inputs/SearchInput.mjs.map +1 -1
  145. package/build/instructionsList/InstructionsList.js +1 -0
  146. package/build/instructionsList/InstructionsList.js.map +1 -1
  147. package/build/instructionsList/InstructionsList.mjs +1 -0
  148. package/build/instructionsList/InstructionsList.mjs.map +1 -1
  149. package/build/link/Link.js +1 -0
  150. package/build/link/Link.js.map +1 -1
  151. package/build/link/Link.mjs +1 -0
  152. package/build/link/Link.mjs.map +1 -1
  153. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js +1 -0
  154. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.js.map +1 -1
  155. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs +1 -0
  156. package/build/listItem/AdditionalInfo/ListItemAdditionalInfo.mjs.map +1 -1
  157. package/build/listItem/ListItem.js +1 -0
  158. package/build/listItem/ListItem.js.map +1 -1
  159. package/build/listItem/ListItem.mjs +1 -0
  160. package/build/listItem/ListItem.mjs.map +1 -1
  161. package/build/listItem/Prompt/ListItemPrompt.js +1 -0
  162. package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
  163. package/build/listItem/Prompt/ListItemPrompt.mjs +1 -0
  164. package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
  165. package/build/loader/Loader.js +1 -0
  166. package/build/loader/Loader.js.map +1 -1
  167. package/build/loader/Loader.mjs +1 -0
  168. package/build/loader/Loader.mjs.map +1 -1
  169. package/build/main.css +22 -22
  170. package/build/markdown/Markdown.js +1 -0
  171. package/build/markdown/Markdown.js.map +1 -1
  172. package/build/markdown/Markdown.mjs +1 -0
  173. package/build/markdown/Markdown.mjs.map +1 -1
  174. package/build/modal/Modal.js +1 -0
  175. package/build/modal/Modal.js.map +1 -1
  176. package/build/modal/Modal.mjs +1 -0
  177. package/build/modal/Modal.mjs.map +1 -1
  178. package/build/navigationOption/NavigationOption.js +1 -0
  179. package/build/navigationOption/NavigationOption.js.map +1 -1
  180. package/build/navigationOption/NavigationOption.mjs +1 -0
  181. package/build/navigationOption/NavigationOption.mjs.map +1 -1
  182. package/build/nudge/Nudge.js +1 -0
  183. package/build/nudge/Nudge.js.map +1 -1
  184. package/build/nudge/Nudge.mjs +1 -0
  185. package/build/nudge/Nudge.mjs.map +1 -1
  186. package/build/overlayHeader/OverlayHeader.js +1 -0
  187. package/build/overlayHeader/OverlayHeader.js.map +1 -1
  188. package/build/overlayHeader/OverlayHeader.mjs +1 -0
  189. package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
  190. package/build/phoneNumberInput/PhoneNumberInput.js +1 -0
  191. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  192. package/build/phoneNumberInput/PhoneNumberInput.mjs +1 -0
  193. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  194. package/build/popover/Popover.js +1 -0
  195. package/build/popover/Popover.js.map +1 -1
  196. package/build/popover/Popover.mjs +1 -0
  197. package/build/popover/Popover.mjs.map +1 -1
  198. package/build/processIndicator/ProcessIndicator.js +1 -0
  199. package/build/processIndicator/ProcessIndicator.js.map +1 -1
  200. package/build/processIndicator/ProcessIndicator.mjs +1 -0
  201. package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
  202. package/build/progressBar/ProgressBar.js +1 -0
  203. package/build/progressBar/ProgressBar.js.map +1 -1
  204. package/build/progressBar/ProgressBar.mjs +1 -0
  205. package/build/progressBar/ProgressBar.mjs.map +1 -1
  206. package/build/promoCard/PromoCard.js +1 -0
  207. package/build/promoCard/PromoCard.js.map +1 -1
  208. package/build/promoCard/PromoCard.mjs +1 -0
  209. package/build/promoCard/PromoCard.mjs.map +1 -1
  210. package/build/promoCard/PromoCardIndicator.js +1 -0
  211. package/build/promoCard/PromoCardIndicator.js.map +1 -1
  212. package/build/promoCard/PromoCardIndicator.mjs +1 -0
  213. package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
  214. package/build/prompt/ActionPrompt/ActionPrompt.js +1 -0
  215. package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
  216. package/build/prompt/ActionPrompt/ActionPrompt.mjs +1 -0
  217. package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
  218. package/build/prompt/InfoPrompt/InfoPrompt.js +1 -0
  219. package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
  220. package/build/prompt/InfoPrompt/InfoPrompt.mjs +1 -0
  221. package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
  222. package/build/prompt/InlinePrompt/InlinePrompt.js +1 -0
  223. package/build/prompt/InlinePrompt/InlinePrompt.js.map +1 -1
  224. package/build/prompt/InlinePrompt/InlinePrompt.mjs +1 -0
  225. package/build/prompt/InlinePrompt/InlinePrompt.mjs.map +1 -1
  226. package/build/radio/Radio.js +1 -0
  227. package/build/radio/Radio.js.map +1 -1
  228. package/build/radio/Radio.mjs +1 -0
  229. package/build/radio/Radio.mjs.map +1 -1
  230. package/build/segmentedControl/SegmentedControl.js +1 -0
  231. package/build/segmentedControl/SegmentedControl.js.map +1 -1
  232. package/build/segmentedControl/SegmentedControl.mjs +1 -0
  233. package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
  234. package/build/select/Select.js +1 -0
  235. package/build/select/Select.js.map +1 -1
  236. package/build/select/Select.mjs +1 -0
  237. package/build/select/Select.mjs.map +1 -1
  238. package/build/select/option/Option.js +1 -0
  239. package/build/select/option/Option.js.map +1 -1
  240. package/build/select/option/Option.mjs +1 -0
  241. package/build/select/option/Option.mjs.map +1 -1
  242. package/build/statusIcon/StatusIcon.js +1 -0
  243. package/build/statusIcon/StatusIcon.js.map +1 -1
  244. package/build/statusIcon/StatusIcon.mjs +1 -0
  245. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  246. package/build/stepper/Stepper.js +1 -0
  247. package/build/stepper/Stepper.js.map +1 -1
  248. package/build/stepper/Stepper.mjs +1 -0
  249. package/build/stepper/Stepper.mjs.map +1 -1
  250. package/build/sticky/Sticky.js +1 -0
  251. package/build/sticky/Sticky.js.map +1 -1
  252. package/build/sticky/Sticky.mjs +1 -0
  253. package/build/sticky/Sticky.mjs.map +1 -1
  254. package/build/styles/css/neptune.css +22 -22
  255. package/build/styles/less/neptune-tokens.less +4 -4
  256. package/build/styles/main.css +22 -22
  257. package/build/styles/props/neptune-tokens.css +2 -2
  258. package/build/styles/styles/less/neptune.css +22 -22
  259. package/build/summary/Summary.js +1 -0
  260. package/build/summary/Summary.js.map +1 -1
  261. package/build/summary/Summary.mjs +1 -0
  262. package/build/summary/Summary.mjs.map +1 -1
  263. package/build/table/Table.js +1 -0
  264. package/build/table/Table.js.map +1 -1
  265. package/build/table/Table.mjs +1 -0
  266. package/build/table/Table.mjs.map +1 -1
  267. package/build/table/TableRow.js +1 -0
  268. package/build/table/TableRow.js.map +1 -1
  269. package/build/table/TableRow.mjs +1 -0
  270. package/build/table/TableRow.mjs.map +1 -1
  271. package/build/table/TableStatusText.js +1 -0
  272. package/build/table/TableStatusText.js.map +1 -1
  273. package/build/table/TableStatusText.mjs +1 -0
  274. package/build/table/TableStatusText.mjs.map +1 -1
  275. package/build/tabs/Tabs.js +1 -0
  276. package/build/tabs/Tabs.js.map +1 -1
  277. package/build/tabs/Tabs.mjs +1 -0
  278. package/build/tabs/Tabs.mjs.map +1 -1
  279. package/build/tile/Tile.js +1 -0
  280. package/build/tile/Tile.js.map +1 -1
  281. package/build/tile/Tile.mjs +1 -0
  282. package/build/tile/Tile.mjs.map +1 -1
  283. package/build/title/Title.js +1 -0
  284. package/build/title/Title.js.map +1 -1
  285. package/build/title/Title.mjs +1 -0
  286. package/build/title/Title.mjs.map +1 -1
  287. package/build/tooltip/Tooltip.js +1 -0
  288. package/build/tooltip/Tooltip.js.map +1 -1
  289. package/build/tooltip/Tooltip.mjs +1 -0
  290. package/build/tooltip/Tooltip.mjs.map +1 -1
  291. package/build/typeahead/Typeahead.js +1 -0
  292. package/build/typeahead/Typeahead.js.map +1 -1
  293. package/build/typeahead/Typeahead.mjs +1 -0
  294. package/build/typeahead/Typeahead.mjs.map +1 -1
  295. package/build/types/common/locale/index.d.ts +1 -1
  296. package/build/types/common/locale/index.d.ts.map +1 -1
  297. package/build/types/expressiveMoneyInput/currencySelector/CurrencySelector.d.ts.map +1 -1
  298. package/build/upload/Upload.js +1 -0
  299. package/build/upload/Upload.js.map +1 -1
  300. package/build/upload/Upload.mjs +1 -0
  301. package/build/upload/Upload.mjs.map +1 -1
  302. package/build/upload/steps/completeStep/completeStep.js +1 -0
  303. package/build/upload/steps/completeStep/completeStep.js.map +1 -1
  304. package/build/upload/steps/completeStep/completeStep.mjs +1 -0
  305. package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
  306. package/build/upload/steps/processingStep/processingStep.js +1 -0
  307. package/build/upload/steps/processingStep/processingStep.js.map +1 -1
  308. package/build/upload/steps/processingStep/processingStep.mjs +1 -0
  309. package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
  310. package/build/upload/steps/uploadImageStep/uploadImageStep.js +1 -0
  311. package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
  312. package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +1 -0
  313. package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
  314. package/build/uploadInput/UploadInput.js +1 -0
  315. package/build/uploadInput/UploadInput.js.map +1 -1
  316. package/build/uploadInput/UploadInput.mjs +1 -0
  317. package/build/uploadInput/UploadInput.mjs.map +1 -1
  318. package/build/uploadInput/uploadButton/UploadButton.js +1 -0
  319. package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
  320. package/build/uploadInput/uploadButton/UploadButton.mjs +1 -0
  321. package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
  322. package/build/uploadInput/uploadButton/defaults.js +1 -0
  323. package/build/uploadInput/uploadButton/defaults.js.map +1 -1
  324. package/build/uploadInput/uploadButton/defaults.mjs +1 -0
  325. package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
  326. package/build/uploadInput/uploadItem/UploadItem.js +1 -0
  327. package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
  328. package/build/uploadInput/uploadItem/UploadItem.mjs +1 -0
  329. package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
  330. package/build/withDisplayFormat/WithDisplayFormat.js +1 -0
  331. package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
  332. package/build/withDisplayFormat/WithDisplayFormat.mjs +1 -0
  333. package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
  334. package/package.json +14 -14
  335. package/src/common/locale/index.test.ts +13 -4
  336. package/src/common/locale/index.ts +9 -3
  337. package/src/expressiveMoneyInput/ExpressiveMoneyInput.story.tsx +18 -0
  338. package/src/expressiveMoneyInput/currencySelector/CurrencySelector.test.tsx +119 -1
  339. package/src/expressiveMoneyInput/currencySelector/CurrencySelector.tsx +4 -3
  340. package/src/main.css +22 -22
  341. package/src/styles/less/neptune.css +22 -22
@@ -120,12 +120,12 @@ describe('locale utils', () => {
120
120
  const result = getLocaleCurrencyName(intl, 'USD');
121
121
  expect(intl.formatDisplayName).toHaveBeenCalledWith('USD', {
122
122
  type: 'currency',
123
- fallback: 'code',
123
+ fallback: 'none',
124
124
  });
125
125
  expect(result).toBe('US Dollar');
126
126
  });
127
127
 
128
- it('should return the original currency code if Intl.DisplayNames is not supported', () => {
128
+ it('should return the formatted currency code if Intl.DisplayNames is not supported', () => {
129
129
  const intl = {
130
130
  formatDisplayName: jest.fn().mockReturnValue('US Dollar'),
131
131
  } as unknown as IntlShape;
@@ -134,8 +134,17 @@ describe('locale utils', () => {
134
134
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
135
135
  (Intl as any).DisplayNames = undefined;
136
136
 
137
- const result = getLocaleCurrencyName(intl, 'USD');
138
- expect(result).toBe('USD');
137
+ const result = getLocaleCurrencyName(intl, 'USC');
138
+ expect(result).toBe('USDC');
139
+ });
140
+
141
+ it('should return the formatted code when formatDisplayName does not support the currency code', () => {
142
+ const intl = {
143
+ formatDisplayName: jest.fn().mockReturnValue(undefined),
144
+ } as unknown as IntlShape;
145
+
146
+ const result = getLocaleCurrencyName(intl, 'USC');
147
+ expect(result).toBe('USDC');
139
148
  });
140
149
  });
141
150
  });
@@ -1,4 +1,5 @@
1
1
  import { IntlShape } from 'react-intl/src/types';
2
+ import { formatCurrencyCode } from '@transferwise/formatting';
2
3
  import { Direction } from '../direction';
3
4
 
4
5
  export const DEFAULT_LANG = 'en';
@@ -105,7 +106,12 @@ export function getDirectionFromLocale(locale: string) {
105
106
  * @returns The localized currency name if Intl.DisplayNames is supported supported, otherwise returns the original currency code.
106
107
  */
107
108
  export function getLocaleCurrencyName(intl: IntlShape, currencyCode: string) {
108
- return typeof Intl.DisplayNames === 'function'
109
- ? intl.formatDisplayName(currencyCode, { type: 'currency', fallback: 'code' })
110
- : currencyCode;
109
+ if (typeof Intl.DisplayNames === 'function') {
110
+ const localisedName = intl.formatDisplayName(currencyCode, {
111
+ type: 'currency',
112
+ fallback: 'none',
113
+ });
114
+ return localisedName != null ? localisedName : formatCurrencyCode(currencyCode);
115
+ }
116
+ return formatCurrencyCode(currencyCode);
111
117
  }
@@ -161,6 +161,24 @@ export const WithInlinePromptSentiment = {
161
161
  },
162
162
  };
163
163
 
164
+ export const WithFormattedCurrencyCode = {
165
+ args: {
166
+ currency: 'USC',
167
+ currencySelector: {
168
+ ...getCurrencySelectorProps({ logEvents: true }),
169
+ options: [
170
+ {
171
+ title: 'Popular',
172
+ currencies: [
173
+ { code: 'USC', label: 'Digital Dollar', keywords: ['USDC', 'Digital Dollar'] },
174
+ { code: 'USD', label: 'US Dollar', keywords: ['dollar', 'us'] },
175
+ ],
176
+ },
177
+ ],
178
+ },
179
+ },
180
+ };
181
+
164
182
  export const WithSecondaryCurrencySelectorAvatar = {
165
183
  args: {
166
184
  currencySelector: getCurrencySelectorProps({ logEvents: true, secondAvatar: true }),
@@ -1,4 +1,11 @@
1
- import { mockMatchMedia, mockResizeObserver, render, screen, userEvent } from '../../test-utils';
1
+ import {
2
+ mockMatchMedia,
3
+ mockResizeObserver,
4
+ render,
5
+ screen,
6
+ userEvent,
7
+ waitFor,
8
+ } from '../../test-utils';
2
9
 
3
10
  import { CurrencySelector } from './CurrencySelector';
4
11
 
@@ -92,6 +99,112 @@ describe('CurrencySelector', () => {
92
99
  expect(screen.getByRole('combobox')).toBeDisabled();
93
100
  });
94
101
 
102
+ it('displays formatted currency code when the currency is selected', () => {
103
+ render(<CurrencySelector options={mockCurrencies} id="id" currency="USC" labelId="labelId" />);
104
+
105
+ expect(screen.getByRole('combobox', { name: 'Select currency' })).toHaveTextContent('USDC');
106
+ });
107
+
108
+ it('displays formatted currency code in the selected option content', async () => {
109
+ render(
110
+ <CurrencySelector
111
+ options={[
112
+ {
113
+ title: 'All',
114
+ currencies: [
115
+ { code: 'USC', label: 'USDC', keywords: ['USDC'] },
116
+ { code: 'EUR', label: 'Euro', keywords: ['EUR'] },
117
+ ],
118
+ },
119
+ ]}
120
+ id="id"
121
+ currency="USC"
122
+ labelId="labelId"
123
+ onChange={jest.fn()}
124
+ />,
125
+ );
126
+
127
+ await userEvent.click(screen.getByRole('combobox'));
128
+
129
+ expect(screen.getByRole('option', { name: /^usdc/iu })).toHaveTextContent('USDC');
130
+ });
131
+
132
+ it('fires onChange with the raw currency code when selecting a formatted currency', async () => {
133
+ const onChange = jest.fn();
134
+ render(
135
+ <CurrencySelector
136
+ options={[
137
+ {
138
+ title: 'All',
139
+ currencies: [
140
+ { code: 'USC', label: 'USDC', keywords: ['USC'] },
141
+ { code: 'EUR', label: 'Euro', keywords: ['EUR'] },
142
+ ],
143
+ },
144
+ ]}
145
+ id="id"
146
+ currency="EUR"
147
+ labelId="labelId"
148
+ onChange={onChange}
149
+ />,
150
+ );
151
+
152
+ await userEvent.click(screen.getByRole('combobox'));
153
+ await userEvent.click(screen.getByRole('option', { name: /^usdc/iu }));
154
+
155
+ expect(onChange).toHaveBeenCalledWith('USC');
156
+ });
157
+
158
+ it('returns USC option when searching by the formatted code USDC', async () => {
159
+ render(
160
+ <CurrencySelector
161
+ options={mockCurrencies}
162
+ id="id"
163
+ currency="USD"
164
+ labelId="labelId"
165
+ onChange={jest.fn()}
166
+ />,
167
+ );
168
+
169
+ await userEvent.click(screen.getByRole('combobox', { name: 'Select currency' }));
170
+
171
+ await userEvent.type(
172
+ screen.getByRole('combobox', {
173
+ name: /type a currency \/ country/iu,
174
+ }),
175
+ 'USDC',
176
+ );
177
+
178
+ await waitFor(() => {
179
+ expect(screen.getByRole('option', { name: /usdc/iu })).toBeInTheDocument();
180
+ });
181
+ });
182
+
183
+ it('does not return USDC option when searching by the raw code USC', async () => {
184
+ render(
185
+ <CurrencySelector
186
+ options={mockCurrencies}
187
+ id="id"
188
+ currency="USD"
189
+ labelId="labelId"
190
+ onChange={jest.fn()}
191
+ />,
192
+ );
193
+
194
+ await userEvent.click(screen.getByRole('combobox', { name: 'Select currency' }));
195
+
196
+ await userEvent.type(
197
+ screen.getByRole('combobox', {
198
+ name: /type a currency \/ country/iu,
199
+ }),
200
+ 'USC',
201
+ );
202
+
203
+ await waitFor(() => {
204
+ expect(screen.queryByRole('option')).not.toBeInTheDocument();
205
+ });
206
+ });
207
+
95
208
  it('deduplicates currencies while searching', async () => {
96
209
  render(
97
210
  <CurrencySelector
@@ -155,6 +268,11 @@ const mockCurrencies = [
155
268
  label: 'Australian Dollar',
156
269
  keywords: ['AUD', 'australia'],
157
270
  },
271
+ {
272
+ code: 'USC',
273
+ label: 'Digital Dollar',
274
+ keywords: ['USDC', 'Digital Dollar'],
275
+ },
158
276
  ],
159
277
  },
160
278
  ];
@@ -19,6 +19,7 @@ import { useIntl } from 'react-intl';
19
19
 
20
20
  import messages from '../ExpressiveMoneyInput.messages';
21
21
  import { getLocaleCurrencyName } from '../../common';
22
+ import { formatCurrencyCode } from '@transferwise/formatting';
22
23
 
23
24
  export interface CurrencyOption {
24
25
  label?: string;
@@ -99,7 +100,7 @@ export const CurrencySelector = ({
99
100
  renderValue={({ code, label }) => {
100
101
  return (
101
102
  <SelectInputOptionContent
102
- title={code}
103
+ title={formatCurrencyCode(code)}
103
104
  note={label}
104
105
  icon={<Flag code={code} intrinsicSize={24} />}
105
106
  />
@@ -128,7 +129,7 @@ export const CurrencySelector = ({
128
129
  onClick={(event) => handleTriggerClick(event)}
129
130
  >
130
131
  <>
131
- <span aria-hidden>{currency}</span>
132
+ <span aria-hidden>{formatCurrencyCode(currency)}</span>
132
133
  <span className="sr-only">{getLocaleCurrencyName(intl, currency)}</span>
133
134
  </>
134
135
  </SelectInputTriggerButton>
@@ -203,7 +204,7 @@ const filterAndSortCurrenciesForQuery = (
203
204
  currencies
204
205
  .filter((currency) => {
205
206
  return (
206
- currency.code.toLowerCase().includes(query) ||
207
+ formatCurrencyCode(currency.code).toLowerCase().includes(query) ||
207
208
  (currency.label ?? '').toLowerCase().includes(query) ||
208
209
  currency.keywords?.some((keyword) => keyword.toLowerCase().includes(query))
209
210
  );
package/src/main.css CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Do not edit directly
3
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
2
+ * Do not edit directly, this file was auto-generated.
3
+ * Generated on Tue, 31 Mar 2026 13:02:10 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -142,8 +142,8 @@
142
142
  }
143
143
 
144
144
  /**
145
- * Do not edit directly
146
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
145
+ * Do not edit directly, this file was auto-generated.
146
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
147
147
  */
148
148
 
149
149
  .np-theme-personal {
@@ -391,8 +391,8 @@
391
391
  }
392
392
 
393
393
  /**
394
- * Do not edit directly
395
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
394
+ * Do not edit directly, this file was auto-generated.
395
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
396
396
  */
397
397
 
398
398
  .np-theme-personal--forest-green {
@@ -640,8 +640,8 @@
640
640
  }
641
641
 
642
642
  /**
643
- * Do not edit directly
644
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
643
+ * Do not edit directly, this file was auto-generated.
644
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
645
645
  */
646
646
 
647
647
  .np-theme-personal--bright-green {
@@ -889,8 +889,8 @@
889
889
  }
890
890
 
891
891
  /**
892
- * Do not edit directly
893
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
892
+ * Do not edit directly, this file was auto-generated.
893
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
894
894
  */
895
895
 
896
896
  .np-theme-personal--dark {
@@ -1138,8 +1138,8 @@
1138
1138
  }
1139
1139
 
1140
1140
  /**
1141
- * Do not edit directly
1142
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
1141
+ * Do not edit directly, this file was auto-generated.
1142
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
1143
1143
  */
1144
1144
 
1145
1145
  .np-theme-platform {
@@ -1321,8 +1321,8 @@
1321
1321
  }
1322
1322
 
1323
1323
  /**
1324
- * Do not edit directly
1325
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
1324
+ * Do not edit directly, this file was auto-generated.
1325
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
1326
1326
  */
1327
1327
 
1328
1328
  .np-theme-platform--forest-green {
@@ -1504,8 +1504,8 @@
1504
1504
  }
1505
1505
 
1506
1506
  /**
1507
- * Do not edit directly
1508
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
1507
+ * Do not edit directly, this file was auto-generated.
1508
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
1509
1509
  */
1510
1510
 
1511
1511
  .np-theme-business {
@@ -1688,8 +1688,8 @@
1688
1688
  }
1689
1689
 
1690
1690
  /**
1691
- * Do not edit directly
1692
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
1691
+ * Do not edit directly, this file was auto-generated.
1692
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
1693
1693
  */
1694
1694
 
1695
1695
  .np-theme-business--dark {
@@ -1872,8 +1872,8 @@
1872
1872
  }
1873
1873
 
1874
1874
  /**
1875
- * Do not edit directly
1876
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
1875
+ * Do not edit directly, this file was auto-generated.
1876
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
1877
1877
  */
1878
1878
 
1879
1879
  .np-theme-business--forest-green {
@@ -2056,8 +2056,8 @@
2056
2056
  }
2057
2057
 
2058
2058
  /**
2059
- * Do not edit directly
2060
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
2059
+ * Do not edit directly, this file was auto-generated.
2060
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
2061
2061
  */
2062
2062
 
2063
2063
  .np-theme-business--bright-green {
@@ -1,6 +1,6 @@
1
1
  /**
2
- * Do not edit directly
3
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
2
+ * Do not edit directly, this file was auto-generated.
3
+ * Generated on Tue, 31 Mar 2026 13:02:10 GMT
4
4
  */
5
5
 
6
6
  :root {
@@ -142,8 +142,8 @@
142
142
  }
143
143
 
144
144
  /**
145
- * Do not edit directly
146
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
145
+ * Do not edit directly, this file was auto-generated.
146
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
147
147
  */
148
148
 
149
149
  .np-theme-personal {
@@ -391,8 +391,8 @@
391
391
  }
392
392
 
393
393
  /**
394
- * Do not edit directly
395
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
394
+ * Do not edit directly, this file was auto-generated.
395
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
396
396
  */
397
397
 
398
398
  .np-theme-personal--forest-green {
@@ -640,8 +640,8 @@
640
640
  }
641
641
 
642
642
  /**
643
- * Do not edit directly
644
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
643
+ * Do not edit directly, this file was auto-generated.
644
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
645
645
  */
646
646
 
647
647
  .np-theme-personal--bright-green {
@@ -889,8 +889,8 @@
889
889
  }
890
890
 
891
891
  /**
892
- * Do not edit directly
893
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
892
+ * Do not edit directly, this file was auto-generated.
893
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
894
894
  */
895
895
 
896
896
  .np-theme-personal--dark {
@@ -1138,8 +1138,8 @@
1138
1138
  }
1139
1139
 
1140
1140
  /**
1141
- * Do not edit directly
1142
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
1141
+ * Do not edit directly, this file was auto-generated.
1142
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
1143
1143
  */
1144
1144
 
1145
1145
  .np-theme-platform {
@@ -1321,8 +1321,8 @@
1321
1321
  }
1322
1322
 
1323
1323
  /**
1324
- * Do not edit directly
1325
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
1324
+ * Do not edit directly, this file was auto-generated.
1325
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
1326
1326
  */
1327
1327
 
1328
1328
  .np-theme-platform--forest-green {
@@ -1504,8 +1504,8 @@
1504
1504
  }
1505
1505
 
1506
1506
  /**
1507
- * Do not edit directly
1508
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
1507
+ * Do not edit directly, this file was auto-generated.
1508
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
1509
1509
  */
1510
1510
 
1511
1511
  .np-theme-business {
@@ -1688,8 +1688,8 @@
1688
1688
  }
1689
1689
 
1690
1690
  /**
1691
- * Do not edit directly
1692
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
1691
+ * Do not edit directly, this file was auto-generated.
1692
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
1693
1693
  */
1694
1694
 
1695
1695
  .np-theme-business--dark {
@@ -1872,8 +1872,8 @@
1872
1872
  }
1873
1873
 
1874
1874
  /**
1875
- * Do not edit directly
1876
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
1875
+ * Do not edit directly, this file was auto-generated.
1876
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
1877
1877
  */
1878
1878
 
1879
1879
  .np-theme-business--forest-green {
@@ -2056,8 +2056,8 @@
2056
2056
  }
2057
2057
 
2058
2058
  /**
2059
- * Do not edit directly
2060
- * Generated on Wed, 07 Jan 2026 11:56:15 GMT
2059
+ * Do not edit directly, this file was auto-generated.
2060
+ * Generated on Tue, 31 Mar 2026 13:02:11 GMT
2061
2061
  */
2062
2062
 
2063
2063
  .np-theme-business--bright-green {