@hoddy-ui/core 2.5.36 → 2.5.38

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.61",
3
+ "version": "2.0.66",
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.36",
3
+ "version": "2.5.38",
4
4
  "description": "Core rich react native components written in typescript",
5
5
  "main": "index.ts",
6
6
  "repository": {
@@ -1,4 +1,4 @@
1
- import { FC } from "react";
1
+ import React, { FC } from "react";
2
2
  import { View } from "react-native";
3
3
  import { ScaledSheet, ms } from "react-native-size-matters";
4
4
  import { useColors } from "../hooks";
@@ -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(10) : undefined,
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,39 +14,11 @@ 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
- }) => {
21
- const colors = useColors();
22
-
23
- const styles = ScaledSheet.create({
24
- root: {
25
- flexDirection: "row",
26
- alignItems: "center",
27
- },
28
- });
29
- return (
30
- <View style={styles.root}>
31
- {[...Array(Math.floor(rating))].map((_, index) => (
32
- <Ionicons key={index} name="star" size={size} color="#FFD700" />
33
- ))}
34
- {[...Array(5 - Math.floor(rating))].map((_, index) => (
35
- <Ionicons
36
- key={index}
37
- name="star"
38
- size={size}
39
- color={colors.textSecondary.light}
40
- />
41
- ))}
42
- </View>
43
- );
44
- };
45
-
46
17
  export const RatingInput: FC<RatingInputProps> = ({
47
18
  onSubmit: _onSubmit,
48
19
  rating = 0,
49
20
  size = 16,
21
+ color = "primary",
50
22
  }) => {
51
23
  const [showReviewsModal, setShowReviewsModal] = useState(false);
52
24
  const [rate, setRate] = useState(0);
@@ -107,7 +79,7 @@ export const RatingInput: FC<RatingInputProps> = ({
107
79
  style={{ marginLeft: 10 }}
108
80
  name={index < rate ? "star" : "star-outline"}
109
81
  size={size}
110
- color={colors.primary.light}
82
+ color={colors[color as keyof typeof colors]?.main || color}
111
83
  />
112
84
  </TouchableOpacity>
113
85
  ))
@@ -144,6 +116,7 @@ export const RatingInput: FC<RatingInputProps> = ({
144
116
  value={review}
145
117
  onChangeText={(text) => setReview(text)}
146
118
  placeholder="Type review here.."
119
+ verticalAlign="top"
147
120
  />
148
121
  </View>
149
122
  <Button
@@ -159,3 +132,37 @@ export const RatingInput: FC<RatingInputProps> = ({
159
132
  </>
160
133
  );
161
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 { Animated, TextInput, TouchableOpacity, View } from "react-native";
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
- _setFocused(value);
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({
@@ -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") {
package/src/types.ts CHANGED
@@ -311,6 +311,7 @@ export interface OTPInputProps {
311
311
  export interface RatingStarsProps {
312
312
  rating: number;
313
313
  size: number;
314
+ color?: colorTypes | (string & {});
314
315
  }
315
316
 
316
317
  export interface RatingInputProps {
@@ -318,6 +319,7 @@ export interface RatingInputProps {
318
319
  noReview?: boolean;
319
320
  size?: number;
320
321
  onSubmit?: (data: { rating: number; review: string }) => Promise<void>;
322
+ color?: colorTypes | (string & {});
321
323
  }
322
324
 
323
325
  export interface DividerProps {