@transferwise/components 46.78.0 → 46.79.1

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 (409) hide show
  1. package/build/accordion/AccordionItem/AccordionItem.js +22 -3
  2. package/build/accordion/AccordionItem/AccordionItem.js.map +1 -1
  3. package/build/accordion/AccordionItem/AccordionItem.mjs +22 -3
  4. package/build/accordion/AccordionItem/AccordionItem.mjs.map +1 -1
  5. package/build/actionButton/ActionButton.js +22 -1
  6. package/build/actionButton/ActionButton.js.map +1 -1
  7. package/build/actionButton/ActionButton.mjs +22 -1
  8. package/build/actionButton/ActionButton.mjs.map +1 -1
  9. package/build/actionOption/ActionOption.js +24 -2
  10. package/build/actionOption/ActionOption.js.map +1 -1
  11. package/build/actionOption/ActionOption.mjs +24 -2
  12. package/build/actionOption/ActionOption.mjs.map +1 -1
  13. package/build/alert/Alert.js +22 -6
  14. package/build/alert/Alert.js.map +1 -1
  15. package/build/alert/Alert.mjs +22 -6
  16. package/build/alert/Alert.mjs.map +1 -1
  17. package/build/alert/inlineMarkdown/InlineMarkdown.js +25 -2
  18. package/build/alert/inlineMarkdown/InlineMarkdown.js.map +1 -1
  19. package/build/alert/inlineMarkdown/InlineMarkdown.mjs +25 -2
  20. package/build/alert/inlineMarkdown/InlineMarkdown.mjs.map +1 -1
  21. package/build/avatar/Avatar.js +23 -2
  22. package/build/avatar/Avatar.js.map +1 -1
  23. package/build/avatar/Avatar.mjs +23 -2
  24. package/build/avatar/Avatar.mjs.map +1 -1
  25. package/build/avatarWrapper/AvatarWrapper.js +23 -3
  26. package/build/avatarWrapper/AvatarWrapper.js.map +1 -1
  27. package/build/avatarWrapper/AvatarWrapper.mjs +23 -3
  28. package/build/avatarWrapper/AvatarWrapper.mjs.map +1 -1
  29. package/build/badge/Badge.js +23 -2
  30. package/build/badge/Badge.js.map +1 -1
  31. package/build/badge/Badge.mjs +23 -2
  32. package/build/badge/Badge.mjs.map +1 -1
  33. package/build/button/Button.js +22 -6
  34. package/build/button/Button.js.map +1 -1
  35. package/build/button/Button.messages.js.map +1 -1
  36. package/build/button/Button.messages.mjs.map +1 -1
  37. package/build/button/Button.mjs +22 -6
  38. package/build/button/Button.mjs.map +1 -1
  39. package/build/button/classMap.js +24 -0
  40. package/build/button/classMap.js.map +1 -1
  41. package/build/button/classMap.mjs +24 -0
  42. package/build/button/classMap.mjs.map +1 -1
  43. package/build/button/legacyUtils/legacyUtils.js +30 -7
  44. package/build/button/legacyUtils/legacyUtils.js.map +1 -1
  45. package/build/button/legacyUtils/legacyUtils.mjs +30 -7
  46. package/build/button/legacyUtils/legacyUtils.mjs.map +1 -1
  47. package/build/card/Card.js +23 -3
  48. package/build/card/Card.js.map +1 -1
  49. package/build/card/Card.mjs +23 -3
  50. package/build/card/Card.mjs.map +1 -1
  51. package/build/checkbox/Checkbox.js +23 -1
  52. package/build/checkbox/Checkbox.js.map +1 -1
  53. package/build/checkbox/Checkbox.mjs +23 -1
  54. package/build/checkbox/Checkbox.mjs.map +1 -1
  55. package/build/checkboxOption/CheckboxOption.js +1 -1
  56. package/build/checkboxOption/CheckboxOption.mjs +1 -1
  57. package/build/chevron/Chevron.js +21 -1
  58. package/build/chevron/Chevron.js.map +1 -1
  59. package/build/chevron/Chevron.mjs +21 -1
  60. package/build/chevron/Chevron.mjs.map +1 -1
  61. package/build/chips/Chip.js +19 -1
  62. package/build/chips/Chip.js.map +1 -1
  63. package/build/chips/Chip.mjs +19 -1
  64. package/build/chips/Chip.mjs.map +1 -1
  65. package/build/circularButton/CircularButton.js +23 -4
  66. package/build/circularButton/CircularButton.js.map +1 -1
  67. package/build/circularButton/CircularButton.mjs +23 -4
  68. package/build/circularButton/CircularButton.mjs.map +1 -1
  69. package/build/common/bottomSheet/BottomSheet.js +3 -2
  70. package/build/common/bottomSheet/BottomSheet.js.map +1 -1
  71. package/build/common/bottomSheet/BottomSheet.mjs +3 -2
  72. package/build/common/bottomSheet/BottomSheet.mjs.map +1 -1
  73. package/build/common/dateUtils/getDateView/getDateView.js +10 -0
  74. package/build/common/dateUtils/getDateView/getDateView.js.map +1 -0
  75. package/build/common/dateUtils/getDateView/getDateView.mjs +8 -0
  76. package/build/common/dateUtils/getDateView/getDateView.mjs.map +1 -0
  77. package/build/common/hooks/useHasIntersected/useHasIntersected.js +10 -10
  78. package/build/common/hooks/useHasIntersected/useHasIntersected.js.map +1 -1
  79. package/build/common/hooks/useHasIntersected/useHasIntersected.mjs +10 -10
  80. package/build/common/hooks/useHasIntersected/useHasIntersected.mjs.map +1 -1
  81. package/build/common/locale/index.js +24 -0
  82. package/build/common/locale/index.js.map +1 -1
  83. package/build/common/locale/index.mjs +24 -0
  84. package/build/common/locale/index.mjs.map +1 -1
  85. package/build/common/panel/Panel.js +23 -2
  86. package/build/common/panel/Panel.js.map +1 -1
  87. package/build/common/panel/Panel.mjs +23 -2
  88. package/build/common/panel/Panel.mjs.map +1 -1
  89. package/build/common/responsivePanel/ResponsivePanel.js +27 -3
  90. package/build/common/responsivePanel/ResponsivePanel.js.map +1 -1
  91. package/build/common/responsivePanel/ResponsivePanel.mjs +27 -3
  92. package/build/common/responsivePanel/ResponsivePanel.mjs.map +1 -1
  93. package/build/criticalBanner/CriticalCommsBanner.js +22 -3
  94. package/build/criticalBanner/CriticalCommsBanner.js.map +1 -1
  95. package/build/criticalBanner/CriticalCommsBanner.mjs +22 -3
  96. package/build/criticalBanner/CriticalCommsBanner.mjs.map +1 -1
  97. package/build/dateInput/DateInput.js +22 -5
  98. package/build/dateInput/DateInput.js.map +1 -1
  99. package/build/dateInput/DateInput.mjs +22 -5
  100. package/build/dateInput/DateInput.mjs.map +1 -1
  101. package/build/dateLookup/DateLookup.js +30 -12
  102. package/build/dateLookup/DateLookup.js.map +1 -1
  103. package/build/dateLookup/DateLookup.mjs +30 -12
  104. package/build/dateLookup/DateLookup.mjs.map +1 -1
  105. package/build/dateLookup/dateHeader/DateHeader.js +26 -5
  106. package/build/dateLookup/dateHeader/DateHeader.js.map +1 -1
  107. package/build/dateLookup/dateHeader/DateHeader.mjs +26 -5
  108. package/build/dateLookup/dateHeader/DateHeader.mjs.map +1 -1
  109. package/build/dateLookup/dateTrigger/DateTrigger.js +19 -3
  110. package/build/dateLookup/dateTrigger/DateTrigger.js.map +1 -1
  111. package/build/dateLookup/dateTrigger/DateTrigger.mjs +19 -3
  112. package/build/dateLookup/dateTrigger/DateTrigger.mjs.map +1 -1
  113. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js +4 -1
  114. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +1 -1
  115. package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs +4 -1
  116. package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +1 -1
  117. package/build/decision/Decision.js +24 -3
  118. package/build/decision/Decision.js.map +1 -1
  119. package/build/decision/Decision.mjs +24 -3
  120. package/build/decision/Decision.mjs.map +1 -1
  121. package/build/definitionList/DefinitionList.js +23 -1
  122. package/build/definitionList/DefinitionList.js.map +1 -1
  123. package/build/definitionList/DefinitionList.mjs +23 -1
  124. package/build/definitionList/DefinitionList.mjs.map +1 -1
  125. package/build/dimmer/Dimmer.js +24 -2
  126. package/build/dimmer/Dimmer.js.map +1 -1
  127. package/build/dimmer/Dimmer.mjs +24 -2
  128. package/build/dimmer/Dimmer.mjs.map +1 -1
  129. package/build/display/Display.js +23 -1
  130. package/build/display/Display.js.map +1 -1
  131. package/build/display/Display.mjs +23 -1
  132. package/build/display/Display.mjs.map +1 -1
  133. package/build/drawer/Drawer.js +23 -4
  134. package/build/drawer/Drawer.js.map +1 -1
  135. package/build/drawer/Drawer.mjs +23 -4
  136. package/build/drawer/Drawer.mjs.map +1 -1
  137. package/build/field/Field.js +23 -2
  138. package/build/field/Field.js.map +1 -1
  139. package/build/field/Field.mjs +23 -2
  140. package/build/field/Field.mjs.map +1 -1
  141. package/build/flowNavigation/FlowNavigation.js +19 -2
  142. package/build/flowNavigation/FlowNavigation.js.map +1 -1
  143. package/build/flowNavigation/FlowNavigation.mjs +19 -2
  144. package/build/flowNavigation/FlowNavigation.mjs.map +1 -1
  145. package/build/header/Header.js +24 -2
  146. package/build/header/Header.js.map +1 -1
  147. package/build/header/Header.mjs +24 -2
  148. package/build/header/Header.mjs.map +1 -1
  149. package/build/image/Image.js +4 -1
  150. package/build/image/Image.js.map +1 -1
  151. package/build/image/Image.mjs +4 -1
  152. package/build/image/Image.mjs.map +1 -1
  153. package/build/index.js +69 -62
  154. package/build/index.js.map +1 -1
  155. package/build/index.mjs +27 -20
  156. package/build/index.mjs.map +1 -1
  157. package/build/info/Info.js +21 -3
  158. package/build/info/Info.js.map +1 -1
  159. package/build/info/Info.mjs +21 -3
  160. package/build/info/Info.mjs.map +1 -1
  161. package/build/inlineAlert/InlineAlert.js +24 -3
  162. package/build/inlineAlert/InlineAlert.js.map +1 -1
  163. package/build/inlineAlert/InlineAlert.mjs +24 -3
  164. package/build/inlineAlert/InlineAlert.mjs.map +1 -1
  165. package/build/inputs/SearchInput.js +23 -2
  166. package/build/inputs/SearchInput.js.map +1 -1
  167. package/build/inputs/SearchInput.mjs +23 -2
  168. package/build/inputs/SearchInput.mjs.map +1 -1
  169. package/build/instructionsList/InstructionsList.js +22 -1
  170. package/build/instructionsList/InstructionsList.js.map +1 -1
  171. package/build/instructionsList/InstructionsList.mjs +22 -1
  172. package/build/instructionsList/InstructionsList.mjs.map +1 -1
  173. package/build/loader/Loader.js +22 -1
  174. package/build/loader/Loader.js.map +1 -1
  175. package/build/loader/Loader.mjs +22 -1
  176. package/build/loader/Loader.mjs.map +1 -1
  177. package/build/markdown/Markdown.js +24 -1
  178. package/build/markdown/Markdown.js.map +1 -1
  179. package/build/markdown/Markdown.mjs +24 -1
  180. package/build/markdown/Markdown.mjs.map +1 -1
  181. package/build/modal/Modal.js +22 -5
  182. package/build/modal/Modal.js.map +1 -1
  183. package/build/modal/Modal.mjs +22 -5
  184. package/build/modal/Modal.mjs.map +1 -1
  185. package/build/moneyInput/MoneyInput.js +22 -3
  186. package/build/moneyInput/MoneyInput.js.map +1 -1
  187. package/build/moneyInput/MoneyInput.mjs +22 -3
  188. package/build/moneyInput/MoneyInput.mjs.map +1 -1
  189. package/build/navigationOption/NavigationOption.js +23 -2
  190. package/build/navigationOption/NavigationOption.js.map +1 -1
  191. package/build/navigationOption/NavigationOption.mjs +23 -2
  192. package/build/navigationOption/NavigationOption.mjs.map +1 -1
  193. package/build/nudge/Nudge.js +19 -1
  194. package/build/nudge/Nudge.js.map +1 -1
  195. package/build/nudge/Nudge.mjs +19 -1
  196. package/build/nudge/Nudge.mjs.map +1 -1
  197. package/build/overlayHeader/OverlayHeader.js +19 -1
  198. package/build/overlayHeader/OverlayHeader.js.map +1 -1
  199. package/build/overlayHeader/OverlayHeader.mjs +19 -1
  200. package/build/overlayHeader/OverlayHeader.mjs.map +1 -1
  201. package/build/phoneNumberInput/PhoneNumberInput.js +23 -2
  202. package/build/phoneNumberInput/PhoneNumberInput.js.map +1 -1
  203. package/build/phoneNumberInput/PhoneNumberInput.mjs +23 -2
  204. package/build/phoneNumberInput/PhoneNumberInput.mjs.map +1 -1
  205. package/build/popover/Popover.js +24 -4
  206. package/build/popover/Popover.js.map +1 -1
  207. package/build/popover/Popover.mjs +24 -4
  208. package/build/popover/Popover.mjs.map +1 -1
  209. package/build/processIndicator/ProcessIndicator.js +22 -1
  210. package/build/processIndicator/ProcessIndicator.js.map +1 -1
  211. package/build/processIndicator/ProcessIndicator.mjs +22 -1
  212. package/build/processIndicator/ProcessIndicator.mjs.map +1 -1
  213. package/build/progressBar/ProgressBar.js +24 -2
  214. package/build/progressBar/ProgressBar.js.map +1 -1
  215. package/build/progressBar/ProgressBar.mjs +24 -2
  216. package/build/progressBar/ProgressBar.mjs.map +1 -1
  217. package/build/promoCard/PromoCard.js +22 -2
  218. package/build/promoCard/PromoCard.js.map +1 -1
  219. package/build/promoCard/PromoCard.mjs +22 -2
  220. package/build/promoCard/PromoCard.mjs.map +1 -1
  221. package/build/promoCard/PromoCardIndicator.js +22 -1
  222. package/build/promoCard/PromoCardIndicator.js.map +1 -1
  223. package/build/promoCard/PromoCardIndicator.mjs +22 -1
  224. package/build/promoCard/PromoCardIndicator.mjs.map +1 -1
  225. package/build/provider/Provider.js +25 -2
  226. package/build/provider/Provider.js.map +1 -1
  227. package/build/provider/Provider.mjs +25 -2
  228. package/build/provider/Provider.mjs.map +1 -1
  229. package/build/radio/Radio.js +24 -2
  230. package/build/radio/Radio.js.map +1 -1
  231. package/build/radio/Radio.mjs +24 -2
  232. package/build/radio/Radio.mjs.map +1 -1
  233. package/build/segmentedControl/SegmentedControl.js +22 -1
  234. package/build/segmentedControl/SegmentedControl.js.map +1 -1
  235. package/build/segmentedControl/SegmentedControl.mjs +22 -1
  236. package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
  237. package/build/select/Select.js +26 -4
  238. package/build/select/Select.js.map +1 -1
  239. package/build/select/Select.mjs +26 -4
  240. package/build/select/Select.mjs.map +1 -1
  241. package/build/select/option/Option.js +22 -1
  242. package/build/select/option/Option.js.map +1 -1
  243. package/build/select/option/Option.mjs +22 -1
  244. package/build/select/option/Option.mjs.map +1 -1
  245. package/build/selectOption/SelectOption.js +24 -6
  246. package/build/selectOption/SelectOption.js.map +1 -1
  247. package/build/selectOption/SelectOption.mjs +24 -6
  248. package/build/selectOption/SelectOption.mjs.map +1 -1
  249. package/build/statusIcon/StatusIcon.js +22 -4
  250. package/build/statusIcon/StatusIcon.js.map +1 -1
  251. package/build/statusIcon/StatusIcon.mjs +22 -4
  252. package/build/statusIcon/StatusIcon.mjs.map +1 -1
  253. package/build/stepper/Stepper.js +25 -3
  254. package/build/stepper/Stepper.js.map +1 -1
  255. package/build/stepper/Stepper.mjs +25 -3
  256. package/build/stepper/Stepper.mjs.map +1 -1
  257. package/build/stepper/deviceDetection.js +2 -3
  258. package/build/stepper/deviceDetection.js.map +1 -1
  259. package/build/stepper/deviceDetection.mjs +2 -3
  260. package/build/stepper/deviceDetection.mjs.map +1 -1
  261. package/build/sticky/Sticky.js +25 -2
  262. package/build/sticky/Sticky.js.map +1 -1
  263. package/build/sticky/Sticky.mjs +25 -2
  264. package/build/sticky/Sticky.mjs.map +1 -1
  265. package/build/summary/Summary.js +21 -5
  266. package/build/summary/Summary.js.map +1 -1
  267. package/build/summary/Summary.mjs +21 -5
  268. package/build/summary/Summary.mjs.map +1 -1
  269. package/build/tabs/Tabs.js +23 -3
  270. package/build/tabs/Tabs.js.map +1 -1
  271. package/build/tabs/Tabs.mjs +23 -3
  272. package/build/tabs/Tabs.mjs.map +1 -1
  273. package/build/tile/Tile.js +24 -2
  274. package/build/tile/Tile.js.map +1 -1
  275. package/build/tile/Tile.mjs +24 -2
  276. package/build/tile/Tile.mjs.map +1 -1
  277. package/build/title/Title.js +23 -1
  278. package/build/title/Title.js.map +1 -1
  279. package/build/title/Title.mjs +23 -1
  280. package/build/title/Title.mjs.map +1 -1
  281. package/build/tooltip/Tooltip.js +22 -1
  282. package/build/tooltip/Tooltip.js.map +1 -1
  283. package/build/tooltip/Tooltip.mjs +22 -1
  284. package/build/tooltip/Tooltip.mjs.map +1 -1
  285. package/build/typeahead/Typeahead.js +22 -4
  286. package/build/typeahead/Typeahead.js.map +1 -1
  287. package/build/typeahead/Typeahead.mjs +22 -4
  288. package/build/typeahead/Typeahead.mjs.map +1 -1
  289. package/build/types/button/Button.d.ts.map +1 -1
  290. package/build/types/button/Button.messages.d.ts +7 -7
  291. package/build/types/button/Button.messages.d.ts.map +1 -1
  292. package/build/types/button/classMap.d.ts +10 -10
  293. package/build/types/button/classMap.d.ts.map +1 -1
  294. package/build/types/button/legacyUtils/index.d.ts +1 -1
  295. package/build/types/button/legacyUtils/index.d.ts.map +1 -1
  296. package/build/types/button/legacyUtils/legacyUtils.d.ts +20 -6
  297. package/build/types/button/legacyUtils/legacyUtils.d.ts.map +1 -1
  298. package/build/types/checkboxButton/index.d.ts +1 -1
  299. package/build/types/checkboxButton/index.d.ts.map +1 -1
  300. package/build/types/common/dateUtils/getDateView/getDateView.d.ts +2 -0
  301. package/build/types/common/dateUtils/getDateView/getDateView.d.ts.map +1 -0
  302. package/build/types/common/dateUtils/index.d.ts +1 -0
  303. package/build/types/common/dateUtils/index.d.ts.map +1 -1
  304. package/build/types/common/fakeEvents.d.ts +23 -0
  305. package/build/types/common/fakeEvents.d.ts.map +1 -0
  306. package/build/types/common/hooks/index.d.ts +4 -4
  307. package/build/types/common/hooks/index.d.ts.map +1 -1
  308. package/build/types/common/hooks/useConditionalListener/index.d.ts +1 -1
  309. package/build/types/common/hooks/useConditionalListener/index.d.ts.map +1 -1
  310. package/build/types/common/hooks/useDirection/index.d.ts +1 -1
  311. package/build/types/common/hooks/useDirection/index.d.ts.map +1 -1
  312. package/build/types/common/hooks/useHasIntersected/index.d.ts +1 -1
  313. package/build/types/common/hooks/useHasIntersected/index.d.ts.map +1 -1
  314. package/build/types/common/hooks/useHasIntersected/useHasIntersected.d.ts +15 -4
  315. package/build/types/common/hooks/useHasIntersected/useHasIntersected.d.ts.map +1 -1
  316. package/build/types/common/index.d.ts +28 -28
  317. package/build/types/common/index.d.ts.map +1 -1
  318. package/build/types/common/responsivePanel/index.d.ts +1 -1
  319. package/build/types/common/responsivePanel/index.d.ts.map +1 -1
  320. package/build/types/dateLookup/DateLookup.d.ts +1 -1
  321. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  322. package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts +1 -1
  323. package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts.map +1 -1
  324. package/build/types/index.d.ts +1 -0
  325. package/build/types/index.d.ts.map +1 -1
  326. package/build/types/navigationOption/NavigationOption.d.ts +1 -0
  327. package/build/types/navigationOption/NavigationOption.d.ts.map +1 -1
  328. package/build/types/stepper/deviceDetection.d.ts +1 -1
  329. package/build/types/stepper/deviceDetection.d.ts.map +1 -1
  330. package/build/types/test-utils/style-mock.d.ts +1 -0
  331. package/build/types/test-utils/style-mock.d.ts.map +1 -0
  332. package/build/types/utilities/deprecatedProperty/deprecatedProperty.d.ts +8 -6
  333. package/build/types/utilities/deprecatedProperty/deprecatedProperty.d.ts.map +1 -1
  334. package/build/types/utilities/deprecatedProperty/index.d.ts +1 -1
  335. package/build/types/utilities/deprecatedProperty/index.d.ts.map +1 -1
  336. package/build/types/utilities/index.d.ts +2 -2
  337. package/build/types/utilities/index.d.ts.map +1 -1
  338. package/build/types/utilities/logActionRequired.d.ts +2 -2
  339. package/build/types/utilities/logActionRequired.d.ts.map +1 -1
  340. package/build/upload/Upload.js +21 -2
  341. package/build/upload/Upload.js.map +1 -1
  342. package/build/upload/Upload.mjs +21 -2
  343. package/build/upload/Upload.mjs.map +1 -1
  344. package/build/upload/steps/processingStep/processingStep.js +25 -3
  345. package/build/upload/steps/processingStep/processingStep.js.map +1 -1
  346. package/build/upload/steps/processingStep/processingStep.mjs +25 -3
  347. package/build/upload/steps/processingStep/processingStep.mjs.map +1 -1
  348. package/build/upload/steps/uploadImageStep/uploadImageStep.js +23 -3
  349. package/build/upload/steps/uploadImageStep/uploadImageStep.js.map +1 -1
  350. package/build/upload/steps/uploadImageStep/uploadImageStep.mjs +23 -3
  351. package/build/upload/steps/uploadImageStep/uploadImageStep.mjs.map +1 -1
  352. package/build/uploadInput/UploadInput.js +22 -3
  353. package/build/uploadInput/UploadInput.js.map +1 -1
  354. package/build/uploadInput/UploadInput.mjs +22 -3
  355. package/build/uploadInput/UploadInput.mjs.map +1 -1
  356. package/build/uploadInput/uploadButton/UploadButton.js +21 -2
  357. package/build/uploadInput/uploadButton/UploadButton.js.map +1 -1
  358. package/build/uploadInput/uploadButton/UploadButton.mjs +21 -2
  359. package/build/uploadInput/uploadButton/UploadButton.mjs.map +1 -1
  360. package/build/uploadInput/uploadButton/defaults.js +24 -0
  361. package/build/uploadInput/uploadButton/defaults.js.map +1 -1
  362. package/build/uploadInput/uploadButton/defaults.mjs +24 -0
  363. package/build/uploadInput/uploadButton/defaults.mjs.map +1 -1
  364. package/build/uploadInput/uploadItem/UploadItem.js +21 -4
  365. package/build/uploadInput/uploadItem/UploadItem.js.map +1 -1
  366. package/build/uploadInput/uploadItem/UploadItem.mjs +21 -4
  367. package/build/uploadInput/uploadItem/UploadItem.mjs.map +1 -1
  368. package/build/utilities/logActionRequired.js.map +1 -1
  369. package/build/utilities/logActionRequired.mjs.map +1 -1
  370. package/build/withDisplayFormat/WithDisplayFormat.js +25 -1
  371. package/build/withDisplayFormat/WithDisplayFormat.js.map +1 -1
  372. package/build/withDisplayFormat/WithDisplayFormat.mjs +25 -1
  373. package/build/withDisplayFormat/WithDisplayFormat.mjs.map +1 -1
  374. package/package.json +2 -2
  375. package/src/button/Button.tsx +0 -3
  376. package/src/button/legacyUtils/legacyUtils.ts +74 -0
  377. package/src/common/dateUtils/getDateView/getDateView.ts +5 -0
  378. package/src/common/dateUtils/index.ts +1 -0
  379. package/src/common/{fakeEvents.js → fakeEvents.ts} +1 -1
  380. package/src/common/hooks/useHasIntersected/{useHasIntersected.js → useHasIntersected.ts} +20 -11
  381. package/src/dateLookup/DateLookup.tests.story.tsx +40 -5
  382. package/src/dateLookup/DateLookup.tsx +9 -11
  383. package/src/dateLookup/dayCalendar/table/DayCalendarTable.tsx +5 -2
  384. package/src/flowNavigation/{FlowNavigation.story.js → FlowNavigation.story.tsx} +34 -16
  385. package/src/index.ts +1 -0
  386. package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.tsx +78 -0
  387. package/src/navigationOption/{NavigationOption.story.js → NavigationOption.story.tsx} +23 -5
  388. package/src/navigationOption/NavigationOption.tsx +1 -1
  389. package/src/select/{Select.story.js → Select.story.tsx} +97 -47
  390. package/src/stepper/{deviceDetection.js → deviceDetection.ts} +2 -6
  391. package/src/utilities/deprecatedProperty/{deprecatedProperty.spec.js → deprecatedProperty.spec.ts} +7 -13
  392. package/src/utilities/deprecatedProperty/{deprecatedProperty.js → deprecatedProperty.ts} +23 -4
  393. package/src/utilities/{logActionRequired.js → logActionRequired.ts} +2 -2
  394. package/src/button/legacyUtils/legacyUtils.js +0 -54
  395. package/src/common/requirements.js +0 -440
  396. package/src/inputWithDisplayFormat/InputWithDisplayFormat.story.js +0 -85
  397. /package/src/button/{Button.messages.js → Button.messages.ts} +0 -0
  398. /package/src/button/{classMap.js → classMap.ts} +0 -0
  399. /package/src/button/legacyUtils/{index.js → index.ts} +0 -0
  400. /package/src/checkboxButton/{index.js → index.ts} +0 -0
  401. /package/src/common/hooks/{index.js → index.ts} +0 -0
  402. /package/src/common/hooks/useConditionalListener/{index.js → index.ts} +0 -0
  403. /package/src/common/hooks/useDirection/{index.js → index.ts} +0 -0
  404. /package/src/common/hooks/useHasIntersected/{index.js → index.ts} +0 -0
  405. /package/src/common/{index.js → index.ts} +0 -0
  406. /package/src/common/responsivePanel/{index.js → index.ts} +0 -0
  407. /package/src/test-utils/{style-mock.js → style-mock.ts} +0 -0
  408. /package/src/utilities/deprecatedProperty/{index.js → index.ts} +0 -0
  409. /package/src/utilities/{index.js → index.ts} +0 -0
@@ -1,21 +1,30 @@
1
1
  import { StoryFn } from '@storybook/react';
2
2
  import { expect, userEvent, within } from '@storybook/test';
3
+ import { action } from '@storybook/addon-actions';
3
4
  import { useState } from 'react';
4
5
 
5
- import DateLookup from './DateLookup';
6
+ import DateLookup, { type DateLookupProps } from './DateLookup';
6
7
 
7
8
  export default {
8
9
  component: DateLookup,
9
10
  title: 'Forms/DateLookup/Tests',
10
11
  };
11
12
 
13
+ const props: DateLookupProps = {
14
+ value: new Date(1987, 0, 10, 12, 0, 0),
15
+ onChange: (value: Date | null) => {
16
+ action(value?.toString() || 'null');
17
+ },
18
+ };
12
19
  type Story = StoryFn<typeof DateLookup>;
13
20
 
14
- const Template: Story = () => {
15
- const [value, setValue] = useState<Date | null>(new Date(1987, 0, 10, 12, 0, 0));
21
+ const Template: Story = (args: DateLookupProps) => {
22
+ const { value: initialValue } = args;
23
+ const [value, setValue] = useState<Date | null>(initialValue);
16
24
 
17
25
  return (
18
26
  <DateLookup
27
+ {...args}
19
28
  value={value}
20
29
  clearable
21
30
  placeholder="placeholder"
@@ -27,7 +36,7 @@ const Template: Story = () => {
27
36
  };
28
37
 
29
38
  export const ClearSpace = Template.bind({});
30
-
39
+ ClearSpace.args = { ...props };
31
40
  ClearSpace.play = async ({ canvasElement, step }) => {
32
41
  const canvas = within(canvasElement);
33
42
 
@@ -46,7 +55,7 @@ ClearSpace.play = async ({ canvasElement, step }) => {
46
55
  };
47
56
 
48
57
  export const ClearEnter = Template.bind({});
49
-
58
+ ClearEnter.args = { ...props };
50
59
  ClearEnter.play = async ({ canvasElement, step }) => {
51
60
  const canvas = within(canvasElement);
52
61
 
@@ -63,3 +72,29 @@ ClearEnter.play = async ({ canvasElement, step }) => {
63
72
  await expect(placeholder).toBeInTheDocument();
64
73
  });
65
74
  };
75
+
76
+ export const FocusOnSelectedDay = Template.bind({});
77
+ FocusOnSelectedDay.args = { ...props };
78
+ FocusOnSelectedDay.play = async () => {
79
+ await userEvent.tab();
80
+ await userEvent.keyboard(' ');
81
+ };
82
+
83
+ export const FocusOnToday = Template.bind({});
84
+ FocusOnToday.args = { ...props, value: null };
85
+ FocusOnToday.play = async () => {
86
+ await userEvent.tab();
87
+ await userEvent.keyboard(' ');
88
+ };
89
+
90
+ export const FocusOnFirstNonDisabledDate = Template.bind({});
91
+ FocusOnFirstNonDisabledDate.args = {
92
+ ...props,
93
+ value: null,
94
+ min: new Date(1987, 0, 10, 12, 0, 0),
95
+ max: new Date(1987, 0, 12, 12, 0, 0),
96
+ };
97
+ FocusOnFirstNonDisabledDate.play = async () => {
98
+ await userEvent.tab();
99
+ await userEvent.keyboard(' ');
100
+ };
@@ -6,11 +6,11 @@ import {
6
6
  MonthFormat,
7
7
  Position,
8
8
  Breakpoint,
9
- SizeSmall,
10
- SizeMedium,
11
- SizeLarge,
9
+ type SizeSmall,
10
+ type SizeMedium,
11
+ type SizeLarge,
12
12
  } from '../common';
13
- import { isWithinRange, moveToWithinRange } from '../common/dateUtils';
13
+ import { isWithinRange, moveToWithinRange, returnDateView } from '../common/dateUtils';
14
14
  import ResponsivePanel from '../common/responsivePanel';
15
15
  import { WithInputAttributesProps, withInputAttributes } from '../inputs/contexts';
16
16
  import { OverlayIdContext, OverlayIdProvider } from '../provider/overlay/OverlayIdProvider';
@@ -72,13 +72,14 @@ class DateLookup extends PureComponent<DateLookupPropsWithInputAttributes, DateL
72
72
 
73
73
  constructor(props: DateLookup['props']) {
74
74
  super(props);
75
+ const dateView = returnDateView(props.value, props.min, props.max);
75
76
  this.state = {
76
77
  selectedDate: getStartOfDay(props.value),
77
78
  originalDate: null,
78
79
  min: getStartOfDay(props.min),
79
80
  max: getStartOfDay(props.max),
80
- viewMonth: (props.value || new Date()).getMonth(),
81
- viewYear: (props.value || new Date()).getFullYear(),
81
+ viewMonth: dateView.getMonth(),
82
+ viewYear: dateView.getFullYear(),
82
83
  open: false,
83
84
  mode: 'day',
84
85
  isMobile: false,
@@ -100,8 +101,7 @@ class DateLookup extends PureComponent<DateLookupPropsWithInputAttributes, DateL
100
101
  props.onChange(moveToWithinRange(selectedDate, min, max));
101
102
  return null;
102
103
  }
103
- const viewDateThatIsWithinRange: Date =
104
- selectedDate || ((min || max) && moveToWithinRange(new Date(), min, max)) || new Date();
104
+ const viewDateThatIsWithinRange: Date = returnDateView(selectedDate, min, max);
105
105
  const viewMonth = viewDateThatIsWithinRange.getMonth();
106
106
  const viewYear = viewDateThatIsWithinRange.getFullYear();
107
107
  return { selectedDate, min, max, viewMonth, viewYear };
@@ -209,9 +209,7 @@ class DateLookup extends PureComponent<DateLookupPropsWithInputAttributes, DateL
209
209
  } else {
210
210
  date = getStartOfDay(new Date());
211
211
  }
212
- if (date) {
213
- date = moveToWithinRange(date, min, max);
214
- }
212
+ date &&= moveToWithinRange(date, min, max);
215
213
  if (date?.getTime() !== selectedDate?.getTime()) {
216
214
  this.props.onChange(date);
217
215
  }
@@ -1,6 +1,6 @@
1
1
  import { formatDate } from '@transferwise/formatting';
2
2
  import { PureComponent } from 'react';
3
- import { injectIntl, WrappedComponentProps } from 'react-intl';
3
+ import { injectIntl, type WrappedComponentProps } from 'react-intl';
4
4
 
5
5
  import { getDayNames, isWithinRange } from '../../../common/dateUtils';
6
6
  import { getFocusableTime } from '../../getFocusableTime/getFocusableTime';
@@ -64,6 +64,9 @@ class DayCalendarTable extends PureComponent<DayCalendarTableProps> {
64
64
  };
65
65
 
66
66
  isDisabled = (day: number) => {
67
+ if (day < 0) {
68
+ return true;
69
+ }
67
70
  const { min, max, viewMonth, viewYear } = this.props;
68
71
  const date = new Date(viewYear, viewMonth, day);
69
72
 
@@ -72,7 +75,7 @@ class DayCalendarTable extends PureComponent<DayCalendarTableProps> {
72
75
 
73
76
  isActive = (day: number) => {
74
77
  const { selectedDate, viewMonth, viewYear } = this.props;
75
- return !!(selectedDate && +new Date(viewYear, viewMonth, day) === +selectedDate);
78
+ return !!(selectedDate && Number(new Date(viewYear, viewMonth, day)) === Number(selectedDate));
76
79
  };
77
80
 
78
81
  isToday = (day: number) => {
@@ -24,6 +24,10 @@ const avatarProfiles = {
24
24
  Business: <BriefcaseIcon />,
25
25
  Profile: <ProfileIcon />,
26
26
  };
27
+ type ProfileTypeKeys = keyof typeof ProfileType;
28
+
29
+ const getAvatarProfile = (showAvatar: string) =>
30
+ showAvatar in avatarProfiles ? avatarProfiles[showAvatar as keyof typeof avatarProfiles] : null;
27
31
 
28
32
  export const Variants = () => {
29
33
  const [activeStep, setActiveStep] = useState(2);
@@ -32,7 +36,11 @@ export const Variants = () => {
32
36
  const showCloseButton = boolean('show closeButton', true);
33
37
  const showMobileBackButton = boolean('show mobile backButton', true);
34
38
  const done = boolean('done', false);
35
- const profileType = select('profileType', Object.keys(ProfileType));
39
+ const profileType: ProfileTypeKeys | undefined = select(
40
+ 'profileType',
41
+ Object.keys(ProfileType) as ProfileTypeKeys[],
42
+ undefined,
43
+ );
36
44
  const avatarURL = text(
37
45
  'avatarURL',
38
46
  'https://wise.com/web-art/assets/illustrations/heart-small@2x.webp',
@@ -44,7 +52,7 @@ export const Variants = () => {
44
52
  avatar={
45
53
  !showAvatar ? null : (
46
54
  <Avatar type={AvatarType.ICON} size={Size.MEDIUM}>
47
- {avatarProfiles[showAvatar]}
55
+ {getAvatarProfile(showAvatar)}
48
56
  </Avatar>
49
57
  )
50
58
  }
@@ -70,9 +78,11 @@ export const Variants = () => {
70
78
  onClick: () => setActiveStep(4),
71
79
  },
72
80
  ]}
73
- onClose={showCloseButton && (() => setClosed(true))}
81
+ onClose={showCloseButton ? () => setClosed(true) : undefined}
74
82
  onGoBack={
75
- showMobileBackButton && (() => setActiveStep(activeStep > 0 ? activeStep - 1 : 0))
83
+ showMobileBackButton
84
+ ? () => setActiveStep(activeStep > 0 ? activeStep - 1 : 0)
85
+ : undefined
76
86
  }
77
87
  />
78
88
 
@@ -112,9 +122,11 @@ export const Variants = () => {
112
122
  onClick: () => setActiveStep(4),
113
123
  },
114
124
  ]}
115
- onClose={showCloseButton && (() => setClosed(true))}
125
+ onClose={showCloseButton ? () => setClosed(true) : undefined}
116
126
  onGoBack={
117
- showMobileBackButton && (() => setActiveStep(activeStep - 1 > 0 ? activeStep - 1 : 0))
127
+ showMobileBackButton
128
+ ? () => setActiveStep(activeStep - 1 > 0 ? activeStep - 1 : 0)
129
+ : undefined
118
130
  }
119
131
  />
120
132
 
@@ -155,9 +167,11 @@ export const Variants = () => {
155
167
  onClick: () => setActiveStep(4),
156
168
  },
157
169
  ]}
158
- onClose={showCloseButton && (() => setClosed(true))}
170
+ onClose={showCloseButton ? () => setClosed(true) : undefined}
159
171
  onGoBack={
160
- showMobileBackButton && (() => setActiveStep(activeStep - 1 > 0 ? activeStep - 1 : 0))
172
+ showMobileBackButton
173
+ ? () => setActiveStep(activeStep - 1 > 0 ? activeStep - 1 : 0)
174
+ : undefined
161
175
  }
162
176
  />
163
177
 
@@ -171,9 +185,11 @@ export const Variants = () => {
171
185
  { label: 'Review', hoverLabel: 'Antonio Dozortevo', onClick: () => setActiveStep(1) },
172
186
  { label: 'Pay', hoverLabel: 'Enrico Gusso', onClick: () => setActiveStep(2) },
173
187
  ]}
174
- onClose={showCloseButton && (() => setClosed(true))}
188
+ onClose={showCloseButton ? () => setClosed(true) : undefined}
175
189
  onGoBack={
176
- showMobileBackButton && (() => setActiveStep(activeStep - 1 > 0 ? activeStep - 1 : 0))
190
+ showMobileBackButton
191
+ ? () => setActiveStep(activeStep - 1 > 0 ? activeStep - 1 : 0)
192
+ : undefined
177
193
  }
178
194
  />
179
195
 
@@ -216,7 +232,7 @@ export const SendFlow = () => {
216
232
  ...(activeStep > 3 && { onClick: handleStepClick(3) }),
217
233
  },
218
234
  ];
219
- function handleStepClick(step) {
235
+ function handleStepClick(step: number) {
220
236
  return () => {
221
237
  setActiveStep(step);
222
238
  };
@@ -268,16 +284,18 @@ export const WithOverlayHeaderComparison = () => {
268
284
  avatar={
269
285
  showAvatar ? (
270
286
  <Avatar type={AvatarType.ICON} size={Size.MEDIUM}>
271
- {avatarProfiles[showAvatar]}
287
+ {getAvatarProfile(showAvatar)}
272
288
  </Avatar>
273
289
  ) : null
274
290
  }
275
291
  activeStep={activeStep}
276
292
  done={done}
277
293
  steps={[]}
278
- onClose={showCloseButton && (() => setClosed(true))}
294
+ onClose={showCloseButton ? () => setClosed(true) : undefined}
279
295
  onGoBack={
280
- showMobileBackButton && (() => setActiveStep(activeStep > 0 ? activeStep - 1 : 0))
296
+ showMobileBackButton
297
+ ? () => setActiveStep(activeStep > 0 ? activeStep - 1 : 0)
298
+ : undefined
281
299
  }
282
300
  />
283
301
  </div>
@@ -286,11 +304,11 @@ export const WithOverlayHeaderComparison = () => {
286
304
  avatar={
287
305
  showAvatar ? (
288
306
  <Avatar type={AvatarType.ICON} size={Size.MEDIUM}>
289
- {avatarProfiles[showAvatar]}
307
+ {getAvatarProfile(showAvatar)}
290
308
  </Avatar>
291
309
  ) : null
292
310
  }
293
- onClose={showCloseButton && (() => setClosed(true))}
311
+ onClose={showCloseButton ? () => setClosed(true) : undefined}
294
312
  />
295
313
  </div>
296
314
  </>
package/src/index.ts CHANGED
@@ -59,6 +59,7 @@ export type {
59
59
  MoneyInputProps,
60
60
  } from './moneyInput';
61
61
  export type { NavigationOptionListProps } from './navigationOptionsList';
62
+ export type { NavigationOptionProps } from './navigationOption/NavigationOption';
62
63
  export type { OverlayHeaderProps } from './overlayHeader';
63
64
  export type { PanelProps } from './common/panel';
64
65
  export type { PhoneNumberInputProps } from './phoneNumberInput/PhoneNumberInput';
@@ -0,0 +1,78 @@
1
+ import { userEvent, within, fn } from '@storybook/test';
2
+
3
+ import InputWithDisplayFormat, { InputWithDisplayFormatProps } from '.';
4
+ import { Field, FieldProps } from '../field/Field';
5
+ import { Meta, type StoryObj } from '@storybook/react';
6
+
7
+ type Story = StoryObj<InputWithDisplayFormatProps & { label: string }>;
8
+
9
+ const meta = {
10
+ title: 'Forms/InputWithDisplayFormat',
11
+ component: InputWithDisplayFormat,
12
+ render: function Render({ label, ...args }: InputWithDisplayFormatProps & FieldProps) {
13
+ return (
14
+ <Field label={label} id={args.id}>
15
+ <InputWithDisplayFormat id={args.id} {...args} />
16
+ </Field>
17
+ );
18
+ },
19
+ args: {
20
+ onFocus: fn(),
21
+ onBlur: fn(),
22
+ onChange: fn(),
23
+ },
24
+ } satisfies Meta<typeof InputWithDisplayFormat>;
25
+ export default meta;
26
+
27
+ export const Basic: Story = {
28
+ args: {
29
+ label: 'Sort Code',
30
+ placeholder: '**-**-**',
31
+ displayPattern: '**-**-**',
32
+ },
33
+ };
34
+
35
+ export const CardNumber: Story = {
36
+ args: {
37
+ label: 'Card Number',
38
+ placeholder: '**** **** **** **** ***',
39
+ displayPattern: '**** **** **** **** ***',
40
+ },
41
+ };
42
+
43
+ export const CVC: Story = {
44
+ args: {
45
+ label: 'CVC',
46
+ placeholder: '***',
47
+ displayPattern: '***',
48
+ value: '',
49
+ },
50
+ };
51
+
52
+ export const ExpiryDate: Story = {
53
+ args: {
54
+ label: 'Expiry Date',
55
+ placeholder: '** / **',
56
+ displayPattern: '** / **',
57
+ },
58
+ };
59
+
60
+ export const SecurityPin: Story = {
61
+ args: {
62
+ label: 'Security Pin',
63
+ placeholder: '*-*-*-*-*-*',
64
+ displayPattern: '*-*-*-*-*-*',
65
+ },
66
+ };
67
+
68
+ export const SecurityPinPlay: Story = {
69
+ args: {
70
+ label: 'Security Pin Play',
71
+ placeholder: '*-*-*-*-*-*',
72
+ displayPattern: '*-*-*-*-*-*',
73
+ },
74
+ play: async ({ canvasElement }) => {
75
+ const canvas = within(canvasElement);
76
+ await userEvent.type(canvas.getByPlaceholderText('*-*-*-*-*-*'), '123456');
77
+ },
78
+ };
@@ -1,3 +1,4 @@
1
+ import { ReactNode } from 'react';
1
2
  import { action } from '@storybook/addon-actions';
2
3
  import { text, boolean } from '@storybook/addon-knobs';
3
4
  import {
@@ -19,8 +20,22 @@ export default {
19
20
  tags: ['autodocs'],
20
21
  };
21
22
 
22
- const Template = (props) => {
23
- const href = text('href', props.href);
23
+ type TemplateTypes = {
24
+ href?: string;
25
+ title?: string;
26
+ content?: string;
27
+ complex?: boolean;
28
+ disabled?: boolean;
29
+ showMediaAtAllSizes?: boolean;
30
+ showMediaCircle?: boolean;
31
+ isContainerAligned?: boolean;
32
+ className?: string;
33
+ hasTitleOnly?: boolean;
34
+ media?: ReactNode;
35
+ };
36
+
37
+ const Template = (props: TemplateTypes) => {
38
+ const href = text('href', props.href ?? '');
24
39
  const title = text('title', props.title ?? 'Navigation option');
25
40
  const content = text('content', props.content ?? 'Button and icon are vertically centered.');
26
41
  const complex = boolean('complex', props.complex ?? false);
@@ -28,7 +43,7 @@ const Template = (props) => {
28
43
  const showMediaAtAllSizes = boolean('showMediaAtAllSizes', props.showMediaAtAllSizes ?? false);
29
44
  const showMediaCircle = props.showMediaCircle ?? boolean('showMediaCircle', true);
30
45
  const isContainerAligned = boolean('isContainerAligned', false);
31
- const className = text('className', props.className);
46
+ const className = text('className', props.className ?? '');
32
47
 
33
48
  return (
34
49
  <NavigationOption
@@ -140,7 +155,10 @@ export const Multiple = () => (
140
155
 
141
156
  export const WithIllustration = () => {
142
157
  return (
143
- <Template media={<Illustration name={Assets.GLOBE} disablePadding />} showMediaCircle={false} />
158
+ <Template
159
+ media={<Illustration name={Assets.GLOBE} disablePadding alt="" />}
160
+ showMediaCircle={false}
161
+ />
144
162
  );
145
163
  };
146
164
 
@@ -166,7 +184,7 @@ export const WithContainerContent = () => (
166
184
  </>
167
185
  );
168
186
 
169
- const NavigationOptionTemplate = (props) => {
187
+ const NavigationOptionTemplate = (props: TemplateTypes) => {
170
188
  const {
171
189
  href,
172
190
  title,
@@ -6,7 +6,7 @@ import { Position } from '../common';
6
6
  import Option from '../common/Option';
7
7
  import { OptionProps, ReferenceType } from '../common/Option/Option';
8
8
 
9
- type NavigationOptionProps = OptionProps;
9
+ export type NavigationOptionProps = OptionProps;
10
10
 
11
11
  const NavigationOption = forwardRef<ReferenceType, NavigationOptionProps>(
12
12
  ({ as: component = 'button', disabled = false, onClick, className, ...rest }, reference) => {