@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,450 @@
1
+ import React, { useMemo, useRef, useEffect } from 'react';
2
+ import {
3
+ View,
4
+ Text,
5
+ StyleSheet,
6
+ PanResponder,
7
+ } from 'react-native';
8
+ import type { DatePickerTheme, TimePeriod } from '../../types';
9
+ import {
10
+ padZero,
11
+ isHourDisabled,
12
+ isMinuteDisabled,
13
+ TimeValidationOptions,
14
+ } from '../../utils/timeUtils';
15
+
16
+ export interface ClockDialProps {
17
+ mode: 'hours' | 'minutes';
18
+ value: number; // current hours (1..12 or 0..23) or minutes (0..59)
19
+ is24Hour?: boolean;
20
+ period?: TimePeriod;
21
+ onSelect: (value: number) => void;
22
+ theme: DatePickerTheme;
23
+ validationOptions?: TimeValidationOptions;
24
+ size?: number;
25
+ }
26
+
27
+ export const ClockDial: React.FC<ClockDialProps> = ({
28
+ mode,
29
+ value,
30
+ is24Hour = false,
31
+ period = 'AM',
32
+ onSelect,
33
+ theme,
34
+ validationOptions,
35
+ size = 260,
36
+ }) => {
37
+ const center = size / 2;
38
+ const radius = size / 2 - 28;
39
+ const innerRadius = radius - 36; // for 24h secondary inner circle
40
+
41
+ const dialRef = useRef<View>(null);
42
+ const dialLayoutRef = useRef<{ pageX: number; pageY: number }>({
43
+ pageX: 0,
44
+ pageY: 0,
45
+ });
46
+
47
+ // Keep latest props in refs for pan responder callbacks
48
+ const stateRef = useRef({
49
+ mode,
50
+ value,
51
+ is24Hour,
52
+ period,
53
+ validationOptions,
54
+ onSelect,
55
+ center,
56
+ radius,
57
+ innerRadius,
58
+ });
59
+
60
+ useEffect(() => {
61
+ stateRef.current = {
62
+ mode,
63
+ value,
64
+ is24Hour,
65
+ period,
66
+ validationOptions,
67
+ onSelect,
68
+ center,
69
+ radius,
70
+ innerRadius,
71
+ };
72
+ }, [mode, value, is24Hour, period, validationOptions, onSelect, center, radius, innerRadius]);
73
+
74
+ const updateDialPosition = () => {
75
+ dialRef.current?.measureInWindow((x, y) => {
76
+ if (x !== undefined && y !== undefined) {
77
+ dialLayoutRef.current = { pageX: x, pageY: y };
78
+ }
79
+ });
80
+ };
81
+
82
+ // Convert touch screen coordinates to selected hour or minute
83
+ const handleTouchCoord = (pageX: number, pageY: number) => {
84
+ const s = stateRef.current;
85
+ const { pageX: dialX, pageY: dialY } = dialLayoutRef.current;
86
+ const touchX = pageX - dialX;
87
+ const touchY = pageY - dialY;
88
+ const dx = touchX - s.center;
89
+ const dy = touchY - s.center;
90
+ const dist = Math.sqrt(dx * dx + dy * dy);
91
+
92
+ if (dist < 12) return; // ignore center pivot
93
+
94
+ let angle = (Math.atan2(dy, dx) * 180) / Math.PI + 90;
95
+ if (angle < 0) angle += 360;
96
+
97
+ if (s.mode === 'minutes') {
98
+ const selectedMinute = Math.round(angle / 6) % 60;
99
+ if (!isMinuteDisabled(selectedMinute, s.value, s.is24Hour, s.period, s.validationOptions)) {
100
+ s.onSelect(selectedMinute);
101
+ }
102
+ } else {
103
+ if (s.is24Hour) {
104
+ const isInnerTouch = dist < (s.radius + s.innerRadius) / 2;
105
+ let h = Math.round(angle / 30) % 12;
106
+ if (isInnerTouch) {
107
+ h = h === 0 ? 12 : h + 12;
108
+ }
109
+ if (!isHourDisabled(h, true, undefined, s.validationOptions)) {
110
+ s.onSelect(h);
111
+ }
112
+ } else {
113
+ let h = Math.round(angle / 30) % 12;
114
+ if (h === 0) h = 12;
115
+ if (!isHourDisabled(h, false, s.period, s.validationOptions)) {
116
+ s.onSelect(h);
117
+ }
118
+ }
119
+ }
120
+ };
121
+
122
+ // PanResponder to track continuous drag gestures (e.g. smoothly moving from 25 to 27)
123
+ const panResponder = useMemo(
124
+ () =>
125
+ PanResponder.create({
126
+ onStartShouldSetPanResponder: () => true,
127
+ onMoveShouldSetPanResponder: () => true,
128
+ onPanResponderGrant: (evt) => {
129
+ const { pageX, pageY, locationX, locationY } = evt.nativeEvent;
130
+ if (dialLayoutRef.current.pageX === 0 && dialLayoutRef.current.pageY === 0) {
131
+ dialLayoutRef.current = {
132
+ pageX: pageX - locationX,
133
+ pageY: pageY - locationY,
134
+ };
135
+ }
136
+ updateDialPosition();
137
+ handleTouchCoord(pageX, pageY);
138
+ },
139
+ onPanResponderMove: (evt) => {
140
+ handleTouchCoord(evt.nativeEvent.pageX, evt.nativeEvent.pageY);
141
+ },
142
+ onPanResponderRelease: (evt) => {
143
+ handleTouchCoord(evt.nativeEvent.pageX, evt.nativeEvent.pageY);
144
+ },
145
+ }),
146
+ []
147
+ );
148
+
149
+ // Calculate clock hand angle and radius based on mode and current value
150
+ const { handAngleDeg, currentR } = useMemo(() => {
151
+ if (mode === 'hours') {
152
+ if (is24Hour) {
153
+ if (value >= 12) {
154
+ const idx = value - 12;
155
+ return { handAngleDeg: idx * 30 - 90, currentR: innerRadius };
156
+ } else {
157
+ const idx = value === 0 ? 0 : value;
158
+ return { handAngleDeg: idx * 30 - 90, currentR: radius };
159
+ }
160
+ } else {
161
+ const idx = value === 12 ? 0 : value;
162
+ return { handAngleDeg: idx * 30 - 90, currentR: radius };
163
+ }
164
+ } else {
165
+ // Minutes: 0..59, each minute is exactly 6 degrees (e.g. 25 = 60°, 27 = 72°)
166
+ const deg = (value % 60) * 6 - 90;
167
+ return { handAngleDeg: deg, currentR: radius };
168
+ }
169
+ }, [mode, value, is24Hour, innerRadius, radius]);
170
+
171
+ const handAngleRad = handAngleDeg * (Math.PI / 180);
172
+ const handTipX = center + currentR * Math.cos(handAngleRad);
173
+ const handTipY = center + currentR * Math.sin(handAngleRad);
174
+
175
+ // Numbers to display on the dial
176
+ const majorItems = useMemo(() => {
177
+ if (mode === 'hours') {
178
+ if (is24Hour) {
179
+ // Outer ring: 00..11, Inner ring: 12..23
180
+ const outer = [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map((h, i) => {
181
+ const actualH = h === 12 ? 0 : h;
182
+ const disabled = isHourDisabled(actualH, true, undefined, validationOptions);
183
+ return { num: actualH, label: padZero(actualH), index: i, isInner: false, disabled };
184
+ });
185
+ const inner = [12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23].map((h, i) => {
186
+ const disabled = isHourDisabled(h, true, undefined, validationOptions);
187
+ return { num: h, label: String(h), index: i, isInner: true, disabled };
188
+ });
189
+ return [...outer, ...inner];
190
+ } else {
191
+ // 1..12 in outer ring
192
+ return [12, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].map((h, i) => {
193
+ const disabled = isHourDisabled(h, false, period, validationOptions);
194
+ return { num: h, label: String(h), index: i, isInner: false, disabled };
195
+ });
196
+ }
197
+ } else {
198
+ // Minutes: 00, 05, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55
199
+ return [0, 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55].map((m, i) => {
200
+ const disabled = isMinuteDisabled(m, value, is24Hour, period, validationOptions);
201
+ return { num: m, label: padZero(m), index: i, isInner: false, disabled };
202
+ });
203
+ }
204
+ }, [mode, is24Hour, period, value, validationOptions]);
205
+
206
+ // Minute tick marks (1..59 excluding multiples of 5)
207
+ const minuteTicks = useMemo(() => {
208
+ if (mode !== 'minutes') return [];
209
+ const ticks = [];
210
+ for (let m = 0; m < 60; m++) {
211
+ if (m % 5 !== 0) {
212
+ const disabled = isMinuteDisabled(m, value, is24Hour, period, validationOptions);
213
+ ticks.push({
214
+ num: m,
215
+ angle: (m * 6 - 90) * (Math.PI / 180),
216
+ disabled,
217
+ });
218
+ }
219
+ }
220
+ return ticks;
221
+ }, [mode, value, is24Hour, period, validationOptions]);
222
+
223
+ return (
224
+ <View
225
+ ref={dialRef}
226
+ onLayout={() => updateDialPosition()}
227
+ {...panResponder.panHandlers}
228
+ style={[
229
+ styles.clockContainer,
230
+ {
231
+ width: size,
232
+ height: size,
233
+ borderRadius: size / 2,
234
+ backgroundColor: `${theme.primaryColor}06`,
235
+ borderColor: `${theme.primaryColor}22`,
236
+ },
237
+ ]}
238
+ >
239
+ {/* Decorative Minute Track Ring */}
240
+ <View
241
+ pointerEvents="none"
242
+ style={[
243
+ styles.trackRing,
244
+ {
245
+ left: center - radius,
246
+ top: center - radius,
247
+ width: radius * 2,
248
+ height: radius * 2,
249
+ borderRadius: radius,
250
+ borderColor: `${theme.primaryColor}14`,
251
+ },
252
+ ]}
253
+ />
254
+
255
+ {/* 24h Inner Track Ring if applicable */}
256
+ {mode === 'hours' && is24Hour && (
257
+ <View
258
+ pointerEvents="none"
259
+ style={[
260
+ styles.trackRing,
261
+ {
262
+ left: center - innerRadius,
263
+ top: center - innerRadius,
264
+ width: innerRadius * 2,
265
+ height: innerRadius * 2,
266
+ borderRadius: innerRadius,
267
+ borderColor: `${theme.primaryColor}14`,
268
+ },
269
+ ]}
270
+ />
271
+ )}
272
+
273
+ {/* Center Pivot Point */}
274
+ <View
275
+ pointerEvents="none"
276
+ style={[
277
+ styles.centerPivot,
278
+ {
279
+ left: center - 5,
280
+ top: center - 5,
281
+ backgroundColor: theme.primaryColor,
282
+ borderColor: '#FFFFFF',
283
+ },
284
+ ]}
285
+ />
286
+
287
+ {/* Clock Hand Pointer Line */}
288
+ <View
289
+ pointerEvents="none"
290
+ style={{
291
+ position: 'absolute',
292
+ left: center,
293
+ top: center - 1.5,
294
+ width: currentR,
295
+ height: 3,
296
+ backgroundColor: theme.primaryColor,
297
+ transformOrigin: 'left center',
298
+ transform: [{ rotate: `${handAngleDeg}deg` }],
299
+ }}
300
+ />
301
+
302
+ {/* Hand Tip Highlight Bubble with Glowing Effect */}
303
+ <View
304
+ pointerEvents="none"
305
+ style={[
306
+ styles.handTipBubble,
307
+ {
308
+ left: handTipX - 17,
309
+ top: handTipY - 17,
310
+ backgroundColor: theme.primaryColor,
311
+ shadowColor: theme.primaryColor,
312
+ shadowOffset: { width: 0, height: 3 },
313
+ shadowOpacity: 0.45,
314
+ shadowRadius: 5,
315
+ elevation: 5,
316
+ },
317
+ ]}
318
+ >
319
+ <Text style={styles.handTipText}>
320
+ {mode === 'minutes' ? padZero(value) : (is24Hour ? padZero(value) : String(value))}
321
+ </Text>
322
+ </View>
323
+
324
+ {/* Minute Tick Marks (pointerEvents="none" so gesture stays on main surface) */}
325
+ {minuteTicks.map((tick) => {
326
+ const tx = center + radius * Math.cos(tick.angle);
327
+ const ty = center + radius * Math.sin(tick.angle);
328
+ const isSelected = tick.num === value;
329
+
330
+ return (
331
+ <View
332
+ key={`tick-${tick.num}`}
333
+ pointerEvents="none"
334
+ style={[
335
+ styles.tickDot,
336
+ {
337
+ left: tx - (isSelected ? 3.5 : 1.5),
338
+ top: ty - (isSelected ? 3.5 : 1.5),
339
+ width: isSelected ? 7 : 3,
340
+ height: isSelected ? 7 : 3,
341
+ borderRadius: isSelected ? 3.5 : 1.5,
342
+ backgroundColor: isSelected
343
+ ? theme.primaryColor
344
+ : tick.disabled
345
+ ? `${theme.textColor}12`
346
+ : `${theme.textColor}35`,
347
+ },
348
+ ]}
349
+ />
350
+ );
351
+ })}
352
+
353
+ {/* Major Numbers (00, 05, 10... 55) */}
354
+ {majorItems.map((item) => {
355
+ const r = item.isInner ? innerRadius : radius;
356
+ const angle = (item.index * 30 - 90) * (Math.PI / 180);
357
+ const x = center + r * Math.cos(angle);
358
+ const y = center + r * Math.sin(angle);
359
+ const isSelected = item.num === value;
360
+ const btnSize = item.isInner ? 28 : 34;
361
+
362
+ return (
363
+ <View
364
+ key={`${item.num}-${item.isInner}`}
365
+ pointerEvents="none"
366
+ style={[
367
+ styles.numberNode,
368
+ {
369
+ left: x - btnSize / 2,
370
+ top: y - btnSize / 2,
371
+ width: btnSize,
372
+ height: btnSize,
373
+ borderRadius: btnSize / 2,
374
+ backgroundColor: isSelected ? theme.primaryColor : 'transparent',
375
+ opacity: item.disabled ? 0.3 : 1,
376
+ },
377
+ ]}
378
+ >
379
+ <Text
380
+ style={[
381
+ styles.numberText,
382
+ {
383
+ color: isSelected
384
+ ? '#FFFFFF'
385
+ : item.isInner
386
+ ? theme.secondaryTextColor
387
+ : theme.textColor,
388
+ fontSize: item.isInner ? 11 : 13,
389
+ fontWeight: isSelected ? '800' : '600',
390
+ },
391
+ ]}
392
+ >
393
+ {item.label}
394
+ </Text>
395
+ </View>
396
+ );
397
+ })}
398
+ </View>
399
+ );
400
+ };
401
+
402
+ const styles = StyleSheet.create({
403
+ clockContainer: {
404
+ borderWidth: 1.5,
405
+ position: 'relative',
406
+ alignSelf: 'center',
407
+ marginVertical: 12,
408
+ },
409
+ trackRing: {
410
+ position: 'absolute',
411
+ borderWidth: 1,
412
+ borderStyle: 'dashed',
413
+ },
414
+ centerPivot: {
415
+ position: 'absolute',
416
+ width: 10,
417
+ height: 10,
418
+ borderRadius: 5,
419
+ borderWidth: 1.5,
420
+ zIndex: 6,
421
+ },
422
+ handTipBubble: {
423
+ position: 'absolute',
424
+ width: 34,
425
+ height: 34,
426
+ borderRadius: 17,
427
+ justifyContent: 'center',
428
+ alignItems: 'center',
429
+ zIndex: 12,
430
+ },
431
+ handTipText: {
432
+ color: '#FFFFFF',
433
+ fontSize: 13,
434
+ fontWeight: '900',
435
+ textAlign: 'center',
436
+ },
437
+ tickDot: {
438
+ position: 'absolute',
439
+ zIndex: 8,
440
+ },
441
+ numberNode: {
442
+ position: 'absolute',
443
+ justifyContent: 'center',
444
+ alignItems: 'center',
445
+ zIndex: 10,
446
+ },
447
+ numberText: {
448
+ textAlign: 'center',
449
+ },
450
+ });