@transferwise/components 0.0.0-experimental-c1f5b0b → 0.0.0-experimental-fe160ab

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 (493) hide show
  1. package/build/Calendar/Calendar.constants.js +10 -0
  2. package/build/Calendar/Calendar.constants.js.map +1 -0
  3. package/build/Calendar/Calendar.constants.mjs +8 -0
  4. package/build/Calendar/Calendar.constants.mjs.map +1 -0
  5. package/build/Calendar/Calendar.js +116 -16
  6. package/build/Calendar/Calendar.js.map +1 -1
  7. package/build/Calendar/Calendar.messages.js +12 -0
  8. package/build/Calendar/Calendar.messages.js.map +1 -1
  9. package/build/Calendar/Calendar.messages.mjs +12 -0
  10. package/build/Calendar/Calendar.messages.mjs.map +1 -1
  11. package/build/Calendar/Calendar.mjs +117 -17
  12. package/build/Calendar/Calendar.mjs.map +1 -1
  13. package/build/Calendar/DateHeader/DateHeader.js +5 -1
  14. package/build/Calendar/DateHeader/DateHeader.js.map +1 -1
  15. package/build/Calendar/DateHeader/DateHeader.mjs +5 -1
  16. package/build/Calendar/DateHeader/DateHeader.mjs.map +1 -1
  17. package/build/Calendar/DayCalendar/DayCalendar.js +20 -2
  18. package/build/Calendar/DayCalendar/DayCalendar.js.map +1 -1
  19. package/build/Calendar/DayCalendar/DayCalendar.mjs +20 -2
  20. package/build/Calendar/DayCalendar/DayCalendar.mjs.map +1 -1
  21. package/build/Calendar/DayCalendar/Table/DayCalendarTable.js +60 -19
  22. package/build/Calendar/DayCalendar/Table/DayCalendarTable.js.map +1 -1
  23. package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs +60 -19
  24. package/build/Calendar/DayCalendar/Table/DayCalendarTable.mjs.map +1 -1
  25. package/build/Calendar/MonthCalendar/MonthCalendar.js +6 -0
  26. package/build/Calendar/MonthCalendar/MonthCalendar.js.map +1 -1
  27. package/build/Calendar/MonthCalendar/MonthCalendar.mjs +6 -0
  28. package/build/Calendar/MonthCalendar/MonthCalendar.mjs.map +1 -1
  29. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js +8 -3
  30. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.js.map +1 -1
  31. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs +8 -3
  32. package/build/Calendar/MonthCalendar/Table/MonthCalendarTable.mjs.map +1 -1
  33. package/build/Calendar/TableLink/TableLink.js +91 -0
  34. package/build/Calendar/TableLink/TableLink.js.map +1 -0
  35. package/build/Calendar/TableLink/TableLink.mjs +87 -0
  36. package/build/Calendar/TableLink/TableLink.mjs.map +1 -0
  37. package/build/Calendar/YearCalendar/Table/YearCalendarTable.js +8 -3
  38. package/build/Calendar/YearCalendar/Table/YearCalendarTable.js.map +1 -1
  39. package/build/Calendar/YearCalendar/Table/YearCalendarTable.mjs +8 -3
  40. package/build/Calendar/YearCalendar/Table/YearCalendarTable.mjs.map +1 -1
  41. package/build/Calendar/YearCalendar/YearCalendar.js +7 -0
  42. package/build/Calendar/YearCalendar/YearCalendar.js.map +1 -1
  43. package/build/Calendar/YearCalendar/YearCalendar.mjs +7 -0
  44. package/build/Calendar/YearCalendar/YearCalendar.mjs.map +1 -1
  45. package/build/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.js +33 -0
  46. package/build/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.js.map +1 -0
  47. package/build/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.mjs +31 -0
  48. package/build/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.mjs.map +1 -0
  49. package/build/Calendar/_helpers/isDateDisabled/isDateDisabled.js +40 -0
  50. package/build/Calendar/_helpers/isDateDisabled/isDateDisabled.js.map +1 -0
  51. package/build/Calendar/_helpers/isDateDisabled/isDateDisabled.mjs +38 -0
  52. package/build/Calendar/_helpers/isDateDisabled/isDateDisabled.mjs.map +1 -0
  53. package/build/DateLookup/DateLookup.js +20 -9
  54. package/build/DateLookup/DateLookup.js.map +1 -1
  55. package/build/DateLookup/DateLookup.mjs +20 -9
  56. package/build/DateLookup/DateLookup.mjs.map +1 -1
  57. package/build/i18n/en.json +4 -0
  58. package/build/i18n/en.json.js +4 -0
  59. package/build/i18n/en.json.js.map +1 -1
  60. package/build/i18n/en.json.mjs +4 -0
  61. package/build/i18n/en.json.mjs.map +1 -1
  62. package/build/index.js +2 -2
  63. package/build/index.mjs +1 -1
  64. package/build/main.css +8798 -4478
  65. package/build/styles/Accordion/Accordion.css +21 -23
  66. package/build/styles/AvatarLayout/AvatarLayout.css +11 -11
  67. package/build/styles/AvatarView/AvatarView.css +3 -3
  68. package/build/styles/AvatarView/Dot/Dot.css +3 -3
  69. package/build/styles/Button/Button.css +6 -6
  70. package/build/styles/Button/LegacyButton/LegacyButton.css +9 -3
  71. package/build/styles/Calendar/Calendar.css +119 -45
  72. package/build/styles/Calendar/TableLink/TableLink.css +115 -0
  73. package/build/styles/Carousel/Carousel.css +27 -28
  74. package/build/styles/CheckboxButton/CheckboxButton.css +15 -10
  75. package/build/styles/Chips/Chip/Chip.css +29 -26
  76. package/build/styles/Container/Container.css +5 -5
  77. package/build/styles/DateInput/DateInput.css +4 -4
  78. package/build/styles/DateLookup/DateLookup.css +1 -1
  79. package/build/styles/DateLookup/DateTrigger/DateTrigger.css +15 -9
  80. package/build/styles/DefinitionList/DefinitionList.css +83 -0
  81. package/build/styles/Dimmer/Dimmer.css +19 -9
  82. package/build/styles/Divider/Divider.css +7 -8
  83. package/build/styles/Drawer/Drawer.css +15 -16
  84. package/build/styles/DropFade/DropFade.css +2 -2
  85. package/build/styles/ExpressiveMoneyInput/AmountInput/AmountInput.css +4 -4
  86. package/build/styles/ExpressiveMoneyInput/Chevron/Chevron.css +5 -5
  87. package/build/styles/ExpressiveMoneyInput/ExpressiveMoneyInput.css +11 -11
  88. package/build/styles/Field/Field.css +12 -13
  89. package/build/styles/FlowNavigation/AnimatedLabel/AnimatedLabel.css +5 -5
  90. package/build/styles/FlowNavigation/FlowNavigation.css +46 -25
  91. package/build/styles/Header/Header.css +9 -11
  92. package/build/styles/Image/Image.css +7 -7
  93. package/build/styles/Info/Info.css +1 -1
  94. package/build/styles/Inputs/Input/Input.css +25 -24
  95. package/build/styles/Inputs/InputGroup/InputGroup.css +13 -13
  96. package/build/styles/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.css +10 -10
  97. package/build/styles/Inputs/SelectInput/ButtonInput/SelectInputButtonInput.css +7 -7
  98. package/build/styles/Inputs/SelectInput/ClearButton/SelectInputClearButton.css +6 -6
  99. package/build/styles/Inputs/SelectInput/ItemView/SelectInputItemView.css +4 -4
  100. package/build/styles/Inputs/SelectInput/Option/SelectInputOption.css +2 -4
  101. package/build/styles/Inputs/SelectInput/OptionContent/SelectInputOptionContent.css +4 -4
  102. package/build/styles/Inputs/SelectInput/Options/SelectInputOptions.css +12 -17
  103. package/build/styles/Inputs/SelectInput/Popover/SelectInputPopover.css +4 -4
  104. package/build/styles/Inputs/SelectInput/SelectInput.css +49 -56
  105. package/build/styles/Inputs/TextArea/TextArea.css +27 -26
  106. package/build/styles/InstructionsList/InstructionsList.css +5 -5
  107. package/build/styles/Link/Link.css +8 -2
  108. package/build/styles/ListItem/ListItem.css +35 -38
  109. package/build/styles/ListItem/ListItem.grid.css +7 -7
  110. package/build/styles/Loader/Loader.css +31 -31
  111. package/build/styles/Logo/Logo.css +2 -2
  112. package/build/styles/Modal/Modal.css +14 -15
  113. package/build/styles/MoneyInput/MoneyInput.css +20 -10
  114. package/build/styles/Nudge/Nudge.css +77 -49
  115. package/build/styles/PhoneNumberInput/PhoneNumberInput.css +9 -3
  116. package/build/styles/Popover/Popover.css +10 -13
  117. package/build/styles/Progress/Progress.css +3 -3
  118. package/build/styles/ProgressBar/ProgressBar.css +4 -4
  119. package/build/styles/PromoCard/PromoCard.css +42 -28
  120. package/build/styles/Prompt/ActionPrompt/ActionPrompt.css +9 -9
  121. package/build/styles/Prompt/CriticalBanner/CriticalBanner.css +23 -23
  122. package/build/styles/Prompt/InfoPrompt/InfoPrompt.css +15 -15
  123. package/build/styles/Prompt/InlinePrompt/InlinePrompt.css +6 -5
  124. package/build/styles/Prompt/PrimitivePrompt/PrimitivePrompt.css +8 -10
  125. package/build/styles/RadioGroup/RadioGroup.css +1 -1
  126. package/build/styles/Section/Section.css +6 -6
  127. package/build/styles/SegmentedControl/SegmentedControl.css +15 -18
  128. package/build/styles/SlidingPanel/SlidingPanel.css +40 -9
  129. package/build/styles/Snackbar/Snackbar.css +35 -21
  130. package/build/styles/Stepper/Stepper.css +15 -9
  131. package/build/styles/Sticky/Sticky.css +2 -2
  132. package/build/styles/Switch/Switch.css +7 -5
  133. package/build/styles/Table/Table.css +57 -60
  134. package/build/styles/Tabs/Tabs.css +14 -18
  135. package/build/styles/Tile/Tile.css +12 -12
  136. package/build/styles/Tooltip/Tooltip.css +2 -2
  137. package/build/styles/Typeahead/Typeahead.css +52 -40
  138. package/build/styles/Upload/Upload.css +10 -11
  139. package/build/styles/UploadInput/UploadButton/UploadButton.css +19 -20
  140. package/build/styles/UploadInput/UploadInput.css +4 -4
  141. package/build/styles/UploadInput/UploadItem/UploadItem.css +44 -45
  142. package/build/styles/_deprecated/ActionButton/ActionButton.css +6 -8
  143. package/build/styles/_deprecated/Alert/Alert.css +2 -2
  144. package/build/styles/_deprecated/Avatar/Avatar.css +65 -65
  145. package/build/styles/_deprecated/Badge/Badge.css +12 -8
  146. package/build/styles/_deprecated/Card/Card.css +18 -27
  147. package/build/styles/_deprecated/CriticalBanner/CriticalCommsBanner.css +7 -7
  148. package/build/styles/_deprecated/LegacyListItem/LegacyListItem.css +1 -1
  149. package/build/styles/_deprecated/NavigationOption/NavigationOption.css +19 -6
  150. package/build/styles/_deprecated/NavigationOptionsList/NavigationOptionsList.css +8 -3
  151. package/build/styles/_deprecated/OverlayHeader/OverlayHeader.css +6 -7
  152. package/build/styles/_deprecated/Select/Select.css +104 -57
  153. package/build/styles/_deprecated/Summary/Summary.css +30 -19
  154. package/build/styles/common/BaseCard/BaseCard.css +7 -3
  155. package/build/styles/common/BottomSheet/BottomSheet.css +18 -30
  156. package/build/styles/common/Circle/Circle.css +10 -10
  157. package/build/styles/common/CloseButton/CloseButton.css +36 -36
  158. package/build/styles/common/LiveRegion/LiveRegion.css +1 -1
  159. package/build/styles/common/Option/Option.css +44 -42
  160. package/build/styles/common/Panel/Panel.css +7 -7
  161. package/build/styles/css/accordion.css +52 -24
  162. package/build/styles/css/alerts.css +124 -56
  163. package/build/styles/css/badge.css +30 -20
  164. package/build/styles/css/breadcrumbs.css +4 -6
  165. package/build/styles/css/button-groups.css +258 -114
  166. package/build/styles/css/buttons.css +94 -49
  167. package/build/styles/css/chevron.css +6 -0
  168. package/build/styles/css/circles.css +76 -38
  169. package/build/styles/css/close.css +4 -1
  170. package/build/styles/css/column-layout.css +59 -37
  171. package/build/styles/css/currency-flags.css +17 -4
  172. package/build/styles/css/decision.css +12 -14
  173. package/build/styles/css/dropdowns.css +209 -58
  174. package/build/styles/css/droppable.css +38 -43
  175. package/build/styles/css/flex.css +136 -40
  176. package/build/styles/css/footer.css +14 -15
  177. package/build/styles/css/grid.css +1434 -381
  178. package/build/styles/css/input-groups.css +546 -252
  179. package/build/styles/css/link-callout.css +8 -2
  180. package/build/styles/css/list-group.css +92 -57
  181. package/build/styles/css/loaders.css +11 -11
  182. package/build/styles/css/media.css +34 -10
  183. package/build/styles/css/modals.css +59 -49
  184. package/build/styles/css/navbar.css +811 -371
  185. package/build/styles/css/navs.css +124 -59
  186. package/build/styles/css/neptune-social-media.css +44 -4
  187. package/build/styles/css/neptune.css +7118 -3155
  188. package/build/styles/css/panels.css +243 -143
  189. package/build/styles/css/popovers.css +295 -114
  190. package/build/styles/css/process.css +77 -64
  191. package/build/styles/css/progress-bars.css +21 -11
  192. package/build/styles/css/select.css +52 -20
  193. package/build/styles/css/sequences.css +219 -99
  194. package/build/styles/css/table.css +43 -48
  195. package/build/styles/css/tick.css +10 -10
  196. package/build/styles/css/tooltip.css +82 -49
  197. package/build/styles/css/utilities.css +40 -12
  198. package/build/styles/css/wells.css +16 -16
  199. package/build/styles/main.css +8798 -4478
  200. package/build/styles/styles/less/accordion.css +52 -24
  201. package/build/styles/styles/less/alerts.css +124 -56
  202. package/build/styles/styles/less/badge.css +30 -20
  203. package/build/styles/styles/less/breadcrumbs.css +4 -6
  204. package/build/styles/styles/less/button-groups.css +258 -114
  205. package/build/styles/styles/less/buttons.css +94 -49
  206. package/build/styles/styles/less/chevron.css +6 -0
  207. package/build/styles/styles/less/circles.css +76 -38
  208. package/build/styles/styles/less/close.css +4 -1
  209. package/build/styles/styles/less/column-layout.css +59 -37
  210. package/build/styles/styles/less/currency-flags.css +17 -4
  211. package/build/styles/styles/less/decision.css +12 -14
  212. package/build/styles/styles/less/dropdowns.css +209 -58
  213. package/build/styles/styles/less/droppable.css +38 -43
  214. package/build/styles/styles/less/flex.css +136 -40
  215. package/build/styles/styles/less/footer.css +14 -15
  216. package/build/styles/styles/less/forms/bootstrap-forms.css +348 -178
  217. package/build/styles/styles/less/forms/checkbox-radio.css +56 -29
  218. package/build/styles/styles/less/grid.css +1434 -381
  219. package/build/styles/styles/less/input-groups.css +546 -252
  220. package/build/styles/styles/less/link-callout.css +8 -2
  221. package/build/styles/styles/less/list-group.css +92 -57
  222. package/build/styles/styles/less/loaders.css +11 -11
  223. package/build/styles/styles/less/media.css +34 -10
  224. package/build/styles/styles/less/modals.css +59 -49
  225. package/build/styles/styles/less/navbar.css +811 -371
  226. package/build/styles/styles/less/navs.css +124 -59
  227. package/build/styles/styles/less/neptune-social-media.css +44 -4
  228. package/build/styles/styles/less/neptune.css +7118 -3155
  229. package/build/styles/styles/less/panels.css +243 -143
  230. package/build/styles/styles/less/popovers.css +295 -114
  231. package/build/styles/styles/less/process.css +77 -64
  232. package/build/styles/styles/less/progress-bars.css +21 -11
  233. package/build/styles/styles/less/select.css +52 -20
  234. package/build/styles/styles/less/sequences.css +219 -99
  235. package/build/styles/styles/less/table.css +43 -48
  236. package/build/styles/styles/less/tick.css +10 -10
  237. package/build/styles/styles/less/tooltip.css +82 -49
  238. package/build/styles/styles/less/utilities.css +40 -12
  239. package/build/styles/styles/less/wells.css +16 -16
  240. package/build/types/Calendar/Calendar.constants.d.ts +2 -0
  241. package/build/types/Calendar/Calendar.constants.d.ts.map +1 -0
  242. package/build/types/Calendar/Calendar.d.ts +16 -3
  243. package/build/types/Calendar/Calendar.d.ts.map +1 -1
  244. package/build/types/Calendar/Calendar.messages.d.ts +20 -0
  245. package/build/types/Calendar/Calendar.messages.d.ts.map +1 -1
  246. package/build/types/Calendar/Calendar.types.d.ts +32 -0
  247. package/build/types/Calendar/Calendar.types.d.ts.map +1 -0
  248. package/build/types/Calendar/DateHeader/DateHeader.d.ts +2 -0
  249. package/build/types/Calendar/DateHeader/DateHeader.d.ts.map +1 -1
  250. package/build/types/Calendar/DayCalendar/DayCalendar.d.ts +7 -1
  251. package/build/types/Calendar/DayCalendar/DayCalendar.d.ts.map +1 -1
  252. package/build/types/Calendar/DayCalendar/Table/DayCalendarTable.d.ts +6 -0
  253. package/build/types/Calendar/DayCalendar/Table/DayCalendarTable.d.ts.map +1 -1
  254. package/build/types/Calendar/MonthCalendar/MonthCalendar.d.ts +1 -0
  255. package/build/types/Calendar/MonthCalendar/MonthCalendar.d.ts.map +1 -1
  256. package/build/types/Calendar/MonthCalendar/Table/MonthCalendarTable.d.ts +2 -1
  257. package/build/types/Calendar/MonthCalendar/Table/MonthCalendarTable.d.ts.map +1 -1
  258. package/build/types/Calendar/{tableLink → TableLink}/TableLink.d.ts +5 -1
  259. package/build/types/Calendar/TableLink/TableLink.d.ts.map +1 -0
  260. package/build/types/Calendar/TableLink/index.d.ts.map +1 -0
  261. package/build/types/Calendar/YearCalendar/Table/YearCalendarTable.d.ts +2 -1
  262. package/build/types/Calendar/YearCalendar/Table/YearCalendarTable.d.ts.map +1 -1
  263. package/build/types/Calendar/YearCalendar/YearCalendar.d.ts +1 -0
  264. package/build/types/Calendar/YearCalendar/YearCalendar.d.ts.map +1 -1
  265. package/build/types/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.d.ts +3 -0
  266. package/build/types/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.d.ts.map +1 -0
  267. package/build/types/Calendar/_helpers/index.d.ts +3 -0
  268. package/build/types/Calendar/_helpers/index.d.ts.map +1 -0
  269. package/build/types/Calendar/_helpers/isDateDisabled/isDateDisabled.d.ts +3 -0
  270. package/build/types/Calendar/_helpers/isDateDisabled/isDateDisabled.d.ts.map +1 -0
  271. package/build/types/Calendar/index.d.ts +1 -0
  272. package/build/types/Calendar/index.d.ts.map +1 -1
  273. package/build/types/DateLookup/DateLookup.d.ts +24 -5
  274. package/build/types/DateLookup/DateLookup.d.ts.map +1 -1
  275. package/build/types/DateLookup/index.d.ts +1 -0
  276. package/build/types/DateLookup/index.d.ts.map +1 -1
  277. package/build/types/index.d.ts +3 -2
  278. package/build/types/index.d.ts.map +1 -1
  279. package/build/types/test-utils/index.d.ts +8 -0
  280. package/build/types/test-utils/index.d.ts.map +1 -1
  281. package/package.json +1 -1
  282. package/src/Accordion/Accordion.css +21 -23
  283. package/src/Accordion/Accordion.less +4 -3
  284. package/src/AvatarLayout/AvatarLayout.css +11 -11
  285. package/src/AvatarView/AvatarView.css +3 -3
  286. package/src/AvatarView/Dot/Dot.css +3 -3
  287. package/src/Button/Button.css +6 -6
  288. package/src/Button/LegacyButton/LegacyButton.css +9 -3
  289. package/src/Button/LegacyButton/LegacyButton.less +3 -1
  290. package/src/Calendar/Calendar.constants.ts +5 -0
  291. package/src/Calendar/Calendar.css +119 -45
  292. package/src/Calendar/Calendar.disabledDates.test.tsx +593 -0
  293. package/src/Calendar/Calendar.less +5 -35
  294. package/src/Calendar/Calendar.messages.ts +21 -0
  295. package/src/Calendar/Calendar.test.tsx +310 -28
  296. package/src/Calendar/Calendar.tsx +159 -18
  297. package/src/Calendar/Calendar.types.ts +35 -0
  298. package/src/Calendar/DateHeader/DateHeader.tsx +6 -0
  299. package/src/Calendar/DayCalendar/DayCalendar.tsx +39 -1
  300. package/src/Calendar/DayCalendar/Table/DayCalendarTable.tsx +67 -27
  301. package/src/Calendar/MonthCalendar/MonthCalendar.tsx +8 -0
  302. package/src/Calendar/MonthCalendar/Table/MonthCalendarTable.tsx +15 -3
  303. package/src/Calendar/TableLink/TableLink.css +115 -0
  304. package/src/Calendar/TableLink/TableLink.less +68 -0
  305. package/src/Calendar/TableLink/TableLink.tsx +112 -0
  306. package/src/Calendar/YearCalendar/Table/YearCalendarTable.tsx +15 -3
  307. package/src/Calendar/YearCalendar/YearCalendar.tsx +9 -0
  308. package/src/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.test.ts +98 -0
  309. package/src/Calendar/_helpers/hasDisabledDatesInMonth/hasDisabledDatesInMonth.ts +45 -0
  310. package/src/Calendar/_helpers/index.ts +2 -0
  311. package/src/Calendar/_helpers/isDateDisabled/isDateDisabled.test.ts +169 -0
  312. package/src/Calendar/_helpers/isDateDisabled/isDateDisabled.ts +59 -0
  313. package/src/Calendar/_stories/Calendar.accessibility.docs.mdx +118 -0
  314. package/src/Calendar/_stories/Calendar.story.tsx +138 -4
  315. package/src/Calendar/_stories/Calendar.test.story.tsx +114 -0
  316. package/src/Calendar/index.ts +7 -0
  317. package/src/Carousel/Carousel.css +27 -28
  318. package/src/CheckboxButton/CheckboxButton.css +15 -10
  319. package/src/CheckboxButton/CheckboxButton.less +4 -4
  320. package/src/Chips/Chip/Chip.css +29 -26
  321. package/src/Chips/Chip/Chip.less +3 -5
  322. package/src/Container/Container.css +5 -5
  323. package/src/DateInput/DateInput.css +4 -4
  324. package/src/DateLookup/DateLookup.css +1 -1
  325. package/src/DateLookup/DateLookup.disabledDates.test.tsx +293 -0
  326. package/src/DateLookup/DateLookup.test.tsx +34 -37
  327. package/src/DateLookup/DateLookup.tsx +37 -13
  328. package/src/DateLookup/DateTrigger/DateTrigger.css +15 -9
  329. package/src/DateLookup/DateTrigger/DateTrigger.less +2 -1
  330. package/src/DateLookup/_stories/DateLookup.accessibility.docs.mdx +108 -0
  331. package/src/DateLookup/_stories/DateLookup.story.tsx +124 -2
  332. package/src/DateLookup/index.ts +6 -0
  333. package/src/Decision/Decision.less +2 -0
  334. package/src/DefinitionList/DefinitionList.css +83 -0
  335. package/src/DefinitionList/DefinitionList.less +3 -1
  336. package/src/Dimmer/Dimmer.css +19 -9
  337. package/src/Dimmer/Dimmer.less +3 -2
  338. package/src/Divider/Divider.css +7 -8
  339. package/src/Drawer/Drawer.css +15 -16
  340. package/src/DropFade/DropFade.css +2 -2
  341. package/src/ExpressiveMoneyInput/AmountInput/AmountInput.css +4 -4
  342. package/src/ExpressiveMoneyInput/Chevron/Chevron.css +5 -5
  343. package/src/ExpressiveMoneyInput/ExpressiveMoneyInput.css +11 -11
  344. package/src/Field/Field.css +12 -13
  345. package/src/FlowNavigation/AnimatedLabel/AnimatedLabel.css +5 -5
  346. package/src/FlowNavigation/FlowNavigation.css +46 -25
  347. package/src/Header/Header.css +9 -11
  348. package/src/Image/Image.css +7 -7
  349. package/src/Info/Info.css +1 -1
  350. package/src/Inputs/Input/Input.css +25 -24
  351. package/src/Inputs/InputGroup/InputGroup.css +13 -13
  352. package/src/Inputs/SelectInput/BottomSheet/SelectInputBottomSheet.css +10 -10
  353. package/src/Inputs/SelectInput/ButtonInput/SelectInputButtonInput.css +7 -7
  354. package/src/Inputs/SelectInput/ClearButton/SelectInputClearButton.css +6 -6
  355. package/src/Inputs/SelectInput/ItemView/SelectInputItemView.css +4 -4
  356. package/src/Inputs/SelectInput/Option/SelectInputOption.css +2 -4
  357. package/src/Inputs/SelectInput/OptionContent/SelectInputOptionContent.css +4 -4
  358. package/src/Inputs/SelectInput/Options/SelectInputOptions.css +12 -17
  359. package/src/Inputs/SelectInput/Popover/SelectInputPopover.css +4 -4
  360. package/src/Inputs/SelectInput/SelectInput.css +49 -56
  361. package/src/Inputs/TextArea/TextArea.css +27 -26
  362. package/src/InstructionsList/InstructionsList.css +5 -5
  363. package/src/Link/Link.css +8 -2
  364. package/src/Link/Link.less +3 -3
  365. package/src/ListItem/ListItem.css +35 -38
  366. package/src/ListItem/ListItem.grid.css +7 -7
  367. package/src/Loader/Loader.css +31 -31
  368. package/src/Logo/Logo.css +2 -2
  369. package/src/Modal/Modal.css +14 -15
  370. package/src/MoneyInput/MoneyInput.css +20 -10
  371. package/src/MoneyInput/MoneyInput.less +3 -2
  372. package/src/Nudge/Nudge.css +77 -49
  373. package/src/Nudge/Nudge.less +8 -0
  374. package/src/PhoneNumberInput/PhoneNumberInput.css +9 -3
  375. package/src/PhoneNumberInput/PhoneNumberInput.less +3 -1
  376. package/src/Popover/Popover.css +10 -13
  377. package/src/Progress/Progress.css +3 -3
  378. package/src/ProgressBar/ProgressBar.css +4 -4
  379. package/src/PromoCard/PromoCard.css +42 -28
  380. package/src/PromoCard/PromoCard.less +32 -24
  381. package/src/Prompt/ActionPrompt/ActionPrompt.css +9 -9
  382. package/src/Prompt/CriticalBanner/CriticalBanner.css +23 -23
  383. package/src/Prompt/InfoPrompt/InfoPrompt.css +15 -15
  384. package/src/Prompt/InlinePrompt/InlinePrompt.css +6 -5
  385. package/src/Prompt/PrimitivePrompt/PrimitivePrompt.css +8 -10
  386. package/src/RadioGroup/RadioGroup.css +1 -1
  387. package/src/Section/Section.css +6 -6
  388. package/src/SegmentedControl/SegmentedControl.css +15 -18
  389. package/src/SlidingPanel/SlidingPanel.css +40 -9
  390. package/src/SlidingPanel/SlidingPanel.less +4 -4
  391. package/src/Snackbar/Snackbar.css +35 -21
  392. package/src/Snackbar/Snackbar.less +9 -3
  393. package/src/Stepper/Stepper.css +15 -9
  394. package/src/Stepper/Stepper.less +1 -1
  395. package/src/Sticky/Sticky.css +2 -2
  396. package/src/Sticky/Sticky.less +4 -1
  397. package/src/Switch/Switch.css +7 -5
  398. package/src/Table/Table.css +57 -60
  399. package/src/Tabs/Tabs.css +14 -18
  400. package/src/Tabs/Tabs.less +1 -0
  401. package/src/Tile/Tile.css +12 -12
  402. package/src/Tooltip/Tooltip.css +2 -2
  403. package/src/Typeahead/Typeahead.css +52 -40
  404. package/src/Typeahead/Typeahead.less +3 -2
  405. package/src/Upload/Upload.css +10 -11
  406. package/src/UploadInput/UploadButton/UploadButton.css +19 -20
  407. package/src/UploadInput/UploadInput.css +4 -4
  408. package/src/UploadInput/UploadItem/UploadItem.css +44 -45
  409. package/src/_deprecated/ActionButton/ActionButton.css +6 -8
  410. package/src/_deprecated/Alert/Alert.css +2 -2
  411. package/src/_deprecated/Avatar/Avatar.css +65 -65
  412. package/src/_deprecated/Avatar/Avatar.less +1 -0
  413. package/src/_deprecated/Badge/Badge.css +12 -8
  414. package/src/_deprecated/Badge/Badge.less +13 -13
  415. package/src/_deprecated/Card/Card.css +18 -27
  416. package/src/_deprecated/Card/Card.less +2 -1
  417. package/src/_deprecated/CriticalBanner/CriticalCommsBanner.css +7 -7
  418. package/src/_deprecated/LegacyListItem/LegacyListItem.css +1 -1
  419. package/src/_deprecated/NavigationOption/NavigationOption.css +19 -6
  420. package/src/_deprecated/NavigationOption/NavigationOption.less +4 -3
  421. package/src/_deprecated/NavigationOptionsList/NavigationOptionsList.css +8 -3
  422. package/src/_deprecated/NavigationOptionsList/NavigationOptionsList.less +3 -1
  423. package/src/_deprecated/OverlayHeader/OverlayHeader.css +6 -7
  424. package/src/_deprecated/Select/Select.css +104 -57
  425. package/src/_deprecated/Select/Select.less +11 -10
  426. package/src/_deprecated/Summary/Summary.css +30 -19
  427. package/src/_deprecated/Summary/Summary.less +8 -1
  428. package/src/common/BaseCard/BaseCard.css +7 -3
  429. package/src/common/BaseCard/BaseCard.less +5 -0
  430. package/src/common/BottomSheet/BottomSheet.css +18 -30
  431. package/src/common/Circle/Circle.css +10 -10
  432. package/src/common/CloseButton/CloseButton.css +36 -36
  433. package/src/common/LiveRegion/LiveRegion.css +1 -1
  434. package/src/common/Option/Option.css +44 -42
  435. package/src/common/Option/Option.less +10 -8
  436. package/src/common/Panel/Panel.css +7 -7
  437. package/src/i18n/en.json +4 -0
  438. package/src/index.ts +3 -2
  439. package/src/main.css +8798 -4478
  440. package/src/styles/less/accordion.css +52 -24
  441. package/src/styles/less/alerts.css +124 -56
  442. package/src/styles/less/badge.css +30 -20
  443. package/src/styles/less/breadcrumbs.css +4 -6
  444. package/src/styles/less/button-groups.css +258 -114
  445. package/src/styles/less/buttons.css +94 -49
  446. package/src/styles/less/buttons.less +10 -2
  447. package/src/styles/less/chevron.css +6 -0
  448. package/src/styles/less/circles.css +76 -38
  449. package/src/styles/less/close.css +4 -1
  450. package/src/styles/less/column-layout.css +59 -37
  451. package/src/styles/less/currency-flags.css +17 -4
  452. package/src/styles/less/decision.css +12 -14
  453. package/src/styles/less/dropdowns.css +209 -58
  454. package/src/styles/less/droppable.css +38 -43
  455. package/src/styles/less/flex.css +136 -40
  456. package/src/styles/less/footer.css +14 -15
  457. package/src/styles/less/forms/bootstrap-forms.css +348 -178
  458. package/src/styles/less/forms/checkbox-radio.css +56 -29
  459. package/src/styles/less/grid.css +1434 -381
  460. package/src/styles/less/input-groups.css +546 -252
  461. package/src/styles/less/link-callout.css +8 -2
  462. package/src/styles/less/list-group.css +92 -57
  463. package/src/styles/less/loaders.css +11 -11
  464. package/src/styles/less/media.css +34 -10
  465. package/src/styles/less/mixins/_logical-properties.less +2 -2
  466. package/src/styles/less/mixins/_physical-properties.less +5 -77
  467. package/src/styles/less/modals.css +59 -49
  468. package/src/styles/less/navbar.css +811 -371
  469. package/src/styles/less/navs.css +124 -59
  470. package/src/styles/less/neptune-social-media.css +44 -4
  471. package/src/styles/less/neptune-social-media.less +18 -4
  472. package/src/styles/less/neptune.css +7118 -3155
  473. package/src/styles/less/panels.css +243 -143
  474. package/src/styles/less/popovers.css +295 -114
  475. package/src/styles/less/process.css +77 -64
  476. package/src/styles/less/progress-bars.css +21 -11
  477. package/src/styles/less/progress-bars.less +6 -1
  478. package/src/styles/less/select.css +52 -20
  479. package/src/styles/less/sequences.css +219 -99
  480. package/src/styles/less/table.css +43 -48
  481. package/src/styles/less/tick.css +10 -10
  482. package/src/styles/less/tooltip.css +82 -49
  483. package/src/styles/less/utilities.css +40 -12
  484. package/src/styles/less/wells.css +16 -16
  485. package/build/Calendar/tableLink/TableLink.js +0 -61
  486. package/build/Calendar/tableLink/TableLink.js.map +0 -1
  487. package/build/Calendar/tableLink/TableLink.mjs +0 -57
  488. package/build/Calendar/tableLink/TableLink.mjs.map +0 -1
  489. package/build/types/Calendar/tableLink/TableLink.d.ts.map +0 -1
  490. package/build/types/Calendar/tableLink/index.d.ts.map +0 -1
  491. package/src/Calendar/tableLink/TableLink.tsx +0 -77
  492. /package/build/types/Calendar/{tableLink → TableLink}/index.d.ts +0 -0
  493. /package/src/Calendar/{tableLink → TableLink}/index.ts +0 -0
@@ -2,10 +2,11 @@ import { formatDate } from '@transferwise/formatting';
2
2
  import { useIntl } from 'react-intl';
3
3
 
4
4
  import { getFocusableTime } from '../../GetFocusableTime/GetFocusableTime';
5
- import TableLink from '../../tableLink';
5
+ import TableLink from '../../TableLink';
6
6
 
7
7
  interface MonthCalendarTableProps {
8
8
  selectedDate: Date | null;
9
+ focusedDate?: Date | null;
9
10
  min: Date | null;
10
11
  max: Date | null;
11
12
  viewYear: number;
@@ -19,6 +20,7 @@ const MONTH_ONLY_FORMAT: Intl.DateTimeFormatOptions = { month: 'short' };
19
20
 
20
21
  const MonthCalendarTable = ({
21
22
  selectedDate,
23
+ focusedDate,
22
24
  min,
23
25
  max,
24
26
  viewYear,
@@ -34,7 +36,8 @@ const MonthCalendarTable = ({
34
36
  type="month"
35
37
  title={formatDate(new Date(viewYear, month), locale, MONTH_ONLY_FORMAT)}
36
38
  active={isActive(month)}
37
- disabled={isDisabled(month)}
39
+ outOfRange={isDisabled(month)}
40
+ disabled={false}
38
41
  today={viewYear === new Date().getFullYear() && month === new Date().getMonth()}
39
42
  autofocus={autofocusMonth === month}
40
43
  onClick={onSelect}
@@ -46,6 +49,10 @@ const MonthCalendarTable = ({
46
49
  return !!(month === selectedDate?.getMonth() && viewYear === selectedDate?.getFullYear());
47
50
  };
48
51
 
52
+ const isFocused = (month: number) => {
53
+ return !!(month === focusedDate?.getMonth() && viewYear === focusedDate?.getFullYear());
54
+ };
55
+
49
56
  const isThisMonth = (month: number) => {
50
57
  return viewYear === new Date().getFullYear() && month === new Date().getMonth();
51
58
  };
@@ -60,7 +67,12 @@ const MonthCalendarTable = ({
60
67
 
61
68
  const autofocusMonth = (() => {
62
69
  const months = Array.from({ length: ROWS * COLS }, (_, index) => index);
63
- return getFocusableTime({ isActive, isNow: isThisMonth, isDisabled, timeSpan: months });
70
+ return getFocusableTime({
71
+ isActive: isFocused,
72
+ isNow: isThisMonth,
73
+ isDisabled,
74
+ timeSpan: months,
75
+ });
64
76
  })();
65
77
 
66
78
  return (
@@ -0,0 +1,115 @@
1
+ .wds-Calendar__option--day,
2
+ .wds-Calendar__option--month,
3
+ .wds-Calendar__option--year {
4
+ width: 100%;
5
+ padding: 4px 0;
6
+ padding: var(--size-4) 0;
7
+ border: transparent;
8
+ border-radius: 10px;
9
+ border-radius: var(--radius-small);
10
+ background-color: transparent;
11
+ font-weight: 600;
12
+ font-weight: var(--font-weight-semi-bold);
13
+ color: #37517e;
14
+ color: var(--color-content-primary);
15
+ }
16
+ @media (max-width: 320px) {
17
+ .wds-Calendar__option--day,
18
+ .wds-Calendar__option--month,
19
+ .wds-Calendar__option--year {
20
+ padding: 0;
21
+ }
22
+ }
23
+ .wds-Calendar__option--day:focus,
24
+ .wds-Calendar__option--month:focus,
25
+ .wds-Calendar__option--year:focus {
26
+ background-color: var(--color-background-screen-hover);
27
+ }
28
+ .wds-Calendar__option--day.disabled,
29
+ .wds-Calendar__option--month.disabled,
30
+ .wds-Calendar__option--year.disabled,
31
+ .wds-Calendar__option--day[aria-disabled="true"],
32
+ .wds-Calendar__option--month[aria-disabled="true"],
33
+ .wds-Calendar__option--year[aria-disabled="true"] {
34
+ --ring-outline-color: var(--color-sentiment-content-primary);
35
+ color: #768e9c;
36
+ color: var(--color-content-tertiary);
37
+ cursor: not-allowed;
38
+ }
39
+ .wds-Calendar__option--day.disabled:hover,
40
+ .wds-Calendar__option--month.disabled:hover,
41
+ .wds-Calendar__option--year.disabled:hover,
42
+ .wds-Calendar__option--day[aria-disabled="true"]:hover,
43
+ .wds-Calendar__option--month[aria-disabled="true"]:hover,
44
+ .wds-Calendar__option--year[aria-disabled="true"]:hover,
45
+ .wds-Calendar__option--day.disabled:focus,
46
+ .wds-Calendar__option--month.disabled:focus,
47
+ .wds-Calendar__option--year.disabled:focus,
48
+ .wds-Calendar__option--day[aria-disabled="true"]:focus,
49
+ .wds-Calendar__option--month[aria-disabled="true"]:focus,
50
+ .wds-Calendar__option--year[aria-disabled="true"]:focus {
51
+ filter: initial;
52
+ opacity: 1;
53
+ opacity: initial;
54
+ background-color: var(--color-sentiment-background-surface);
55
+ color: var(--color-sentiment-content-primary);
56
+ }
57
+ .wds-Calendar__option--day.disabled.active,
58
+ .wds-Calendar__option--month.disabled.active,
59
+ .wds-Calendar__option--year.disabled.active,
60
+ .wds-Calendar__option--day[aria-disabled="true"].active,
61
+ .wds-Calendar__option--month[aria-disabled="true"].active,
62
+ .wds-Calendar__option--year[aria-disabled="true"].active,
63
+ .wds-Calendar__option--day.disabled.active:hover,
64
+ .wds-Calendar__option--month.disabled.active:hover,
65
+ .wds-Calendar__option--year.disabled.active:hover,
66
+ .wds-Calendar__option--day[aria-disabled="true"].active:hover,
67
+ .wds-Calendar__option--month[aria-disabled="true"].active:hover,
68
+ .wds-Calendar__option--year[aria-disabled="true"].active:hover,
69
+ .wds-Calendar__option--day.disabled.active:active,
70
+ .wds-Calendar__option--month.disabled.active:active,
71
+ .wds-Calendar__option--year.disabled.active:active,
72
+ .wds-Calendar__option--day[aria-disabled="true"].active:active,
73
+ .wds-Calendar__option--month[aria-disabled="true"].active:active,
74
+ .wds-Calendar__option--year[aria-disabled="true"].active:active,
75
+ .wds-Calendar__option--day.disabled.active:focus,
76
+ .wds-Calendar__option--month.disabled.active:focus,
77
+ .wds-Calendar__option--year.disabled.active:focus,
78
+ .wds-Calendar__option--day[aria-disabled="true"].active:focus,
79
+ .wds-Calendar__option--month[aria-disabled="true"].active:focus,
80
+ .wds-Calendar__option--year[aria-disabled="true"].active:focus {
81
+ filter: initial;
82
+ opacity: 1;
83
+ opacity: initial;
84
+ background-color: var(--color-sentiment-interactive-primary);
85
+ color: var(--color-sentiment-interactive-secondary);
86
+ }
87
+ .wds-Calendar__option--day.disabled.today,
88
+ .wds-Calendar__option--month.disabled.today,
89
+ .wds-Calendar__option--year.disabled.today,
90
+ .wds-Calendar__option--day[aria-disabled="true"].today,
91
+ .wds-Calendar__option--month[aria-disabled="true"].today,
92
+ .wds-Calendar__option--year[aria-disabled="true"].today {
93
+ text-decoration-color: #768e9c;
94
+ text-decoration-color: var(--color-content-tertiary);
95
+ }
96
+ .wds-Calendar__option--day {
97
+ height: 40px;
98
+ height: var(--size-40);
99
+ border-radius: 9999px;
100
+ border-radius: var(--radius-full);
101
+ line-height: 40px;
102
+ line-height: var(--size-40);
103
+ width: 40px;
104
+ width: var(--size-40);
105
+ padding: 0;
106
+ display: inline-flex;
107
+ align-items: center;
108
+ justify-content: center;
109
+ }
110
+ .wds-Calendar__option--day.today {
111
+ -webkit-text-decoration: underline;
112
+ text-decoration: underline;
113
+ text-decoration-thickness: 2px;
114
+ text-underline-offset: 4px;
115
+ }
@@ -0,0 +1,68 @@
1
+ @import (reference) "./../../styles/variables/neptune-tokens.less";
2
+
3
+ .wds-Calendar__option--day,
4
+ .wds-Calendar__option--month,
5
+ .wds-Calendar__option--year {
6
+ width: 100%;
7
+ padding: var(--size-4) 0;
8
+ @media (--screen-400-zoom) {
9
+ padding: 0;
10
+ }
11
+ border: transparent;
12
+ border-radius: var(--radius-small);
13
+ background-color: transparent;
14
+ font-weight: var(--font-weight-semi-bold);
15
+ color: var(--color-content-primary);
16
+
17
+ &:focus {
18
+ background-color: var(--color-background-screen-hover);
19
+ }
20
+
21
+ &.disabled,
22
+ &[aria-disabled="true"] {
23
+ --ring-outline-color: var(--color-sentiment-content-primary);
24
+ color: var(--color-content-tertiary);
25
+ cursor: not-allowed;
26
+
27
+ &:hover,
28
+ &:focus {
29
+ filter: unset;
30
+ opacity: unset;
31
+ background-color: var(--color-sentiment-background-surface);
32
+ color: var(--color-sentiment-content-primary);
33
+ }
34
+
35
+ &.active {
36
+ &,
37
+ &:hover,
38
+ &:active,
39
+ &:focus {
40
+ filter: unset;
41
+ opacity: unset;
42
+ background-color: var(--color-sentiment-interactive-primary);
43
+ color: var(--color-sentiment-interactive-secondary);
44
+ }
45
+ }
46
+
47
+ &.today {
48
+ text-decoration-color: var(--color-content-tertiary);
49
+ }
50
+ }
51
+ }
52
+
53
+ .wds-Calendar__option--day {
54
+ height: var(--size-40);
55
+ border-radius: var(--radius-full);
56
+ line-height: var(--size-40);
57
+ width: var(--size-40);
58
+ padding: 0;
59
+ display: inline-flex;
60
+ align-items: center;
61
+ justify-content: center;
62
+
63
+ &.today {
64
+ text-decoration: underline;
65
+ text-decoration-thickness: 2px;
66
+ text-underline-offset: 4px;
67
+ }
68
+ }
@@ -0,0 +1,112 @@
1
+ import { clsx } from 'clsx';
2
+ import { useEffect, useRef } from 'react';
3
+ import { useIntl } from 'react-intl';
4
+
5
+ import messages from '../Calendar.messages';
6
+ import SentimentSurface from '../../SentimentSurface';
7
+
8
+ interface TableLinkProps {
9
+ item: number;
10
+ type: 'day' | 'month' | 'year';
11
+ title?: string;
12
+ longTitle?: string;
13
+ active: boolean;
14
+ outOfRange: boolean;
15
+ disabled: boolean;
16
+ today: boolean;
17
+ autofocus?: boolean;
18
+ disabledReasonId?: string;
19
+ announceReasonOnFocus?: boolean;
20
+ onClick: (item: number) => void;
21
+ onFocus?: (item: number) => void;
22
+ }
23
+
24
+ const TableLink = ({
25
+ item,
26
+ type,
27
+ title,
28
+ longTitle,
29
+ active,
30
+ outOfRange,
31
+ disabled,
32
+ today,
33
+ autofocus,
34
+ disabledReasonId,
35
+ announceReasonOnFocus,
36
+ onClick,
37
+ onFocus,
38
+ }: TableLinkProps) => {
39
+ const buttonRef = useRef<HTMLButtonElement>(null);
40
+ // Distinguishes keyboard-driven .focus() (arrow keys) from screen-reader-initiated focus (VoiceOver cursor).
41
+ // Without this, the onFocus callback would re-trigger state updates that conflict with the already-committed focusedDate.
42
+ const isProgrammaticFocus = useRef(false);
43
+ const intl = useIntl();
44
+
45
+ useEffect(() => {
46
+ if (autofocus) {
47
+ setTimeout(() => {
48
+ isProgrammaticFocus.current = true;
49
+ buttonRef.current?.focus();
50
+ isProgrammaticFocus.current = false;
51
+ }, 0);
52
+ }
53
+ }, [autofocus]);
54
+
55
+ const isUnavailable = outOfRange || disabled;
56
+
57
+ const onCalendarClick = (event: React.MouseEvent) => {
58
+ event.preventDefault();
59
+ if (!isUnavailable) {
60
+ onClick(item);
61
+ }
62
+ };
63
+
64
+ const onCalendarFocus = () => {
65
+ if (!isProgrammaticFocus.current) {
66
+ onFocus?.(item);
67
+ }
68
+ };
69
+
70
+ const calculateAriaLabel = () => {
71
+ let label = longTitle || title || '';
72
+ if (active) {
73
+ label += `, ${intl.formatMessage(messages.selected)} ${intl.formatMessage(messages[type])}`;
74
+ }
75
+ if (isUnavailable) {
76
+ label += `, ${intl.formatMessage(messages.notAvailable)}`;
77
+ }
78
+ return label;
79
+ };
80
+
81
+ return (
82
+ <SentimentSurface
83
+ // @ts-expect-error - Generic forwardRef limitation in SentimentSurface
84
+ ref={buttonRef}
85
+ as="button"
86
+ data-calendar-cell
87
+ aria-describedby={
88
+ isUnavailable || (autofocus && announceReasonOnFocus) ? disabledReasonId : undefined
89
+ }
90
+ aria-disabled={isUnavailable || undefined}
91
+ aria-label={calculateAriaLabel()}
92
+ aria-pressed={active}
93
+ className={clsx(
94
+ `wds-Calendar__option--${type}`,
95
+ `tw-date-lookup-${type}-option np-text-body-default-bold`,
96
+ { active: !!active },
97
+ { today: !!today },
98
+ { disabled: !!isUnavailable },
99
+ )}
100
+ hasBaseStyles={false}
101
+ sentiment={isUnavailable ? 'negative' : 'neutral'}
102
+ tabIndex={autofocus ? 0 : -1}
103
+ type="button"
104
+ onClick={onCalendarClick}
105
+ onFocus={onCalendarFocus}
106
+ >
107
+ {title || item}
108
+ </SentimentSurface>
109
+ );
110
+ };
111
+
112
+ export default TableLink;
@@ -2,10 +2,11 @@ import { formatDate } from '@transferwise/formatting';
2
2
  import { useIntl } from 'react-intl';
3
3
 
4
4
  import { getFocusableTime } from '../../GetFocusableTime/GetFocusableTime';
5
- import TableLink from '../../tableLink';
5
+ import TableLink from '../../TableLink';
6
6
 
7
7
  interface YearCalendarTableProps {
8
8
  selectedDate: Date | null;
9
+ focusedDate?: Date | null;
9
10
  min: Date | null;
10
11
  max: Date | null;
11
12
  viewYear: number;
@@ -19,6 +20,7 @@ const YEAR_ONLY_FORMAT: Intl.DateTimeFormatOptions = { year: 'numeric' };
19
20
 
20
21
  const YearCalendarTable = ({
21
22
  selectedDate,
23
+ focusedDate,
22
24
  min,
23
25
  max,
24
26
  viewYear,
@@ -34,7 +36,8 @@ const YearCalendarTable = ({
34
36
  type="year"
35
37
  title={formatDate(new Date(year, 0), locale, YEAR_ONLY_FORMAT)}
36
38
  active={isActive(year)}
37
- disabled={isDisabled(year)}
39
+ outOfRange={isDisabled(year)}
40
+ disabled={false}
38
41
  today={isThisYear(year)}
39
42
  autofocus={autofocusYear === year}
40
43
  onClick={onSelect}
@@ -46,6 +49,10 @@ const YearCalendarTable = ({
46
49
  return !!(year === selectedDate?.getFullYear());
47
50
  };
48
51
 
52
+ const isFocused = (year: number) => {
53
+ return !!(year === focusedDate?.getFullYear());
54
+ };
55
+
49
56
  const isThisYear = (year: number) => {
50
57
  return year === new Date().getFullYear();
51
58
  };
@@ -56,7 +63,12 @@ const YearCalendarTable = ({
56
63
 
57
64
  const autofocusYear = (() => {
58
65
  const years = Array.from({ length: ROWS * COLS }, (_, index) => startYear + index);
59
- return getFocusableTime({ isActive, isNow: isThisYear, isDisabled, timeSpan: years });
66
+ return getFocusableTime({
67
+ isActive: isFocused,
68
+ isNow: isThisYear,
69
+ isDisabled,
70
+ timeSpan: years,
71
+ });
60
72
  })();
61
73
 
62
74
  return (
@@ -8,6 +8,7 @@ import YearCalendarTable from './Table';
8
8
 
9
9
  interface YearCalendarProps extends WrappedComponentProps {
10
10
  selectedDate: Date | null;
11
+ focusedDate?: Date | null;
11
12
  min: Date | null;
12
13
  max: Date | null;
13
14
  viewYear: number;
@@ -33,21 +34,29 @@ class YearCalendar extends PureComponent<YearCalendarProps> {
33
34
  render() {
34
35
  const {
35
36
  selectedDate,
37
+ focusedDate,
36
38
  min,
37
39
  max,
38
40
  viewYear,
39
41
  placeholder,
40
42
  intl: { formatMessage },
41
43
  } = this.props;
44
+ const startYear = viewYear - (viewYear % 20);
45
+ const isPreviousDisabled = !!(min && startYear - 1 < min.getFullYear());
46
+ const isNextDisabled = !!(max && startYear + 20 > max.getFullYear());
47
+
42
48
  return (
43
49
  <>
44
50
  <DateHeader
45
51
  dateMode={formatMessage(messages.twentyYears)}
52
+ isPreviousDisabled={isPreviousDisabled}
53
+ isNextDisabled={isNextDisabled}
46
54
  onPreviousClick={this.selectPreviousYears}
47
55
  onNextClick={this.selectNextYears}
48
56
  />
49
57
  <YearCalendarTable
50
58
  selectedDate={selectedDate}
59
+ focusedDate={focusedDate}
51
60
  min={min}
52
61
  max={max}
53
62
  viewYear={viewYear}
@@ -0,0 +1,98 @@
1
+ import { hasDisabledDatesInMonth } from './hasDisabledDatesInMonth';
2
+ import type { DisabledRules } from '../../Calendar.types';
3
+
4
+ describe('hasDisabledDatesInMonth', () => {
5
+ describe('weekdays', () => {
6
+ it('returns true when weekday rules exist (every month has all weekdays)', () => {
7
+ const rules: DisabledRules = { weekdays: ['sat', 'sun'], reason: 'Closed' };
8
+ expect(hasDisabledDatesInMonth(6, 2024, rules)).toBe(true);
9
+ });
10
+
11
+ it('returns true for any month when weekday rules exist', () => {
12
+ const rules: DisabledRules = { weekdays: ['mon'], reason: 'Closed' };
13
+ expect(hasDisabledDatesInMonth(0, 2024, rules)).toBe(true);
14
+ expect(hasDisabledDatesInMonth(11, 2024, rules)).toBe(true);
15
+ });
16
+
17
+ it('returns false when weekdays array is empty', () => {
18
+ const rules: DisabledRules = { weekdays: [], reason: 'None' };
19
+ expect(hasDisabledDatesInMonth(6, 2024, rules)).toBe(false);
20
+ });
21
+ });
22
+
23
+ describe('specific dates', () => {
24
+ const rules: DisabledRules = {
25
+ dates: [new Date(2024, 6, 11), new Date(2024, 6, 25), new Date(2025, 0, 1)],
26
+ reason: 'Bank holidays',
27
+ };
28
+
29
+ it('returns true when month contains a disabled date', () => {
30
+ expect(hasDisabledDatesInMonth(6, 2024, rules)).toBe(true);
31
+ });
32
+
33
+ it('returns false when month has no disabled dates', () => {
34
+ expect(hasDisabledDatesInMonth(5, 2024, rules)).toBe(false);
35
+ });
36
+
37
+ it('returns true for another year with disabled date', () => {
38
+ expect(hasDisabledDatesInMonth(0, 2025, rules)).toBe(true);
39
+ });
40
+ });
41
+
42
+ describe('ranges', () => {
43
+ const rules: DisabledRules = {
44
+ ranges: [{ start: new Date(2024, 2, 29), end: new Date(2024, 3, 3) }],
45
+ reason: 'Maintenance',
46
+ };
47
+
48
+ it('returns true when range starts in the month', () => {
49
+ expect(hasDisabledDatesInMonth(2, 2024, rules)).toBe(true);
50
+ });
51
+
52
+ it('returns true when range ends in the month', () => {
53
+ expect(hasDisabledDatesInMonth(3, 2024, rules)).toBe(true);
54
+ });
55
+
56
+ it('returns true when range spans the entire month', () => {
57
+ const spanRules: DisabledRules = {
58
+ ranges: [{ start: new Date(2024, 0, 1), end: new Date(2024, 11, 31) }],
59
+ reason: 'Year-long',
60
+ };
61
+ expect(hasDisabledDatesInMonth(6, 2024, spanRules)).toBe(true);
62
+ });
63
+
64
+ it('returns false when range does not overlap the month', () => {
65
+ expect(hasDisabledDatesInMonth(4, 2024, rules)).toBe(false);
66
+ });
67
+ });
68
+
69
+ describe('min/max constraints', () => {
70
+ it('returns false when all disabled dates in month are outside min/max', () => {
71
+ const rules: DisabledRules = {
72
+ dates: [new Date(2024, 6, 1), new Date(2024, 6, 2)],
73
+ reason: 'Early',
74
+ };
75
+ const min = new Date(2024, 6, 10);
76
+ const max = new Date(2024, 6, 31);
77
+ expect(hasDisabledDatesInMonth(6, 2024, rules, min, max)).toBe(false);
78
+ });
79
+
80
+ it('returns true when weekdays exist regardless of min/max', () => {
81
+ const rules: DisabledRules = { weekdays: ['sat'], reason: 'Closed' };
82
+ const min = new Date(2024, 6, 10);
83
+ const max = new Date(2024, 6, 20);
84
+ expect(hasDisabledDatesInMonth(6, 2024, rules, min, max)).toBe(true);
85
+ });
86
+ });
87
+
88
+ describe('no rules', () => {
89
+ it('returns false when disabledRules is undefined', () => {
90
+ expect(hasDisabledDatesInMonth(6, 2024, undefined)).toBe(false);
91
+ });
92
+
93
+ it('returns false when only reason is provided', () => {
94
+ const rules: DisabledRules = { reason: 'Reason only' };
95
+ expect(hasDisabledDatesInMonth(6, 2024, rules)).toBe(false);
96
+ });
97
+ });
98
+ });
@@ -0,0 +1,45 @@
1
+ import type { DisabledRules } from '../../Calendar.types';
2
+
3
+ export function hasDisabledDatesInMonth(
4
+ month: number,
5
+ year: number,
6
+ disabledRules?: DisabledRules,
7
+ min?: Date | null,
8
+ max?: Date | null,
9
+ ): boolean {
10
+ if (!disabledRules) return false;
11
+
12
+ if (disabledRules.weekdays?.length) {
13
+ return true;
14
+ }
15
+
16
+ const monthStart = new Date(year, month, 1);
17
+ const monthEnd = new Date(year, month + 1, 0);
18
+
19
+ if (disabledRules.dates?.length) {
20
+ const hasDateInMonth = disabledRules.dates.some((date) => {
21
+ if (date.getFullYear() !== year || date.getMonth() !== month) return false;
22
+ if (min && date < min) return false;
23
+ if (max && date > max) return false;
24
+ return true;
25
+ });
26
+ if (hasDateInMonth) return true;
27
+ }
28
+
29
+ if (disabledRules.ranges?.length) {
30
+ const hasOverlap = disabledRules.ranges.some((range) => {
31
+ const rangeStart = new Date(
32
+ range.start.getFullYear(),
33
+ range.start.getMonth(),
34
+ range.start.getDate(),
35
+ );
36
+ const rangeEnd = new Date(range.end.getFullYear(), range.end.getMonth(), range.end.getDate());
37
+ if (max && rangeStart > max) return false;
38
+ if (min && rangeEnd < min) return false;
39
+ return rangeStart <= monthEnd && rangeEnd >= monthStart;
40
+ });
41
+ if (hasOverlap) return true;
42
+ }
43
+
44
+ return false;
45
+ }
@@ -0,0 +1,2 @@
1
+ export { isDateDisabled } from './isDateDisabled/isDateDisabled';
2
+ export { hasDisabledDatesInMonth } from './hasDisabledDatesInMonth/hasDisabledDatesInMonth';