1 | const calendarLabel = 'Calendar';
|
2 | const closeDatePicker = 'Close';
|
3 | const focusStartDate = 'Interact with the calendar and add the check-in date for your trip.';
|
4 | const clearDate = 'Clear Date';
|
5 | const clearDates = 'Clear Dates';
|
6 | const jumpToPrevMonth = 'Move backward to switch to the previous month.';
|
7 | const jumpToNextMonth = 'Move forward to switch to the next month.';
|
8 | const keyboardShortcuts = 'Keyboard Shortcuts';
|
9 | const showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.';
|
10 | const hideKeyboardShortcutsPanel = 'Close the shortcuts panel.';
|
11 | const openThisPanel = 'Open this panel.';
|
12 | const enterKey = 'Enter key';
|
13 | const leftArrowRightArrow = 'Right and left arrow keys';
|
14 | const upArrowDownArrow = 'up and down arrow keys';
|
15 | const pageUpPageDown = 'page up and page down keys';
|
16 | const homeEnd = 'Home and end keys';
|
17 | const escape = 'Escape key';
|
18 | const questionMark = 'Question mark';
|
19 | const selectFocusedDate = 'Select the date in focus.';
|
20 | const moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.';
|
21 | const moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.';
|
22 | const moveFocusByOneMonth = 'Switch months.';
|
23 | const moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.';
|
24 | const returnFocusToInput = 'Return to the date input field.';
|
25 | const keyboardNavigationInstructions = `Press the down arrow key to interact with the calendar and
|
26 | select a date. Press the question mark key to get the keyboard shortcuts for changing dates.`;
|
27 |
|
28 | const chooseAvailableStartDate = ({ date }) => `Choose ${date} as your check-in date. It’s available.`;
|
29 | const chooseAvailableEndDate = ({ date }) => `Choose ${date} as your check-out date. It’s available.`;
|
30 | const chooseAvailableDate = ({ date }) => date;
|
31 | const dateIsUnavailable = ({ date }) => `Not available. ${date}`;
|
32 | const dateIsSelected = ({ date }) => `Selected. ${date}`;
|
33 | const dateIsSelectedAsStartDate = ({ date }) => `Selected as start date. ${date}`;
|
34 | const dateIsSelectedAsEndDate = ({ date }) => `Selected as end date. ${date}`;
|
35 |
|
36 | export default {
|
37 | calendarLabel,
|
38 | closeDatePicker,
|
39 | focusStartDate,
|
40 | clearDate,
|
41 | clearDates,
|
42 | jumpToPrevMonth,
|
43 | jumpToNextMonth,
|
44 | keyboardShortcuts,
|
45 | showKeyboardShortcutsPanel,
|
46 | hideKeyboardShortcutsPanel,
|
47 | openThisPanel,
|
48 | enterKey,
|
49 | leftArrowRightArrow,
|
50 | upArrowDownArrow,
|
51 | pageUpPageDown,
|
52 | homeEnd,
|
53 | escape,
|
54 | questionMark,
|
55 | selectFocusedDate,
|
56 | moveFocusByOneDay,
|
57 | moveFocusByOneWeek,
|
58 | moveFocusByOneMonth,
|
59 | moveFocustoStartAndEndOfWeek,
|
60 | returnFocusToInput,
|
61 | keyboardNavigationInstructions,
|
62 |
|
63 | chooseAvailableStartDate,
|
64 | chooseAvailableEndDate,
|
65 | dateIsUnavailable,
|
66 | dateIsSelected,
|
67 | dateIsSelectedAsStartDate,
|
68 | dateIsSelectedAsEndDate,
|
69 | };
|
70 |
|
71 | export const DateRangePickerPhrases = {
|
72 | calendarLabel,
|
73 | closeDatePicker,
|
74 | clearDates,
|
75 | focusStartDate,
|
76 | jumpToPrevMonth,
|
77 | jumpToNextMonth,
|
78 | keyboardShortcuts,
|
79 | showKeyboardShortcutsPanel,
|
80 | hideKeyboardShortcutsPanel,
|
81 | openThisPanel,
|
82 | enterKey,
|
83 | leftArrowRightArrow,
|
84 | upArrowDownArrow,
|
85 | pageUpPageDown,
|
86 | homeEnd,
|
87 | escape,
|
88 | questionMark,
|
89 | selectFocusedDate,
|
90 | moveFocusByOneDay,
|
91 | moveFocusByOneWeek,
|
92 | moveFocusByOneMonth,
|
93 | moveFocustoStartAndEndOfWeek,
|
94 | returnFocusToInput,
|
95 | keyboardNavigationInstructions,
|
96 | chooseAvailableStartDate,
|
97 | chooseAvailableEndDate,
|
98 | dateIsUnavailable,
|
99 | dateIsSelected,
|
100 | dateIsSelectedAsStartDate,
|
101 | dateIsSelectedAsEndDate,
|
102 | };
|
103 |
|
104 | export const DateRangePickerInputPhrases = {
|
105 | focusStartDate,
|
106 | clearDates,
|
107 | keyboardNavigationInstructions,
|
108 | };
|
109 |
|
110 | export const SingleDatePickerPhrases = {
|
111 | calendarLabel,
|
112 | closeDatePicker,
|
113 | clearDate,
|
114 | jumpToPrevMonth,
|
115 | jumpToNextMonth,
|
116 | keyboardShortcuts,
|
117 | showKeyboardShortcutsPanel,
|
118 | hideKeyboardShortcutsPanel,
|
119 | openThisPanel,
|
120 | enterKey,
|
121 | leftArrowRightArrow,
|
122 | upArrowDownArrow,
|
123 | pageUpPageDown,
|
124 | homeEnd,
|
125 | escape,
|
126 | questionMark,
|
127 | selectFocusedDate,
|
128 | moveFocusByOneDay,
|
129 | moveFocusByOneWeek,
|
130 | moveFocusByOneMonth,
|
131 | moveFocustoStartAndEndOfWeek,
|
132 | returnFocusToInput,
|
133 | keyboardNavigationInstructions,
|
134 | chooseAvailableDate,
|
135 | dateIsUnavailable,
|
136 | dateIsSelected,
|
137 | };
|
138 |
|
139 | export const SingleDatePickerInputPhrases = {
|
140 | clearDate,
|
141 | keyboardNavigationInstructions,
|
142 | };
|
143 |
|
144 | export const DayPickerPhrases = {
|
145 | calendarLabel,
|
146 | jumpToPrevMonth,
|
147 | jumpToNextMonth,
|
148 | keyboardShortcuts,
|
149 | showKeyboardShortcutsPanel,
|
150 | hideKeyboardShortcutsPanel,
|
151 | openThisPanel,
|
152 | enterKey,
|
153 | leftArrowRightArrow,
|
154 | upArrowDownArrow,
|
155 | pageUpPageDown,
|
156 | homeEnd,
|
157 | escape,
|
158 | questionMark,
|
159 | selectFocusedDate,
|
160 | moveFocusByOneDay,
|
161 | moveFocusByOneWeek,
|
162 | moveFocusByOneMonth,
|
163 | moveFocustoStartAndEndOfWeek,
|
164 | returnFocusToInput,
|
165 | chooseAvailableStartDate,
|
166 | chooseAvailableEndDate,
|
167 | chooseAvailableDate,
|
168 | dateIsUnavailable,
|
169 | dateIsSelected,
|
170 | dateIsSelectedAsStartDate,
|
171 | dateIsSelectedAsEndDate,
|
172 | };
|
173 |
|
174 | export const DayPickerKeyboardShortcutsPhrases = {
|
175 | keyboardShortcuts,
|
176 | showKeyboardShortcutsPanel,
|
177 | hideKeyboardShortcutsPanel,
|
178 | openThisPanel,
|
179 | enterKey,
|
180 | leftArrowRightArrow,
|
181 | upArrowDownArrow,
|
182 | pageUpPageDown,
|
183 | homeEnd,
|
184 | escape,
|
185 | questionMark,
|
186 | selectFocusedDate,
|
187 | moveFocusByOneDay,
|
188 | moveFocusByOneWeek,
|
189 | moveFocusByOneMonth,
|
190 | moveFocustoStartAndEndOfWeek,
|
191 | returnFocusToInput,
|
192 | };
|
193 |
|
194 | export const DayPickerNavigationPhrases = {
|
195 | jumpToPrevMonth,
|
196 | jumpToNextMonth,
|
197 | };
|
198 |
|
199 | export const CalendarDayPhrases = {
|
200 | chooseAvailableDate,
|
201 | dateIsUnavailable,
|
202 | dateIsSelected,
|
203 | dateIsSelectedAsStartDate,
|
204 | dateIsSelectedAsEndDate,
|
205 | };
|