@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.js
CHANGED
|
@@ -926,13 +926,13 @@ var import_react_native_size_matters10 = require("react-native-size-matters");
|
|
|
926
926
|
var import_react_native11 = require("react-native");
|
|
927
927
|
var import_react11 = __toESM(require("react"));
|
|
928
928
|
var import_react_native_reanimated2 = __toESM(require("react-native-reanimated"));
|
|
929
|
-
var import_react_native_size_matters9 = require("react-native-size-matters");
|
|
930
929
|
var import_react_native_safe_area_context3 = require("react-native-safe-area-context");
|
|
930
|
+
var import_react_native_size_matters9 = require("react-native-size-matters");
|
|
931
931
|
var Popup = ({
|
|
932
932
|
title,
|
|
933
933
|
sheet,
|
|
934
934
|
bare = false,
|
|
935
|
-
keyboardVerticalOffset
|
|
935
|
+
keyboardVerticalOffset,
|
|
936
936
|
children,
|
|
937
937
|
open,
|
|
938
938
|
onClose = () => {
|
|
@@ -944,9 +944,29 @@ var Popup = ({
|
|
|
944
944
|
const theme = useTheme();
|
|
945
945
|
const colors2 = useColors();
|
|
946
946
|
const [modalVisible, setModalVisible] = (0, import_react11.useState)(false);
|
|
947
|
+
const [keyboardVisible, setKeyboardVisible] = (0, import_react11.useState)(false);
|
|
947
948
|
const { bottom } = (0, import_react_native_safe_area_context3.useSafeAreaInsets)();
|
|
948
949
|
const backdropOpacity = (0, import_react_native_reanimated2.useSharedValue)(0);
|
|
949
950
|
const contentTranslateY = (0, import_react_native_reanimated2.useSharedValue)(1e3);
|
|
951
|
+
const keyboardVerticalOffsetValue = import_react_native11.Platform.OS === "ios" ? -10 : -bottom * 2;
|
|
952
|
+
(0, import_react11.useEffect)(() => {
|
|
953
|
+
const keyboardDidShowListener = import_react_native11.Keyboard.addListener(
|
|
954
|
+
"keyboardDidShow",
|
|
955
|
+
() => {
|
|
956
|
+
setKeyboardVisible(true);
|
|
957
|
+
}
|
|
958
|
+
);
|
|
959
|
+
const keyboardDidHideListener = import_react_native11.Keyboard.addListener(
|
|
960
|
+
"keyboardDidHide",
|
|
961
|
+
() => {
|
|
962
|
+
setKeyboardVisible(false);
|
|
963
|
+
}
|
|
964
|
+
);
|
|
965
|
+
return () => {
|
|
966
|
+
keyboardDidHideListener?.remove();
|
|
967
|
+
keyboardDidShowListener?.remove();
|
|
968
|
+
};
|
|
969
|
+
}, []);
|
|
950
970
|
(0, import_react11.useEffect)(() => {
|
|
951
971
|
if (open) {
|
|
952
972
|
setModalVisible(true);
|
|
@@ -987,7 +1007,8 @@ var Popup = ({
|
|
|
987
1007
|
zIndex: 1e3,
|
|
988
1008
|
alignSelf: "center",
|
|
989
1009
|
maxWidth: sheet ? void 0 : "90%",
|
|
990
|
-
width: sheet ? "100%" : void 0
|
|
1010
|
+
width: sheet ? "100%" : void 0,
|
|
1011
|
+
marginBottom: import_react_native11.Platform.OS === "android" && keyboardVisible ? bottom : 0
|
|
991
1012
|
},
|
|
992
1013
|
container: {
|
|
993
1014
|
paddingBottom: sheet && !bare ? bottom + (0, import_react_native_size_matters9.ms)(10) : void 0,
|
|
@@ -1038,7 +1059,7 @@ var Popup = ({
|
|
|
1038
1059
|
{
|
|
1039
1060
|
style: styles2.keyboardView,
|
|
1040
1061
|
behavior: import_react_native11.Platform.OS === "ios" ? "padding" : "height",
|
|
1041
|
-
keyboardVerticalOffset
|
|
1062
|
+
keyboardVerticalOffset: keyboardVerticalOffset || keyboardVerticalOffsetValue
|
|
1042
1063
|
},
|
|
1043
1064
|
/* @__PURE__ */ import_react11.default.createElement(import_react_native11.TouchableWithoutFeedback, { onPress: import_react_native11.Keyboard.dismiss }, /* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.root }, /* @__PURE__ */ import_react11.default.createElement(import_react_native_reanimated2.default.View, { style: [styles2.backdrop, backdropAnimatedStyle] }), open && /* @__PURE__ */ import_react11.default.createElement(
|
|
1044
1065
|
import_react_native11.Pressable,
|
|
@@ -1050,10 +1071,10 @@ var Popup = ({
|
|
|
1050
1071
|
import_react_native_reanimated2.default.View,
|
|
1051
1072
|
{
|
|
1052
1073
|
style: [styles2.avoidingView, contentAnimatedStyle],
|
|
1053
|
-
layout: import_react_native_reanimated2.LinearTransition
|
|
1074
|
+
layout: import_react_native_reanimated2.LinearTransition.springify(1)
|
|
1054
1075
|
},
|
|
1055
1076
|
/* @__PURE__ */ import_react11.default.createElement(
|
|
1056
|
-
|
|
1077
|
+
import_react_native11.View,
|
|
1057
1078
|
{
|
|
1058
1079
|
style: styles2.container
|
|
1059
1080
|
},
|