@hoddy-ui/core 2.5.43 → 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/next/index.ts CHANGED
@@ -27,6 +27,9 @@ export * from "../src/hooks";
27
27
  export * from "../src/theme";
28
28
  export * from "../src/types";
29
29
 
30
+ export * from "../src/Components/Animators/hooks";
31
+ export * from "../src/Components/Animators/Animator";
32
+
30
33
  const HoddyUI = {
31
34
  initialize: initialize,
32
35
  };
package/next/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hoddy-ui/next",
3
- "version": "2.5.68",
3
+ "version": "2.5.76",
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.43",
3
+ "version": "2.5.45",
4
4
  "description": "Core rich react native components written in typescript",
5
5
  "main": "index.ts",
6
6
  "repository": {
@@ -2,6 +2,7 @@ import { useEffect, useRef } from "react";
2
2
  import { Platform } from "react-native";
3
3
  import {
4
4
  Easing,
5
+ runOnJS,
5
6
  useAnimatedStyle,
6
7
  useSharedValue,
7
8
  withDelay,
@@ -76,22 +77,24 @@ export const useFloatAnimation = ({
76
77
  opacity.value = withDelay(
77
78
  delay,
78
79
  withTiming(1, { duration }, () => {
79
- startFloating();
80
-
81
- if (closeAfter) {
82
- opacity.value = withDelay(
83
- closeAfter,
84
- withTiming(0, { duration: closeDuration })
85
- );
86
- translateY.value = withDelay(
87
- closeAfter,
88
- withTiming(0, { duration: closeDuration })
89
- );
90
- isFloating.current = false;
91
- }
80
+ "worklet";
81
+ runOnJS(startFloating)();
92
82
  })
93
83
  );
94
84
 
85
+ // Handle auto-close
86
+ if (closeAfter) {
87
+ const totalDelay = delay + duration + closeAfter;
88
+ opacity.value = withDelay(
89
+ totalDelay,
90
+ withTiming(0, { duration: closeDuration })
91
+ );
92
+ translateY.value = withDelay(
93
+ totalDelay,
94
+ withTiming(0, { duration: closeDuration })
95
+ );
96
+ }
97
+
95
98
  return () => {
96
99
  opacity.value = 0;
97
100
  translateY.value = 0;
@@ -1,20 +1,23 @@
1
- import React from "react";
1
+ import React, { forwardRef } from "react";
2
2
  import { useSafeAreaInsets } from "react-native-safe-area-context";
3
3
 
4
4
  import { StyleSheet, View } from "react-native";
5
5
  import { SafeAreaViewProps } from "../types";
6
6
 
7
- export const SafeAreaView: React.FC<SafeAreaViewProps> = ({
8
- children,
9
- style,
10
- }) => {
11
- const { top, bottom } = useSafeAreaInsets();
12
- const styles = StyleSheet.create({
13
- root: {
14
- paddingTop: top,
15
- paddingBottom: bottom,
16
- flex: 1,
17
- },
18
- });
19
- return <View style={[styles.root, style]}>{children}</View>;
20
- };
7
+ export const SafeAreaView = forwardRef<View, SafeAreaViewProps>(
8
+ ({ children, style, ...rest }, ref) => {
9
+ const { top, bottom } = useSafeAreaInsets();
10
+ const styles = StyleSheet.create({
11
+ root: {
12
+ paddingTop: top,
13
+ paddingBottom: bottom,
14
+ flex: 1,
15
+ },
16
+ });
17
+ return (
18
+ <View ref={ref} style={[styles.root, style]} {...rest}>
19
+ {children}
20
+ </View>
21
+ );
22
+ }
23
+ );
@@ -33,6 +33,7 @@ const Typography: React.FC<TypographyProps> = forwardRef(
33
33
  fontWeight = 400,
34
34
  fontFamily, // NEW PROP ADDED
35
35
  fontSize,
36
+ lineHeight,
36
37
  ...props
37
38
  },
38
39
  ref
@@ -45,9 +46,10 @@ const Typography: React.FC<TypographyProps> = forwardRef(
45
46
  const baseFontSize =
46
47
  customFontSizes?.[variant] ?? DEFAULT_FONT_SIZES[variant];
47
48
  const f = fontSize || baseFontSize;
49
+ const lh = lineHeight || f * 1.2;
48
50
  const styles: any = StyleSheet.create({
49
51
  text: {
50
- lineHeight: f * 1.2,
52
+ lineHeight: lh,
51
53
  fontSize: f,
52
54
  marginBottom: ms(gutterBottom) || 0,
53
55
  color: colors[color]?.main || color,
package/src/types.ts CHANGED
@@ -6,6 +6,7 @@ import {
6
6
  TextInputProps,
7
7
  TextProps,
8
8
  TextStyle,
9
+ ViewProps,
9
10
  ViewStyle,
10
11
  } from "react-native";
11
12
 
@@ -261,6 +262,7 @@ export interface TypographyProps extends TextProps {
261
262
  color?: colorTypes | (string & {});
262
263
  style?: StyleProp<TextStyle | ViewStyle>;
263
264
  textCase?: "capitalize" | "uppercase" | "lowercase" | undefined;
265
+ lineHeight?: number;
264
266
  variant?:
265
267
  | "caption"
266
268
  | "body1"
@@ -280,9 +282,8 @@ export interface TypographyProps extends TextProps {
280
282
  fontWeight?: 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900;
281
283
  }
282
284
 
283
- export interface SafeAreaViewProps {
285
+ export interface SafeAreaViewProps extends ViewProps {
284
286
  children: ReactNode;
285
- style?: ViewStyle;
286
287
  }
287
288
 
288
289
  export interface SelectMenuProps {