@dreamstack-us/kaal 0.0.1 → 0.0.2
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.
- package/lib/module/components/CalendarGrid/CalendarGrid.js +47 -13
- package/lib/module/components/CalendarGrid/CalendarGrid.js.map +1 -1
- package/lib/module/components/CalendarGrid/CalendarGrid.styles.js +22 -17
- package/lib/module/components/CalendarGrid/CalendarGrid.styles.js.map +1 -1
- package/lib/module/components/CalendarGrid/CalendarGrid.web.js +203 -0
- package/lib/module/components/CalendarGrid/CalendarGrid.web.js.map +1 -0
- package/lib/module/components/CalendarGrid/DayCell.js +64 -52
- package/lib/module/components/CalendarGrid/DayCell.js.map +1 -1
- package/lib/module/components/CalendarGrid/DayCell.web.js +112 -0
- package/lib/module/components/CalendarGrid/DayCell.web.js.map +1 -0
- package/lib/module/components/CalendarGrid/index.js +1 -1
- package/lib/module/components/CalendarGrid/index.js.map +1 -1
- package/lib/module/components/DatePicker/DatePicker.android.js +17 -8
- package/lib/module/components/DatePicker/DatePicker.android.js.map +1 -1
- package/lib/module/components/DatePicker/DatePicker.ios.js +17 -8
- package/lib/module/components/DatePicker/DatePicker.ios.js.map +1 -1
- package/lib/module/components/DatePicker/DatePicker.js.map +1 -1
- package/lib/module/components/DatePicker/DatePicker.styles.js +19 -20
- package/lib/module/components/DatePicker/DatePicker.styles.js.map +1 -1
- package/lib/module/components/DatePicker/DatePicker.web.js +26 -12
- package/lib/module/components/DatePicker/DatePicker.web.js.map +1 -1
- package/lib/module/components/TimePicker/ClockFace.js +27 -7
- package/lib/module/components/TimePicker/ClockFace.js.map +1 -1
- package/lib/module/components/TimePicker/ClockFace.web.js +253 -0
- package/lib/module/components/TimePicker/ClockFace.web.js.map +1 -0
- package/lib/module/components/TimePicker/MaterialTimePicker.js +68 -16
- package/lib/module/components/TimePicker/MaterialTimePicker.js.map +1 -1
- package/lib/module/components/TimePicker/MaterialTimePicker.web.js +231 -0
- package/lib/module/components/TimePicker/MaterialTimePicker.web.js.map +1 -0
- package/lib/module/components/TimePicker/TimePicker.android.js +13 -6
- package/lib/module/components/TimePicker/TimePicker.android.js.map +1 -1
- package/lib/module/components/TimePicker/TimePicker.ios.js +14 -7
- package/lib/module/components/TimePicker/TimePicker.ios.js.map +1 -1
- package/lib/module/components/TimePicker/TimePicker.styles.js +53 -45
- package/lib/module/components/TimePicker/TimePicker.styles.js.map +1 -1
- package/lib/module/components/TimePicker/TimePicker.web.js +24 -12
- package/lib/module/components/TimePicker/TimePicker.web.js.map +1 -1
- package/lib/module/components/TimePicker/TimeWheelPicker.js +45 -10
- package/lib/module/components/TimePicker/TimeWheelPicker.js.map +1 -1
- package/lib/module/components/TimePicker/TimeWheelPicker.web.js +339 -0
- package/lib/module/components/TimePicker/TimeWheelPicker.web.js.map +1 -0
- package/lib/module/components/TimePicker/index.js +3 -3
- package/lib/module/components/TimePicker/index.js.map +1 -1
- package/lib/module/components/WheelPicker/WheelPicker.js +21 -2
- package/lib/module/components/WheelPicker/WheelPicker.js.map +1 -1
- package/lib/module/components/WheelPicker/WheelPicker.styles.js +13 -8
- package/lib/module/components/WheelPicker/WheelPicker.styles.js.map +1 -1
- package/lib/module/components/WheelPicker/WheelPicker.web.js +146 -57
- package/lib/module/components/WheelPicker/WheelPicker.web.js.map +1 -1
- package/lib/module/context/ThemeOverrideContext.js +34 -0
- package/lib/module/context/ThemeOverrideContext.js.map +1 -0
- package/lib/module/index.js +3 -0
- package/lib/module/index.js.map +1 -1
- package/lib/module/utils/validation.js +74 -34
- package/lib/module/utils/validation.js.map +1 -1
- package/lib/typescript/components/CalendarGrid/CalendarGrid.d.ts +9 -0
- package/lib/typescript/components/CalendarGrid/CalendarGrid.d.ts.map +1 -1
- package/lib/typescript/components/CalendarGrid/CalendarGrid.styles.d.ts +12 -10
- package/lib/typescript/components/CalendarGrid/CalendarGrid.styles.d.ts.map +1 -1
- package/lib/typescript/components/CalendarGrid/CalendarGrid.web.d.ts +21 -0
- package/lib/typescript/components/CalendarGrid/CalendarGrid.web.d.ts.map +1 -0
- package/lib/typescript/components/CalendarGrid/DayCell.d.ts.map +1 -1
- package/lib/typescript/components/CalendarGrid/DayCell.web.d.ts +12 -0
- package/lib/typescript/components/CalendarGrid/DayCell.web.d.ts.map +1 -0
- package/lib/typescript/components/DatePicker/DatePicker.android.d.ts.map +1 -1
- package/lib/typescript/components/DatePicker/DatePicker.d.ts +12 -1
- package/lib/typescript/components/DatePicker/DatePicker.d.ts.map +1 -1
- package/lib/typescript/components/DatePicker/DatePicker.ios.d.ts.map +1 -1
- package/lib/typescript/components/DatePicker/DatePicker.styles.d.ts +12 -13
- package/lib/typescript/components/DatePicker/DatePicker.styles.d.ts.map +1 -1
- package/lib/typescript/components/DatePicker/DatePicker.web.d.ts.map +1 -1
- package/lib/typescript/components/TimePicker/ClockFace.d.ts.map +1 -1
- package/lib/typescript/components/TimePicker/ClockFace.web.d.ts +12 -0
- package/lib/typescript/components/TimePicker/ClockFace.web.d.ts.map +1 -0
- package/lib/typescript/components/TimePicker/MaterialTimePicker.d.ts.map +1 -1
- package/lib/typescript/components/TimePicker/MaterialTimePicker.web.d.ts +12 -0
- package/lib/typescript/components/TimePicker/MaterialTimePicker.web.d.ts.map +1 -0
- package/lib/typescript/components/TimePicker/TimePicker.android.d.ts.map +1 -1
- package/lib/typescript/components/TimePicker/TimePicker.ios.d.ts.map +1 -1
- package/lib/typescript/components/TimePicker/TimePicker.styles.d.ts +29 -25
- package/lib/typescript/components/TimePicker/TimePicker.styles.d.ts.map +1 -1
- package/lib/typescript/components/TimePicker/TimePicker.web.d.ts.map +1 -1
- package/lib/typescript/components/TimePicker/TimeWheelPicker.d.ts.map +1 -1
- package/lib/typescript/components/TimePicker/TimeWheelPicker.web.d.ts +11 -0
- package/lib/typescript/components/TimePicker/TimeWheelPicker.web.d.ts.map +1 -0
- package/lib/typescript/components/WheelPicker/WheelPicker.d.ts +14 -1
- package/lib/typescript/components/WheelPicker/WheelPicker.d.ts.map +1 -1
- package/lib/typescript/components/WheelPicker/WheelPicker.styles.d.ts +9 -7
- package/lib/typescript/components/WheelPicker/WheelPicker.styles.d.ts.map +1 -1
- package/lib/typescript/components/WheelPicker/WheelPicker.web.d.ts.map +1 -1
- package/lib/typescript/context/ThemeOverrideContext.d.ts +23 -0
- package/lib/typescript/context/ThemeOverrideContext.d.ts.map +1 -0
- package/lib/typescript/index.d.ts +4 -2
- package/lib/typescript/index.d.ts.map +1 -1
- package/lib/typescript/types/datepicker.d.ts +41 -0
- package/lib/typescript/types/datepicker.d.ts.map +1 -1
- package/lib/typescript/types/timepicker.d.ts +62 -0
- package/lib/typescript/types/timepicker.d.ts.map +1 -1
- package/lib/typescript/utils/validation.d.ts +47 -27
- package/lib/typescript/utils/validation.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/components/CalendarGrid/CalendarGrid.styles.ts +21 -17
- package/src/components/CalendarGrid/CalendarGrid.tsx +98 -12
- package/src/components/CalendarGrid/CalendarGrid.web.tsx +305 -0
- package/src/components/CalendarGrid/DayCell.tsx +78 -59
- package/src/components/CalendarGrid/DayCell.web.tsx +129 -0
- package/src/components/DatePicker/DatePicker.android.tsx +14 -8
- package/src/components/DatePicker/DatePicker.ios.tsx +14 -8
- package/src/components/DatePicker/DatePicker.styles.ts +18 -22
- package/src/components/DatePicker/DatePicker.tsx +12 -1
- package/src/components/DatePicker/DatePicker.web.tsx +21 -13
- package/src/components/TimePicker/ClockFace.tsx +34 -8
- package/src/components/TimePicker/ClockFace.web.tsx +303 -0
- package/src/components/TimePicker/MaterialTimePicker.tsx +144 -13
- package/src/components/TimePicker/MaterialTimePicker.web.tsx +271 -0
- package/src/components/TimePicker/TimePicker.android.tsx +9 -1
- package/src/components/TimePicker/TimePicker.ios.tsx +10 -6
- package/src/components/TimePicker/TimePicker.styles.ts +52 -45
- package/src/components/TimePicker/TimePicker.web.tsx +17 -7
- package/src/components/TimePicker/TimeWheelPicker.tsx +60 -6
- package/src/components/TimePicker/TimeWheelPicker.web.tsx +401 -0
- package/src/components/WheelPicker/WheelPicker.styles.ts +12 -8
- package/src/components/WheelPicker/WheelPicker.tsx +24 -2
- package/src/components/WheelPicker/WheelPicker.web.tsx +153 -57
- package/src/context/ThemeOverrideContext.tsx +38 -0
- package/src/index.ts +11 -0
- package/src/types/datepicker.ts +44 -0
- package/src/types/timepicker.ts +74 -0
- package/src/utils/validation.ts +111 -55
- package/lib/module/unistyles.js +0 -9
- package/lib/module/unistyles.js.map +0 -1
- package/lib/typescript/unistyles.d.ts +0 -3
- package/lib/typescript/unistyles.d.ts.map +0 -1
- package/src/unistyles.ts +0 -6
|
@@ -1,28 +1,30 @@
|
|
|
1
|
-
import { StyleSheet } from 'react-native
|
|
1
|
+
import { StyleSheet } from 'react-native';
|
|
2
2
|
|
|
3
3
|
const ITEM_HEIGHT = 44;
|
|
4
4
|
const VISIBLE_ITEMS = 5;
|
|
5
5
|
const CONTAINER_HEIGHT = ITEM_HEIGHT * VISIBLE_ITEMS;
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* Default styles for TimePicker using plain React Native StyleSheet.
|
|
9
|
+
* Colors use dark theme defaults - consumers override via themeOverrides prop.
|
|
10
|
+
*/
|
|
11
|
+
export const styles = StyleSheet.create({
|
|
8
12
|
// Container styles
|
|
9
13
|
container: {
|
|
10
|
-
backgroundColor:
|
|
11
|
-
borderRadius:
|
|
12
|
-
padding:
|
|
14
|
+
backgroundColor: '#2C2C2E',
|
|
15
|
+
borderRadius: 16,
|
|
16
|
+
padding: 16,
|
|
13
17
|
},
|
|
14
18
|
|
|
15
19
|
// ============ Wheel Picker Styles (iOS) ============
|
|
16
20
|
wheelContainer: {
|
|
17
21
|
flexDirection: 'row',
|
|
18
22
|
height: CONTAINER_HEIGHT,
|
|
19
|
-
backgroundColor:
|
|
20
|
-
|
|
21
|
-
backdropFilter: 'blur(20px)',
|
|
22
|
-
borderRadius: theme.radii.card,
|
|
23
|
+
backgroundColor: '#2C2C2E',
|
|
24
|
+
borderRadius: 16,
|
|
23
25
|
overflow: 'hidden',
|
|
24
26
|
alignItems: 'center',
|
|
25
|
-
paddingHorizontal:
|
|
27
|
+
paddingHorizontal: 8,
|
|
26
28
|
},
|
|
27
29
|
|
|
28
30
|
wheelColumn: {
|
|
@@ -38,8 +40,8 @@ export const styles = StyleSheet.create((theme) => ({
|
|
|
38
40
|
left: 4,
|
|
39
41
|
right: 4,
|
|
40
42
|
height: ITEM_HEIGHT,
|
|
41
|
-
backgroundColor:
|
|
42
|
-
borderRadius:
|
|
43
|
+
backgroundColor: 'rgba(120, 120, 128, 0.24)',
|
|
44
|
+
borderRadius: 8,
|
|
43
45
|
zIndex: 0,
|
|
44
46
|
},
|
|
45
47
|
|
|
@@ -55,7 +57,7 @@ export const styles = StyleSheet.create((theme) => ({
|
|
|
55
57
|
|
|
56
58
|
wheelItemText: {
|
|
57
59
|
fontSize: 22,
|
|
58
|
-
color:
|
|
60
|
+
color: '#FFFFFF',
|
|
59
61
|
fontWeight: '400',
|
|
60
62
|
opacity: 0.5,
|
|
61
63
|
},
|
|
@@ -68,24 +70,24 @@ export const styles = StyleSheet.create((theme) => ({
|
|
|
68
70
|
wheelSeparator: {
|
|
69
71
|
fontSize: 22,
|
|
70
72
|
fontWeight: '500',
|
|
71
|
-
color:
|
|
72
|
-
paddingHorizontal:
|
|
73
|
+
color: '#FFFFFF',
|
|
74
|
+
paddingHorizontal: 4,
|
|
73
75
|
},
|
|
74
76
|
|
|
75
77
|
// ============ Material Time Picker Styles ============
|
|
76
78
|
materialContainer: {
|
|
77
|
-
backgroundColor:
|
|
79
|
+
backgroundColor: '#2C2C2E',
|
|
78
80
|
borderRadius: 28,
|
|
79
|
-
padding:
|
|
81
|
+
padding: 24,
|
|
80
82
|
width: 320,
|
|
81
83
|
},
|
|
82
84
|
|
|
83
85
|
materialHeader: {
|
|
84
86
|
fontSize: 12,
|
|
85
87
|
fontWeight: '500',
|
|
86
|
-
color:
|
|
88
|
+
color: '#8E8E93',
|
|
87
89
|
letterSpacing: 0.5,
|
|
88
|
-
marginBottom:
|
|
90
|
+
marginBottom: 20,
|
|
89
91
|
textTransform: 'uppercase',
|
|
90
92
|
},
|
|
91
93
|
|
|
@@ -94,8 +96,8 @@ export const styles = StyleSheet.create((theme) => ({
|
|
|
94
96
|
flexDirection: 'row',
|
|
95
97
|
alignItems: 'center',
|
|
96
98
|
justifyContent: 'center',
|
|
97
|
-
gap:
|
|
98
|
-
marginBottom:
|
|
99
|
+
gap: 12,
|
|
100
|
+
marginBottom: 24,
|
|
99
101
|
},
|
|
100
102
|
|
|
101
103
|
timeFieldsContainer: {
|
|
@@ -104,22 +106,22 @@ export const styles = StyleSheet.create((theme) => ({
|
|
|
104
106
|
},
|
|
105
107
|
|
|
106
108
|
timeField: {
|
|
107
|
-
backgroundColor:
|
|
108
|
-
borderRadius:
|
|
109
|
-
paddingVertical:
|
|
110
|
-
paddingHorizontal:
|
|
109
|
+
backgroundColor: '#3A3A3C',
|
|
110
|
+
borderRadius: 8,
|
|
111
|
+
paddingVertical: 12,
|
|
112
|
+
paddingHorizontal: 8,
|
|
111
113
|
minWidth: 80,
|
|
112
114
|
alignItems: 'center',
|
|
113
115
|
},
|
|
114
116
|
|
|
115
117
|
timeFieldActive: {
|
|
116
|
-
backgroundColor:
|
|
118
|
+
backgroundColor: '#4DA6FF',
|
|
117
119
|
},
|
|
118
120
|
|
|
119
121
|
timeFieldText: {
|
|
120
122
|
fontSize: 48,
|
|
121
123
|
fontWeight: '400',
|
|
122
|
-
color:
|
|
124
|
+
color: '#FFFFFF',
|
|
123
125
|
fontVariant: ['tabular-nums'],
|
|
124
126
|
},
|
|
125
127
|
|
|
@@ -130,48 +132,48 @@ export const styles = StyleSheet.create((theme) => ({
|
|
|
130
132
|
timeSeparator: {
|
|
131
133
|
fontSize: 48,
|
|
132
134
|
fontWeight: '400',
|
|
133
|
-
color:
|
|
134
|
-
marginHorizontal:
|
|
135
|
+
color: '#FFFFFF',
|
|
136
|
+
marginHorizontal: 4,
|
|
135
137
|
},
|
|
136
138
|
|
|
137
139
|
// Period toggle (AM/PM)
|
|
138
140
|
periodToggleContainer: {
|
|
139
141
|
borderWidth: 1,
|
|
140
|
-
borderColor:
|
|
141
|
-
borderRadius:
|
|
142
|
+
borderColor: '#48484A',
|
|
143
|
+
borderRadius: 8,
|
|
142
144
|
overflow: 'hidden',
|
|
143
145
|
},
|
|
144
146
|
|
|
145
147
|
periodButton: {
|
|
146
|
-
paddingVertical:
|
|
147
|
-
paddingHorizontal:
|
|
148
|
+
paddingVertical: 8,
|
|
149
|
+
paddingHorizontal: 12,
|
|
148
150
|
backgroundColor: 'transparent',
|
|
149
151
|
},
|
|
150
152
|
|
|
151
153
|
periodButtonActive: {
|
|
152
|
-
backgroundColor:
|
|
154
|
+
backgroundColor: 'rgba(77, 166, 255, 0.2)',
|
|
153
155
|
},
|
|
154
156
|
|
|
155
157
|
periodButtonTop: {
|
|
156
158
|
borderBottomWidth: 1,
|
|
157
|
-
borderBottomColor:
|
|
159
|
+
borderBottomColor: '#48484A',
|
|
158
160
|
},
|
|
159
161
|
|
|
160
162
|
periodButtonText: {
|
|
161
163
|
fontSize: 14,
|
|
162
164
|
fontWeight: '500',
|
|
163
|
-
color:
|
|
165
|
+
color: '#8E8E93',
|
|
164
166
|
},
|
|
165
167
|
|
|
166
168
|
periodButtonTextActive: {
|
|
167
|
-
color:
|
|
169
|
+
color: '#4DA6FF',
|
|
168
170
|
},
|
|
169
171
|
|
|
170
172
|
// ============ Clock Face Styles ============
|
|
171
173
|
clockContainer: {
|
|
172
174
|
alignItems: 'center',
|
|
173
175
|
justifyContent: 'center',
|
|
174
|
-
marginBottom:
|
|
176
|
+
marginBottom: 20,
|
|
175
177
|
},
|
|
176
178
|
|
|
177
179
|
// ============ Action Buttons ============
|
|
@@ -182,28 +184,33 @@ export const styles = StyleSheet.create((theme) => ({
|
|
|
182
184
|
},
|
|
183
185
|
|
|
184
186
|
keyboardButton: {
|
|
185
|
-
padding:
|
|
187
|
+
padding: 8,
|
|
186
188
|
},
|
|
187
189
|
|
|
188
190
|
keyboardButtonText: {
|
|
189
191
|
fontSize: 20,
|
|
190
|
-
color:
|
|
192
|
+
color: '#8E8E93',
|
|
191
193
|
},
|
|
192
194
|
|
|
193
195
|
actionButtonsContainer: {
|
|
194
196
|
flexDirection: 'row',
|
|
195
|
-
gap:
|
|
197
|
+
gap: 8,
|
|
196
198
|
},
|
|
197
199
|
|
|
198
200
|
actionButton: {
|
|
199
|
-
paddingVertical:
|
|
200
|
-
paddingHorizontal:
|
|
201
|
+
paddingVertical: 10,
|
|
202
|
+
paddingHorizontal: 16,
|
|
201
203
|
borderRadius: 20,
|
|
202
204
|
},
|
|
203
205
|
|
|
204
206
|
actionButtonText: {
|
|
205
207
|
fontSize: 14,
|
|
206
208
|
fontWeight: '500',
|
|
207
|
-
color:
|
|
209
|
+
color: '#4DA6FF',
|
|
208
210
|
},
|
|
209
|
-
})
|
|
211
|
+
});
|
|
212
|
+
|
|
213
|
+
// Export constants for use in components
|
|
214
|
+
export const WHEEL_ITEM_HEIGHT = ITEM_HEIGHT;
|
|
215
|
+
export const WHEEL_VISIBLE_ITEMS = VISIBLE_ITEMS;
|
|
216
|
+
export const WHEEL_CONTAINER_HEIGHT = CONTAINER_HEIGHT;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type React from 'react';
|
|
2
|
+
import { ThemeOverrideProvider } from '../../context/ThemeOverrideContext';
|
|
2
3
|
import type { TimePickerProps } from '../../types/timepicker';
|
|
3
4
|
import { MaterialTimePicker } from './MaterialTimePicker';
|
|
4
5
|
import { TimeWheelPicker } from './TimeWheelPicker';
|
|
@@ -15,21 +16,30 @@ export const TimePicker: React.FC<TimePickerProps> = ({
|
|
|
15
16
|
theme = 'ios',
|
|
16
17
|
is24Hour = false,
|
|
17
18
|
minuteInterval = 1,
|
|
19
|
+
themeOverrides,
|
|
18
20
|
}) => {
|
|
19
21
|
// iOS theme uses wheel picker
|
|
20
22
|
if (theme === 'ios') {
|
|
21
23
|
return (
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
<ThemeOverrideProvider value={{ timePicker: themeOverrides }}>
|
|
25
|
+
<TimeWheelPicker
|
|
26
|
+
value={value}
|
|
27
|
+
onChange={onChange}
|
|
28
|
+
is24Hour={is24Hour}
|
|
29
|
+
minuteInterval={minuteInterval}
|
|
30
|
+
/>
|
|
31
|
+
</ThemeOverrideProvider>
|
|
28
32
|
);
|
|
29
33
|
}
|
|
30
34
|
|
|
31
35
|
// Android/native theme uses Material clock face
|
|
32
36
|
return (
|
|
33
|
-
<
|
|
37
|
+
<ThemeOverrideProvider value={{ timePicker: themeOverrides }}>
|
|
38
|
+
<MaterialTimePicker
|
|
39
|
+
value={value}
|
|
40
|
+
onChange={onChange}
|
|
41
|
+
is24Hour={is24Hour}
|
|
42
|
+
/>
|
|
43
|
+
</ThemeOverrideProvider>
|
|
34
44
|
);
|
|
35
45
|
};
|
|
@@ -8,22 +8,33 @@ import Animated, {
|
|
|
8
8
|
useSharedValue,
|
|
9
9
|
withSpring,
|
|
10
10
|
} from 'react-native-reanimated';
|
|
11
|
+
import { useTimePickerOverrides } from '../../context/ThemeOverrideContext';
|
|
11
12
|
import { to12Hour, to24Hour } from '../../hooks/useTimePicker';
|
|
12
13
|
import type { TimePeriod, TimeValue } from '../../types/timepicker';
|
|
13
|
-
import { styles } from './TimePicker.styles';
|
|
14
|
+
import { WHEEL_ITEM_HEIGHT, styles } from './TimePicker.styles';
|
|
14
15
|
|
|
15
|
-
const ITEM_HEIGHT =
|
|
16
|
+
const ITEM_HEIGHT = WHEEL_ITEM_HEIGHT;
|
|
16
17
|
const VISIBLE_ITEMS = 5;
|
|
17
18
|
const CONTAINER_HEIGHT = ITEM_HEIGHT * VISIBLE_ITEMS;
|
|
18
19
|
|
|
20
|
+
// Default colors (dark theme)
|
|
21
|
+
const DEFAULT_COLORS = {
|
|
22
|
+
containerBackground: '#2C2C2E',
|
|
23
|
+
selectionHighlight: 'rgba(120, 120, 128, 0.24)',
|
|
24
|
+
textColor: '#FFFFFF',
|
|
25
|
+
separatorColor: '#FFFFFF',
|
|
26
|
+
};
|
|
27
|
+
|
|
19
28
|
interface WheelColumnProps {
|
|
20
29
|
items: { value: number | string; label: string }[];
|
|
21
30
|
selectedIndex: number;
|
|
22
31
|
onSelect: (index: number) => void;
|
|
32
|
+
textColor: string;
|
|
33
|
+
highlightColor: string;
|
|
23
34
|
}
|
|
24
35
|
|
|
25
36
|
const WheelColumn: React.FC<WheelColumnProps> = memo(
|
|
26
|
-
({ items, selectedIndex, onSelect }) => {
|
|
37
|
+
({ items, selectedIndex, onSelect, textColor, highlightColor }) => {
|
|
27
38
|
const translateY = useSharedValue(-selectedIndex * ITEM_HEIGHT);
|
|
28
39
|
|
|
29
40
|
const handleSelect = useCallback(
|
|
@@ -66,7 +77,12 @@ const WheelColumn: React.FC<WheelColumnProps> = memo(
|
|
|
66
77
|
|
|
67
78
|
return (
|
|
68
79
|
<View style={styles.wheelColumn}>
|
|
69
|
-
<View
|
|
80
|
+
<View
|
|
81
|
+
style={[
|
|
82
|
+
styles.wheelSelectionIndicator,
|
|
83
|
+
{ backgroundColor: highlightColor },
|
|
84
|
+
]}
|
|
85
|
+
/>
|
|
70
86
|
|
|
71
87
|
<GestureDetector gesture={panGesture}>
|
|
72
88
|
<Animated.View style={[styles.wheelItemsContainer, animatedStyle]}>
|
|
@@ -79,6 +95,7 @@ const WheelColumn: React.FC<WheelColumnProps> = memo(
|
|
|
79
95
|
<Text
|
|
80
96
|
style={[
|
|
81
97
|
styles.wheelItemText,
|
|
98
|
+
{ color: textColor },
|
|
82
99
|
isSelected && styles.wheelItemTextSelected,
|
|
83
100
|
]}
|
|
84
101
|
>
|
|
@@ -107,6 +124,30 @@ interface TimeWheelPickerProps {
|
|
|
107
124
|
|
|
108
125
|
export const TimeWheelPicker: React.FC<TimeWheelPickerProps> = memo(
|
|
109
126
|
({ value, onChange, is24Hour = false, minuteInterval = 1 }) => {
|
|
127
|
+
const overrides = useTimePickerOverrides();
|
|
128
|
+
|
|
129
|
+
// Build colors from overrides (use backgroundColor as fallback for wheelContainerBackground)
|
|
130
|
+
const colors = useMemo(
|
|
131
|
+
() => ({
|
|
132
|
+
containerBackground:
|
|
133
|
+
overrides?.wheelContainerBackground ??
|
|
134
|
+
overrides?.backgroundColor ??
|
|
135
|
+
DEFAULT_COLORS.containerBackground,
|
|
136
|
+
selectionHighlight:
|
|
137
|
+
overrides?.wheelSelectionHighlight ??
|
|
138
|
+
DEFAULT_COLORS.selectionHighlight,
|
|
139
|
+
textColor:
|
|
140
|
+
overrides?.wheelTextColor ??
|
|
141
|
+
overrides?.textColor ??
|
|
142
|
+
DEFAULT_COLORS.textColor,
|
|
143
|
+
separatorColor:
|
|
144
|
+
overrides?.wheelSeparatorColor ??
|
|
145
|
+
overrides?.textColor ??
|
|
146
|
+
DEFAULT_COLORS.separatorColor,
|
|
147
|
+
}),
|
|
148
|
+
[overrides],
|
|
149
|
+
);
|
|
150
|
+
|
|
110
151
|
// Generate hour items
|
|
111
152
|
const hourItems = useMemo(() => {
|
|
112
153
|
if (is24Hour) {
|
|
@@ -181,19 +222,30 @@ export const TimeWheelPicker: React.FC<TimeWheelPickerProps> = memo(
|
|
|
181
222
|
);
|
|
182
223
|
|
|
183
224
|
return (
|
|
184
|
-
<View
|
|
225
|
+
<View
|
|
226
|
+
style={[
|
|
227
|
+
styles.wheelContainer,
|
|
228
|
+
{ backgroundColor: colors.containerBackground },
|
|
229
|
+
]}
|
|
230
|
+
>
|
|
185
231
|
<WheelColumn
|
|
186
232
|
items={hourItems}
|
|
187
233
|
selectedIndex={hourIndex}
|
|
188
234
|
onSelect={handleHourChange}
|
|
235
|
+
textColor={colors.textColor}
|
|
236
|
+
highlightColor={colors.selectionHighlight}
|
|
189
237
|
/>
|
|
190
238
|
|
|
191
|
-
<Text style={styles.wheelSeparator}
|
|
239
|
+
<Text style={[styles.wheelSeparator, { color: colors.separatorColor }]}>
|
|
240
|
+
:
|
|
241
|
+
</Text>
|
|
192
242
|
|
|
193
243
|
<WheelColumn
|
|
194
244
|
items={minuteItems}
|
|
195
245
|
selectedIndex={minuteIndex}
|
|
196
246
|
onSelect={handleMinuteChange}
|
|
247
|
+
textColor={colors.textColor}
|
|
248
|
+
highlightColor={colors.selectionHighlight}
|
|
197
249
|
/>
|
|
198
250
|
|
|
199
251
|
{!is24Hour && (
|
|
@@ -201,6 +253,8 @@ export const TimeWheelPicker: React.FC<TimeWheelPickerProps> = memo(
|
|
|
201
253
|
items={periodItems}
|
|
202
254
|
selectedIndex={periodIndex}
|
|
203
255
|
onSelect={handlePeriodChange}
|
|
256
|
+
textColor={colors.textColor}
|
|
257
|
+
highlightColor={colors.selectionHighlight}
|
|
204
258
|
/>
|
|
205
259
|
)}
|
|
206
260
|
</View>
|