@hoddy-ui/core 2.5.9 → 2.5.11
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 +39 -24
- package/next/dist/index.js.map +1 -1
- package/next/dist/index.mjs +39 -24
- package/next/dist/index.mjs.map +1 -1
- package/next/package.json +1 -1
- package/package.json +1 -1
- package/src/Components/Animators/hooks/useFadeAnimation.ts +1 -3
- package/src/Components/Animators/hooks/useFloatAnimation.ts +9 -9
- package/src/Components/Animators/hooks/useGrowAnimation.ts +5 -4
- package/src/Components/Animators/hooks/useRollAnimation.ts +10 -6
- package/src/Components/Animators/hooks/useSlideAnimation.ts +5 -8
- package/src/Components/Animators/hooks/useThrownUpAnimation.ts +9 -12
- package/src/Components/Popup.tsx +44 -12
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" ? -bottom : -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);
|
|
@@ -979,15 +999,17 @@ var Popup = ({
|
|
|
979
999
|
justifyContent: sheet ? "flex-end" : "center"
|
|
980
1000
|
},
|
|
981
1001
|
keyboardView: {
|
|
982
|
-
flex: 1
|
|
1002
|
+
flex: 1,
|
|
1003
|
+
zIndex: 1e3
|
|
983
1004
|
},
|
|
984
1005
|
avoidingView: {
|
|
1006
|
+
zIndex: 2,
|
|
985
1007
|
minHeight: typeof sheet === "number" ? sheet : void 0,
|
|
986
1008
|
maxHeight: "90%",
|
|
987
|
-
zIndex: 1e3,
|
|
988
1009
|
alignSelf: "center",
|
|
989
1010
|
maxWidth: sheet ? void 0 : "90%",
|
|
990
|
-
width: sheet ? "100%" : void 0
|
|
1011
|
+
width: sheet ? "100%" : void 0,
|
|
1012
|
+
marginBottom: import_react_native11.Platform.OS === "android" && keyboardVisible ? bottom : 0
|
|
991
1013
|
},
|
|
992
1014
|
container: {
|
|
993
1015
|
paddingBottom: sheet && !bare ? bottom + (0, import_react_native_size_matters9.ms)(10) : void 0,
|
|
@@ -1033,40 +1055,33 @@ var Popup = ({
|
|
|
1033
1055
|
visible: modalVisible,
|
|
1034
1056
|
onRequestClose: closeAction
|
|
1035
1057
|
},
|
|
1036
|
-
/* @__PURE__ */ import_react11.default.createElement(UIThemeProvider, null, /* @__PURE__ */ import_react11.default.createElement(
|
|
1058
|
+
/* @__PURE__ */ import_react11.default.createElement(UIThemeProvider, null, /* @__PURE__ */ import_react11.default.createElement(import_react_native_reanimated2.default.View, { style: [styles2.backdrop, backdropAnimatedStyle] }), /* @__PURE__ */ import_react11.default.createElement(
|
|
1037
1059
|
import_react_native11.KeyboardAvoidingView,
|
|
1038
1060
|
{
|
|
1039
1061
|
style: styles2.keyboardView,
|
|
1040
1062
|
behavior: import_react_native11.Platform.OS === "ios" ? "padding" : "height",
|
|
1041
|
-
keyboardVerticalOffset
|
|
1063
|
+
keyboardVerticalOffset: keyboardVerticalOffset || keyboardVerticalOffsetValue
|
|
1042
1064
|
},
|
|
1043
|
-
/* @__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 },
|
|
1065
|
+
/* @__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 }, open && /* @__PURE__ */ import_react11.default.createElement(
|
|
1044
1066
|
import_react_native11.Pressable,
|
|
1045
1067
|
{
|
|
1046
|
-
style: [import_react_native11.StyleSheet.absoluteFill, { zIndex:
|
|
1068
|
+
style: [import_react_native11.StyleSheet.absoluteFill, { zIndex: 1 }],
|
|
1047
1069
|
onPress: closeAction
|
|
1048
1070
|
}
|
|
1049
1071
|
), /* @__PURE__ */ import_react11.default.createElement(
|
|
1050
1072
|
import_react_native_reanimated2.default.View,
|
|
1051
1073
|
{
|
|
1052
1074
|
style: [styles2.avoidingView, contentAnimatedStyle],
|
|
1053
|
-
layout: import_react_native_reanimated2.LinearTransition
|
|
1075
|
+
layout: import_react_native_reanimated2.LinearTransition.springify().stiffness(200).mass(0.5).damping(100)
|
|
1054
1076
|
},
|
|
1055
|
-
/* @__PURE__ */ import_react11.default.createElement(
|
|
1056
|
-
|
|
1077
|
+
/* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.container }, !bare && /* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.title }, /* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.titleIcon }, /* @__PURE__ */ import_react11.default.createElement(
|
|
1078
|
+
IconButton,
|
|
1057
1079
|
{
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
size: 20,
|
|
1064
|
-
icon: "close",
|
|
1065
|
-
onPress: closeAction
|
|
1066
|
-
}
|
|
1067
|
-
)), /* @__PURE__ */ import_react11.default.createElement(Typography_default, { align: "center", fontWeight: 500 }, title)),
|
|
1068
|
-
/* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.content }, children)
|
|
1069
|
-
)
|
|
1080
|
+
size: 20,
|
|
1081
|
+
icon: "close",
|
|
1082
|
+
onPress: closeAction
|
|
1083
|
+
}
|
|
1084
|
+
)), /* @__PURE__ */ import_react11.default.createElement(Typography_default, { align: "center", fontWeight: 500 }, title)), /* @__PURE__ */ import_react11.default.createElement(import_react_native11.View, { style: styles2.content }, children))
|
|
1070
1085
|
)))
|
|
1071
1086
|
))
|
|
1072
1087
|
);
|