@hoddy-ui/core 1.1.0 → 1.1.2
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/README.md +972 -190
- package/index.ts +7 -3
- package/next/dist/index.d.mts +62 -7
- package/next/dist/index.d.ts +62 -7
- package/next/dist/index.js +225 -200
- package/next/dist/index.js.map +1 -1
- package/next/dist/index.mjs +223 -200
- package/next/dist/index.mjs.map +1 -1
- package/next/index.ts +1 -0
- package/next/package.json +1 -1
- package/package.json +1 -1
- package/src/Components/Animators/Animator.tsx +117 -0
- package/src/Components/Animators/README.md +137 -0
- package/src/Components/Animators/hooks/index.ts +8 -0
- package/src/Components/Animators/hooks/useAppState.ts +37 -0
- package/src/Components/Animators/hooks/useBlinkAnimation.ts +71 -0
- package/src/Components/Animators/hooks/useFadeAnimation.ts +50 -0
- package/src/Components/Animators/hooks/useFloatAnimation.ts +103 -0
- package/src/Components/Animators/hooks/useGrowAnimation.ts +54 -0
- package/src/Components/Animators/hooks/useRollAnimation.ts +86 -0
- package/src/Components/Animators/hooks/useSlideAnimation.ts +88 -0
- package/src/Components/Animators/hooks/useThrownUpAnimation.ts +82 -0
- package/src/Components/Locator.tsx +50 -22
- package/src/Components/Popup.tsx +16 -13
- package/src/Components/TextField.tsx +230 -220
- package/src/Components/Typography.tsx +0 -2
- package/src/config/KeyManager.ts +2 -0
- package/src/config/index.ts +2 -0
- package/src/theme/index.tsx +3 -1
- package/src/types.ts +57 -9
- package/src/Components/Animator.tsx +0 -43
package/index.ts
CHANGED
|
@@ -8,20 +8,24 @@ export { default as Avatar } from "./src/Components/Avatar";
|
|
|
8
8
|
export * from "./src/Components/Button";
|
|
9
9
|
export { default as Button } from "./src/Components/Button";
|
|
10
10
|
export * from "./src/Components/Checkbox";
|
|
11
|
+
export * from "./src/Components/Divider";
|
|
11
12
|
export * from "./src/Components/FlashMessage";
|
|
12
13
|
export * from "./src/Components/FormWrapper";
|
|
13
|
-
export * from "./src/Components/StarRating";
|
|
14
14
|
export * from "./src/Components/Grid";
|
|
15
15
|
export * from "./src/Components/Locator";
|
|
16
|
+
export * from "./src/Components/OTPInput";
|
|
16
17
|
export * from "./src/Components/Popup";
|
|
17
18
|
export * from "./src/Components/SafeAreaView";
|
|
18
|
-
export * from "./src/Components/Divider";
|
|
19
19
|
export { default as SelectMenu } from "./src/Components/SelectMenu";
|
|
20
20
|
export { default as Spinner } from "./src/Components/Spinner";
|
|
21
|
+
export * from "./src/Components/StarRating";
|
|
21
22
|
export * from "./src/Components/TextField";
|
|
22
23
|
export { default as TextField } from "./src/Components/TextField";
|
|
23
24
|
export { default as Typography } from "./src/Components/Typography";
|
|
24
|
-
|
|
25
|
+
|
|
26
|
+
// Animation hooks
|
|
27
|
+
export * from "./src/Components/Animators/hooks";
|
|
28
|
+
|
|
25
29
|
// Others
|
|
26
30
|
// export * from "./src/config";
|
|
27
31
|
export * from "./src/hooks";
|
package/next/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode, FC } from 'react';
|
|
2
|
-
import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps } from 'react-native';
|
|
2
|
+
import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps, TextInput } 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";
|
|
@@ -110,6 +123,7 @@ interface IconButtonProps {
|
|
|
110
123
|
}
|
|
111
124
|
type locatorLocation = {
|
|
112
125
|
description: string;
|
|
126
|
+
formatted_address?: string;
|
|
113
127
|
longitude: number;
|
|
114
128
|
latitude: number;
|
|
115
129
|
};
|
|
@@ -133,6 +147,26 @@ interface LocatorProps {
|
|
|
133
147
|
renderInput?: (props: LocatorInputProps) => ReactNode;
|
|
134
148
|
country?: string;
|
|
135
149
|
}
|
|
150
|
+
interface ListProps {
|
|
151
|
+
style?: ViewStyle;
|
|
152
|
+
children: ReactNode;
|
|
153
|
+
}
|
|
154
|
+
interface ListItemTextProps {
|
|
155
|
+
primary: string;
|
|
156
|
+
divider?: boolean;
|
|
157
|
+
primaryProps?: TypographyProps;
|
|
158
|
+
secondaryProps?: TypographyProps;
|
|
159
|
+
secondary?: string;
|
|
160
|
+
style?: ViewStyle;
|
|
161
|
+
}
|
|
162
|
+
interface ListItemProps {
|
|
163
|
+
link?: boolean;
|
|
164
|
+
divider?: boolean;
|
|
165
|
+
onPress?: () => void;
|
|
166
|
+
index?: number;
|
|
167
|
+
style?: ViewStyle;
|
|
168
|
+
children: ReactNode;
|
|
169
|
+
}
|
|
136
170
|
interface FormWrapperProps {
|
|
137
171
|
children: ReactNode;
|
|
138
172
|
behavior?: "position" | "height" | "padding";
|
|
@@ -260,6 +294,7 @@ type configProps = {
|
|
|
260
294
|
googleMapApiKey?: string;
|
|
261
295
|
colors?: extraColorTypes;
|
|
262
296
|
fontFamily?: string;
|
|
297
|
+
edgeToEdge?: boolean;
|
|
263
298
|
};
|
|
264
299
|
declare function initialize(config: configProps): void;
|
|
265
300
|
|
|
@@ -287,14 +322,34 @@ declare const RatingInput: FC<RatingInputProps>;
|
|
|
287
322
|
declare const GridItem: React.FC<GridItemProps>;
|
|
288
323
|
declare const Grid: React.FC<GridProps>;
|
|
289
324
|
|
|
290
|
-
|
|
325
|
+
type predictionType = {
|
|
326
|
+
id: string;
|
|
327
|
+
description: string;
|
|
328
|
+
};
|
|
329
|
+
declare const getPredictionsFromCoords: (coords: {
|
|
330
|
+
latitude: number;
|
|
331
|
+
longitude: number;
|
|
332
|
+
}) => Promise<{
|
|
291
333
|
description: any;
|
|
292
334
|
id: any;
|
|
293
335
|
latLng: {
|
|
294
|
-
lst:
|
|
295
|
-
lng:
|
|
336
|
+
lst: number;
|
|
337
|
+
lng: number;
|
|
296
338
|
};
|
|
297
339
|
}[]>;
|
|
340
|
+
declare const getPredictionsFromQuery: (query: string, country: string) => Promise<{
|
|
341
|
+
description: any;
|
|
342
|
+
id: any;
|
|
343
|
+
}[]>;
|
|
344
|
+
declare const getLocationFromPlaceId: (place_id: string) => Promise<{
|
|
345
|
+
formatted_address: string;
|
|
346
|
+
geometry: {
|
|
347
|
+
location: {
|
|
348
|
+
lat: number;
|
|
349
|
+
lng: number;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
}>;
|
|
298
353
|
declare const Locator: React.FC<LocatorProps>;
|
|
299
354
|
|
|
300
355
|
declare const Popup: React.FC<PopupProps>;
|
|
@@ -308,7 +363,7 @@ declare const SelectMenu: React.FC<SelectMenuProps>;
|
|
|
308
363
|
declare const Spinner: React.FC<SpinnerProps>;
|
|
309
364
|
|
|
310
365
|
declare const TextField: React.FC<TextFieldProps>;
|
|
311
|
-
declare const TextField2: React.
|
|
366
|
+
declare const TextField2: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<TextInput>>;
|
|
312
367
|
|
|
313
368
|
declare const Typography: React.FC<TypographyProps>;
|
|
314
369
|
|
|
@@ -564,7 +619,7 @@ declare const useColors: () => {
|
|
|
564
619
|
text: string;
|
|
565
620
|
};
|
|
566
621
|
};
|
|
567
|
-
declare const useTheme: () => ThemeTypes;
|
|
622
|
+
declare const useTheme: () => index.ThemeTypes;
|
|
568
623
|
declare const useNavScreenOptions: (type: "stack" | "tab" | "drawer") => any;
|
|
569
624
|
|
|
570
625
|
declare const UIThemeContext: React.Context<ThemeContext>;
|
|
@@ -574,4 +629,4 @@ declare const HoddyUI: {
|
|
|
574
629
|
initialize: typeof initialize;
|
|
575
630
|
};
|
|
576
631
|
|
|
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 };
|
|
632
|
+
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, getLocationFromPlaceId, getPredictionsFromCoords, getPredictionsFromQuery, type locatorLocation, type predictionType, showFlashMessage, useColors, useNavScreenOptions, useTheme };
|
package/next/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React, { ReactNode, FC } from 'react';
|
|
2
|
-
import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps } from 'react-native';
|
|
2
|
+
import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps, TextInput } 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";
|
|
@@ -110,6 +123,7 @@ interface IconButtonProps {
|
|
|
110
123
|
}
|
|
111
124
|
type locatorLocation = {
|
|
112
125
|
description: string;
|
|
126
|
+
formatted_address?: string;
|
|
113
127
|
longitude: number;
|
|
114
128
|
latitude: number;
|
|
115
129
|
};
|
|
@@ -133,6 +147,26 @@ interface LocatorProps {
|
|
|
133
147
|
renderInput?: (props: LocatorInputProps) => ReactNode;
|
|
134
148
|
country?: string;
|
|
135
149
|
}
|
|
150
|
+
interface ListProps {
|
|
151
|
+
style?: ViewStyle;
|
|
152
|
+
children: ReactNode;
|
|
153
|
+
}
|
|
154
|
+
interface ListItemTextProps {
|
|
155
|
+
primary: string;
|
|
156
|
+
divider?: boolean;
|
|
157
|
+
primaryProps?: TypographyProps;
|
|
158
|
+
secondaryProps?: TypographyProps;
|
|
159
|
+
secondary?: string;
|
|
160
|
+
style?: ViewStyle;
|
|
161
|
+
}
|
|
162
|
+
interface ListItemProps {
|
|
163
|
+
link?: boolean;
|
|
164
|
+
divider?: boolean;
|
|
165
|
+
onPress?: () => void;
|
|
166
|
+
index?: number;
|
|
167
|
+
style?: ViewStyle;
|
|
168
|
+
children: ReactNode;
|
|
169
|
+
}
|
|
136
170
|
interface FormWrapperProps {
|
|
137
171
|
children: ReactNode;
|
|
138
172
|
behavior?: "position" | "height" | "padding";
|
|
@@ -260,6 +294,7 @@ type configProps = {
|
|
|
260
294
|
googleMapApiKey?: string;
|
|
261
295
|
colors?: extraColorTypes;
|
|
262
296
|
fontFamily?: string;
|
|
297
|
+
edgeToEdge?: boolean;
|
|
263
298
|
};
|
|
264
299
|
declare function initialize(config: configProps): void;
|
|
265
300
|
|
|
@@ -287,14 +322,34 @@ declare const RatingInput: FC<RatingInputProps>;
|
|
|
287
322
|
declare const GridItem: React.FC<GridItemProps>;
|
|
288
323
|
declare const Grid: React.FC<GridProps>;
|
|
289
324
|
|
|
290
|
-
|
|
325
|
+
type predictionType = {
|
|
326
|
+
id: string;
|
|
327
|
+
description: string;
|
|
328
|
+
};
|
|
329
|
+
declare const getPredictionsFromCoords: (coords: {
|
|
330
|
+
latitude: number;
|
|
331
|
+
longitude: number;
|
|
332
|
+
}) => Promise<{
|
|
291
333
|
description: any;
|
|
292
334
|
id: any;
|
|
293
335
|
latLng: {
|
|
294
|
-
lst:
|
|
295
|
-
lng:
|
|
336
|
+
lst: number;
|
|
337
|
+
lng: number;
|
|
296
338
|
};
|
|
297
339
|
}[]>;
|
|
340
|
+
declare const getPredictionsFromQuery: (query: string, country: string) => Promise<{
|
|
341
|
+
description: any;
|
|
342
|
+
id: any;
|
|
343
|
+
}[]>;
|
|
344
|
+
declare const getLocationFromPlaceId: (place_id: string) => Promise<{
|
|
345
|
+
formatted_address: string;
|
|
346
|
+
geometry: {
|
|
347
|
+
location: {
|
|
348
|
+
lat: number;
|
|
349
|
+
lng: number;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
}>;
|
|
298
353
|
declare const Locator: React.FC<LocatorProps>;
|
|
299
354
|
|
|
300
355
|
declare const Popup: React.FC<PopupProps>;
|
|
@@ -308,7 +363,7 @@ declare const SelectMenu: React.FC<SelectMenuProps>;
|
|
|
308
363
|
declare const Spinner: React.FC<SpinnerProps>;
|
|
309
364
|
|
|
310
365
|
declare const TextField: React.FC<TextFieldProps>;
|
|
311
|
-
declare const TextField2: React.
|
|
366
|
+
declare const TextField2: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<TextInput>>;
|
|
312
367
|
|
|
313
368
|
declare const Typography: React.FC<TypographyProps>;
|
|
314
369
|
|
|
@@ -564,7 +619,7 @@ declare const useColors: () => {
|
|
|
564
619
|
text: string;
|
|
565
620
|
};
|
|
566
621
|
};
|
|
567
|
-
declare const useTheme: () => ThemeTypes;
|
|
622
|
+
declare const useTheme: () => index.ThemeTypes;
|
|
568
623
|
declare const useNavScreenOptions: (type: "stack" | "tab" | "drawer") => any;
|
|
569
624
|
|
|
570
625
|
declare const UIThemeContext: React.Context<ThemeContext>;
|
|
@@ -574,4 +629,4 @@ declare const HoddyUI: {
|
|
|
574
629
|
initialize: typeof initialize;
|
|
575
630
|
};
|
|
576
631
|
|
|
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 };
|
|
632
|
+
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, getLocationFromPlaceId, getPredictionsFromCoords, getPredictionsFromQuery, type locatorLocation, type predictionType, showFlashMessage, useColors, useNavScreenOptions, useTheme };
|