@umituz/react-native-design-system 1.5.31 → 1.5.33
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umituz/react-native-design-system",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.33",
|
|
4
4
|
"description": "Universal design system for React Native apps - Domain-Driven Design architecture with Material Design 3 components",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -49,7 +49,7 @@ import DateTimePicker, { DateTimePickerEvent } from '@react-native-community/dat
|
|
|
49
49
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
50
50
|
import { useAppDesignTokens } from '@umituz/react-native-theme';
|
|
51
51
|
import { AtomicIcon, type AtomicIconColor } from './AtomicIcon';
|
|
52
|
-
import {
|
|
52
|
+
import { BottomSheetModal, useBottomSheetModal } from '@umituz/react-native-bottom-sheet';
|
|
53
53
|
import { AtomicButton } from './AtomicButton';
|
|
54
54
|
|
|
55
55
|
/**
|
|
@@ -103,7 +103,7 @@ export const AtomicDatePicker: React.FC<AtomicDatePickerProps> = ({
|
|
|
103
103
|
const tokens = useAppDesignTokens();
|
|
104
104
|
const { height } = useWindowDimensions();
|
|
105
105
|
const insets = useSafeAreaInsets();
|
|
106
|
-
const {
|
|
106
|
+
const { modalRef, present, dismiss } = useBottomSheetModal();
|
|
107
107
|
const [tempDate, setTempDate] = useState<Date>(value || new Date());
|
|
108
108
|
|
|
109
109
|
// Update tempDate when value prop changes
|
|
@@ -128,7 +128,7 @@ export const AtomicDatePicker: React.FC<AtomicDatePickerProps> = ({
|
|
|
128
128
|
*/
|
|
129
129
|
const handleDone = () => {
|
|
130
130
|
onChange(tempDate);
|
|
131
|
-
|
|
131
|
+
dismiss();
|
|
132
132
|
};
|
|
133
133
|
|
|
134
134
|
/**
|
|
@@ -136,7 +136,7 @@ export const AtomicDatePicker: React.FC<AtomicDatePickerProps> = ({
|
|
|
136
136
|
*/
|
|
137
137
|
const handleOpen = () => {
|
|
138
138
|
setTempDate(value || new Date());
|
|
139
|
-
|
|
139
|
+
present();
|
|
140
140
|
};
|
|
141
141
|
|
|
142
142
|
/**
|
|
@@ -205,7 +205,7 @@ export const AtomicDatePicker: React.FC<AtomicDatePickerProps> = ({
|
|
|
205
205
|
accessibilityState={{ disabled }}
|
|
206
206
|
>
|
|
207
207
|
<AtomicIcon
|
|
208
|
-
name="
|
|
208
|
+
name="Calendar"
|
|
209
209
|
color={getIconColor()}
|
|
210
210
|
size="md"
|
|
211
211
|
/>
|
|
@@ -227,13 +227,13 @@ export const AtomicDatePicker: React.FC<AtomicDatePickerProps> = ({
|
|
|
227
227
|
)}
|
|
228
228
|
|
|
229
229
|
{/* Bottom Sheet DatePicker */}
|
|
230
|
-
<
|
|
231
|
-
ref={
|
|
230
|
+
<BottomSheetModal
|
|
231
|
+
ref={modalRef}
|
|
232
232
|
preset="medium"
|
|
233
233
|
enableBackdrop
|
|
234
234
|
enablePanDownToClose
|
|
235
235
|
enableHandleIndicator
|
|
236
|
-
|
|
236
|
+
onDismiss={() => {
|
|
237
237
|
// Reset temp date when closed without saving
|
|
238
238
|
setTempDate(value || new Date());
|
|
239
239
|
}}
|
|
@@ -258,7 +258,7 @@ export const AtomicDatePicker: React.FC<AtomicDatePickerProps> = ({
|
|
|
258
258
|
/>
|
|
259
259
|
</View>
|
|
260
260
|
</View>
|
|
261
|
-
</
|
|
261
|
+
</BottomSheetModal>
|
|
262
262
|
</View>
|
|
263
263
|
);
|
|
264
264
|
};
|