@hoddy-ui/core 2.5.37 → 2.5.39
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.d.mts +6 -1
- package/next/dist/index.d.ts +6 -1
- package/next/dist/index.js +62 -43
- package/next/dist/index.js.map +1 -1
- package/next/dist/index.mjs +104 -85
- package/next/dist/index.mjs.map +1 -1
- package/next/package.json +1 -1
- package/package.json +1 -1
- package/src/Components/Divider.tsx +1 -1
- package/src/Components/Popup.tsx +8 -1
- package/src/Components/SelectMenu.tsx +22 -16
- package/src/Components/StarRating.tsx +35 -36
- package/src/Components/TextField.tsx +15 -2
- package/src/theme/index.tsx +6 -2
package/next/package.json
CHANGED
package/package.json
CHANGED
package/src/Components/Popup.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
Dimensions,
|
|
2
3
|
Keyboard,
|
|
3
4
|
KeyboardAvoidingView,
|
|
4
5
|
Modal,
|
|
@@ -134,7 +135,7 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
134
135
|
marginBottom: Platform.OS === "android" && keyboardVisible ? bottom : 0,
|
|
135
136
|
},
|
|
136
137
|
container: {
|
|
137
|
-
paddingBottom: sheet && !bare ? bottom + ms(
|
|
138
|
+
paddingBottom: sheet && !bare ? bottom + ms(0) : undefined,
|
|
138
139
|
backgroundColor: theme === "dark" ? "#111" : colors.white[1],
|
|
139
140
|
borderTopLeftRadius: 20,
|
|
140
141
|
borderTopRightRadius: 20,
|
|
@@ -145,7 +146,12 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
145
146
|
...style,
|
|
146
147
|
},
|
|
147
148
|
content: {
|
|
149
|
+
maxHeight:
|
|
150
|
+
sheet && !bare
|
|
151
|
+
? Dimensions.get("screen").height * 0.9 - bottom - ms(60)
|
|
152
|
+
: undefined,
|
|
148
153
|
paddingHorizontal: bare ? undefined : "15@ms",
|
|
154
|
+
// backgroundColor : "#f94",
|
|
149
155
|
},
|
|
150
156
|
title: {
|
|
151
157
|
flexDirection: "row",
|
|
@@ -177,6 +183,7 @@ export const Popup: React.FC<PopupProps> = ({
|
|
|
177
183
|
statusBarTranslucent
|
|
178
184
|
visible={modalOpen}
|
|
179
185
|
onRequestClose={closeAction}
|
|
186
|
+
navigationBarTranslucent
|
|
180
187
|
>
|
|
181
188
|
<UIThemeProvider>
|
|
182
189
|
<Animated.View style={[styles.backdrop, backdropAnimatedStyle]} />
|
|
@@ -98,27 +98,33 @@ const SelectMenu: React.FC<SelectMenuProps> = ({
|
|
|
98
98
|
disableAutoKeyboardManagement
|
|
99
99
|
>
|
|
100
100
|
<View style={styles.content}>
|
|
101
|
-
<View style={styles.header}>
|
|
102
|
-
{helperText && (
|
|
103
|
-
<Typography variant="body2" color="textSecondary" gutterBottom={5}>
|
|
104
|
-
{helperText}
|
|
105
|
-
</Typography>
|
|
106
|
-
)}
|
|
107
|
-
{searchEnabled && (
|
|
108
|
-
<TextField
|
|
109
|
-
label={searchPlaceholder}
|
|
110
|
-
value={search}
|
|
111
|
-
type="search"
|
|
112
|
-
onChangeText={setSearch}
|
|
113
|
-
variant="outlined"
|
|
114
|
-
/>
|
|
115
|
-
)}
|
|
116
|
-
</View>
|
|
117
101
|
<FlatList
|
|
118
102
|
removeClippedSubviews
|
|
119
103
|
keyExtractor={(item) => item.value}
|
|
120
104
|
bounces={false}
|
|
121
105
|
renderItem={renderItem}
|
|
106
|
+
ListHeaderComponent={
|
|
107
|
+
<View style={styles.header}>
|
|
108
|
+
{helperText && (
|
|
109
|
+
<Typography
|
|
110
|
+
variant="body2"
|
|
111
|
+
color="textSecondary"
|
|
112
|
+
gutterBottom={5}
|
|
113
|
+
>
|
|
114
|
+
{helperText}
|
|
115
|
+
</Typography>
|
|
116
|
+
)}
|
|
117
|
+
{searchEnabled && (
|
|
118
|
+
<TextField
|
|
119
|
+
label={searchPlaceholder}
|
|
120
|
+
value={search}
|
|
121
|
+
type="search"
|
|
122
|
+
onChangeText={setSearch}
|
|
123
|
+
variant="outlined"
|
|
124
|
+
/>
|
|
125
|
+
)}
|
|
126
|
+
</View>
|
|
127
|
+
}
|
|
122
128
|
data={options
|
|
123
129
|
.filter((item) =>
|
|
124
130
|
search.length > 1
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ionicons } from "@expo/vector-icons";
|
|
2
2
|
import * as Haptics from "expo-haptics";
|
|
3
|
-
import { FC, useEffect, useState } from "react";
|
|
3
|
+
import React, { FC, useEffect, useState } from "react";
|
|
4
4
|
import {
|
|
5
5
|
ActivityIndicator,
|
|
6
6
|
TextInput,
|
|
@@ -14,41 +14,6 @@ import Button from "./Button";
|
|
|
14
14
|
import { Popup } from "./Popup";
|
|
15
15
|
import Typography from "./Typography";
|
|
16
16
|
|
|
17
|
-
export const RatingStars: FC<RatingStarsProps> = ({
|
|
18
|
-
rating = 0,
|
|
19
|
-
size = 16,
|
|
20
|
-
color = "#FFD700",
|
|
21
|
-
}) => {
|
|
22
|
-
const colors = useColors();
|
|
23
|
-
|
|
24
|
-
const styles = ScaledSheet.create({
|
|
25
|
-
root: {
|
|
26
|
-
flexDirection: "row",
|
|
27
|
-
alignItems: "center",
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
return (
|
|
31
|
-
<View style={styles.root}>
|
|
32
|
-
{[...Array(Math.floor(rating))].map((_, index) => (
|
|
33
|
-
<Ionicons
|
|
34
|
-
key={index}
|
|
35
|
-
name="star"
|
|
36
|
-
size={size}
|
|
37
|
-
color={colors[color as keyof typeof colors]?.main || color}
|
|
38
|
-
/>
|
|
39
|
-
))}
|
|
40
|
-
{[...Array(5 - Math.floor(rating))].map((_, index) => (
|
|
41
|
-
<Ionicons
|
|
42
|
-
key={index}
|
|
43
|
-
name="star"
|
|
44
|
-
size={size}
|
|
45
|
-
color={colors.textSecondary.light}
|
|
46
|
-
/>
|
|
47
|
-
))}
|
|
48
|
-
</View>
|
|
49
|
-
);
|
|
50
|
-
};
|
|
51
|
-
|
|
52
17
|
export const RatingInput: FC<RatingInputProps> = ({
|
|
53
18
|
onSubmit: _onSubmit,
|
|
54
19
|
rating = 0,
|
|
@@ -167,3 +132,37 @@ export const RatingInput: FC<RatingInputProps> = ({
|
|
|
167
132
|
</>
|
|
168
133
|
);
|
|
169
134
|
};
|
|
135
|
+
|
|
136
|
+
export const RatingStars: FC<RatingStarsProps> = ({
|
|
137
|
+
rating = 0,
|
|
138
|
+
size = 16,
|
|
139
|
+
color = "#FFD700",
|
|
140
|
+
}) => {
|
|
141
|
+
const colors = useColors();
|
|
142
|
+
const styles = ScaledSheet.create({
|
|
143
|
+
root: {
|
|
144
|
+
flexDirection: "row",
|
|
145
|
+
alignItems: "center",
|
|
146
|
+
},
|
|
147
|
+
});
|
|
148
|
+
return (
|
|
149
|
+
<View style={styles.root}>
|
|
150
|
+
{[...Array(Math.floor(rating))].map((_, index) => (
|
|
151
|
+
<Ionicons
|
|
152
|
+
key={index}
|
|
153
|
+
name="star"
|
|
154
|
+
size={size}
|
|
155
|
+
color={colors[color as keyof typeof colors]?.main || color}
|
|
156
|
+
/>
|
|
157
|
+
))}
|
|
158
|
+
{[...Array(5 - Math.floor(rating))].map((_, index) => (
|
|
159
|
+
<Ionicons
|
|
160
|
+
key={index}
|
|
161
|
+
name="star"
|
|
162
|
+
size={size}
|
|
163
|
+
color={colors.textSecondary.light}
|
|
164
|
+
/>
|
|
165
|
+
))}
|
|
166
|
+
</View>
|
|
167
|
+
);
|
|
168
|
+
};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { Ionicons, MaterialIcons } from "@expo/vector-icons";
|
|
2
2
|
import React, { useRef, useState } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
Animated,
|
|
5
|
+
Keyboard,
|
|
6
|
+
TextInput,
|
|
7
|
+
TouchableOpacity,
|
|
8
|
+
View,
|
|
9
|
+
} from "react-native";
|
|
4
10
|
import {
|
|
5
11
|
ScaledSheet,
|
|
6
12
|
moderateScale,
|
|
@@ -316,7 +322,14 @@ export const TextField2 = React.forwardRef<TextInput, TextFieldProps>(
|
|
|
316
322
|
);
|
|
317
323
|
|
|
318
324
|
const setFocused = (value: boolean) => {
|
|
319
|
-
|
|
325
|
+
if (options && value) {
|
|
326
|
+
Keyboard.dismiss();
|
|
327
|
+
setTimeout(() => {
|
|
328
|
+
_setFocused(value);
|
|
329
|
+
}, 100);
|
|
330
|
+
} else {
|
|
331
|
+
_setFocused(value);
|
|
332
|
+
}
|
|
320
333
|
};
|
|
321
334
|
|
|
322
335
|
const styles: any = ScaledSheet.create({
|
package/src/theme/index.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import AsyncStorage from "@react-native-async-storage/async-storage";
|
|
|
2
2
|
import * as NavigationBar from "expo-navigation-bar";
|
|
3
3
|
import * as SystemUI from "expo-system-ui";
|
|
4
4
|
import React, { createContext, useEffect, useReducer } from "react";
|
|
5
|
-
import { Platform, useColorScheme } from "react-native";
|
|
5
|
+
import { Appearance, Platform, useColorScheme } from "react-native";
|
|
6
6
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
7
7
|
import FlashMessage from "../Components/FlashMessage";
|
|
8
8
|
import { getConfig } from "../config/KeyManager";
|
|
@@ -43,6 +43,8 @@ const ConfigureSystemUI = () => {
|
|
|
43
43
|
|
|
44
44
|
useEffect(() => {
|
|
45
45
|
const config = getConfig();
|
|
46
|
+
// Appearance.setColorScheme(theme);
|
|
47
|
+
|
|
46
48
|
if (colors) {
|
|
47
49
|
SystemUI.setBackgroundColorAsync(colors.white[1]);
|
|
48
50
|
if (Platform.OS === "android") {
|
|
@@ -83,10 +85,12 @@ export const UIThemeProvider = ({ children }: ThemeProviderProps) => {
|
|
|
83
85
|
type: "default",
|
|
84
86
|
payload: colorScheme,
|
|
85
87
|
});
|
|
86
|
-
} else
|
|
88
|
+
} else {
|
|
87
89
|
themeDispatch({
|
|
88
90
|
type: val,
|
|
89
91
|
});
|
|
92
|
+
Appearance.setColorScheme(val);
|
|
93
|
+
}
|
|
90
94
|
} else {
|
|
91
95
|
themeDispatch({
|
|
92
96
|
type: "default",
|