@ornikar/kitt-universal 5.0.0 → 5.0.1

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.
@@ -10,9 +10,9 @@ const jsxRuntime = require('react/jsx-runtime');
10
10
  const Animated = require('react-native-reanimated');
11
11
  const twemojiParser = require('twemoji-parser');
12
12
  const WebBrowser = require('expo-web-browser');
13
+ const DateTimePicker = require('@react-native-community/datetimepicker');
13
14
  const reactIntl = require('react-intl');
14
15
  const react$1 = require('@linaria/react');
15
- const DateTimePicker = require('@react-native-community/datetimepicker');
16
16
  const reactNativeSafeAreaContext = require('react-native-safe-area-context');
17
17
  const expoLinearGradient = require('expo-linear-gradient');
18
18
  const reactNative$1 = require('@floating-ui/react-native');
@@ -1702,6 +1702,51 @@ function DatePickerInputs({
1702
1702
  });
1703
1703
  }
1704
1704
 
1705
+ function DatePickerAndroid({
1706
+ onBlur,
1707
+ onFocus,
1708
+ pickerDefaultDate,
1709
+ pickerUITestID,
1710
+ setIsFocused,
1711
+ currentValue,
1712
+ setCurrentValue,
1713
+ onChange,
1714
+ isFocused,
1715
+ ...props
1716
+ }) {
1717
+ const handleClose = () => {
1718
+ if (onBlur) onBlur();
1719
+ };
1720
+
1721
+ return /*#__PURE__*/jsxRuntime.jsx(DatePickerInputs, {
1722
+ handleModalOpen: () => {
1723
+ setIsFocused(true);
1724
+ if (onFocus) onFocus();
1725
+ DateTimePicker.DateTimePickerAndroid.open({
1726
+ testID: pickerUITestID,
1727
+ value: currentValue || pickerDefaultDate || new Date(Date.now()),
1728
+ onChange: e => {
1729
+ setIsFocused(false);
1730
+ const {
1731
+ timestamp
1732
+ } = e.nativeEvent;
1733
+
1734
+ if (timestamp) {
1735
+ const date = new Date(timestamp);
1736
+ setCurrentValue(date);
1737
+ onChange(date);
1738
+ handleClose();
1739
+ }
1740
+ },
1741
+ onTouchCancel: handleClose
1742
+ });
1743
+ },
1744
+ currentValue: currentValue,
1745
+ isFocused: isFocused,
1746
+ ...props
1747
+ });
1748
+ }
1749
+
1705
1750
  // Don't use styled.Pressable here - babel-plugin-styled-components-react-native-web only supports tagged templates
1706
1751
  const OverlayPressable = /*#__PURE__*/styled__default(reactNative.Pressable).withConfig({
1707
1752
  displayName: "Overlay__OverlayPressable",
@@ -2247,6 +2292,20 @@ function DatePicker({
2247
2292
  const [isFocused, setIsFocused] = react.useState(false);
2248
2293
  const [currentValue, setCurrentValue] = react.useState(value);
2249
2294
 
2295
+ if (reactNative.Platform.OS === 'android') {
2296
+ return /*#__PURE__*/jsxRuntime.jsx(DatePickerAndroid, {
2297
+ pickerDefaultDate: pickerDefaultDate,
2298
+ pickerUITestID: pickerUITestID,
2299
+ currentValue: currentValue,
2300
+ setCurrentValue: setCurrentValue,
2301
+ isFocused: isFocused,
2302
+ setIsFocused: setIsFocused,
2303
+ onChange: onChange,
2304
+ onBlur: onBlur,
2305
+ ...props
2306
+ });
2307
+ }
2308
+
2250
2309
  const handleModalClose = () => {
2251
2310
  if (onBlur) onBlur();
2252
2311
  setIsPickerUIVisible(false);