@hoddy-ui/core 2.5.6 → 2.5.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoddy-ui/next",
3
- "version": "2.0.48",
3
+ "version": "2.0.49",
4
4
  "description": "Core rich react native components written in typescript, with support for expo-router",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoddy-ui/core",
3
- "version": "2.5.6",
3
+ "version": "2.5.8",
4
4
  "description": "Core rich react native components written in typescript",
5
5
  "main": "index.ts",
6
6
  "repository": {
@@ -17,18 +17,19 @@ import Animated, {
17
17
  useSharedValue,
18
18
  withTiming,
19
19
  } from "react-native-reanimated";
20
- import { ScaledSheet } from "react-native-size-matters";
20
+ import { ms, ScaledSheet } from "react-native-size-matters";
21
21
  import { useColors, useTheme } from "../hooks";
22
22
  import { UIThemeProvider } from "../theme";
23
23
  import { PopupProps } from "../types";
24
24
  import { IconButton } from "./Button";
25
25
  import Typography from "./Typography";
26
+ import { useSafeAreaInsets } from "react-native-safe-area-context";
26
27
 
27
28
  export const Popup: React.FC<PopupProps> = ({
28
29
  title,
29
30
  sheet,
30
31
  bare = false,
31
- keyboardVerticalOffset,
32
+ keyboardVerticalOffset = -10,
32
33
  children,
33
34
  open,
34
35
  onClose = () => {},
@@ -39,6 +40,7 @@ export const Popup: React.FC<PopupProps> = ({
39
40
  const theme = useTheme();
40
41
  const colors = useColors();
41
42
  const [modalVisible, setModalVisible] = useState(false);
43
+ const { bottom } = useSafeAreaInsets();
42
44
 
43
45
  // Animation values
44
46
  const backdropOpacity = useSharedValue(0);
@@ -82,22 +84,26 @@ export const Popup: React.FC<PopupProps> = ({
82
84
  width: "100%",
83
85
  justifyContent: sheet ? "flex-end" : "center",
84
86
  },
87
+ keyboardView: {
88
+ flex: 1,
89
+ },
85
90
  avoidingView: {
86
91
  minHeight: typeof sheet === "number" ? sheet : undefined,
87
- maxHeight: "80%",
92
+ maxHeight: "90%",
88
93
  zIndex: 1000,
89
94
  alignSelf: "center",
90
95
  maxWidth: sheet ? undefined : "90%",
91
96
  width: sheet ? "100%" : undefined,
92
97
  },
93
98
  container: {
94
- paddingBottom: sheet ? "30@ms" : undefined,
95
- backgroundColor: theme === "dark" ? "#111" : colors.white[2],
99
+ paddingBottom: sheet && !bare ? bottom + ms(10) : undefined,
100
+ backgroundColor: theme === "dark" ? "#111" : colors.white[1],
96
101
  borderTopLeftRadius: 20,
97
102
  borderTopRightRadius: 20,
98
103
  borderBottomRightRadius: sheet ? 0 : 20,
99
104
  borderBottomLeftRadius: sheet ? 0 : 20,
100
105
  width: "100%",
106
+ overflow: "hidden",
101
107
  ...style,
102
108
  },
103
109
  content: {
@@ -135,20 +141,24 @@ export const Popup: React.FC<PopupProps> = ({
135
141
  onRequestClose={closeAction}
136
142
  >
137
143
  <UIThemeProvider>
138
- <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
139
- <View style={styles.root}>
140
- <Animated.View style={[styles.backdrop, backdropAnimatedStyle]} />
141
- {open && (
142
- <Pressable
143
- style={[StyleSheet.absoluteFill, { zIndex: 2 }]}
144
- onPress={closeAction}
145
- />
146
- )}
144
+ <KeyboardAvoidingView
145
+ style={styles.keyboardView}
146
+ behavior={Platform.OS === "ios" ? "padding" : undefined}
147
+ keyboardVerticalOffset={keyboardVerticalOffset}
148
+ >
149
+ <TouchableWithoutFeedback onPress={Keyboard.dismiss}>
150
+ <View style={styles.root}>
151
+ <Animated.View style={[styles.backdrop, backdropAnimatedStyle]} />
152
+ {open && (
153
+ <Pressable
154
+ style={[StyleSheet.absoluteFill, { zIndex: 2 }]}
155
+ onPress={closeAction}
156
+ />
157
+ )}
147
158
 
148
- <Animated.View style={[styles.avoidingView, contentAnimatedStyle]}>
149
- <KeyboardAvoidingView
150
- keyboardVerticalOffset={keyboardVerticalOffset}
151
- behavior={Platform.OS === "ios" ? "padding" : "padding"}
159
+ <Animated.View
160
+ style={[styles.avoidingView, contentAnimatedStyle]}
161
+ layout={LinearTransition}
152
162
  >
153
163
  <Animated.View
154
164
  layout={LinearTransition}
@@ -171,10 +181,10 @@ export const Popup: React.FC<PopupProps> = ({
171
181
 
172
182
  <View style={styles.content}>{children}</View>
173
183
  </Animated.View>
174
- </KeyboardAvoidingView>
175
- </Animated.View>
176
- </View>
177
- </TouchableWithoutFeedback>
184
+ </Animated.View>
185
+ </View>
186
+ </TouchableWithoutFeedback>
187
+ </KeyboardAvoidingView>
178
188
  </UIThemeProvider>
179
189
  </Modal>
180
190
  );
@@ -413,7 +413,7 @@ export const TextField2 = React.forwardRef<TextInput, TextFieldProps>(
413
413
  <View style={styles.root}>
414
414
  {label && (
415
415
  <Typography
416
- variant="body1"
416
+ variant="body2"
417
417
  color="textSecondary"
418
418
  gutterBottom={7}
419
419
  {...labelProps}