@hoddy-ui/core 1.0.100 → 1.1.1

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.
@@ -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
- // setFocused(true);
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
- // setFocused(true);
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
  };
@@ -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";
@@ -11,6 +12,7 @@ type extraColorTypes = {
11
12
  light?: string;
12
13
  dark?: string;
13
14
  text?: string;
15
+ [key: number]: string;
14
16
  };
15
17
  };
16
18
  light?: {
@@ -19,9 +21,14 @@ type extraColorTypes = {
19
21
  light?: string;
20
22
  dark?: string;
21
23
  text?: string;
24
+ [key: number]: string;
22
25
  };
23
26
  };
24
27
  };
28
+ interface ThemeActionTypes {
29
+ type: ThemeModes;
30
+ payload?: ThemeTypes;
31
+ }
25
32
  interface ThemeState {
26
33
  value: ThemeTypes;
27
34
  mode: ThemeModes;
@@ -49,6 +56,14 @@ interface AvatarProps {
49
56
  size?: number;
50
57
  style?: ViewStyle;
51
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
+ }
52
67
  interface ButtonProps {
53
68
  color?: colorTypes;
54
69
  variant?: "text" | "outlined" | "contained";
@@ -108,6 +123,7 @@ interface IconButtonProps {
108
123
  }
109
124
  type locatorLocation = {
110
125
  description: string;
126
+ formatted_address?: string;
111
127
  longitude: number;
112
128
  latitude: number;
113
129
  };
@@ -131,6 +147,26 @@ interface LocatorProps {
131
147
  renderInput?: (props: LocatorInputProps) => ReactNode;
132
148
  country?: string;
133
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
+ }
134
170
  interface FormWrapperProps {
135
171
  children: ReactNode;
136
172
  behavior?: "position" | "height" | "padding";
@@ -160,6 +196,7 @@ interface PopupProps {
160
196
  children: ReactNode;
161
197
  open: boolean;
162
198
  onClose?: () => void;
199
+ style?: ViewStyle;
163
200
  }
164
201
  interface SpinnerProps {
165
202
  label?: string;
@@ -197,7 +234,7 @@ interface TypographyProps extends TextProps {
197
234
  children: ReactNode;
198
235
  color?: colorTypes | (string & {});
199
236
  style?: TextStyle | ViewStyle;
200
- textCase?: "capitalize" | "uppercase" | "lowercase" | null;
237
+ textCase?: "capitalize" | "uppercase" | "lowercase" | undefined;
201
238
  variant?: "caption" | "body1" | "body2" | "h6" | "h5" | "h4" | "h3" | "h2" | "h1";
202
239
  align?: "center" | "left" | "right";
203
240
  gutterBottom?: number;
@@ -257,6 +294,7 @@ type configProps = {
257
294
  googleMapApiKey?: string;
258
295
  colors?: extraColorTypes;
259
296
  fontFamily?: string;
297
+ edgeToEdge?: boolean;
260
298
  };
261
299
  declare function initialize(config: configProps): void;
262
300
 
@@ -284,14 +322,34 @@ declare const RatingInput: FC<RatingInputProps>;
284
322
  declare const GridItem: React.FC<GridItemProps>;
285
323
  declare const Grid: React.FC<GridProps>;
286
324
 
287
- declare const getPredictionsFromCoords: (coords: any) => Promise<{
325
+ type predictionType = {
326
+ id: string;
327
+ description: string;
328
+ };
329
+ declare const getPredictionsFromCoords: (coords: {
330
+ latitude: number;
331
+ longitude: number;
332
+ }) => Promise<{
288
333
  description: any;
289
334
  id: any;
290
335
  latLng: {
291
- lst: any;
292
- lng: any;
336
+ lst: number;
337
+ lng: number;
293
338
  };
294
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
+ }>;
295
353
  declare const Locator: React.FC<LocatorProps>;
296
354
 
297
355
  declare const Popup: React.FC<PopupProps>;
@@ -305,7 +363,7 @@ declare const SelectMenu: React.FC<SelectMenuProps>;
305
363
  declare const Spinner: React.FC<SpinnerProps>;
306
364
 
307
365
  declare const TextField: React.FC<TextFieldProps>;
308
- declare const TextField2: React.FC<TextFieldProps>;
366
+ declare const TextField2: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<TextInput>>;
309
367
 
310
368
  declare const Typography: React.FC<TypographyProps>;
311
369
 
@@ -313,6 +371,10 @@ declare const OTPInput: FC<OTPInputProps>;
313
371
 
314
372
  declare const useColors: () => {
315
373
  white: {
374
+ main?: string | undefined;
375
+ light?: string | undefined;
376
+ dark?: string | undefined;
377
+ text?: string | undefined;
316
378
  1: string;
317
379
  2: string;
318
380
  3: string;
@@ -320,6 +382,10 @@ declare const useColors: () => {
320
382
  5: string;
321
383
  };
322
384
  black: {
385
+ main?: string | undefined;
386
+ light?: string | undefined;
387
+ dark?: string | undefined;
388
+ text?: string | undefined;
323
389
  1: string;
324
390
  2: string;
325
391
  3: string;
@@ -388,6 +454,10 @@ declare const useColors: () => {
388
454
  };
389
455
  } | {
390
456
  white: {
457
+ main?: string | undefined;
458
+ light?: string | undefined;
459
+ dark?: string | undefined;
460
+ text?: string | undefined;
391
461
  1: string;
392
462
  2: string;
393
463
  3: string;
@@ -395,6 +465,10 @@ declare const useColors: () => {
395
465
  5: string;
396
466
  };
397
467
  black: {
468
+ main?: string | undefined;
469
+ light?: string | undefined;
470
+ dark?: string | undefined;
471
+ text?: string | undefined;
398
472
  1: string;
399
473
  2: string;
400
474
  3: string;
@@ -463,6 +537,10 @@ declare const useColors: () => {
463
537
  };
464
538
  } | {
465
539
  white: {
540
+ main?: string | undefined;
541
+ light?: string | undefined;
542
+ dark?: string | undefined;
543
+ text?: string | undefined;
466
544
  1: string;
467
545
  2: string;
468
546
  3: string;
@@ -470,6 +548,10 @@ declare const useColors: () => {
470
548
  5: string;
471
549
  };
472
550
  black: {
551
+ main?: string | undefined;
552
+ light?: string | undefined;
553
+ dark?: string | undefined;
554
+ text?: string | undefined;
473
555
  1: string;
474
556
  2: string;
475
557
  3: string;
@@ -537,7 +619,7 @@ declare const useColors: () => {
537
619
  text: string;
538
620
  };
539
621
  };
540
- declare const useTheme: () => ThemeTypes;
622
+ declare const useTheme: () => index.ThemeTypes;
541
623
  declare const useNavScreenOptions: (type: "stack" | "tab" | "drawer") => any;
542
624
 
543
625
  declare const UIThemeContext: React.Context<ThemeContext>;
@@ -547,4 +629,4 @@ declare const HoddyUI: {
547
629
  initialize: typeof initialize;
548
630
  };
549
631
 
550
- 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 };
@@ -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";
@@ -11,6 +12,7 @@ type extraColorTypes = {
11
12
  light?: string;
12
13
  dark?: string;
13
14
  text?: string;
15
+ [key: number]: string;
14
16
  };
15
17
  };
16
18
  light?: {
@@ -19,9 +21,14 @@ type extraColorTypes = {
19
21
  light?: string;
20
22
  dark?: string;
21
23
  text?: string;
24
+ [key: number]: string;
22
25
  };
23
26
  };
24
27
  };
28
+ interface ThemeActionTypes {
29
+ type: ThemeModes;
30
+ payload?: ThemeTypes;
31
+ }
25
32
  interface ThemeState {
26
33
  value: ThemeTypes;
27
34
  mode: ThemeModes;
@@ -49,6 +56,14 @@ interface AvatarProps {
49
56
  size?: number;
50
57
  style?: ViewStyle;
51
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
+ }
52
67
  interface ButtonProps {
53
68
  color?: colorTypes;
54
69
  variant?: "text" | "outlined" | "contained";
@@ -108,6 +123,7 @@ interface IconButtonProps {
108
123
  }
109
124
  type locatorLocation = {
110
125
  description: string;
126
+ formatted_address?: string;
111
127
  longitude: number;
112
128
  latitude: number;
113
129
  };
@@ -131,6 +147,26 @@ interface LocatorProps {
131
147
  renderInput?: (props: LocatorInputProps) => ReactNode;
132
148
  country?: string;
133
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
+ }
134
170
  interface FormWrapperProps {
135
171
  children: ReactNode;
136
172
  behavior?: "position" | "height" | "padding";
@@ -160,6 +196,7 @@ interface PopupProps {
160
196
  children: ReactNode;
161
197
  open: boolean;
162
198
  onClose?: () => void;
199
+ style?: ViewStyle;
163
200
  }
164
201
  interface SpinnerProps {
165
202
  label?: string;
@@ -197,7 +234,7 @@ interface TypographyProps extends TextProps {
197
234
  children: ReactNode;
198
235
  color?: colorTypes | (string & {});
199
236
  style?: TextStyle | ViewStyle;
200
- textCase?: "capitalize" | "uppercase" | "lowercase" | null;
237
+ textCase?: "capitalize" | "uppercase" | "lowercase" | undefined;
201
238
  variant?: "caption" | "body1" | "body2" | "h6" | "h5" | "h4" | "h3" | "h2" | "h1";
202
239
  align?: "center" | "left" | "right";
203
240
  gutterBottom?: number;
@@ -257,6 +294,7 @@ type configProps = {
257
294
  googleMapApiKey?: string;
258
295
  colors?: extraColorTypes;
259
296
  fontFamily?: string;
297
+ edgeToEdge?: boolean;
260
298
  };
261
299
  declare function initialize(config: configProps): void;
262
300
 
@@ -284,14 +322,34 @@ declare const RatingInput: FC<RatingInputProps>;
284
322
  declare const GridItem: React.FC<GridItemProps>;
285
323
  declare const Grid: React.FC<GridProps>;
286
324
 
287
- declare const getPredictionsFromCoords: (coords: any) => Promise<{
325
+ type predictionType = {
326
+ id: string;
327
+ description: string;
328
+ };
329
+ declare const getPredictionsFromCoords: (coords: {
330
+ latitude: number;
331
+ longitude: number;
332
+ }) => Promise<{
288
333
  description: any;
289
334
  id: any;
290
335
  latLng: {
291
- lst: any;
292
- lng: any;
336
+ lst: number;
337
+ lng: number;
293
338
  };
294
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
+ }>;
295
353
  declare const Locator: React.FC<LocatorProps>;
296
354
 
297
355
  declare const Popup: React.FC<PopupProps>;
@@ -305,7 +363,7 @@ declare const SelectMenu: React.FC<SelectMenuProps>;
305
363
  declare const Spinner: React.FC<SpinnerProps>;
306
364
 
307
365
  declare const TextField: React.FC<TextFieldProps>;
308
- declare const TextField2: React.FC<TextFieldProps>;
366
+ declare const TextField2: React.ForwardRefExoticComponent<TextFieldProps & React.RefAttributes<TextInput>>;
309
367
 
310
368
  declare const Typography: React.FC<TypographyProps>;
311
369
 
@@ -313,6 +371,10 @@ declare const OTPInput: FC<OTPInputProps>;
313
371
 
314
372
  declare const useColors: () => {
315
373
  white: {
374
+ main?: string | undefined;
375
+ light?: string | undefined;
376
+ dark?: string | undefined;
377
+ text?: string | undefined;
316
378
  1: string;
317
379
  2: string;
318
380
  3: string;
@@ -320,6 +382,10 @@ declare const useColors: () => {
320
382
  5: string;
321
383
  };
322
384
  black: {
385
+ main?: string | undefined;
386
+ light?: string | undefined;
387
+ dark?: string | undefined;
388
+ text?: string | undefined;
323
389
  1: string;
324
390
  2: string;
325
391
  3: string;
@@ -388,6 +454,10 @@ declare const useColors: () => {
388
454
  };
389
455
  } | {
390
456
  white: {
457
+ main?: string | undefined;
458
+ light?: string | undefined;
459
+ dark?: string | undefined;
460
+ text?: string | undefined;
391
461
  1: string;
392
462
  2: string;
393
463
  3: string;
@@ -395,6 +465,10 @@ declare const useColors: () => {
395
465
  5: string;
396
466
  };
397
467
  black: {
468
+ main?: string | undefined;
469
+ light?: string | undefined;
470
+ dark?: string | undefined;
471
+ text?: string | undefined;
398
472
  1: string;
399
473
  2: string;
400
474
  3: string;
@@ -463,6 +537,10 @@ declare const useColors: () => {
463
537
  };
464
538
  } | {
465
539
  white: {
540
+ main?: string | undefined;
541
+ light?: string | undefined;
542
+ dark?: string | undefined;
543
+ text?: string | undefined;
466
544
  1: string;
467
545
  2: string;
468
546
  3: string;
@@ -470,6 +548,10 @@ declare const useColors: () => {
470
548
  5: string;
471
549
  };
472
550
  black: {
551
+ main?: string | undefined;
552
+ light?: string | undefined;
553
+ dark?: string | undefined;
554
+ text?: string | undefined;
473
555
  1: string;
474
556
  2: string;
475
557
  3: string;
@@ -537,7 +619,7 @@ declare const useColors: () => {
537
619
  text: string;
538
620
  };
539
621
  };
540
- declare const useTheme: () => ThemeTypes;
622
+ declare const useTheme: () => index.ThemeTypes;
541
623
  declare const useNavScreenOptions: (type: "stack" | "tab" | "drawer") => any;
542
624
 
543
625
  declare const UIThemeContext: React.Context<ThemeContext>;
@@ -547,4 +629,4 @@ declare const HoddyUI: {
547
629
  initialize: typeof initialize;
548
630
  };
549
631
 
550
- 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 };