UNPKG

5.45 kBJavaScriptView Raw
1const calendarLabel = 'Calendar';
2const closeDatePicker = 'Close';
3const focusStartDate = 'Interact with the calendar and add the check-in date for your trip.';
4const clearDate = 'Clear Date';
5const clearDates = 'Clear Dates';
6const jumpToPrevMonth = 'Move backward to switch to the previous month.';
7const jumpToNextMonth = 'Move forward to switch to the next month.';
8const keyboardShortcuts = 'Keyboard Shortcuts';
9const showKeyboardShortcutsPanel = 'Open the keyboard shortcuts panel.';
10const hideKeyboardShortcutsPanel = 'Close the shortcuts panel.';
11const openThisPanel = 'Open this panel.';
12const enterKey = 'Enter key';
13const leftArrowRightArrow = 'Right and left arrow keys';
14const upArrowDownArrow = 'up and down arrow keys';
15const pageUpPageDown = 'page up and page down keys';
16const homeEnd = 'Home and end keys';
17const escape = 'Escape key';
18const questionMark = 'Question mark';
19const selectFocusedDate = 'Select the date in focus.';
20const moveFocusByOneDay = 'Move backward (left) and forward (right) by one day.';
21const moveFocusByOneWeek = 'Move backward (up) and forward (down) by one week.';
22const moveFocusByOneMonth = 'Switch months.';
23const moveFocustoStartAndEndOfWeek = 'Go to the first or last day of a week.';
24const returnFocusToInput = 'Return to the date input field.';
25const 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
28const chooseAvailableStartDate = ({ date }) => `Choose ${date} as your check-in date. It’s available.`;
29const chooseAvailableEndDate = ({ date }) => `Choose ${date} as your check-out date. It’s available.`;
30const chooseAvailableDate = ({ date }) => date;
31const dateIsUnavailable = ({ date }) => `Not available. ${date}`;
32const dateIsSelected = ({ date }) => `Selected. ${date}`;
33const dateIsSelectedAsStartDate = ({ date }) => `Selected as start date. ${date}`;
34const dateIsSelectedAsEndDate = ({ date }) => `Selected as end date. ${date}`;
35
36export 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
71export 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
104export const DateRangePickerInputPhrases = {
105 focusStartDate,
106 clearDates,
107 keyboardNavigationInstructions,
108};
109
110export 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
139export const SingleDatePickerInputPhrases = {
140 clearDate,
141 keyboardNavigationInstructions,
142};
143
144export 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
174export 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
194export const DayPickerNavigationPhrases = {
195 jumpToPrevMonth,
196 jumpToNextMonth,
197};
198
199export const CalendarDayPhrases = {
200 chooseAvailableDate,
201 dateIsUnavailable,
202 dateIsSelected,
203 dateIsSelectedAsStartDate,
204 dateIsSelectedAsEndDate,
205};