@transferwise/components 46.144.0 → 46.145.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 (329) hide show
  1. package/README.md +2 -2
  2. package/build/actionOption/ActionOption.js.map +1 -1
  3. package/build/actionOption/ActionOption.mjs.map +1 -1
  4. package/build/calendar/Calendar.js +159 -0
  5. package/build/calendar/Calendar.js.map +1 -0
  6. package/build/{dateLookup/DateLookup.messages.js → calendar/Calendar.messages.js} +1 -1
  7. package/build/calendar/Calendar.messages.js.map +1 -0
  8. package/build/{dateLookup/DateLookup.messages.mjs → calendar/Calendar.messages.mjs} +1 -1
  9. package/build/calendar/Calendar.messages.mjs.map +1 -0
  10. package/build/calendar/Calendar.mjs +155 -0
  11. package/build/calendar/Calendar.mjs.map +1 -0
  12. package/build/{dateLookup → calendar}/dateHeader/DateHeader.js +4 -4
  13. package/build/calendar/dateHeader/DateHeader.js.map +1 -0
  14. package/build/{dateLookup → calendar}/dateHeader/DateHeader.mjs +1 -1
  15. package/build/calendar/dateHeader/DateHeader.mjs.map +1 -0
  16. package/build/{dateLookup → calendar}/dayCalendar/DayCalendar.js +2 -2
  17. package/build/calendar/dayCalendar/DayCalendar.js.map +1 -0
  18. package/build/{dateLookup → calendar}/dayCalendar/DayCalendar.mjs +1 -1
  19. package/build/calendar/dayCalendar/DayCalendar.mjs.map +1 -0
  20. package/build/calendar/dayCalendar/table/DayCalendarTable.js.map +1 -0
  21. package/build/calendar/dayCalendar/table/DayCalendarTable.mjs.map +1 -0
  22. package/build/calendar/getFocusableTime/getFocusableTime.js.map +1 -0
  23. package/build/calendar/getFocusableTime/getFocusableTime.mjs.map +1 -0
  24. package/build/calendar/getStartOfDay/getStartOfDay.js.map +1 -0
  25. package/build/calendar/getStartOfDay/getStartOfDay.mjs.map +1 -0
  26. package/build/{dateLookup → calendar}/monthCalendar/MonthCalendar.js +2 -2
  27. package/build/calendar/monthCalendar/MonthCalendar.js.map +1 -0
  28. package/build/{dateLookup → calendar}/monthCalendar/MonthCalendar.mjs +1 -1
  29. package/build/calendar/monthCalendar/MonthCalendar.mjs.map +1 -0
  30. package/build/calendar/monthCalendar/table/MonthCalendarTable.js.map +1 -0
  31. package/build/calendar/monthCalendar/table/MonthCalendarTable.mjs.map +1 -0
  32. package/build/{dateLookup → calendar}/tableLink/TableLink.js +2 -2
  33. package/build/calendar/tableLink/TableLink.js.map +1 -0
  34. package/build/{dateLookup → calendar}/tableLink/TableLink.mjs +1 -1
  35. package/build/calendar/tableLink/TableLink.mjs.map +1 -0
  36. package/build/{dateLookup → calendar}/yearCalendar/YearCalendar.js +2 -2
  37. package/build/calendar/yearCalendar/YearCalendar.js.map +1 -0
  38. package/build/{dateLookup → calendar}/yearCalendar/YearCalendar.mjs +1 -1
  39. package/build/calendar/yearCalendar/YearCalendar.mjs.map +1 -0
  40. package/build/calendar/yearCalendar/table/YearCalendarTable.js.map +1 -0
  41. package/build/calendar/yearCalendar/table/YearCalendarTable.mjs.map +1 -0
  42. package/build/checkboxOption/CheckboxOption.js.map +1 -1
  43. package/build/checkboxOption/CheckboxOption.mjs.map +1 -1
  44. package/build/container/Container.js.map +1 -1
  45. package/build/container/Container.mjs.map +1 -1
  46. package/build/dateLookup/DateLookup.js +28 -168
  47. package/build/dateLookup/DateLookup.js.map +1 -1
  48. package/build/dateLookup/DateLookup.mjs +29 -169
  49. package/build/dateLookup/DateLookup.mjs.map +1 -1
  50. package/build/index.js +2 -0
  51. package/build/index.js.map +1 -1
  52. package/build/index.mjs +1 -0
  53. package/build/index.mjs.map +1 -1
  54. package/build/legacylistItem/LegacyListItem.js.map +1 -1
  55. package/build/legacylistItem/LegacyListItem.mjs.map +1 -1
  56. package/build/listItem/AvatarLayout/ListItemAvatarLayout.js.map +1 -1
  57. package/build/listItem/AvatarLayout/ListItemAvatarLayout.mjs.map +1 -1
  58. package/build/listItem/AvatarView/ListItemAvatarView.js.map +1 -1
  59. package/build/listItem/AvatarView/ListItemAvatarView.mjs.map +1 -1
  60. package/build/listItem/Button/ListItemButton.js.map +1 -1
  61. package/build/listItem/Button/ListItemButton.mjs.map +1 -1
  62. package/build/listItem/Checkbox/ListItemCheckbox.js.map +1 -1
  63. package/build/listItem/Checkbox/ListItemCheckbox.mjs.map +1 -1
  64. package/build/listItem/IconButton/ListItemIconButton.js.map +1 -1
  65. package/build/listItem/IconButton/ListItemIconButton.mjs.map +1 -1
  66. package/build/listItem/Image/ListItemImage.js.map +1 -1
  67. package/build/listItem/Image/ListItemImage.mjs.map +1 -1
  68. package/build/listItem/ListItem.js.map +1 -1
  69. package/build/listItem/ListItem.mjs.map +1 -1
  70. package/build/listItem/Navigation/ListItemNavigation.js.map +1 -1
  71. package/build/listItem/Navigation/ListItemNavigation.mjs.map +1 -1
  72. package/build/listItem/Prompt/ListItemPrompt.js.map +1 -1
  73. package/build/listItem/Prompt/ListItemPrompt.mjs.map +1 -1
  74. package/build/listItem/Radio/ListItemRadio.js.map +1 -1
  75. package/build/listItem/Radio/ListItemRadio.mjs.map +1 -1
  76. package/build/listItem/Switch/ListItemSwitch.js.map +1 -1
  77. package/build/listItem/Switch/ListItemSwitch.mjs.map +1 -1
  78. package/build/loader/Loader.js +1 -1
  79. package/build/loader/Loader.js.map +1 -1
  80. package/build/loader/Loader.mjs +1 -1
  81. package/build/loader/Loader.mjs.map +1 -1
  82. package/build/logo/Logo.js +1 -1
  83. package/build/logo/Logo.js.map +1 -1
  84. package/build/logo/Logo.mjs +1 -1
  85. package/build/logo/Logo.mjs.map +1 -1
  86. package/build/main.css +108 -117
  87. package/build/navigationOption/NavigationOption.js.map +1 -1
  88. package/build/navigationOption/NavigationOption.mjs.map +1 -1
  89. package/build/navigationOptionsList/NavigationOptionsList.js.map +1 -1
  90. package/build/navigationOptionsList/NavigationOptionsList.mjs.map +1 -1
  91. package/build/prompt/ActionPrompt/ActionPrompt.js.map +1 -1
  92. package/build/prompt/ActionPrompt/ActionPrompt.mjs.map +1 -1
  93. package/build/prompt/CriticalBanner/CriticalBanner.js.map +1 -1
  94. package/build/prompt/CriticalBanner/CriticalBanner.mjs.map +1 -1
  95. package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
  96. package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
  97. package/build/radioOption/RadioOption.js.map +1 -1
  98. package/build/radioOption/RadioOption.mjs.map +1 -1
  99. package/build/segmentedControl/SegmentedControl.js +1 -1
  100. package/build/segmentedControl/SegmentedControl.js.map +1 -1
  101. package/build/segmentedControl/SegmentedControl.mjs +1 -1
  102. package/build/segmentedControl/SegmentedControl.mjs.map +1 -1
  103. package/build/styles/calendar/Calendar.css +83 -0
  104. package/build/styles/css/neptune.css +11 -11
  105. package/build/styles/dateLookup/DateLookup.css +0 -90
  106. package/build/styles/less/legacy-variables.less +1 -1
  107. package/build/styles/less/neptune-tokens.less +2 -2
  108. package/build/styles/main.css +108 -117
  109. package/build/styles/props/custom-media.css +1 -1
  110. package/build/styles/props/neptune-tokens.css +1 -1
  111. package/build/styles/styles/less/neptune.css +11 -11
  112. package/build/summary/Summary.js +1 -1
  113. package/build/summary/Summary.js.map +1 -1
  114. package/build/summary/Summary.mjs +1 -1
  115. package/build/summary/Summary.mjs.map +1 -1
  116. package/build/switchOption/SwitchOption.js +1 -1
  117. package/build/switchOption/SwitchOption.js.map +1 -1
  118. package/build/switchOption/SwitchOption.mjs +1 -1
  119. package/build/switchOption/SwitchOption.mjs.map +1 -1
  120. package/build/types/actionOption/ActionOption.d.ts +1 -1
  121. package/build/types/calendar/Calendar.d.ts +13 -0
  122. package/build/types/calendar/Calendar.d.ts.map +1 -0
  123. package/build/types/{dateLookup/DateLookup.messages.d.ts → calendar/Calendar.messages.d.ts} +1 -1
  124. package/build/types/calendar/Calendar.messages.d.ts.map +1 -0
  125. package/build/types/calendar/dateHeader/DateHeader.d.ts.map +1 -0
  126. package/build/types/calendar/dateHeader/index.d.ts.map +1 -0
  127. package/build/types/calendar/dayCalendar/DayCalendar.d.ts.map +1 -0
  128. package/build/types/calendar/dayCalendar/index.d.ts.map +1 -0
  129. package/build/types/calendar/dayCalendar/table/DayCalendarTable.d.ts.map +1 -0
  130. package/build/types/calendar/dayCalendar/table/index.d.ts.map +1 -0
  131. package/build/types/calendar/getFocusableTime/getFocusableTime.d.ts.map +1 -0
  132. package/build/types/calendar/getStartOfDay/getStartOfDay.d.ts.map +1 -0
  133. package/build/types/calendar/getStartOfDay/index.d.ts.map +1 -0
  134. package/build/types/calendar/index.d.ts +3 -0
  135. package/build/types/calendar/index.d.ts.map +1 -0
  136. package/build/types/{dateLookup → calendar}/monthCalendar/MonthCalendar.d.ts +1 -1
  137. package/build/types/calendar/monthCalendar/MonthCalendar.d.ts.map +1 -0
  138. package/build/types/calendar/monthCalendar/index.d.ts.map +1 -0
  139. package/build/types/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.d.ts +1 -1
  140. package/build/types/calendar/monthCalendar/table/MonthCalendarTable.d.ts.map +1 -0
  141. package/build/types/calendar/monthCalendar/table/index.d.ts.map +1 -0
  142. package/build/types/calendar/tableLink/TableLink.d.ts.map +1 -0
  143. package/build/types/calendar/tableLink/index.d.ts.map +1 -0
  144. package/build/types/{dateLookup → calendar}/yearCalendar/YearCalendar.d.ts +1 -1
  145. package/build/types/calendar/yearCalendar/YearCalendar.d.ts.map +1 -0
  146. package/build/types/calendar/yearCalendar/index.d.ts.map +1 -0
  147. package/build/types/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.d.ts +1 -1
  148. package/build/types/calendar/yearCalendar/table/YearCalendarTable.d.ts.map +1 -0
  149. package/build/types/calendar/yearCalendar/table/index.d.ts.map +1 -0
  150. package/build/types/checkboxOption/CheckboxOption.d.ts +1 -1
  151. package/build/types/container/Container.d.ts +1 -1
  152. package/build/types/dateLookup/DateLookup.d.ts +2 -26
  153. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  154. package/build/types/index.d.ts +2 -0
  155. package/build/types/index.d.ts.map +1 -1
  156. package/build/types/legacylistItem/LegacyListItem.d.ts +1 -1
  157. package/build/types/listItem/AvatarLayout/ListItemAvatarLayout.d.ts +1 -1
  158. package/build/types/listItem/AvatarView/ListItemAvatarView.d.ts +1 -1
  159. package/build/types/listItem/Button/ListItemButton.d.ts +1 -1
  160. package/build/types/listItem/Checkbox/ListItemCheckbox.d.ts +1 -1
  161. package/build/types/listItem/IconButton/ListItemIconButton.d.ts +1 -1
  162. package/build/types/listItem/Image/ListItemImage.d.ts +1 -1
  163. package/build/types/listItem/ListItem.d.ts +1 -1
  164. package/build/types/listItem/Navigation/ListItemNavigation.d.ts +1 -1
  165. package/build/types/listItem/Prompt/ListItemPrompt.d.ts +1 -1
  166. package/build/types/listItem/Radio/ListItemRadio.d.ts +1 -1
  167. package/build/types/listItem/Switch/ListItemSwitch.d.ts +1 -1
  168. package/build/types/logo/Logo.d.ts +1 -1
  169. package/build/types/navigationOption/NavigationOption.d.ts +1 -1
  170. package/build/types/navigationOptionsList/NavigationOptionsList.d.ts +1 -1
  171. package/build/types/prompt/ActionPrompt/ActionPrompt.d.ts +1 -1
  172. package/build/types/prompt/CriticalBanner/CriticalBanner.d.ts +1 -1
  173. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +1 -1
  174. package/build/types/radioOption/RadioOption.d.ts +1 -1
  175. package/build/types/summary/Summary.d.ts +1 -1
  176. package/build/types/switchOption/SwitchOption.d.ts +1 -1
  177. package/package.json +22 -23
  178. package/src/actionButton/ActionButton.story.tsx +1 -1
  179. package/src/actionOption/ActionOption.tsx +1 -1
  180. package/src/button/_stories/Button.accessibility.docs.mdx +1 -1
  181. package/src/button/_stories/Button.story.tsx +6 -6
  182. package/src/calendar/Calendar.css +83 -0
  183. package/src/calendar/Calendar.less +79 -0
  184. package/src/calendar/Calendar.story.tsx +92 -0
  185. package/src/calendar/Calendar.test.tsx +138 -0
  186. package/src/calendar/Calendar.tsx +165 -0
  187. package/src/{dateLookup → calendar}/dateHeader/DateHeader.tsx +1 -1
  188. package/src/{dateLookup → calendar}/dayCalendar/DayCalendar.tsx +1 -1
  189. package/src/calendar/index.ts +2 -0
  190. package/src/{dateLookup → calendar}/monthCalendar/MonthCalendar.tsx +2 -2
  191. package/src/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.tsx +1 -1
  192. package/src/{dateLookup → calendar}/tableLink/TableLink.tsx +1 -1
  193. package/src/{dateLookup → calendar}/yearCalendar/YearCalendar.tsx +2 -2
  194. package/src/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.tsx +1 -1
  195. package/src/checkboxButton/CheckboxButton.story.tsx +1 -1
  196. package/src/checkboxOption/CheckboxOption.tsx +1 -1
  197. package/src/chips/Chips.story.tsx +3 -3
  198. package/src/circularButton/CircularButton.story.tsx +4 -4
  199. package/src/container/Container.tsx +1 -1
  200. package/src/dateLookup/DateLookup.css +0 -90
  201. package/src/dateLookup/DateLookup.less +0 -91
  202. package/src/dateLookup/DateLookup.test.tsx +0 -124
  203. package/src/dateLookup/DateLookup.tsx +31 -161
  204. package/src/divider/Divider.story.tsx +2 -2
  205. package/src/header/Header.accessibility.docs.mdx +1 -1
  206. package/src/header/Header.story.tsx +1 -1
  207. package/src/iconButton/IconButton.story.tsx +4 -4
  208. package/src/index.ts +2 -0
  209. package/src/legacylistItem/LegacyListItem.tsx +1 -1
  210. package/src/listItem/AdditionalInfo/ListItemAdditionalInfo.story.tsx +1 -1
  211. package/src/listItem/AvatarLayout/ListItemAvatarLayout.story.tsx +1 -1
  212. package/src/listItem/AvatarLayout/ListItemAvatarLayout.tsx +1 -1
  213. package/src/listItem/AvatarView/ListItemAvatarView.story.tsx +3 -3
  214. package/src/listItem/AvatarView/ListItemAvatarView.tsx +1 -1
  215. package/src/listItem/Button/ListItemButton.story.tsx +3 -3
  216. package/src/listItem/Button/ListItemButton.tsx +1 -1
  217. package/src/listItem/Checkbox/ListItemCheckbox.tsx +1 -1
  218. package/src/listItem/IconButton/ListItemIconButton.story.tsx +4 -4
  219. package/src/listItem/IconButton/ListItemIconButton.tsx +1 -1
  220. package/src/listItem/Image/ListItemImage.tsx +1 -1
  221. package/src/listItem/ListItem.tsx +1 -1
  222. package/src/listItem/Navigation/ListItemNavigation.tsx +1 -1
  223. package/src/listItem/Prompt/ListItemPrompt.tsx +1 -1
  224. package/src/listItem/Radio/ListItemRadio.tsx +1 -1
  225. package/src/listItem/Switch/ListItemSwitch.tsx +1 -1
  226. package/src/listItem/_stories/ListItem.disabled.story.tsx +1 -1
  227. package/src/listItem/_stories/ListItem.story.tsx +5 -5
  228. package/src/loader/Loader.tsx +1 -1
  229. package/src/logo/Logo.story.tsx +1 -1
  230. package/src/logo/Logo.tsx +1 -1
  231. package/src/main.css +108 -117
  232. package/src/main.less +1 -0
  233. package/src/navigationOption/NavigationOption.tsx +1 -1
  234. package/src/navigationOptionsList/NavigationOptionsList.tsx +1 -1
  235. package/src/prompt/ActionPrompt/ActionPrompt.story.tsx +1 -1
  236. package/src/prompt/ActionPrompt/ActionPrompt.tsx +1 -1
  237. package/src/prompt/CriticalBanner/CriticalBanner.story.tsx +1 -1
  238. package/src/prompt/CriticalBanner/CriticalBanner.tsx +1 -1
  239. package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +1 -1
  240. package/src/prompt/InfoPrompt/InfoPrompt.tsx +1 -1
  241. package/src/radioOption/RadioOption.tsx +1 -1
  242. package/src/segmentedControl/SegmentedControl.test.tsx +1 -1
  243. package/src/segmentedControl/SegmentedControl.tsx +1 -1
  244. package/src/styles/less/neptune.css +11 -11
  245. package/src/summary/Summary.tsx +1 -1
  246. package/src/switch/Switch.story.tsx +1 -1
  247. package/src/switchOption/SwitchOption.tsx +1 -1
  248. package/build/dateLookup/DateLookup.messages.js.map +0 -1
  249. package/build/dateLookup/DateLookup.messages.mjs.map +0 -1
  250. package/build/dateLookup/dateHeader/DateHeader.js.map +0 -1
  251. package/build/dateLookup/dateHeader/DateHeader.mjs.map +0 -1
  252. package/build/dateLookup/dayCalendar/DayCalendar.js.map +0 -1
  253. package/build/dateLookup/dayCalendar/DayCalendar.mjs.map +0 -1
  254. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +0 -1
  255. package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +0 -1
  256. package/build/dateLookup/getFocusableTime/getFocusableTime.js.map +0 -1
  257. package/build/dateLookup/getFocusableTime/getFocusableTime.mjs.map +0 -1
  258. package/build/dateLookup/getStartOfDay/getStartOfDay.js.map +0 -1
  259. package/build/dateLookup/getStartOfDay/getStartOfDay.mjs.map +0 -1
  260. package/build/dateLookup/monthCalendar/MonthCalendar.js.map +0 -1
  261. package/build/dateLookup/monthCalendar/MonthCalendar.mjs.map +0 -1
  262. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +0 -1
  263. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs.map +0 -1
  264. package/build/dateLookup/tableLink/TableLink.js.map +0 -1
  265. package/build/dateLookup/tableLink/TableLink.mjs.map +0 -1
  266. package/build/dateLookup/yearCalendar/YearCalendar.js.map +0 -1
  267. package/build/dateLookup/yearCalendar/YearCalendar.mjs.map +0 -1
  268. package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +0 -1
  269. package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs.map +0 -1
  270. package/build/types/dateLookup/DateLookup.messages.d.ts.map +0 -1
  271. package/build/types/dateLookup/dateHeader/DateHeader.d.ts.map +0 -1
  272. package/build/types/dateLookup/dateHeader/index.d.ts.map +0 -1
  273. package/build/types/dateLookup/dayCalendar/DayCalendar.d.ts.map +0 -1
  274. package/build/types/dateLookup/dayCalendar/index.d.ts.map +0 -1
  275. package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts.map +0 -1
  276. package/build/types/dateLookup/dayCalendar/table/index.d.ts.map +0 -1
  277. package/build/types/dateLookup/getFocusableTime/getFocusableTime.d.ts.map +0 -1
  278. package/build/types/dateLookup/getStartOfDay/getStartOfDay.d.ts.map +0 -1
  279. package/build/types/dateLookup/getStartOfDay/index.d.ts.map +0 -1
  280. package/build/types/dateLookup/monthCalendar/MonthCalendar.d.ts.map +0 -1
  281. package/build/types/dateLookup/monthCalendar/index.d.ts.map +0 -1
  282. package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts.map +0 -1
  283. package/build/types/dateLookup/monthCalendar/table/index.d.ts.map +0 -1
  284. package/build/types/dateLookup/tableLink/TableLink.d.ts.map +0 -1
  285. package/build/types/dateLookup/tableLink/index.d.ts.map +0 -1
  286. package/build/types/dateLookup/yearCalendar/YearCalendar.d.ts.map +0 -1
  287. package/build/types/dateLookup/yearCalendar/index.d.ts.map +0 -1
  288. package/build/types/dateLookup/yearCalendar/table/YearCalendarTable.d.ts.map +0 -1
  289. package/build/types/dateLookup/yearCalendar/table/index.d.ts.map +0 -1
  290. /package/build/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.js +0 -0
  291. /package/build/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.mjs +0 -0
  292. /package/build/{dateLookup → calendar}/getFocusableTime/getFocusableTime.js +0 -0
  293. /package/build/{dateLookup → calendar}/getFocusableTime/getFocusableTime.mjs +0 -0
  294. /package/build/{dateLookup → calendar}/getStartOfDay/getStartOfDay.js +0 -0
  295. /package/build/{dateLookup → calendar}/getStartOfDay/getStartOfDay.mjs +0 -0
  296. /package/build/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.js +0 -0
  297. /package/build/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.mjs +0 -0
  298. /package/build/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.js +0 -0
  299. /package/build/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.mjs +0 -0
  300. /package/build/types/{dateLookup → calendar}/dateHeader/DateHeader.d.ts +0 -0
  301. /package/build/types/{dateLookup → calendar}/dateHeader/index.d.ts +0 -0
  302. /package/build/types/{dateLookup → calendar}/dayCalendar/DayCalendar.d.ts +0 -0
  303. /package/build/types/{dateLookup → calendar}/dayCalendar/index.d.ts +0 -0
  304. /package/build/types/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.d.ts +0 -0
  305. /package/build/types/{dateLookup → calendar}/dayCalendar/table/index.d.ts +0 -0
  306. /package/build/types/{dateLookup → calendar}/getFocusableTime/getFocusableTime.d.ts +0 -0
  307. /package/build/types/{dateLookup → calendar}/getStartOfDay/getStartOfDay.d.ts +0 -0
  308. /package/build/types/{dateLookup → calendar}/getStartOfDay/index.d.ts +0 -0
  309. /package/build/types/{dateLookup → calendar}/monthCalendar/index.d.ts +0 -0
  310. /package/build/types/{dateLookup → calendar}/monthCalendar/table/index.d.ts +0 -0
  311. /package/build/types/{dateLookup → calendar}/tableLink/TableLink.d.ts +0 -0
  312. /package/build/types/{dateLookup → calendar}/tableLink/index.d.ts +0 -0
  313. /package/build/types/{dateLookup → calendar}/yearCalendar/index.d.ts +0 -0
  314. /package/build/types/{dateLookup → calendar}/yearCalendar/table/index.d.ts +0 -0
  315. /package/src/{dateLookup/DateLookup.messages.ts → calendar/Calendar.messages.ts} +0 -0
  316. /package/src/{dateLookup → calendar}/dateHeader/index.ts +0 -0
  317. /package/src/{dateLookup → calendar}/dayCalendar/index.ts +0 -0
  318. /package/src/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.tsx +0 -0
  319. /package/src/{dateLookup → calendar}/dayCalendar/table/index.ts +0 -0
  320. /package/src/{dateLookup → calendar}/getFocusableTime/getFocusable.test.ts +0 -0
  321. /package/src/{dateLookup → calendar}/getFocusableTime/getFocusableTime.tsx +0 -0
  322. /package/src/{dateLookup → calendar}/getStartOfDay/getStartOfDay.test.js +0 -0
  323. /package/src/{dateLookup → calendar}/getStartOfDay/getStartOfDay.tsx +0 -0
  324. /package/src/{dateLookup → calendar}/getStartOfDay/index.ts +0 -0
  325. /package/src/{dateLookup → calendar}/monthCalendar/index.ts +0 -0
  326. /package/src/{dateLookup → calendar}/monthCalendar/table/index.ts +0 -0
  327. /package/src/{dateLookup → calendar}/tableLink/index.ts +0 -0
  328. /package/src/{dateLookup → calendar}/yearCalendar/index.ts +0 -0
  329. /package/src/{dateLookup → calendar}/yearCalendar/table/index.ts +0 -0
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  Neptune is the Design System built by and used at TransferWise. Neptune Web is the Neptune framework for Web. Neptune Web provides a way to build high quality, consistent user experiences on the web with ease.
6
6
 
7
- This is the Neptune Web React component library. It uses [Neptune CSS](https://github.com/transferwise/neptune-web/tree/main/packages/css).
7
+ This is the Neptune Web React component library. It includes all necessary base CSS styles.
8
8
 
9
9
  ## Usage
10
10
 
@@ -23,7 +23,7 @@ npm install @transferwise/components react react-dom prop-types @wise/art
23
23
 
24
24
  ```js
25
25
  // These CSS files should be imported once in your application
26
- import '@transferwise/neptune-css/dist/css/neptune.css';
26
+ import '@transferwise/components/build/styles/css/neptune.css';
27
27
  import '@transferwise/components/build/main.css';
28
28
 
29
29
  import en from '@transferwise/components/build/i18n/en.json';
@@ -1 +1 @@
1
- {"version":3,"file":"ActionOption.js","sources":["../../src/actionOption/ActionOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Button from '../button';\nimport {\n AriaLabelProperty,\n CommonProps,\n Priority,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n} from '../common';\nimport Option from '../common/Option';\nimport { ButtonPriority } from '../button/Button.types';\n\ntype ActionOptionPriority =\n | PriorityPrimary\n | PrioritySecondary\n | PriorityTertiary\n | 'secondary-send';\n\nexport type ActionOptionProps = {\n complex?: boolean;\n content?: React.ReactNode;\n disabled?: boolean;\n media?: React.ReactNode;\n showMediaAtAllSizes?: boolean;\n onClick: () => void;\n title: React.ReactNode;\n additionalContent?: React.ReactNode;\n action: React.ReactNode;\n priority?: ActionOptionPriority;\n showMediaCircle?: boolean;\n isContainerAligned?: boolean;\n as?: React.ElementType;\n} & CommonProps &\n AriaLabelProperty;\n\n/**\n * @deprecated Use `<ListItem />` instead (run codemod to migrate: **`npx @wise/wds-codemods@latest list-item`**).\n * @deprecatedSince 46.104.0\n * @see [Source](../listItem/ListItem.tsx)\n * @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)\n * @see [Design docs](https://wise.design/components/list-item)\n * @see [Release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3647251055/List+Item+release+notes)\n */\nconst ActionOption = ({\n action,\n priority = Priority.PRIMARY,\n disabled,\n onClick,\n media,\n title,\n content,\n additionalContent,\n complex,\n className,\n showMediaAtAllSizes,\n showMediaCircle,\n isContainerAligned,\n as,\n 'aria-label': ariaLabel,\n}: ActionOptionProps) => {\n const sharedProps = {\n media,\n title,\n content,\n complex,\n disabled,\n showMediaAtAllSizes,\n showMediaCircle,\n className: clsx('tw-action-option', className),\n isContainerAligned,\n additionalContent,\n as,\n };\n\n const getAriaLabel = (): string | undefined => {\n if (ariaLabel) {\n return ariaLabel;\n }\n\n const generatedLabels: string[] = [];\n\n if (typeof title === 'string') {\n generatedLabels.push(title);\n }\n\n if (typeof action === 'string') {\n generatedLabels.push(action);\n }\n\n return generatedLabels.join(', ') || undefined;\n };\n\n const mapPriority = (priority: ActionOptionPriority): ButtonPriority => {\n switch (priority) {\n case 'primary':\n return 'primary';\n case 'secondary':\n return 'secondary-neutral';\n case 'tertiary':\n return 'tertiary';\n case 'secondary-send':\n return 'secondary';\n default:\n return 'primary';\n }\n };\n\n return (\n <Option\n {...sharedProps}\n button={\n <Button\n v2\n size=\"sm\"\n priority={mapPriority(priority)}\n disabled={disabled}\n aria-label={getAriaLabel()}\n onClick={onClick}\n >\n {action}\n </Button>\n }\n />\n );\n};\n\nexport default ActionOption;\n"],"names":["ActionOption","action","priority","Priority","PRIMARY","disabled","onClick","media","title","content","additionalContent","complex","className","showMediaAtAllSizes","showMediaCircle","isContainerAligned","as","ariaLabel","sharedProps","clsx","getAriaLabel","generatedLabels","push","join","undefined","mapPriority","_jsx","Option","button","Button","v2","size","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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OAAO,WAAW;AACpB,MAAA;AACE,QAAA,OAAO,SAAS;AACpB;EACF,CAAC;EAED,oBACEwB,cAAA,CAACC,cAAM,EAAA;AAAA,IAAA,GACDT,WAAW;IACfU,MAAM,eACJF,cAAA,CAACG,uBAAM,EAAA;MACLC,EAAE,EAAA,IAAA;AACFC,MAAAA,IAAI,EAAC,IAAI;AACT7B,MAAAA,QAAQ,EAAEuB,WAAW,CAACvB,QAAQ,CAAE;AAChCG,MAAAA,QAAQ,EAAEA,QAAS;MACnB,YAAA,EAAYe,YAAY,EAAG;AAC3Bd,MAAAA,OAAO,EAAEA,OAAQ;AAAA0B,MAAAA,QAAA,EAEhB/B;KACK;AACT,GAAA,CACD;AAEN;;;;"}
1
+ {"version":3,"file":"ActionOption.js","sources":["../../src/actionOption/ActionOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Button from '../button';\nimport {\n AriaLabelProperty,\n CommonProps,\n Priority,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n} from '../common';\nimport Option from '../common/Option';\nimport { ButtonPriority } from '../button/Button.types';\n\ntype ActionOptionPriority =\n | PriorityPrimary\n | PrioritySecondary\n | PriorityTertiary\n | 'secondary-send';\n\nexport type ActionOptionProps = {\n complex?: boolean;\n content?: React.ReactNode;\n disabled?: boolean;\n media?: React.ReactNode;\n showMediaAtAllSizes?: boolean;\n onClick: () => void;\n title: React.ReactNode;\n additionalContent?: React.ReactNode;\n action: React.ReactNode;\n priority?: ActionOptionPriority;\n showMediaCircle?: boolean;\n isContainerAligned?: boolean;\n as?: React.ElementType;\n} & CommonProps &\n AriaLabelProperty;\n\n/**\n * @deprecated Use `<ListItem />` instead (run codemod to migrate: **`npx @wise/wds-codemods@latest list-item`**).\n * @deprecatedSince 46.104.0\n * @see [Source](../listItem/ListItem.tsx)\n * @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)\n * @see [Design docs](https://docs.wise.design/components/list-item)\n * @see [Release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3647251055/List+Item+release+notes)\n */\nconst ActionOption = ({\n action,\n priority = Priority.PRIMARY,\n disabled,\n onClick,\n media,\n title,\n content,\n additionalContent,\n complex,\n className,\n showMediaAtAllSizes,\n showMediaCircle,\n isContainerAligned,\n as,\n 'aria-label': ariaLabel,\n}: ActionOptionProps) => {\n const sharedProps = {\n media,\n title,\n content,\n complex,\n disabled,\n showMediaAtAllSizes,\n showMediaCircle,\n className: clsx('tw-action-option', className),\n isContainerAligned,\n additionalContent,\n as,\n };\n\n const getAriaLabel = (): string | undefined => {\n if (ariaLabel) {\n return ariaLabel;\n }\n\n const generatedLabels: string[] = [];\n\n if (typeof title === 'string') {\n generatedLabels.push(title);\n }\n\n if (typeof action === 'string') {\n generatedLabels.push(action);\n }\n\n return generatedLabels.join(', ') || undefined;\n };\n\n const mapPriority = (priority: ActionOptionPriority): ButtonPriority => {\n switch (priority) {\n case 'primary':\n return 'primary';\n case 'secondary':\n return 'secondary-neutral';\n case 'tertiary':\n return 'tertiary';\n case 'secondary-send':\n return 'secondary';\n default:\n return 'primary';\n }\n };\n\n return (\n <Option\n {...sharedProps}\n button={\n <Button\n v2\n size=\"sm\"\n priority={mapPriority(priority)}\n disabled={disabled}\n aria-label={getAriaLabel()}\n onClick={onClick}\n >\n {action}\n </Button>\n }\n />\n );\n};\n\nexport default ActionOption;\n"],"names":["ActionOption","action","priority","Priority","PRIMARY","disabled","onClick","media","title","content","additionalContent","complex","className","showMediaAtAllSizes","showMediaCircle","isContainerAligned","as","ariaLabel","sharedProps","clsx","getAriaLabel","generatedLabels","push","join","undefined","mapPriority","_jsx","Option","button","Button","v2","size","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAMA,YAAY,GAAGA,CAAC;EACpBC,MAAM;EACNC,QAAQ,GAAGC,gBAAQ,CAACC,OAAO;EAC3BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,i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EAAA;MACLC,EAAE,EAAA,IAAA;AACFC,MAAAA,IAAI,EAAC,IAAI;AACT7B,MAAAA,QAAQ,EAAEuB,WAAW,CAACvB,QAAQ,CAAE;AAChCG,MAAAA,QAAQ,EAAEA,QAAS;MACnB,YAAA,EAAYe,YAAY,EAAG;AAC3Bd,MAAAA,OAAO,EAAEA,OAAQ;AAAA0B,MAAAA,QAAA,EAEhB/B;KACK;AACT,GAAA,CACD;AAEN;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"ActionOption.mjs","sources":["../../src/actionOption/ActionOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Button from '../button';\nimport {\n AriaLabelProperty,\n CommonProps,\n Priority,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n} from '../common';\nimport Option from '../common/Option';\nimport { ButtonPriority } from '../button/Button.types';\n\ntype ActionOptionPriority =\n | PriorityPrimary\n | PrioritySecondary\n | PriorityTertiary\n | 'secondary-send';\n\nexport type ActionOptionProps = {\n complex?: boolean;\n content?: React.ReactNode;\n disabled?: boolean;\n media?: React.ReactNode;\n showMediaAtAllSizes?: boolean;\n onClick: () => void;\n title: React.ReactNode;\n additionalContent?: React.ReactNode;\n action: React.ReactNode;\n priority?: ActionOptionPriority;\n showMediaCircle?: boolean;\n isContainerAligned?: boolean;\n as?: React.ElementType;\n} & CommonProps &\n AriaLabelProperty;\n\n/**\n * @deprecated Use `<ListItem />` instead (run codemod to migrate: **`npx @wise/wds-codemods@latest list-item`**).\n * @deprecatedSince 46.104.0\n * @see [Source](../listItem/ListItem.tsx)\n * @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)\n * @see [Design docs](https://wise.design/components/list-item)\n * @see [Release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3647251055/List+Item+release+notes)\n */\nconst ActionOption = ({\n action,\n priority = Priority.PRIMARY,\n disabled,\n onClick,\n media,\n title,\n content,\n additionalContent,\n complex,\n className,\n showMediaAtAllSizes,\n showMediaCircle,\n isContainerAligned,\n as,\n 'aria-label': ariaLabel,\n}: ActionOptionProps) => {\n const sharedProps = {\n media,\n title,\n content,\n complex,\n disabled,\n showMediaAtAllSizes,\n showMediaCircle,\n className: clsx('tw-action-option', className),\n isContainerAligned,\n additionalContent,\n as,\n };\n\n const getAriaLabel = (): string | undefined => {\n if (ariaLabel) {\n return ariaLabel;\n }\n\n const generatedLabels: string[] = [];\n\n if (typeof title === 'string') {\n generatedLabels.push(title);\n }\n\n if (typeof action === 'string') {\n generatedLabels.push(action);\n }\n\n return generatedLabels.join(', ') || undefined;\n };\n\n const mapPriority = (priority: ActionOptionPriority): ButtonPriority => {\n switch (priority) {\n case 'primary':\n return 'primary';\n case 'secondary':\n return 'secondary-neutral';\n case 'tertiary':\n return 'tertiary';\n case 'secondary-send':\n return 'secondary';\n default:\n return 'primary';\n }\n };\n\n return (\n <Option\n {...sharedProps}\n button={\n <Button\n v2\n size=\"sm\"\n priority={mapPriority(priority)}\n disabled={disabled}\n aria-label={getAriaLabel()}\n onClick={onClick}\n >\n {action}\n </Button>\n }\n />\n );\n};\n\nexport default ActionOption;\n"],"names":["ActionOption","action","priority","Priority","PRIMARY","disabled","onClick","media","title","content","additionalContent","complex","className","showMediaAtAllSizes","showMediaCircle","isContainerAligned","as","ariaLabel","sharedProps","clsx","getAriaLabel","generatedLabels","push","join","undefined","mapPriority","_jsx","Option","button","Button","v2","size","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAMA,YAAY,GAAGA,CAAC;EACpBC,MAAM;EACNC,QAAQ,GAAGC,QAAQ,CAACC,OAAO;EAC3BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,iBAAiB;EACjBC,OAAO;EACPC,SAAS;EACTC,mBAAmB;EACnBC,eAAe;EACfC,kBAAkB;EAClBC,EAAE;AACF,EAAA,YAAY,EAAEC;AAAS,CACL,KAAI;AACtB,EAAA,MAAMC,WAAW,GA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,YAAA,EAAYe,YAAY,EAAG;AAC3Bd,MAAAA,OAAO,EAAEA,OAAQ;AAAA0B,MAAAA,QAAA,EAEhB/B;KACK;AACT,GAAA,CACD;AAEN;;;;"}
1
+ {"version":3,"file":"ActionOption.mjs","sources":["../../src/actionOption/ActionOption.tsx"],"sourcesContent":["import { clsx } from 'clsx';\n\nimport Button from '../button';\nimport {\n AriaLabelProperty,\n CommonProps,\n Priority,\n PriorityPrimary,\n PrioritySecondary,\n PriorityTertiary,\n} from '../common';\nimport Option from '../common/Option';\nimport { ButtonPriority } from '../button/Button.types';\n\ntype ActionOptionPriority =\n | PriorityPrimary\n | PrioritySecondary\n | PriorityTertiary\n | 'secondary-send';\n\nexport type ActionOptionProps = {\n complex?: boolean;\n content?: React.ReactNode;\n disabled?: boolean;\n media?: React.ReactNode;\n showMediaAtAllSizes?: boolean;\n onClick: () => void;\n title: React.ReactNode;\n additionalContent?: React.ReactNode;\n action: React.ReactNode;\n priority?: ActionOptionPriority;\n showMediaCircle?: boolean;\n isContainerAligned?: boolean;\n as?: React.ElementType;\n} & CommonProps &\n AriaLabelProperty;\n\n/**\n * @deprecated Use `<ListItem />` instead (run codemod to migrate: **`npx @wise/wds-codemods@latest list-item`**).\n * @deprecatedSince 46.104.0\n * @see [Source](../listItem/ListItem.tsx)\n * @see [Storybook](https://storybook.wise.design/?path=/docs/content-listitem--docs)\n * @see [Design docs](https://docs.wise.design/components/list-item)\n * @see [Release notes](https://transferwise.atlassian.net/wiki/spaces/DS/pages/3647251055/List+Item+release+notes)\n */\nconst ActionOption = ({\n action,\n priority = Priority.PRIMARY,\n disabled,\n onClick,\n media,\n title,\n content,\n additionalContent,\n complex,\n className,\n showMediaAtAllSizes,\n showMediaCircle,\n isContainerAligned,\n as,\n 'aria-label': ariaLabel,\n}: ActionOptionProps) => {\n const sharedProps = {\n media,\n title,\n content,\n complex,\n disabled,\n showMediaAtAllSizes,\n showMediaCircle,\n className: clsx('tw-action-option', className),\n isContainerAligned,\n additionalContent,\n as,\n };\n\n const getAriaLabel = (): string | undefined => {\n if (ariaLabel) {\n return ariaLabel;\n }\n\n const generatedLabels: string[] = [];\n\n if (typeof title === 'string') {\n generatedLabels.push(title);\n }\n\n if (typeof action === 'string') {\n generatedLabels.push(action);\n }\n\n return generatedLabels.join(', ') || undefined;\n };\n\n const mapPriority = (priority: ActionOptionPriority): ButtonPriority => {\n switch (priority) {\n case 'primary':\n return 'primary';\n case 'secondary':\n return 'secondary-neutral';\n case 'tertiary':\n return 'tertiary';\n case 'secondary-send':\n return 'secondary';\n default:\n return 'primary';\n }\n };\n\n return (\n <Option\n {...sharedProps}\n button={\n <Button\n v2\n size=\"sm\"\n priority={mapPriority(priority)}\n disabled={disabled}\n aria-label={getAriaLabel()}\n onClick={onClick}\n >\n {action}\n </Button>\n }\n />\n );\n};\n\nexport default ActionOption;\n"],"names":["ActionOption","action","priority","Priority","PRIMARY","disabled","onClick","media","title","content","additionalContent","complex","className","showMediaAtAllSizes","showMediaCircle","isContainerAligned","as","ariaLabel","sharedProps","clsx","getAriaLabel","generatedLabels","push","join","undefined","mapPriority","_jsx","Option","button","Button","v2","size","children"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6CA,MAAMA,YAAY,GAAGA,CAAC;EACpBC,MAAM;EACNC,QAAQ,GAAGC,QAAQ,CAACC,OAAO;EAC3BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,KAAK;EACLC,OAAO;EACPC,iBAAiB;EACjBC,OAAO;EACPC,SAAS;EACTC,mBAAmB;EACnBC,eAAe;EACfC,kBAAkB;EAClBC,EAAE;AACF,EAAA,YAAY,EAAEC;AAAS,CACL,KAAI;AACtB,EAAA,MAAMC,WAAW,GAAG;IAClBX,KAAK;IACLC,KAAK;IACLC,OAAO;IACPE,OAAO;IACPN,QAAQ;IACRQ,mBAAmB;IACnBC,eAAe;AACfF,IAAAA,SAAS,EAAEO,IAAI,CAAC,kBAAkB,EAAEP,SAAS,CAAC;IAC9C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
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
5
+ var React = require('react');
6
+ require('../common/theme.js');
7
+ require('../common/direction.js');
8
+ require('@transferwise/neptune-tokens');
9
+ require('../common/propsValues/control.js');
10
+ require('../common/propsValues/size.js');
11
+ require('../common/propsValues/typography.js');
12
+ require('../common/propsValues/width.js');
13
+ require('../common/propsValues/type.js');
14
+ require('../common/propsValues/dateMode.js');
15
+ var monthFormat = require('../common/propsValues/monthFormat.js');
16
+ require('../common/propsValues/position.js');
17
+ require('../common/propsValues/layouts.js');
18
+ require('../common/propsValues/status.js');
19
+ require('../common/propsValues/sentiment.js');
20
+ require('../common/propsValues/profileType.js');
21
+ require('../common/propsValues/variant.js');
22
+ require('../common/propsValues/scroll.js');
23
+ require('../common/propsValues/markdownNodeType.js');
24
+ require('../common/fileType.js');
25
+ require('@transferwise/formatting');
26
+ require('@transferwise/icons');
27
+ require('clsx');
28
+ require('react-intl');
29
+ require('../common/closeButton/CloseButton.messages.js');
30
+ var jsxRuntime = require('react/jsx-runtime');
31
+ var moveToWithinRange = require('../common/dateUtils/moveToWithinRange/moveToWithinRange.js');
32
+ var isWithinRange = require('../common/dateUtils/isWithinRange/isWithinRange.js');
33
+ var getDateView = require('../common/dateUtils/getDateView/getDateView.js');
34
+ var DayCalendar = require('./dayCalendar/DayCalendar.js');
35
+ var getStartOfDay = require('./getStartOfDay/getStartOfDay.js');
36
+ var MonthCalendar = require('./monthCalendar/MonthCalendar.js');
37
+ var YearCalendar = require('./yearCalendar/YearCalendar.js');
38
+
39
+ const Calendar = ({
40
+ value,
41
+ min: minProp = null,
42
+ max: maxProp = null,
43
+ monthFormat: monthFormat$1 = monthFormat.MonthFormat.LONG,
44
+ placeholder,
45
+ onChange,
46
+ onSelect
47
+ }) => {
48
+ const selectedDate = getStartOfDay.getStartOfDay(value);
49
+ const min = getStartOfDay.getStartOfDay(minProp);
50
+ const max = getStartOfDay.getStartOfDay(maxProp);
51
+ React.useEffect(() => {
52
+ if (selectedDate && !isWithinRange.isWithinRange(selectedDate, min, max)) {
53
+ onChange(moveToWithinRange.moveToWithinRange(selectedDate, min, max));
54
+ }
55
+ }, [selectedDate?.getTime(), min?.getTime(), max?.getTime(), onChange]); // eslint-disable-line react-hooks/exhaustive-deps
56
+ const dateView = getDateView.returnDateView(selectedDate, min, max);
57
+ const [viewMonth, setViewMonth] = React.useState(dateView.getMonth());
58
+ const [viewYear, setViewYear] = React.useState(dateView.getFullYear());
59
+ const [mode, setMode] = React.useState('day');
60
+ React.useEffect(() => {
61
+ const view = getDateView.returnDateView(selectedDate, min, max);
62
+ // eslint-disable-next-line react-hooks/set-state-in-effect
63
+ setViewMonth(view.getMonth());
64
+ setViewYear(view.getFullYear());
65
+ }, [selectedDate?.getTime(), min?.getTime(), max?.getTime()]); // eslint-disable-line react-hooks/exhaustive-deps
66
+ const handleViewDateUpdate = React.useCallback(
67
+ // eslint-disable-next-line react-hooks/preserve-manual-memoization
68
+ ({
69
+ month,
70
+ year
71
+ }) => {
72
+ if (month !== undefined) setViewMonth(month);
73
+ if (year !== undefined) setViewYear(year);
74
+ }, []);
75
+ const switchToDays = React.useCallback(() => setMode('day'), []);
76
+ const switchToMonths = React.useCallback(() => setMode('month'), []);
77
+ const switchToYears = React.useCallback(() => setMode('year'), []);
78
+ const handleSelectedDateUpdate = React.useCallback(date => {
79
+ if (onSelect) {
80
+ onSelect(date);
81
+ } else {
82
+ onChange(date);
83
+ }
84
+ }, [onChange, onSelect]);
85
+ const adjustDate = React.useCallback((daysToAdd, monthsToAdd, yearsToAdd) => {
86
+ let date;
87
+ if (selectedDate) {
88
+ date = new Date(mode === 'year' ? selectedDate.getFullYear() + yearsToAdd : selectedDate.getFullYear(), mode === 'month' ? selectedDate.getMonth() + monthsToAdd : selectedDate.getMonth(), mode === 'day' ? selectedDate.getDate() + daysToAdd : selectedDate.getDate());
89
+ } else {
90
+ date = getStartOfDay.getStartOfDay(new Date());
91
+ }
92
+ date &&= moveToWithinRange.moveToWithinRange(date, min, max);
93
+ if (date?.getTime() !== selectedDate?.getTime()) {
94
+ onChange(date);
95
+ }
96
+ }, [selectedDate, min, max, mode, onChange]);
97
+ const handleKeyDown = React.useCallback(event => {
98
+ switch (event.key) {
99
+ case 'ArrowLeft':
100
+ adjustDate(-1, -1, -1);
101
+ event.preventDefault();
102
+ break;
103
+ case 'ArrowUp':
104
+ adjustDate(-7, -4, -4);
105
+ event.preventDefault();
106
+ break;
107
+ case 'ArrowRight':
108
+ adjustDate(1, 1, 1);
109
+ event.preventDefault();
110
+ break;
111
+ case 'ArrowDown':
112
+ adjustDate(7, 4, 4);
113
+ event.preventDefault();
114
+ break;
115
+ }
116
+ }, [adjustDate]);
117
+ return (
118
+ /*#__PURE__*/
119
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
120
+ jsxRuntime.jsxs("div", {
121
+ onKeyDown: handleKeyDown,
122
+ children: [mode === 'day' && /*#__PURE__*/jsxRuntime.jsx(DayCalendar.default, {
123
+ selectedDate: selectedDate,
124
+ min: min,
125
+ max: max,
126
+ viewMonth: viewMonth,
127
+ viewYear: viewYear,
128
+ monthFormat: monthFormat$1,
129
+ onSelect: handleSelectedDateUpdate,
130
+ onLabelClick: switchToYears,
131
+ onViewDateUpdate: handleViewDateUpdate
132
+ }), mode === 'month' && /*#__PURE__*/jsxRuntime.jsx(MonthCalendar.default, {
133
+ selectedDate: selectedDate,
134
+ min: min,
135
+ max: max,
136
+ viewYear: viewYear,
137
+ ...(placeholder != null && {
138
+ placeholder
139
+ }),
140
+ onSelect: switchToDays,
141
+ onLabelClick: switchToYears,
142
+ onViewDateUpdate: handleViewDateUpdate
143
+ }), mode === 'year' && /*#__PURE__*/jsxRuntime.jsx(YearCalendar.default, {
144
+ selectedDate: selectedDate,
145
+ min: min,
146
+ max: max,
147
+ viewYear: viewYear,
148
+ ...(placeholder != null && {
149
+ placeholder
150
+ }),
151
+ onSelect: switchToMonths,
152
+ onViewDateUpdate: handleViewDateUpdate
153
+ })]
154
+ })
155
+ );
156
+ };
157
+
158
+ exports.default = Calendar;
159
+ //# sourceMappingURL=Calendar.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Calendar.js","sources":["../../src/calendar/Calendar.tsx"],"sourcesContent":["import { useState, useCallback, useEffect, KeyboardEvent } from 'react';\n\nimport { MonthFormat } from '../common';\nimport { isWithinRange, moveToWithinRange, returnDateView } from '../common/dateUtils';\nimport DayCalendar from './dayCalendar';\nimport { getStartOfDay } from './getStartOfDay';\nimport MonthCalendar from './monthCalendar';\nimport YearCalendar from './yearCalendar';\n\nexport interface CalendarProps {\n value: Date | null;\n min?: Date | null;\n max?: Date | null;\n monthFormat?: `${MonthFormat}`;\n placeholder?: string;\n onChange: (date: Date | null) => void;\n onSelect?: (date: Date) => void;\n}\n\nconst Calendar = ({\n value,\n min: minProp = null,\n max: maxProp = null,\n monthFormat = MonthFormat.LONG,\n placeholder,\n onChange,\n onSelect,\n}: CalendarProps) => {\n const selectedDate = getStartOfDay(value);\n const min = getStartOfDay(minProp);\n const max = getStartOfDay(maxProp);\n\n useEffect(() => {\n if (selectedDate && !isWithinRange(selectedDate, min, max)) {\n onChange(moveToWithinRange(selectedDate, min, max));\n }\n }, [selectedDate?.getTime(), min?.getTime(), max?.getTime(), onChange]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const dateView = returnDateView(selectedDate, min, max);\n const [viewMonth, setViewMonth] = useState(dateView.getMonth());\n const [viewYear, setViewYear] = useState(dateView.getFullYear());\n const [mode, setMode] = useState<'day' | 'month' | 'year'>('day');\n\n useEffect(() => {\n const view = returnDateView(selectedDate, min, max);\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setViewMonth(view.getMonth());\n\n setViewYear(view.getFullYear());\n }, [selectedDate?.getTime(), min?.getTime(), max?.getTime()]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const handleViewDateUpdate = useCallback(\n // eslint-disable-next-line react-hooks/preserve-manual-memoization\n ({ month, year }: { month?: number; year?: number }) => {\n if (month !== undefined) setViewMonth(month);\n if (year !== undefined) setViewYear(year);\n },\n [],\n );\n\n const switchToDays = useCallback(() => setMode('day'), []);\n const switchToMonths = useCallback(() => setMode('month'), []);\n const switchToYears = useCallback(() => setMode('year'), []);\n\n const handleSelectedDateUpdate = useCallback(\n (date: Date) => {\n if (onSelect) {\n onSelect(date);\n } else {\n onChange(date);\n }\n },\n [onChange, onSelect],\n );\n\n const adjustDate = useCallback(\n (daysToAdd: number, monthsToAdd: number, yearsToAdd: number) => {\n let date: Date | null;\n if (selectedDate) {\n date = new Date(\n mode === 'year' ? selectedDate.getFullYear() + yearsToAdd : selectedDate.getFullYear(),\n mode === 'month' ? selectedDate.getMonth() + monthsToAdd : selectedDate.getMonth(),\n mode === 'day' ? selectedDate.getDate() + daysToAdd : selectedDate.getDate(),\n );\n } else {\n date = getStartOfDay(new Date());\n }\n date &&= moveToWithinRange(date, min, max);\n if (date?.getTime() !== selectedDate?.getTime()) {\n onChange(date);\n }\n },\n [selectedDate, min, max, mode, onChange],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n switch (event.key) {\n case 'ArrowLeft':\n adjustDate(-1, -1, -1);\n event.preventDefault();\n break;\n case 'ArrowUp':\n adjustDate(-7, -4, -4);\n event.preventDefault();\n break;\n case 'ArrowRight':\n adjustDate(1, 1, 1);\n event.preventDefault();\n break;\n case 'ArrowDown':\n adjustDate(7, 4, 4);\n event.preventDefault();\n break;\n default:\n break;\n }\n },\n [adjustDate],\n );\n\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div onKeyDown={handleKeyDown}>\n {mode === 'day' && (\n <DayCalendar\n selectedDate={selectedDate}\n min={min}\n max={max}\n viewMonth={viewMonth}\n viewYear={viewYear}\n monthFormat={monthFormat}\n onSelect={handleSelectedDateUpdate}\n onLabelClick={switchToYears}\n onViewDateUpdate={handleViewDateUpdate}\n />\n )}\n {mode === 'month' && (\n <MonthCalendar\n selectedDate={selectedDate}\n min={min}\n max={max}\n viewYear={viewYear}\n {...(placeholder != null && { placeholder })}\n onSelect={switchToDays}\n onLabelClick={switchToYears}\n onViewDateUpdate={handleViewDateUpdate}\n />\n )}\n {mode === 'year' && (\n <YearCalendar\n selectedDate={selectedDate}\n min={min}\n max={max}\n viewYear={viewYear}\n {...(placeholder != null && { placeholder })}\n onSelect={switchToMonths}\n onViewDateUpdate={handleViewDateUpdate}\n />\n )}\n </div>\n );\n};\n\nexport default Calendar;\n"],"names":["Calendar","value","min","minProp","max","maxProp","monthFormat","MonthFormat","LONG","placeholder","onChange","onSelect","selectedDate","getStartOfDay","useEffect","isWithinRange","moveToWithinRange","getTime","dateView","returnDateView","viewMonth","setViewMonth","useState","getMonth","viewYear","setViewYear","getFullYear","mode","setMode","view","handleViewDateUpdate","useCallback","month","year","undefined","switchToDays","switchToMonths","switchToYears","handleSelectedDateUpdate","date","adjustDate","daysToAdd","monthsToAdd","yearsToAdd","Date","getDate","handleKeyDown","event","key","preventDefault","_jsxs","onKeyDown","children","_jsx","DayCalendar","onLabelClick","onViewDateUpdate","MonthCalendar","YearCalendar"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,QAAQ,GAAGA,CAAC;EAChBC,KAAK;EACLC,GAAG,EAAEC,OAAO,GAAG,IAAI;EACnBC,GAAG,EAAEC,OAAO,GAAG,IAAI;eACnBC,aAAW,GAAGC,uBAAW,CAACC,IAAI;EAC9BC,WAAW;EACXC,QAAQ;AACRC,EAAAA;AAAQ,CACM,KAAI;AAClB,EAAA,MAAMC,YAAY,GAAGC,2BAAa,CAACZ,KAAK,CAAC;AACzC,EAAA,MAAMC,GAAG,GAAGW,2BAAa,CAACV,OAAO,CAAC;AAClC,EAAA,MAAMC,GAAG,GAAGS,2BAAa,CAACR,OAAO,CAAC;AAElCS,EAAAA,eAAS,CAAC,MAAK;IACb,IAAIF,YAAY,IAAI,CAACG,2BAAa,CAACH,YAAY,EAAEV,GAAG,EAAEE,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,QAAAA,WAAW,EAAEA,aAAY;AACzBK,QAAAA,QAAQ,EAAE2B,wBAAyB;AACnCiB,QAAAA,YAAY,EAAElB,aAAc;AAC5BmB,QAAAA,gBAAgB,EAAE1B;OAAqB,CAE1C,EACAH,IAAI,KAAK,OAAO,iBACf0B,cAAA,CAACI,qBAAa,EAAA;AACZ7C,QAAAA,YAAY,EAAEA,YAAa;AAC3BV,QAAAA,GAAG,EAAEA,GAAI;AACTE,QAAAA,GAAG,EAAEA,GAAI;AACToB,QAAAA,QAAQ,EAAEA,QAAS;QAAA,IACdf,WAAW,IAAI,IAAI,IAAI;AAAEA,UAAAA;SAAa,CAAA;AAC3CE,QAAAA,QAAQ,EAAEwB,YAAa;AACvBoB,QAAAA,YAAY,EAAElB,aAAc;AAC5BmB,QAAAA,gBAAgB,EAAE1B;OAAqB,CAE1C,EACAH,IAAI,KAAK,MAAM,iBACd0B,cAAA,CAACK,oBAAY,EAAA;AACX9C,QAAAA,YAAY,EAAEA,YAAa;AAC3BV,QAAAA,GAAG,EAAEA,GAAI;AACTE,QAAAA,GAAG,EAAEA,GAAI;AACToB,QAAAA,QAAQ,EAAEA,QAAS;QAAA,IACdf,WAAW,IAAI,IAAI,IAAI;AAAEA,UAAAA;SAAa,CAAA;AAC3CE,QAAAA,QAAQ,EAAEyB,cAAe;AACzBoB,QAAAA,gBAAgB,EAAE1B;AAAqB,OAAA,CAE1C;KACE;AAAC;AAEV;;;;"}
@@ -32,4 +32,4 @@ var messages = reactIntl.defineMessages({
32
32
  });
33
33
 
34
34
  exports.default = messages;
35
- //# sourceMappingURL=DateLookup.messages.js.map
35
+ //# sourceMappingURL=Calendar.messages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Calendar.messages.js","sources":["../../src/calendar/Calendar.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n next: {\n id: 'neptune.DateLookup.next',\n defaultMessage: 'next',\n description: 'Description of next button',\n },\n previous: {\n id: 'neptune.DateLookup.previous',\n defaultMessage: 'previous',\n description: 'Description of previous button',\n },\n day: {\n id: 'neptune.DateLookup.day',\n defaultMessage: 'day',\n description: 'Description of next/previous/selected day button',\n },\n month: {\n id: 'neptune.DateLookup.month',\n defaultMessage: 'month',\n description: 'Description of next/previous/selected month button',\n },\n year: {\n id: 'neptune.DateLookup.year',\n defaultMessage: 'year',\n description: 'Description of next/previous/selected year button',\n },\n twentyYears: {\n id: 'neptune.DateLookup.twentyYears',\n defaultMessage: '20 years',\n description: 'Description of next/previous 20 years button',\n },\n selected: {\n id: 'neptune.DateLookup.selected',\n defaultMessage: 'selected',\n description: 'Description of the selected day/month/year',\n },\n goTo20YearView: {\n id: 'neptune.DateLookup.goTo20YearView',\n defaultMessage: 'Go to 20 year view',\n description: 'Description of the button to go to 20 year view',\n },\n});\n"],"names":["defineMessages","next","id","previous","day","month","year","twentyYears","selected","goTo20YearView"],"mappings":";;;;;;AAEA,eAAeA,wBAAc,CAAC;AAC5BC,EAAAA,IAAI,EAAE;IACJC,EAAE,EAAA;GAGH;AACDC,EAAAA,QAAQ,EAAE;IACRD,EAAE,EAAA;GAGH;AACDE,EAAAA,GAAG,EAAE;IACHF,EAAE,EAAA;GAGH;AACDG,EAAAA,KAAK,EAAE;IACLH,EAAE,EAAA;GAGH;AACDI,EAAAA,IAAI,EAAE;IACJJ,EAAE,EAAA;GAGH;AACDK,EAAAA,WAAW,EAAE;IACXL,EAAE,EAAA;GAGH;AACDM,EAAAA,QAAQ,EAAE;IACRN,EAAE,EAAA;GAGH;AACDO,EAAAA,cAAc,EAAE;IACdP,EAAE,EAAA;AAGH;AACF,CAAA,CAAC;;;;"}
@@ -28,4 +28,4 @@ var messages = defineMessages({
28
28
  });
29
29
 
30
30
  export { messages as default };
31
- //# sourceMappingURL=DateLookup.messages.mjs.map
31
+ //# sourceMappingURL=Calendar.messages.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Calendar.messages.mjs","sources":["../../src/calendar/Calendar.messages.ts"],"sourcesContent":["import { defineMessages } from 'react-intl';\n\nexport default defineMessages({\n next: {\n id: 'neptune.DateLookup.next',\n defaultMessage: 'next',\n description: 'Description of next button',\n },\n previous: {\n id: 'neptune.DateLookup.previous',\n defaultMessage: 'previous',\n description: 'Description of previous button',\n },\n day: {\n id: 'neptune.DateLookup.day',\n defaultMessage: 'day',\n description: 'Description of next/previous/selected day button',\n },\n month: {\n id: 'neptune.DateLookup.month',\n defaultMessage: 'month',\n description: 'Description of next/previous/selected month button',\n },\n year: {\n id: 'neptune.DateLookup.year',\n defaultMessage: 'year',\n description: 'Description of next/previous/selected year button',\n },\n twentyYears: {\n id: 'neptune.DateLookup.twentyYears',\n defaultMessage: '20 years',\n description: 'Description of next/previous 20 years button',\n },\n selected: {\n id: 'neptune.DateLookup.selected',\n defaultMessage: 'selected',\n description: 'Description of the selected day/month/year',\n },\n goTo20YearView: {\n id: 'neptune.DateLookup.goTo20YearView',\n defaultMessage: 'Go to 20 year view',\n description: 'Description of the button to go to 20 year view',\n },\n});\n"],"names":["defineMessages","next","id","previous","day","month","year","twentyYears","selected","goTo20YearView"],"mappings":";;AAEA,eAAeA,cAAc,CAAC;AAC5BC,EAAAA,IAAI,EAAE;IACJC,EAAE,EAAA;GAGH;AACDC,EAAAA,QAAQ,EAAE;IACRD,EAAE,EAAA;GAGH;AACDE,EAAAA,GAAG,EAAE;IACHF,EAAE,EAAA;GAGH;AACDG,EAAAA,KAAK,EAAE;IACLH,EAAE,EAAA;GAGH;AACDI,EAAAA,IAAI,EAAE;IACJJ,EAAE,EAAA;GAGH;AACDK,EAAAA,WAAW,EAAE;IACXL,EAAE,EAAA;GAGH;AACDM,EAAAA,QAAQ,EAAE;IACRN,EAAE,EAAA;GAGH;AACDO,EAAAA,cAAc,EAAE;IACdP,EAAE,EAAA;AAGH;AACF,CAAA,CAAC;;;;"}
@@ -0,0 +1,155 @@
1
+ import { useEffect, useState, useCallback } from 'react';
2
+ import '../common/theme.mjs';
3
+ import '../common/direction.mjs';
4
+ import '@transferwise/neptune-tokens';
5
+ import '../common/propsValues/control.mjs';
6
+ import '../common/propsValues/size.mjs';
7
+ import '../common/propsValues/typography.mjs';
8
+ import '../common/propsValues/width.mjs';
9
+ import '../common/propsValues/type.mjs';
10
+ import '../common/propsValues/dateMode.mjs';
11
+ import { MonthFormat } from '../common/propsValues/monthFormat.mjs';
12
+ import '../common/propsValues/position.mjs';
13
+ import '../common/propsValues/layouts.mjs';
14
+ import '../common/propsValues/status.mjs';
15
+ import '../common/propsValues/sentiment.mjs';
16
+ import '../common/propsValues/profileType.mjs';
17
+ import '../common/propsValues/variant.mjs';
18
+ import '../common/propsValues/scroll.mjs';
19
+ import '../common/propsValues/markdownNodeType.mjs';
20
+ import '../common/fileType.mjs';
21
+ import '@transferwise/formatting';
22
+ import '@transferwise/icons';
23
+ import 'clsx';
24
+ import 'react-intl';
25
+ import '../common/closeButton/CloseButton.messages.mjs';
26
+ import { jsxs, jsx } from 'react/jsx-runtime';
27
+ import { moveToWithinRange } from '../common/dateUtils/moveToWithinRange/moveToWithinRange.mjs';
28
+ import { isWithinRange } from '../common/dateUtils/isWithinRange/isWithinRange.mjs';
29
+ import { returnDateView } from '../common/dateUtils/getDateView/getDateView.mjs';
30
+ import DayCalendar from './dayCalendar/DayCalendar.mjs';
31
+ import { getStartOfDay } from './getStartOfDay/getStartOfDay.mjs';
32
+ import MonthCalendar from './monthCalendar/MonthCalendar.mjs';
33
+ import YearCalendar from './yearCalendar/YearCalendar.mjs';
34
+
35
+ const Calendar = ({
36
+ value,
37
+ min: minProp = null,
38
+ max: maxProp = null,
39
+ monthFormat = MonthFormat.LONG,
40
+ placeholder,
41
+ onChange,
42
+ onSelect
43
+ }) => {
44
+ const selectedDate = getStartOfDay(value);
45
+ const min = getStartOfDay(minProp);
46
+ const max = getStartOfDay(maxProp);
47
+ useEffect(() => {
48
+ if (selectedDate && !isWithinRange(selectedDate, min, max)) {
49
+ onChange(moveToWithinRange(selectedDate, min, max));
50
+ }
51
+ }, [selectedDate?.getTime(), min?.getTime(), max?.getTime(), onChange]); // eslint-disable-line react-hooks/exhaustive-deps
52
+ const dateView = returnDateView(selectedDate, min, max);
53
+ const [viewMonth, setViewMonth] = useState(dateView.getMonth());
54
+ const [viewYear, setViewYear] = useState(dateView.getFullYear());
55
+ const [mode, setMode] = useState('day');
56
+ useEffect(() => {
57
+ const view = returnDateView(selectedDate, min, max);
58
+ // eslint-disable-next-line react-hooks/set-state-in-effect
59
+ setViewMonth(view.getMonth());
60
+ setViewYear(view.getFullYear());
61
+ }, [selectedDate?.getTime(), min?.getTime(), max?.getTime()]); // eslint-disable-line react-hooks/exhaustive-deps
62
+ const handleViewDateUpdate = useCallback(
63
+ // eslint-disable-next-line react-hooks/preserve-manual-memoization
64
+ ({
65
+ month,
66
+ year
67
+ }) => {
68
+ if (month !== undefined) setViewMonth(month);
69
+ if (year !== undefined) setViewYear(year);
70
+ }, []);
71
+ const switchToDays = useCallback(() => setMode('day'), []);
72
+ const switchToMonths = useCallback(() => setMode('month'), []);
73
+ const switchToYears = useCallback(() => setMode('year'), []);
74
+ const handleSelectedDateUpdate = useCallback(date => {
75
+ if (onSelect) {
76
+ onSelect(date);
77
+ } else {
78
+ onChange(date);
79
+ }
80
+ }, [onChange, onSelect]);
81
+ const adjustDate = useCallback((daysToAdd, monthsToAdd, yearsToAdd) => {
82
+ let date;
83
+ if (selectedDate) {
84
+ date = new Date(mode === 'year' ? selectedDate.getFullYear() + yearsToAdd : selectedDate.getFullYear(), mode === 'month' ? selectedDate.getMonth() + monthsToAdd : selectedDate.getMonth(), mode === 'day' ? selectedDate.getDate() + daysToAdd : selectedDate.getDate());
85
+ } else {
86
+ date = getStartOfDay(new Date());
87
+ }
88
+ date &&= moveToWithinRange(date, min, max);
89
+ if (date?.getTime() !== selectedDate?.getTime()) {
90
+ onChange(date);
91
+ }
92
+ }, [selectedDate, min, max, mode, onChange]);
93
+ const handleKeyDown = useCallback(event => {
94
+ switch (event.key) {
95
+ case 'ArrowLeft':
96
+ adjustDate(-1, -1, -1);
97
+ event.preventDefault();
98
+ break;
99
+ case 'ArrowUp':
100
+ adjustDate(-7, -4, -4);
101
+ event.preventDefault();
102
+ break;
103
+ case 'ArrowRight':
104
+ adjustDate(1, 1, 1);
105
+ event.preventDefault();
106
+ break;
107
+ case 'ArrowDown':
108
+ adjustDate(7, 4, 4);
109
+ event.preventDefault();
110
+ break;
111
+ }
112
+ }, [adjustDate]);
113
+ return (
114
+ /*#__PURE__*/
115
+ // eslint-disable-next-line jsx-a11y/no-static-element-interactions
116
+ jsxs("div", {
117
+ onKeyDown: handleKeyDown,
118
+ children: [mode === 'day' && /*#__PURE__*/jsx(DayCalendar, {
119
+ selectedDate: selectedDate,
120
+ min: min,
121
+ max: max,
122
+ viewMonth: viewMonth,
123
+ viewYear: viewYear,
124
+ monthFormat: monthFormat,
125
+ onSelect: handleSelectedDateUpdate,
126
+ onLabelClick: switchToYears,
127
+ onViewDateUpdate: handleViewDateUpdate
128
+ }), mode === 'month' && /*#__PURE__*/jsx(MonthCalendar, {
129
+ selectedDate: selectedDate,
130
+ min: min,
131
+ max: max,
132
+ viewYear: viewYear,
133
+ ...(placeholder != null && {
134
+ placeholder
135
+ }),
136
+ onSelect: switchToDays,
137
+ onLabelClick: switchToYears,
138
+ onViewDateUpdate: handleViewDateUpdate
139
+ }), mode === 'year' && /*#__PURE__*/jsx(YearCalendar, {
140
+ selectedDate: selectedDate,
141
+ min: min,
142
+ max: max,
143
+ viewYear: viewYear,
144
+ ...(placeholder != null && {
145
+ placeholder
146
+ }),
147
+ onSelect: switchToMonths,
148
+ onViewDateUpdate: handleViewDateUpdate
149
+ })]
150
+ })
151
+ );
152
+ };
153
+
154
+ export { Calendar as default };
155
+ //# sourceMappingURL=Calendar.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Calendar.mjs","sources":["../../src/calendar/Calendar.tsx"],"sourcesContent":["import { useState, useCallback, useEffect, KeyboardEvent } from 'react';\n\nimport { MonthFormat } from '../common';\nimport { isWithinRange, moveToWithinRange, returnDateView } from '../common/dateUtils';\nimport DayCalendar from './dayCalendar';\nimport { getStartOfDay } from './getStartOfDay';\nimport MonthCalendar from './monthCalendar';\nimport YearCalendar from './yearCalendar';\n\nexport interface CalendarProps {\n value: Date | null;\n min?: Date | null;\n max?: Date | null;\n monthFormat?: `${MonthFormat}`;\n placeholder?: string;\n onChange: (date: Date | null) => void;\n onSelect?: (date: Date) => void;\n}\n\nconst Calendar = ({\n value,\n min: minProp = null,\n max: maxProp = null,\n monthFormat = MonthFormat.LONG,\n placeholder,\n onChange,\n onSelect,\n}: CalendarProps) => {\n const selectedDate = getStartOfDay(value);\n const min = getStartOfDay(minProp);\n const max = getStartOfDay(maxProp);\n\n useEffect(() => {\n if (selectedDate && !isWithinRange(selectedDate, min, max)) {\n onChange(moveToWithinRange(selectedDate, min, max));\n }\n }, [selectedDate?.getTime(), min?.getTime(), max?.getTime(), onChange]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const dateView = returnDateView(selectedDate, min, max);\n const [viewMonth, setViewMonth] = useState(dateView.getMonth());\n const [viewYear, setViewYear] = useState(dateView.getFullYear());\n const [mode, setMode] = useState<'day' | 'month' | 'year'>('day');\n\n useEffect(() => {\n const view = returnDateView(selectedDate, min, max);\n // eslint-disable-next-line react-hooks/set-state-in-effect\n setViewMonth(view.getMonth());\n\n setViewYear(view.getFullYear());\n }, [selectedDate?.getTime(), min?.getTime(), max?.getTime()]); // eslint-disable-line react-hooks/exhaustive-deps\n\n const handleViewDateUpdate = useCallback(\n // eslint-disable-next-line react-hooks/preserve-manual-memoization\n ({ month, year }: { month?: number; year?: number }) => {\n if (month !== undefined) setViewMonth(month);\n if (year !== undefined) setViewYear(year);\n },\n [],\n );\n\n const switchToDays = useCallback(() => setMode('day'), []);\n const switchToMonths = useCallback(() => setMode('month'), []);\n const switchToYears = useCallback(() => setMode('year'), []);\n\n const handleSelectedDateUpdate = useCallback(\n (date: Date) => {\n if (onSelect) {\n onSelect(date);\n } else {\n onChange(date);\n }\n },\n [onChange, onSelect],\n );\n\n const adjustDate = useCallback(\n (daysToAdd: number, monthsToAdd: number, yearsToAdd: number) => {\n let date: Date | null;\n if (selectedDate) {\n date = new Date(\n mode === 'year' ? selectedDate.getFullYear() + yearsToAdd : selectedDate.getFullYear(),\n mode === 'month' ? selectedDate.getMonth() + monthsToAdd : selectedDate.getMonth(),\n mode === 'day' ? selectedDate.getDate() + daysToAdd : selectedDate.getDate(),\n );\n } else {\n date = getStartOfDay(new Date());\n }\n date &&= moveToWithinRange(date, min, max);\n if (date?.getTime() !== selectedDate?.getTime()) {\n onChange(date);\n }\n },\n [selectedDate, min, max, mode, onChange],\n );\n\n const handleKeyDown = useCallback(\n (event: KeyboardEvent<HTMLDivElement>) => {\n switch (event.key) {\n case 'ArrowLeft':\n adjustDate(-1, -1, -1);\n event.preventDefault();\n break;\n case 'ArrowUp':\n adjustDate(-7, -4, -4);\n event.preventDefault();\n break;\n case 'ArrowRight':\n adjustDate(1, 1, 1);\n event.preventDefault();\n break;\n case 'ArrowDown':\n adjustDate(7, 4, 4);\n event.preventDefault();\n break;\n default:\n break;\n }\n },\n [adjustDate],\n );\n\n return (\n // eslint-disable-next-line jsx-a11y/no-static-element-interactions\n <div onKeyDown={handleKeyDown}>\n {mode === 'day' && (\n <DayCalendar\n selectedDate={selectedDate}\n min={min}\n max={max}\n viewMonth={viewMonth}\n viewYear={viewYear}\n monthFormat={monthFormat}\n onSelect={handleSelectedDateUpdate}\n onLabelClick={switchToYears}\n onViewDateUpdate={handleViewDateUpdate}\n />\n )}\n {mode === 'month' && (\n <MonthCalendar\n selectedDate={selectedDate}\n min={min}\n max={max}\n viewYear={viewYear}\n {...(placeholder != null && { placeholder })}\n onSelect={switchToDays}\n onLabelClick={switchToYears}\n onViewDateUpdate={handleViewDateUpdate}\n />\n )}\n {mode === 'year' && (\n <YearCalendar\n selectedDate={selectedDate}\n min={min}\n max={max}\n viewYear={viewYear}\n {...(placeholder != null && { placeholder })}\n onSelect={switchToMonths}\n onViewDateUpdate={handleViewDateUpdate}\n />\n )}\n </div>\n );\n};\n\nexport default Calendar;\n"],"names":["Calendar","value","min","minProp","max","maxProp","monthFormat","MonthFormat","LONG","placeholder","onChange","onSelect","selectedDate","getStartOfDay","useEffect","isWithinRange","moveToWithinRange","getTime","dateView","returnDateView","viewMonth","setViewMonth","useState","getMonth","viewYear","setViewYear","getFullYear","mode","setMode","view","handleViewDateUpdate","useCallback","month","year","undefined","switchToDays","switchToMonths","switchToYears","handleSelectedDateUpdate","date","adjustDate","daysToAdd","monthsToAdd","yearsToAdd","Date","getDate","handleKeyDown","event","key","preventDefault","_jsxs","onKeyDown","children","_jsx","DayCalendar","onLabelClick","onViewDateUpdate","MonthCalendar","YearCalendar"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,QAAQ,GAAGA,CAAC;EAChBC,KAAK;EACLC,GAAG,EAAEC,OAAO,GAAG,IAAI;EACnBC,GAAG,EAAEC,OAAO,GAAG,IAAI;EACnBC,WAAW,GAAGC,WAAW,CAACC,IAAI;EAC9BC,WAAW;EACXC,QAAQ;AACRC,EAAAA;AAAQ,CACM,KAAI;AAClB,EAAA,MAAMC,YAAY,GAAGC,aAAa,CAACZ,KAAK,CAAC;AACzC,EAAA,MAAMC,GAAG,GAAGW,aAAa,CAACV,OAAO,CAAC;AAClC,EAAA,MAAMC,GAAG,GAAGS,aAAa,CAACR,OAAO,CAAC;AAElCS,EAAAA,SAAS,CAAC,MAAK;IACb,IAAIF,YAAY,IAAI,CAACG,aAAa,CAACH,YAAY,EAAEV,GAAG,EAAEE,GAAG,CAAC,EAAE;MAC1DM,QAAQ,CAACM,iBAAiB,CAACJ,YAAY,EAAEV,GAAG,EAAEE,GAAG,CAAC,CAAC;AACrD,IAAA;EACF,CAAC,EAAE,CAACQ,YAAY,EAAEK,OAAO,EAAE,EAAEf,GAAG,EAAEe,OAAO,EAAE,EAAE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C,QAAAA,YAAY,EAAEA,YAAa;AAC3BV,QAAAA,GAAG,EAAEA,GAAI;AACTE,QAAAA,GAAG,EAAEA,GAAI;AACToB,QAAAA,QAAQ,EAAEA,QAAS;QAAA,IACdf,WAAW,IAAI,IAAI,IAAI;AAAEA,UAAAA;SAAa,CAAA;AAC3CE,QAAAA,QAAQ,EAAEwB,YAAa;AACvBoB,QAAAA,YAAY,EAAElB,aAAc;AAC5BmB,QAAAA,gBAAgB,EAAE1B;OAAqB,CAE1C,EACAH,IAAI,KAAK,MAAM,iBACd0B,GAAA,CAACK,YAAY,EAAA;AACX9C,QAAAA,YAAY,EAAEA,YAAa;AAC3BV,QAAAA,GAAG,EAAEA,GAAI;AACTE,QAAAA,GAAG,EAAEA,GAAI;AACToB,QAAAA,QAAQ,EAAEA,QAAS;QAAA,IACdf,WAAW,IAAI,IAAI,IAAI;AAAEA,UAAAA;SAAa,CAAA;AAC3CE,QAAAA,QAAQ,EAAEyB,cAAe;AACzBoB,QAAAA,gBAAgB,EAAE1B;AAAqB,OAAA,CAE1C;KACE;AAAC;AAEV;;;;"}
@@ -32,7 +32,7 @@ require('@transferwise/neptune-validation');
32
32
  require('../../provider/direction/DirectionProvider.js');
33
33
  var useLayout = require('../../common/hooks/useLayout/useLayout.js');
34
34
  var Title = require('../../title/Title.js');
35
- var DateLookup_messages = require('../DateLookup.messages.js');
35
+ var Calendar_messages = require('../Calendar.messages.js');
36
36
  var Button = require('../../button/Button.js');
37
37
  var IconButton = require('../../iconButton/IconButton.js');
38
38
 
@@ -55,7 +55,7 @@ const DateHeader = ({
55
55
  size: 40,
56
56
  priority: "minimal",
57
57
  className: "d-inline-flex",
58
- "aria-label": `${intl.formatMessage(DateLookup_messages.default.previous)} ${dateMode}`,
58
+ "aria-label": `${intl.formatMessage(Calendar_messages.default.previous)} ${dateMode}`,
59
59
  onClick: onPreviousClick,
60
60
  children: /*#__PURE__*/jsxRuntime.jsx(icons.ChevronLeft, {
61
61
  className: "left-single-direction"
@@ -70,7 +70,7 @@ const DateHeader = ({
70
70
  type: "button",
71
71
  priority: "tertiary",
72
72
  className: "tw-date-lookup-header-current",
73
- "aria-label": intl.formatMessage(DateLookup_messages.default.goTo20YearView),
73
+ "aria-label": intl.formatMessage(Calendar_messages.default.goTo20YearView),
74
74
  addonEnd: {
75
75
  type: 'icon',
76
76
  value: /*#__PURE__*/jsxRuntime.jsx(icons.ChevronDown, {})
@@ -83,7 +83,7 @@ const DateHeader = ({
83
83
  children: /*#__PURE__*/jsxRuntime.jsx(IconButton.default, {
84
84
  size: 40,
85
85
  className: "d-inline-flex",
86
- "aria-label": `${intl.formatMessage(DateLookup_messages.default.next)} ${dateMode}`,
86
+ "aria-label": `${intl.formatMessage(Calendar_messages.default.next)} ${dateMode}`,
87
87
  priority: "minimal",
88
88
  onClick: onNextClick,
89
89
  children: /*#__PURE__*/jsxRuntime.jsx(icons.ChevronRight, {
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateHeader.js","sources":["../../../src/calendar/dateHeader/DateHeader.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { Typography } from '../../common';\nimport { useLayout } from '../../common/hooks';\nimport Title from '../../title';\nimport messages from '../Calendar.messages';\nimport Button from '../../button/Button';\nimport { ChevronDown, ChevronLeft, ChevronRight } from '@transferwise/icons';\nimport IconButton from '../../iconButton';\n\ninterface DateHeaderProps {\n label?: string;\n onLabelClick?: () => void;\n onPreviousClick: () => void;\n onNextClick: () => void;\n dateMode: string;\n}\n\nconst DateHeader: React.FC<DateHeaderProps> = ({\n label,\n onLabelClick,\n onPreviousClick,\n onNextClick,\n dateMode,\n}) => {\n const intl = useIntl();\n const { isMobile } = useLayout();\n return (\n <div className={clsx('text-xs-center', !isMobile && ['clearfix', 'p-y-1'])}>\n <div className=\"pull-left-single-direction\">\n <IconButton\n size={40}\n priority=\"minimal\"\n className=\"d-inline-flex\"\n aria-label={`${intl.formatMessage(messages.previous)} ${dateMode}`}\n onClick={onPreviousClick}\n >\n <ChevronLeft className=\"left-single-direction\" />\n </IconButton>\n </div>\n {label && (\n <Title type={Typography.TITLE_BODY} className=\"tw-date-lookup-header-current-container\">\n <Button\n v2\n size=\"md\"\n type=\"button\"\n priority=\"tertiary\"\n className=\"tw-date-lookup-header-current\"\n aria-label={intl.formatMessage(messages.goTo20YearView)}\n addonEnd={{ type: 'icon', value: <ChevronDown /> }}\n onClick={onLabelClick}\n >\n {label}\n </Button>\n </Title>\n )}\n <div className=\"pull-right-single-direction\">\n <IconButton\n size={40}\n className=\"d-inline-flex\"\n aria-label={`${intl.formatMessage(messages.next)} ${dateMode}`}\n priority=\"minimal\"\n onClick={onNextClick}\n >\n <ChevronRight className=\"right-single-direction\" />\n </IconButton>\n </div>\n </div>\n );\n};\n\nexport default DateHeader;\n"],"names":["DateHeader","label","onLabelClick","onPreviousClick","onNextClick","dateMode","intl","useIntl","isMobile","useLayout","_jsxs","className","clsx","children","_jsx","IconButton","size","priority","formatMessage","messages","previous","onClick","ChevronLeft","Title","type","Typography","TITLE_BODY","Button","v2","goTo20YearView","addonEnd","value","ChevronDown","next","ChevronRight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,UAAU,GAA8BA,CAAC;EAC7CC,KAAK;EACLC,YAAY;EACZC,eAAe;EACfC,WAAW;AACXC,EAAAA;AAAQ,CACT,KAAI;AACH,EAAA,MAAMC,IAAI,GAAGC,iBAAO,EAAE;EACtB,MAAM;AAAEC,IAAAA;GAAU,GAAGC,mBAAS,EAAE;AAChC,EAAA,oBACEC,eAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAEC,SAAI,CAAC,gBAAgB,EAAE,CAACJ,QAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAE;AAAAK,IAAAA,QAAA,gBACzEC,cAAA,CAAA,KAAA,EAAA;AAAKH,MAAAA,SAAS,EAAC,4BAA4B;MAAAE,QAAA,eACz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I,CAAC,CAAA,CAAA,EAAI5B,QAAQ,CAAA,CAAG;AAC/DY,QAAAA,QAAQ,EAAC,SAAS;AAClBI,QAAAA,OAAO,EAAEjB,WAAY;QAAAS,QAAA,eAErBC,cAAA,CAACoB,kBAAY,EAAA;AAACvB,UAAAA,SAAS,EAAC;SAAwB;OACtC;AACd,KAAK,CACP;AAAA,GAAK,CAAC;AAEV;;;;"}
@@ -28,7 +28,7 @@ import '@transferwise/neptune-validation';
28
28
  import '../../provider/direction/DirectionProvider.mjs';
29
29
  import { useLayout } from '../../common/hooks/useLayout/useLayout.mjs';
30
30
  import Title from '../../title/Title.mjs';
31
- import messages from '../DateLookup.messages.mjs';
31
+ import messages from '../Calendar.messages.mjs';
32
32
  import Button from '../../button/Button.mjs';
33
33
  import IconButton from '../../iconButton/IconButton.mjs';
34
34
 
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DateHeader.mjs","sources":["../../../src/calendar/dateHeader/DateHeader.tsx"],"sourcesContent":["import { clsx } from 'clsx';\nimport { useIntl } from 'react-intl';\n\nimport { Typography } from '../../common';\nimport { useLayout } from '../../common/hooks';\nimport Title from '../../title';\nimport messages from '../Calendar.messages';\nimport Button from '../../button/Button';\nimport { ChevronDown, ChevronLeft, ChevronRight } from '@transferwise/icons';\nimport IconButton from '../../iconButton';\n\ninterface DateHeaderProps {\n label?: string;\n onLabelClick?: () => void;\n onPreviousClick: () => void;\n onNextClick: () => void;\n dateMode: string;\n}\n\nconst DateHeader: React.FC<DateHeaderProps> = ({\n label,\n onLabelClick,\n onPreviousClick,\n onNextClick,\n dateMode,\n}) => {\n const intl = useIntl();\n const { isMobile } = useLayout();\n return (\n <div className={clsx('text-xs-center', !isMobile && ['clearfix', 'p-y-1'])}>\n <div className=\"pull-left-single-direction\">\n <IconButton\n size={40}\n priority=\"minimal\"\n className=\"d-inline-flex\"\n aria-label={`${intl.formatMessage(messages.previous)} ${dateMode}`}\n onClick={onPreviousClick}\n >\n <ChevronLeft className=\"left-single-direction\" />\n </IconButton>\n </div>\n {label && (\n <Title type={Typography.TITLE_BODY} className=\"tw-date-lookup-header-current-container\">\n <Button\n v2\n size=\"md\"\n type=\"button\"\n priority=\"tertiary\"\n className=\"tw-date-lookup-header-current\"\n aria-label={intl.formatMessage(messages.goTo20YearView)}\n addonEnd={{ type: 'icon', value: <ChevronDown /> }}\n onClick={onLabelClick}\n >\n {label}\n </Button>\n </Title>\n )}\n <div className=\"pull-right-single-direction\">\n <IconButton\n size={40}\n className=\"d-inline-flex\"\n aria-label={`${intl.formatMessage(messages.next)} ${dateMode}`}\n priority=\"minimal\"\n onClick={onNextClick}\n >\n <ChevronRight className=\"right-single-direction\" />\n </IconButton>\n </div>\n </div>\n );\n};\n\nexport default DateHeader;\n"],"names":["DateHeader","label","onLabelClick","onPreviousClick","onNextClick","dateMode","intl","useIntl","isMobile","useLayout","_jsxs","className","clsx","children","_jsx","IconButton","size","priority","formatMessage","messages","previous","onClick","ChevronLeft","Title","type","Typography","TITLE_BODY","Button","v2","goTo20YearView","addonEnd","value","ChevronDown","next","ChevronRight"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBA,MAAMA,UAAU,GAA8BA,CAAC;EAC7CC,KAAK;EACLC,YAAY;EACZC,eAAe;EACfC,WAAW;AACXC,EAAAA;AAAQ,CACT,KAAI;AACH,EAAA,MAAMC,IAAI,GAAGC,OAAO,EAAE;EACtB,MAAM;AAAEC,IAAAA;GAAU,GAAGC,SAAS,EAAE;AAChC,EAAA,oBACEC,IAAA,CAAA,KAAA,EAAA;AAAKC,IAAAA,SAAS,EAAEC,IAAI,CAAC,gBAAgB,EAAE,CAACJ,QAAQ,IAAI,CAAC,UAAU,EAAE,OAAO,CAAC,CAAE;AAAAK,IAAAA,QAAA,gBACzEC,GAAA,CAAA,KAAA,EAAA;AAAKH,MAAAA,SAAS,EAAC,4BAA4B;MAAAE,QAAA,eACzCC,GAAA,CAACC,UAAU,EAAA;AACTC,QAAAA,IAAI,EA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AAA,QAAQ,EAAC,SAAS;AAClBI,QAAAA,OAAO,EAAEjB,WAAY;QAAAS,QAAA,eAErBC,GAAA,CAACoB,YAAY,EAAA;AAACvB,UAAAA,SAAS,EAAC;SAAwB;OACtC;AACd,KAAK,CACP;AAAA,GAAK,CAAC;AAEV;;;;"}
@@ -5,7 +5,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var formatting = require('@transferwise/formatting');
6
6
  var React = require('react');
7
7
  var reactIntl = require('react-intl');
8
- var DateLookup_messages = require('../DateLookup.messages.js');
8
+ var Calendar_messages = require('../Calendar.messages.js');
9
9
  var DateHeader = require('../dateHeader/DateHeader.js');
10
10
  var DayCalendarTable = require('./table/DayCalendarTable.js');
11
11
  var jsxRuntime = require('react/jsx-runtime');
@@ -52,7 +52,7 @@ let DayCalendar$1 = class DayCalendar extends React.PureComponent {
52
52
  month: monthFormat,
53
53
  year: 'numeric'
54
54
  }),
55
- dateMode: formatMessage(DateLookup_messages.default.month),
55
+ dateMode: formatMessage(Calendar_messages.default.month),
56
56
  onLabelClick: onLabelClick,
57
57
  onPreviousClick: this.selectPreviousMonth,
58
58
  onNextClick: this.selectNextMonth
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DayCalendar.js","sources":["../../../src/calendar/dayCalendar/DayCalendar.tsx"],"sourcesContent":["import { formatDate } from '@transferwise/formatting';\nimport { PureComponent } from 'react';\nimport { injectIntl, WrappedComponentProps } from 'react-intl';\n\nimport { MonthFormat } from '../../common';\nimport messages from '../Calendar.messages';\nimport DateHeader from '../dateHeader';\n\nimport DayCalendarTable from './table';\n\ninterface DayCalendarProps extends WrappedComponentProps {\n selectedDate: Date | null;\n min: Date | null;\n max: Date | null;\n viewMonth: number;\n viewYear: number;\n monthFormat: `${MonthFormat}`;\n onSelect: (date: Date) => void;\n onLabelClick: () => void;\n onViewDateUpdate: (date: { month: number; year: number }) => void;\n}\n\nclass DayCalendar extends PureComponent<DayCalendarProps> {\n selectPreviousMonth = () => {\n const { viewMonth, viewYear } = this.props;\n this.props.onViewDateUpdate({\n month: viewMonth <= 0 ? 11 : viewMonth - 1,\n year: viewMonth <= 0 ? viewYear - 1 : viewYear,\n });\n };\n\n selectNextMonth = () => {\n const { viewMonth, viewYear } = this.props;\n this.props.onViewDateUpdate({\n month: viewMonth >= 11 ? 0 : viewMonth + 1,\n year: viewMonth >= 11 ? viewYear + 1 : viewYear,\n });\n };\n\n render() {\n const {\n selectedDate,\n min,\n max,\n viewMonth,\n viewYear,\n intl: { locale, formatMessage },\n monthFormat,\n onLabelClick,\n onSelect,\n } = this.props;\n return (\n <>\n <DateHeader\n label={formatDate(new Date(viewYear, viewMonth), locale, {\n month: monthFormat,\n year: 'numeric',\n })}\n dateMode={formatMessage(messages.month)}\n onLabelClick={onLabelClick}\n onPreviousClick={this.selectPreviousMonth}\n onNextClick={this.selectNextMonth}\n />\n <DayCalendarTable {...{ selectedDate, min, max, viewMonth, viewYear, onSelect }} />\n </>\n );\n }\n}\n\nexport default injectIntl(DayCalendar);\n"],"names":["DayCalendar","PureComponent","selectPreviousMonth","viewMonth","viewYear","props","onViewDateUpdate","month","year","selectNextMonth","render","selectedDate","min","max","intl","locale","formatMessage","monthFormat","onLabelClick","onSelect","_jsxs","_Fragment","children","_jsx","DateHeader","label","formatDate","Date","dateMode","messages","onPreviousClick","onNextClick","DayCalendarTable","injectIntl"],"mappings":";;;;;;;;;;;;oBAsBA,MAAMA,WAAY,SAAQC,mBAA+B,CAAA;EACvDC,mBAAmB,GAAGA,MAAK;IACzB,MAAM;MAAEC,SAAS;AAAEC,MAAAA;KAAU,GAAG,IAAI,CAACC,KAAK;AAC1C,IAAA,IAAI,CAACA,KAAK,CAACC,gBAAgB,CAAC;MAC1BC,KAAK,EAAEJ,SAAS,IAAI,CAAC,GAAG,EAAE,GAAGA,SAAS,GAAG,CAAC;MAC1CK,IAAI,EAAEL,SAAS,IAAI,CAAC,GAAGC,QAAQ,GAAG,CAAC,GAAGA;AACvC,KAAA,CAAC;E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CAACjC,aAAW,CAAC;;;;"}
@@ -1,7 +1,7 @@
1
1
  import { formatDate } from '@transferwise/formatting';
2
2
  import { PureComponent } from 'react';
3
3
  import { injectIntl } from 'react-intl';
4
- import messages from '../DateLookup.messages.mjs';
4
+ import messages from '../Calendar.messages.mjs';
5
5
  import DateHeader from '../dateHeader/DateHeader.mjs';
6
6
  import DayCalendarTable from './table/DayCalendarTable.mjs';
7
7
  import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DayCalendar.mjs","sources":["../../../src/calendar/dayCalendar/DayCalendar.tsx"],"sourcesContent":["import { formatDate } from '@transferwise/formatting';\nimport { PureComponent } from 'react';\nimport { injectIntl, WrappedComponentProps } from 'react-intl';\n\nimport { MonthFormat } from '../../common';\nimport messages from '../Calendar.messages';\nimport DateHeader from '../dateHeader';\n\nimport DayCalendarTable from './table';\n\ninterface DayCalendarProps extends WrappedComponentProps {\n selectedDate: Date | null;\n min: Date | null;\n max: Date | null;\n viewMonth: number;\n viewYear: number;\n monthFormat: `${MonthFormat}`;\n onSelect: (date: Date) => void;\n onLabelClick: () => void;\n onViewDateUpdate: (date: { month: number; year: number }) => void;\n}\n\nclass DayCalendar extends PureComponent<DayCalendarProps> {\n selectPreviousMonth = () => {\n const { viewMonth, viewYear } = this.props;\n this.props.onViewDateUpdate({\n month: viewMonth <= 0 ? 11 : viewMonth - 1,\n year: viewMonth <= 0 ? viewYear - 1 : viewYear,\n });\n };\n\n selectNextMonth = () => {\n const { viewMonth, viewYear } = this.props;\n this.props.onViewDateUpdate({\n month: viewMonth >= 11 ? 0 : viewMonth + 1,\n year: viewMonth >= 11 ? viewYear + 1 : viewYear,\n });\n };\n\n render() {\n const {\n selectedDate,\n min,\n max,\n viewMonth,\n viewYear,\n intl: { locale, formatMessage },\n monthFormat,\n onLabelClick,\n onSelect,\n } = this.props;\n return (\n <>\n <DateHeader\n label={formatDate(new Date(viewYear, viewMonth), locale, {\n month: monthFormat,\n year: 'numeric',\n })}\n dateMode={formatMessage(messages.month)}\n onLabelClick={onLabelClick}\n onPreviousClick={this.selectPreviousMonth}\n onNextClick={this.selectNextMonth}\n />\n <DayCalendarTable {...{ selectedDate, min, max, viewMonth, viewYear, onSelect }} />\n </>\n );\n }\n}\n\nexport default injectIntl(DayCalendar);\n"],"names":["DayCalendar","PureComponent","selectPreviousMonth","viewMonth","viewYear","props","onViewDateUpdate","month","year","selectNextMonth","render","selectedDate","min","max","intl","locale","formatMessage","monthFormat","onLabelClick","onSelect","_jsxs","_Fragment","children","_jsx","DateHeader","label","formatDate","Date","dateMode","messages","onPreviousClick","onNextClick","DayCalendarTable","injectIntl"],"mappings":";;;;;;;;AAsBA,MAAMA,WAAY,SAAQC,aAA+B,CAAA;EACvDC,mBAAmB,GAAGA,MAAK;IACzB,MAAM;MAAEC,SAAS;AAAEC,MAAAA;KAAU,GAAG,IAAI,CAACC,KAAK;AAC1C,IAAA,IAAI,CAACA,KAAK,CAACC,gBAAgB,CAAC;MAC1BC,KAAK,EAAEJ,SAAS,IAAI,CAAC,GAAG,EAAE,GAAGA,SAAS,GAAG,CAAC;MAC1CK,IAAI,EAAEL,SAAS,IAAI,CAAC,GAAGC,QAAQ,GAAG,CAAC,GAAGA;AACvC,KAAA,CAAC;EACJ,CAAC;EAEDK,eAAe,GAAGA,MAAK;IACrB,MAAM;MAAEN,SAAS;AAAEC,MAAAA;KAAU,GAAG,IAAI,CAACC,KAAK;AAC1C,IAAA,IAAI,CAACA,KAAK,CAACC,gBAAgB,CAAC;MAC1BC,KAAK,EAAEJ,SAAS,IAAI,EAAE,GAAG,CAAC,GAAGA,SAAS,GAAG,CAAC;MAC1CK,IAAI,EAAEL,SAAS,IAAI,EAAE,GAAGC,QAAQ,GAAG,CAAC,GAAGA;AACxC,KAAA,CAAC;EACJ,CAAC;AAEDM,EAAAA,MAAMA,GAAA;IACJ,MAAM;MACJC,YAAY;MACZC,GAAG;MACHC,GAAG;MACHV,SAAS;MACT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