@izonnet-web-solution/react-native-date-picker-kit 0.0.0-stage → 1.0.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 (271) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/LICENSE +5 -0
  3. package/README.md +942 -2
  4. package/assets/screenshots/calendar-picker-blue.jpg +0 -0
  5. package/assets/screenshots/calendar-picker.jpg +0 -0
  6. package/assets/screenshots/datetime-picker-date.jpg +0 -0
  7. package/assets/screenshots/datetime-picker-time-blue.jpg +0 -0
  8. package/assets/screenshots/input-modal-picker.jpg +0 -0
  9. package/assets/screenshots/manual-entry-single.jpg +0 -0
  10. package/assets/screenshots/manual-entry-split.jpg +0 -0
  11. package/assets/screenshots/month-year-selector-modal.jpg +0 -0
  12. package/assets/screenshots/range-picker.jpg +0 -0
  13. package/assets/screenshots/time-12h-wheel.jpg +0 -0
  14. package/assets/screenshots/time-24h-military-blue.jpg +0 -0
  15. package/assets/screenshots/wheel-date-picker.jpg +0 -0
  16. package/lib/components/Calendar/Calendar.d.ts +35 -0
  17. package/lib/components/Calendar/Calendar.d.ts.map +1 -0
  18. package/lib/components/Calendar/Calendar.js +126 -0
  19. package/lib/components/Calendar/Calendar.js.map +1 -0
  20. package/lib/components/Calendar/CalendarGrid.d.ts +11 -0
  21. package/lib/components/Calendar/CalendarGrid.d.ts.map +1 -0
  22. package/lib/components/Calendar/CalendarGrid.js +22 -0
  23. package/lib/components/Calendar/CalendarGrid.js.map +1 -0
  24. package/lib/components/Calendar/CalendarHeader.d.ts +23 -0
  25. package/lib/components/Calendar/CalendarHeader.d.ts.map +1 -0
  26. package/lib/components/Calendar/CalendarHeader.js +62 -0
  27. package/lib/components/Calendar/CalendarHeader.js.map +1 -0
  28. package/lib/components/Calendar/DateCell.d.ts +11 -0
  29. package/lib/components/Calendar/DateCell.d.ts.map +1 -0
  30. package/lib/components/Calendar/DateCell.js +71 -0
  31. package/lib/components/Calendar/DateCell.js.map +1 -0
  32. package/lib/components/Calendar/MonthYearSelectorModal.d.ts +17 -0
  33. package/lib/components/Calendar/MonthYearSelectorModal.d.ts.map +1 -0
  34. package/lib/components/Calendar/MonthYearSelectorModal.js +253 -0
  35. package/lib/components/Calendar/MonthYearSelectorModal.js.map +1 -0
  36. package/lib/components/Calendar/WeekDays.d.ts +13 -0
  37. package/lib/components/Calendar/WeekDays.d.ts.map +1 -0
  38. package/lib/components/Calendar/WeekDays.js +34 -0
  39. package/lib/components/Calendar/WeekDays.js.map +1 -0
  40. package/lib/components/Calendar/index.d.ts +7 -0
  41. package/lib/components/Calendar/index.d.ts.map +1 -0
  42. package/lib/components/Calendar/index.js +23 -0
  43. package/lib/components/Calendar/index.js.map +1 -0
  44. package/lib/components/DatePicker.d.ts +4 -0
  45. package/lib/components/DatePicker.d.ts.map +1 -0
  46. package/lib/components/DatePicker.js +498 -0
  47. package/lib/components/DatePicker.js.map +1 -0
  48. package/lib/components/Input/CalendarPopup.d.ts +26 -0
  49. package/lib/components/Input/CalendarPopup.d.ts.map +1 -0
  50. package/lib/components/Input/CalendarPopup.js +60 -0
  51. package/lib/components/Input/CalendarPopup.js.map +1 -0
  52. package/lib/components/Input/DateInput.d.ts +29 -0
  53. package/lib/components/Input/DateInput.d.ts.map +1 -0
  54. package/lib/components/Input/DateInput.js +110 -0
  55. package/lib/components/Input/DateInput.js.map +1 -0
  56. package/lib/components/Input/index.d.ts +3 -0
  57. package/lib/components/Input/index.d.ts.map +1 -0
  58. package/lib/components/Input/index.js +19 -0
  59. package/lib/components/Input/index.js.map +1 -0
  60. package/lib/components/ManualDateInput/DateInputField.d.ts +19 -0
  61. package/lib/components/ManualDateInput/DateInputField.d.ts.map +1 -0
  62. package/lib/components/ManualDateInput/DateInputField.js +345 -0
  63. package/lib/components/ManualDateInput/DateInputField.js.map +1 -0
  64. package/lib/components/ManualDateInput/DateValidationMessage.d.ts +8 -0
  65. package/lib/components/ManualDateInput/DateValidationMessage.d.ts.map +1 -0
  66. package/lib/components/ManualDateInput/DateValidationMessage.js +45 -0
  67. package/lib/components/ManualDateInput/DateValidationMessage.js.map +1 -0
  68. package/lib/components/ManualDateInput/ManualDateInput.d.ts +19 -0
  69. package/lib/components/ManualDateInput/ManualDateInput.d.ts.map +1 -0
  70. package/lib/components/ManualDateInput/ManualDateInput.js +18 -0
  71. package/lib/components/ManualDateInput/ManualDateInput.js.map +1 -0
  72. package/lib/components/ManualDateInput/index.d.ts +4 -0
  73. package/lib/components/ManualDateInput/index.d.ts.map +1 -0
  74. package/lib/components/ManualDateInput/index.js +20 -0
  75. package/lib/components/ManualDateInput/index.js.map +1 -0
  76. package/lib/components/Range/RangeDateCell.d.ts +11 -0
  77. package/lib/components/Range/RangeDateCell.d.ts.map +1 -0
  78. package/lib/components/Range/RangeDateCell.js +107 -0
  79. package/lib/components/Range/RangeDateCell.js.map +1 -0
  80. package/lib/components/Range/RangePicker.d.ts +29 -0
  81. package/lib/components/Range/RangePicker.d.ts.map +1 -0
  82. package/lib/components/Range/RangePicker.js +261 -0
  83. package/lib/components/Range/RangePicker.js.map +1 -0
  84. package/lib/components/Range/index.d.ts +3 -0
  85. package/lib/components/Range/index.d.ts.map +1 -0
  86. package/lib/components/Range/index.js +19 -0
  87. package/lib/components/Range/index.js.map +1 -0
  88. package/lib/components/Time/ClockDial.d.ts +15 -0
  89. package/lib/components/Time/ClockDial.d.ts.map +1 -0
  90. package/lib/components/Time/ClockDial.js +347 -0
  91. package/lib/components/Time/ClockDial.js.map +1 -0
  92. package/lib/components/Time/DateTimePicker.d.ts +31 -0
  93. package/lib/components/Time/DateTimePicker.d.ts.map +1 -0
  94. package/lib/components/Time/DateTimePicker.js +197 -0
  95. package/lib/components/Time/DateTimePicker.js.map +1 -0
  96. package/lib/components/Time/TimePicker.d.ts +31 -0
  97. package/lib/components/Time/TimePicker.d.ts.map +1 -0
  98. package/lib/components/Time/TimePicker.js +550 -0
  99. package/lib/components/Time/TimePicker.js.map +1 -0
  100. package/lib/components/Time/WheelTimePicker.d.ts +27 -0
  101. package/lib/components/Time/WheelTimePicker.d.ts.map +1 -0
  102. package/lib/components/Time/WheelTimePicker.js +203 -0
  103. package/lib/components/Time/WheelTimePicker.js.map +1 -0
  104. package/lib/components/Time/index.d.ts +5 -0
  105. package/lib/components/Time/index.d.ts.map +1 -0
  106. package/lib/components/Time/index.js +21 -0
  107. package/lib/components/Time/index.js.map +1 -0
  108. package/lib/components/Wheel/WheelColumn.d.ts +17 -0
  109. package/lib/components/Wheel/WheelColumn.d.ts.map +1 -0
  110. package/lib/components/Wheel/WheelColumn.js +192 -0
  111. package/lib/components/Wheel/WheelColumn.js.map +1 -0
  112. package/lib/components/Wheel/WheelPicker.d.ts +26 -0
  113. package/lib/components/Wheel/WheelPicker.d.ts.map +1 -0
  114. package/lib/components/Wheel/WheelPicker.js +123 -0
  115. package/lib/components/Wheel/WheelPicker.js.map +1 -0
  116. package/lib/components/Wheel/index.d.ts +3 -0
  117. package/lib/components/Wheel/index.d.ts.map +1 -0
  118. package/lib/components/Wheel/index.js +19 -0
  119. package/lib/components/Wheel/index.js.map +1 -0
  120. package/lib/components/common/Button.d.ts +17 -0
  121. package/lib/components/common/Button.d.ts.map +1 -0
  122. package/lib/components/common/Button.js +77 -0
  123. package/lib/components/common/Button.js.map +1 -0
  124. package/lib/components/common/IconButton.d.ts +14 -0
  125. package/lib/components/common/IconButton.d.ts.map +1 -0
  126. package/lib/components/common/IconButton.js +150 -0
  127. package/lib/components/common/IconButton.js.map +1 -0
  128. package/lib/components/common/Modal.d.ts +13 -0
  129. package/lib/components/common/Modal.d.ts.map +1 -0
  130. package/lib/components/common/Modal.js +65 -0
  131. package/lib/components/common/Modal.js.map +1 -0
  132. package/lib/components/common/index.d.ts +4 -0
  133. package/lib/components/common/index.d.ts.map +1 -0
  134. package/lib/components/common/index.js +20 -0
  135. package/lib/components/common/index.js.map +1 -0
  136. package/lib/components/index.d.ts +9 -0
  137. package/lib/components/index.d.ts.map +1 -0
  138. package/lib/components/index.js +25 -0
  139. package/lib/components/index.js.map +1 -0
  140. package/lib/hooks/index.d.ts +4 -0
  141. package/lib/hooks/index.d.ts.map +1 -0
  142. package/lib/hooks/index.js +20 -0
  143. package/lib/hooks/index.js.map +1 -0
  144. package/lib/hooks/useCalendar.d.ts +34 -0
  145. package/lib/hooks/useCalendar.d.ts.map +1 -0
  146. package/lib/hooks/useCalendar.js +93 -0
  147. package/lib/hooks/useCalendar.js.map +1 -0
  148. package/lib/hooks/useDatePicker.d.ts +28 -0
  149. package/lib/hooks/useDatePicker.d.ts.map +1 -0
  150. package/lib/hooks/useDatePicker.js +150 -0
  151. package/lib/hooks/useDatePicker.js.map +1 -0
  152. package/lib/hooks/useDateRange.d.ts +23 -0
  153. package/lib/hooks/useDateRange.d.ts.map +1 -0
  154. package/lib/hooks/useDateRange.js +82 -0
  155. package/lib/hooks/useDateRange.js.map +1 -0
  156. package/lib/index.d.ts +7 -0
  157. package/lib/index.d.ts.map +1 -0
  158. package/lib/index.js +29 -0
  159. package/lib/index.js.map +1 -0
  160. package/lib/localization/en.d.ts +3 -0
  161. package/lib/localization/en.d.ts.map +1 -0
  162. package/lib/localization/en.js +80 -0
  163. package/lib/localization/en.js.map +1 -0
  164. package/lib/localization/gu.d.ts +3 -0
  165. package/lib/localization/gu.d.ts.map +1 -0
  166. package/lib/localization/gu.js +80 -0
  167. package/lib/localization/gu.js.map +1 -0
  168. package/lib/localization/hi.d.ts +3 -0
  169. package/lib/localization/hi.d.ts.map +1 -0
  170. package/lib/localization/hi.js +80 -0
  171. package/lib/localization/hi.js.map +1 -0
  172. package/lib/localization/index.d.ts +8 -0
  173. package/lib/localization/index.d.ts.map +1 -0
  174. package/lib/localization/index.js +32 -0
  175. package/lib/localization/index.js.map +1 -0
  176. package/lib/themes/dark.d.ts +3 -0
  177. package/lib/themes/dark.d.ts.map +1 -0
  178. package/lib/themes/dark.js +30 -0
  179. package/lib/themes/dark.js.map +1 -0
  180. package/lib/themes/index.d.ts +16 -0
  181. package/lib/themes/index.d.ts.map +1 -0
  182. package/lib/themes/index.js +56 -0
  183. package/lib/themes/index.js.map +1 -0
  184. package/lib/themes/light.d.ts +3 -0
  185. package/lib/themes/light.d.ts.map +1 -0
  186. package/lib/themes/light.js +30 -0
  187. package/lib/themes/light.js.map +1 -0
  188. package/lib/types/index.d.ts +344 -0
  189. package/lib/types/index.d.ts.map +1 -0
  190. package/lib/types/index.js +3 -0
  191. package/lib/types/index.js.map +1 -0
  192. package/lib/utils/calendarUtils.d.ts +27 -0
  193. package/lib/utils/calendarUtils.d.ts.map +1 -0
  194. package/lib/utils/calendarUtils.js +108 -0
  195. package/lib/utils/calendarUtils.js.map +1 -0
  196. package/lib/utils/dateFormatting.d.ts +29 -0
  197. package/lib/utils/dateFormatting.d.ts.map +1 -0
  198. package/lib/utils/dateFormatting.js +114 -0
  199. package/lib/utils/dateFormatting.js.map +1 -0
  200. package/lib/utils/dateParsing.d.ts +23 -0
  201. package/lib/utils/dateParsing.d.ts.map +1 -0
  202. package/lib/utils/dateParsing.js +289 -0
  203. package/lib/utils/dateParsing.js.map +1 -0
  204. package/lib/utils/dateUtils.d.ts +20 -0
  205. package/lib/utils/dateUtils.d.ts.map +1 -0
  206. package/lib/utils/dateUtils.js +115 -0
  207. package/lib/utils/dateUtils.js.map +1 -0
  208. package/lib/utils/dateValidation.d.ts +36 -0
  209. package/lib/utils/dateValidation.d.ts.map +1 -0
  210. package/lib/utils/dateValidation.js +196 -0
  211. package/lib/utils/dateValidation.js.map +1 -0
  212. package/lib/utils/index.d.ts +7 -0
  213. package/lib/utils/index.d.ts.map +1 -0
  214. package/lib/utils/index.js +23 -0
  215. package/lib/utils/index.js.map +1 -0
  216. package/lib/utils/timeUtils.d.ts +78 -0
  217. package/lib/utils/timeUtils.d.ts.map +1 -0
  218. package/lib/utils/timeUtils.js +335 -0
  219. package/lib/utils/timeUtils.js.map +1 -0
  220. package/package.json +92 -3
  221. package/src/components/Calendar/Calendar.tsx +314 -0
  222. package/src/components/Calendar/CalendarGrid.tsx +47 -0
  223. package/src/components/Calendar/CalendarHeader.tsx +176 -0
  224. package/src/components/Calendar/DateCell.tsx +118 -0
  225. package/src/components/Calendar/MonthYearSelectorModal.tsx +407 -0
  226. package/src/components/Calendar/WeekDays.tsx +49 -0
  227. package/src/components/Calendar/index.ts +6 -0
  228. package/src/components/DatePicker.tsx +834 -0
  229. package/src/components/Input/CalendarPopup.tsx +168 -0
  230. package/src/components/Input/DateInput.tsx +259 -0
  231. package/src/components/Input/index.ts +2 -0
  232. package/src/components/ManualDateInput/DateInputField.tsx +493 -0
  233. package/src/components/ManualDateInput/DateValidationMessage.tsx +65 -0
  234. package/src/components/ManualDateInput/ManualDateInput.tsx +66 -0
  235. package/src/components/ManualDateInput/index.ts +3 -0
  236. package/src/components/Range/RangeDateCell.tsx +174 -0
  237. package/src/components/Range/RangePicker.tsx +484 -0
  238. package/src/components/Range/index.ts +2 -0
  239. package/src/components/Time/ClockDial.tsx +450 -0
  240. package/src/components/Time/DateTimePicker.tsx +395 -0
  241. package/src/components/Time/TimePicker.tsx +899 -0
  242. package/src/components/Time/WheelTimePicker.tsx +356 -0
  243. package/src/components/Time/index.ts +4 -0
  244. package/src/components/Wheel/WheelColumn.tsx +300 -0
  245. package/src/components/Wheel/WheelPicker.tsx +265 -0
  246. package/src/components/Wheel/index.ts +2 -0
  247. package/src/components/common/Button.tsx +125 -0
  248. package/src/components/common/IconButton.tsx +237 -0
  249. package/src/components/common/Modal.tsx +137 -0
  250. package/src/components/common/index.ts +3 -0
  251. package/src/components/index.ts +8 -0
  252. package/src/hooks/index.ts +3 -0
  253. package/src/hooks/useCalendar.ts +153 -0
  254. package/src/hooks/useDatePicker.ts +216 -0
  255. package/src/hooks/useDateRange.ts +135 -0
  256. package/src/index.ts +17 -0
  257. package/src/localization/en.ts +78 -0
  258. package/src/localization/gu.ts +78 -0
  259. package/src/localization/hi.ts +78 -0
  260. package/src/localization/index.ts +31 -0
  261. package/src/themes/dark.ts +28 -0
  262. package/src/themes/index.ts +73 -0
  263. package/src/themes/light.ts +28 -0
  264. package/src/types/index.ts +452 -0
  265. package/src/utils/calendarUtils.ts +152 -0
  266. package/src/utils/dateFormatting.ts +125 -0
  267. package/src/utils/dateParsing.ts +335 -0
  268. package/src/utils/dateUtils.ts +117 -0
  269. package/src/utils/dateValidation.ts +276 -0
  270. package/src/utils/index.ts +6 -0
  271. package/src/utils/timeUtils.ts +416 -0
@@ -0,0 +1,395 @@
1
+ import React, { useState, useCallback, useMemo } from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ TouchableOpacity,
6
+ StyleSheet,
7
+ StyleProp,
8
+ ViewStyle,
9
+ } from 'react-native';
10
+ import type {
11
+ DatePickerTheme,
12
+ DatePickerLocale,
13
+ DateFormat,
14
+ DisabledDateCheck,
15
+ TimePickerLayout,
16
+ } from '../../types';
17
+ import { setTimeOnDate } from '../../utils/timeUtils';
18
+ import { validateDate } from '../../utils/dateValidation';
19
+ import { Calendar } from '../Calendar/Calendar';
20
+ import { TimePicker } from './TimePicker';
21
+ import { Button } from '../common/Button';
22
+
23
+ export interface DateTimePickerComponentProps {
24
+ value?: Date | null;
25
+ defaultValue?: Date | null;
26
+ onChange?: (date: Date | null) => void;
27
+ format?: DateFormat;
28
+ is24Hour?: boolean;
29
+ minuteInterval?: number;
30
+ minimumTime?: string | Date;
31
+ maximumTime?: string | Date;
32
+ minimumDate?: Date;
33
+ maximumDate?: Date;
34
+ disabledDates?: (Date | string)[] | DisabledDateCheck;
35
+ disabledWeekdays?: number[];
36
+ firstDayOfWeek?: 0 | 1 | 2 | 3 | 4 | 5 | 6;
37
+ showSeconds?: boolean;
38
+ timePickerLayout?: TimePickerLayout;
39
+ allowManualEntry?: boolean;
40
+ theme: DatePickerTheme;
41
+ locale: DatePickerLocale;
42
+ initialTab?: 'date' | 'time';
43
+ showActionButtons?: boolean;
44
+ onConfirm?: (date: Date | null) => void;
45
+ onCancel?: () => void;
46
+ onClear?: () => void;
47
+ style?: StyleProp<ViewStyle>;
48
+ }
49
+
50
+ export const DateTimePicker: React.FC<DateTimePickerComponentProps> = ({
51
+ value: controlledValue,
52
+ defaultValue = null,
53
+ onChange,
54
+ format,
55
+ is24Hour = false,
56
+ minuteInterval = 1,
57
+ minimumTime,
58
+ maximumTime,
59
+ minimumDate,
60
+ maximumDate,
61
+ disabledDates,
62
+ disabledWeekdays,
63
+ firstDayOfWeek = 0,
64
+ showSeconds = false,
65
+ timePickerLayout = 'wheel',
66
+ allowManualEntry = false,
67
+ theme,
68
+ locale,
69
+ initialTab = 'date',
70
+ showActionButtons = true,
71
+ onConfirm,
72
+ onCancel,
73
+ onClear,
74
+ style,
75
+ }) => {
76
+ const [activeTab, setActiveTab] = useState<'date' | 'time'>(initialTab);
77
+ const [currentDate, setCurrentDate] = useState<Date>(
78
+ controlledValue || defaultValue || new Date()
79
+ );
80
+
81
+ const displayFormat =
82
+ format || (is24Hour ? 'DD/MM/YYYY HH:mm' : 'DD/MM/YYYY hh:mm A');
83
+
84
+ // Handle Date Selection from Calendar
85
+ const handleDateSelect = useCallback(
86
+ (newDate: Date | null) => {
87
+ if (!newDate) {
88
+ onChange?.(null);
89
+ return;
90
+ }
91
+ // Preserve existing hours and minutes
92
+ const combined = setTimeOnDate(
93
+ newDate,
94
+ currentDate.getHours(),
95
+ currentDate.getMinutes(),
96
+ currentDate.getSeconds()
97
+ );
98
+ setCurrentDate(combined);
99
+ onChange?.(combined);
100
+ },
101
+ [currentDate, onChange]
102
+ );
103
+
104
+ // Handle Time Selection from TimePicker
105
+ const handleTimeSelect = useCallback(
106
+ (newDateWithTime: Date | null) => {
107
+ if (!newDateWithTime) {
108
+ onChange?.(null);
109
+ return;
110
+ }
111
+ setCurrentDate(newDateWithTime);
112
+ onChange?.(newDateWithTime);
113
+ },
114
+ [onChange]
115
+ );
116
+
117
+ // Global validation check
118
+ const isValid = useMemo(() => {
119
+ const val = validateDate(currentDate, {
120
+ minimumDate,
121
+ maximumDate,
122
+ disabledDates,
123
+ disabledWeekdays,
124
+ minimumTime,
125
+ maximumTime,
126
+ is24Hour,
127
+ validateTimeComponent: true,
128
+ locale,
129
+ });
130
+ return val.isValid;
131
+ }, [
132
+ currentDate,
133
+ minimumDate,
134
+ maximumDate,
135
+ disabledDates,
136
+ disabledWeekdays,
137
+ minimumTime,
138
+ maximumTime,
139
+ is24Hour,
140
+ locale,
141
+ ]);
142
+
143
+ return (
144
+ <View
145
+ style={[
146
+ styles.container,
147
+ {
148
+ backgroundColor: theme.surfaceColor,
149
+ borderRadius: 20,
150
+ borderColor: theme.borderColor,
151
+ },
152
+ style,
153
+ ]}
154
+ >
155
+ {/* Segmented Tab Switcher: [ 📅 Date ] [ ⏰ Time ] */}
156
+ <View
157
+ style={[
158
+ styles.tabBar,
159
+ {
160
+ backgroundColor: `${theme.textColor}0A`,
161
+ borderColor: theme.borderColor,
162
+ },
163
+ ]}
164
+ >
165
+ <TouchableOpacity
166
+ activeOpacity={0.8}
167
+ onPress={() => setActiveTab('date')}
168
+ style={[
169
+ styles.tabItem,
170
+ activeTab === 'date' && {
171
+ backgroundColor: theme.cardColor,
172
+ shadowColor: '#000',
173
+ shadowOffset: { width: 0, height: 1 },
174
+ shadowOpacity: 0.1,
175
+ shadowRadius: 3,
176
+ elevation: 2,
177
+ },
178
+ ]}
179
+ >
180
+ <Text
181
+ style={[
182
+ styles.tabText,
183
+ {
184
+ color: activeTab === 'date' ? theme.primaryColor : theme.secondaryTextColor,
185
+ fontWeight: activeTab === 'date' ? '800' : '600',
186
+ },
187
+ ]}
188
+ >
189
+ 📅 {locale.selectDate || 'Calendar Date'}
190
+ </Text>
191
+ </TouchableOpacity>
192
+
193
+ <TouchableOpacity
194
+ activeOpacity={0.8}
195
+ onPress={() => setActiveTab('time')}
196
+ style={[
197
+ styles.tabItem,
198
+ activeTab === 'time' && {
199
+ backgroundColor: theme.cardColor,
200
+ shadowColor: '#000',
201
+ shadowOffset: { width: 0, height: 1 },
202
+ shadowOpacity: 0.1,
203
+ shadowRadius: 3,
204
+ elevation: 2,
205
+ },
206
+ ]}
207
+ >
208
+ <Text
209
+ style={[
210
+ styles.tabText,
211
+ {
212
+ color: activeTab === 'time' ? theme.primaryColor : theme.secondaryTextColor,
213
+ fontWeight: activeTab === 'time' ? '800' : '600',
214
+ },
215
+ ]}
216
+ >
217
+ ⏰ {locale.timeLabel || 'Clock Time'}
218
+ </Text>
219
+ </TouchableOpacity>
220
+ </View>
221
+
222
+ {/* Tab 1: Date (Calendar) */}
223
+ {activeTab === 'date' && (
224
+ <Calendar
225
+ selectedDate={currentDate}
226
+ onSelectDate={handleDateSelect}
227
+ format={displayFormat}
228
+ theme={theme}
229
+ locale={locale}
230
+ minimumDate={minimumDate}
231
+ maximumDate={maximumDate}
232
+ disabledDates={disabledDates}
233
+ disabledWeekdays={disabledWeekdays}
234
+ firstDayOfWeek={firstDayOfWeek}
235
+ allowManualEntry={allowManualEntry}
236
+ showActionButtons={false}
237
+ />
238
+ )}
239
+
240
+ {/* Tab 2: Time (TimePicker) */}
241
+ {activeTab === 'time' && (
242
+ <TimePicker
243
+ value={currentDate}
244
+ onChange={handleTimeSelect}
245
+ format={displayFormat}
246
+ is24Hour={is24Hour}
247
+ minuteInterval={minuteInterval}
248
+ minimumTime={minimumTime}
249
+ maximumTime={maximumTime}
250
+ selectedDate={currentDate}
251
+ minimumDate={minimumDate}
252
+ maximumDate={maximumDate}
253
+ showSeconds={showSeconds}
254
+ timePickerLayout={timePickerLayout}
255
+ theme={theme}
256
+ locale={locale}
257
+ showActionButtons={false}
258
+ />
259
+ )}
260
+
261
+ {/* Bottom Action Buttons */}
262
+ {showActionButtons && (
263
+ <View style={styles.actionsRow}>
264
+ <View style={styles.leftActions}>
265
+ <Button
266
+ title="Today/Now"
267
+ onPress={() => {
268
+ const now = new Date();
269
+ setCurrentDate(now);
270
+ onChange?.(now);
271
+ }}
272
+ variant="outline"
273
+ size="small"
274
+ theme={theme}
275
+ />
276
+ {onClear && (
277
+ <Button
278
+ title={locale.clear}
279
+ onPress={() => {
280
+ onChange?.(null);
281
+ onClear();
282
+ }}
283
+ variant="text"
284
+ size="small"
285
+ theme={theme}
286
+ />
287
+ )}
288
+ </View>
289
+ <View style={styles.rightActions}>
290
+ {onCancel && (
291
+ <Button
292
+ title={locale.cancel}
293
+ onPress={onCancel}
294
+ variant="text"
295
+ size="small"
296
+ theme={theme}
297
+ />
298
+ )}
299
+ {onConfirm && (
300
+ <Button
301
+ title={locale.confirm}
302
+ onPress={() => onConfirm(currentDate)}
303
+ variant="primary"
304
+ size="small"
305
+ disabled={!isValid}
306
+ theme={theme}
307
+ />
308
+ )}
309
+ </View>
310
+ </View>
311
+ )}
312
+ </View>
313
+ );
314
+ };
315
+
316
+ const styles = StyleSheet.create({
317
+ container: {
318
+ padding: 16,
319
+ borderWidth: 1,
320
+ flexGrow: 1,
321
+ justifyContent: 'space-between',
322
+ },
323
+ previewBanner: {
324
+ padding: 14,
325
+ borderRadius: 16,
326
+ borderWidth: 1,
327
+ marginBottom: 14,
328
+ shadowColor: '#000',
329
+ shadowOffset: { width: 0, height: 2 },
330
+ shadowOpacity: 0.04,
331
+ shadowRadius: 4,
332
+ elevation: 1,
333
+ },
334
+ previewHeaderRow: {
335
+ flexDirection: 'row',
336
+ justifyContent: 'space-between',
337
+ alignItems: 'center',
338
+ marginBottom: 4,
339
+ },
340
+ previewLabel: {
341
+ fontSize: 10,
342
+ fontWeight: '800',
343
+ letterSpacing: 0.6,
344
+ },
345
+ statusBadge: {
346
+ paddingHorizontal: 8,
347
+ paddingVertical: 3,
348
+ borderRadius: 8,
349
+ },
350
+ statusBadgeText: {
351
+ fontSize: 10,
352
+ fontWeight: '700',
353
+ },
354
+ previewValue: {
355
+ fontSize: 18,
356
+ fontWeight: '900',
357
+ letterSpacing: -0.4,
358
+ },
359
+ tabBar: {
360
+ flexDirection: 'row',
361
+ borderRadius: 12,
362
+ borderWidth: 1,
363
+ padding: 4,
364
+ marginBottom: 14,
365
+ },
366
+ tabItem: {
367
+ flex: 1,
368
+ paddingVertical: 9,
369
+ alignItems: 'center',
370
+ justifyContent: 'center',
371
+ borderRadius: 9,
372
+ },
373
+ tabText: {
374
+ fontSize: 13,
375
+ },
376
+ actionsRow: {
377
+ flexDirection: 'row',
378
+ justifyContent: 'space-between',
379
+ alignItems: 'center',
380
+ marginTop: 'auto',
381
+ paddingTop: 12,
382
+ borderTopWidth: 1,
383
+ borderTopColor: 'rgba(0,0,0,0.06)',
384
+ },
385
+ leftActions: {
386
+ flexDirection: 'row',
387
+ alignItems: 'center',
388
+ gap: 8,
389
+ },
390
+ rightActions: {
391
+ flexDirection: 'row',
392
+ alignItems: 'center',
393
+ gap: 8,
394
+ },
395
+ });