@hoddy-ui/core 2.5.9 → 2.5.10
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/next/dist/index.js +27 -6
- package/next/dist/index.js.map +1 -1
- package/next/dist/index.mjs +27 -6
- package/next/dist/index.mjs.map +1 -1
- package/next/package.json +1 -1
- package/package.json +1 -1
- package/src/Components/Popup.tsx +34 -6
package/next/dist/index.mjs
CHANGED
|
@@ -890,13 +890,13 @@ import Animated2, {
|
|
|
890
890
|
useSharedValue as useSharedValue2,
|
|
891
891
|
withTiming as withTiming2
|
|
892
892
|
} from "react-native-reanimated";
|
|
893
|
-
import { ms as ms5, ScaledSheet as ScaledSheet7 } from "react-native-size-matters";
|
|
894
893
|
import { useSafeAreaInsets as useSafeAreaInsets2 } from "react-native-safe-area-context";
|
|
894
|
+
import { ms as ms5, ScaledSheet as ScaledSheet7 } from "react-native-size-matters";
|
|
895
895
|
var Popup = ({
|
|
896
896
|
title,
|
|
897
897
|
sheet,
|
|
898
898
|
bare = false,
|
|
899
|
-
keyboardVerticalOffset
|
|
899
|
+
keyboardVerticalOffset,
|
|
900
900
|
children,
|
|
901
901
|
open,
|
|
902
902
|
onClose = () => {
|
|
@@ -908,9 +908,29 @@ var Popup = ({
|
|
|
908
908
|
const theme = useTheme();
|
|
909
909
|
const colors2 = useColors();
|
|
910
910
|
const [modalVisible, setModalVisible] = useState3(false);
|
|
911
|
+
const [keyboardVisible, setKeyboardVisible] = useState3(false);
|
|
911
912
|
const { bottom } = useSafeAreaInsets2();
|
|
912
913
|
const backdropOpacity = useSharedValue2(0);
|
|
913
914
|
const contentTranslateY = useSharedValue2(1e3);
|
|
915
|
+
const keyboardVerticalOffsetValue = Platform5.OS === "ios" ? -10 : -bottom * 2;
|
|
916
|
+
useEffect2(() => {
|
|
917
|
+
const keyboardDidShowListener = Keyboard2.addListener(
|
|
918
|
+
"keyboardDidShow",
|
|
919
|
+
() => {
|
|
920
|
+
setKeyboardVisible(true);
|
|
921
|
+
}
|
|
922
|
+
);
|
|
923
|
+
const keyboardDidHideListener = Keyboard2.addListener(
|
|
924
|
+
"keyboardDidHide",
|
|
925
|
+
() => {
|
|
926
|
+
setKeyboardVisible(false);
|
|
927
|
+
}
|
|
928
|
+
);
|
|
929
|
+
return () => {
|
|
930
|
+
keyboardDidHideListener?.remove();
|
|
931
|
+
keyboardDidShowListener?.remove();
|
|
932
|
+
};
|
|
933
|
+
}, []);
|
|
914
934
|
useEffect2(() => {
|
|
915
935
|
if (open) {
|
|
916
936
|
setModalVisible(true);
|
|
@@ -951,7 +971,8 @@ var Popup = ({
|
|
|
951
971
|
zIndex: 1e3,
|
|
952
972
|
alignSelf: "center",
|
|
953
973
|
maxWidth: sheet ? void 0 : "90%",
|
|
954
|
-
width: sheet ? "100%" : void 0
|
|
974
|
+
width: sheet ? "100%" : void 0,
|
|
975
|
+
marginBottom: Platform5.OS === "android" && keyboardVisible ? bottom : 0
|
|
955
976
|
},
|
|
956
977
|
container: {
|
|
957
978
|
paddingBottom: sheet && !bare ? bottom + ms5(10) : void 0,
|
|
@@ -1002,7 +1023,7 @@ var Popup = ({
|
|
|
1002
1023
|
{
|
|
1003
1024
|
style: styles2.keyboardView,
|
|
1004
1025
|
behavior: Platform5.OS === "ios" ? "padding" : "height",
|
|
1005
|
-
keyboardVerticalOffset
|
|
1026
|
+
keyboardVerticalOffset: keyboardVerticalOffset || keyboardVerticalOffsetValue
|
|
1006
1027
|
},
|
|
1007
1028
|
/* @__PURE__ */ React11.createElement(TouchableWithoutFeedback2, { onPress: Keyboard2.dismiss }, /* @__PURE__ */ React11.createElement(View5, { style: styles2.root }, /* @__PURE__ */ React11.createElement(Animated2.View, { style: [styles2.backdrop, backdropAnimatedStyle] }), open && /* @__PURE__ */ React11.createElement(
|
|
1008
1029
|
Pressable,
|
|
@@ -1014,10 +1035,10 @@ var Popup = ({
|
|
|
1014
1035
|
Animated2.View,
|
|
1015
1036
|
{
|
|
1016
1037
|
style: [styles2.avoidingView, contentAnimatedStyle],
|
|
1017
|
-
layout: LinearTransition
|
|
1038
|
+
layout: LinearTransition.springify(1)
|
|
1018
1039
|
},
|
|
1019
1040
|
/* @__PURE__ */ React11.createElement(
|
|
1020
|
-
|
|
1041
|
+
View5,
|
|
1021
1042
|
{
|
|
1022
1043
|
style: styles2.container
|
|
1023
1044
|
},
|