@hoddy-ui/next 2.0.33 → 2.0.35
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/components/AdaptiveStatusBarNext.tsx +12 -18
- package/dist/index.d.mts +39 -2
- package/dist/index.d.ts +39 -2
- package/dist/index.js +11 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -14
- package/dist/index.mjs.map +1 -1
- package/index.ts +1 -0
- package/package.json +1 -1
|
@@ -7,30 +7,24 @@ const AdaptiveStatusBar = ({ translucent = false }) => {
|
|
|
7
7
|
const [focused, setFocused] = useState(false);
|
|
8
8
|
const colors = useColors();
|
|
9
9
|
const theme = useTheme();
|
|
10
|
+
const statusbarHandler = () => {
|
|
11
|
+
StatusBar.setBarStyle(theme === "dark" ? "light-content" : "dark-content");
|
|
12
|
+
if (Platform.OS === "android") {
|
|
13
|
+
StatusBar.setBackgroundColor(
|
|
14
|
+
translucent ? "transparent" : colors.white[1]
|
|
15
|
+
);
|
|
16
|
+
StatusBar.setTranslucent(true);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
10
20
|
useFocusEffect(
|
|
11
21
|
React.useCallback(() => {
|
|
12
|
-
|
|
13
|
-
StatusBar.setBarStyle(
|
|
14
|
-
theme === "dark" ? "light-content" : "dark-content"
|
|
15
|
-
);
|
|
16
|
-
if (Platform.OS === "android") {
|
|
17
|
-
StatusBar.setBackgroundColor(
|
|
18
|
-
colors.white[1] + (translucent ? "0" : "")
|
|
19
|
-
);
|
|
20
|
-
StatusBar.setTranslucent(true);
|
|
21
|
-
}
|
|
22
|
-
// return () => setFocused(false);
|
|
22
|
+
statusbarHandler();
|
|
23
23
|
}, [theme])
|
|
24
24
|
);
|
|
25
25
|
|
|
26
26
|
React.useEffect(() => {
|
|
27
|
-
|
|
28
|
-
StatusBar.setBarStyle(theme === "dark" ? "light-content" : "dark-content");
|
|
29
|
-
if (Platform.OS === "android") {
|
|
30
|
-
StatusBar.setBackgroundColor(colors.white[1] + (translucent ? "0" : ""));
|
|
31
|
-
StatusBar.setTranslucent(true);
|
|
32
|
-
}
|
|
33
|
-
// return () => setFocused(false);
|
|
27
|
+
statusbarHandler();
|
|
34
28
|
}, [theme]);
|
|
35
29
|
return <></>;
|
|
36
30
|
};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode, FC } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps } from 'react-native';
|
|
3
|
+
import * as index from 'index';
|
|
3
4
|
|
|
4
5
|
type ThemeTypes = "dark" | "light";
|
|
5
6
|
type ThemeModes = "dark" | "light" | "default";
|
|
@@ -24,6 +25,10 @@ type extraColorTypes = {
|
|
|
24
25
|
};
|
|
25
26
|
};
|
|
26
27
|
};
|
|
28
|
+
interface ThemeActionTypes {
|
|
29
|
+
type: ThemeModes;
|
|
30
|
+
payload?: ThemeTypes;
|
|
31
|
+
}
|
|
27
32
|
interface ThemeState {
|
|
28
33
|
value: ThemeTypes;
|
|
29
34
|
mode: ThemeModes;
|
|
@@ -51,6 +56,14 @@ interface AvatarProps {
|
|
|
51
56
|
size?: number;
|
|
52
57
|
style?: ViewStyle;
|
|
53
58
|
}
|
|
59
|
+
interface AnimatorProps {
|
|
60
|
+
style?: ViewStyle;
|
|
61
|
+
duration?: number;
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
delay?: number;
|
|
64
|
+
animationType?: "easeInEaseOut" | "linear" | "spring";
|
|
65
|
+
type?: "fade" | "slideInLeft" | "slideInRight" | "slideInUp" | "slideInDown";
|
|
66
|
+
}
|
|
54
67
|
interface ButtonProps {
|
|
55
68
|
color?: colorTypes;
|
|
56
69
|
variant?: "text" | "outlined" | "contained";
|
|
@@ -133,6 +146,26 @@ interface LocatorProps {
|
|
|
133
146
|
renderInput?: (props: LocatorInputProps) => ReactNode;
|
|
134
147
|
country?: string;
|
|
135
148
|
}
|
|
149
|
+
interface ListProps {
|
|
150
|
+
style?: ViewStyle;
|
|
151
|
+
children: ReactNode;
|
|
152
|
+
}
|
|
153
|
+
interface ListItemTextProps {
|
|
154
|
+
primary: string;
|
|
155
|
+
divider?: boolean;
|
|
156
|
+
primaryProps?: TypographyProps;
|
|
157
|
+
secondaryProps?: TypographyProps;
|
|
158
|
+
secondary?: string;
|
|
159
|
+
style?: ViewStyle;
|
|
160
|
+
}
|
|
161
|
+
interface ListItemProps {
|
|
162
|
+
link?: boolean;
|
|
163
|
+
divider?: boolean;
|
|
164
|
+
onPress?: () => void;
|
|
165
|
+
index?: number;
|
|
166
|
+
style?: ViewStyle;
|
|
167
|
+
children: ReactNode;
|
|
168
|
+
}
|
|
136
169
|
interface FormWrapperProps {
|
|
137
170
|
children: ReactNode;
|
|
138
171
|
behavior?: "position" | "height" | "padding";
|
|
@@ -287,6 +320,10 @@ declare const RatingInput: FC<RatingInputProps>;
|
|
|
287
320
|
declare const GridItem: React.FC<GridItemProps>;
|
|
288
321
|
declare const Grid: React.FC<GridProps>;
|
|
289
322
|
|
|
323
|
+
type predictionType = {
|
|
324
|
+
id: string;
|
|
325
|
+
description: string;
|
|
326
|
+
};
|
|
290
327
|
declare const getPredictionsFromCoords: (coords: any) => Promise<{
|
|
291
328
|
description: any;
|
|
292
329
|
id: any;
|
|
@@ -564,7 +601,7 @@ declare const useColors: () => {
|
|
|
564
601
|
text: string;
|
|
565
602
|
};
|
|
566
603
|
};
|
|
567
|
-
declare const useTheme: () => ThemeTypes;
|
|
604
|
+
declare const useTheme: () => index.ThemeTypes;
|
|
568
605
|
declare const useNavScreenOptions: (type: "stack" | "tab" | "drawer") => any;
|
|
569
606
|
|
|
570
607
|
declare const UIThemeContext: React.Context<ThemeContext>;
|
|
@@ -574,4 +611,4 @@ declare const HoddyUI: {
|
|
|
574
611
|
initialize: typeof initialize;
|
|
575
612
|
};
|
|
576
613
|
|
|
577
|
-
export { AdaptiveStatusBar, AlertX, Avatar, Button, CheckBox, Divider, FormWrapper, Grid, GridItem, IconButton, LinkButton, Locator, OTPInput, Popup, RatingInput, RatingStars, SafeAreaView, SelectMenu, Spinner, TextField, TextField2, Typography, UIThemeContext, UIThemeProvider, HoddyUI as default, getPredictionsFromCoords, showFlashMessage, useColors, useNavScreenOptions, useTheme };
|
|
614
|
+
export { AdaptiveStatusBar, AlertX, type AlertXProps, type AnimatorProps, Avatar, type AvatarProps, Button, type ButtonProps, CheckBox, type CheckboxProps, Divider, type DividerProps, type FlashMessageProps, FormWrapper, type FormWrapperProps, Grid, GridItem, type GridItemProps, type GridProps, IconButton, type IconButtonProps, LinkButton, type LinkButtonProps, type ListItemProps, type ListItemTextProps, type ListProps, Locator, type LocatorInputProps, type LocatorProps, OTPInput, type OTPInputProps, Popup, type PopupProps, RatingInput, type RatingInputProps, RatingStars, type RatingStarsProps, SafeAreaView, type SafeAreaViewProps, SelectMenu, type SelectMenuProps, Spinner, type SpinnerProps, TextField, TextField2, type TextFieldProps, type ThemeActionTypes, type ThemeContext, type ThemeModes, type ThemeProviderProps, type ThemeState, type ThemeTypes, Typography, type TypographyProps, UIThemeContext, UIThemeProvider, type colorTypes, HoddyUI as default, type extraColorTypes, getPredictionsFromCoords, type locatorLocation, type predictionType, showFlashMessage, useColors, useNavScreenOptions, useTheme };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode, FC } from 'react';
|
|
2
2
|
import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps } from 'react-native';
|
|
3
|
+
import * as index from 'index';
|
|
3
4
|
|
|
4
5
|
type ThemeTypes = "dark" | "light";
|
|
5
6
|
type ThemeModes = "dark" | "light" | "default";
|
|
@@ -24,6 +25,10 @@ type extraColorTypes = {
|
|
|
24
25
|
};
|
|
25
26
|
};
|
|
26
27
|
};
|
|
28
|
+
interface ThemeActionTypes {
|
|
29
|
+
type: ThemeModes;
|
|
30
|
+
payload?: ThemeTypes;
|
|
31
|
+
}
|
|
27
32
|
interface ThemeState {
|
|
28
33
|
value: ThemeTypes;
|
|
29
34
|
mode: ThemeModes;
|
|
@@ -51,6 +56,14 @@ interface AvatarProps {
|
|
|
51
56
|
size?: number;
|
|
52
57
|
style?: ViewStyle;
|
|
53
58
|
}
|
|
59
|
+
interface AnimatorProps {
|
|
60
|
+
style?: ViewStyle;
|
|
61
|
+
duration?: number;
|
|
62
|
+
children: ReactNode;
|
|
63
|
+
delay?: number;
|
|
64
|
+
animationType?: "easeInEaseOut" | "linear" | "spring";
|
|
65
|
+
type?: "fade" | "slideInLeft" | "slideInRight" | "slideInUp" | "slideInDown";
|
|
66
|
+
}
|
|
54
67
|
interface ButtonProps {
|
|
55
68
|
color?: colorTypes;
|
|
56
69
|
variant?: "text" | "outlined" | "contained";
|
|
@@ -133,6 +146,26 @@ interface LocatorProps {
|
|
|
133
146
|
renderInput?: (props: LocatorInputProps) => ReactNode;
|
|
134
147
|
country?: string;
|
|
135
148
|
}
|
|
149
|
+
interface ListProps {
|
|
150
|
+
style?: ViewStyle;
|
|
151
|
+
children: ReactNode;
|
|
152
|
+
}
|
|
153
|
+
interface ListItemTextProps {
|
|
154
|
+
primary: string;
|
|
155
|
+
divider?: boolean;
|
|
156
|
+
primaryProps?: TypographyProps;
|
|
157
|
+
secondaryProps?: TypographyProps;
|
|
158
|
+
secondary?: string;
|
|
159
|
+
style?: ViewStyle;
|
|
160
|
+
}
|
|
161
|
+
interface ListItemProps {
|
|
162
|
+
link?: boolean;
|
|
163
|
+
divider?: boolean;
|
|
164
|
+
onPress?: () => void;
|
|
165
|
+
index?: number;
|
|
166
|
+
style?: ViewStyle;
|
|
167
|
+
children: ReactNode;
|
|
168
|
+
}
|
|
136
169
|
interface FormWrapperProps {
|
|
137
170
|
children: ReactNode;
|
|
138
171
|
behavior?: "position" | "height" | "padding";
|
|
@@ -287,6 +320,10 @@ declare const RatingInput: FC<RatingInputProps>;
|
|
|
287
320
|
declare const GridItem: React.FC<GridItemProps>;
|
|
288
321
|
declare const Grid: React.FC<GridProps>;
|
|
289
322
|
|
|
323
|
+
type predictionType = {
|
|
324
|
+
id: string;
|
|
325
|
+
description: string;
|
|
326
|
+
};
|
|
290
327
|
declare const getPredictionsFromCoords: (coords: any) => Promise<{
|
|
291
328
|
description: any;
|
|
292
329
|
id: any;
|
|
@@ -564,7 +601,7 @@ declare const useColors: () => {
|
|
|
564
601
|
text: string;
|
|
565
602
|
};
|
|
566
603
|
};
|
|
567
|
-
declare const useTheme: () => ThemeTypes;
|
|
604
|
+
declare const useTheme: () => index.ThemeTypes;
|
|
568
605
|
declare const useNavScreenOptions: (type: "stack" | "tab" | "drawer") => any;
|
|
569
606
|
|
|
570
607
|
declare const UIThemeContext: React.Context<ThemeContext>;
|
|
@@ -574,4 +611,4 @@ declare const HoddyUI: {
|
|
|
574
611
|
initialize: typeof initialize;
|
|
575
612
|
};
|
|
576
613
|
|
|
577
|
-
export { AdaptiveStatusBar, AlertX, Avatar, Button, CheckBox, Divider, FormWrapper, Grid, GridItem, IconButton, LinkButton, Locator, OTPInput, Popup, RatingInput, RatingStars, SafeAreaView, SelectMenu, Spinner, TextField, TextField2, Typography, UIThemeContext, UIThemeProvider, HoddyUI as default, getPredictionsFromCoords, showFlashMessage, useColors, useNavScreenOptions, useTheme };
|
|
614
|
+
export { AdaptiveStatusBar, AlertX, type AlertXProps, type AnimatorProps, Avatar, type AvatarProps, Button, type ButtonProps, CheckBox, type CheckboxProps, Divider, type DividerProps, type FlashMessageProps, FormWrapper, type FormWrapperProps, Grid, GridItem, type GridItemProps, type GridProps, IconButton, type IconButtonProps, LinkButton, type LinkButtonProps, type ListItemProps, type ListItemTextProps, type ListProps, Locator, type LocatorInputProps, type LocatorProps, OTPInput, type OTPInputProps, Popup, type PopupProps, RatingInput, type RatingInputProps, RatingStars, type RatingStarsProps, SafeAreaView, type SafeAreaViewProps, SelectMenu, type SelectMenuProps, Spinner, type SpinnerProps, TextField, TextField2, type TextFieldProps, type ThemeActionTypes, type ThemeContext, type ThemeModes, type ThemeProviderProps, type ThemeState, type ThemeTypes, Typography, type TypographyProps, UIThemeContext, UIThemeProvider, type colorTypes, HoddyUI as default, type extraColorTypes, getPredictionsFromCoords, type locatorLocation, type predictionType, showFlashMessage, useColors, useNavScreenOptions, useTheme };
|
package/dist/index.js
CHANGED
|
@@ -528,25 +528,22 @@ var AdaptiveStatusBar = ({ translucent = false }) => {
|
|
|
528
528
|
const [focused, setFocused] = (0, import_react5.useState)(false);
|
|
529
529
|
const colors2 = useColors();
|
|
530
530
|
const theme = useTheme();
|
|
531
|
+
const statusbarHandler = () => {
|
|
532
|
+
import_react_native5.StatusBar.setBarStyle(theme === "dark" ? "light-content" : "dark-content");
|
|
533
|
+
if (import_react_native5.Platform.OS === "android") {
|
|
534
|
+
import_react_native5.StatusBar.setBackgroundColor(
|
|
535
|
+
translucent ? "transparent" : colors2.white[1]
|
|
536
|
+
);
|
|
537
|
+
import_react_native5.StatusBar.setTranslucent(true);
|
|
538
|
+
}
|
|
539
|
+
};
|
|
531
540
|
(0, import_expo_router.useFocusEffect)(
|
|
532
541
|
import_react5.default.useCallback(() => {
|
|
533
|
-
|
|
534
|
-
theme === "dark" ? "light-content" : "dark-content"
|
|
535
|
-
);
|
|
536
|
-
if (import_react_native5.Platform.OS === "android") {
|
|
537
|
-
import_react_native5.StatusBar.setBackgroundColor(
|
|
538
|
-
colors2.white[1] + (translucent ? "0" : "")
|
|
539
|
-
);
|
|
540
|
-
import_react_native5.StatusBar.setTranslucent(true);
|
|
541
|
-
}
|
|
542
|
+
statusbarHandler();
|
|
542
543
|
}, [theme])
|
|
543
544
|
);
|
|
544
545
|
import_react5.default.useEffect(() => {
|
|
545
|
-
|
|
546
|
-
if (import_react_native5.Platform.OS === "android") {
|
|
547
|
-
import_react_native5.StatusBar.setBackgroundColor(colors2.white[1] + (translucent ? "0" : ""));
|
|
548
|
-
import_react_native5.StatusBar.setTranslucent(true);
|
|
549
|
-
}
|
|
546
|
+
statusbarHandler();
|
|
550
547
|
}, [theme]);
|
|
551
548
|
return /* @__PURE__ */ import_react5.default.createElement(import_react5.default.Fragment, null);
|
|
552
549
|
};
|