@towsila/expo-ui-library 4.11.6 → 4.12.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@towsila/expo-ui-library",
3
- "version": "4.11.6",
3
+ "version": "4.12.1",
4
4
  "description": "",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -0,0 +1,38 @@
1
+ import { View } from "react-native";
2
+ import Skeleton from "./skeleton";
3
+ import { useLanguage } from "../../context/LanguageContext";
4
+ import { useAppTheme } from "../../context/ThemeContext";
5
+
6
+ export default function RequestCardSkeleton() {
7
+ const { colors } = useAppTheme();
8
+ const {isRTL} = useLanguage();
9
+ return (
10
+ <View
11
+ style={{
12
+ backgroundColor: colors.background.card,
13
+ borderRadius: 15,
14
+ padding: 12,
15
+ borderWidth: 1.5,
16
+ borderColor: colors.semantic.border,
17
+ gap: 12,
18
+ }}
19
+ >
20
+ <View style={{ flexDirection: isRTL? "row-reverse":"row", justifyContent: "space-between" }}>
21
+ <Skeleton width={140} height={20} />
22
+ <Skeleton width={70} height={22} radius={11} />
23
+ </View>
24
+ <View style={{ flexDirection: isRTL? "row-reverse":"row", justifyContent: "space-between" }}>
25
+ <Skeleton width={140} height={20} />
26
+ <Skeleton width={70} height={22} radius={11} />
27
+ </View>
28
+ <Skeleton height={36} />
29
+ <Skeleton height={36} />
30
+ <Skeleton height={36} />
31
+ <Skeleton height={1} />
32
+ <View style={{ flexDirection: isRTL? "row-reverse":"row", justifyContent: "space-between" }}>
33
+ <Skeleton width={140} height={20} />
34
+ <Skeleton width={70} height={22} radius={11} />
35
+ </View>
36
+ </View>
37
+ );
38
+ }
@@ -0,0 +1,38 @@
1
+ import { useEffect, useRef } from "react";
2
+ import { Animated, DimensionValue, StyleProp, ViewStyle } from "react-native";
3
+ import { useAppTheme } from "../../context/ThemeContext";
4
+
5
+ export default function Skeleton({
6
+ width = "100%",
7
+ height = 16,
8
+ radius = 8,
9
+ style,
10
+ }: {
11
+ width?: DimensionValue;
12
+ height?: number;
13
+ radius?: number;
14
+ style?: StyleProp<ViewStyle>;
15
+ }) {
16
+ const { colors } = useAppTheme();
17
+ const opacity = useRef(new Animated.Value(0.4)).current;
18
+
19
+ useEffect(() => {
20
+ const loop = Animated.loop(
21
+ Animated.sequence([
22
+ Animated.timing(opacity, { toValue: 1, duration: 700, useNativeDriver: true }),
23
+ Animated.timing(opacity, { toValue: 0.4, duration: 700, useNativeDriver: true }),
24
+ ])
25
+ );
26
+ loop.start();
27
+ return () => loop.stop();
28
+ }, []);
29
+
30
+ return (
31
+ <Animated.View
32
+ style={[
33
+ { width, height, borderRadius: radius, backgroundColor: colors.semantic.border, opacity },
34
+ style,
35
+ ]}
36
+ />
37
+ );
38
+ }
package/src/index.ts CHANGED
@@ -83,4 +83,6 @@ export { default as RequestCard } from "./components/ui/requestCard";
83
83
  export { Request, RequestStatus } from "./types/request";
84
84
  export {default as TextArea} from "./components/ui/textArea";
85
85
  export {default as ConfirmDeleteScreen} from "./components/screens/confirmDeleteScreen";
86
- export {useConfirmDeleteForm} from "./hooks/useDeleteAccount";
86
+ export {useConfirmDeleteForm} from "./hooks/useDeleteAccount";
87
+ export {default as Skeleton} from "./components/ui/skeleton";
88
+ export {default as RequestCardSkeleton} from "./components/ui/requestCardSkeleton";