@izonnet-web-solution/react-native-date-time-picker-kit 0.0.0-stage → 1.0.1

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 (216) hide show
  1. package/DateTimePickerKit.podspec +22 -0
  2. package/LICENSE +20 -0
  3. package/README.md +652 -2
  4. package/android/build.gradle +36 -0
  5. package/android/src/main/AndroidManifest.xml +2 -0
  6. package/android/src/main/java/com/datetimepickerkit/DatePickerHelper.kt +185 -0
  7. package/android/src/main/java/com/datetimepickerkit/DateTimePickerHelper.kt +214 -0
  8. package/android/src/main/java/com/datetimepickerkit/DateTimePickerKitModule.kt +258 -0
  9. package/android/src/main/java/com/datetimepickerkit/DateTimePickerKitPackage.kt +30 -0
  10. package/android/src/main/java/com/datetimepickerkit/TimePickerHelper.kt +208 -0
  11. package/ios/DateTimePickerKit.h +11 -0
  12. package/ios/DateTimePickerKit.mm +84 -0
  13. package/ios/DateTimePickerModule.swift +474 -0
  14. package/lib/module/NativeDateTimePickerKit.js +5 -0
  15. package/lib/module/NativeDateTimePickerKit.js.map +1 -0
  16. package/lib/module/components/CalendarPicker.js +419 -0
  17. package/lib/module/components/CalendarPicker.js.map +1 -0
  18. package/lib/module/components/ClockPicker.js +273 -0
  19. package/lib/module/components/ClockPicker.js.map +1 -0
  20. package/lib/module/components/DatePicker.js +181 -0
  21. package/lib/module/components/DatePicker.js.map +1 -0
  22. package/lib/module/components/DateRangePicker.js +158 -0
  23. package/lib/module/components/DateRangePicker.js.map +1 -0
  24. package/lib/module/components/DateTimePicker.js +674 -0
  25. package/lib/module/components/DateTimePicker.js.map +1 -0
  26. package/lib/module/components/MonthPicker.js +145 -0
  27. package/lib/module/components/MonthPicker.js.map +1 -0
  28. package/lib/module/components/TimePicker.js +142 -0
  29. package/lib/module/components/TimePicker.js.map +1 -0
  30. package/lib/module/components/TimeSlotPicker.js +118 -0
  31. package/lib/module/components/TimeSlotPicker.js.map +1 -0
  32. package/lib/module/components/WheelPicker.js +159 -0
  33. package/lib/module/components/WheelPicker.js.map +1 -0
  34. package/lib/module/components/YearPicker.js +151 -0
  35. package/lib/module/components/YearPicker.js.map +1 -0
  36. package/lib/module/components/common/ModalWrapper.js +136 -0
  37. package/lib/module/components/common/ModalWrapper.js.map +1 -0
  38. package/lib/module/components/common/PickerHeader.js +82 -0
  39. package/lib/module/components/common/PickerHeader.js.map +1 -0
  40. package/lib/module/components/common/PresetsBar.js +66 -0
  41. package/lib/module/components/common/PresetsBar.js.map +1 -0
  42. package/lib/module/errors/DateTimePickerError.js +12 -0
  43. package/lib/module/errors/DateTimePickerError.js.map +1 -0
  44. package/lib/module/hooks/useDateTimePicker.js +73 -0
  45. package/lib/module/hooks/useDateTimePicker.js.map +1 -0
  46. package/lib/module/index.js +40 -0
  47. package/lib/module/index.js.map +1 -0
  48. package/lib/module/localization/index.js +6 -0
  49. package/lib/module/localization/index.js.map +1 -0
  50. package/lib/module/localization/locales.js +186 -0
  51. package/lib/module/localization/locales.js.map +1 -0
  52. package/lib/module/localization/types.js +2 -0
  53. package/lib/module/localization/types.js.map +1 -0
  54. package/lib/module/localization/useLocale.js +176 -0
  55. package/lib/module/localization/useLocale.js.map +1 -0
  56. package/lib/module/native/NativeDateTimePicker.js +110 -0
  57. package/lib/module/native/NativeDateTimePicker.js.map +1 -0
  58. package/lib/module/package.json +1 -0
  59. package/lib/module/presets/datePresets.js +75 -0
  60. package/lib/module/presets/datePresets.js.map +1 -0
  61. package/lib/module/presets/index.js +4 -0
  62. package/lib/module/presets/index.js.map +1 -0
  63. package/lib/module/slots/index.js +4 -0
  64. package/lib/module/slots/index.js.map +1 -0
  65. package/lib/module/slots/timeSlots.js +59 -0
  66. package/lib/module/slots/timeSlots.js.map +1 -0
  67. package/lib/module/theme/defaultTheme.js +91 -0
  68. package/lib/module/theme/defaultTheme.js.map +1 -0
  69. package/lib/module/theme/index.js +6 -0
  70. package/lib/module/theme/index.js.map +1 -0
  71. package/lib/module/theme/types.js +2 -0
  72. package/lib/module/theme/types.js.map +1 -0
  73. package/lib/module/theme/useTheme.js +81 -0
  74. package/lib/module/theme/useTheme.js.map +1 -0
  75. package/lib/module/types/events.js +4 -0
  76. package/lib/module/types/events.js.map +1 -0
  77. package/lib/module/types/index.js +7 -0
  78. package/lib/module/types/index.js.map +1 -0
  79. package/lib/module/types/native.js +2 -0
  80. package/lib/module/types/native.js.map +1 -0
  81. package/lib/module/types/presentation.js +2 -0
  82. package/lib/module/types/presentation.js.map +1 -0
  83. package/lib/module/types/props.js +4 -0
  84. package/lib/module/types/props.js.map +1 -0
  85. package/lib/module/utils/constants.js +14 -0
  86. package/lib/module/utils/constants.js.map +1 -0
  87. package/lib/module/utils/dateConversion.js +224 -0
  88. package/lib/module/utils/dateConversion.js.map +1 -0
  89. package/lib/module/utils/dateFormatting.js +102 -0
  90. package/lib/module/utils/dateFormatting.js.map +1 -0
  91. package/lib/module/utils/dateValidation.js +161 -0
  92. package/lib/module/utils/dateValidation.js.map +1 -0
  93. package/lib/module/utils/index.js +7 -0
  94. package/lib/module/utils/index.js.map +1 -0
  95. package/lib/typescript/package.json +1 -0
  96. package/lib/typescript/src/NativeDateTimePickerKit.d.ts +17 -0
  97. package/lib/typescript/src/NativeDateTimePickerKit.d.ts.map +1 -0
  98. package/lib/typescript/src/components/CalendarPicker.d.ts +51 -0
  99. package/lib/typescript/src/components/CalendarPicker.d.ts.map +1 -0
  100. package/lib/typescript/src/components/ClockPicker.d.ts +22 -0
  101. package/lib/typescript/src/components/ClockPicker.d.ts.map +1 -0
  102. package/lib/typescript/src/components/DatePicker.d.ts +44 -0
  103. package/lib/typescript/src/components/DatePicker.d.ts.map +1 -0
  104. package/lib/typescript/src/components/DateRangePicker.d.ts +56 -0
  105. package/lib/typescript/src/components/DateRangePicker.d.ts.map +1 -0
  106. package/lib/typescript/src/components/DateTimePicker.d.ts +7 -0
  107. package/lib/typescript/src/components/DateTimePicker.d.ts.map +1 -0
  108. package/lib/typescript/src/components/MonthPicker.d.ts +21 -0
  109. package/lib/typescript/src/components/MonthPicker.d.ts.map +1 -0
  110. package/lib/typescript/src/components/TimePicker.d.ts +31 -0
  111. package/lib/typescript/src/components/TimePicker.d.ts.map +1 -0
  112. package/lib/typescript/src/components/TimeSlotPicker.d.ts +18 -0
  113. package/lib/typescript/src/components/TimeSlotPicker.d.ts.map +1 -0
  114. package/lib/typescript/src/components/WheelPicker.d.ts +17 -0
  115. package/lib/typescript/src/components/WheelPicker.d.ts.map +1 -0
  116. package/lib/typescript/src/components/YearPicker.d.ts +14 -0
  117. package/lib/typescript/src/components/YearPicker.d.ts.map +1 -0
  118. package/lib/typescript/src/components/common/ModalWrapper.d.ts +11 -0
  119. package/lib/typescript/src/components/common/ModalWrapper.d.ts.map +1 -0
  120. package/lib/typescript/src/components/common/PickerHeader.d.ts +13 -0
  121. package/lib/typescript/src/components/common/PickerHeader.d.ts.map +1 -0
  122. package/lib/typescript/src/components/common/PresetsBar.d.ts +12 -0
  123. package/lib/typescript/src/components/common/PresetsBar.d.ts.map +1 -0
  124. package/lib/typescript/src/errors/DateTimePickerError.d.ts +7 -0
  125. package/lib/typescript/src/errors/DateTimePickerError.d.ts.map +1 -0
  126. package/lib/typescript/src/hooks/useDateTimePicker.d.ts +17 -0
  127. package/lib/typescript/src/hooks/useDateTimePicker.d.ts.map +1 -0
  128. package/lib/typescript/src/index.d.ts +23 -0
  129. package/lib/typescript/src/index.d.ts.map +1 -0
  130. package/lib/typescript/src/localization/index.d.ts +4 -0
  131. package/lib/typescript/src/localization/index.d.ts.map +1 -0
  132. package/lib/typescript/src/localization/locales.d.ts +12 -0
  133. package/lib/typescript/src/localization/locales.d.ts.map +1 -0
  134. package/lib/typescript/src/localization/types.d.ts +23 -0
  135. package/lib/typescript/src/localization/types.d.ts.map +1 -0
  136. package/lib/typescript/src/localization/useLocale.d.ts +31 -0
  137. package/lib/typescript/src/localization/useLocale.d.ts.map +1 -0
  138. package/lib/typescript/src/native/NativeDateTimePicker.d.ts +14 -0
  139. package/lib/typescript/src/native/NativeDateTimePicker.d.ts.map +1 -0
  140. package/lib/typescript/src/presets/datePresets.d.ts +8 -0
  141. package/lib/typescript/src/presets/datePresets.d.ts.map +1 -0
  142. package/lib/typescript/src/presets/index.d.ts +2 -0
  143. package/lib/typescript/src/presets/index.d.ts.map +1 -0
  144. package/lib/typescript/src/slots/index.d.ts +2 -0
  145. package/lib/typescript/src/slots/index.d.ts.map +1 -0
  146. package/lib/typescript/src/slots/timeSlots.d.ts +18 -0
  147. package/lib/typescript/src/slots/timeSlots.d.ts.map +1 -0
  148. package/lib/typescript/src/theme/defaultTheme.d.ts +9 -0
  149. package/lib/typescript/src/theme/defaultTheme.d.ts.map +1 -0
  150. package/lib/typescript/src/theme/index.d.ts +4 -0
  151. package/lib/typescript/src/theme/index.d.ts.map +1 -0
  152. package/lib/typescript/src/theme/types.d.ts +76 -0
  153. package/lib/typescript/src/theme/types.d.ts.map +1 -0
  154. package/lib/typescript/src/theme/useTheme.d.ts +4 -0
  155. package/lib/typescript/src/theme/useTheme.d.ts.map +1 -0
  156. package/lib/typescript/src/types/events.d.ts +8 -0
  157. package/lib/typescript/src/types/events.d.ts.map +1 -0
  158. package/lib/typescript/src/types/index.d.ts +5 -0
  159. package/lib/typescript/src/types/index.d.ts.map +1 -0
  160. package/lib/typescript/src/types/native.d.ts +26 -0
  161. package/lib/typescript/src/types/native.d.ts.map +1 -0
  162. package/lib/typescript/src/types/presentation.d.ts +26 -0
  163. package/lib/typescript/src/types/presentation.d.ts.map +1 -0
  164. package/lib/typescript/src/types/props.d.ts +221 -0
  165. package/lib/typescript/src/types/props.d.ts.map +1 -0
  166. package/lib/typescript/src/utils/constants.d.ts +12 -0
  167. package/lib/typescript/src/utils/constants.d.ts.map +1 -0
  168. package/lib/typescript/src/utils/dateConversion.d.ts +46 -0
  169. package/lib/typescript/src/utils/dateConversion.d.ts.map +1 -0
  170. package/lib/typescript/src/utils/dateFormatting.d.ts +8 -0
  171. package/lib/typescript/src/utils/dateFormatting.d.ts.map +1 -0
  172. package/lib/typescript/src/utils/dateValidation.d.ts +46 -0
  173. package/lib/typescript/src/utils/dateValidation.d.ts.map +1 -0
  174. package/lib/typescript/src/utils/index.d.ts +5 -0
  175. package/lib/typescript/src/utils/index.d.ts.map +1 -0
  176. package/package.json +191 -4
  177. package/src/NativeDateTimePickerKit.ts +19 -0
  178. package/src/components/CalendarPicker.tsx +623 -0
  179. package/src/components/ClockPicker.tsx +403 -0
  180. package/src/components/DatePicker.tsx +276 -0
  181. package/src/components/DateRangePicker.tsx +251 -0
  182. package/src/components/DateTimePicker.tsx +1028 -0
  183. package/src/components/MonthPicker.tsx +216 -0
  184. package/src/components/TimePicker.tsx +203 -0
  185. package/src/components/TimeSlotPicker.tsx +163 -0
  186. package/src/components/WheelPicker.tsx +229 -0
  187. package/src/components/YearPicker.tsx +228 -0
  188. package/src/components/common/ModalWrapper.tsx +192 -0
  189. package/src/components/common/PickerHeader.tsx +121 -0
  190. package/src/components/common/PresetsBar.tsx +104 -0
  191. package/src/errors/DateTimePickerError.ts +29 -0
  192. package/src/hooks/useDateTimePicker.ts +100 -0
  193. package/src/index.tsx +92 -0
  194. package/src/localization/index.ts +3 -0
  195. package/src/localization/locales.ts +499 -0
  196. package/src/localization/types.ts +21 -0
  197. package/src/localization/useLocale.ts +197 -0
  198. package/src/native/NativeDateTimePicker.ts +154 -0
  199. package/src/presets/datePresets.ts +97 -0
  200. package/src/presets/index.ts +1 -0
  201. package/src/slots/index.ts +1 -0
  202. package/src/slots/timeSlots.ts +89 -0
  203. package/src/theme/defaultTheme.ts +102 -0
  204. package/src/theme/index.ts +3 -0
  205. package/src/theme/types.ts +82 -0
  206. package/src/theme/useTheme.ts +98 -0
  207. package/src/types/events.ts +8 -0
  208. package/src/types/index.ts +4 -0
  209. package/src/types/native.ts +28 -0
  210. package/src/types/presentation.ts +28 -0
  211. package/src/types/props.ts +291 -0
  212. package/src/utils/constants.ts +15 -0
  213. package/src/utils/dateConversion.ts +273 -0
  214. package/src/utils/dateFormatting.ts +166 -0
  215. package/src/utils/dateValidation.ts +178 -0
  216. package/src/utils/index.ts +4 -0
@@ -0,0 +1,1028 @@
1
+ import {
2
+ forwardRef,
3
+ useCallback,
4
+ useEffect,
5
+ useImperativeHandle,
6
+ useMemo,
7
+ useRef,
8
+ useState,
9
+ } from 'react';
10
+ import { StyleSheet, Text, TouchableOpacity, View } from 'react-native';
11
+ import { DateTimePickerError } from '../errors/DateTimePickerError';
12
+ import { useLocale } from '../localization';
13
+ import { NativeDateTimePicker } from '../native/NativeDateTimePicker';
14
+ import { type DatePreset, getStandardSinglePresets } from '../presets';
15
+ import { useTheme } from '../theme';
16
+ import type { ResolvedTheme, ThemeConfig } from '../theme/types';
17
+ import type {
18
+ DateTimePickerProps,
19
+ DateTimePickerRef,
20
+ NativePickerAction,
21
+ NativePickerOptions,
22
+ NativePickerTheme,
23
+ OpenPickerOptions,
24
+ } from '../types';
25
+ import {
26
+ clampDate,
27
+ clampTime,
28
+ dateToTimestamp,
29
+ normalizeDateWithTimezone,
30
+ parseDate,
31
+ timestampToDate,
32
+ } from '../utils/dateConversion';
33
+ import {
34
+ isDateDisabled,
35
+ validateDateRange,
36
+ validateMinuteInterval,
37
+ } from '../utils/dateValidation';
38
+ import { CalendarPicker } from './CalendarPicker';
39
+ import { ClockPicker } from './ClockPicker';
40
+ import { ModalWrapper } from './common/ModalWrapper';
41
+ import { PickerHeader } from './common/PickerHeader';
42
+ import { PresetsBar } from './common/PresetsBar';
43
+ import { WheelPicker } from './WheelPicker';
44
+
45
+ export const DateTimePicker = forwardRef<
46
+ DateTimePickerRef,
47
+ DateTimePickerProps
48
+ >((props, ref) => {
49
+ const {
50
+ mode = 'date',
51
+ value: propValue,
52
+ defaultValue,
53
+ display = 'default',
54
+ disabled = false,
55
+ presentation = 'native',
56
+ minimumDate,
57
+ maximumDate,
58
+ minuteInterval,
59
+ disabledDates,
60
+ disabledWeekdays,
61
+ markedDates,
62
+ firstDayOfWeek,
63
+ locale: propLocale,
64
+ timeZoneOffsetInMinutes,
65
+ is24Hour,
66
+ theme: propTheme = 'auto',
67
+ title,
68
+ confirmText,
69
+ cancelText,
70
+ accentColor,
71
+ textColor,
72
+ backgroundColor,
73
+ showPresets = false,
74
+ customPresets,
75
+ onChange,
76
+ onConfirm,
77
+ onCancel,
78
+ onDismiss,
79
+ onOpen,
80
+ onError,
81
+ open: propOpen,
82
+ backdropOpacity,
83
+ animationType,
84
+ showHandle,
85
+ closeOnBackdropPress,
86
+ testID,
87
+ } = props;
88
+
89
+ const effectiveMinDate = minimumDate ?? props.minDate;
90
+ const effectiveMaxDate = maximumDate ?? props.maxDate;
91
+ const effectiveTimeZone = props.timeZone ?? props.timeZoneName;
92
+ const effectiveOffsetMinutes =
93
+ timeZoneOffsetInMinutes !== undefined
94
+ ? timeZoneOffsetInMinutes
95
+ : props.utcOffset !== undefined
96
+ ? Math.abs(props.utcOffset) <= 14
97
+ ? props.utcOffset * 60
98
+ : props.utcOffset
99
+ : undefined;
100
+
101
+ const effectiveOpen =
102
+ propOpen !== undefined
103
+ ? propOpen
104
+ : props.isVisible !== undefined
105
+ ? props.isVisible
106
+ : props.visible !== undefined
107
+ ? props.visible
108
+ : undefined;
109
+
110
+ // Track internal date state with bounds clamping and timezone normalization
111
+ const initialDate = useMemo(() => {
112
+ let d = parseDate(propValue) || parseDate(defaultValue) || new Date();
113
+ if (effectiveTimeZone || effectiveOffsetMinutes !== undefined) {
114
+ d = normalizeDateWithTimezone(
115
+ d,
116
+ effectiveTimeZone,
117
+ effectiveOffsetMinutes
118
+ );
119
+ }
120
+ const clamped = clampDate(d, effectiveMinDate, effectiveMaxDate);
121
+ return clamped ? clampTime(clamped, effectiveMinDate, effectiveMaxDate) : d;
122
+ }, [
123
+ propValue,
124
+ defaultValue,
125
+ effectiveTimeZone,
126
+ effectiveOffsetMinutes,
127
+ effectiveMinDate,
128
+ effectiveMaxDate,
129
+ ]);
130
+
131
+ const [currentDate, setCurrentDate] = useState<Date>(initialDate);
132
+ const isOpenRef = useRef<boolean>(false);
133
+ const dateRef = useRef<Date>(currentDate);
134
+
135
+ // JS modal presentation state
136
+ const [isJsModalVisible, setIsJsModalVisible] = useState(false);
137
+ const [dateTimeTab, setDateTimeTab] = useState<'date' | 'time'>('date');
138
+ const [activePresetId, setActivePresetId] = useState<string | undefined>();
139
+
140
+ // Theme & Locale with custom overrides
141
+ const themeInput = useMemo(() => {
142
+ let base: ThemeConfig =
143
+ typeof propTheme === 'object'
144
+ ? { ...propTheme }
145
+ : ({ mode: propTheme } as ThemeConfig);
146
+
147
+ if (props.themeColors) {
148
+ base = {
149
+ ...base,
150
+ themeColors: {
151
+ ...base.themeColors,
152
+ ...props.themeColors,
153
+ },
154
+ };
155
+ }
156
+ if (accentColor || textColor || backgroundColor) {
157
+ base = {
158
+ ...base,
159
+ colors: {
160
+ ...base.colors,
161
+ ...(accentColor && {
162
+ accent: accentColor,
163
+ primary: accentColor,
164
+ selected: accentColor,
165
+ }),
166
+ ...(textColor && { text: textColor }),
167
+ ...(backgroundColor && {
168
+ background: backgroundColor,
169
+ modalBackground: backgroundColor,
170
+ }),
171
+ },
172
+ };
173
+ }
174
+ return base;
175
+ }, [propTheme, props.themeColors, accentColor, textColor, backgroundColor]);
176
+
177
+ const resolvedTheme: ResolvedTheme = useTheme(themeInput);
178
+ const localeData = useLocale(propLocale);
179
+
180
+ // Keep dateRef synced
181
+ useEffect(() => {
182
+ dateRef.current = currentDate;
183
+ }, [currentDate]);
184
+
185
+ // Update if propValue changes
186
+ useEffect(() => {
187
+ if (propValue !== undefined && propValue !== null) {
188
+ let parsed = parseDate(propValue);
189
+ if (parsed) {
190
+ if (effectiveTimeZone || effectiveOffsetMinutes !== undefined) {
191
+ parsed = normalizeDateWithTimezone(
192
+ parsed,
193
+ effectiveTimeZone,
194
+ effectiveOffsetMinutes
195
+ );
196
+ }
197
+ const clamped = clampDate(parsed, effectiveMinDate, effectiveMaxDate);
198
+ const finalDate = clamped
199
+ ? clampTime(clamped, effectiveMinDate, effectiveMaxDate)
200
+ : parsed;
201
+ setCurrentDate(finalDate);
202
+ dateRef.current = finalDate;
203
+ }
204
+ }
205
+ }, [
206
+ propValue,
207
+ effectiveTimeZone,
208
+ effectiveOffsetMinutes,
209
+ effectiveMinDate,
210
+ effectiveMaxDate,
211
+ ]);
212
+
213
+ const buildNativeOptions = useCallback(
214
+ (targetDate: Date): NativePickerOptions => {
215
+ const minTimestamp = effectiveMinDate
216
+ ? dateToTimestamp(effectiveMinDate)
217
+ : undefined;
218
+ const maxTimestamp = effectiveMaxDate
219
+ ? dateToTimestamp(effectiveMaxDate)
220
+ : undefined;
221
+
222
+ const nativeTheme: NativePickerTheme =
223
+ typeof propTheme === 'string' &&
224
+ (propTheme === 'light' || propTheme === 'dark' || propTheme === 'auto')
225
+ ? propTheme
226
+ : 'auto';
227
+
228
+ return {
229
+ value: targetDate.getTime(),
230
+ minimumDate: minTimestamp ?? undefined,
231
+ maximumDate: maxTimestamp ?? undefined,
232
+ display,
233
+ locale: typeof propLocale === 'string' ? propLocale : propLocale?.code,
234
+ timeZoneOffsetInMinutes: effectiveOffsetMinutes,
235
+ is24Hour,
236
+ minuteInterval,
237
+ title,
238
+ confirmText,
239
+ cancelText,
240
+ theme: nativeTheme,
241
+ accentColor,
242
+ textColor,
243
+ backgroundColor,
244
+ };
245
+ },
246
+ [
247
+ effectiveMinDate,
248
+ effectiveMaxDate,
249
+ display,
250
+ propLocale,
251
+ effectiveOffsetMinutes,
252
+ is24Hour,
253
+ minuteInterval,
254
+ title,
255
+ confirmText,
256
+ cancelText,
257
+ propTheme,
258
+ accentColor,
259
+ textColor,
260
+ backgroundColor,
261
+ ]
262
+ );
263
+
264
+ const openPicker = useCallback(async (): Promise<Date | null> => {
265
+ if (disabled) {
266
+ const err = new DateTimePickerError(
267
+ 'UNKNOWN_ERROR',
268
+ 'Cannot open picker: component is disabled.'
269
+ );
270
+ onError?.(err);
271
+ return null;
272
+ }
273
+
274
+ if (minuteInterval !== undefined) {
275
+ if (!validateMinuteInterval(minuteInterval)) {
276
+ const err = new DateTimePickerError(
277
+ 'INVALID_MINUTE_INTERVAL',
278
+ `minuteInterval must be a positive integer that evenly divides 60. Received: ${minuteInterval}`
279
+ );
280
+ onError?.(err);
281
+ throw err;
282
+ }
283
+ }
284
+
285
+ if (effectiveMinDate && effectiveMaxDate) {
286
+ if (!validateDateRange(effectiveMinDate, effectiveMaxDate)) {
287
+ const err = new DateTimePickerError(
288
+ 'DATE_OUT_OF_RANGE',
289
+ 'minimumDate cannot be after maximumDate.'
290
+ );
291
+ onError?.(err);
292
+ throw err;
293
+ }
294
+ }
295
+
296
+ // Presentation: JS Modal / Bottom Sheet / Fullscreen
297
+ if (presentation !== 'native') {
298
+ setIsJsModalVisible(true);
299
+ setDateTimeTab('date');
300
+ isOpenRef.current = true;
301
+ onOpen?.();
302
+ return null;
303
+ }
304
+
305
+ // Presentation: Native (TurboModule)
306
+ if (isOpenRef.current) {
307
+ const err = new DateTimePickerError(
308
+ 'PICKER_ALREADY_OPEN',
309
+ 'A native picker dialog is already active.'
310
+ );
311
+ onError?.(err);
312
+ throw err;
313
+ }
314
+
315
+ isOpenRef.current = true;
316
+ onOpen?.();
317
+
318
+ const targetDate = dateRef.current;
319
+ const nativeOptions = buildNativeOptions(targetDate);
320
+
321
+ try {
322
+ let result: { action: NativePickerAction; timestamp: number };
323
+
324
+ switch (mode) {
325
+ case 'time':
326
+ result = await NativeDateTimePicker.openTimePicker(nativeOptions);
327
+ break;
328
+ case 'datetime':
329
+ result = await NativeDateTimePicker.openDateTimePicker(nativeOptions);
330
+ break;
331
+ case 'countdown':
332
+ result =
333
+ await NativeDateTimePicker.openCountdownPicker(nativeOptions);
334
+ break;
335
+ case 'date':
336
+ default:
337
+ result = await NativeDateTimePicker.openDatePicker(nativeOptions);
338
+ break;
339
+ }
340
+
341
+ const action = result.action;
342
+ if (action === 'confirmed') {
343
+ const selectedDate = timestampToDate(result.timestamp);
344
+
345
+ if (isDateDisabled(selectedDate, disabledDates, disabledWeekdays)) {
346
+ const err = new DateTimePickerError(
347
+ 'DATE_OUT_OF_RANGE',
348
+ 'Selected date is in disabledDates or disabledWeekdays.'
349
+ );
350
+ onError?.(err);
351
+ }
352
+
353
+ setCurrentDate(selectedDate);
354
+ dateRef.current = selectedDate;
355
+ onChange?.(selectedDate);
356
+ onConfirm?.(selectedDate);
357
+ return selectedDate;
358
+ } else if (action === 'cancelled') {
359
+ onCancel?.();
360
+ return null;
361
+ } else {
362
+ onDismiss?.();
363
+ return null;
364
+ }
365
+ } catch (error) {
366
+ const normalized =
367
+ error instanceof DateTimePickerError
368
+ ? error
369
+ : new DateTimePickerError(
370
+ 'UNKNOWN_ERROR',
371
+ error instanceof Error ? error.message : 'Unknown error',
372
+ error
373
+ );
374
+ onError?.(normalized);
375
+ throw normalized;
376
+ } finally {
377
+ isOpenRef.current = false;
378
+ }
379
+ }, [
380
+ disabled,
381
+ minuteInterval,
382
+ effectiveMinDate,
383
+ effectiveMaxDate,
384
+ presentation,
385
+ onOpen,
386
+ buildNativeOptions,
387
+ mode,
388
+ disabledDates,
389
+ disabledWeekdays,
390
+ onChange,
391
+ onConfirm,
392
+ onCancel,
393
+ onDismiss,
394
+ onError,
395
+ ]);
396
+
397
+ const closePicker = useCallback(async (): Promise<boolean> => {
398
+ if (presentation !== 'native') {
399
+ setIsJsModalVisible(false);
400
+ isOpenRef.current = false;
401
+ onDismiss?.();
402
+ return true;
403
+ }
404
+
405
+ if (!isOpenRef.current) {
406
+ return false;
407
+ }
408
+ try {
409
+ const closed = await NativeDateTimePicker.closePicker();
410
+ isOpenRef.current = false;
411
+ onDismiss?.();
412
+ return closed;
413
+ } catch (error) {
414
+ const normalized =
415
+ error instanceof DateTimePickerError
416
+ ? error
417
+ : new DateTimePickerError(
418
+ 'UNKNOWN_ERROR',
419
+ error instanceof Error ? error.message : 'Failed to close picker',
420
+ error
421
+ );
422
+ onError?.(normalized);
423
+ return false;
424
+ }
425
+ }, [presentation, onDismiss, onError]);
426
+
427
+ const confirmProgrammatic = useCallback(async (): Promise<Date | null> => {
428
+ if (presentation !== 'native') {
429
+ const selectedDate = dateRef.current;
430
+ setIsJsModalVisible(false);
431
+ isOpenRef.current = false;
432
+ onChange?.(selectedDate);
433
+ onConfirm?.(selectedDate);
434
+ return selectedDate;
435
+ }
436
+
437
+ try {
438
+ const result = await NativeDateTimePicker.confirmPicker();
439
+ const selectedDate = timestampToDate(result.timestamp);
440
+ setCurrentDate(selectedDate);
441
+ dateRef.current = selectedDate;
442
+ isOpenRef.current = false;
443
+ onChange?.(selectedDate);
444
+ onConfirm?.(selectedDate);
445
+ return selectedDate;
446
+ } catch (error) {
447
+ const normalized =
448
+ error instanceof DateTimePickerError
449
+ ? error
450
+ : new DateTimePickerError(
451
+ 'PICKER_NOT_OPEN',
452
+ error instanceof Error
453
+ ? error.message
454
+ : 'Picker is not currently open to confirm',
455
+ error
456
+ );
457
+ onError?.(normalized);
458
+ return null;
459
+ }
460
+ }, [presentation, onChange, onConfirm, onError]);
461
+
462
+ const cancelProgrammatic = useCallback(async (): Promise<boolean> => {
463
+ if (presentation !== 'native') {
464
+ setIsJsModalVisible(false);
465
+ isOpenRef.current = false;
466
+ onCancel?.();
467
+ return true;
468
+ }
469
+
470
+ try {
471
+ const cancelled = await NativeDateTimePicker.cancelPicker();
472
+ isOpenRef.current = false;
473
+ onCancel?.();
474
+ return cancelled;
475
+ } catch (error) {
476
+ const normalized =
477
+ error instanceof DateTimePickerError
478
+ ? error
479
+ : new DateTimePickerError(
480
+ 'PICKER_NOT_OPEN',
481
+ error instanceof Error
482
+ ? error.message
483
+ : 'Picker is not currently open to cancel',
484
+ error
485
+ );
486
+ onError?.(normalized);
487
+ return false;
488
+ }
489
+ }, [presentation, onCancel, onError]);
490
+
491
+ const reset = useCallback(() => {
492
+ setCurrentDate(initialDate);
493
+ dateRef.current = initialDate;
494
+ setActivePresetId(undefined);
495
+ }, [initialDate]);
496
+
497
+ const getValue = useCallback((): Date | null => {
498
+ return dateRef.current;
499
+ }, []);
500
+
501
+ const setValue = useCallback(
502
+ (date: Date | number | string) => {
503
+ let parsed = parseDate(date);
504
+ if (parsed) {
505
+ if (effectiveTimeZone || effectiveOffsetMinutes !== undefined) {
506
+ parsed = normalizeDateWithTimezone(
507
+ parsed,
508
+ effectiveTimeZone,
509
+ effectiveOffsetMinutes
510
+ );
511
+ }
512
+ const clamped = clampDate(parsed, effectiveMinDate, effectiveMaxDate);
513
+ const finalDate = clamped
514
+ ? clampTime(clamped, effectiveMinDate, effectiveMaxDate)
515
+ : parsed;
516
+ setCurrentDate(finalDate);
517
+ dateRef.current = finalDate;
518
+ }
519
+ },
520
+ [
521
+ effectiveTimeZone,
522
+ effectiveOffsetMinutes,
523
+ effectiveMinDate,
524
+ effectiveMaxDate,
525
+ ]
526
+ );
527
+
528
+ // Imperative handle
529
+ useImperativeHandle(
530
+ ref,
531
+ () => ({
532
+ open: openPicker,
533
+ close: closePicker,
534
+ confirm: confirmProgrammatic,
535
+ cancel: cancelProgrammatic,
536
+ reset,
537
+ getValue,
538
+ setValue,
539
+ }),
540
+ [
541
+ openPicker,
542
+ closePicker,
543
+ confirmProgrammatic,
544
+ cancelProgrammatic,
545
+ reset,
546
+ getValue,
547
+ setValue,
548
+ ]
549
+ );
550
+
551
+ // Declarative open prop support
552
+ useEffect(() => {
553
+ if (effectiveOpen === true && !isOpenRef.current) {
554
+ openPicker().catch(() => {});
555
+ } else if (effectiveOpen === false && isOpenRef.current) {
556
+ closePicker().catch(() => {});
557
+ }
558
+ }, [effectiveOpen, openPicker, closePicker]);
559
+
560
+ // Presets handling
561
+ const presets = useMemo(() => {
562
+ if (!showPresets) return [];
563
+ return customPresets || getStandardSinglePresets();
564
+ }, [showPresets, customPresets]);
565
+
566
+ const handleSelectPreset = useCallback(
567
+ (preset: DatePreset) => {
568
+ setActivePresetId(preset.id);
569
+ const val = preset.getValue();
570
+ if (val instanceof Date) {
571
+ let updated = val;
572
+ if (effectiveTimeZone || effectiveOffsetMinutes !== undefined) {
573
+ updated = normalizeDateWithTimezone(
574
+ updated,
575
+ effectiveTimeZone,
576
+ effectiveOffsetMinutes
577
+ );
578
+ }
579
+ const clamped = clampDate(updated, effectiveMinDate, effectiveMaxDate);
580
+ const finalDate = clamped
581
+ ? clampTime(clamped, effectiveMinDate, effectiveMaxDate)
582
+ : updated;
583
+ setCurrentDate(finalDate);
584
+ dateRef.current = finalDate;
585
+ onChange?.(finalDate);
586
+ }
587
+ },
588
+ [
589
+ effectiveTimeZone,
590
+ effectiveOffsetMinutes,
591
+ effectiveMinDate,
592
+ effectiveMaxDate,
593
+ onChange,
594
+ ]
595
+ );
596
+
597
+ const handleJsDateChange = useCallback(
598
+ (newDate: Date) => {
599
+ setActivePresetId(undefined);
600
+ let updated = newDate;
601
+ if (effectiveTimeZone || effectiveOffsetMinutes !== undefined) {
602
+ updated = normalizeDateWithTimezone(
603
+ updated,
604
+ effectiveTimeZone,
605
+ effectiveOffsetMinutes
606
+ );
607
+ }
608
+ const clamped = clampDate(updated, effectiveMinDate, effectiveMaxDate);
609
+ const finalDate = clamped
610
+ ? clampTime(clamped, effectiveMinDate, effectiveMaxDate)
611
+ : updated;
612
+ setCurrentDate(finalDate);
613
+ dateRef.current = finalDate;
614
+ onChange?.(finalDate);
615
+ },
616
+ [
617
+ effectiveTimeZone,
618
+ effectiveOffsetMinutes,
619
+ effectiveMinDate,
620
+ effectiveMaxDate,
621
+ onChange,
622
+ ]
623
+ );
624
+
625
+ const handleJsConfirm = useCallback(() => {
626
+ let finalDate = new Date(currentDate.getTime());
627
+ if (effectiveTimeZone || effectiveOffsetMinutes !== undefined) {
628
+ finalDate = normalizeDateWithTimezone(
629
+ finalDate,
630
+ effectiveTimeZone,
631
+ effectiveOffsetMinutes
632
+ );
633
+ }
634
+ const clamped = clampDate(finalDate, effectiveMinDate, effectiveMaxDate);
635
+ const confirmedDate = clamped
636
+ ? clampTime(clamped, effectiveMinDate, effectiveMaxDate)
637
+ : finalDate;
638
+
639
+ setIsJsModalVisible(false);
640
+ isOpenRef.current = false;
641
+ onChange?.(confirmedDate);
642
+ onConfirm?.(confirmedDate);
643
+ }, [
644
+ currentDate,
645
+ effectiveTimeZone,
646
+ effectiveOffsetMinutes,
647
+ effectiveMinDate,
648
+ effectiveMaxDate,
649
+ onChange,
650
+ onConfirm,
651
+ ]);
652
+
653
+ const handleJsCancel = useCallback(() => {
654
+ setIsJsModalVisible(false);
655
+ isOpenRef.current = false;
656
+ onCancel?.();
657
+ }, [onCancel]);
658
+
659
+ // If native, don't render JS UI (TurboModule handles presentation)
660
+ if (presentation === 'native') {
661
+ return null;
662
+ }
663
+
664
+ const defaultHeaderTitle =
665
+ title ||
666
+ (mode === 'time'
667
+ ? localeData.selectTimeTitle
668
+ : mode === 'datetime'
669
+ ? localeData.selectDateTimeTitle
670
+ : localeData.selectDateTitle);
671
+
672
+ const isModalVisible = isJsModalVisible;
673
+
674
+ // Render JS UI based on mode
675
+ const renderPickerBody = () => {
676
+ if (mode === 'time') {
677
+ return (
678
+ <ClockPicker
679
+ value={currentDate}
680
+ is24Hour={is24Hour}
681
+ minuteInterval={minuteInterval}
682
+ locale={localeData}
683
+ theme={resolvedTheme}
684
+ onChange={(res) => handleJsDateChange(res.date)}
685
+ />
686
+ );
687
+ }
688
+
689
+ if (mode === 'countdown') {
690
+ const minutesItems = Array.from({ length: 60 }, (_, i) => ({
691
+ label: `${i} min`,
692
+ value: i,
693
+ }));
694
+ return (
695
+ <View style={styles.countdownContainer}>
696
+ <WheelPicker
697
+ items={minutesItems}
698
+ selectedValue={currentDate.getMinutes()}
699
+ theme={resolvedTheme}
700
+ onChange={(val) => {
701
+ const d = new Date(currentDate);
702
+ d.setMinutes(val);
703
+ handleJsDateChange(d);
704
+ }}
705
+ />
706
+ </View>
707
+ );
708
+ }
709
+
710
+ if (mode === 'datetime') {
711
+ return (
712
+ <View>
713
+ {/* Tab selector between Date and Time */}
714
+ <View
715
+ style={[
716
+ styles.tabsRow,
717
+ {
718
+ borderColor: resolvedTheme.colors.border,
719
+ backgroundColor: resolvedTheme.colors.card,
720
+ },
721
+ ]}
722
+ >
723
+ <TouchableOpacity
724
+ onPress={() => setDateTimeTab('date')}
725
+ style={[
726
+ styles.tabBtn,
727
+ dateTimeTab === 'date' && {
728
+ backgroundColor: resolvedTheme.colors.primary,
729
+ },
730
+ ]}
731
+ >
732
+ <Text
733
+ style={[
734
+ styles.tabText,
735
+ {
736
+ color:
737
+ dateTimeTab === 'date'
738
+ ? resolvedTheme.colors.primaryText
739
+ : resolvedTheme.colors.textSecondary,
740
+ fontWeight: dateTimeTab === 'date' ? 'bold' : 'normal',
741
+ },
742
+ ]}
743
+ >
744
+ Date
745
+ </Text>
746
+ </TouchableOpacity>
747
+
748
+ <TouchableOpacity
749
+ onPress={() => setDateTimeTab('time')}
750
+ style={[
751
+ styles.tabBtn,
752
+ dateTimeTab === 'time' && {
753
+ backgroundColor: resolvedTheme.colors.primary,
754
+ },
755
+ ]}
756
+ >
757
+ <Text
758
+ style={[
759
+ styles.tabText,
760
+ {
761
+ color:
762
+ dateTimeTab === 'time'
763
+ ? resolvedTheme.colors.primaryText
764
+ : resolvedTheme.colors.textSecondary,
765
+ fontWeight: dateTimeTab === 'time' ? 'bold' : 'normal',
766
+ },
767
+ ]}
768
+ >
769
+ Time
770
+ </Text>
771
+ </TouchableOpacity>
772
+ </View>
773
+
774
+ {dateTimeTab === 'date' ? (
775
+ <CalendarPicker
776
+ value={currentDate}
777
+ onChange={handleJsDateChange}
778
+ minimumDate={effectiveMinDate}
779
+ maximumDate={effectiveMaxDate}
780
+ disabledDates={disabledDates}
781
+ disabledWeekdays={disabledWeekdays}
782
+ markedDates={markedDates}
783
+ firstDayOfWeek={firstDayOfWeek}
784
+ locale={localeData}
785
+ theme={resolvedTheme}
786
+ />
787
+ ) : (
788
+ <ClockPicker
789
+ value={currentDate}
790
+ is24Hour={is24Hour}
791
+ minuteInterval={minuteInterval}
792
+ locale={localeData}
793
+ theme={resolvedTheme}
794
+ onChange={(res) => {
795
+ const combined = new Date(currentDate);
796
+ combined.setHours(res.hour, res.minute);
797
+ handleJsDateChange(combined);
798
+ }}
799
+ />
800
+ )}
801
+ </View>
802
+ );
803
+ }
804
+
805
+ // Default mode === 'date'
806
+ return (
807
+ <CalendarPicker
808
+ value={currentDate}
809
+ onChange={handleJsDateChange}
810
+ minimumDate={effectiveMinDate}
811
+ maximumDate={effectiveMaxDate}
812
+ disabledDates={disabledDates}
813
+ disabledWeekdays={disabledWeekdays}
814
+ markedDates={markedDates}
815
+ firstDayOfWeek={firstDayOfWeek}
816
+ locale={localeData}
817
+ theme={resolvedTheme}
818
+ />
819
+ );
820
+ };
821
+
822
+ const content = (
823
+ <View style={styles.innerContent}>
824
+ {presentation !== 'inline' && (
825
+ <PickerHeader
826
+ title={defaultHeaderTitle}
827
+ cancelText={cancelText || localeData.cancelText}
828
+ confirmText={confirmText || localeData.confirmText}
829
+ onCancel={handleJsCancel}
830
+ onConfirm={handleJsConfirm}
831
+ theme={resolvedTheme}
832
+ isRTL={localeData.isRTL}
833
+ />
834
+ )}
835
+
836
+ {showPresets && presets.length > 0 && (
837
+ <PresetsBar
838
+ presets={presets}
839
+ activePresetId={activePresetId}
840
+ onSelectPreset={handleSelectPreset}
841
+ theme={resolvedTheme}
842
+ isRTL={localeData.isRTL}
843
+ />
844
+ )}
845
+
846
+ {renderPickerBody()}
847
+ </View>
848
+ );
849
+
850
+ return (
851
+ <ModalWrapper
852
+ testID={testID}
853
+ presentation={presentation}
854
+ visible={isModalVisible}
855
+ onClose={handleJsCancel}
856
+ theme={resolvedTheme}
857
+ backdropOpacity={backdropOpacity}
858
+ animationType={animationType}
859
+ showHandle={showHandle}
860
+ closeOnBackdropPress={closeOnBackdropPress}
861
+ >
862
+ {content}
863
+ </ModalWrapper>
864
+ );
865
+ });
866
+
867
+ DateTimePicker.displayName = 'DateTimePicker';
868
+
869
+ /**
870
+ * Imperative helper function to open the native Date Time Picker modal.
871
+ */
872
+ export async function openDateTimePickerModal(
873
+ options: OpenPickerOptions
874
+ ): Promise<Date | null> {
875
+ const {
876
+ mode = 'date',
877
+ value = new Date(),
878
+ minimumDate,
879
+ maximumDate,
880
+ display = 'default',
881
+ locale,
882
+ timeZoneOffsetInMinutes,
883
+ is24Hour,
884
+ minuteInterval,
885
+ title,
886
+ confirmText,
887
+ cancelText,
888
+ theme = 'auto',
889
+ accentColor,
890
+ textColor,
891
+ backgroundColor,
892
+ disabledDates,
893
+ disabledWeekdays,
894
+ onChange,
895
+ onConfirm,
896
+ onCancel,
897
+ onDismiss,
898
+ onError,
899
+ } = options;
900
+
901
+ if (minuteInterval !== undefined && !validateMinuteInterval(minuteInterval)) {
902
+ const err = new DateTimePickerError(
903
+ 'INVALID_MINUTE_INTERVAL',
904
+ `minuteInterval must be a positive integer dividing 60. Received: ${minuteInterval}`
905
+ );
906
+ onError?.(err);
907
+ throw err;
908
+ }
909
+
910
+ if (
911
+ minimumDate &&
912
+ maximumDate &&
913
+ !validateDateRange(minimumDate, maximumDate)
914
+ ) {
915
+ const err = new DateTimePickerError(
916
+ 'DATE_OUT_OF_RANGE',
917
+ 'minimumDate cannot be after maximumDate.'
918
+ );
919
+ onError?.(err);
920
+ throw err;
921
+ }
922
+
923
+ const parsedValue = parseDate(value) || new Date();
924
+ const minTimestamp = minimumDate ? dateToTimestamp(minimumDate) : undefined;
925
+ const maxTimestamp = maximumDate ? dateToTimestamp(maximumDate) : undefined;
926
+
927
+ const nativeTheme: NativePickerTheme =
928
+ typeof theme === 'string' &&
929
+ (theme === 'light' || theme === 'dark' || theme === 'auto')
930
+ ? theme
931
+ : 'auto';
932
+
933
+ const nativeOptions: NativePickerOptions = {
934
+ value: parsedValue.getTime(),
935
+ minimumDate: minTimestamp ?? undefined,
936
+ maximumDate: maxTimestamp ?? undefined,
937
+ display,
938
+ locale: typeof locale === 'string' ? locale : locale?.code,
939
+ timeZoneOffsetInMinutes,
940
+ is24Hour,
941
+ minuteInterval,
942
+ title,
943
+ confirmText,
944
+ cancelText,
945
+ theme: nativeTheme,
946
+ accentColor,
947
+ textColor,
948
+ backgroundColor,
949
+ };
950
+
951
+ try {
952
+ let result: { action: NativePickerAction; timestamp: number };
953
+
954
+ switch (mode) {
955
+ case 'time':
956
+ result = await NativeDateTimePicker.openTimePicker(nativeOptions);
957
+ break;
958
+ case 'datetime':
959
+ result = await NativeDateTimePicker.openDateTimePicker(nativeOptions);
960
+ break;
961
+ case 'countdown':
962
+ result = await NativeDateTimePicker.openCountdownPicker(nativeOptions);
963
+ break;
964
+ case 'date':
965
+ default:
966
+ result = await NativeDateTimePicker.openDatePicker(nativeOptions);
967
+ break;
968
+ }
969
+
970
+ const selectedDate = timestampToDate(result.timestamp);
971
+ if (result.action === 'confirmed') {
972
+ if (isDateDisabled(selectedDate, disabledDates, disabledWeekdays)) {
973
+ const err = new DateTimePickerError(
974
+ 'DATE_OUT_OF_RANGE',
975
+ 'Selected date is disabled.'
976
+ );
977
+ onError?.(err);
978
+ }
979
+ onChange?.(selectedDate);
980
+ onConfirm?.(selectedDate);
981
+ return selectedDate;
982
+ } else if (result.action === 'cancelled') {
983
+ onCancel?.();
984
+ return null;
985
+ } else {
986
+ onDismiss?.();
987
+ return null;
988
+ }
989
+ } catch (error) {
990
+ const normalized =
991
+ error instanceof DateTimePickerError
992
+ ? error
993
+ : new DateTimePickerError(
994
+ 'UNKNOWN_ERROR',
995
+ error instanceof Error ? error.message : 'Unknown error',
996
+ error
997
+ );
998
+ onError?.(normalized);
999
+ throw normalized;
1000
+ }
1001
+ }
1002
+
1003
+ const styles = StyleSheet.create({
1004
+ innerContent: {
1005
+ width: '100%',
1006
+ },
1007
+ countdownContainer: {
1008
+ padding: 16,
1009
+ },
1010
+ tabsRow: {
1011
+ flexDirection: 'row',
1012
+ marginHorizontal: 16,
1013
+ marginTop: 12,
1014
+ marginBottom: 8,
1015
+ borderRadius: 8,
1016
+ borderWidth: 1,
1017
+ overflow: 'hidden',
1018
+ },
1019
+ tabBtn: {
1020
+ flex: 1,
1021
+ paddingVertical: 8,
1022
+ alignItems: 'center',
1023
+ justifyContent: 'center',
1024
+ },
1025
+ tabText: {
1026
+ fontSize: 14,
1027
+ },
1028
+ });