@idealyst/datepicker 1.0.83 → 1.0.84
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/README.md +1 -1
- package/package.json +8 -3
- package/src/DateInput/DateInput.native.tsx +1 -1
- package/src/DateInput/DateInput.styles.tsx +3 -3
- package/src/DateInput/DateInput.web.tsx +1 -1
- package/src/DateInput/types.ts +1 -1
- package/src/DatePicker/Calendar.native.tsx +2 -2
- package/src/DatePicker/Calendar.styles.tsx +24 -21
- package/src/DatePicker/Calendar.web.tsx +9 -4
- package/src/DatePicker/DatePicker.styles.tsx +5 -5
- package/src/DatePicker/types.ts +1 -1
- package/src/DateRangePicker/DateRangePicker.styles.tsx +7 -7
- package/src/DateRangePicker/RangeCalendar.native.tsx +15 -15
- package/src/DateRangePicker/RangeCalendar.styles.tsx +6 -2
- package/src/DateRangePicker/RangeCalendar.web.tsx +16 -16
- package/src/DateRangePicker/types.ts +1 -1
- package/src/DateTimePicker/DateTimePicker.styles.tsx +33 -6
- package/src/DateTimePicker/DateTimePickerBase.tsx +10 -29
- package/src/DateTimePicker/TimePicker.styles.tsx +2 -5
- package/src/DateTimePicker/TimePickerBase.tsx +1 -1
- package/src/DateTimePicker/types.ts +1 -1
- package/src/DateTimeRangePicker/DateTimeRangePicker.styles.tsx +27 -7
- package/src/DateTimeRangePicker/DateTimeRangePickerBase.tsx +11 -21
- package/src/DateTimeRangePicker/types.ts +1 -1
- package/src/examples/DatePickerExamples.tsx +29 -29
- package/src/primitives/CalendarGrid/CalendarGrid.styles.tsx +13 -24
- package/src/primitives/CalendarGrid/CalendarGrid.tsx +19 -11
- package/src/primitives/CalendarHeader/CalendarHeader.tsx +15 -15
- package/src/primitives/CalendarOverlay/CalendarOverlay.styles.tsx +7 -2
- package/src/primitives/CalendarOverlay/CalendarOverlay.tsx +38 -32
package/README.md
CHANGED
|
@@ -72,7 +72,7 @@ function MyComponent() {
|
|
|
72
72
|
| `error` | `string` | - | Error message |
|
|
73
73
|
| `helperText` | `string` | - | Helper text |
|
|
74
74
|
| `format` | `string` | `'MM/dd/yyyy'` | Date display format |
|
|
75
|
-
| `size` | `'
|
|
75
|
+
| `size` | `'sm' \| 'md' \| 'lg'` | `'md'` | Size variant |
|
|
76
76
|
| `variant` | `'outlined' \| 'filled'` | `'outlined'` | Visual variant |
|
|
77
77
|
|
|
78
78
|
## Examples
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@idealyst/datepicker",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.84",
|
|
4
4
|
"description": "Cross-platform date and time picker components for React and React Native",
|
|
5
5
|
"documentation": "https://github.com/IdealystIO/idealyst-framework/tree/main/packages/datepicker#readme",
|
|
6
6
|
"readme": "README.md",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"publish:npm": "npm publish"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@idealyst/components": "^1.0.
|
|
40
|
-
"@idealyst/theme": "^1.0.
|
|
39
|
+
"@idealyst/components": "^1.0.84",
|
|
40
|
+
"@idealyst/theme": "^1.0.84",
|
|
41
41
|
"react": ">=16.8.0",
|
|
42
42
|
"react-native": ">=0.60.0",
|
|
43
43
|
"react-native-svg": ">=13.0.0",
|
|
@@ -61,7 +61,12 @@
|
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
|
+
"@idealyst/components": "^1.0.84",
|
|
65
|
+
"@idealyst/theme": "^1.0.84",
|
|
64
66
|
"@types/react": "^19.1.0",
|
|
67
|
+
"react": "^19.1.0",
|
|
68
|
+
"react-native": "^0.80.1",
|
|
69
|
+
"react-native-unistyles": "^3.0.10",
|
|
65
70
|
"typescript": "^5.0.0"
|
|
66
71
|
},
|
|
67
72
|
"files": [
|
|
@@ -6,20 +6,20 @@ export const dateInputStyles = StyleSheet.create((theme) => ({
|
|
|
6
6
|
},
|
|
7
7
|
|
|
8
8
|
label: {
|
|
9
|
-
fontSize: theme.typography?.
|
|
9
|
+
fontSize: theme.typography?.fontSize?.sm || 14,
|
|
10
10
|
color: theme.colors?.text?.primary || '#1f2937',
|
|
11
11
|
marginBottom: theme.spacing?.xs || 4,
|
|
12
12
|
fontWeight: '500',
|
|
13
13
|
},
|
|
14
14
|
|
|
15
15
|
helperText: {
|
|
16
|
-
fontSize: theme.typography?.
|
|
16
|
+
fontSize: theme.typography?.fontSize?.sm || 12,
|
|
17
17
|
color: theme.colors?.text?.secondary || '#6b7280',
|
|
18
18
|
marginTop: theme.spacing?.xs || 4,
|
|
19
19
|
},
|
|
20
20
|
|
|
21
21
|
errorText: {
|
|
22
|
-
fontSize: theme.typography?.
|
|
22
|
+
fontSize: theme.typography?.fontSize?.sm || 12,
|
|
23
23
|
color: theme.colors?.text?.error || '#dc2626',
|
|
24
24
|
marginTop: theme.spacing?.xs || 4,
|
|
25
25
|
},
|
package/src/DateInput/types.ts
CHANGED
|
@@ -180,7 +180,7 @@ export const Calendar: React.FC<CalendarProps> = memo(({
|
|
|
180
180
|
<View style={calendarStyles.header}>
|
|
181
181
|
<Button
|
|
182
182
|
variant="text"
|
|
183
|
-
size="
|
|
183
|
+
size="sm"
|
|
184
184
|
onPress={goToPreviousMonth}
|
|
185
185
|
disabled={disabled}
|
|
186
186
|
style={calendarStyles.headerButton}
|
|
@@ -190,7 +190,7 @@ export const Calendar: React.FC<CalendarProps> = memo(({
|
|
|
190
190
|
<Text weight="semibold">{monthName}</Text>
|
|
191
191
|
<Button
|
|
192
192
|
variant="text"
|
|
193
|
-
size="
|
|
193
|
+
size="sm"
|
|
194
194
|
onPress={goToNextMonth}
|
|
195
195
|
disabled={disabled}
|
|
196
196
|
style={calendarStyles.headerButton}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
+
import { AppTheme } from '@idealyst/theme';
|
|
1
2
|
import { StyleSheet } from 'react-native-unistyles';
|
|
2
3
|
|
|
3
|
-
export const calendarStyles = StyleSheet.create((theme) => ({
|
|
4
|
+
export const calendarStyles = StyleSheet.create((theme: AppTheme) => ({
|
|
4
5
|
container: {
|
|
5
6
|
width: 256,
|
|
6
|
-
|
|
7
|
+
_web: {
|
|
8
|
+
position: 'relative',
|
|
9
|
+
}
|
|
7
10
|
},
|
|
8
11
|
|
|
9
12
|
header: {
|
|
@@ -11,33 +14,33 @@ export const calendarStyles = StyleSheet.create((theme) => ({
|
|
|
11
14
|
flexDirection: 'row',
|
|
12
15
|
justifyContent: 'space-between',
|
|
13
16
|
alignItems: 'center',
|
|
14
|
-
marginBottom:
|
|
17
|
+
marginBottom: 16,
|
|
15
18
|
},
|
|
16
19
|
|
|
17
20
|
headerButton: {
|
|
18
21
|
minWidth: 32,
|
|
19
22
|
minHeight: 32,
|
|
20
|
-
paddingHorizontal:
|
|
21
|
-
paddingVertical:
|
|
23
|
+
paddingHorizontal: 8,
|
|
24
|
+
paddingVertical: 4,
|
|
22
25
|
},
|
|
23
26
|
|
|
24
27
|
headerTitle: {
|
|
25
28
|
display: 'flex',
|
|
26
29
|
flexDirection: 'row',
|
|
27
30
|
alignItems: 'center',
|
|
28
|
-
gap:
|
|
31
|
+
gap: 8,
|
|
29
32
|
},
|
|
30
33
|
|
|
31
34
|
monthYearButton: {
|
|
32
|
-
paddingHorizontal:
|
|
33
|
-
paddingVertical:
|
|
35
|
+
paddingHorizontal: 8,
|
|
36
|
+
paddingVertical: 4,
|
|
34
37
|
},
|
|
35
38
|
|
|
36
39
|
pickerContainer: {
|
|
37
|
-
marginBottom:
|
|
38
|
-
padding:
|
|
40
|
+
marginBottom: 16,
|
|
41
|
+
padding: 12,
|
|
39
42
|
backgroundColor: theme.colors?.surface?.secondary || '#f9fafb',
|
|
40
|
-
borderRadius:
|
|
43
|
+
borderRadius: 8,
|
|
41
44
|
borderWidth: 1,
|
|
42
45
|
borderColor: theme.colors?.border?.primary || '#e5e7eb',
|
|
43
46
|
|
|
@@ -78,9 +81,9 @@ export const calendarStyles = StyleSheet.create((theme) => ({
|
|
|
78
81
|
},
|
|
79
82
|
|
|
80
83
|
pickerButton: {
|
|
81
|
-
fontSize:
|
|
82
|
-
paddingHorizontal:
|
|
83
|
-
paddingVertical:
|
|
84
|
+
fontSize: 12,
|
|
85
|
+
paddingHorizontal: 6,
|
|
86
|
+
paddingVertical: 4,
|
|
84
87
|
minHeight: 32,
|
|
85
88
|
justifyContent: 'center',
|
|
86
89
|
alignItems: 'center',
|
|
@@ -119,7 +122,7 @@ export const calendarStyles = StyleSheet.create((theme) => ({
|
|
|
119
122
|
|
|
120
123
|
weekdayHeader: {
|
|
121
124
|
flexDirection: 'row',
|
|
122
|
-
marginBottom:
|
|
125
|
+
marginBottom: 8,
|
|
123
126
|
|
|
124
127
|
// Web specific styles
|
|
125
128
|
_web: {
|
|
@@ -134,7 +137,7 @@ export const calendarStyles = StyleSheet.create((theme) => ({
|
|
|
134
137
|
flex: 1,
|
|
135
138
|
alignItems: 'center',
|
|
136
139
|
justifyContent: 'center',
|
|
137
|
-
paddingVertical:
|
|
140
|
+
paddingVertical: 4,
|
|
138
141
|
|
|
139
142
|
// Web specific styles
|
|
140
143
|
_web: {
|
|
@@ -144,7 +147,7 @@ export const calendarStyles = StyleSheet.create((theme) => ({
|
|
|
144
147
|
},
|
|
145
148
|
|
|
146
149
|
weekdayText: {
|
|
147
|
-
fontSize:
|
|
150
|
+
fontSize: 12,
|
|
148
151
|
fontWeight: '500',
|
|
149
152
|
color: theme.colors?.text?.secondary || '#6b7280',
|
|
150
153
|
},
|
|
@@ -152,7 +155,7 @@ export const calendarStyles = StyleSheet.create((theme) => ({
|
|
|
152
155
|
calendarGrid: {
|
|
153
156
|
flexDirection: 'row',
|
|
154
157
|
flexWrap: 'wrap',
|
|
155
|
-
marginBottom:
|
|
158
|
+
marginBottom: 8,
|
|
156
159
|
|
|
157
160
|
// Web specific styles
|
|
158
161
|
_web: {
|
|
@@ -184,8 +187,8 @@ export const calendarStyles = StyleSheet.create((theme) => ({
|
|
|
184
187
|
minWidth: 28,
|
|
185
188
|
minHeight: 28,
|
|
186
189
|
padding: 0,
|
|
187
|
-
borderRadius:
|
|
188
|
-
fontSize:
|
|
190
|
+
borderRadius: 6,
|
|
191
|
+
fontSize: 13,
|
|
189
192
|
alignItems: 'center',
|
|
190
193
|
justifyContent: 'center',
|
|
191
194
|
|
|
@@ -211,7 +214,7 @@ export const calendarStyles = StyleSheet.create((theme) => ({
|
|
|
211
214
|
},
|
|
212
215
|
|
|
213
216
|
todaySection: {
|
|
214
|
-
paddingTop:
|
|
217
|
+
paddingTop: 12,
|
|
215
218
|
borderTopWidth: 1,
|
|
216
219
|
borderTopColor: theme.colors?.border?.secondary || '#f3f4f6',
|
|
217
220
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React, { useState, useEffect, useRef } from 'react';
|
|
2
|
-
import { View } from '@idealyst/components';
|
|
2
|
+
import { View, useMergeRefs } from '@idealyst/components';
|
|
3
3
|
import { CalendarProps } from './types';
|
|
4
4
|
import { CalendarHeader } from '../primitives/CalendarHeader';
|
|
5
5
|
import { CalendarGrid } from '../primitives/CalendarGrid';
|
|
6
6
|
import { CalendarOverlay } from '../primitives/CalendarOverlay';
|
|
7
7
|
import { calendarStyles } from './Calendar.styles';
|
|
8
|
+
import { getWebProps } from 'react-native-unistyles/web';
|
|
8
9
|
|
|
9
10
|
|
|
10
11
|
export const Calendar: React.FC<CalendarProps> = ({
|
|
@@ -22,7 +23,7 @@ export const Calendar: React.FC<CalendarProps> = ({
|
|
|
22
23
|
controlledCurrentMonth || value || new Date()
|
|
23
24
|
);
|
|
24
25
|
const [overlayMode, setOverlayMode] = useState<'month' | 'year' | null>(null);
|
|
25
|
-
const containerRef = useRef<
|
|
26
|
+
const containerRef = useRef<HTMLDivElement>(null);
|
|
26
27
|
|
|
27
28
|
const currentMonth = controlledCurrentMonth || internalCurrentMonth;
|
|
28
29
|
|
|
@@ -116,8 +117,12 @@ export const Calendar: React.FC<CalendarProps> = ({
|
|
|
116
117
|
}
|
|
117
118
|
};
|
|
118
119
|
|
|
120
|
+
const { ref: styleRef, ...containerProps } = getWebProps(calendarStyles.container);
|
|
121
|
+
|
|
122
|
+
const mergedRef = useMergeRefs(containerRef, styleRef);
|
|
123
|
+
|
|
119
124
|
return (
|
|
120
|
-
<
|
|
125
|
+
<div ref={mergedRef as any} {...containerProps} data-testid={testID}>
|
|
121
126
|
<CalendarHeader
|
|
122
127
|
currentMonth={currentMonth}
|
|
123
128
|
onPreviousMonth={goToPreviousMonth}
|
|
@@ -149,6 +154,6 @@ export const Calendar: React.FC<CalendarProps> = ({
|
|
|
149
154
|
disabled={disabled}
|
|
150
155
|
/>
|
|
151
156
|
)}
|
|
152
|
-
</
|
|
157
|
+
</div>
|
|
153
158
|
);
|
|
154
159
|
};
|
|
@@ -7,7 +7,7 @@ export const datePickerStyles = StyleSheet.create((theme) => ({
|
|
|
7
7
|
|
|
8
8
|
label: {
|
|
9
9
|
marginBottom: theme.spacing?.sm || 8,
|
|
10
|
-
fontSize: theme.typography?.
|
|
10
|
+
fontSize: theme.typography?.fontSize?.sm || 14,
|
|
11
11
|
fontWeight: '500',
|
|
12
12
|
color: theme.colors?.text?.primary || '#1f2937',
|
|
13
13
|
},
|
|
@@ -51,26 +51,26 @@ export const datePickerStyles = StyleSheet.create((theme) => ({
|
|
|
51
51
|
},
|
|
52
52
|
|
|
53
53
|
selectedDateLabel: {
|
|
54
|
-
fontSize: theme.typography?.
|
|
54
|
+
fontSize: theme.typography?.fontSize?.sm || 12,
|
|
55
55
|
color: theme.colors?.text?.secondary || '#6b7280',
|
|
56
56
|
marginBottom: 4,
|
|
57
57
|
},
|
|
58
58
|
|
|
59
59
|
selectedDateValue: {
|
|
60
|
-
fontSize: theme.typography?.
|
|
60
|
+
fontSize: theme.typography?.fontSize?.md || 16,
|
|
61
61
|
fontWeight: '600',
|
|
62
62
|
color: theme.colors?.text?.primary || '#1f2937',
|
|
63
63
|
},
|
|
64
64
|
|
|
65
65
|
errorText: {
|
|
66
66
|
marginTop: 4,
|
|
67
|
-
fontSize: theme.typography?.
|
|
67
|
+
fontSize: theme.typography?.fontSize?.sm || 12,
|
|
68
68
|
color: theme.colors?.text?.error || '#dc2626',
|
|
69
69
|
},
|
|
70
70
|
|
|
71
71
|
helperText: {
|
|
72
72
|
marginTop: 4,
|
|
73
|
-
fontSize: theme.typography?.
|
|
73
|
+
fontSize: theme.typography?.fontSize?.sm || 12,
|
|
74
74
|
color: theme.colors?.text?.secondary || '#6b7280',
|
|
75
75
|
},
|
|
76
76
|
}));
|
package/src/DatePicker/types.ts
CHANGED
|
@@ -6,7 +6,7 @@ export const dateRangePickerStyles = StyleSheet.create((theme) => ({
|
|
|
6
6
|
},
|
|
7
7
|
|
|
8
8
|
label: {
|
|
9
|
-
fontSize: theme.typography?.
|
|
9
|
+
fontSize: theme.typography?.fontSize?.sm || 14,
|
|
10
10
|
fontWeight: '600',
|
|
11
11
|
color: theme.colors?.text?.primary || '#111827',
|
|
12
12
|
marginBottom: theme.spacing?.xs || 4,
|
|
@@ -30,13 +30,13 @@ export const dateRangePickerStyles = StyleSheet.create((theme) => ({
|
|
|
30
30
|
},
|
|
31
31
|
|
|
32
32
|
selectedRangeLabel: {
|
|
33
|
-
fontSize: theme.typography?.
|
|
33
|
+
fontSize: theme.typography?.fontSize?.sm || 12,
|
|
34
34
|
fontWeight: '500',
|
|
35
35
|
color: theme.colors?.text?.secondary || '#6b7280',
|
|
36
36
|
},
|
|
37
37
|
|
|
38
38
|
selectedRangeValue: {
|
|
39
|
-
fontSize: theme.typography?.
|
|
39
|
+
fontSize: theme.typography?.fontSize?.md || 16,
|
|
40
40
|
fontWeight: '600',
|
|
41
41
|
color: theme.colors?.text?.primary || '#111827',
|
|
42
42
|
},
|
|
@@ -54,7 +54,7 @@ export const dateRangePickerStyles = StyleSheet.create((theme) => ({
|
|
|
54
54
|
borderColor: theme.colors?.border?.primary || '#e5e7eb',
|
|
55
55
|
borderRadius: theme.borderRadius?.md || 8,
|
|
56
56
|
backgroundColor: theme.colors?.surface?.primary || '#ffffff',
|
|
57
|
-
fontSize: theme.typography?.
|
|
57
|
+
fontSize: theme.typography?.fontSize?.md || 16,
|
|
58
58
|
textAlign: 'center',
|
|
59
59
|
|
|
60
60
|
_web: {
|
|
@@ -64,19 +64,19 @@ export const dateRangePickerStyles = StyleSheet.create((theme) => ({
|
|
|
64
64
|
},
|
|
65
65
|
|
|
66
66
|
rangeSeparator: {
|
|
67
|
-
fontSize: theme.typography?.
|
|
67
|
+
fontSize: theme.typography?.fontSize?.md || 16,
|
|
68
68
|
fontWeight: '500',
|
|
69
69
|
color: theme.colors?.text?.secondary || '#6b7280',
|
|
70
70
|
},
|
|
71
71
|
|
|
72
72
|
errorText: {
|
|
73
|
-
fontSize: theme.typography?.
|
|
73
|
+
fontSize: theme.typography?.fontSize?.sm || 12,
|
|
74
74
|
color: theme.colors?.semantic?.error || '#dc2626',
|
|
75
75
|
marginTop: theme.spacing?.xs || 4,
|
|
76
76
|
},
|
|
77
77
|
|
|
78
78
|
helperText: {
|
|
79
|
-
fontSize: theme.typography?.
|
|
79
|
+
fontSize: theme.typography?.fontSize?.sm || 12,
|
|
80
80
|
color: theme.colors?.text?.secondary || '#6b7280',
|
|
81
81
|
marginTop: theme.spacing?.xs || 4,
|
|
82
82
|
},
|
|
@@ -222,39 +222,39 @@ export const RangeCalendar: React.FC<RangeCalendarProps> = ({
|
|
|
222
222
|
<View style={[rangeCalendarStyles.container, style]} testID={testID}>
|
|
223
223
|
{/* Header */}
|
|
224
224
|
<View style={rangeCalendarStyles.header}>
|
|
225
|
-
<Button
|
|
226
|
-
|
|
227
|
-
size="
|
|
228
|
-
onPress={goToPreviousMonth}
|
|
225
|
+
<Button
|
|
226
|
+
type="text"
|
|
227
|
+
size="sm"
|
|
228
|
+
onPress={goToPreviousMonth}
|
|
229
229
|
disabled={disabled}
|
|
230
230
|
style={rangeCalendarStyles.headerButton}
|
|
231
231
|
>
|
|
232
232
|
←
|
|
233
233
|
</Button>
|
|
234
|
-
<View style={
|
|
234
|
+
<View style={rangeCalendarStyles.headerTitle}>
|
|
235
235
|
<Button
|
|
236
|
-
|
|
237
|
-
size="
|
|
236
|
+
type="text"
|
|
237
|
+
size="sm"
|
|
238
238
|
onPress={() => setOverlayMode('month')}
|
|
239
239
|
disabled={disabled}
|
|
240
|
-
style={
|
|
240
|
+
style={rangeCalendarStyles.compactButton}
|
|
241
241
|
>
|
|
242
242
|
<Text weight="semibold">{currentMonth.toLocaleDateString('en-US', { month: 'long' })}</Text>
|
|
243
243
|
</Button>
|
|
244
244
|
<Button
|
|
245
|
-
|
|
246
|
-
size="
|
|
245
|
+
type="text"
|
|
246
|
+
size="sm"
|
|
247
247
|
onPress={() => setOverlayMode('year')}
|
|
248
248
|
disabled={disabled}
|
|
249
|
-
style={
|
|
249
|
+
style={rangeCalendarStyles.compactButton}
|
|
250
250
|
>
|
|
251
251
|
<Text weight="semibold">{currentMonth.getFullYear()}</Text>
|
|
252
252
|
</Button>
|
|
253
253
|
</View>
|
|
254
|
-
<Button
|
|
255
|
-
|
|
256
|
-
size="
|
|
257
|
-
onPress={goToNextMonth}
|
|
254
|
+
<Button
|
|
255
|
+
type="text"
|
|
256
|
+
size="sm"
|
|
257
|
+
onPress={goToNextMonth}
|
|
258
258
|
disabled={disabled}
|
|
259
259
|
style={rangeCalendarStyles.headerButton}
|
|
260
260
|
>
|
|
@@ -68,7 +68,7 @@ export const rangeCalendarStyles = StyleSheet.create((theme) => ({
|
|
|
68
68
|
},
|
|
69
69
|
|
|
70
70
|
weekdayText: {
|
|
71
|
-
fontSize: theme.typography?.
|
|
71
|
+
fontSize: theme.typography?.fontSize?.sm || 12,
|
|
72
72
|
fontWeight: '500',
|
|
73
73
|
color: theme.colors?.text?.secondary || '#6b7280',
|
|
74
74
|
},
|
|
@@ -120,7 +120,7 @@ export const rangeCalendarStyles = StyleSheet.create((theme) => ({
|
|
|
120
120
|
padding: 0,
|
|
121
121
|
margin: 0,
|
|
122
122
|
borderRadius: theme.borderRadius?.sm || 6,
|
|
123
|
-
fontSize: theme.typography?.
|
|
123
|
+
fontSize: theme.typography?.fontSize?.sm || 13,
|
|
124
124
|
alignItems: 'center',
|
|
125
125
|
justifyContent: 'center',
|
|
126
126
|
overflow: 'hidden',
|
|
@@ -193,4 +193,8 @@ export const rangeCalendarStyles = StyleSheet.create((theme) => ({
|
|
|
193
193
|
clearButton: {
|
|
194
194
|
width: '100%',
|
|
195
195
|
},
|
|
196
|
+
|
|
197
|
+
compactButton: {
|
|
198
|
+
padding: 4,
|
|
199
|
+
},
|
|
196
200
|
}));
|
|
@@ -244,20 +244,20 @@ export const RangeCalendar: React.FC<RangeCalendarProps> = ({
|
|
|
244
244
|
<div {...containerProps} data-testid={testID} ref={containerRef}>
|
|
245
245
|
{/* Header */}
|
|
246
246
|
<div {...headerProps}>
|
|
247
|
-
<Button
|
|
248
|
-
|
|
249
|
-
size="
|
|
250
|
-
onPress={goToPreviousMonth}
|
|
247
|
+
<Button
|
|
248
|
+
type="text"
|
|
249
|
+
size="sm"
|
|
250
|
+
onPress={goToPreviousMonth}
|
|
251
251
|
disabled={disabled}
|
|
252
252
|
style={getWebProps([rangeCalendarStyles.headerButton]).style}
|
|
253
253
|
>
|
|
254
254
|
←
|
|
255
255
|
</Button>
|
|
256
|
-
|
|
256
|
+
|
|
257
257
|
<div {...headerTitleProps} style={{ display: 'flex', gap: '8px' }}>
|
|
258
258
|
<Button
|
|
259
|
-
|
|
260
|
-
size="
|
|
259
|
+
type="text"
|
|
260
|
+
size="sm"
|
|
261
261
|
onPress={() => setOverlayMode('month')}
|
|
262
262
|
disabled={disabled}
|
|
263
263
|
style={{ padding: '4px 8px' }}
|
|
@@ -265,8 +265,8 @@ export const RangeCalendar: React.FC<RangeCalendarProps> = ({
|
|
|
265
265
|
<Text weight="semibold">{currentMonth.toLocaleDateString('en-US', { month: 'long' })}</Text>
|
|
266
266
|
</Button>
|
|
267
267
|
<Button
|
|
268
|
-
|
|
269
|
-
size="
|
|
268
|
+
type="text"
|
|
269
|
+
size="sm"
|
|
270
270
|
onPress={() => setOverlayMode('year')}
|
|
271
271
|
disabled={disabled}
|
|
272
272
|
style={{ padding: '4px 8px' }}
|
|
@@ -274,11 +274,11 @@ export const RangeCalendar: React.FC<RangeCalendarProps> = ({
|
|
|
274
274
|
<Text weight="semibold">{currentMonth.getFullYear()}</Text>
|
|
275
275
|
</Button>
|
|
276
276
|
</div>
|
|
277
|
-
|
|
278
|
-
<Button
|
|
279
|
-
|
|
280
|
-
size="
|
|
281
|
-
onPress={goToNextMonth}
|
|
277
|
+
|
|
278
|
+
<Button
|
|
279
|
+
type="text"
|
|
280
|
+
size="sm"
|
|
281
|
+
onPress={goToNextMonth}
|
|
282
282
|
disabled={disabled}
|
|
283
283
|
style={getWebProps([rangeCalendarStyles.headerButton]).style}
|
|
284
284
|
>
|
|
@@ -303,10 +303,10 @@ export const RangeCalendar: React.FC<RangeCalendarProps> = ({
|
|
|
303
303
|
<div key={index} {...getWebProps([rangeCalendarStyles.dayCell])}>
|
|
304
304
|
{dayInfo && (
|
|
305
305
|
<Button
|
|
306
|
-
|
|
306
|
+
type="text"
|
|
307
307
|
disabled={isDateDisabled(dayInfo.date)}
|
|
308
308
|
onPress={() => handleDateClick(dayInfo.date)}
|
|
309
|
-
size="
|
|
309
|
+
size="sm"
|
|
310
310
|
style={{
|
|
311
311
|
...getWebProps([rangeCalendarStyles.dayButton]).style,
|
|
312
312
|
backgroundColor: isDateSelected(dayInfo.date)
|
|
@@ -6,7 +6,7 @@ export const dateTimePickerStyles = StyleSheet.create((theme) => ({
|
|
|
6
6
|
},
|
|
7
7
|
|
|
8
8
|
label: {
|
|
9
|
-
fontSize: theme.typography?.
|
|
9
|
+
fontSize: theme.typography?.fontSize?.sm || 14,
|
|
10
10
|
fontWeight: '600',
|
|
11
11
|
color: theme.colors?.text?.primary || '#111827',
|
|
12
12
|
marginBottom: theme.spacing?.xs || 4,
|
|
@@ -30,13 +30,13 @@ export const dateTimePickerStyles = StyleSheet.create((theme) => ({
|
|
|
30
30
|
},
|
|
31
31
|
|
|
32
32
|
selectedDateTimeLabel: {
|
|
33
|
-
fontSize: theme.typography?.
|
|
33
|
+
fontSize: theme.typography?.fontSize?.sm || 12,
|
|
34
34
|
fontWeight: '500',
|
|
35
35
|
color: theme.colors?.text?.secondary || '#6b7280',
|
|
36
36
|
},
|
|
37
37
|
|
|
38
38
|
selectedDateTimeValue: {
|
|
39
|
-
fontSize: theme.typography?.
|
|
39
|
+
fontSize: theme.typography?.fontSize?.md || 16,
|
|
40
40
|
fontWeight: '600',
|
|
41
41
|
color: theme.colors?.text?.primary || '#111827',
|
|
42
42
|
},
|
|
@@ -46,7 +46,7 @@ export const dateTimePickerStyles = StyleSheet.create((theme) => ({
|
|
|
46
46
|
},
|
|
47
47
|
|
|
48
48
|
sectionLabel: {
|
|
49
|
-
fontSize: theme.typography?.
|
|
49
|
+
fontSize: theme.typography?.fontSize?.sm || 14,
|
|
50
50
|
fontWeight: '600',
|
|
51
51
|
color: theme.colors?.text?.primary || '#111827',
|
|
52
52
|
},
|
|
@@ -64,14 +64,41 @@ export const dateTimePickerStyles = StyleSheet.create((theme) => ({
|
|
|
64
64
|
},
|
|
65
65
|
|
|
66
66
|
errorText: {
|
|
67
|
-
fontSize: theme.typography?.
|
|
67
|
+
fontSize: theme.typography?.fontSize?.sm || 12,
|
|
68
68
|
color: theme.colors?.semantic?.error || '#dc2626',
|
|
69
69
|
marginTop: theme.spacing?.xs || 4,
|
|
70
70
|
},
|
|
71
71
|
|
|
72
72
|
helperText: {
|
|
73
|
-
fontSize: theme.typography?.
|
|
73
|
+
fontSize: theme.typography?.fontSize?.sm || 12,
|
|
74
74
|
color: theme.colors?.text?.secondary || '#6b7280',
|
|
75
75
|
marginTop: theme.spacing?.xs || 4,
|
|
76
76
|
},
|
|
77
|
+
|
|
78
|
+
sideBySideLayout: {
|
|
79
|
+
flexDirection: 'row',
|
|
80
|
+
gap: theme.spacing?.md || 16,
|
|
81
|
+
alignItems: 'flex-start',
|
|
82
|
+
_web: {
|
|
83
|
+
display: 'flex',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
|
|
87
|
+
stepNavigation: {
|
|
88
|
+
flexDirection: 'row',
|
|
89
|
+
gap: theme.spacing?.xs || 8,
|
|
90
|
+
marginBottom: theme.spacing?.xs || 8,
|
|
91
|
+
_web: {
|
|
92
|
+
display: 'flex',
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
|
|
96
|
+
stepButton: {
|
|
97
|
+
flex: 1,
|
|
98
|
+
},
|
|
99
|
+
|
|
100
|
+
backButtonContainer: {
|
|
101
|
+
marginTop: theme.spacing?.sm || 12,
|
|
102
|
+
alignItems: 'flex-start',
|
|
103
|
+
},
|
|
77
104
|
}));
|