@hoddy-ui/core 1.0.79 → 1.0.81
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/package.json +1 -1
- package/src/Components/Popup.tsx +36 -25
- package/src/types.ts +2 -1
package/package.json
CHANGED
package/src/Components/Popup.tsx
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
|
+
Keyboard,
|
|
2
3
|
KeyboardAvoidingView,
|
|
3
4
|
Modal,
|
|
5
|
+
Platform,
|
|
4
6
|
Pressable,
|
|
5
7
|
StyleSheet,
|
|
8
|
+
TouchableWithoutFeedback,
|
|
6
9
|
View,
|
|
7
10
|
} from "react-native";
|
|
8
11
|
|
|
@@ -17,6 +20,7 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
17
20
|
title,
|
|
18
21
|
sheet,
|
|
19
22
|
bare = false,
|
|
23
|
+
keyboardVerticalOffset,
|
|
20
24
|
children,
|
|
21
25
|
open,
|
|
22
26
|
onClose = () => {},
|
|
@@ -99,34 +103,41 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
99
103
|
visible={showSecondary}
|
|
100
104
|
onRequestClose={closeAction}
|
|
101
105
|
>
|
|
102
|
-
<
|
|
103
|
-
{
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
<TouchableWithoutFeedback onPress={Keyboard.dismiss}>
|
|
107
|
+
<View style={styles.root}>
|
|
108
|
+
{open && (
|
|
109
|
+
<Pressable
|
|
110
|
+
style={StyleSheet.absoluteFill}
|
|
111
|
+
onPress={closeAction}
|
|
112
|
+
/>
|
|
113
|
+
)}
|
|
109
114
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
{
|
|
116
|
-
|
|
117
|
-
<
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
115
|
+
<KeyboardAvoidingView
|
|
116
|
+
style={styles.avoidingView}
|
|
117
|
+
keyboardVerticalOffset={keyboardVerticalOffset}
|
|
118
|
+
behavior={Platform.OS === "ios" ? "position" : "padding"}
|
|
119
|
+
>
|
|
120
|
+
<View style={styles.container}>
|
|
121
|
+
{!bare && (
|
|
122
|
+
<View style={styles.title}>
|
|
123
|
+
<IconButton
|
|
124
|
+
size={20}
|
|
125
|
+
icon="close"
|
|
126
|
+
onPress={closeAction}
|
|
127
|
+
/>
|
|
128
|
+
<View style={{ flex: 1 }}>
|
|
129
|
+
<Typography color="textSecondary" align="center">
|
|
130
|
+
{title}
|
|
131
|
+
</Typography>
|
|
132
|
+
</View>
|
|
122
133
|
</View>
|
|
123
|
-
|
|
124
|
-
)}
|
|
134
|
+
)}
|
|
125
135
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
136
|
+
<View style={styles.content}>{children}</View>
|
|
137
|
+
</View>
|
|
138
|
+
</KeyboardAvoidingView>
|
|
139
|
+
</View>
|
|
140
|
+
</TouchableWithoutFeedback>
|
|
130
141
|
</Modal>
|
|
131
142
|
</Modal>
|
|
132
143
|
</>
|
package/src/types.ts
CHANGED
|
@@ -210,6 +210,7 @@ export interface GridProps {
|
|
|
210
210
|
}
|
|
211
211
|
export interface PopupProps {
|
|
212
212
|
title?: string;
|
|
213
|
+
keyboardVerticalOffset?: number;
|
|
213
214
|
sheet?: number | boolean;
|
|
214
215
|
bare?: boolean;
|
|
215
216
|
children: ReactNode;
|
|
@@ -253,7 +254,7 @@ export interface TextFieldProps extends TextInputProps {
|
|
|
253
254
|
|
|
254
255
|
export interface TypographyProps {
|
|
255
256
|
children: ReactNode;
|
|
256
|
-
color?: colorTypes;
|
|
257
|
+
color?: colorTypes & string;
|
|
257
258
|
style?: TextStyle | ViewStyle;
|
|
258
259
|
textCase?: "capitalize" | "uppercase" | "lowercase" | null;
|
|
259
260
|
variant?:
|