@hoddy-ui/core 2.5.40 → 2.5.45
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/index.ts +1 -2
- package/next/dist/index.d.mts +165 -6
- package/next/dist/index.d.ts +165 -6
- package/next/dist/index.js +628 -83
- package/next/dist/index.js.map +1 -1
- package/next/dist/index.mjs +679 -97
- package/next/dist/index.mjs.map +1 -1
- package/next/index.ts +3 -0
- package/next/package.json +1 -1
- package/package.json +1 -1
- package/src/Components/Animators/hooks/useFloatAnimation.ts +16 -13
- package/src/Components/FormWrapper.tsx +51 -44
- package/src/Components/SafeAreaView.tsx +18 -15
- package/src/Components/Typography.tsx +25 -15
- package/src/config/KeyManager.ts +14 -0
- package/src/config/index.ts +21 -0
- package/src/types.ts +3 -2
package/index.ts
CHANGED
|
@@ -3,7 +3,6 @@ import { initialize } from "./src/config";
|
|
|
3
3
|
// Components
|
|
4
4
|
export { default as AdaptiveStatusBar } from "./src/Components/AdaptiveStatusBar";
|
|
5
5
|
export { default as AlertX } from "./src/Components/AlertX";
|
|
6
|
-
export * from "./src/Components/Animators/Animator";
|
|
7
6
|
export { default as Avatar } from "./src/Components/Avatar";
|
|
8
7
|
export * from "./src/Components/Button";
|
|
9
8
|
export { default as Button } from "./src/Components/Button";
|
|
@@ -25,9 +24,9 @@ export { default as Typography } from "./src/Components/Typography";
|
|
|
25
24
|
|
|
26
25
|
// Animation hooks
|
|
27
26
|
export * from "./src/Components/Animators/hooks";
|
|
27
|
+
export * from "./src/Components/Animators/Animator";
|
|
28
28
|
|
|
29
29
|
// Others
|
|
30
|
-
// export * from "./src/config";
|
|
31
30
|
export * from "./src/hooks";
|
|
32
31
|
export * from "./src/theme";
|
|
33
32
|
|
package/next/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode, FC } from 'react';
|
|
2
|
-
import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps, StyleProp, TextInput } from 'react-native';
|
|
2
|
+
import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps, StyleProp, ViewProps, ScrollView, View, TextInput } from 'react-native';
|
|
3
3
|
|
|
4
4
|
type ThemeTypes = "dark" | "light";
|
|
5
5
|
type ThemeModes = "dark" | "light" | "default";
|
|
@@ -231,6 +231,7 @@ interface TypographyProps extends TextProps {
|
|
|
231
231
|
color?: colorTypes | (string & {});
|
|
232
232
|
style?: StyleProp<TextStyle | ViewStyle>;
|
|
233
233
|
textCase?: "capitalize" | "uppercase" | "lowercase" | undefined;
|
|
234
|
+
lineHeight?: number;
|
|
234
235
|
variant?: "caption" | "body1" | "body2" | "h6" | "h5" | "h4" | "h3" | "h2" | "h1";
|
|
235
236
|
align?: "center" | "left" | "right";
|
|
236
237
|
gutterBottom?: number;
|
|
@@ -240,9 +241,8 @@ interface TypographyProps extends TextProps {
|
|
|
240
241
|
fontSize?: number;
|
|
241
242
|
fontWeight?: 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
242
243
|
}
|
|
243
|
-
interface SafeAreaViewProps {
|
|
244
|
+
interface SafeAreaViewProps extends ViewProps {
|
|
244
245
|
children: ReactNode;
|
|
245
|
-
style?: ViewStyle;
|
|
246
246
|
}
|
|
247
247
|
interface SelectMenuProps {
|
|
248
248
|
open: boolean;
|
|
@@ -325,6 +325,7 @@ type AnimatorProps = (BaseAnimatorProps & {
|
|
|
325
325
|
type: "thrownup";
|
|
326
326
|
});
|
|
327
327
|
|
|
328
|
+
type TypographyVariant = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "body1" | "body2" | "caption";
|
|
328
329
|
/**
|
|
329
330
|
* Configuration options for the Hoddy UI library
|
|
330
331
|
*
|
|
@@ -344,6 +345,12 @@ type AnimatorProps = (BaseAnimatorProps & {
|
|
|
344
345
|
* 500: "Inter-Medium",
|
|
345
346
|
* 600: "Inter-SemiBold",
|
|
346
347
|
* 700: "Inter-Bold"
|
|
348
|
+
* },
|
|
349
|
+
* fontSizes: {
|
|
350
|
+
* h1: 48,
|
|
351
|
+
* h2: 40,
|
|
352
|
+
* body1: 16,
|
|
353
|
+
* caption: 12
|
|
347
354
|
* }
|
|
348
355
|
* }
|
|
349
356
|
* });
|
|
@@ -364,6 +371,10 @@ type configProps = {
|
|
|
364
371
|
fontWeights?: {
|
|
365
372
|
[K in 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900]?: string;
|
|
366
373
|
};
|
|
374
|
+
/** Custom font sizes for each typography variant (values in pixels, will be scaled with ms()) */
|
|
375
|
+
fontSizes?: {
|
|
376
|
+
[K in TypographyVariant]?: number;
|
|
377
|
+
};
|
|
367
378
|
};
|
|
368
379
|
};
|
|
369
380
|
declare function initialize(config: configProps): void;
|
|
@@ -384,7 +395,7 @@ declare const CheckBox: FC<CheckboxProps>;
|
|
|
384
395
|
|
|
385
396
|
declare const showFlashMessage: (msg: FlashMessageProps) => void;
|
|
386
397
|
|
|
387
|
-
declare const FormWrapper: React.
|
|
398
|
+
declare const FormWrapper: React.ForwardRefExoticComponent<FormWrapperProps & React.RefAttributes<ScrollView>>;
|
|
388
399
|
|
|
389
400
|
declare const RatingInput: FC<RatingInputProps>;
|
|
390
401
|
declare const RatingStars: FC<RatingStarsProps>;
|
|
@@ -427,7 +438,7 @@ declare const Locator: React.FC<LocatorProps>;
|
|
|
427
438
|
|
|
428
439
|
declare const Popup: React.FC<PopupProps>;
|
|
429
440
|
|
|
430
|
-
declare const SafeAreaView: React.
|
|
441
|
+
declare const SafeAreaView: React.ForwardRefExoticComponent<SafeAreaViewProps & React.RefAttributes<View>>;
|
|
431
442
|
|
|
432
443
|
declare const Divider: FC<DividerProps>;
|
|
433
444
|
|
|
@@ -702,8 +713,156 @@ declare const useNavScreenOptions: (type: "stack" | "tab" | "drawer") => any;
|
|
|
702
713
|
declare const UIThemeContext: React.Context<ThemeContext>;
|
|
703
714
|
declare const UIThemeProvider: ({ children }: ThemeProviderProps) => React.JSX.Element;
|
|
704
715
|
|
|
716
|
+
declare const useAppState: () => {
|
|
717
|
+
isActive: boolean;
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
interface UseBlinkAnimationProps {
|
|
721
|
+
delay?: number;
|
|
722
|
+
blinkDuration?: number;
|
|
723
|
+
minOpacity?: number;
|
|
724
|
+
maxOpacity?: number;
|
|
725
|
+
}
|
|
726
|
+
declare const useBlinkAnimation: ({ delay, blinkDuration, minOpacity, maxOpacity, }?: UseBlinkAnimationProps) => {
|
|
727
|
+
animatedStyle: {
|
|
728
|
+
opacity: number;
|
|
729
|
+
};
|
|
730
|
+
};
|
|
731
|
+
|
|
732
|
+
interface UseFadeAnimationProps {
|
|
733
|
+
duration?: number;
|
|
734
|
+
delay?: number;
|
|
735
|
+
closeAfter?: number | null;
|
|
736
|
+
}
|
|
737
|
+
declare const useFadeAnimation: ({ duration, delay, closeAfter, }?: UseFadeAnimationProps) => {
|
|
738
|
+
animatedStyle: {
|
|
739
|
+
opacity: number;
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
interface UseFloatAnimationProps {
|
|
744
|
+
duration?: number;
|
|
745
|
+
delay?: number;
|
|
746
|
+
closeAfter?: number | null;
|
|
747
|
+
closeDuration?: number;
|
|
748
|
+
floatDistance?: number;
|
|
749
|
+
floatDuration?: number;
|
|
750
|
+
}
|
|
751
|
+
declare const useFloatAnimation: ({ duration, delay, closeAfter, closeDuration, floatDistance, floatDuration, }?: UseFloatAnimationProps) => {
|
|
752
|
+
animatedStyle: {
|
|
753
|
+
opacity: number;
|
|
754
|
+
transform: {
|
|
755
|
+
translateY: number;
|
|
756
|
+
}[];
|
|
757
|
+
};
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
interface UseGrowAnimationProps {
|
|
761
|
+
duration?: number;
|
|
762
|
+
delay?: number;
|
|
763
|
+
closeAfter?: number | null;
|
|
764
|
+
initialScale?: number;
|
|
765
|
+
}
|
|
766
|
+
declare const useGrowAnimation: ({ duration, delay, closeAfter, initialScale, }?: UseGrowAnimationProps) => {
|
|
767
|
+
animatedStyle: {
|
|
768
|
+
transform: {
|
|
769
|
+
scale: number;
|
|
770
|
+
}[];
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
interface UseRollAnimationProps {
|
|
775
|
+
duration?: number;
|
|
776
|
+
delay?: number;
|
|
777
|
+
closeAfter?: number | null;
|
|
778
|
+
initialTranslateY?: number;
|
|
779
|
+
initialRotate?: string;
|
|
780
|
+
}
|
|
781
|
+
declare const useRollAnimation: ({ duration, delay, closeAfter, initialTranslateY, initialRotate, }?: UseRollAnimationProps) => {
|
|
782
|
+
animatedStyle: {
|
|
783
|
+
transform: ({
|
|
784
|
+
translateY: number;
|
|
785
|
+
rotate?: undefined;
|
|
786
|
+
} | {
|
|
787
|
+
rotate: string;
|
|
788
|
+
translateY?: undefined;
|
|
789
|
+
})[];
|
|
790
|
+
};
|
|
791
|
+
};
|
|
792
|
+
|
|
793
|
+
interface UseSlideAnimationProps {
|
|
794
|
+
duration?: number;
|
|
795
|
+
delay?: number;
|
|
796
|
+
direction?: "up" | "down" | "left" | "right";
|
|
797
|
+
closeAfter?: number | null;
|
|
798
|
+
initialValue?: number;
|
|
799
|
+
}
|
|
800
|
+
declare const useSlideAnimation: ({ duration, delay, direction, closeAfter, initialValue, }?: UseSlideAnimationProps) => {
|
|
801
|
+
animatedStyle: {
|
|
802
|
+
transform: {
|
|
803
|
+
translateY: number;
|
|
804
|
+
}[];
|
|
805
|
+
} | {
|
|
806
|
+
transform: {
|
|
807
|
+
translateX: number;
|
|
808
|
+
}[];
|
|
809
|
+
};
|
|
810
|
+
};
|
|
811
|
+
|
|
812
|
+
interface UseThrownUpAnimationProps {
|
|
813
|
+
delay?: number;
|
|
814
|
+
closeAfter?: number | null;
|
|
815
|
+
}
|
|
816
|
+
declare const useThrownUpAnimation: ({ delay, closeAfter, }?: UseThrownUpAnimationProps) => {
|
|
817
|
+
animatedStyle: {
|
|
818
|
+
transform: {
|
|
819
|
+
translateY: number;
|
|
820
|
+
}[];
|
|
821
|
+
opacity: number;
|
|
822
|
+
};
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Unified Animator component that handles multiple animation types with type-safe props.
|
|
827
|
+
*
|
|
828
|
+
* Each animation type only accepts its relevant props, ensuring type safety and better developer experience.
|
|
829
|
+
*
|
|
830
|
+
* @example
|
|
831
|
+
* // Fade animation - only accepts base props
|
|
832
|
+
* <Animator type="fade" duration={1000} closeAfter={3000}>
|
|
833
|
+
* <Text>This will fade in and out</Text>
|
|
834
|
+
* </Animator>
|
|
835
|
+
*
|
|
836
|
+
* @example
|
|
837
|
+
* // Slide animation - only accepts direction and initialValue props
|
|
838
|
+
* <Animator type="slide" direction="up" duration={800} closeAfter={2000}>
|
|
839
|
+
* <View>This will slide up from bottom</View>
|
|
840
|
+
* </Animator>
|
|
841
|
+
*
|
|
842
|
+
* @example
|
|
843
|
+
* // Grow animation - only accepts initialScale prop
|
|
844
|
+
* <Animator type="grow" initialScale={0.5} duration={600}>
|
|
845
|
+
* <Button>This will grow from 50% scale</Button>
|
|
846
|
+
* </Animator>
|
|
847
|
+
*
|
|
848
|
+
* @example
|
|
849
|
+
* // Blink animation - only accepts blink-specific props
|
|
850
|
+
* <Animator type="blink" blinkDuration={1000} minOpacity={0.3}>
|
|
851
|
+
* <Icon>This will blink continuously</Icon>
|
|
852
|
+
* </Animator>
|
|
853
|
+
*
|
|
854
|
+
* @example
|
|
855
|
+
* // TypeScript will show errors for invalid prop combinations:
|
|
856
|
+
* // ❌ This will cause a TypeScript error:
|
|
857
|
+
* // <Animator type="fade" direction="up"> // direction is not valid for fade
|
|
858
|
+
* //
|
|
859
|
+
* // ✅ This is correct:
|
|
860
|
+
* // <Animator type="slide" direction="up">
|
|
861
|
+
*/
|
|
862
|
+
declare const Animator: FC<AnimatorProps>;
|
|
863
|
+
|
|
705
864
|
declare const HoddyUI: {
|
|
706
865
|
initialize: typeof initialize;
|
|
707
866
|
};
|
|
708
867
|
|
|
709
|
-
export { AdaptiveStatusBar, AlertX, type AlertXProps, type AnimationType, 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, useThemeContext };
|
|
868
|
+
export { AdaptiveStatusBar, AlertX, type AlertXProps, type AnimationType, Animator, 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, useAppState, useBlinkAnimation, useColors, useFadeAnimation, useFloatAnimation, useGrowAnimation, useNavScreenOptions, useRollAnimation, useSlideAnimation, useTheme, useThemeContext, useThrownUpAnimation };
|
package/next/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React, { ReactNode, FC } from 'react';
|
|
2
|
-
import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps, StyleProp, TextInput } from 'react-native';
|
|
2
|
+
import { ViewStyle, TextStyle, NativeSyntheticEvent, NativeScrollEvent, TextInputProps, TextProps, StyleProp, ViewProps, ScrollView, View, TextInput } from 'react-native';
|
|
3
3
|
|
|
4
4
|
type ThemeTypes = "dark" | "light";
|
|
5
5
|
type ThemeModes = "dark" | "light" | "default";
|
|
@@ -231,6 +231,7 @@ interface TypographyProps extends TextProps {
|
|
|
231
231
|
color?: colorTypes | (string & {});
|
|
232
232
|
style?: StyleProp<TextStyle | ViewStyle>;
|
|
233
233
|
textCase?: "capitalize" | "uppercase" | "lowercase" | undefined;
|
|
234
|
+
lineHeight?: number;
|
|
234
235
|
variant?: "caption" | "body1" | "body2" | "h6" | "h5" | "h4" | "h3" | "h2" | "h1";
|
|
235
236
|
align?: "center" | "left" | "right";
|
|
236
237
|
gutterBottom?: number;
|
|
@@ -240,9 +241,8 @@ interface TypographyProps extends TextProps {
|
|
|
240
241
|
fontSize?: number;
|
|
241
242
|
fontWeight?: 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
|
|
242
243
|
}
|
|
243
|
-
interface SafeAreaViewProps {
|
|
244
|
+
interface SafeAreaViewProps extends ViewProps {
|
|
244
245
|
children: ReactNode;
|
|
245
|
-
style?: ViewStyle;
|
|
246
246
|
}
|
|
247
247
|
interface SelectMenuProps {
|
|
248
248
|
open: boolean;
|
|
@@ -325,6 +325,7 @@ type AnimatorProps = (BaseAnimatorProps & {
|
|
|
325
325
|
type: "thrownup";
|
|
326
326
|
});
|
|
327
327
|
|
|
328
|
+
type TypographyVariant = "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "body1" | "body2" | "caption";
|
|
328
329
|
/**
|
|
329
330
|
* Configuration options for the Hoddy UI library
|
|
330
331
|
*
|
|
@@ -344,6 +345,12 @@ type AnimatorProps = (BaseAnimatorProps & {
|
|
|
344
345
|
* 500: "Inter-Medium",
|
|
345
346
|
* 600: "Inter-SemiBold",
|
|
346
347
|
* 700: "Inter-Bold"
|
|
348
|
+
* },
|
|
349
|
+
* fontSizes: {
|
|
350
|
+
* h1: 48,
|
|
351
|
+
* h2: 40,
|
|
352
|
+
* body1: 16,
|
|
353
|
+
* caption: 12
|
|
347
354
|
* }
|
|
348
355
|
* }
|
|
349
356
|
* });
|
|
@@ -364,6 +371,10 @@ type configProps = {
|
|
|
364
371
|
fontWeights?: {
|
|
365
372
|
[K in 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900]?: string;
|
|
366
373
|
};
|
|
374
|
+
/** Custom font sizes for each typography variant (values in pixels, will be scaled with ms()) */
|
|
375
|
+
fontSizes?: {
|
|
376
|
+
[K in TypographyVariant]?: number;
|
|
377
|
+
};
|
|
367
378
|
};
|
|
368
379
|
};
|
|
369
380
|
declare function initialize(config: configProps): void;
|
|
@@ -384,7 +395,7 @@ declare const CheckBox: FC<CheckboxProps>;
|
|
|
384
395
|
|
|
385
396
|
declare const showFlashMessage: (msg: FlashMessageProps) => void;
|
|
386
397
|
|
|
387
|
-
declare const FormWrapper: React.
|
|
398
|
+
declare const FormWrapper: React.ForwardRefExoticComponent<FormWrapperProps & React.RefAttributes<ScrollView>>;
|
|
388
399
|
|
|
389
400
|
declare const RatingInput: FC<RatingInputProps>;
|
|
390
401
|
declare const RatingStars: FC<RatingStarsProps>;
|
|
@@ -427,7 +438,7 @@ declare const Locator: React.FC<LocatorProps>;
|
|
|
427
438
|
|
|
428
439
|
declare const Popup: React.FC<PopupProps>;
|
|
429
440
|
|
|
430
|
-
declare const SafeAreaView: React.
|
|
441
|
+
declare const SafeAreaView: React.ForwardRefExoticComponent<SafeAreaViewProps & React.RefAttributes<View>>;
|
|
431
442
|
|
|
432
443
|
declare const Divider: FC<DividerProps>;
|
|
433
444
|
|
|
@@ -702,8 +713,156 @@ declare const useNavScreenOptions: (type: "stack" | "tab" | "drawer") => any;
|
|
|
702
713
|
declare const UIThemeContext: React.Context<ThemeContext>;
|
|
703
714
|
declare const UIThemeProvider: ({ children }: ThemeProviderProps) => React.JSX.Element;
|
|
704
715
|
|
|
716
|
+
declare const useAppState: () => {
|
|
717
|
+
isActive: boolean;
|
|
718
|
+
};
|
|
719
|
+
|
|
720
|
+
interface UseBlinkAnimationProps {
|
|
721
|
+
delay?: number;
|
|
722
|
+
blinkDuration?: number;
|
|
723
|
+
minOpacity?: number;
|
|
724
|
+
maxOpacity?: number;
|
|
725
|
+
}
|
|
726
|
+
declare const useBlinkAnimation: ({ delay, blinkDuration, minOpacity, maxOpacity, }?: UseBlinkAnimationProps) => {
|
|
727
|
+
animatedStyle: {
|
|
728
|
+
opacity: number;
|
|
729
|
+
};
|
|
730
|
+
};
|
|
731
|
+
|
|
732
|
+
interface UseFadeAnimationProps {
|
|
733
|
+
duration?: number;
|
|
734
|
+
delay?: number;
|
|
735
|
+
closeAfter?: number | null;
|
|
736
|
+
}
|
|
737
|
+
declare const useFadeAnimation: ({ duration, delay, closeAfter, }?: UseFadeAnimationProps) => {
|
|
738
|
+
animatedStyle: {
|
|
739
|
+
opacity: number;
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
|
|
743
|
+
interface UseFloatAnimationProps {
|
|
744
|
+
duration?: number;
|
|
745
|
+
delay?: number;
|
|
746
|
+
closeAfter?: number | null;
|
|
747
|
+
closeDuration?: number;
|
|
748
|
+
floatDistance?: number;
|
|
749
|
+
floatDuration?: number;
|
|
750
|
+
}
|
|
751
|
+
declare const useFloatAnimation: ({ duration, delay, closeAfter, closeDuration, floatDistance, floatDuration, }?: UseFloatAnimationProps) => {
|
|
752
|
+
animatedStyle: {
|
|
753
|
+
opacity: number;
|
|
754
|
+
transform: {
|
|
755
|
+
translateY: number;
|
|
756
|
+
}[];
|
|
757
|
+
};
|
|
758
|
+
};
|
|
759
|
+
|
|
760
|
+
interface UseGrowAnimationProps {
|
|
761
|
+
duration?: number;
|
|
762
|
+
delay?: number;
|
|
763
|
+
closeAfter?: number | null;
|
|
764
|
+
initialScale?: number;
|
|
765
|
+
}
|
|
766
|
+
declare const useGrowAnimation: ({ duration, delay, closeAfter, initialScale, }?: UseGrowAnimationProps) => {
|
|
767
|
+
animatedStyle: {
|
|
768
|
+
transform: {
|
|
769
|
+
scale: number;
|
|
770
|
+
}[];
|
|
771
|
+
};
|
|
772
|
+
};
|
|
773
|
+
|
|
774
|
+
interface UseRollAnimationProps {
|
|
775
|
+
duration?: number;
|
|
776
|
+
delay?: number;
|
|
777
|
+
closeAfter?: number | null;
|
|
778
|
+
initialTranslateY?: number;
|
|
779
|
+
initialRotate?: string;
|
|
780
|
+
}
|
|
781
|
+
declare const useRollAnimation: ({ duration, delay, closeAfter, initialTranslateY, initialRotate, }?: UseRollAnimationProps) => {
|
|
782
|
+
animatedStyle: {
|
|
783
|
+
transform: ({
|
|
784
|
+
translateY: number;
|
|
785
|
+
rotate?: undefined;
|
|
786
|
+
} | {
|
|
787
|
+
rotate: string;
|
|
788
|
+
translateY?: undefined;
|
|
789
|
+
})[];
|
|
790
|
+
};
|
|
791
|
+
};
|
|
792
|
+
|
|
793
|
+
interface UseSlideAnimationProps {
|
|
794
|
+
duration?: number;
|
|
795
|
+
delay?: number;
|
|
796
|
+
direction?: "up" | "down" | "left" | "right";
|
|
797
|
+
closeAfter?: number | null;
|
|
798
|
+
initialValue?: number;
|
|
799
|
+
}
|
|
800
|
+
declare const useSlideAnimation: ({ duration, delay, direction, closeAfter, initialValue, }?: UseSlideAnimationProps) => {
|
|
801
|
+
animatedStyle: {
|
|
802
|
+
transform: {
|
|
803
|
+
translateY: number;
|
|
804
|
+
}[];
|
|
805
|
+
} | {
|
|
806
|
+
transform: {
|
|
807
|
+
translateX: number;
|
|
808
|
+
}[];
|
|
809
|
+
};
|
|
810
|
+
};
|
|
811
|
+
|
|
812
|
+
interface UseThrownUpAnimationProps {
|
|
813
|
+
delay?: number;
|
|
814
|
+
closeAfter?: number | null;
|
|
815
|
+
}
|
|
816
|
+
declare const useThrownUpAnimation: ({ delay, closeAfter, }?: UseThrownUpAnimationProps) => {
|
|
817
|
+
animatedStyle: {
|
|
818
|
+
transform: {
|
|
819
|
+
translateY: number;
|
|
820
|
+
}[];
|
|
821
|
+
opacity: number;
|
|
822
|
+
};
|
|
823
|
+
};
|
|
824
|
+
|
|
825
|
+
/**
|
|
826
|
+
* Unified Animator component that handles multiple animation types with type-safe props.
|
|
827
|
+
*
|
|
828
|
+
* Each animation type only accepts its relevant props, ensuring type safety and better developer experience.
|
|
829
|
+
*
|
|
830
|
+
* @example
|
|
831
|
+
* // Fade animation - only accepts base props
|
|
832
|
+
* <Animator type="fade" duration={1000} closeAfter={3000}>
|
|
833
|
+
* <Text>This will fade in and out</Text>
|
|
834
|
+
* </Animator>
|
|
835
|
+
*
|
|
836
|
+
* @example
|
|
837
|
+
* // Slide animation - only accepts direction and initialValue props
|
|
838
|
+
* <Animator type="slide" direction="up" duration={800} closeAfter={2000}>
|
|
839
|
+
* <View>This will slide up from bottom</View>
|
|
840
|
+
* </Animator>
|
|
841
|
+
*
|
|
842
|
+
* @example
|
|
843
|
+
* // Grow animation - only accepts initialScale prop
|
|
844
|
+
* <Animator type="grow" initialScale={0.5} duration={600}>
|
|
845
|
+
* <Button>This will grow from 50% scale</Button>
|
|
846
|
+
* </Animator>
|
|
847
|
+
*
|
|
848
|
+
* @example
|
|
849
|
+
* // Blink animation - only accepts blink-specific props
|
|
850
|
+
* <Animator type="blink" blinkDuration={1000} minOpacity={0.3}>
|
|
851
|
+
* <Icon>This will blink continuously</Icon>
|
|
852
|
+
* </Animator>
|
|
853
|
+
*
|
|
854
|
+
* @example
|
|
855
|
+
* // TypeScript will show errors for invalid prop combinations:
|
|
856
|
+
* // ❌ This will cause a TypeScript error:
|
|
857
|
+
* // <Animator type="fade" direction="up"> // direction is not valid for fade
|
|
858
|
+
* //
|
|
859
|
+
* // ✅ This is correct:
|
|
860
|
+
* // <Animator type="slide" direction="up">
|
|
861
|
+
*/
|
|
862
|
+
declare const Animator: FC<AnimatorProps>;
|
|
863
|
+
|
|
705
864
|
declare const HoddyUI: {
|
|
706
865
|
initialize: typeof initialize;
|
|
707
866
|
};
|
|
708
867
|
|
|
709
|
-
export { AdaptiveStatusBar, AlertX, type AlertXProps, type AnimationType, 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, useThemeContext };
|
|
868
|
+
export { AdaptiveStatusBar, AlertX, type AlertXProps, type AnimationType, Animator, 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, useAppState, useBlinkAnimation, useColors, useFadeAnimation, useFloatAnimation, useGrowAnimation, useNavScreenOptions, useRollAnimation, useSlideAnimation, useTheme, useThemeContext, useThrownUpAnimation };
|