@umituz/react-native-design-system 1.5.34 → 1.5.36

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.34",
3
+ "version": "1.5.36",
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",
@@ -44,6 +44,8 @@ import {
44
44
  TouchableOpacity,
45
45
  StyleSheet,
46
46
  useWindowDimensions,
47
+ type StyleProp,
48
+ type ViewStyle,
47
49
  } from 'react-native';
48
50
  import DateTimePicker, { DateTimePickerEvent } from '@react-native-community/datetimepicker';
49
51
  import { useSafeAreaInsets } from 'react-native-safe-area-context';
@@ -58,7 +60,7 @@ import { AtomicButton } from './AtomicButton';
58
60
  */
59
61
  export interface AtomicDatePickerProps {
60
62
  /** Selected date value */
61
- value: Date;
63
+ value: Date | null;
62
64
  /** Callback when date changes */
63
65
  onChange: (date: Date) => void;
64
66
  /** Optional label displayed above picker */
@@ -77,6 +79,8 @@ export interface AtomicDatePickerProps {
77
79
  placeholder?: string;
78
80
  /** Optional test ID for E2E testing */
79
81
  testID?: string;
82
+ /** Optional container style */
83
+ style?: StyleProp<ViewStyle>;
80
84
  }
81
85
 
82
86
  /**
@@ -100,12 +104,13 @@ export const AtomicDatePicker: React.FC<AtomicDatePickerProps> = ({
100
104
  mode = 'date',
101
105
  placeholder = 'Select date',
102
106
  testID,
107
+ style,
103
108
  }) => {
104
109
  const tokens = useAppDesignTokens();
105
110
  const { height } = useWindowDimensions();
106
111
  const insets = useSafeAreaInsets();
107
112
  const { modalRef, present, dismiss } = useBottomSheetModal();
108
- const [tempDate, setTempDate] = useState<Date>(value || new Date());
113
+ const [tempDate, setTempDate] = useState<Date>(value ?? new Date());
109
114
 
110
115
  // Update tempDate when value prop changes
111
116
  useEffect(() => {
@@ -136,7 +141,7 @@ export const AtomicDatePicker: React.FC<AtomicDatePickerProps> = ({
136
141
  * Handle open - reset temp date to current value
137
142
  */
138
143
  const handleOpen = () => {
139
- setTempDate(value || new Date());
144
+ setTempDate(value ?? new Date());
140
145
  present();
141
146
  };
142
147
 
@@ -185,7 +190,7 @@ export const AtomicDatePicker: React.FC<AtomicDatePickerProps> = ({
185
190
  const styles = getStyles(tokens, height, insets);
186
191
 
187
192
  return (
188
- <View style={styles.container} testID={testID}>
193
+ <View style={[styles.container, style]} testID={testID}>
189
194
  {label && (
190
195
  <Text style={styles.label} testID={testID ? `${testID}-label` : undefined}>
191
196
  {label}
@@ -236,7 +241,7 @@ export const AtomicDatePicker: React.FC<AtomicDatePickerProps> = ({
236
241
  enableHandleIndicator
237
242
  onDismiss={() => {
238
243
  // Reset temp date when closed without saving
239
- setTempDate(value || new Date());
244
+ setTempDate(value ?? new Date());
240
245
  }}
241
246
  >
242
247
  <View style={styles.bottomSheetContent}>