@transferwise/components 46.144.1 → 46.146.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 (209) hide show
  1. package/build/calendar/Calendar.js +159 -0
  2. package/build/calendar/Calendar.js.map +1 -0
  3. package/build/{dateLookup/DateLookup.messages.js → calendar/Calendar.messages.js} +1 -1
  4. package/build/calendar/Calendar.messages.js.map +1 -0
  5. package/build/{dateLookup/DateLookup.messages.mjs → calendar/Calendar.messages.mjs} +1 -1
  6. package/build/calendar/Calendar.messages.mjs.map +1 -0
  7. package/build/calendar/Calendar.mjs +155 -0
  8. package/build/calendar/Calendar.mjs.map +1 -0
  9. package/build/{dateLookup → calendar}/dateHeader/DateHeader.js +4 -4
  10. package/build/calendar/dateHeader/DateHeader.js.map +1 -0
  11. package/build/{dateLookup → calendar}/dateHeader/DateHeader.mjs +1 -1
  12. package/build/calendar/dateHeader/DateHeader.mjs.map +1 -0
  13. package/build/{dateLookup → calendar}/dayCalendar/DayCalendar.js +2 -2
  14. package/build/calendar/dayCalendar/DayCalendar.js.map +1 -0
  15. package/build/{dateLookup → calendar}/dayCalendar/DayCalendar.mjs +1 -1
  16. package/build/calendar/dayCalendar/DayCalendar.mjs.map +1 -0
  17. package/build/calendar/dayCalendar/table/DayCalendarTable.js.map +1 -0
  18. package/build/calendar/dayCalendar/table/DayCalendarTable.mjs.map +1 -0
  19. package/build/calendar/getFocusableTime/getFocusableTime.js.map +1 -0
  20. package/build/calendar/getFocusableTime/getFocusableTime.mjs.map +1 -0
  21. package/build/calendar/getStartOfDay/getStartOfDay.js.map +1 -0
  22. package/build/calendar/getStartOfDay/getStartOfDay.mjs.map +1 -0
  23. package/build/{dateLookup → calendar}/monthCalendar/MonthCalendar.js +2 -2
  24. package/build/calendar/monthCalendar/MonthCalendar.js.map +1 -0
  25. package/build/{dateLookup → calendar}/monthCalendar/MonthCalendar.mjs +1 -1
  26. package/build/calendar/monthCalendar/MonthCalendar.mjs.map +1 -0
  27. package/build/calendar/monthCalendar/table/MonthCalendarTable.js.map +1 -0
  28. package/build/calendar/monthCalendar/table/MonthCalendarTable.mjs.map +1 -0
  29. package/build/{dateLookup → calendar}/tableLink/TableLink.js +2 -2
  30. package/build/calendar/tableLink/TableLink.js.map +1 -0
  31. package/build/{dateLookup → calendar}/tableLink/TableLink.mjs +1 -1
  32. package/build/calendar/tableLink/TableLink.mjs.map +1 -0
  33. package/build/{dateLookup → calendar}/yearCalendar/YearCalendar.js +2 -2
  34. package/build/calendar/yearCalendar/YearCalendar.js.map +1 -0
  35. package/build/{dateLookup → calendar}/yearCalendar/YearCalendar.mjs +1 -1
  36. package/build/calendar/yearCalendar/YearCalendar.mjs.map +1 -0
  37. package/build/calendar/yearCalendar/table/YearCalendarTable.js.map +1 -0
  38. package/build/calendar/yearCalendar/table/YearCalendarTable.mjs.map +1 -0
  39. package/build/dateLookup/DateLookup.js +28 -168
  40. package/build/dateLookup/DateLookup.js.map +1 -1
  41. package/build/dateLookup/DateLookup.mjs +29 -169
  42. package/build/dateLookup/DateLookup.mjs.map +1 -1
  43. package/build/index.js +2 -0
  44. package/build/index.js.map +1 -1
  45. package/build/index.mjs +1 -0
  46. package/build/index.mjs.map +1 -1
  47. package/build/main.css +624 -688
  48. package/build/prompt/InfoPrompt/InfoPrompt.js +1 -1
  49. package/build/prompt/InfoPrompt/InfoPrompt.js.map +1 -1
  50. package/build/prompt/InfoPrompt/InfoPrompt.mjs +2 -2
  51. package/build/prompt/InfoPrompt/InfoPrompt.mjs.map +1 -1
  52. package/build/sentimentSurface/SentimentSurface.js +9 -2
  53. package/build/sentimentSurface/SentimentSurface.js.map +1 -1
  54. package/build/sentimentSurface/SentimentSurface.mjs +9 -2
  55. package/build/sentimentSurface/SentimentSurface.mjs.map +1 -1
  56. package/build/styles/calendar/Calendar.css +83 -0
  57. package/build/styles/dateLookup/DateLookup.css +0 -90
  58. package/build/styles/main.css +624 -688
  59. package/build/styles/sentimentSurface/SentimentSurface.css +325 -337
  60. package/build/types/calendar/Calendar.d.ts +13 -0
  61. package/build/types/calendar/Calendar.d.ts.map +1 -0
  62. package/build/types/{dateLookup/DateLookup.messages.d.ts → calendar/Calendar.messages.d.ts} +1 -1
  63. package/build/types/calendar/Calendar.messages.d.ts.map +1 -0
  64. package/build/types/calendar/dateHeader/DateHeader.d.ts.map +1 -0
  65. package/build/types/calendar/dateHeader/index.d.ts.map +1 -0
  66. package/build/types/calendar/dayCalendar/DayCalendar.d.ts.map +1 -0
  67. package/build/types/calendar/dayCalendar/index.d.ts.map +1 -0
  68. package/build/types/calendar/dayCalendar/table/DayCalendarTable.d.ts.map +1 -0
  69. package/build/types/calendar/dayCalendar/table/index.d.ts.map +1 -0
  70. package/build/types/calendar/getFocusableTime/getFocusableTime.d.ts.map +1 -0
  71. package/build/types/calendar/getStartOfDay/getStartOfDay.d.ts.map +1 -0
  72. package/build/types/calendar/getStartOfDay/index.d.ts.map +1 -0
  73. package/build/types/calendar/index.d.ts +3 -0
  74. package/build/types/calendar/index.d.ts.map +1 -0
  75. package/build/types/{dateLookup → calendar}/monthCalendar/MonthCalendar.d.ts +1 -1
  76. package/build/types/calendar/monthCalendar/MonthCalendar.d.ts.map +1 -0
  77. package/build/types/calendar/monthCalendar/index.d.ts.map +1 -0
  78. package/build/types/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.d.ts +1 -1
  79. package/build/types/calendar/monthCalendar/table/MonthCalendarTable.d.ts.map +1 -0
  80. package/build/types/calendar/monthCalendar/table/index.d.ts.map +1 -0
  81. package/build/types/calendar/tableLink/TableLink.d.ts.map +1 -0
  82. package/build/types/calendar/tableLink/index.d.ts.map +1 -0
  83. package/build/types/{dateLookup → calendar}/yearCalendar/YearCalendar.d.ts +1 -1
  84. package/build/types/calendar/yearCalendar/YearCalendar.d.ts.map +1 -0
  85. package/build/types/calendar/yearCalendar/index.d.ts.map +1 -0
  86. package/build/types/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.d.ts +1 -1
  87. package/build/types/calendar/yearCalendar/table/YearCalendarTable.d.ts.map +1 -0
  88. package/build/types/calendar/yearCalendar/table/index.d.ts.map +1 -0
  89. package/build/types/dateLookup/DateLookup.d.ts +2 -26
  90. package/build/types/dateLookup/DateLookup.d.ts.map +1 -1
  91. package/build/types/index.d.ts +2 -0
  92. package/build/types/index.d.ts.map +1 -1
  93. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts +3 -2
  94. package/build/types/prompt/InfoPrompt/InfoPrompt.d.ts.map +1 -1
  95. package/build/types/sentimentSurface/SentimentSurface.d.ts.map +1 -1
  96. package/package.json +2 -2
  97. package/src/calendar/Calendar.css +83 -0
  98. package/src/calendar/Calendar.less +79 -0
  99. package/src/calendar/Calendar.story.tsx +92 -0
  100. package/src/calendar/Calendar.test.tsx +138 -0
  101. package/src/calendar/Calendar.tsx +165 -0
  102. package/src/{dateLookup → calendar}/dateHeader/DateHeader.tsx +1 -1
  103. package/src/{dateLookup → calendar}/dayCalendar/DayCalendar.tsx +1 -1
  104. package/src/calendar/index.ts +2 -0
  105. package/src/{dateLookup → calendar}/monthCalendar/MonthCalendar.tsx +2 -2
  106. package/src/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.tsx +1 -1
  107. package/src/{dateLookup → calendar}/tableLink/TableLink.tsx +1 -1
  108. package/src/{dateLookup → calendar}/yearCalendar/YearCalendar.tsx +2 -2
  109. package/src/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.tsx +1 -1
  110. package/src/criticalBanner/CriticalCommsBanner.test.tsx +1 -1
  111. package/src/dateLookup/DateLookup.css +0 -90
  112. package/src/dateLookup/DateLookup.less +0 -91
  113. package/src/dateLookup/DateLookup.test.tsx +0 -124
  114. package/src/dateLookup/DateLookup.tsx +31 -161
  115. package/src/index.ts +2 -0
  116. package/src/main.css +624 -688
  117. package/src/main.less +1 -0
  118. package/src/prompt/InfoPrompt/InfoPrompt.story.tsx +42 -0
  119. package/src/prompt/InfoPrompt/InfoPrompt.test.tsx +65 -1
  120. package/src/prompt/InfoPrompt/InfoPrompt.tsx +15 -4
  121. package/src/sentimentSurface/SentimentSurface.css +325 -337
  122. package/src/sentimentSurface/SentimentSurface.docs.mdx +2 -0
  123. package/src/sentimentSurface/SentimentSurface.less +2 -322
  124. package/src/sentimentSurface/SentimentSurface.story.tsx +4 -0
  125. package/src/sentimentSurface/SentimentSurface.test.story.tsx +1 -5
  126. package/src/sentimentSurface/SentimentSurface.test.tsx +84 -3
  127. package/src/sentimentSurface/SentimentSurface.tsx +10 -2
  128. package/build/dateLookup/DateLookup.messages.js.map +0 -1
  129. package/build/dateLookup/DateLookup.messages.mjs.map +0 -1
  130. package/build/dateLookup/dateHeader/DateHeader.js.map +0 -1
  131. package/build/dateLookup/dateHeader/DateHeader.mjs.map +0 -1
  132. package/build/dateLookup/dayCalendar/DayCalendar.js.map +0 -1
  133. package/build/dateLookup/dayCalendar/DayCalendar.mjs.map +0 -1
  134. package/build/dateLookup/dayCalendar/table/DayCalendarTable.js.map +0 -1
  135. package/build/dateLookup/dayCalendar/table/DayCalendarTable.mjs.map +0 -1
  136. package/build/dateLookup/getFocusableTime/getFocusableTime.js.map +0 -1
  137. package/build/dateLookup/getFocusableTime/getFocusableTime.mjs.map +0 -1
  138. package/build/dateLookup/getStartOfDay/getStartOfDay.js.map +0 -1
  139. package/build/dateLookup/getStartOfDay/getStartOfDay.mjs.map +0 -1
  140. package/build/dateLookup/monthCalendar/MonthCalendar.js.map +0 -1
  141. package/build/dateLookup/monthCalendar/MonthCalendar.mjs.map +0 -1
  142. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.js.map +0 -1
  143. package/build/dateLookup/monthCalendar/table/MonthCalendarTable.mjs.map +0 -1
  144. package/build/dateLookup/tableLink/TableLink.js.map +0 -1
  145. package/build/dateLookup/tableLink/TableLink.mjs.map +0 -1
  146. package/build/dateLookup/yearCalendar/YearCalendar.js.map +0 -1
  147. package/build/dateLookup/yearCalendar/YearCalendar.mjs.map +0 -1
  148. package/build/dateLookup/yearCalendar/table/YearCalendarTable.js.map +0 -1
  149. package/build/dateLookup/yearCalendar/table/YearCalendarTable.mjs.map +0 -1
  150. package/build/types/dateLookup/DateLookup.messages.d.ts.map +0 -1
  151. package/build/types/dateLookup/dateHeader/DateHeader.d.ts.map +0 -1
  152. package/build/types/dateLookup/dateHeader/index.d.ts.map +0 -1
  153. package/build/types/dateLookup/dayCalendar/DayCalendar.d.ts.map +0 -1
  154. package/build/types/dateLookup/dayCalendar/index.d.ts.map +0 -1
  155. package/build/types/dateLookup/dayCalendar/table/DayCalendarTable.d.ts.map +0 -1
  156. package/build/types/dateLookup/dayCalendar/table/index.d.ts.map +0 -1
  157. package/build/types/dateLookup/getFocusableTime/getFocusableTime.d.ts.map +0 -1
  158. package/build/types/dateLookup/getStartOfDay/getStartOfDay.d.ts.map +0 -1
  159. package/build/types/dateLookup/getStartOfDay/index.d.ts.map +0 -1
  160. package/build/types/dateLookup/monthCalendar/MonthCalendar.d.ts.map +0 -1
  161. package/build/types/dateLookup/monthCalendar/index.d.ts.map +0 -1
  162. package/build/types/dateLookup/monthCalendar/table/MonthCalendarTable.d.ts.map +0 -1
  163. package/build/types/dateLookup/monthCalendar/table/index.d.ts.map +0 -1
  164. package/build/types/dateLookup/tableLink/TableLink.d.ts.map +0 -1
  165. package/build/types/dateLookup/tableLink/index.d.ts.map +0 -1
  166. package/build/types/dateLookup/yearCalendar/YearCalendar.d.ts.map +0 -1
  167. package/build/types/dateLookup/yearCalendar/index.d.ts.map +0 -1
  168. package/build/types/dateLookup/yearCalendar/table/YearCalendarTable.d.ts.map +0 -1
  169. package/build/types/dateLookup/yearCalendar/table/index.d.ts.map +0 -1
  170. /package/build/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.js +0 -0
  171. /package/build/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.mjs +0 -0
  172. /package/build/{dateLookup → calendar}/getFocusableTime/getFocusableTime.js +0 -0
  173. /package/build/{dateLookup → calendar}/getFocusableTime/getFocusableTime.mjs +0 -0
  174. /package/build/{dateLookup → calendar}/getStartOfDay/getStartOfDay.js +0 -0
  175. /package/build/{dateLookup → calendar}/getStartOfDay/getStartOfDay.mjs +0 -0
  176. /package/build/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.js +0 -0
  177. /package/build/{dateLookup → calendar}/monthCalendar/table/MonthCalendarTable.mjs +0 -0
  178. /package/build/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.js +0 -0
  179. /package/build/{dateLookup → calendar}/yearCalendar/table/YearCalendarTable.mjs +0 -0
  180. /package/build/types/{dateLookup → calendar}/dateHeader/DateHeader.d.ts +0 -0
  181. /package/build/types/{dateLookup → calendar}/dateHeader/index.d.ts +0 -0
  182. /package/build/types/{dateLookup → calendar}/dayCalendar/DayCalendar.d.ts +0 -0
  183. /package/build/types/{dateLookup → calendar}/dayCalendar/index.d.ts +0 -0
  184. /package/build/types/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.d.ts +0 -0
  185. /package/build/types/{dateLookup → calendar}/dayCalendar/table/index.d.ts +0 -0
  186. /package/build/types/{dateLookup → calendar}/getFocusableTime/getFocusableTime.d.ts +0 -0
  187. /package/build/types/{dateLookup → calendar}/getStartOfDay/getStartOfDay.d.ts +0 -0
  188. /package/build/types/{dateLookup → calendar}/getStartOfDay/index.d.ts +0 -0
  189. /package/build/types/{dateLookup → calendar}/monthCalendar/index.d.ts +0 -0
  190. /package/build/types/{dateLookup → calendar}/monthCalendar/table/index.d.ts +0 -0
  191. /package/build/types/{dateLookup → calendar}/tableLink/TableLink.d.ts +0 -0
  192. /package/build/types/{dateLookup → calendar}/tableLink/index.d.ts +0 -0
  193. /package/build/types/{dateLookup → calendar}/yearCalendar/index.d.ts +0 -0
  194. /package/build/types/{dateLookup → calendar}/yearCalendar/table/index.d.ts +0 -0
  195. /package/src/{dateLookup/DateLookup.messages.ts → calendar/Calendar.messages.ts} +0 -0
  196. /package/src/{dateLookup → calendar}/dateHeader/index.ts +0 -0
  197. /package/src/{dateLookup → calendar}/dayCalendar/index.ts +0 -0
  198. /package/src/{dateLookup → calendar}/dayCalendar/table/DayCalendarTable.tsx +0 -0
  199. /package/src/{dateLookup → calendar}/dayCalendar/table/index.ts +0 -0
  200. /package/src/{dateLookup → calendar}/getFocusableTime/getFocusable.test.ts +0 -0
  201. /package/src/{dateLookup → calendar}/getFocusableTime/getFocusableTime.tsx +0 -0
  202. /package/src/{dateLookup → calendar}/getStartOfDay/getStartOfDay.test.js +0 -0
  203. /package/src/{dateLookup → calendar}/getStartOfDay/getStartOfDay.tsx +0 -0
  204. /package/src/{dateLookup → calendar}/getStartOfDay/index.ts +0 -0
  205. /package/src/{dateLookup → calendar}/monthCalendar/index.ts +0 -0
  206. /package/src/{dateLookup → calendar}/monthCalendar/table/index.ts +0 -0
  207. /package/src/{dateLookup → calendar}/tableLink/index.ts +0 -0
  208. /package/src/{dateLookup → calendar}/yearCalendar/index.ts +0 -0
  209. /package/src/{dateLookup → calendar}/yearCalendar/table/index.ts +0 -0
@@ -36,6 +36,8 @@ Each `SentimentSurface` sets tokens for content, interactive elements, and backg
36
36
  --color-sentiment-background-surface
37
37
  --color-sentiment-background-surface-hover
38
38
  --color-sentiment-background-surface-active
39
+
40
+ --color-sentiment-border-overlay
39
41
  `} />
40
42
 
41
43
  ## Using Tokens in Components
@@ -1,330 +1,10 @@
1
+ @import "@transferwise/neptune-tokens/sentiment/sentiments.css";
2
+
1
3
  .wds-sentiment-surface {
2
4
  &--hasBaseStyles {
3
5
  background-color: var(--color-sentiment-background-surface);
4
6
  color: var(--color-sentiment-content-primary);
5
7
  }
6
8
 
7
- &-negative {
8
- .np-theme-personal&,
9
- .np-theme-business&,
10
- .np-theme-platform&,
11
- .np-theme-personal--bright-green&,
12
- .np-theme-business--bright-green& {
13
- &-base {
14
- .sentiment-surface-tokens(
15
- #CB272F, #B8232B, #A72027,
16
- #CB272F, #B8232B, #A72027,
17
- #FBEAEA, #F9E1E1, #F8D8D8,
18
- #F5D3D4, #F0BDBE, #ECACAD,
19
- #FBEAEA, #F9E1E1, #F8D8D8,
20
- #FBEAEA, #F9E1E1, #F8D8D8
21
- );
22
- }
23
- &-elevated {
24
- .sentiment-surface-tokens(
25
- #FFFFFF, #F5CCCC, #F1B7B7,
26
- #FBEAEA, #F5CCCC, #F1B7B7,
27
- #CB272F, #B8232B, #A72027,
28
- #9B141B, #831116, #6D0e13,
29
- #CB272F, #B8232B, #A72027,
30
- #CB272F, #B8232B, #A72027
31
- );
32
- }
33
- }
34
-
35
- .np-theme-personal--dark&,
36
- .np-theme-business--dark&,
37
- .np-theme-personal--forest-green&,
38
- .np-theme-business--forest-green&,
39
- .np-theme-platform--forest-green& {
40
- &-base {
41
- .sentiment-surface-tokens(
42
- #FFA8AD, #FFBDC0, #FFD1D3,
43
- #FFA8AD, #FFBDC0, #FFD1D3,
44
- #410B0D, #641115, #761418,
45
- #601013, #7A1519, #90181D,
46
- #410B0D, #641115, #761418,
47
- #410B0D, #641115, #761418
48
- );
49
- }
50
- &-elevated {
51
- .sentiment-surface-tokens(
52
- #410B0D, #641115, #761418,
53
- #410B0D, #641115, #761418,
54
- #FFA8AD, #FFBDC0, #FFD1D3,
55
- #D9898D, #D68084, #D06C71,
56
- #FFA8AD, #FFBDC0, #FFD1D3,
57
- #FFA8AD, #FFBDC0, #FFD1D3
58
- );
59
- }
60
- }
61
- }
62
-
63
- &-warning {
64
- .np-theme-personal&,
65
- .np-theme-business&,
66
- .np-theme-platform&,
67
- .np-theme-personal--bright-green&,
68
- .np-theme-business--bright-green& {
69
- &-base {
70
- .sentiment-surface-tokens(
71
- #4A3B1C, #302612, #2C2311, // content-primary (default, hover, active)
72
- #FFD11A, #FFBF0F, #FFBB00, // interactive-primary
73
- #FFF7D7, #FFF0B2, #FFE98F, // interactive-secondary
74
- #FFEC9E, #FFE187, #FFD55F, // interactive-secondary-neutral
75
- #4A3B1C, #302612, #2C2311, // interactive-control
76
- #FFF7D7, #FFF0B2, #FFE98F // background-surface
77
- );
78
- }
79
- &-elevated {
80
- .sentiment-surface-tokens(
81
- #4A3B1C, #302612, #2C2311, // content-primary
82
- #4A3B1C, #302612, #2C2311, // interactive-primary
83
- #FFD11A, #FFBF0F, #FFBB00, // interactive-secondary
84
- #FFEC9E, #FFEDB8, #FFF2CC, // interactive-secondary-neutral
85
- #FFD11A, #FFBF0F, #FFBB00, // interactive-control
86
- #FFD11A, #FFBF0F, #FFBB00 // background-surface
87
- );
88
- }
89
- }
90
-
91
- .np-theme-personal--dark&,
92
- .np-theme-business--dark&,
93
- .np-theme-personal--forest-green&,
94
- .np-theme-business--forest-green&,
95
- .np-theme-platform--forest-green& {
96
- &-base {
97
- .sentiment-surface-tokens(
98
- #FADC65, #F9D648, #F8CD20, // content-primary
99
- #FADC65, #F9D648, #F8CD20, // interactive-primary
100
- #3A3523, #504930, #665D3D, // interactive-secondary
101
- #4D462A, #5D532F, #685D33, // interactive-secondary-neutral
102
- #3A3523, #504930, #665D3D, // interactive-control
103
- #3A3523, #504930, #665D3D // background-surface
104
- );
105
- }
106
- &-elevated {
107
- .sentiment-surface-tokens(
108
- #3A3523, #504930, #665D3D, // content-primary
109
- #3A3523, #504930, #665D3D, // interactive-primary
110
- #FADC65, #F9D648, #F8CD20, // interactive-secondary
111
- #E3C85D, #DFC044, #D9B526, // interactive-secondary-neutral
112
- #FADC65, #F9D648, #F8CD20, // interactive-control
113
- #FADC65, #F9D648, #F8CD20 // background-surface
114
- );
115
- }
116
- }
117
- }
118
- &-success {
119
- .np-theme-personal&,
120
- .np-theme-business&,
121
- .np-theme-platform&,
122
- .np-theme-personal--bright-green&,
123
- .np-theme-business--bright-green& {
124
- &-base {
125
- .sentiment-surface-tokens(
126
- #054D28, #043A1E, #022614, // content-primary (default, hover, active)
127
- #054D28, #043A1E, #022614, // interactive-primary
128
- #E2F6D5, #D3F2C0, #C5EDAB, // interactive-secondary
129
- #BCD9B8, #AACFA5, #94C38E, // interactive-secondary-neutral
130
- #E2F6D5, #D3F2C0, #C5EDAB, // interactive-control
131
- #E2F6D5, #D3F2C0, #C5EDAB // background-surface
132
- );
133
- }
134
- &-elevated {
135
- .sentiment-surface-tokens(
136
- #CEF1B8, #E0FFCC, #E1F4D4, // content-primary
137
- #CEF1B8, #E0FFCC, #E1F4D4, // interactive-primary
138
- #054D28, #043A1E, #022614, // interactive-secondary
139
- #256A43, #2A794C, #329057, // interactive-secondary-neutral
140
- #054D28, #043A1E, #022614, // interactive-control
141
- #054D28, #043A1E, #022614 // background-surface
142
- );
143
- }
144
- }
145
-
146
- .np-theme-personal--dark&,
147
- .np-theme-business--dark&,
148
- .np-theme-personal--forest-green&,
149
- .np-theme-business--forest-green&,
150
- .np-theme-platform--forest-green& {
151
- &-base {
152
- .sentiment-surface-tokens(
153
- #CEF1B8, #E0FFCC, #E1F4D4, // content-primary
154
- #CEF1B8, #E0FFCC, #E1F4D4, // interactive-primary
155
- #054D28, #043A1E, #022614, // interactive-secondary
156
- #256A43, #2A794C, #329057, // interactive-secondary-neutral
157
- #054D28, #043A1E, #022614, // interactive-control
158
- #054D28, #043A1E, #022614 // background-surface
159
- );
160
- }
161
- &-elevated {
162
- .sentiment-surface-tokens(
163
- #252C20, #323B2B, #3E4A36, // content-primary
164
- #252C20, #323B2B, #3E4A36, // interactive-primary
165
- #BAE5A0, #C8EAB3, #D6F0C7, // interactive-secondary
166
- #A8CF91, #94C478, #83BB63, // interactive-secondary-neutral
167
- #BAE5A0, #C8EAB3, #D6F0C7, // interactive-control
168
- #BAE5A0, #C8EAB3, #D6F0C7 // background-surface
169
- );
170
- }
171
- }
172
- }
173
- &-neutral {
174
- .np-theme-personal&,
175
- .np-theme-business&,
176
- .np-theme-platform&,
177
- .np-theme-personal--bright-green&,
178
- .np-theme-business--bright-green& {
179
- &-base {
180
- .sentiment-surface-tokens(
181
- #454745, #353635, #232423, // content-primary (default, hover, active)
182
- #454745, #353635, #232423, // interactive-primary
183
- rgba(62, 59, 7, 0.07), rgba(62, 59, 7, 0.12), rgba(62, 59, 7, 0.17), // interactive-secondary
184
- rgba(62, 59, 7, 0.07), rgba(62, 59, 7, 0.12), rgba(62, 59, 7, 0.17), // interactive-secondary-neutral
185
- #F1F1ED, #E7E7E1, #DFDED5, // interactive-control
186
- rgba(62, 59, 7, 0.07), rgba(62, 59, 7, 0.12), rgba(62, 59, 7, 0.17) // background-surface
187
- );
188
- }
189
- &-elevated {
190
- .sentiment-surface-tokens(
191
- #F1F1ED, #E7E7E1, #DFDED5, // content-primary
192
- #F1F1ED, #E7E7E1, #DFDED5, // interactive-primary
193
- #454745, #353635, #232423, // interactive-secondary
194
- #585958, #6A6C6A, #7D7E7D, // interactive-secondary-neutral
195
- #454745, #353635, #232423, // interactive-control
196
- #454745, #353635, #232423 // background-surface
197
- );
198
- }
199
- }
200
-
201
- .np-theme-personal--dark&,
202
- .np-theme-business--dark&,
203
- .np-theme-personal--forest-green&,
204
- .np-theme-business--forest-green&,
205
- .np-theme-platform--forest-green& {
206
- &-base {
207
- .sentiment-surface-tokens(
208
- #F1F1ED, #E7E7E1, #DFDED5, // content-primary
209
- #F1F1ED, #E7E7E1, #DFDED5, // interactive-primary
210
- rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.30), // interactive-secondary
211
- rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.30), // interactive-secondary-neutral
212
- #2A2C29, #414441, #595B58, // interactive-control
213
- rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.20), rgba(255, 255, 255, 0.30) // background-surface
214
- );
215
- }
216
- &-elevated {
217
- .sentiment-surface-tokens(
218
- #2A2C29, #414441, #595B58, // content-primary
219
- #2A2C29, #414441, #595B58, // interactive-primary
220
- #F1F1ED, #E7E7E1, #DFDED5, // interactive-secondary
221
- #E4E4DC, #DCDCD2, #D3D2C6, // interactive-secondary-neutral
222
- #F1F1ED, #E7E7E1, #DFDED5, // interactive-control
223
- #F1F1ED, #E7E7E1, #DFDED5 // background-surface
224
- );
225
- }
226
- }
227
- }
228
- &-proposition {
229
- .np-theme-personal&,
230
- .np-theme-business&,
231
- .np-theme-platform&,
232
- .np-theme-personal--bright-green&,
233
- .np-theme-business--bright-green& {
234
- &-base {
235
- .sentiment-surface-tokens(
236
- #0E0F0C, #0A2826, #074140, // content-primary (default, hover, active)
237
- #054D4D, #043A3A, #022626, // interactive-primary
238
- #E0F7F7, #CAF1F1, #B6ECEC, // interactive-secondary
239
- #B4D5D5, #A3CCCC, #9AC6C6, // interactive-secondary-neutral
240
- #E0F7F7, #CAF1F1, #B6ECEC, // interactive-control
241
- #E0F7F7, #CAF1F1, #B6ECEC // background-surface
242
- );
243
- }
244
- &-elevated {
245
- .sentiment-surface-tokens(
246
- #FFFFFF, #EAF9F9, #D5F4F4, // content-primary
247
- #E0F7F7, #CAF1F1, #B6ECEC, // interactive-primary
248
- #054D4D, #043A3A, #022626, // interactive-secondary
249
- #1F6161, #247070, #298080, // interactive-secondary-neutral
250
- #054D4D, #043A3A, #022626, // interactive-control
251
- #054D4D, #043A3A, #022626 // background-surface
252
- );
253
- }
254
- }
255
-
256
- .np-theme-personal--dark&,
257
- .np-theme-business--dark&,
258
- .np-theme-personal--forest-green&,
259
- .np-theme-business--forest-green&,
260
- .np-theme-platform--forest-green& {
261
- &-base {
262
- .sentiment-surface-tokens(
263
- #FFFFFF, #EAF9F9, #D5F4F4, // content-primary
264
- #E0F7F7, #CAF1F1, #B6ECEC, // interactive-primary
265
- #054D4D, #043A3A, #022626, // interactive-secondary
266
- #1F6161, #247070, #298080, // interactive-secondary-neutral
267
- #054D4D, #043A3A, #022626, // interactive-control
268
- #054D4D, #043A3A, #022626 // background-surface
269
- );
270
- }
271
- &-elevated {
272
- .sentiment-surface-tokens(
273
- #0E0F0C, #0A2826, #074140, // content-primary
274
- #0B312F, #104744, #16605C, // interactive-primary
275
- #E0F7F7, #CAF1F1, #B6ECEC, // interactive-secondary
276
- #B4D5D5, #A3CCCC, #9AC6C6, // interactive-secondary-neutral
277
- #E0F7F7, #CAF1F1, #B6ECEC, // interactive-control
278
- #E0F7F7, #CAF1F1, #B6ECEC // background-surface
279
- );
280
- }
281
- }
282
- }
283
-
284
9
  --ring-outline-color: var(--color-sentiment-content-primary, var(--color-content-primary));
285
10
  }
286
-
287
- .sentiment-surface-tokens(
288
- @content-primary,
289
- @content-primary-hover,
290
- @content-primary-active,
291
- @interactive-primary,
292
- @interactive-primary-hover,
293
- @interactive-primary-active,
294
- @interactive-secondary,
295
- @interactive-secondary-hover,
296
- @interactive-secondary-active,
297
- @interactive-secondary-neutral,
298
- @interactive-secondary-neutral-hover,
299
- @interactive-secondary-neutral-active,
300
- @interactive-control,
301
- @interactive-control-hover,
302
- @interactive-control-active,
303
- @background-surface,
304
- @background-surface-hover,
305
- @background-surface-active
306
- ) {
307
- --color-sentiment-content-primary: @content-primary;
308
- --color-sentiment-content-primary-hover: @content-primary-hover;
309
- --color-sentiment-content-primary-active: @content-primary-active;
310
-
311
- --color-sentiment-interactive-primary: @interactive-primary;
312
- --color-sentiment-interactive-primary-hover: @interactive-primary-hover;
313
- --color-sentiment-interactive-primary-active: @interactive-primary-active;
314
-
315
- --color-sentiment-interactive-secondary: @interactive-secondary;
316
- --color-sentiment-interactive-secondary-hover: @interactive-secondary-hover;
317
- --color-sentiment-interactive-secondary-active: @interactive-secondary-active;
318
-
319
- --color-sentiment-interactive-secondary-neutral: @interactive-secondary-neutral;
320
- --color-sentiment-interactive-secondary-neutral-hover: @interactive-secondary-neutral-hover;
321
- --color-sentiment-interactive-secondary-neutral-active: @interactive-secondary-neutral-active;
322
-
323
- --color-sentiment-interactive-control: @interactive-control;
324
- --color-sentiment-interactive-control-hover: @interactive-control-hover;
325
- --color-sentiment-interactive-control-active: @interactive-control-active;
326
-
327
- --color-sentiment-background-surface: @background-surface;
328
- --color-sentiment-background-surface-hover: @background-surface-hover;
329
- --color-sentiment-background-surface-active: @background-surface-active;
330
- }
@@ -170,6 +170,10 @@ const tokenCategories = [
170
170
  '--color-sentiment-background-surface-active',
171
171
  ],
172
172
  },
173
+ {
174
+ name: 'Border',
175
+ tokens: ['--color-sentiment-border-overlay'],
176
+ },
173
177
  ];
174
178
 
175
179
  const TokenSwatch = ({ token }: { token: string }) => (
@@ -83,11 +83,7 @@ const ButtonsGrid = () => (
83
83
  key={`${sentiment}-${emphasis}`}
84
84
  sentiment={sentiment}
85
85
  emphasis={emphasis}
86
- style={{
87
- backgroundColor: 'var(--color-sentiment-background-surface)',
88
- color: 'var(--color-sentiment-content-primary)',
89
- padding: '16px',
90
- }}
86
+ className="p-a-2"
91
87
  >
92
88
  <span
93
89
  style={{
@@ -1,3 +1,5 @@
1
+ import { ThemeProvider } from '@wise/components-theming';
2
+
1
3
  import { render, screen } from '../test-utils';
2
4
  import SentimentSurface from './SentimentSurface';
3
5
  import { Sentiment, Emphasis } from './SentimentSurface.types';
@@ -62,7 +64,7 @@ describe('SentimentSurface', () => {
62
64
  );
63
65
  const element = screen.getByTestId('surface');
64
66
  expect(element).toHaveClass('wds-sentiment-surface');
65
- expect(element).toHaveClass(`wds-sentiment-surface-${sentiment}-base`);
67
+ expect(element).toHaveClass(`wds-sentiment-${sentiment}-light-base`);
66
68
  });
67
69
  });
68
70
  });
@@ -79,7 +81,7 @@ describe('SentimentSurface', () => {
79
81
  );
80
82
  const element = screen.getByTestId('surface');
81
83
  expect(element).toHaveClass('wds-sentiment-surface');
82
- expect(element).toHaveClass(`wds-sentiment-surface-neutral-${emphasis}`);
84
+ expect(element).toHaveClass(`wds-sentiment-neutral-light-${emphasis}`);
83
85
  });
84
86
  });
85
87
 
@@ -91,7 +93,7 @@ describe('SentimentSurface', () => {
91
93
  );
92
94
  const element = screen.getByTestId('surface');
93
95
  expect(element).toHaveClass('wds-sentiment-surface');
94
- expect(element).toHaveClass('wds-sentiment-surface-neutral-base');
96
+ expect(element).toHaveClass('wds-sentiment-neutral-light-base');
95
97
  });
96
98
  });
97
99
 
@@ -137,6 +139,85 @@ describe('SentimentSurface', () => {
137
139
  });
138
140
  });
139
141
 
142
+ describe('dark mode detection', () => {
143
+ it('uses dark mode class for forest-green theme', () => {
144
+ render(
145
+ <ThemeProvider theme="forest-green">
146
+ <SentimentSurface sentiment="negative" data-testid="surface">
147
+ {testContent}
148
+ </SentimentSurface>
149
+ </ThemeProvider>,
150
+ );
151
+ expect(screen.getByTestId('surface')).toHaveClass('wds-sentiment-negative-dark-base');
152
+ });
153
+
154
+ it('uses dark mode class for business--forest-green theme', () => {
155
+ render(
156
+ <ThemeProvider theme="business--forest-green">
157
+ <SentimentSurface sentiment="warning" emphasis="elevated" data-testid="surface">
158
+ {testContent}
159
+ </SentimentSurface>
160
+ </ThemeProvider>,
161
+ );
162
+ expect(screen.getByTestId('surface')).toHaveClass('wds-sentiment-warning-dark-elevated');
163
+ });
164
+
165
+ it('uses dark mode class for dark screen mode', () => {
166
+ render(
167
+ <ThemeProvider theme="personal" screenMode="dark">
168
+ <SentimentSurface sentiment="success" data-testid="surface">
169
+ {testContent}
170
+ </SentimentSurface>
171
+ </ThemeProvider>,
172
+ );
173
+ expect(screen.getByTestId('surface')).toHaveClass('wds-sentiment-success-dark-base');
174
+ });
175
+
176
+ it('uses light mode class for bright-green theme', () => {
177
+ render(
178
+ <ThemeProvider theme="bright-green">
179
+ <SentimentSurface sentiment="neutral" data-testid="surface">
180
+ {testContent}
181
+ </SentimentSurface>
182
+ </ThemeProvider>,
183
+ );
184
+ expect(screen.getByTestId('surface')).toHaveClass('wds-sentiment-neutral-light-base');
185
+ });
186
+
187
+ it('uses light mode class for np-theme-platform in light mode', () => {
188
+ render(
189
+ <ThemeProvider theme="platform" screenMode="light">
190
+ <SentimentSurface sentiment="neutral" data-testid="surface">
191
+ {testContent}
192
+ </SentimentSurface>
193
+ </ThemeProvider>,
194
+ );
195
+ expect(screen.getByTestId('surface')).toHaveClass('wds-sentiment-neutral-light-base');
196
+ });
197
+
198
+ it('uses light mode class for np-theme-platform in dark mode', () => {
199
+ render(
200
+ <ThemeProvider theme="platform" screenMode="dark">
201
+ <SentimentSurface sentiment="neutral" data-testid="surface">
202
+ {testContent}
203
+ </SentimentSurface>
204
+ </ThemeProvider>,
205
+ );
206
+ expect(screen.getByTestId('surface')).toHaveClass('wds-sentiment-neutral-light-base');
207
+ });
208
+
209
+ it('uses dark mode class for np-theme-platform--forest-green', () => {
210
+ render(
211
+ <ThemeProvider theme="platform--forest-green">
212
+ <SentimentSurface sentiment="negative" data-testid="surface">
213
+ {testContent}
214
+ </SentimentSurface>
215
+ </ThemeProvider>,
216
+ );
217
+ expect(screen.getByTestId('surface')).toHaveClass('wds-sentiment-negative-dark-base');
218
+ });
219
+ });
220
+
140
221
  describe('HTML attributes', () => {
141
222
  it('supports aria-label attribute', () => {
142
223
  const ariaLabel = 'Surface label';
@@ -54,11 +54,19 @@ const SentimentSurface: SentimentSurfaceComponent = forwardRef(function Sentimen
54
54
  ) {
55
55
  const Element = as ?? 'div';
56
56
  const BASE_CLASS = 'wds-sentiment-surface';
57
- const { className: closestBrandTheme } = useTheme();
57
+ const { className: closestBrandTheme, isScreenModeDark: isDark, theme } = useTheme();
58
+
59
+ const getThemeBrightness = () => {
60
+ const isForestGreen = theme.includes('forest-green');
61
+ const isPlatform = theme.includes('platform');
62
+
63
+ return isForestGreen || (isDark && !isPlatform) ? 'dark' : 'light';
64
+ };
65
+
58
66
  const classNames = clsx(
59
67
  closestBrandTheme,
60
68
  BASE_CLASS,
61
- `${BASE_CLASS}-${sentiment}-${emphasis}`,
69
+ `wds-sentiment-${sentiment}-${getThemeBrightness()}-${emphasis}`,
62
70
  hasBaseStyles && `${BASE_CLASS}--hasBaseStyles`,
63
71
  className,
64
72
  );
@@ -1 +0,0 @@
1
- {"version":3,"file":"DateLookup.messages.js","sources":["../../src/dateLookup/DateLookup.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;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DateLookup.messages.mjs","sources":["../../src/dateLookup/DateLookup.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;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DateHeader.js","sources":["../../../src/dateLookup/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 '../DateLookup.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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;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AACC,2BAAQ,CAACU,cAAc,CAAE;AACxDC,QAAAA,QAAQ,EAAE;AAAEN,UAAAA,IAAI,EAAE,MAAM;AAAEO,UAAAA,KAAK,eAAEjB,cAAA,CAACkB,iBAAW,EAAA,EAAA;SAAM;AACnDX,QAAAA,OAAO,EAAEnB,YAAa;AAAAW,QAAAA,QAAA,EAErBZ;OACK;KACH,CACR,eACDa,cAAA,CAAA,KAAA,EAAA;AAAKH,MAAAA,SAAS,EAAC,6BAA6B;MAAAE,QAAA,eAC1CC,cAAA,CAACC,kBAAU,EAAA;AACTC,QAAAA,IAAI,EAAE,EAAG;AACTL,QAAAA,SAAS,EAAC,eAAe;QACzB,YAAA,EAAY,CAAA,EAAGL,IAAI,CAACY,aAAa,CAACC,2BAAQ,CAACc,IAAI,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;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DateHeader.mjs","sources":["../../../src/dateLookup/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 '../DateLookup.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,gBAA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C,GAAA,CAACC,UAAU,EAAA;AACTC,QAAAA,IAAI,EAAE,EAAG;AACTL,QAAAA,SAAS,EAAC,eAAe;QACzB,YAAA,EAAY,CAAA,EAAGL,IAAI,CAACY,aAAa,CAACC,QAAQ,CAACc,IAAI,CAAC,CAAA,CAAA,EAAI5B,QAAQ,CAAA,CAAG;AAC/DY,QAAAA,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;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DayCalendar.js","sources":["../../../src/dateLookup/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 '../DateLookup.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;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;MACTC,QAAQ;AACRU,MAAAA,IAAI,EAAE;QAAEC,MAAM;AAAEC,QAAAA;OAAe;MAC/BC,WAAW;MACXC,YAAY;AACZC,MAAAA;KACD,GAAG,IAAI,CAACd,KAAK;IACd,oBACEe,eAAA,CAAAC,mBAAA,EAAA;MAAAC,QAAA,EAAA,cACEC,cAAA,CAACC,kBAAU,EAAA;AACTC,QAAAA,KAAK,EAAEC,qBAAU,CAAC,IAAIC,IAAI,CAACvB,QAAQ,EAAED,SAAS,CAAC,EAAEY,MAAM,EAAE;AACvDR,UAAAA,KAAK,EAAEU,WAAW;AAClBT,UAAAA,IAAI,EAAE;AACP,SAAA,CAAE;AACHoB,QAAAA,QAAQ,EAAEZ,aAAa,CAACa,2BAAQ,CAACtB,KAAK,CAAE;AACxCW,QAAAA,YAAY,EAAEA,YAAa;QAC3BY,eAAe,EAAE,IAAI,CAAC5B,mBAAoB;QAC1C6B,WAAW,EAAE,IAAI,CAACtB;AAAgB,OAAA,CAEpC,eAAAc,cAAA,CAACS,wBAAgB,EAAA;QAAOrB,YAAY;QAAEC,GAAG;QAAEC,GAAG;QAAEV,SAAS;QAAEC,QAAQ;AAAEe,QAAAA;AAAQ,OAAG,CAClF;AAAA,KAAA,CAAG;AAEP,EAAA;AACD;AAED,kBAAec,oBAAU,CAACjC,aAAW,CAAC;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DayCalendar.mjs","sources":["../../../src/dateLookup/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 '../DateLookup.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;AAC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tB;AAAgB,OAAA,CAEpC,eAAAc,GAAA,CAACS,gBAAgB,EAAA;QAAOrB,YAAY;QAAEC,GAAG;QAAEC,GAAG;QAAEV,SAAS;QAAEC,QAAQ;AAAEe,QAAAA;AAAQ,OAAG,CAClF;AAAA,KAAA,CAAG;AAEP,EAAA;AACD;AAED,oBAAec,UAAU,CAACjC,WAAW,CAAC;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DayCalendarTable.js","sources":["../../../../src/dateLookup/dayCalendar/table/DayCalendarTable.tsx"],"sourcesContent":["import { formatDate } from '@transferwise/formatting';\nimport { PureComponent } from 'react';\nimport { injectIntl, type WrappedComponentProps } from 'react-intl';\n\nimport { getDayNames, isWithinRange } from '../../../common/dateUtils';\nimport { getFocusableTime } from '../../getFocusableTime/getFocusableTime';\nimport { getStartOfDay } from '../../getStartOfDay';\nimport TableLink from '../../tableLink';\n\nconst SHORT_DAY_FORMAT: Intl.DateTimeFormatOptions = { day: 'numeric' };\n\ninterface DayCalendarTableProps extends WrappedComponentProps {\n selectedDate: Date | null;\n min: Date | null;\n max: Date | null;\n viewMonth: number;\n viewYear: number;\n onSelect: (date: Date) => void;\n}\n\nclass DayCalendarTable extends PureComponent<DayCalendarTableProps> {\n getTableStructure = () => {\n const { viewMonth, viewYear } = this.props;\n let firstDayOfMonth = new Date(viewYear, viewMonth, 1).getDay();\n // JS Sunday is 0, we're setting it last\n if (firstDayOfMonth === 0) {\n firstDayOfMonth = 7;\n }\n const daysInMonth = new Date(viewYear, viewMonth + 1, 0).getDate();\n\n let week: number[] = [];\n const weeks: number[][] = [];\n let i;\n\n // Pad first week\n for (i = 1; i < firstDayOfMonth; i += 1) {\n week.push(-1);\n }\n // Fill in days\n for (i = 1; i <= daysInMonth; i += 1) {\n week.push(i);\n if ((firstDayOfMonth + i - 1) % 7 === 0) {\n weeks.push(week);\n week = [];\n }\n }\n if (week.length > 0) {\n // Pad last week\n for (i = week.length; i < 7; i += 1) {\n week.push(-1);\n }\n weeks.push(week);\n }\n return weeks;\n };\n\n days = getDayNames(this.props.intl.locale, 'short');\n daysShort = getDayNames(this.props.intl.locale, 'narrow');\n daysLong = getDayNames(this.props.intl.locale, 'long');\n\n selectDay = (day: number) => {\n const { viewMonth, viewYear, onSelect } = this.props;\n onSelect(new Date(viewYear, viewMonth, day));\n };\n\n isDisabled = (day: number) => {\n if (day < 0) {\n return true;\n }\n const { min, max, viewMonth, viewYear } = this.props;\n const date = new Date(viewYear, viewMonth, day);\n\n return !isWithinRange(date, min, max);\n };\n\n isActive = (day: number) => {\n const { selectedDate, viewMonth, viewYear } = this.props;\n return !!(selectedDate && Number(new Date(viewYear, viewMonth, day)) === Number(selectedDate));\n };\n\n isToday = (day: number) => {\n const { viewMonth, viewYear } = this.props;\n return Number(getStartOfDay(new Date())) === Number(new Date(viewYear, viewMonth, day));\n };\n\n getAutofocusDay = (weeks: number[][]) => {\n const days = weeks.flatMap((week) => week);\n return getFocusableTime({\n isActive: this.isActive,\n isNow: this.isToday,\n isDisabled: this.isDisabled,\n timeSpan: days,\n });\n };\n\n render() {\n const { viewMonth, viewYear, intl } = this.props;\n const weeks = this.getTableStructure();\n const autoFocusDay = this.getAutofocusDay(weeks);\n return (\n <table className=\"table table-condensed table-bordered tw-date-lookup-calendar m-b-0\">\n <thead>\n <tr>\n {this.days.map((day, index) => (\n <th\n key={day}\n className={\n index > 4\n ? 'text-xs-center np-text-body-default'\n : 'text-xs-center np-text-body-default-bold'\n }\n >\n <span className=\"hidden-xs\">\n <abbr title={this.daysLong[index]}>{day.slice(0, 3)}</abbr>\n </span>\n <span className=\"visible-xs-inline-block\">\n <abbr title={this.daysLong[index]}>{this.daysShort[index].slice(0, 2)}</abbr>\n </span>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {/* eslint-disable react/no-array-index-key */}\n {weeks.map((week, weekIndex) => (\n <tr key={weekIndex}>\n {week.map((day, dayIndex) => (\n <td key={dayIndex} className={dayIndex > 4 ? 'weekend' : ''}>\n {day !== -1 && (\n <TableLink\n item={day}\n type=\"day\"\n title={formatDate(\n new Date(viewYear, viewMonth, day),\n intl.locale,\n SHORT_DAY_FORMAT,\n )}\n autofocus={day === autoFocusDay}\n longTitle={formatDate(new Date(viewYear, viewMonth, day), intl.locale)}\n active={this.isActive(day)}\n disabled={this.isDisabled(day)}\n today={this.isToday(day)}\n onClick={this.selectDay}\n />\n )}\n </td>\n ))}\n </tr>\n ))}\n {/* eslint-enable react/no-array-index-key */}\n </tbody>\n </table>\n );\n }\n}\n\nexport default injectIntl(DayCalendarTable);\n"],"names":["SHORT_DAY_FORMAT","day","DayCalendarTable","PureComponent","getTableStructure","viewMonth","viewYear","props","firstDayOfMonth","Date","getDay","daysInMonth","getDate","week","weeks","i","push","length","days","getDayNames","intl","locale","daysShort","daysLong","selectDay","onSelect","isDisabled","min","max","date","isWithinRange","isActive","selectedDate","Number","isToday","getStartOfDay","getAutofocusDay","flatMap","getFocusableTime","isNow","timeSpan","render","autoFocusDay","_jsxs","className","children","_jsx","map","index","title","slice","weekIndex","dayIndex","TableLink","item","type","formatDate","autofocus","longTitle","active","disabled","today","onClick","injectIntl"],"mappings":";;;;;;;;;;;;;;AASA,MAAMA,gBAAgB,GAA+B;AAAEC,EAAAA,GAAG,EAAE;CAAW;yBAWvE,MAAMC,gBAAiB,SAAQC,mBAAoC,CAAA;EACjEC,iBAAiB,GAAGA,MAAK;IACvB,MAAM;MAAEC,SAAS;AAAEC,MAAAA;KAAU,GAAG,IAAI,CAACC,KAAK;AAC1C,IAAA,IAAIC,eAAe,GAAG,IAAIC,IAAI,CAACH,QAAQ,EAAED,SAAS,EAAE,CAAC,CAAC,CAACK,MAAM,EAAE;AAC/D;IACA,IAAIF,eAAe,KAAK,CAAC,EAAE;AACzBA,MAAAA,eAAe,GAAG,CAAC;AACrB,IAAA;AACA,IAAA,MAAMG,WAAW,GAAG,IAAIF,IAAI,CAACH,QAAQ,EAAED,SAAS,GAAG,CAAC,EAAE,CAAC,CAAC,CAACO,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,KAAK,EAAE,IAAI,CAAC3B,OAAO,CAACjC,GAAG,CAAE;cACzB6D,OAAO,EAAE,IAAI,CAACtC;aAAU;AAE3B,WAAA,EAjBM4B,QAkBL,CACL;AAAC,SAAA,EArBKD,SAsBL,CACL;AAAC,OAEG,CACT;AAAA,KAAO,CAAC;AAEZ,EAAA;AACD;AAED,uBAAeY,oBAAU,CAAC7D,kBAAgB,CAAC;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"DayCalendarTable.mjs","sources":["../../../../src/dateLookup/dayCalendar/table/DayCalendarTable.tsx"],"sourcesContent":["import { formatDate } from '@transferwise/formatting';\nimport { PureComponent } from 'react';\nimport { injectIntl, type WrappedComponentProps } from 'react-intl';\n\nimport { getDayNames, isWithinRange } from '../../../common/dateUtils';\nimport { getFocusableTime } from '../../getFocusableTime/getFocusableTime';\nimport { getStartOfDay } from '../../getStartOfDay';\nimport TableLink from '../../tableLink';\n\nconst SHORT_DAY_FORMAT: Intl.DateTimeFormatOptions = { day: 'numeric' };\n\ninterface DayCalendarTableProps extends WrappedComponentProps {\n selectedDate: Date | null;\n min: Date | null;\n max: Date | null;\n viewMonth: number;\n viewYear: number;\n onSelect: (date: Date) => void;\n}\n\nclass DayCalendarTable extends PureComponent<DayCalendarTableProps> {\n getTableStructure = () => {\n const { viewMonth, viewYear } = this.props;\n let firstDayOfMonth = new Date(viewYear, viewMonth, 1).getDay();\n // JS Sunday is 0, we're setting it last\n if (firstDayOfMonth === 0) {\n firstDayOfMonth = 7;\n }\n const daysInMonth = new Date(viewYear, viewMonth + 1, 0).getDate();\n\n let week: number[] = [];\n const weeks: number[][] = [];\n let i;\n\n // Pad first week\n for (i = 1; i < firstDayOfMonth; i += 1) {\n week.push(-1);\n }\n // Fill in days\n for (i = 1; i <= daysInMonth; i += 1) {\n week.push(i);\n if ((firstDayOfMonth + i - 1) % 7 === 0) {\n weeks.push(week);\n week = [];\n }\n }\n if (week.length > 0) {\n // Pad last week\n for (i = week.length; i < 7; i += 1) {\n week.push(-1);\n }\n weeks.push(week);\n }\n return weeks;\n };\n\n days = getDayNames(this.props.intl.locale, 'short');\n daysShort = getDayNames(this.props.intl.locale, 'narrow');\n daysLong = getDayNames(this.props.intl.locale, 'long');\n\n selectDay = (day: number) => {\n const { viewMonth, viewYear, onSelect } = this.props;\n onSelect(new Date(viewYear, viewMonth, day));\n };\n\n isDisabled = (day: number) => {\n if (day < 0) {\n return true;\n }\n const { min, max, viewMonth, viewYear } = this.props;\n const date = new Date(viewYear, viewMonth, day);\n\n return !isWithinRange(date, min, max);\n };\n\n isActive = (day: number) => {\n const { selectedDate, viewMonth, viewYear } = this.props;\n return !!(selectedDate && Number(new Date(viewYear, viewMonth, day)) === Number(selectedDate));\n };\n\n isToday = (day: number) => {\n const { viewMonth, viewYear } = this.props;\n return Number(getStartOfDay(new Date())) === Number(new Date(viewYear, viewMonth, day));\n };\n\n getAutofocusDay = (weeks: number[][]) => {\n const days = weeks.flatMap((week) => week);\n return getFocusableTime({\n isActive: this.isActive,\n isNow: this.isToday,\n isDisabled: this.isDisabled,\n timeSpan: days,\n });\n };\n\n render() {\n const { viewMonth, viewYear, intl } = this.props;\n const weeks = this.getTableStructure();\n const autoFocusDay = this.getAutofocusDay(weeks);\n return (\n <table className=\"table table-condensed table-bordered tw-date-lookup-calendar m-b-0\">\n <thead>\n <tr>\n {this.days.map((day, index) => (\n <th\n key={day}\n className={\n index > 4\n ? 'text-xs-center np-text-body-default'\n : 'text-xs-center np-text-body-default-bold'\n }\n >\n <span className=\"hidden-xs\">\n <abbr title={this.daysLong[index]}>{day.slice(0, 3)}</abbr>\n </span>\n <span className=\"visible-xs-inline-block\">\n <abbr title={this.daysLong[index]}>{this.daysShort[index].slice(0, 2)}</abbr>\n </span>\n </th>\n ))}\n </tr>\n </thead>\n <tbody>\n {/* eslint-disable react/no-array-index-key */}\n {weeks.map((week, weekIndex) => (\n <tr key={weekIndex}>\n {week.map((day, dayIndex) => (\n <td key={dayIndex} className={dayIndex > 4 ? 'weekend' : ''}>\n {day !== -1 && (\n <TableLink\n item={day}\n type=\"day\"\n title={formatDate(\n new Date(viewYear, viewMonth, day),\n intl.locale,\n SHORT_DAY_FORMAT,\n )}\n autofocus={day === autoFocusDay}\n longTitle={formatDate(new Date(viewYear, viewMonth, day), intl.locale)}\n active={this.isActive(day)}\n disabled={this.isDisabled(day)}\n today={this.isToday(day)}\n onClick={this.selectDay}\n />\n )}\n </td>\n ))}\n </tr>\n ))}\n {/* eslint-enable react/no-array-index-key */}\n </tbody>\n </table>\n );\n }\n}\n\nexport default injectIntl(DayCalendarTable);\n"],"names":["SHORT_DAY_FORMAT","day","DayCalendarTable","PureComponent","getTableStructure","viewMonth","viewYear","props","firstDayOfMonth","Date","getDay","daysInMonth","getDate","week","weeks","i","push","length","days","getDayNames","intl","locale","daysShort","daysLong","selectDay","onSelect","isDisabled","min","max","date","isWithinRange","isActive","selectedDate","Number","isToday","getStartOfDay","getAutofocusDay","flatMap","getFocusableTime","isNow","timeSpan","render","autoFocusDay","_jsxs","className","children","_jsx","map","index","title","slice","weekIndex","dayIndex","TableLink","item","type","formatDate","autofocus","longTitle","active","disabled","today","onClick","injectIntl"],"mappings":";;;;;;;;;;AASA,MAAMA,gBAAgB,GAA+B;AAAEC,EAAAA,GAAG,EAAE;CAAW;AAWvE,MAAMC,gBAAiB,SAAQC,aAAoC,CAAA;EACjEC,iBAAiB,GAAGA,MAAK;IACvB,MAAM;MAAEC,SAAS;AAAEC,MAAAA;KAAU,GAAG,IAAI,CAACC,KAAK;AAC1C,IAAA,IAAIC,eAAe,GAAG,IAAIC,IAAI,CAACH,QAAQ,EAAED,SAAS,EAAE,CAAC,CAAC,CAACK,MAAM,EAAE;AAC/D;IACA,IAAIF,eAAe,KAAK,CAAC,EAAE;AACzBA,MAAAA,eAAe,GAAG,CAAC;AACrB,IAAA;AACA,IAAA,MAAMG,WAAW,GAAG,IAAIF,IAAI,CAACH,QAAQ,EAAED,SAAS,GAAG,CAAC,EAAE,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D,cAAAA,KAAK,EAAE,IAAI,CAAC3B,OAAO,CAACjC,GAAG,CAAE;cACzB6D,OAAO,EAAE,IAAI,CAACtC;aAAU;AAE3B,WAAA,EAjBM4B,QAkBL,CACL;AAAC,SAAA,EArBKD,SAsBL,CACL;AAAC,OAEG,CACT;AAAA,KAAO,CAAC;AAEZ,EAAA;AACD;AAED,yBAAeY,UAAU,CAAC7D,gBAAgB,CAAC;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getFocusableTime.js","sources":["../../../src/dateLookup/getFocusableTime/getFocusableTime.tsx"],"sourcesContent":["interface FocusableTimeProps {\n isActive: (time: number) => boolean;\n isNow: (time: number) => boolean;\n isDisabled: (time: number) => boolean;\n timeSpan: readonly number[];\n}\n\nexport function getFocusableTime(props: FocusableTimeProps): number | undefined {\n return (\n props.timeSpan.find((time: number) => props.isActive(time)) ||\n props.timeSpan.find((time: number) => props.isNow(time) && !props.isDisabled(time)) ||\n props.timeSpan.find((time: number) => !props.isDisabled(time))\n );\n}\n"],"names":["getFocusableTime","props","timeSpan","find","time","isActive","isNow","isDisabled"],"mappings":";;AAOM,SAAUA,gBAAgBA,CAACC,KAAyB,EAAA;EACxD,OACEA,KAAK,CAACC,QAAQ,CAACC,IAAI,CAAEC,IAAY,IAAKH,KAAK,CAACI,QAAQ,CAACD,IAAI,CAAC,CAAC,IAC3DH,KAAK,CAACC,QAAQ,CAACC,IAAI,CAAEC,IAAY,IAAKH,KAAK,CAACK,KAAK,CAACF,IAAI,CAAC,IAAI,CAACH,KAAK,CAACM,UAAU,CAACH,IAAI,CAAC,CAAC,IACnFH,KAAK,CAACC,QAAQ,CAACC,IAAI,CAAEC,IAAY,IAAK,CAACH,KAAK,CAACM,UAAU,CAACH,IAAI,CAAC,CAAC;AAElE;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"getFocusableTime.mjs","sources":["../../../src/dateLookup/getFocusableTime/getFocusableTime.tsx"],"sourcesContent":["interface FocusableTimeProps {\n isActive: (time: number) => boolean;\n isNow: (time: number) => boolean;\n isDisabled: (time: number) => boolean;\n timeSpan: readonly number[];\n}\n\nexport function getFocusableTime(props: FocusableTimeProps): number | undefined {\n return (\n props.timeSpan.find((time: number) => props.isActive(time)) ||\n props.timeSpan.find((time: number) => props.isNow(time) && !props.isDisabled(time)) ||\n props.timeSpan.find((time: number) => !props.isDisabled(time))\n );\n}\n"],"names":["getFocusableTime","props","timeSpan","find","time","isActive","isNow","isDisabled"],"mappings":"AAOM,SAAUA,gBAAgBA,CAACC,KAAyB,EAAA;EACxD,OACEA,KAAK,CAACC,QAAQ,CAACC,IAAI,CAAEC,IAAY,IAAKH,KAAK,CAACI,QAAQ,CAACD,IAAI,CAAC,CAAC,IAC3DH,KAAK,CAACC,QAAQ,CAACC,IAAI,CAAEC,IAAY,IAAKH,KAAK,CAACK,KAAK,CAACF,IAAI,CAAC,IAAI,CAACH,KAAK,CAACM,UAAU,CAACH,IAAI,CAAC,CAAC,IACnFH,KAAK,CAACC,QAAQ,CAACC,IAAI,CAAEC,IAAY,IAAK,CAACH,KAAK,CAACM,UAAU,CAACH,IAAI,CAAC,CAAC;AAElE;;;;"}