indatastar-styled-progress-bars 0.1.0
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/LICENSE +20 -0
- package/README.md +37 -0
- package/lib/module/SemiCircularProgressBar/index.js +78 -0
- package/lib/module/SemiCircularProgressBar/index.js.map +1 -0
- package/lib/module/WaveProgressBar/index.js +102 -0
- package/lib/module/WaveProgressBar/index.js.map +1 -0
- package/lib/module/index.js +5 -0
- package/lib/module/index.js.map +1 -0
- package/lib/module/package.json +1 -0
- package/lib/typescript/package.json +1 -0
- package/lib/typescript/src/SemiCircularProgressBar/index.d.ts +12 -0
- package/lib/typescript/src/SemiCircularProgressBar/index.d.ts.map +1 -0
- package/lib/typescript/src/WaveProgressBar/index.d.ts +15 -0
- package/lib/typescript/src/WaveProgressBar/index.d.ts.map +1 -0
- package/lib/typescript/src/index.d.ts +3 -0
- package/lib/typescript/src/index.d.ts.map +1 -0
- package/package.json +163 -0
- package/src/SemiCircularProgressBar/index.tsx +102 -0
- package/src/WaveProgressBar/index.tsx +103 -0
- package/src/index.tsx +2 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 InDataStar
|
|
4
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
5
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
6
|
+
in the Software without restriction, including without limitation the rights
|
|
7
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
8
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
9
|
+
furnished to do so, subject to the following conditions:
|
|
10
|
+
|
|
11
|
+
The above copyright notice and this permission notice shall be included in all
|
|
12
|
+
copies or substantial portions of the Software.
|
|
13
|
+
|
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
15
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
16
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
17
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
18
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
19
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
20
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
# styled-progress-bars
|
|
2
|
+
|
|
3
|
+
A choice of different progression bars to use
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
```sh
|
|
9
|
+
npm install styled-progress-bars
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
## Usage
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
```js
|
|
17
|
+
import { multiply } from 'styled-progress-bars';
|
|
18
|
+
|
|
19
|
+
// ...
|
|
20
|
+
|
|
21
|
+
const result = await multiply(3, 7);
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
## Contributing
|
|
26
|
+
|
|
27
|
+
- [Development workflow](CONTRIBUTING.md#development-workflow)
|
|
28
|
+
- [Sending a pull request](CONTRIBUTING.md#sending-a-pull-request)
|
|
29
|
+
- [Code of conduct](CODE_OF_CONDUCT.md)
|
|
30
|
+
|
|
31
|
+
## License
|
|
32
|
+
|
|
33
|
+
MIT
|
|
34
|
+
|
|
35
|
+
---
|
|
36
|
+
|
|
37
|
+
Made with [create-react-native-library](https://github.com/callstack/react-native-builder-bob)
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import React, { useEffect, useRef } from 'react';
|
|
4
|
+
import { View, Animated, StyleSheet } from 'react-native';
|
|
5
|
+
import Svg, { Path, Defs, LinearGradient as SvgGradient, Stop } from 'react-native-svg';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const SemiCircularProgressBar = ({
|
|
8
|
+
progress = 0,
|
|
9
|
+
end = 50,
|
|
10
|
+
radius = 50,
|
|
11
|
+
strokeWidth = 10,
|
|
12
|
+
colors = ['#4c669f', '#3b5998'],
|
|
13
|
+
duration = 500
|
|
14
|
+
}) => {
|
|
15
|
+
const animatedValue = useRef(new Animated.Value(0)).current;
|
|
16
|
+
const centerX = radius + strokeWidth;
|
|
17
|
+
const centerY = radius + strokeWidth;
|
|
18
|
+
const circumference = Math.PI * radius;
|
|
19
|
+
|
|
20
|
+
// Cast AnimatedPath so TS allows Animated values
|
|
21
|
+
const AnimatedPath = Animated.createAnimatedComponent(Path);
|
|
22
|
+
const path = `M ${centerX - radius},${centerY}
|
|
23
|
+
A ${radius},${radius} 0 0 1 ${centerX + radius},${centerY}`;
|
|
24
|
+
const strokeDashoffset = animatedValue.interpolate({
|
|
25
|
+
inputRange: [0, end],
|
|
26
|
+
outputRange: [circumference, 0]
|
|
27
|
+
});
|
|
28
|
+
useEffect(() => {
|
|
29
|
+
Animated.timing(animatedValue, {
|
|
30
|
+
toValue: progress,
|
|
31
|
+
duration,
|
|
32
|
+
useNativeDriver: false
|
|
33
|
+
}).start();
|
|
34
|
+
}, [progress]);
|
|
35
|
+
return /*#__PURE__*/_jsx(View, {
|
|
36
|
+
style: styles.container,
|
|
37
|
+
children: /*#__PURE__*/_jsxs(Svg, {
|
|
38
|
+
width: radius * 2 + strokeWidth * 2,
|
|
39
|
+
height: radius + strokeWidth * 2,
|
|
40
|
+
children: [/*#__PURE__*/_jsx(Defs, {
|
|
41
|
+
children: /*#__PURE__*/_jsx(SvgGradient, {
|
|
42
|
+
id: "grad",
|
|
43
|
+
x1: "0%",
|
|
44
|
+
y1: "0%",
|
|
45
|
+
x2: "100%",
|
|
46
|
+
y2: "0%",
|
|
47
|
+
children: colors.map((color, index) => /*#__PURE__*/_jsx(Stop, {
|
|
48
|
+
offset: `${index / (colors.length - 1) * 100}%`,
|
|
49
|
+
stopColor: color
|
|
50
|
+
}, index))
|
|
51
|
+
})
|
|
52
|
+
}), /*#__PURE__*/_jsx(Path, {
|
|
53
|
+
d: path,
|
|
54
|
+
stroke: "rgba(224,224,224,0.3)",
|
|
55
|
+
strokeWidth: strokeWidth,
|
|
56
|
+
fill: "none",
|
|
57
|
+
strokeLinecap: "round"
|
|
58
|
+
}), /*#__PURE__*/_jsx(AnimatedPath, {
|
|
59
|
+
d: path,
|
|
60
|
+
stroke: "url(#grad)",
|
|
61
|
+
strokeWidth: strokeWidth,
|
|
62
|
+
fill: "none",
|
|
63
|
+
strokeDasharray: `${circumference}`,
|
|
64
|
+
strokeDashoffset: strokeDashoffset // TS-safe cast
|
|
65
|
+
,
|
|
66
|
+
strokeLinecap: "round"
|
|
67
|
+
})]
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
};
|
|
71
|
+
const styles = StyleSheet.create({
|
|
72
|
+
container: {
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
justifyContent: 'center'
|
|
75
|
+
}
|
|
76
|
+
});
|
|
77
|
+
export default SemiCircularProgressBar;
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["React","useEffect","useRef","View","Animated","StyleSheet","Svg","Path","Defs","LinearGradient","SvgGradient","Stop","jsx","_jsx","jsxs","_jsxs","SemiCircularProgressBar","progress","end","radius","strokeWidth","colors","duration","animatedValue","Value","current","centerX","centerY","circumference","Math","PI","AnimatedPath","createAnimatedComponent","path","strokeDashoffset","interpolate","inputRange","outputRange","timing","toValue","useNativeDriver","start","style","styles","container","children","width","height","id","x1","y1","x2","y2","map","color","index","offset","length","stopColor","d","stroke","fill","strokeLinecap","strokeDasharray","create","alignItems","justifyContent"],"sourceRoot":"../../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AAG;QACpCM,gBAAgB,EAAEA,gBAAwB,CAAC;QAAA;QAC3C4B,aAAa,EAAC;MAAO,CACtB,CAAC;IAAA,CAES;EAAC,CACF,CAAC;AAEX,CAAC;AAED,MAAMnB,MAAM,GAAGtC,UAAU,CAAC2D,MAAM,CAAC;EAC/BpB,SAAS,EAAE;IACTqB,UAAU,EAAE,QAAQ;IACpBC,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAEF,eAAelD,uBAAuB","ignoreList":[]}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
import { useEffect, useRef } from 'react';
|
|
4
|
+
import { View, Animated, StyleSheet, Easing, Text } from 'react-native';
|
|
5
|
+
import Svg, { Path, Defs, LinearGradient as SvgGradient, Stop } from 'react-native-svg';
|
|
6
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
const WaveProgressBar = ({
|
|
8
|
+
progress = 0,
|
|
9
|
+
end = 50,
|
|
10
|
+
width = 300,
|
|
11
|
+
height = 50,
|
|
12
|
+
waveHeight = 10,
|
|
13
|
+
colors = ['#4c669f', '#3b5998'],
|
|
14
|
+
duration = 1000,
|
|
15
|
+
backgroundColor = '#e0e0e0',
|
|
16
|
+
borderRadius = 10,
|
|
17
|
+
showLabel = true
|
|
18
|
+
}) => {
|
|
19
|
+
const animatedValue = useRef(new Animated.Value(0)).current;
|
|
20
|
+
useEffect(() => {
|
|
21
|
+
Animated.timing(animatedValue, {
|
|
22
|
+
toValue: progress,
|
|
23
|
+
duration,
|
|
24
|
+
easing: Easing.out(Easing.ease),
|
|
25
|
+
useNativeDriver: false
|
|
26
|
+
}).start();
|
|
27
|
+
}, [progress, duration]);
|
|
28
|
+
|
|
29
|
+
// Animated width of the wave container
|
|
30
|
+
const waveWidth = animatedValue.interpolate({
|
|
31
|
+
inputRange: [0, end],
|
|
32
|
+
outputRange: [0, width]
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
// Wave path
|
|
36
|
+
const wavePath = `
|
|
37
|
+
M0 ${height / 2}
|
|
38
|
+
Q ${width / 4} ${height / 2 - waveHeight}, ${width / 2} ${height / 2}
|
|
39
|
+
T ${width} ${height / 2}
|
|
40
|
+
L ${width} ${height}
|
|
41
|
+
L0 ${height}
|
|
42
|
+
Z
|
|
43
|
+
`;
|
|
44
|
+
return /*#__PURE__*/_jsxs(View, {
|
|
45
|
+
style: [styles.container, {
|
|
46
|
+
width,
|
|
47
|
+
height,
|
|
48
|
+
borderRadius,
|
|
49
|
+
backgroundColor
|
|
50
|
+
}],
|
|
51
|
+
children: [/*#__PURE__*/_jsx(Animated.View, {
|
|
52
|
+
style: {
|
|
53
|
+
width: waveWidth,
|
|
54
|
+
height,
|
|
55
|
+
overflow: 'hidden'
|
|
56
|
+
},
|
|
57
|
+
children: /*#__PURE__*/_jsxs(Svg, {
|
|
58
|
+
width: width,
|
|
59
|
+
height: height,
|
|
60
|
+
children: [/*#__PURE__*/_jsx(Defs, {
|
|
61
|
+
children: /*#__PURE__*/_jsx(SvgGradient, {
|
|
62
|
+
id: "grad",
|
|
63
|
+
x1: "0%",
|
|
64
|
+
y1: "0%",
|
|
65
|
+
x2: "100%",
|
|
66
|
+
y2: "0%",
|
|
67
|
+
children: colors.map((color, index) => /*#__PURE__*/_jsx(Stop, {
|
|
68
|
+
offset: `${index / (colors.length - 1) * 100}%`,
|
|
69
|
+
stopColor: color
|
|
70
|
+
}, index))
|
|
71
|
+
})
|
|
72
|
+
}), /*#__PURE__*/_jsx(Path, {
|
|
73
|
+
d: wavePath,
|
|
74
|
+
fill: "url(#grad)"
|
|
75
|
+
})]
|
|
76
|
+
})
|
|
77
|
+
}), showLabel && /*#__PURE__*/_jsx(View, {
|
|
78
|
+
style: {
|
|
79
|
+
position: 'absolute',
|
|
80
|
+
width,
|
|
81
|
+
height,
|
|
82
|
+
justifyContent: 'center',
|
|
83
|
+
alignItems: 'center'
|
|
84
|
+
},
|
|
85
|
+
children: /*#__PURE__*/_jsxs(Text, {
|
|
86
|
+
style: {
|
|
87
|
+
color: '#fff',
|
|
88
|
+
fontWeight: 'bold'
|
|
89
|
+
},
|
|
90
|
+
children: [Math.round(progress), "%"]
|
|
91
|
+
})
|
|
92
|
+
})]
|
|
93
|
+
});
|
|
94
|
+
};
|
|
95
|
+
const styles = StyleSheet.create({
|
|
96
|
+
container: {
|
|
97
|
+
overflow: 'hidden',
|
|
98
|
+
justifyContent: 'center'
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
export default WaveProgressBar;
|
|
102
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["useEffect","useRef","View","Animated","StyleSheet","Easing","Text","Svg","Path","Defs","LinearGradient","SvgGradient","Stop","jsx","_jsx","jsxs","_jsxs","WaveProgressBar","progress","end","width","height","waveHeight","colors","duration","backgroundColor","borderRadius","showLabel","animatedValue","Value","current","timing","toValue","easing","out","ease","useNativeDriver","start","waveWidth","interpolate","inputRange","outputRange","wavePath","style","styles","container","children","overflow","id","x1","y1","x2","y2","map","color","index","offset","length","stopColor","d","fill","position","justifyContent","alignItems","fontWeight","Math","round","create"],"sourceRoot":"../../../src","sources":["WaveProgressBar/index.tsx"],"mappings":";;AAAA,SAASA,SAAS,EAAEC,MAAM,QAAQ,OAAO;AACzC,SAASC,IAAI,EAAEC,QAAQ,EAAEC,UAAU,EAAEC,MAAM,EAAEC,IAAI,QAAQ,cAAc;AACvE,OAAOC,GAAG,IAAIC,IAAI,EAAEC,IAAI,EAAEC,cAAc,IAAIC,WAAW,EAAEC,IAAI,QAAQ,kBAAkB;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAexF,MAAMC,eAAe,GAAGA,CAAC;EACvBC,QAAQ,GAAG,CAAC;EACZC,GAAG,GAAG,EAAE;EACRC,KAAK,GAAG,GAAG;EACXC,MAAM,GAAG,EAAE;EACXC,UAAU,GAA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ED,MAAM0B,MAAM,GAAGxC,UAAU,CAAC+D,MAAM,CAAC;EAC/BtB,SAAS,EAAE;IACTE,QAAQ,EAAE,QAAQ;IAClBe,cAAc,EAAE;EAClB;AACF,CAAC,CAAC;AAEF,eAAe7C,eAAe","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"names":["default","SemiCircularProgressBar","WaveProgressBar"],"sourceRoot":"../../src","sources":["index.tsx"],"mappings":";;AAAA,SAASA,OAAO,IAAIC,uBAAuB,QAAQ,oCAA2B;AAC9E,SAASD,OAAO,IAAIE,eAAe,QAAQ,4BAAmB","ignoreList":[]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type JSX } from 'react';
|
|
2
|
+
interface SemiCircularProgressBarProps {
|
|
3
|
+
progress?: number;
|
|
4
|
+
end?: number;
|
|
5
|
+
radius?: number;
|
|
6
|
+
strokeWidth?: number;
|
|
7
|
+
colors?: string[];
|
|
8
|
+
duration?: number;
|
|
9
|
+
}
|
|
10
|
+
declare const SemiCircularProgressBar: ({ progress, end, radius, strokeWidth, colors, duration, }: SemiCircularProgressBarProps) => JSX.Element;
|
|
11
|
+
export default SemiCircularProgressBar;
|
|
12
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/SemiCircularProgressBar/index.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAqB,KAAK,GAAG,EAAE,MAAM,OAAO,CAAC;AAK3D,UAAU,4BAA4B;IACpC,QAAQ,CAAC,EAAC,MAAM,CAAC;IACjB,GAAG,CAAC,EAAC,MAAM,CAAC;IACZ,MAAM,CAAC,EAAC,MAAM,CAAC;IACf,WAAW,CAAC,EAAC,MAAM,CAAC;IACpB,MAAM,CAAC,EAAC,MAAM,EAAE,CAAC;IACjB,QAAQ,CAAC,EAAC,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,uBAAuB,GAAI,2DAO9B,4BAA4B,KAAG,GAAG,CAAC,OAqErC,CAAA;AASD,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
interface WaveProgressBarProps {
|
|
2
|
+
progress?: number;
|
|
3
|
+
end?: number;
|
|
4
|
+
width?: number;
|
|
5
|
+
height?: number;
|
|
6
|
+
waveHeight?: number;
|
|
7
|
+
colors?: string[];
|
|
8
|
+
duration?: number;
|
|
9
|
+
backgroundColor?: string;
|
|
10
|
+
borderRadius?: number;
|
|
11
|
+
showLabel?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const WaveProgressBar: ({ progress, end, width, height, waveHeight, colors, duration, backgroundColor, borderRadius, showLabel, }: WaveProgressBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
export default WaveProgressBar;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/WaveProgressBar/index.tsx"],"names":[],"mappings":"AAIA,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,QAAA,MAAM,eAAe,GAAI,2GAWtB,oBAAoB,4CAiEtB,CAAC;AASF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "indatastar-styled-progress-bars",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A choice of different progression bars to use",
|
|
5
|
+
"main": "./lib/module/index.js",
|
|
6
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"source": "./src/index.tsx",
|
|
10
|
+
"types": "./lib/typescript/src/index.d.ts",
|
|
11
|
+
"default": "./lib/module/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./package.json": "./package.json"
|
|
14
|
+
},
|
|
15
|
+
"files": [
|
|
16
|
+
"src",
|
|
17
|
+
"lib",
|
|
18
|
+
"android",
|
|
19
|
+
"ios",
|
|
20
|
+
"cpp",
|
|
21
|
+
"*.podspec",
|
|
22
|
+
"react-native.config.js",
|
|
23
|
+
"!ios/build",
|
|
24
|
+
"!android/build",
|
|
25
|
+
"!android/gradle",
|
|
26
|
+
"!android/gradlew",
|
|
27
|
+
"!android/gradlew.bat",
|
|
28
|
+
"!android/local.properties",
|
|
29
|
+
"!**/__tests__",
|
|
30
|
+
"!**/__fixtures__",
|
|
31
|
+
"!**/__mocks__",
|
|
32
|
+
"!**/.*"
|
|
33
|
+
],
|
|
34
|
+
"scripts": {
|
|
35
|
+
"example": "yarn workspace styled-progress-bars-example",
|
|
36
|
+
"clean": "del-cli lib",
|
|
37
|
+
"prepare": "bob build",
|
|
38
|
+
"typecheck": "tsc",
|
|
39
|
+
"lint": "eslint \"**/*.{js,ts,tsx}\"",
|
|
40
|
+
"test": "jest",
|
|
41
|
+
"release": "release-it --only-version"
|
|
42
|
+
},
|
|
43
|
+
"keywords": [
|
|
44
|
+
"react-native",
|
|
45
|
+
"ios",
|
|
46
|
+
"android"
|
|
47
|
+
],
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "git+https://github.com/InDataStar/styled-progress-bars.git"
|
|
51
|
+
},
|
|
52
|
+
"author": "InDataStar <crawfordlp1@gmail.com> (https://github.com/InDataStar)",
|
|
53
|
+
"license": "MIT",
|
|
54
|
+
"bugs": {
|
|
55
|
+
"url": "https://github.com/InDataStar/styled-progress-bars/issues"
|
|
56
|
+
},
|
|
57
|
+
"homepage": "https://github.com/InDataStar/styled-progress-bars#readme",
|
|
58
|
+
"publishConfig": {
|
|
59
|
+
"registry": "https://registry.npmjs.org/"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@commitlint/config-conventional": "^19.8.1",
|
|
63
|
+
"@eslint/compat": "^1.3.2",
|
|
64
|
+
"@eslint/eslintrc": "^3.3.1",
|
|
65
|
+
"@eslint/js": "^9.35.0",
|
|
66
|
+
"@react-native/babel-preset": "0.83.0",
|
|
67
|
+
"@react-native/eslint-config": "0.83.0",
|
|
68
|
+
"@release-it/conventional-changelog": "^10.0.1",
|
|
69
|
+
"@types/jest": "^29.5.14",
|
|
70
|
+
"@types/react": "^19.1.12",
|
|
71
|
+
"commitlint": "^19.8.1",
|
|
72
|
+
"del-cli": "^6.0.0",
|
|
73
|
+
"eslint": "^9.35.0",
|
|
74
|
+
"eslint-config-prettier": "^10.1.8",
|
|
75
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
76
|
+
"jest": "^29.7.0",
|
|
77
|
+
"lefthook": "^2.0.3",
|
|
78
|
+
"prettier": "^3.7.4",
|
|
79
|
+
"react": "19.1.0",
|
|
80
|
+
"react-native": "^0.81.5",
|
|
81
|
+
"react-native-builder-bob": "^0.40.13",
|
|
82
|
+
"release-it": "^19.0.4",
|
|
83
|
+
"typescript": "^5.9.2"
|
|
84
|
+
},
|
|
85
|
+
"peerDependencies": {
|
|
86
|
+
"react": "*",
|
|
87
|
+
"react-native": "*"
|
|
88
|
+
},
|
|
89
|
+
"workspaces": [
|
|
90
|
+
"example"
|
|
91
|
+
],
|
|
92
|
+
"packageManager": "yarn@4.11.0",
|
|
93
|
+
"react-native-builder-bob": {
|
|
94
|
+
"source": "src",
|
|
95
|
+
"output": "lib",
|
|
96
|
+
"targets": [
|
|
97
|
+
[
|
|
98
|
+
"module",
|
|
99
|
+
{
|
|
100
|
+
"esm": true
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
[
|
|
104
|
+
"typescript",
|
|
105
|
+
{
|
|
106
|
+
"project": "tsconfig.build.json"
|
|
107
|
+
}
|
|
108
|
+
]
|
|
109
|
+
]
|
|
110
|
+
},
|
|
111
|
+
"prettier": {
|
|
112
|
+
"quoteProps": "consistent",
|
|
113
|
+
"singleQuote": true,
|
|
114
|
+
"tabWidth": 2,
|
|
115
|
+
"trailingComma": "es5",
|
|
116
|
+
"useTabs": false
|
|
117
|
+
},
|
|
118
|
+
"jest": {
|
|
119
|
+
"preset": "react-native",
|
|
120
|
+
"modulePathIgnorePatterns": [
|
|
121
|
+
"<rootDir>/example/node_modules",
|
|
122
|
+
"<rootDir>/lib/"
|
|
123
|
+
]
|
|
124
|
+
},
|
|
125
|
+
"commitlint": {
|
|
126
|
+
"extends": [
|
|
127
|
+
"@commitlint/config-conventional"
|
|
128
|
+
]
|
|
129
|
+
},
|
|
130
|
+
"release-it": {
|
|
131
|
+
"git": {
|
|
132
|
+
"commitMessage": "chore: release ${version}",
|
|
133
|
+
"tagName": "v${version}"
|
|
134
|
+
},
|
|
135
|
+
"npm": {
|
|
136
|
+
"publish": true
|
|
137
|
+
},
|
|
138
|
+
"github": {
|
|
139
|
+
"release": true
|
|
140
|
+
},
|
|
141
|
+
"plugins": {
|
|
142
|
+
"@release-it/conventional-changelog": {
|
|
143
|
+
"preset": {
|
|
144
|
+
"name": "angular"
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
},
|
|
149
|
+
"create-react-native-library": {
|
|
150
|
+
"type": "library",
|
|
151
|
+
"languages": "js",
|
|
152
|
+
"tools": [
|
|
153
|
+
"eslint",
|
|
154
|
+
"jest",
|
|
155
|
+
"lefthook",
|
|
156
|
+
"release-it"
|
|
157
|
+
],
|
|
158
|
+
"version": "0.56.1"
|
|
159
|
+
},
|
|
160
|
+
"dependencies": {
|
|
161
|
+
"react-native-svg": "^15.15.1"
|
|
162
|
+
}
|
|
163
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import React, { useEffect, useRef, type JSX } from 'react';
|
|
2
|
+
import { View, Animated, StyleSheet } from 'react-native';
|
|
3
|
+
import Svg, { Path , Defs, LinearGradient as SvgGradient, Stop } from 'react-native-svg';
|
|
4
|
+
import type {PathProps} from 'react-native-svg';
|
|
5
|
+
|
|
6
|
+
interface SemiCircularProgressBarProps{
|
|
7
|
+
progress?:number;
|
|
8
|
+
end?:number;
|
|
9
|
+
radius?:number;
|
|
10
|
+
strokeWidth?:number;
|
|
11
|
+
colors?:string[];
|
|
12
|
+
duration?:number;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const SemiCircularProgressBar = ({
|
|
16
|
+
progress = 0,
|
|
17
|
+
end = 50,
|
|
18
|
+
radius = 50,
|
|
19
|
+
strokeWidth = 10,
|
|
20
|
+
colors = ['#4c669f', '#3b5998'],
|
|
21
|
+
duration = 500,
|
|
22
|
+
}: SemiCircularProgressBarProps): JSX.Element => {
|
|
23
|
+
const animatedValue = useRef(new Animated.Value(0)).current;
|
|
24
|
+
const centerX = radius + strokeWidth;
|
|
25
|
+
const centerY = radius + strokeWidth;
|
|
26
|
+
const circumference = Math.PI * radius;
|
|
27
|
+
|
|
28
|
+
// Cast AnimatedPath so TS allows Animated values
|
|
29
|
+
const AnimatedPath = Animated.createAnimatedComponent(Path) as React.ComponentType<
|
|
30
|
+
PathProps & { strokeDashoffset?: Animated.AnimatedInterpolation<number> }
|
|
31
|
+
>;
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
const path = `M ${centerX - radius},${centerY}
|
|
36
|
+
A ${radius},${radius} 0 0 1 ${centerX + radius},${centerY}`;
|
|
37
|
+
|
|
38
|
+
const strokeDashoffset =animatedValue.interpolate({
|
|
39
|
+
inputRange:[0,end],
|
|
40
|
+
outputRange:[circumference,0],
|
|
41
|
+
})
|
|
42
|
+
|
|
43
|
+
useEffect(()=>{
|
|
44
|
+
Animated.timing(animatedValue,{
|
|
45
|
+
toValue:progress,
|
|
46
|
+
duration,
|
|
47
|
+
useNativeDriver:false
|
|
48
|
+
}).start();
|
|
49
|
+
},[progress])
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
return(
|
|
53
|
+
<View style={styles.container}>
|
|
54
|
+
<Svg
|
|
55
|
+
width={radius*2+strokeWidth*2}
|
|
56
|
+
height={radius+strokeWidth*2}
|
|
57
|
+
>
|
|
58
|
+
<Defs>
|
|
59
|
+
<SvgGradient id="grad" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
60
|
+
{colors.map((color, index) => (
|
|
61
|
+
<Stop
|
|
62
|
+
key={index}
|
|
63
|
+
offset={`${(index / (colors.length - 1)) * 100}%`}
|
|
64
|
+
stopColor={color}
|
|
65
|
+
/>
|
|
66
|
+
))}
|
|
67
|
+
</SvgGradient>
|
|
68
|
+
</Defs>
|
|
69
|
+
|
|
70
|
+
<Path
|
|
71
|
+
d={path}
|
|
72
|
+
stroke="rgba(224,224,224,0.3)"
|
|
73
|
+
strokeWidth={strokeWidth}
|
|
74
|
+
fill="none"
|
|
75
|
+
strokeLinecap="round"
|
|
76
|
+
/>
|
|
77
|
+
|
|
78
|
+
<AnimatedPath
|
|
79
|
+
d={path}
|
|
80
|
+
stroke="url(#grad)"
|
|
81
|
+
strokeWidth={strokeWidth}
|
|
82
|
+
fill="none"
|
|
83
|
+
strokeDasharray={`${circumference}`}
|
|
84
|
+
strokeDashoffset={strokeDashoffset as any} // TS-safe cast
|
|
85
|
+
strokeLinecap="round"
|
|
86
|
+
/>
|
|
87
|
+
|
|
88
|
+
</Svg>
|
|
89
|
+
</View>
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const styles = StyleSheet.create({
|
|
94
|
+
container: {
|
|
95
|
+
alignItems: 'center',
|
|
96
|
+
justifyContent: 'center',
|
|
97
|
+
},
|
|
98
|
+
});
|
|
99
|
+
|
|
100
|
+
export default SemiCircularProgressBar;
|
|
101
|
+
|
|
102
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { useEffect, useRef } from 'react';
|
|
2
|
+
import { View, Animated, StyleSheet, Easing, Text } from 'react-native';
|
|
3
|
+
import Svg, { Path, Defs, LinearGradient as SvgGradient, Stop } from 'react-native-svg';
|
|
4
|
+
|
|
5
|
+
interface WaveProgressBarProps {
|
|
6
|
+
progress?: number; // 0-100
|
|
7
|
+
end?: number; // 0-100
|
|
8
|
+
width?: number;
|
|
9
|
+
height?: number;
|
|
10
|
+
waveHeight?: number;
|
|
11
|
+
colors?: string[];
|
|
12
|
+
duration?: number;
|
|
13
|
+
backgroundColor?: string;
|
|
14
|
+
borderRadius?: number;
|
|
15
|
+
showLabel?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const WaveProgressBar = ({
|
|
19
|
+
progress = 0,
|
|
20
|
+
end = 50,
|
|
21
|
+
width = 300,
|
|
22
|
+
height = 50,
|
|
23
|
+
waveHeight = 10,
|
|
24
|
+
colors = ['#4c669f', '#3b5998'],
|
|
25
|
+
duration = 1000,
|
|
26
|
+
backgroundColor = '#e0e0e0',
|
|
27
|
+
borderRadius = 10,
|
|
28
|
+
showLabel = true,
|
|
29
|
+
}: WaveProgressBarProps) => {
|
|
30
|
+
const animatedValue = useRef(new Animated.Value(0)).current;
|
|
31
|
+
|
|
32
|
+
useEffect(() => {
|
|
33
|
+
Animated.timing(animatedValue, {
|
|
34
|
+
toValue: progress,
|
|
35
|
+
duration,
|
|
36
|
+
easing: Easing.out(Easing.ease),
|
|
37
|
+
useNativeDriver: false,
|
|
38
|
+
}).start();
|
|
39
|
+
}, [progress, duration]);
|
|
40
|
+
|
|
41
|
+
// Animated width of the wave container
|
|
42
|
+
const waveWidth = animatedValue.interpolate({
|
|
43
|
+
inputRange: [0, end],
|
|
44
|
+
outputRange: [0, width],
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
// Wave path
|
|
48
|
+
const wavePath = `
|
|
49
|
+
M0 ${height / 2}
|
|
50
|
+
Q ${width / 4} ${height / 2 - waveHeight}, ${width / 2} ${height / 2}
|
|
51
|
+
T ${width} ${height / 2}
|
|
52
|
+
L ${width} ${height}
|
|
53
|
+
L0 ${height}
|
|
54
|
+
Z
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
return (
|
|
58
|
+
<View style={[styles.container, { width, height, borderRadius, backgroundColor }]}>
|
|
59
|
+
{/* Animated container for the wave */}
|
|
60
|
+
<Animated.View style={{ width: waveWidth, height, overflow: 'hidden' }}>
|
|
61
|
+
<Svg width={width} height={height}>
|
|
62
|
+
<Defs>
|
|
63
|
+
<SvgGradient id="grad" x1="0%" y1="0%" x2="100%" y2="0%">
|
|
64
|
+
{colors.map((color, index) => (
|
|
65
|
+
<Stop
|
|
66
|
+
key={index}
|
|
67
|
+
offset={`${(index / (colors.length - 1)) * 100}%`}
|
|
68
|
+
stopColor={color}
|
|
69
|
+
/>
|
|
70
|
+
))}
|
|
71
|
+
</SvgGradient>
|
|
72
|
+
</Defs>
|
|
73
|
+
|
|
74
|
+
<Path d={wavePath} fill="url(#grad)" />
|
|
75
|
+
</Svg>
|
|
76
|
+
</Animated.View>
|
|
77
|
+
|
|
78
|
+
{/* Optional percentage label */}
|
|
79
|
+
{showLabel && (
|
|
80
|
+
<View
|
|
81
|
+
style={{
|
|
82
|
+
position: 'absolute',
|
|
83
|
+
width,
|
|
84
|
+
height,
|
|
85
|
+
justifyContent: 'center',
|
|
86
|
+
alignItems: 'center',
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
<Text style={{ color: '#fff', fontWeight: 'bold' }}>{Math.round(progress)}%</Text>
|
|
90
|
+
</View>
|
|
91
|
+
)}
|
|
92
|
+
</View>
|
|
93
|
+
);
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const styles = StyleSheet.create({
|
|
97
|
+
container: {
|
|
98
|
+
overflow: 'hidden',
|
|
99
|
+
justifyContent: 'center',
|
|
100
|
+
},
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
export default WaveProgressBar;
|
package/src/index.tsx
ADDED