@transferwise/components 46.94.1 → 46.95.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 (475) hide show
  1. package/build/accordion/Accordion.js +4 -2
  2. package/build/accordion/Accordion.js.map +1 -1
  3. package/build/accordion/AccordionItem/AccordionItem.js +6 -4
  4. package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
  5. package/build/actionButton/ActionButton.js +3 -1
  6. package/build/actionButton/ActionButton.js.map +1 -1
  7. package/build/actionOption/ActionOption.js +5 -3
  8. package/build/actionOption/ActionOption.js.map +1 -1
  9. package/build/alert/Alert.js +4 -4
  10. package/build/alert/Alert.js.map +1 -1
  11. package/build/alert/inlineMarkdown/InlineMarkdown.js +4 -2
  12. package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
  13. package/build/avatar/Avatar.js +3 -1
  14. package/build/avatar/Avatar.js.map +1 -1
  15. package/build/avatarLayout/AvatarLayout.js +5 -3
  16. package/build/avatarLayout/AvatarLayout.js.map +1 -1
  17. package/build/avatarView/AvatarView.js +9 -7
  18. package/build/avatarView/AvatarView.js.map +1 -1
  19. package/build/avatarView/NotificationDot.js +3 -1
  20. package/build/avatarView/NotificationDot.js.map +1 -1
  21. package/build/avatarWrapper/AvatarWrapper.js +8 -6
  22. package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
  23. package/build/avatarWrapper/AvatarWrapper.mjs +1 -1
  24. package/build/avatarWrapper/index.js +3 -1
  25. package/build/avatarWrapper/index.js.map +1 -1
  26. package/build/badge/Badge.js +3 -1
  27. package/build/badge/Badge.js.map +1 -1
  28. package/build/badge/Badge.mjs.map +1 -1
  29. package/build/badge/BadgeAssets.js +9 -7
  30. package/build/badge/BadgeAssets.js.map +1 -1
  31. package/build/badge/BadgeAssets.mjs +2 -2
  32. package/build/badge/BadgeAssets.mjs.map +1 -1
  33. package/build/body/Body.js +3 -1
  34. package/build/body/Body.js.map +1 -1
  35. package/build/button/Button.js +8 -6
  36. package/build/button/Button.js.map +1 -1
  37. package/build/button/Button.resolver.js +5 -3
  38. package/build/button/Button.resolver.js.map +1 -1
  39. package/build/button/LegacyButton.js +5 -3
  40. package/build/button/LegacyButton.js.map +1 -1
  41. package/build/card/Card.js +6 -4
  42. package/build/card/Card.js.map +1 -1
  43. package/build/carousel/Carousel.js +7 -5
  44. package/build/carousel/Carousel.js.map +1 -1
  45. package/build/checkbox/Checkbox.js +6 -4
  46. package/build/checkbox/Checkbox.js.map +1 -1
  47. package/build/checkboxButton/CheckboxButton.js +3 -1
  48. package/build/checkboxButton/CheckboxButton.js.map +1 -1
  49. package/build/checkboxOption/CheckboxOption.js +5 -3
  50. package/build/checkboxOption/CheckboxOption.js.map +1 -1
  51. package/build/chevron/Chevron.js +3 -1
  52. package/build/chevron/Chevron.js.map +1 -1
  53. package/build/chips/Chip.js +4 -2
  54. package/build/chips/Chip.js.map +1 -1
  55. package/build/chips/Chips.js +5 -3
  56. package/build/chips/Chips.js.map +1 -1
  57. package/build/chips/Chips.messages.js +3 -1
  58. package/build/chips/Chips.messages.js.map +1 -1
  59. package/build/circularButton/CircularButton.js +5 -3
  60. package/build/circularButton/CircularButton.js.map +1 -1
  61. package/build/common/Option/Option.js +7 -5
  62. package/build/common/Option/Option.js.map +1 -1
  63. package/build/common/Option/Option.mjs +2 -2
  64. package/build/common/Option/Option.mjs.map +1 -1
  65. package/build/common/RadioButton/RadioButton.js +3 -1
  66. package/build/common/RadioButton/RadioButton.js.map +1 -1
  67. package/build/common/action/Action.js +2 -2
  68. package/build/common/action/Action.js.map +1 -1
  69. package/build/common/bottomSheet/BottomSheet.js +4 -2
  70. package/build/common/bottomSheet/BottomSheet.js.map +1 -1
  71. package/build/common/card/Card.js +3 -1
  72. package/build/common/card/Card.js.map +1 -1
  73. package/build/common/circle/Circle.js +3 -1
  74. package/build/common/circle/Circle.js.map +1 -1
  75. package/build/common/closeButton/CloseButton.js +1 -1
  76. package/build/common/closeButton/CloseButton.js.map +1 -1
  77. package/build/common/closeButton/CloseButton.messages.js +3 -1
  78. package/build/common/closeButton/CloseButton.messages.js.map +1 -1
  79. package/build/common/flowHeader/FlowHeader.js +3 -1
  80. package/build/common/flowHeader/FlowHeader.js.map +1 -1
  81. package/build/common/focusBoundary/FocusBoundary.js +3 -1
  82. package/build/common/focusBoundary/FocusBoundary.js.map +1 -1
  83. package/build/common/historyNavigator/historyNavigator.js +3 -1
  84. package/build/common/historyNavigator/historyNavigator.js.map +1 -1
  85. package/build/common/locale/index.js +0 -24
  86. package/build/common/locale/index.js.map +1 -1
  87. package/build/common/locale/index.mjs +0 -24
  88. package/build/common/locale/index.mjs.map +1 -1
  89. package/build/common/panel/Panel.js +3 -1
  90. package/build/common/panel/Panel.js.map +1 -1
  91. package/build/common/responsivePanel/ResponsivePanel.js +5 -3
  92. package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
  93. package/build/common/textFormat/formatWithPattern/formatWithPattern.js +4 -2
  94. package/build/common/textFormat/formatWithPattern/formatWithPattern.js.map +1 -1
  95. package/build/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js +4 -2
  96. package/build/common/textFormat/getCountOfSymbolsInSelection/getCountOfSymbolsInSelection.js.map +1 -1
  97. package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js +4 -2
  98. package/build/common/textFormat/getCursorPositionAfterKeystroke/getCursorPositionAfterKeystroke.js.map +1 -1
  99. package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js +2 -2
  100. package/build/common/textFormat/getDistanceToSymbol/getDistanceToSymbol.js.map +1 -1
  101. package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js +3 -1
  102. package/build/common/textFormat/getSymbolsInPatternWithPosition/getSymbolsInPatternWithPosition.js.map +1 -1
  103. package/build/common/textFormat/unformatWithPattern/unformatWithPattern.js +3 -1
  104. package/build/common/textFormat/unformatWithPattern/unformatWithPattern.js.map +1 -1
  105. package/build/criticalBanner/CriticalCommsBanner.js +3 -1
  106. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  107. package/build/dateInput/DateInput.js +15 -13
  108. package/build/dateInput/DateInput.js.map +1 -1
  109. package/build/dateInput/DateInput.messages.js +3 -1
  110. package/build/dateInput/DateInput.messages.js.map +1 -1
  111. package/build/dateInput/DateInput.mjs +3 -3
  112. package/build/dateInput/DateInput.mjs.map +1 -1
  113. package/build/dateLookup/DateLookup.js +8 -6
  114. package/build/dateLookup/DateLookup.js.map +1 -1
  115. package/build/dateLookup/DateLookup.messages.js +3 -1
  116. package/build/dateLookup/DateLookup.messages.js.map +1 -1
  117. package/build/dateLookup/dateHeader/DateHeader.js +33 -26
  118. package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
  119. package/build/dateLookup/dateHeader/DateHeader.mjs +27 -22
  120. package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
  121. package/build/dateLookup/dateTrigger/DateTrigger.js +8 -6
  122. package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -1
  123. package/build/dateLookup/dateTrigger/DateTrigger.messages.js +4 -2
  124. package/build/dateLookup/dateTrigger/DateTrigger.messages.js.map +1 -1
  125. package/build/dateLookup/dateTrigger/DateTrigger.messages.mjs +2 -2
  126. package/build/dateLookup/dateTrigger/DateTrigger.messages.mjs.map +1 -1
  127. package/build/dateLookup/dateTrigger/DateTrigger.mjs +2 -2
  128. package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -1
  129. package/build/dateLookup/dayCalendar/DayCalendar.js +6 -4
  130. package/build/dateLookup/dayCalendar/DayCalendar.js.map +1 -1
  131. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -2
  132. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -1
  133. package/build/dateLookup/monthCalendar/MonthCalendar.js +6 -4
  134. package/build/dateLookup/monthCalendar/MonthCalendar.js.map +1 -1
  135. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js +4 -2
  136. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +1 -1
  137. package/build/dateLookup/tableLink/TableLink.js +4 -2
  138. package/build/dateLookup/tableLink/TableLink.js.map +1 -1
  139. package/build/dateLookup/yearCalendar/YearCalendar.js +6 -4
  140. package/build/dateLookup/yearCalendar/YearCalendar.js.map +1 -1
  141. package/build/dateLookup/yearCalendar/table/YearCalendarTable.js +4 -2
  142. package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +1 -1
  143. package/build/decision/Decision.js +2 -2
  144. package/build/decision/Decision.js.map +1 -1
  145. package/build/definitionList/DefinitionList.js +4 -2
  146. package/build/definitionList/DefinitionList.js.map +1 -1
  147. package/build/dimmer/Dimmer.js +3 -3
  148. package/build/dimmer/Dimmer.js.map +1 -1
  149. package/build/dimmer/dimmerManager/DimmerManager.js +3 -1
  150. package/build/dimmer/dimmerManager/DimmerManager.js.map +1 -1
  151. package/build/display/Display.js +3 -1
  152. package/build/display/Display.js.map +1 -1
  153. package/build/divider/Divider.js +35 -0
  154. package/build/divider/Divider.js.map +1 -0
  155. package/build/divider/Divider.mjs +31 -0
  156. package/build/divider/Divider.mjs.map +1 -0
  157. package/build/drawer/Drawer.js +4 -2
  158. package/build/drawer/Drawer.js.map +1 -1
  159. package/build/dropFade/DropFade.js +3 -1
  160. package/build/dropFade/DropFade.js.map +1 -1
  161. package/build/emphasis/Emphasis.js +4 -2
  162. package/build/emphasis/Emphasis.js.map +1 -1
  163. package/build/emphasis/EmphasisHtmlTransformer.js +3 -1
  164. package/build/emphasis/EmphasisHtmlTransformer.js.map +1 -1
  165. package/build/field/Field.js +1 -1
  166. package/build/field/Field.js.map +1 -1
  167. package/build/flowNavigation/FlowNavigation.js +8 -6
  168. package/build/flowNavigation/FlowNavigation.js.map +1 -1
  169. package/build/flowNavigation/FlowNavigation.messages.js +3 -1
  170. package/build/flowNavigation/FlowNavigation.messages.js.map +1 -1
  171. package/build/flowNavigation/animatedLabel/AnimatedLabel.js +5 -3
  172. package/build/flowNavigation/animatedLabel/AnimatedLabel.js.map +1 -1
  173. package/build/header/Header.js +4 -4
  174. package/build/header/Header.js.map +1 -1
  175. package/build/i18n/commonMessages/Button.messages.js +3 -1
  176. package/build/i18n/commonMessages/Button.messages.js.map +1 -1
  177. package/build/i18n/cs.json +22 -5
  178. package/build/i18n/cs.json.js +25 -6
  179. package/build/i18n/cs.json.js.map +1 -1
  180. package/build/i18n/cs.json.mjs +22 -5
  181. package/build/i18n/cs.json.mjs.map +1 -1
  182. package/build/i18n/de.json.js +3 -1
  183. package/build/i18n/de.json.js.map +1 -1
  184. package/build/i18n/en.json.js +3 -1
  185. package/build/i18n/en.json.js.map +1 -1
  186. package/build/i18n/es.json.js +3 -1
  187. package/build/i18n/es.json.js.map +1 -1
  188. package/build/i18n/fr.json.js +3 -1
  189. package/build/i18n/fr.json.js.map +1 -1
  190. package/build/i18n/hu.json.js +3 -1
  191. package/build/i18n/hu.json.js.map +1 -1
  192. package/build/i18n/id.json.js +3 -1
  193. package/build/i18n/id.json.js.map +1 -1
  194. package/build/i18n/index.js +22 -20
  195. package/build/i18n/index.js.map +1 -1
  196. package/build/i18n/it.json.js +3 -1
  197. package/build/i18n/it.json.js.map +1 -1
  198. package/build/i18n/ja.json.js +3 -1
  199. package/build/i18n/ja.json.js.map +1 -1
  200. package/build/i18n/nl.json +73 -0
  201. package/build/i18n/pl.json.js +3 -1
  202. package/build/i18n/pl.json.js.map +1 -1
  203. package/build/i18n/pt.json.js +3 -1
  204. package/build/i18n/pt.json.js.map +1 -1
  205. package/build/i18n/ro.json.js +3 -1
  206. package/build/i18n/ro.json.js.map +1 -1
  207. package/build/i18n/ru.json.js +3 -1
  208. package/build/i18n/ru.json.js.map +1 -1
  209. package/build/i18n/th.json.js +3 -1
  210. package/build/i18n/th.json.js.map +1 -1
  211. package/build/i18n/tr.json.js +3 -1
  212. package/build/i18n/tr.json.js.map +1 -1
  213. package/build/i18n/uk.json.js +3 -1
  214. package/build/i18n/uk.json.js.map +1 -1
  215. package/build/i18n/zh-CN.json.js +3 -1
  216. package/build/i18n/zh-CN.json.js.map +1 -1
  217. package/build/i18n/zh-HK.json.js +3 -1
  218. package/build/i18n/zh-HK.json.js.map +1 -1
  219. package/build/iconButton/IconButton.js +5 -3
  220. package/build/iconButton/IconButton.js.map +1 -1
  221. package/build/index.js +84 -82
  222. package/build/index.js.map +1 -1
  223. package/build/index.mjs +3 -2
  224. package/build/index.mjs.map +1 -1
  225. package/build/info/Info.js +8 -6
  226. package/build/info/Info.js.map +1 -1
  227. package/build/info/Info.messages.js +3 -1
  228. package/build/info/Info.messages.js.map +1 -1
  229. package/build/inlineAlert/InlineAlert.js +5 -3
  230. package/build/inlineAlert/InlineAlert.js.map +1 -1
  231. package/build/inputWithDisplayFormat/InputWithDisplayFormat.js +4 -2
  232. package/build/inputWithDisplayFormat/InputWithDisplayFormat.js.map +1 -1
  233. package/build/inputs/SelectInput.js +3 -3
  234. package/build/inputs/SelectInput.js.map +1 -1
  235. package/build/inputs/SelectInput.messages.js +3 -1
  236. package/build/inputs/SelectInput.messages.js.map +1 -1
  237. package/build/inputs/SelectInput.mjs +2 -2
  238. package/build/inputs/SelectInput.mjs.map +1 -1
  239. package/build/instructionsList/InstructionsList.js +4 -2
  240. package/build/instructionsList/InstructionsList.js.map +1 -1
  241. package/build/label/Label.js +3 -3
  242. package/build/label/Label.js.map +1 -1
  243. package/build/label/Label.messages.js +3 -1
  244. package/build/label/Label.messages.js.map +1 -1
  245. package/build/link/Link.js +5 -3
  246. package/build/link/Link.js.map +1 -1
  247. package/build/link/Link.messages.js +3 -1
  248. package/build/link/Link.messages.js.map +1 -1
  249. package/build/listItem/ListItem.js +5 -3
  250. package/build/listItem/ListItem.js.map +1 -1
  251. package/build/loader/Loader.js +3 -1
  252. package/build/loader/Loader.js.map +1 -1
  253. package/build/main.css +27 -8
  254. package/build/markdown/Markdown.js +3 -1
  255. package/build/markdown/Markdown.js.map +1 -1
  256. package/build/modal/Modal.js +5 -3
  257. package/build/modal/Modal.js.map +1 -1
  258. package/build/money/Money.js +3 -1
  259. package/build/money/Money.js.map +1 -1
  260. package/build/moneyInput/MoneyInput.js +7 -5
  261. package/build/moneyInput/MoneyInput.js.map +1 -1
  262. package/build/moneyInput/MoneyInput.messages.js +3 -1
  263. package/build/moneyInput/MoneyInput.messages.js.map +1 -1
  264. package/build/navigationOption/NavigationOption.js +5 -3
  265. package/build/navigationOption/NavigationOption.js.map +1 -1
  266. package/build/navigationOptionsList/NavigationOptionsList.js +3 -1
  267. package/build/navigationOptionsList/NavigationOptionsList.js.map +1 -1
  268. package/build/nudge/Nudge.js +2 -2
  269. package/build/nudge/Nudge.js.map +1 -1
  270. package/build/overlayHeader/OverlayHeader.js +4 -2
  271. package/build/overlayHeader/OverlayHeader.js.map +1 -1
  272. package/build/phoneNumberInput/PhoneNumberInput.js +5 -3
  273. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  274. package/build/phoneNumberInput/PhoneNumberInput.messages.js +3 -1
  275. package/build/phoneNumberInput/PhoneNumberInput.messages.js.map +1 -1
  276. package/build/phoneNumberInput/data/countries.js +3 -1
  277. package/build/phoneNumberInput/data/countries.js.map +1 -1
  278. package/build/phoneNumberInput/utils/findCountryByCode/index.js +1 -1
  279. package/build/phoneNumberInput/utils/findCountryByCode/index.js.map +1 -1
  280. package/build/phoneNumberInput/utils/findCountryByPrefix/index.js +1 -1
  281. package/build/phoneNumberInput/utils/findCountryByPrefix/index.js.map +1 -1
  282. package/build/popover/Popover.js +5 -3
  283. package/build/popover/Popover.js.map +1 -1
  284. package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.js +3 -1
  285. package/build/primitives/PrimitiveAnchor/PrimitiveAnchor.js.map +1 -1
  286. package/build/primitives/PrimitiveButton/PrimitiveButton.js +4 -2
  287. package/build/primitives/PrimitiveButton/PrimitiveButton.js.map +1 -1
  288. package/build/processIndicator/ProcessIndicator.js +3 -1
  289. package/build/processIndicator/ProcessIndicator.js.map +1 -1
  290. package/build/progress/Progress.js +3 -1
  291. package/build/progress/Progress.js.map +1 -1
  292. package/build/progressBar/ProgressBar.js +7 -5
  293. package/build/progressBar/ProgressBar.js.map +1 -1
  294. package/build/promoCard/PromoCard.js +8 -6
  295. package/build/promoCard/PromoCard.js.map +1 -1
  296. package/build/promoCard/PromoCardGroup.js +3 -1
  297. package/build/promoCard/PromoCardGroup.js.map +1 -1
  298. package/build/promoCard/PromoCardIndicator.js +5 -3
  299. package/build/promoCard/PromoCardIndicator.js.map +1 -1
  300. package/build/provider/Provider.js +4 -2
  301. package/build/provider/Provider.js.map +1 -1
  302. package/build/radio/Radio.js +6 -4
  303. package/build/radio/Radio.js.map +1 -1
  304. package/build/radioGroup/RadioGroup.js +4 -2
  305. package/build/radioGroup/RadioGroup.js.map +1 -1
  306. package/build/radioOption/RadioOption.js +5 -3
  307. package/build/radioOption/RadioOption.js.map +1 -1
  308. package/build/section/Section.js +3 -1
  309. package/build/section/Section.js.map +1 -1
  310. package/build/segmentedControl/SegmentedControl.js +5 -3
  311. package/build/segmentedControl/SegmentedControl.js.map +1 -1
  312. package/build/select/Select.js +13 -11
  313. package/build/select/Select.js.map +1 -1
  314. package/build/select/Select.messages.js +3 -1
  315. package/build/select/Select.messages.js.map +1 -1
  316. package/build/select/option/Option.js +6 -4
  317. package/build/select/option/Option.js.map +1 -1
  318. package/build/select/option/index.js +3 -1
  319. package/build/select/option/index.js.map +1 -1
  320. package/build/select/searchBox/SearchBox.js +3 -1
  321. package/build/select/searchBox/SearchBox.js.map +1 -1
  322. package/build/selectOption/SelectOption.js +10 -8
  323. package/build/selectOption/SelectOption.js.map +1 -1
  324. package/build/selectOption/SelectOption.messages.js +3 -1
  325. package/build/selectOption/SelectOption.messages.js.map +1 -1
  326. package/build/snackbar/Snackbar.js +3 -3
  327. package/build/snackbar/Snackbar.js.map +1 -1
  328. package/build/snackbar/SnackbarProvider.js +3 -1
  329. package/build/snackbar/SnackbarProvider.js.map +1 -1
  330. package/build/snackbar/useSnackbar.js +3 -1
  331. package/build/snackbar/useSnackbar.js.map +1 -1
  332. package/build/statusIcon/StatusIcon.js +12 -10
  333. package/build/statusIcon/StatusIcon.js.map +1 -1
  334. package/build/statusIcon/StatusIcon.messages.js +3 -1
  335. package/build/statusIcon/StatusIcon.messages.js.map +1 -1
  336. package/build/stepper/Stepper.js +4 -2
  337. package/build/stepper/Stepper.js.map +1 -1
  338. package/build/sticky/Sticky.js +3 -1
  339. package/build/sticky/Sticky.js.map +1 -1
  340. package/build/styles/button/Button.css +2 -2
  341. package/build/styles/common/Option/Option.css +1 -1
  342. package/build/styles/dateLookup/DateLookup.css +0 -5
  343. package/build/styles/divider/Divider.css +24 -0
  344. package/build/styles/main.css +27 -8
  345. package/build/summary/Summary.js +9 -7
  346. package/build/summary/Summary.js.map +1 -1
  347. package/build/summary/Summary.messages.js +3 -1
  348. package/build/summary/Summary.messages.js.map +1 -1
  349. package/build/switch/Switch.js +3 -1
  350. package/build/switch/Switch.js.map +1 -1
  351. package/build/switchOption/SwitchOption.js +5 -3
  352. package/build/switchOption/SwitchOption.js.map +1 -1
  353. package/build/table/Table.js +16 -14
  354. package/build/table/Table.js.map +1 -1
  355. package/build/table/Table.messages.js +3 -1
  356. package/build/table/Table.messages.js.map +1 -1
  357. package/build/table/TableCell.js +9 -7
  358. package/build/table/TableCell.js.map +1 -1
  359. package/build/table/TableHeader.js +6 -4
  360. package/build/table/TableHeader.js.map +1 -1
  361. package/build/table/TableRow.js +6 -4
  362. package/build/table/TableRow.js.map +1 -1
  363. package/build/table/TableStatusText.js +4 -2
  364. package/build/table/TableStatusText.js.map +1 -1
  365. package/build/tabs/Tab.js +3 -1
  366. package/build/tabs/Tab.js.map +1 -1
  367. package/build/tabs/TabList.js +3 -1
  368. package/build/tabs/TabList.js.map +1 -1
  369. package/build/tabs/TabPanel.js +3 -1
  370. package/build/tabs/TabPanel.js.map +1 -1
  371. package/build/tabs/Tabs.js +6 -4
  372. package/build/tabs/Tabs.js.map +1 -1
  373. package/build/textareaWithDisplayFormat/TextareaWithDisplayFormat.js +4 -2
  374. package/build/textareaWithDisplayFormat/TextareaWithDisplayFormat.js.map +1 -1
  375. package/build/tile/Tile.js +5 -3
  376. package/build/tile/Tile.js.map +1 -1
  377. package/build/title/Title.js +3 -1
  378. package/build/title/Title.js.map +1 -1
  379. package/build/tooltip/Tooltip.js +3 -1
  380. package/build/tooltip/Tooltip.js.map +1 -1
  381. package/build/typeahead/Typeahead.js +8 -6
  382. package/build/typeahead/Typeahead.js.map +1 -1
  383. package/build/typeahead/Typeahead.messages.js +3 -1
  384. package/build/typeahead/Typeahead.messages.js.map +1 -1
  385. package/build/typeahead/typeaheadInput/TypeaheadInput.js +3 -1
  386. package/build/typeahead/typeaheadInput/TypeaheadInput.js.map +1 -1
  387. package/build/typeahead/typeaheadOption/TypeaheadOption.js +5 -3
  388. package/build/typeahead/typeaheadOption/TypeaheadOption.js.map +1 -1
  389. package/build/typeahead/util/highlight.js +3 -1
  390. package/build/typeahead/util/highlight.js.map +1 -1
  391. package/build/types/badge/Badge.d.ts +1 -1
  392. package/build/types/badge/Badge.d.ts.map +1 -1
  393. package/build/types/badge/BadgeAssets.d.ts.map +1 -1
  394. package/build/types/common/locale/index.d.ts +1 -1
  395. package/build/types/common/locale/index.d.ts.map +1 -1
  396. package/build/types/dateInput/DateInput.d.ts +1 -1
  397. package/build/types/dateInput/DateInput.d.ts.map +1 -1
  398. package/build/types/dateLookup/dateHeader/DateHeader.d.ts.map +1 -1
  399. package/build/types/divider/Divider.d.ts +29 -0
  400. package/build/types/divider/Divider.d.ts.map +1 -0
  401. package/build/types/divider/index.d.ts +3 -0
  402. package/build/types/divider/index.d.ts.map +1 -0
  403. package/build/types/index.d.ts +2 -0
  404. package/build/types/index.d.ts.map +1 -1
  405. package/build/types/upload/Upload.d.ts.map +1 -1
  406. package/build/upload/Upload.js +20 -18
  407. package/build/upload/Upload.js.map +1 -1
  408. package/build/upload/Upload.messages.js +3 -1
  409. package/build/upload/Upload.messages.js.map +1 -1
  410. package/build/upload/Upload.mjs +3 -1
  411. package/build/upload/Upload.mjs.map +1 -1
  412. package/build/upload/steps/completeStep/completeStep.js +30 -6
  413. package/build/upload/steps/completeStep/completeStep.js.map +1 -1
  414. package/build/upload/steps/completeStep/completeStep.mjs +24 -2
  415. package/build/upload/steps/completeStep/completeStep.mjs.map +1 -1
  416. package/build/upload/steps/processingStep/processingStep.js +6 -4
  417. package/build/upload/steps/processingStep/processingStep.js.map +1 -1
  418. package/build/upload/steps/uploadImageStep/uploadImageStep.js +5 -3
  419. package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
  420. package/build/uploadInput/UploadInput.js +13 -11
  421. package/build/uploadInput/UploadInput.js.map +1 -1
  422. package/build/uploadInput/UploadInput.messages.js +3 -1
  423. package/build/uploadInput/UploadInput.messages.js.map +1 -1
  424. package/build/uploadInput/uploadButton/UploadButton.js +8 -8
  425. package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
  426. package/build/uploadInput/uploadButton/UploadButton.messages.js +3 -1
  427. package/build/uploadInput/uploadButton/UploadButton.messages.js.map +1 -1
  428. package/build/uploadInput/uploadButton/getAllowedFileTypes.js +3 -1
  429. package/build/uploadInput/uploadButton/getAllowedFileTypes.js.map +1 -1
  430. package/build/uploadInput/uploadItem/UploadItem.js +12 -12
  431. package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
  432. package/build/uploadInput/uploadItem/UploadItem.messages.js +3 -1
  433. package/build/uploadInput/uploadItem/UploadItem.messages.js.map +1 -1
  434. package/build/withDisplayFormat/WithDisplayFormat.js +19 -17
  435. package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
  436. package/build/withId/withId.js +3 -1
  437. package/build/withId/withId.js.map +1 -1
  438. package/build/withNextPortal/withNextPortal.js +3 -1
  439. package/build/withNextPortal/withNextPortal.js.map +1 -1
  440. package/package.json +10 -11
  441. package/src/badge/Badge.tsx +1 -1
  442. package/src/badge/BadgeAssets.tsx +2 -2
  443. package/src/button/Button.css +2 -2
  444. package/src/button/Button.less +2 -2
  445. package/src/common/Option/Option.css +1 -1
  446. package/src/common/Option/Option.less +2 -2
  447. package/src/common/Option/Option.tsx +1 -1
  448. package/src/common/locale/index.ts +1 -1
  449. package/src/dateInput/DateInput.tsx +7 -1
  450. package/src/dateLookup/DateLookup.css +0 -5
  451. package/src/dateLookup/DateLookup.less +0 -4
  452. package/src/dateLookup/dateHeader/DateHeader.tsx +24 -26
  453. package/src/divider/Divider.accessibility.docs.mdx +61 -0
  454. package/src/divider/Divider.css +24 -0
  455. package/src/divider/Divider.less +31 -0
  456. package/src/divider/Divider.spec.tsx +60 -0
  457. package/src/divider/Divider.story.tsx +130 -0
  458. package/src/divider/Divider.tsx +54 -0
  459. package/src/divider/index.ts +2 -0
  460. package/src/i18n/cs.json +22 -5
  461. package/src/i18n/nl.json +73 -0
  462. package/src/index.ts +2 -0
  463. package/src/main.css +27 -8
  464. package/src/main.less +1 -0
  465. package/src/upload/Upload.spec.tsx +293 -0
  466. package/src/upload/Upload.tsx +5 -1
  467. package/src/upload/steps/completeStep/completeStep.spec.tsx +51 -0
  468. package/src/upload/steps/completeStep/completeStep.tsx +1 -1
  469. package/src/upload/steps/processingStep/processingStep.spec.tsx +59 -0
  470. package/src/upload/steps/uploadImageStep/uploadImageStep.spec.tsx +79 -0
  471. package/src/upload/Upload.events.spec.js +0 -49
  472. package/src/upload/Upload.spec.js +0 -305
  473. package/src/upload/steps/completeStep/completeStep.spec.js +0 -51
  474. package/src/upload/steps/processingStep/processingStep.spec.js +0 -55
  475. package/src/upload/steps/uploadImageStep/uploadImageStep.spec.js +0 -91
@@ -1,305 +0,0 @@
1
- import { shallow, mount } from 'enzyme';
2
- import { act } from 'react';
3
- import { mockMatchMedia } from '../test-utils';
4
-
5
- import { ANIMATION_DURATION_IN_MS } from '../processIndicator';
6
-
7
- import { CompleteStep, UploadImageStep, ProcessingStep } from './steps';
8
-
9
- import Upload from '.';
10
- import { Cross } from '@transferwise/icons';
11
-
12
- mockMatchMedia();
13
-
14
- jest.mock('./utils/postData', () => ({
15
- postData: async () => 'ServerResponse',
16
- }));
17
-
18
- jest.mock('./utils/asyncFileRead');
19
- const { asyncFileRead } = require('./utils/asyncFileRead');
20
-
21
- const defaultLocale = 'en-GB';
22
- const formatMessage = (id) => String(id);
23
- jest.mock('react-intl', () => ({
24
- injectIntl: (Component) =>
25
- function (props) {
26
- return (
27
- <Component {...props} intl={{ locale: defaultLocale, formatMessage: (id) => String(id) }} />
28
- );
29
- },
30
- useIntl: () => ({ formatMessage }),
31
- defineMessages: (translations) => translations,
32
- }));
33
-
34
- const TEST_FILE = new File(['(⌐□_□)'], 'chucknorris.png', { type: 'image/png' });
35
- const ANIMATION_DELAY = ANIMATION_DURATION_IN_MS * 2;
36
-
37
- const props = {
38
- animationDelay: 1000,
39
- csButtonText: 'csButtonText',
40
- csFailureText: 'csFailureText',
41
- csSuccessText: 'csSuccessText',
42
- csTooLargeMessage: 'csTooLargeMessage',
43
- maxSize: 5000000,
44
- onCancel: jest.fn(),
45
- onChange: jest.fn(),
46
- onFailure: jest.fn(),
47
- onStart: jest.fn(),
48
- onSuccess: jest.fn(),
49
- psButtonText: 'psButtonText',
50
- psProcessingText: 'psProcessingText',
51
- usAccept: 'image/*',
52
- usButtonText: 'Or Select File',
53
- usButtonRetryText: 'Try again',
54
- usDropMessage: 'Drop file to start upload',
55
- usPlaceholder: 'Drag and drop a file less than 5MB',
56
- };
57
-
58
- const UPLOADIMAGE_STEP_PROPS = {
59
- fileDropped: expect.any(Function),
60
- isComplete: false,
61
- usAccept: props.usAccept,
62
- usButtonText: props.usButtonText,
63
- usDisabled: false,
64
- usHelpImage: undefined,
65
- usLabel: '',
66
- usPlaceholder: props.usPlaceholder,
67
- };
68
-
69
- const PROCESSING_STEP_PROPS = {
70
- isComplete: false,
71
- isError: false,
72
- isSuccess: false,
73
- onAnimationCompleted: expect.any(Function),
74
- onClear: expect.any(Function),
75
- psButtonText: props.psButtonText,
76
- psProcessingText: props.psProcessingText,
77
- psButtonDisabled: false,
78
- };
79
-
80
- const COMPLETED_STEP_PROPS = {
81
- csButtonText: props.csButtonText,
82
- csFailureText: props.csFailureText,
83
- csSuccessText: props.csSuccessText,
84
- fileName: TEST_FILE.name,
85
- isComplete: true,
86
- isError: false,
87
- isImage: true,
88
- onClear: expect.any(Function),
89
- uploadedImage: 'data:image/png;base64,KOKMkOKWoV/ilqEp',
90
- };
91
-
92
- describe('Upload', () => {
93
- let component;
94
- beforeEach(() => {
95
- jest.useFakeTimers();
96
- component = shallow(<Upload {...props} />).dive();
97
- asyncFileRead.mockImplementation(async () => 'a value');
98
- });
99
-
100
- afterEach(async () => {
101
- await jest.runOnlyPendingTimersAsync();
102
- jest.useRealTimers();
103
- jest.clearAllMocks();
104
- jest.clearAllTimers();
105
- });
106
-
107
- it('renders container', () => {
108
- expect(component.find('.droppable-md')).toHaveLength(1);
109
- });
110
-
111
- it('renders the UploadImageStep by default', () => {
112
- expect(component.find(UploadImageStep)).toHaveLength(1);
113
- expect(component.find(ProcessingStep)).toHaveLength(0);
114
- expect(component.find(CompleteStep)).toHaveLength(0);
115
- expect(component.find('.droppable-dropping-card')).toHaveLength(1);
116
- });
117
-
118
- it('renders the ProcessingStep when state is processing', () => {
119
- component.setState({ isProcessing: true });
120
-
121
- expect(component.find(UploadImageStep)).toHaveLength(0);
122
- expect(component.find(ProcessingStep)).toHaveLength(1);
123
- expect(component.find(CompleteStep)).toHaveLength(0);
124
- expect(component.find('.droppable-dropping-card')).toHaveLength(0);
125
- });
126
-
127
- it('renders the CompleteStep when state is completed', () => {
128
- component.setState({ isComplete: true });
129
-
130
- expect(component.find(UploadImageStep)).toHaveLength(0);
131
- expect(component.find(ProcessingStep)).toHaveLength(0);
132
- expect(component.find(CompleteStep)).toHaveLength(1);
133
- expect(component.find('.droppable-dropping-card')).toHaveLength(1);
134
- });
135
-
136
- describe('before file is dropped', () => {
137
- it('renders the UploadImageStep with right props', () => {
138
- expect(component.find(UploadImageStep).props()).toStrictEqual(UPLOADIMAGE_STEP_PROPS);
139
- });
140
- });
141
-
142
- describe('when file is dropped', () => {
143
- it('onStart is called with file', async () => {
144
- await component.instance().fileDropped(TEST_FILE);
145
-
146
- expect(props.onStart).toHaveBeenCalledWith(TEST_FILE);
147
- });
148
-
149
- it('step changes from UploadImageStep to ProcessingStep', async () => {
150
- expect(component.find(UploadImageStep)).toHaveLength(1);
151
- expect(component.find(ProcessingStep)).toHaveLength(0);
152
- expect(component.find(CompleteStep)).toHaveLength(0);
153
-
154
- await component.instance().fileDropped(TEST_FILE);
155
- component.update();
156
-
157
- expect(component.find(UploadImageStep)).toHaveLength(0);
158
- expect(component.find(ProcessingStep)).toHaveLength(1);
159
- expect(component.find(CompleteStep)).toHaveLength(0);
160
- });
161
-
162
- it('step changes from UploadImageStep to ProcessingStep with right props', async () => {
163
- await component.instance().fileDropped(TEST_FILE);
164
- component.update();
165
-
166
- expect(component.find(ProcessingStep).props()).toStrictEqual(PROCESSING_STEP_PROPS);
167
- });
168
- });
169
-
170
- describe('when file is being processed', () => {
171
- it('step ProcessingStep is called with success props', async () => {
172
- await component.instance().fileDropped(TEST_FILE);
173
- jest.advanceTimersByTime(props.animationDelay);
174
- component.update();
175
-
176
- expect(component.find(ProcessingStep).props()).toStrictEqual({
177
- ...PROCESSING_STEP_PROPS,
178
- isSuccess: true,
179
- });
180
- });
181
-
182
- it('step ProcessingStep is called with error props', async () => {
183
- asyncFileRead.mockImplementation(async () => {
184
- throw 'An error';
185
- });
186
-
187
- await component.instance().fileDropped(TEST_FILE);
188
- jest.advanceTimersByTime(props.animationDelay);
189
- component.update();
190
-
191
- expect(component.find(ProcessingStep).props()).toStrictEqual({
192
- ...PROCESSING_STEP_PROPS,
193
- isError: true,
194
- });
195
- });
196
-
197
- it('should disable processing button when psButtonDisabled is true', async () => {
198
- component.setProps({ psButtonDisabled: true });
199
- await component.instance().fileDropped(TEST_FILE);
200
- jest.advanceTimersByTime(props.animationDelay);
201
- component.update();
202
-
203
- expect(component.find(ProcessingStep).props()).toStrictEqual({
204
- ...PROCESSING_STEP_PROPS,
205
- psButtonDisabled: true,
206
- isError: false,
207
- isSuccess: true,
208
- });
209
- });
210
- });
211
-
212
- describe('when file is processed', () => {
213
- const waitForUpload = async () => {
214
- for (let i = 0; i < 4; i += 1) {
215
- await act(async () => {
216
- await jest.runOnlyPendingTimersAsync();
217
- });
218
- }
219
- };
220
-
221
- it('step changes from UploadImageStep to CompleteStep', async () => {
222
- component = mount(<Upload {...props} />);
223
- const upload = component.children();
224
- expect(upload.find(UploadImageStep)).toHaveLength(1);
225
- expect(upload.find(ProcessingStep)).toHaveLength(0);
226
- expect(upload.find(CompleteStep)).toHaveLength(0);
227
-
228
- await act(async () => {
229
- await upload.instance().fileDropped(TEST_FILE);
230
- });
231
- await waitForUpload();
232
- component.update();
233
-
234
- expect(component.find(UploadImageStep)).toHaveLength(0);
235
- expect(component.find(ProcessingStep)).toHaveLength(0);
236
- expect(component.find(CompleteStep)).toHaveLength(1);
237
- });
238
-
239
- it('step UploadImageStep is called with error props', async () => {
240
- component = mount(<Upload {...props} />);
241
- const upload = component.children();
242
- asyncFileRead.mockImplementation(async () => {
243
- throw 'An error';
244
- });
245
-
246
- await act(async () => {
247
- await upload.instance().fileDropped(TEST_FILE);
248
- });
249
- await waitForUpload();
250
- component.update();
251
-
252
- expect(component.find(UploadImageStep).props()).toStrictEqual({
253
- ...UPLOADIMAGE_STEP_PROPS,
254
- isComplete: false,
255
- errorMessage: 'csFailureText',
256
- errorIconLabel: undefined,
257
- usButtonText: 'Try again',
258
- usHelpImage: null,
259
- });
260
- });
261
-
262
- it('onSuccess is called with response when httpOptions are provided', async () => {
263
- component = mount(<Upload {...props} httpOptions={{ url: 'a-url' }} />).children();
264
-
265
- await act(async () => {
266
- await component.instance().fileDropped(TEST_FILE);
267
- });
268
- await waitForUpload();
269
-
270
- expect(props.onSuccess).toHaveBeenCalledWith('ServerResponse', TEST_FILE.name);
271
- });
272
-
273
- it('wont process new file while current process is in progress', async () => {
274
- component = mount(<Upload {...props} httpOptions={{ url: 'a-url' }} />).children();
275
-
276
- await act(async () => {
277
- await component.instance().fileDropped(TEST_FILE);
278
- });
279
- const result = await act(async () => component.instance().fileDropped(TEST_FILE));
280
-
281
- expect(result).toBe(false);
282
-
283
- await waitForUpload();
284
-
285
- expect(props.onSuccess).toHaveBeenCalledTimes(1);
286
- });
287
-
288
- it('should respect `errorIconLabel` override', async () => {
289
- const errorIconLabel = 'Custom error icon label';
290
- component = mount(<Upload {...props} errorIconLabel={errorIconLabel} />);
291
- const upload = component.children();
292
- asyncFileRead.mockImplementation(async () => {
293
- throw 'An error';
294
- });
295
-
296
- await act(async () => {
297
- await upload.instance().fileDropped(TEST_FILE);
298
- });
299
- await waitForUpload();
300
- component.update();
301
-
302
- expect(component.find(Cross).at(1).prop('title')).toBe(errorIconLabel);
303
- });
304
- });
305
- });
@@ -1,51 +0,0 @@
1
- import { Document as DocumentIcon } from '@transferwise/icons';
2
- import { shallow } from 'enzyme';
3
-
4
- import Body from '../../../body';
5
- import Button from '../../../button';
6
-
7
- import CompleteStep from '.';
8
-
9
- describe('CompleteStep', () => {
10
- const COMPLETED_STEP_PROPS = {
11
- isComplete: true,
12
- uploadedImage: '',
13
- fileName: 'fileName',
14
- isError: false,
15
- isImage: true,
16
- csSuccessText: 'csSuccessText',
17
- csFailureText: 'csFailureText',
18
- csButtonText: 'csButtonText',
19
- onClear: jest.fn(),
20
- usLabel: 'usLabel',
21
- };
22
- let component;
23
- beforeEach(() => {
24
- component = shallow(<CompleteStep {...COMPLETED_STEP_PROPS} />);
25
- });
26
-
27
- it('renders container', () => {
28
- expect(component.find('.droppable-complete-card')).toHaveLength(1);
29
- });
30
-
31
- describe('when error is false', () => {
32
- it('renders isImage or Upload icon', () => {
33
- expect(component.find(DocumentIcon)).toHaveLength(1);
34
- component.setProps({ uploadedImage: 'uploadedImage' });
35
- expect(component.find('img.thumbnail')).toHaveLength(1);
36
- });
37
-
38
- it('renders filename when error is false', () => {
39
- expect(component.find(Body).props().children).toBe(COMPLETED_STEP_PROPS.fileName);
40
- });
41
- });
42
-
43
- it('renders button when csButtonText is set up', () => {
44
- expect(component.find(Button)).toHaveLength(1);
45
- });
46
-
47
- it('calls onClear when button is clicked', () => {
48
- component.find(Button).simulate('click', {});
49
- expect(COMPLETED_STEP_PROPS.onClear).toHaveBeenCalledTimes(1);
50
- });
51
- });
@@ -1,55 +0,0 @@
1
- import { shallow } from 'enzyme';
2
-
3
- import Button from '../../../button';
4
- import ProcessIndicator from '../../../processIndicator';
5
- import Title from '../../../title/Title';
6
-
7
- import ProcessingStep from '.';
8
-
9
- describe('ProcessingStep', () => {
10
- const PROCESSING_STEP_PROPS = {
11
- isComplete: false,
12
- isError: false,
13
- isSuccess: false,
14
- onAnimationCompleted: jest.fn(),
15
- onClear: jest.fn(),
16
- psButtonText: 'psButtonText',
17
- psProcessingText: 'psProcessingText',
18
- };
19
- let component;
20
- beforeEach(() => {
21
- component = shallow(<ProcessingStep {...PROCESSING_STEP_PROPS} />);
22
- });
23
-
24
- it('renders container', () => {
25
- expect(component.find('.droppable-processing-card')).toHaveLength(1);
26
- });
27
-
28
- it('renders ProcessIndicator with default status', () => {
29
- expect(component.find(ProcessIndicator)).toHaveLength(1);
30
- expect(component.find(ProcessIndicator).props().status).toBe('processing');
31
- });
32
-
33
- it('renders ProcessIndicator with success status', () => {
34
- component = shallow(<ProcessingStep {...PROCESSING_STEP_PROPS} isSuccess />);
35
- expect(component.find(ProcessIndicator).props().status).toBe('succeeded');
36
- });
37
-
38
- it('renders ProcessIndicator with error status', () => {
39
- component = shallow(<ProcessingStep {...PROCESSING_STEP_PROPS} isError />);
40
- expect(component.find(ProcessIndicator).props().status).toBe('failed');
41
- });
42
-
43
- it('renders psProcessingText', () => {
44
- expect(component.find(Title).props().children).toBe(PROCESSING_STEP_PROPS.psProcessingText);
45
- });
46
-
47
- it('renders button when psButtonText is set up', () => {
48
- expect(component.find(Button)).toHaveLength(1);
49
- });
50
-
51
- it('calls onClear when button is clicked', () => {
52
- component.find(Button).simulate('click', {});
53
- expect(PROCESSING_STEP_PROPS.onClear).toHaveBeenCalledTimes(1);
54
- });
55
- });
@@ -1,91 +0,0 @@
1
- import { Upload as UploadIcon } from '@transferwise/icons';
2
- import { shallow } from 'enzyme';
3
- import StatusIcon from '../../../statusIcon/StatusIcon';
4
-
5
- import UploadImageStep from '.';
6
- import { InlineAlert } from '../../../index';
7
-
8
- describe('uploadImageStep', () => {
9
- const UPLOADIMAGE_STEP_PROPS = {
10
- fileDropped: jest.fn(),
11
- isComplete: false,
12
- usAccept: 'usAccept',
13
- usButtonText: '',
14
- usDisabled: false,
15
- usLabel: '',
16
- usHelpImage: '',
17
- usPlaceholder: '',
18
- errorMessage: '',
19
- };
20
- let component;
21
- beforeEach(() => {
22
- component = shallow(<UploadImageStep {...UPLOADIMAGE_STEP_PROPS} />);
23
- });
24
-
25
- it('renders container', () => {
26
- expect(component.find('.droppable-default-card')).toHaveLength(1);
27
- });
28
-
29
- it('renders helpImage or Upload icon', () => {
30
- expect(component.find(UploadIcon)).toHaveLength(2);
31
- component.setProps({ usHelpImage: 'usHelpImage' });
32
- expect(component.find('img.thumbnail')).toHaveLength(1);
33
- });
34
-
35
- it('renders label', () => {
36
- expect(component.find('h4')).toHaveLength(0);
37
- component.setProps({ usLabel: 'usLabel' });
38
- expect(component.find('h4').text()).toBe('usLabel');
39
- });
40
-
41
- it('renders placeholder', () => {
42
- expect(component.find('p')).toHaveLength(0);
43
- component.setProps({ usPlaceholder: 'usPlaceholder' });
44
- expect(component.find('p').text()).toBe('usPlaceholder');
45
- });
46
-
47
- it('renders buttonText or Icon', () => {
48
- expect(component.find('.btn-primary')).toHaveLength(1);
49
- expect(component.find(UploadIcon)).toHaveLength(2);
50
- component.setProps({ usButtonText: 'usButtonText' });
51
- expect(component.find('.btn-primary span').text()).toBe('usButtonText');
52
- expect(component.find(UploadIcon)).toHaveLength(1);
53
- });
54
-
55
- it('renders input file', () => {
56
- expect(component.find('input[type="file"]')).toHaveLength(1);
57
- });
58
-
59
- it('renders a custom usHelpImage file', () => {
60
- component = shallow(
61
- <UploadImageStep
62
- {...UPLOADIMAGE_STEP_PROPS}
63
- usHelpImage={<img src="https://test.com" alt="test" className="test-image" />}
64
- />,
65
- );
66
-
67
- expect(component.find('.test-image')).toHaveLength(1);
68
- });
69
-
70
- it('should respect `errorIconLabel` override', () => {
71
- const errorIconLabel = 'Error icon label';
72
- component = shallow(
73
- <UploadImageStep
74
- {...UPLOADIMAGE_STEP_PROPS}
75
- errorMessage="Maximum filesize is 2MB."
76
- errorIconLabel={errorIconLabel}
77
- />,
78
- );
79
- expect(component.find(InlineAlert).prop('iconLabel')).toBe(errorIconLabel);
80
- });
81
-
82
- describe('when errorMessage is not empty', () => {
83
- it('renders errorMessage and icon when error is true', () => {
84
- component = shallow(
85
- <UploadImageStep {...UPLOADIMAGE_STEP_PROPS} errorMessage="error message" />,
86
- );
87
- expect(component.find('.upload-error-message').text()).toBe('<InlineAlert />');
88
- expect(component.find(StatusIcon)).toHaveLength(1);
89
- });
90
- });
91
- });