@codeimplants/ui-kit 1.0.0 → 1.0.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/dist/components/icons/animated/errors/AnimatedClientError.js +21 -9
- package/dist/components/icons/animated/errors/AnimatedCrash.js +47 -25
- package/dist/components/icons/animated/errors/AnimatedInvalidData.js +23 -13
- package/dist/components/icons/animated/maintenance/AnimatedAlert.js +54 -15
- package/dist/components/icons/animated/maintenance/AnimatedEmergency.js +30 -14
- package/dist/components/icons/animated/network/AnimatedTimeout.js +47 -15
- package/dist/components/icons/animated/permissions/AnimatedPermission.js +21 -10
- package/dist/components/icons/animated/permissions/AnimatedPermissionDenied.js +35 -17
- package/package.json +2 -2
- package/src/components/icons/animated/errors/AnimatedClientError.tsx +24 -21
- package/src/components/icons/animated/errors/AnimatedCrash.tsx +52 -68
- package/src/components/icons/animated/errors/AnimatedInvalidData.tsx +28 -42
- package/src/components/icons/animated/maintenance/AnimatedAlert.tsx +63 -33
- package/src/components/icons/animated/maintenance/AnimatedEmergency.tsx +36 -35
- package/src/components/icons/animated/network/AnimatedTimeout.tsx +52 -30
- package/src/components/icons/animated/permissions/AnimatedPermission.tsx +24 -22
- package/src/components/icons/animated/permissions/AnimatedPermissionDenied.tsx +41 -43
- package/src/types/svg.d.ts +20 -0
- package/src/types/reanimated.d.ts +0 -38
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { Animated, Easing } from 'react-native';
|
|
4
4
|
import Svg, { Path, Circle } from 'react-native-svg';
|
|
5
5
|
const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
6
6
|
/**
|
|
@@ -8,13 +8,25 @@ const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
|
8
8
|
* Shows warning triangle with error code
|
|
9
9
|
*/
|
|
10
10
|
export const AnimatedClientError = ({ size = 64, color = '#F59E0B', }) => {
|
|
11
|
-
const pulse =
|
|
11
|
+
const pulse = useRef(new Animated.Value(1)).current;
|
|
12
12
|
useEffect(() => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
Animated.loop(Animated.sequence([
|
|
14
|
+
Animated.timing(pulse, {
|
|
15
|
+
toValue: 1.1,
|
|
16
|
+
duration: 1000,
|
|
17
|
+
easing: Easing.inOut(Easing.ease),
|
|
18
|
+
useNativeDriver: true,
|
|
19
|
+
}),
|
|
20
|
+
Animated.timing(pulse, {
|
|
21
|
+
toValue: 1,
|
|
22
|
+
duration: 1000,
|
|
23
|
+
easing: Easing.inOut(Easing.ease),
|
|
24
|
+
useNativeDriver: true,
|
|
25
|
+
}),
|
|
26
|
+
])).start();
|
|
27
|
+
}, [pulse]);
|
|
28
|
+
return (_jsxs(Svg, { width: size, height: size, viewBox: "0 0 64 64", fill: "none", children: [_jsx(Path, { d: "M32 8 L56 52 L8 52 Z", fill: color, opacity: 0.1 }), _jsx(AnimatedPath, { d: "M32 12 L52 48 L12 48 Z", stroke: color, strokeWidth: "3", fill: "none", strokeLinejoin: "round", style: {
|
|
29
|
+
transform: [{ scale: pulse }],
|
|
30
|
+
} }), _jsx(Path, { d: "M32 22 L32 36", stroke: color, strokeWidth: "3", strokeLinecap: "round" }), _jsx(Circle, { cx: "32", cy: "42", r: "2", fill: color }), _jsx(Path, { d: "M20 28 L18 32 L20 36", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", opacity: 0.6 }), _jsx(Path, { d: "M44 28 L46 32 L44 36", stroke: color, strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", opacity: 0.6 })] }));
|
|
19
31
|
};
|
|
20
32
|
export default AnimatedClientError;
|
|
@@ -1,36 +1,58 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { Animated, Easing } from 'react-native';
|
|
4
4
|
import Svg, { Path, Circle } from 'react-native-svg';
|
|
5
5
|
const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
6
|
-
const AnimatedCircle = Animated.createAnimatedComponent(Circle);
|
|
7
6
|
/**
|
|
8
7
|
* Animated Crash Icon
|
|
9
8
|
* Shows broken pieces with scatter animation
|
|
10
9
|
*/
|
|
11
10
|
export const AnimatedCrash = ({ size = 64, color = '#EF4444', }) => {
|
|
12
|
-
const scatter1 =
|
|
13
|
-
const scatter2 =
|
|
14
|
-
const scatter3 =
|
|
15
|
-
const opacity = useSharedValue(1);
|
|
11
|
+
const scatter1 = useRef(new Animated.Value(0)).current;
|
|
12
|
+
const scatter2 = useRef(new Animated.Value(0)).current;
|
|
13
|
+
const scatter3 = useRef(new Animated.Value(0)).current;
|
|
16
14
|
useEffect(() => {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
15
|
+
const createAnimation = (value, durationOut, durationIn) => {
|
|
16
|
+
return Animated.loop(Animated.sequence([
|
|
17
|
+
Animated.timing(value, {
|
|
18
|
+
toValue: 1,
|
|
19
|
+
duration: durationOut,
|
|
20
|
+
easing: Easing.out(Easing.cubic),
|
|
21
|
+
useNativeDriver: true,
|
|
22
|
+
}),
|
|
23
|
+
Animated.timing(value, {
|
|
24
|
+
toValue: 0,
|
|
25
|
+
duration: durationIn,
|
|
26
|
+
easing: Easing.in(Easing.cubic),
|
|
27
|
+
useNativeDriver: true,
|
|
28
|
+
}),
|
|
29
|
+
]));
|
|
30
|
+
};
|
|
31
|
+
createAnimation(scatter1, 1200, 800).start();
|
|
32
|
+
createAnimation(scatter2, 1300, 700).start();
|
|
33
|
+
createAnimation(scatter3, 1100, 900).start();
|
|
34
|
+
}, [scatter1, scatter2, scatter3]);
|
|
35
|
+
const style1 = {
|
|
36
|
+
transform: [
|
|
37
|
+
{ translateX: scatter1.interpolate({ inputRange: [0, 1], outputRange: [0, -8] }) },
|
|
38
|
+
{ translateY: scatter1.interpolate({ inputRange: [0, 1], outputRange: [0, -8] }) },
|
|
39
|
+
],
|
|
40
|
+
opacity: scatter1.interpolate({ inputRange: [0, 1], outputRange: [1, 0.5] }),
|
|
41
|
+
};
|
|
42
|
+
const style2 = {
|
|
43
|
+
transform: [
|
|
44
|
+
{ translateX: scatter2.interpolate({ inputRange: [0, 1], outputRange: [0, 8] }) },
|
|
45
|
+
{ translateY: scatter2.interpolate({ inputRange: [0, 1], outputRange: [0, -6] }) },
|
|
46
|
+
],
|
|
47
|
+
opacity: scatter2.interpolate({ inputRange: [0, 1], outputRange: [1, 0.5] }),
|
|
48
|
+
};
|
|
49
|
+
const style3 = {
|
|
50
|
+
transform: [
|
|
51
|
+
{ translateX: scatter3.interpolate({ inputRange: [0, 1], outputRange: [0, -6] }) },
|
|
52
|
+
{ translateY: scatter3.interpolate({ inputRange: [0, 1], outputRange: [0, 8] }) },
|
|
53
|
+
],
|
|
54
|
+
opacity: scatter3.interpolate({ inputRange: [0, 1], outputRange: [1, 0.5] }),
|
|
55
|
+
};
|
|
56
|
+
return (_jsxs(Svg, { width: size, height: size, viewBox: "0 0 64 64", fill: "none", children: [_jsx(AnimatedPath, { d: "M20 16 L28 20 L24 28 L16 24 Z", fill: color, style: style1 }), _jsx(AnimatedPath, { d: "M36 20 L44 16 L48 24 L40 28 Z", fill: color, style: style2 }), _jsx(AnimatedPath, { d: "M24 36 L40 36 L38 48 L26 48 Z", fill: color, style: style3 }), _jsx(Path, { d: "M32 12 L32 52 M12 32 L52 32", stroke: color, strokeWidth: "2", strokeLinecap: "round", opacity: 0.4 }), _jsx(Circle, { cx: "32", cy: "32", r: "6", fill: color, opacity: 0.6 }), _jsx(Path, { d: "M32 28 L32 32 M32 34 L32 35", stroke: "#FFFFFF", strokeWidth: "2", strokeLinecap: "round" })] }));
|
|
35
57
|
};
|
|
36
58
|
export default AnimatedCrash;
|
|
@@ -1,24 +1,34 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { Animated, Easing } from 'react-native';
|
|
4
4
|
import Svg, { Path, G } from 'react-native-svg';
|
|
5
5
|
const AnimatedG = Animated.createAnimatedComponent(G);
|
|
6
|
-
const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
7
6
|
/**
|
|
8
7
|
* Animated Invalid Data Icon
|
|
9
8
|
* Shows corrupted file/document with glitch effect
|
|
10
9
|
*/
|
|
11
10
|
export const AnimatedInvalidData = ({ size = 64, color = '#EF4444', }) => {
|
|
12
|
-
const glitch =
|
|
13
|
-
const opacity =
|
|
11
|
+
const glitch = useRef(new Animated.Value(0)).current;
|
|
12
|
+
const opacity = useRef(new Animated.Value(1)).current;
|
|
14
13
|
useEffect(() => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
Animated.loop(Animated.sequence([
|
|
15
|
+
Animated.timing(glitch, { toValue: 0, duration: 2000, useNativeDriver: true }),
|
|
16
|
+
Animated.timing(glitch, { toValue: 3, duration: 100, easing: Easing.linear, useNativeDriver: true }),
|
|
17
|
+
Animated.timing(glitch, { toValue: 0, duration: 100, useNativeDriver: true }),
|
|
18
|
+
Animated.timing(glitch, { toValue: -2, duration: 100, useNativeDriver: true }),
|
|
19
|
+
Animated.timing(glitch, { toValue: 0, duration: 100, useNativeDriver: true }),
|
|
20
|
+
])).start();
|
|
21
|
+
Animated.loop(Animated.sequence([
|
|
22
|
+
Animated.timing(opacity, { toValue: 1, duration: 2000, useNativeDriver: true }),
|
|
23
|
+
Animated.timing(opacity, { toValue: 0.7, duration: 100, useNativeDriver: true }),
|
|
24
|
+
Animated.timing(opacity, { toValue: 1, duration: 100, useNativeDriver: true }),
|
|
25
|
+
Animated.timing(opacity, { toValue: 0.8, duration: 100, useNativeDriver: true }),
|
|
26
|
+
Animated.timing(opacity, { toValue: 1, duration: 100, useNativeDriver: true }),
|
|
27
|
+
])).start();
|
|
28
|
+
}, [glitch, opacity]);
|
|
29
|
+
return (_jsxs(Svg, { width: size, height: size, viewBox: "0 0 64 64", fill: "none", children: [_jsx(Path, { d: "M16 8 L40 8 L48 16 L48 56 L16 56 Z", stroke: color, strokeWidth: "2", fill: "none" }), _jsx(Path, { d: "M40 8 L40 16 L48 16", stroke: color, strokeWidth: "2", fill: "none" }), _jsxs(AnimatedG, { style: {
|
|
30
|
+
transform: [{ translateX: glitch }],
|
|
31
|
+
opacity: opacity,
|
|
32
|
+
}, children: [_jsx(Path, { d: "M22 24 L42 24", stroke: color, strokeWidth: "2", strokeLinecap: "round", opacity: 0.6 }), _jsx(Path, { d: "M22 32 L38 32", stroke: color, strokeWidth: "2", strokeLinecap: "round", opacity: 0.6 }), _jsx(Path, { d: "M22 40 L40 40", stroke: color, strokeWidth: "2", strokeLinecap: "round", opacity: 0.6 })] }), _jsx(Path, { d: "M26 44 L38 56 M38 44 L26 56", stroke: color, strokeWidth: "3", strokeLinecap: "round" }), _jsx(Path, { d: "M28 28 L30 28 M34 28 L36 28", stroke: color, strokeWidth: "2", strokeLinecap: "round", opacity: 0.4 })] }));
|
|
23
33
|
};
|
|
24
34
|
export default AnimatedInvalidData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { Animated, Easing } from 'react-native';
|
|
4
4
|
import Svg, { Path, Circle } from 'react-native-svg';
|
|
5
5
|
const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
6
6
|
const AnimatedCircle = Animated.createAnimatedComponent(Circle);
|
|
@@ -9,19 +9,58 @@ const AnimatedCircle = Animated.createAnimatedComponent(Circle);
|
|
|
9
9
|
* Alert bell with ringing animation
|
|
10
10
|
*/
|
|
11
11
|
export const AnimatedAlert = ({ size = 64, color = '#F59E0B', }) => {
|
|
12
|
-
const rotation =
|
|
13
|
-
const ringPulse =
|
|
12
|
+
const rotation = useRef(new Animated.Value(0)).current;
|
|
13
|
+
const ringPulse = useRef(new Animated.Value(0)).current;
|
|
14
14
|
useEffect(() => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
Animated.loop(Animated.sequence([
|
|
16
|
+
Animated.timing(rotation, {
|
|
17
|
+
toValue: 1,
|
|
18
|
+
duration: 150,
|
|
19
|
+
easing: Easing.inOut(Easing.ease),
|
|
20
|
+
useNativeDriver: true,
|
|
21
|
+
}),
|
|
22
|
+
Animated.timing(rotation, {
|
|
23
|
+
toValue: -1,
|
|
24
|
+
duration: 150,
|
|
25
|
+
easing: Easing.inOut(Easing.ease),
|
|
26
|
+
useNativeDriver: true,
|
|
27
|
+
}),
|
|
28
|
+
])).start();
|
|
29
|
+
Animated.loop(Animated.timing(ringPulse, {
|
|
30
|
+
toValue: 1,
|
|
31
|
+
duration: 1000,
|
|
32
|
+
easing: Easing.out(Easing.ease),
|
|
33
|
+
useNativeDriver: true,
|
|
34
|
+
})).start();
|
|
35
|
+
}, [rotation, ringPulse]);
|
|
36
|
+
const bellStyle = {
|
|
37
|
+
transform: [
|
|
38
|
+
{ translateX: 32 },
|
|
39
|
+
{ translateY: 24 },
|
|
40
|
+
{ rotate: rotation.interpolate({
|
|
41
|
+
inputRange: [-1, 1],
|
|
42
|
+
outputRange: ['-10deg', '10deg'],
|
|
43
|
+
}) },
|
|
44
|
+
{ translateX: -32 },
|
|
45
|
+
{ translateY: -24 },
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
const ringStyle = {
|
|
49
|
+
opacity: ringPulse.interpolate({
|
|
50
|
+
inputRange: [0, 1],
|
|
51
|
+
outputRange: [1, 0],
|
|
52
|
+
}),
|
|
53
|
+
transform: [
|
|
54
|
+
{ translateX: 32 },
|
|
55
|
+
{ translateY: 28 },
|
|
56
|
+
{ scale: ringPulse.interpolate({
|
|
57
|
+
inputRange: [0, 1],
|
|
58
|
+
outputRange: [0.8, 1.3],
|
|
59
|
+
}) },
|
|
60
|
+
{ translateX: -32 },
|
|
61
|
+
{ translateY: -28 },
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
return (_jsxs(Svg, { width: size, height: size, viewBox: "0 0 64 64", fill: "none", children: [_jsx(AnimatedCircle, { cx: "32", cy: "28", r: "28", stroke: color, strokeWidth: "2", fill: "none", style: ringStyle }), _jsx(AnimatedPath, { d: "M20 28 C20 20, 26 14, 32 14 C38 14, 44 20, 44 28 L44 36 C44 38, 46 40, 48 40 L16 40 C18 40, 20 38, 20 36 Z", fill: color, opacity: 0.9, style: bellStyle }), _jsx(AnimatedPath, { d: "M32 40 L32 44", stroke: color, strokeWidth: "2", strokeLinecap: "round", style: bellStyle }), _jsx(AnimatedCircle, { cx: "32", cy: "46", r: "2", fill: color, style: bellStyle }), _jsx(Path, { d: "M28 14 C28 12, 30 10, 32 10 C34 10, 36 12, 36 14", stroke: color, strokeWidth: "2", strokeLinecap: "round", fill: "none" }), _jsx(Path, { d: "M12 24 C12 16, 18 10, 26 8 M52 24 C52 16, 46 10, 38 8", stroke: color, strokeWidth: "2", strokeLinecap: "round", opacity: 0.4 })] }));
|
|
26
65
|
};
|
|
27
66
|
export default AnimatedAlert;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { Animated, Easing } from 'react-native';
|
|
4
4
|
import Svg, { Path, G } from 'react-native-svg';
|
|
5
5
|
const AnimatedG = Animated.createAnimatedComponent(G);
|
|
6
6
|
const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
@@ -9,18 +9,34 @@ const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
|
9
9
|
* Emergency siren with flashing light
|
|
10
10
|
*/
|
|
11
11
|
export const AnimatedEmergency = ({ size = 64, color = '#DC2626', }) => {
|
|
12
|
-
const flash =
|
|
13
|
-
const rotate =
|
|
12
|
+
const flash = useRef(new Animated.Value(0)).current;
|
|
13
|
+
const rotate = useRef(new Animated.Value(0)).current;
|
|
14
14
|
useEffect(() => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
Animated.loop(Animated.sequence([
|
|
16
|
+
Animated.timing(flash, { toValue: 1, duration: 300, useNativeDriver: true }),
|
|
17
|
+
Animated.timing(flash, { toValue: 0, duration: 300, useNativeDriver: true }),
|
|
18
|
+
])).start();
|
|
19
|
+
Animated.loop(Animated.timing(rotate, {
|
|
20
|
+
toValue: 1,
|
|
21
|
+
duration: 2000,
|
|
22
|
+
easing: Easing.linear,
|
|
23
|
+
useNativeDriver: true,
|
|
24
|
+
})).start();
|
|
25
|
+
}, [flash, rotate]);
|
|
26
|
+
const rotateStyle = {
|
|
27
|
+
transform: [
|
|
28
|
+
{ translateX: 32 },
|
|
29
|
+
{ translateY: 24 },
|
|
30
|
+
{ rotate: rotate.interpolate({
|
|
31
|
+
inputRange: [0, 1],
|
|
32
|
+
outputRange: ['0deg', '360deg'],
|
|
33
|
+
}) },
|
|
34
|
+
{ translateX: -32 },
|
|
35
|
+
{ translateY: -24 },
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
return (_jsxs(Svg, { width: size, height: size, viewBox: "0 0 64 64", fill: "none", children: [_jsx(AnimatedG, { style: rotateStyle, children: _jsx(Path, { d: "M32 8 L32 16 M48 16 L42 22 M54 32 L46 32 M48 48 L42 42 M32 56 L32 48 M16 48 L22 42 M10 32 L18 32 M16 16 L22 22", stroke: color, strokeWidth: "2", strokeLinecap: "round", opacity: 0.6 }) }), _jsx(Path, { d: "M20 32 L24 24 L40 24 L44 32 Z", fill: color, opacity: 0.3 }), _jsx(AnimatedPath, { d: "M26 24 L32 16 L38 24 Z", fill: color, style: {
|
|
39
|
+
opacity: flash,
|
|
40
|
+
} }), _jsx(Path, { d: "M18 32 L46 32 L44 40 L20 40 Z", fill: color, opacity: 0.8 }), _jsx(Path, { d: "M22 34 L24 38 M28 34 L30 38 M34 34 L36 38 M40 34 L42 38", stroke: "#FFFFFF", strokeWidth: "2", strokeLinecap: "round", opacity: 0.6 }), _jsx(Path, { d: "M32 44 L32 50 M32 52 L32 53", stroke: color, strokeWidth: "3", strokeLinecap: "round" })] }));
|
|
25
41
|
};
|
|
26
42
|
export default AnimatedEmergency;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { Animated, Easing } from 'react-native';
|
|
4
4
|
import Svg, { Circle, Path } from 'react-native-svg';
|
|
5
5
|
const AnimatedCircle = Animated.createAnimatedComponent(Circle);
|
|
6
6
|
const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
@@ -9,19 +9,51 @@ const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
|
9
9
|
* Shows clock with warning indicator
|
|
10
10
|
*/
|
|
11
11
|
export const AnimatedTimeout = ({ size = 64, color = '#F59E0B', }) => {
|
|
12
|
-
const rotation =
|
|
13
|
-
const pulse =
|
|
12
|
+
const rotation = useRef(new Animated.Value(0)).current;
|
|
13
|
+
const pulse = useRef(new Animated.Value(1)).current;
|
|
14
14
|
useEffect(() => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
15
|
+
Animated.loop(Animated.timing(rotation, {
|
|
16
|
+
toValue: 1,
|
|
17
|
+
duration: 2000,
|
|
18
|
+
easing: Easing.linear,
|
|
19
|
+
useNativeDriver: true,
|
|
20
|
+
})).start();
|
|
21
|
+
Animated.loop(Animated.sequence([
|
|
22
|
+
Animated.timing(pulse, {
|
|
23
|
+
toValue: 1.2,
|
|
24
|
+
duration: 800,
|
|
25
|
+
easing: Easing.inOut(Easing.ease),
|
|
26
|
+
useNativeDriver: true,
|
|
27
|
+
}),
|
|
28
|
+
Animated.timing(pulse, {
|
|
29
|
+
toValue: 1,
|
|
30
|
+
duration: 800,
|
|
31
|
+
easing: Easing.inOut(Easing.ease),
|
|
32
|
+
useNativeDriver: true,
|
|
33
|
+
}),
|
|
34
|
+
])).start();
|
|
35
|
+
}, [rotation, pulse]);
|
|
36
|
+
const clockHandStyle = {
|
|
37
|
+
transform: [
|
|
38
|
+
{ translateX: 32 },
|
|
39
|
+
{ translateY: 32 },
|
|
40
|
+
{ rotate: rotation.interpolate({
|
|
41
|
+
inputRange: [0, 1],
|
|
42
|
+
outputRange: ['0deg', '360deg'],
|
|
43
|
+
}) },
|
|
44
|
+
{ translateX: -32 },
|
|
45
|
+
{ translateY: -32 },
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
const warningStyle = {
|
|
49
|
+
transform: [
|
|
50
|
+
{ translateX: 48 },
|
|
51
|
+
{ translateY: 16 },
|
|
52
|
+
{ scale: pulse },
|
|
53
|
+
{ translateX: -48 },
|
|
54
|
+
{ translateY: -16 },
|
|
55
|
+
],
|
|
56
|
+
};
|
|
57
|
+
return (_jsxs(Svg, { width: size, height: size, viewBox: "0 0 64 64", fill: "none", children: [_jsx(Circle, { cx: "32", cy: "32", r: "20", stroke: color, strokeWidth: "3", fill: "none" }), _jsx(Path, { d: "M32 14 L32 16 M32 48 L32 50 M14 32 L16 32 M48 32 L50 32", stroke: color, strokeWidth: "2", strokeLinecap: "round", opacity: 0.4 }), _jsx(AnimatedPath, { d: "M32 32 L32 20", stroke: color, strokeWidth: "2.5", strokeLinecap: "round", style: clockHandStyle }), _jsx(Path, { d: "M32 32 L38 32", stroke: color, strokeWidth: "2", strokeLinecap: "round" }), _jsx(Circle, { cx: "32", cy: "32", r: "2", fill: color }), _jsx(AnimatedCircle, { cx: "48", cy: "16", r: "6", fill: color, style: warningStyle }), _jsx(Path, { d: "M48 13 L48 16 M48 18 L48 18.5", stroke: "#FFFFFF", strokeWidth: "1.5", strokeLinecap: "round" })] }));
|
|
26
58
|
};
|
|
27
59
|
export default AnimatedTimeout;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { Animated, Easing } from 'react-native';
|
|
4
4
|
import Svg, { Path, G } from 'react-native-svg';
|
|
5
5
|
const AnimatedG = Animated.createAnimatedComponent(G);
|
|
6
6
|
/**
|
|
@@ -8,14 +8,25 @@ const AnimatedG = Animated.createAnimatedComponent(G);
|
|
|
8
8
|
* Generic permission icon with shield and checkmark
|
|
9
9
|
*/
|
|
10
10
|
export const AnimatedPermission = ({ size = 64, color = '#3B82F6', }) => {
|
|
11
|
-
const scale =
|
|
11
|
+
const scale = useRef(new Animated.Value(1)).current;
|
|
12
12
|
useEffect(() => {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
Animated.loop(Animated.sequence([
|
|
14
|
+
Animated.timing(scale, {
|
|
15
|
+
toValue: 1.1,
|
|
16
|
+
duration: 1500,
|
|
17
|
+
easing: Easing.inOut(Easing.ease),
|
|
18
|
+
useNativeDriver: true,
|
|
19
|
+
}),
|
|
20
|
+
Animated.timing(scale, {
|
|
21
|
+
toValue: 1,
|
|
22
|
+
duration: 1500,
|
|
23
|
+
easing: Easing.inOut(Easing.ease),
|
|
24
|
+
useNativeDriver: true,
|
|
25
|
+
}),
|
|
26
|
+
])).start();
|
|
27
|
+
}, [scale]);
|
|
28
|
+
return (_jsxs(Svg, { width: size, height: size, viewBox: "0 0 64 64", fill: "none", children: [_jsx(Path, { d: "M32 8 C32 8, 48 12, 48 20 C48 36, 32 56, 32 56 C32 56, 16 36, 16 20 C16 12, 32 8, 32 8 Z", fill: color, opacity: 0.1 }), _jsx(Path, { d: "M32 10 C32 10, 46 14, 46 20 C46 34, 32 52, 32 52 C32 52, 18 34, 18 20 C18 14, 32 10, 32 10 Z", stroke: color, strokeWidth: "2.5", fill: "none" }), _jsx(AnimatedG, { style: {
|
|
29
|
+
transform: [{ scale: scale }],
|
|
30
|
+
}, children: _jsx(Path, { d: "M24 30 L30 36 L42 24", stroke: color, strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round" }) })] }));
|
|
20
31
|
};
|
|
21
32
|
export default AnimatedPermission;
|
|
@@ -1,27 +1,45 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useEffect } from 'react';
|
|
3
|
-
import
|
|
4
|
-
import Svg, { Path
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import { Animated, Easing } from 'react-native';
|
|
4
|
+
import Svg, { Path } from 'react-native-svg';
|
|
5
5
|
const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
6
|
-
const AnimatedCircle = Animated.createAnimatedComponent(Circle);
|
|
7
6
|
/**
|
|
8
7
|
* Animated Permission Denied Icon
|
|
9
8
|
* Shield with X mark for denied permissions
|
|
10
9
|
*/
|
|
11
10
|
export const AnimatedPermissionDenied = ({ size = 64, color = '#EF4444', }) => {
|
|
12
|
-
const shake =
|
|
13
|
-
const pulse =
|
|
11
|
+
const shake = useRef(new Animated.Value(0)).current;
|
|
12
|
+
const pulse = useRef(new Animated.Value(1)).current;
|
|
14
13
|
useEffect(() => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
14
|
+
Animated.loop(Animated.sequence([
|
|
15
|
+
Animated.timing(shake, { toValue: 0, duration: 2000, useNativeDriver: true }),
|
|
16
|
+
Animated.timing(shake, { toValue: -3, duration: 50, useNativeDriver: true }),
|
|
17
|
+
Animated.timing(shake, { toValue: 3, duration: 100, useNativeDriver: true }),
|
|
18
|
+
Animated.timing(shake, { toValue: -3, duration: 100, useNativeDriver: true }),
|
|
19
|
+
Animated.timing(shake, { toValue: 3, duration: 100, useNativeDriver: true }),
|
|
20
|
+
Animated.timing(shake, { toValue: 0, duration: 50, useNativeDriver: true }),
|
|
21
|
+
])).start();
|
|
22
|
+
Animated.loop(Animated.sequence([
|
|
23
|
+
Animated.timing(pulse, {
|
|
24
|
+
toValue: 1.1,
|
|
25
|
+
duration: 1000,
|
|
26
|
+
easing: Easing.inOut(Easing.ease),
|
|
27
|
+
useNativeDriver: true,
|
|
28
|
+
}),
|
|
29
|
+
Animated.timing(pulse, {
|
|
30
|
+
toValue: 1,
|
|
31
|
+
duration: 1000,
|
|
32
|
+
easing: Easing.inOut(Easing.ease),
|
|
33
|
+
useNativeDriver: true,
|
|
34
|
+
}),
|
|
35
|
+
])).start();
|
|
36
|
+
}, [shake, pulse]);
|
|
37
|
+
return (_jsxs(Svg, { width: size, height: size, viewBox: "0 0 64 64", fill: "none", children: [_jsx(AnimatedPath, { d: "M32 8 C32 8, 48 12, 48 20 C48 36, 32 56, 32 56 C32 56, 16 36, 16 20 C16 12, 32 8, 32 8 Z", fill: color, opacity: 0.1, style: {
|
|
38
|
+
transform: [{ translateX: shake }],
|
|
39
|
+
} }), _jsx(AnimatedPath, { d: "M32 10 C32 10, 46 14, 46 20 C46 34, 32 52, 32 52 C32 52, 18 34, 18 20 C18 14, 32 10, 32 10 Z", stroke: color, strokeWidth: "2.5", fill: "none", style: {
|
|
40
|
+
transform: [{ translateX: shake }],
|
|
41
|
+
} }), _jsx(AnimatedPath, { d: "M24 24 L40 40 M40 24 L24 40", stroke: color, strokeWidth: "3", strokeLinecap: "round", style: {
|
|
42
|
+
transform: [{ scale: pulse }],
|
|
43
|
+
} })] }));
|
|
26
44
|
};
|
|
27
45
|
export default AnimatedPermissionDenied;
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codeimplants/ui-kit",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Enterprise-grade cross-platform UI components for error handling, network states, and user feedback",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
+
"react-native": "src/index.ts",
|
|
6
7
|
"types": "dist/index.d.ts",
|
|
7
8
|
"exports": {
|
|
8
9
|
".": {
|
|
@@ -53,7 +54,6 @@
|
|
|
53
54
|
}
|
|
54
55
|
},
|
|
55
56
|
"dependencies": {
|
|
56
|
-
"react-native-reanimated": "^3.6.0",
|
|
57
57
|
"react-native-svg": "^14.1.0"
|
|
58
58
|
},
|
|
59
59
|
"devDependencies": {
|
|
@@ -1,12 +1,6 @@
|
|
|
1
|
-
import React, { useEffect } from 'react';
|
|
2
|
-
import Animated,
|
|
3
|
-
|
|
4
|
-
useAnimatedProps,
|
|
5
|
-
withRepeat,
|
|
6
|
-
withTiming,
|
|
7
|
-
Easing,
|
|
8
|
-
} from 'react-native-reanimated';
|
|
9
|
-
import Svg, { Path, Rect, Circle } from 'react-native-svg';
|
|
1
|
+
import React, { useEffect, useRef } from 'react';
|
|
2
|
+
import { Animated, Easing } from 'react-native';
|
|
3
|
+
import Svg, { Path, Circle } from 'react-native-svg';
|
|
10
4
|
|
|
11
5
|
const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
12
6
|
|
|
@@ -23,19 +17,26 @@ export const AnimatedClientError: React.FC<AnimatedClientErrorProps> = ({
|
|
|
23
17
|
size = 64,
|
|
24
18
|
color = '#F59E0B',
|
|
25
19
|
}) => {
|
|
26
|
-
const pulse =
|
|
20
|
+
const pulse = useRef(new Animated.Value(1)).current;
|
|
27
21
|
|
|
28
22
|
useEffect(() => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
23
|
+
Animated.loop(
|
|
24
|
+
Animated.sequence([
|
|
25
|
+
Animated.timing(pulse, {
|
|
26
|
+
toValue: 1.1,
|
|
27
|
+
duration: 1000,
|
|
28
|
+
easing: Easing.inOut(Easing.ease),
|
|
29
|
+
useNativeDriver: true,
|
|
30
|
+
}),
|
|
31
|
+
Animated.timing(pulse, {
|
|
32
|
+
toValue: 1,
|
|
33
|
+
duration: 1000,
|
|
34
|
+
easing: Easing.inOut(Easing.ease),
|
|
35
|
+
useNativeDriver: true,
|
|
36
|
+
}),
|
|
37
|
+
])
|
|
38
|
+
).start();
|
|
39
|
+
}, [pulse]);
|
|
39
40
|
|
|
40
41
|
return (
|
|
41
42
|
<Svg width={size} height={size} viewBox="0 0 64 64" fill="none">
|
|
@@ -48,12 +49,14 @@ export const AnimatedClientError: React.FC<AnimatedClientErrorProps> = ({
|
|
|
48
49
|
|
|
49
50
|
{/* Warning triangle border */}
|
|
50
51
|
<AnimatedPath
|
|
51
|
-
animatedProps={animatedProps}
|
|
52
52
|
d="M32 12 L52 48 L12 48 Z"
|
|
53
53
|
stroke={color}
|
|
54
54
|
strokeWidth="3"
|
|
55
55
|
fill="none"
|
|
56
56
|
strokeLinejoin="round"
|
|
57
|
+
style={{
|
|
58
|
+
transform: [{ scale: pulse }],
|
|
59
|
+
}}
|
|
57
60
|
/>
|
|
58
61
|
|
|
59
62
|
{/* Exclamation mark */}
|