related-ui-components 2.5.7 → 2.5.9
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/lib/module/app.js +9 -9
- package/lib/module/app.js.map +1 -1
- package/lib/module/components/Input/CountryPickerView.js +0 -2
- package/lib/module/components/Input/CountryPickerView.js.map +1 -1
- package/lib/module/components/ProgressBar/CircularProgressBar.js +101 -30
- package/lib/module/components/ProgressBar/CircularProgressBar.js.map +1 -1
- package/lib/module/contexts/BottomSheetStackProvider.js +0 -1
- package/lib/module/contexts/BottomSheetStackProvider.js.map +1 -1
- package/lib/typescript/src/app.d.ts.map +1 -1
- package/lib/typescript/src/components/Input/CountryPickerView.d.ts.map +1 -1
- package/lib/typescript/src/components/ProgressBar/CircularProgressBar.d.ts +10 -3
- package/lib/typescript/src/components/ProgressBar/CircularProgressBar.d.ts.map +1 -1
- package/lib/typescript/src/contexts/BottomSheetStackProvider.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/app.tsx +3 -2
- package/src/components/Input/CountryPickerView.tsx +0 -2
- package/src/components/ProgressBar/CircularProgressBar.tsx +135 -44
- package/src/contexts/BottomSheetStackProvider.tsx +0 -2
package/lib/module/app.js
CHANGED
|
@@ -5,7 +5,7 @@ import { SafeAreaView, StyleSheet, StatusBar } from "react-native";
|
|
|
5
5
|
// Adjust path as needed
|
|
6
6
|
import { GestureHandlerRootView } from "react-native-gesture-handler";
|
|
7
7
|
import { lightTheme, RelatedProvider, useTheme } from "./theme/index.js";
|
|
8
|
-
import
|
|
8
|
+
import CircularProgressBar from "./components/ProgressBar/CircularProgressBar.js";
|
|
9
9
|
import { BottomSheetStackProvider } from "./contexts/index.js";
|
|
10
10
|
import { SafeAreaProvider } from "react-native-safe-area-context";
|
|
11
11
|
|
|
@@ -63,12 +63,13 @@ const App = () => {
|
|
|
63
63
|
barStyle: "light-content"
|
|
64
64
|
}), /*#__PURE__*/_jsx(SafeAreaView, {
|
|
65
65
|
style: styles.appContainer,
|
|
66
|
-
children: /*#__PURE__*/_jsx(
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
66
|
+
children: /*#__PURE__*/_jsx(CircularProgressBar, {
|
|
67
|
+
variant: "steps",
|
|
68
|
+
totalSteps: 4,
|
|
69
|
+
currentStep: 4,
|
|
70
|
+
size: 43,
|
|
71
|
+
strokeWidth: 2,
|
|
72
|
+
progressColor: "#9CA0A3"
|
|
72
73
|
})
|
|
73
74
|
})]
|
|
74
75
|
})
|
|
@@ -80,8 +81,7 @@ const App = () => {
|
|
|
80
81
|
const styles = StyleSheet.create({
|
|
81
82
|
appContainer: {
|
|
82
83
|
flex: 1,
|
|
83
|
-
backgroundColor: "
|
|
84
|
-
// Match carousel background or choose another
|
|
84
|
+
backgroundColor: "grey",
|
|
85
85
|
justifyContent: "center" // Center the carousel vertically if it's the main content
|
|
86
86
|
}
|
|
87
87
|
});
|
package/lib/module/app.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useState","SafeAreaView","StyleSheet","StatusBar","GestureHandlerRootView","lightTheme","RelatedProvider","useTheme","
|
|
1
|
+
{"version":3,"names":["React","useState","SafeAreaView","StyleSheet","StatusBar","GestureHandlerRootView","lightTheme","RelatedProvider","useTheme","CircularProgressBar","BottomSheetStackProvider","SafeAreaProvider","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DUMMY_DATA","id","image","title","App","theme","departureDate","setDepartureDate","undefined","returnDate","setReturnDate","progress","setProgress","handleAnimate","newProgress","Math","floor","random","children","style","flex","barStyle","styles","appContainer","variant","totalSteps","currentStep","size","strokeWidth","progressColor","create","backgroundColor","justifyContent"],"sourceRoot":"..\\..\\src","sources":["app.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,QAAQ,QAAQ,OAAO;AACvC,SAASC,YAAY,EAAEC,UAAU,EAAEC,SAAS,QAAQ,cAAc;AACgB;AAClF,SAASC,sBAAsB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AAA,eACfvB,IAAA,CAACR,sBAAsB;QAACgC,KAAK,EAAE;UAAEC,IAAI,EAAE;QAAE,CAAE;QAAAF,QAAA,eACzCvB,IAAA,CAACN,eAAe;UAACgB,KAAK,EAAEjB,UAAW;UAAA8B,QAAA,eACjCrB,KAAA,CAACL,wBAAwB;YAAA0B,QAAA,gBACvBvB,IAAA,CAACT,SAAS;cAACmC,QAAQ,EAAC;YAAe,CAAE,CAAC,eACtC1B,IAAA,CAACX,YAAY;cAACmC,KAAK,EAAEG,MAAM,CAACC,YAAa;cAAAL,QAAA,eA+CvCvB,IAAA,CAACJ,mBAAmB;gBAACiC,OAAO,EAAC,OAAO;gBAACC,UAAU,EAAE,CAAE;gBAACC,WAAW,EAAE,CAAE;gBAACC,IAAI,EAAE,EAAG;gBAAEC,WAAW,EAAE,CAAE;gBAACC,aAAa,EAAC;cAAS,CAAsB;YAAC,CAEjI,CAAC;UAAA,CACS;QAAC,CACZ;MAAC,CACI;IAAC,CACP;EAAC,CACnB,CAAC;AAEP,CAAC;AAED,MAAMP,MAAM,GAAGrC,UAAU,CAAC6C,MAAM,CAAC;EAC/BP,YAAY,EAAE;IACZH,IAAI,EAAE,CAAC;IACPW,eAAe,EAAC,MAAM;IACtBC,cAAc,EAAE,QAAQ,CAAE;EAC5B;AACF,CAAC,CAAC;AAEF,eAAe5B,GAAG","ignoreList":[]}
|
|
@@ -6,14 +6,12 @@ import { BottomSheetFlatList } from "@gorhom/bottom-sheet";
|
|
|
6
6
|
import { useTheme } from "../../theme/index.js";
|
|
7
7
|
import { iso2ToFlagEmoji } from "../../utils/flags.js";
|
|
8
8
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
9
|
-
// ADDED: A memoized row component to ensure stability
|
|
10
9
|
const CountryRow = /*#__PURE__*/React.memo(({
|
|
11
10
|
item,
|
|
12
11
|
onSelectCountry,
|
|
13
12
|
nameStyle,
|
|
14
13
|
codeStyle
|
|
15
14
|
}) => {
|
|
16
|
-
// This handler is now stable because onSelectCountry is stable
|
|
17
15
|
const handlePress = () => onSelectCountry(item);
|
|
18
16
|
return /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
19
17
|
style: styles.countryRow,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useCallback","useMemo","Text","View","TouchableOpacity","StyleSheet","BottomSheetFlatList","useTheme","iso2ToFlagEmoji","jsxs","_jsxs","jsx","_jsx","CountryRow","memo","item","onSelectCountry","nameStyle","codeStyle","handlePress","style","styles","countryRow","onPress","children","flag","iso2","countryText","name","code","CountryPickerView","countries","listTitle","listTitleStyle","countryNameStyle","countryCodeStyle","theme","memoizedNameStyle","countryName","color","text","memoizedCodeStyle","countryCode","helper","renderCountry","popup","popupTitle","data","keyExtractor","c","renderItem","contentContainerStyle","paddingBottom","initialNumToRender","maxToRenderPerBatch","create","flex","width","paddingHorizontal","loaderContainer","alignItems","justifyContent","fontSize","fontWeight","marginBottom","paddingTop","flexDirection","paddingVertical","height","marginLeft"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Input/CountryPickerView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAyBC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACxE,SACEC,IAAI,EACJC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,QAKL,cAAc;AACrB,SAA+BC,mBAAmB,QAAQ,sBAAsB;AAChF,SAASC,QAAQ,QAAQ,sBAAa;AACtC,SAASC,eAAe,QAAQ,sBAAmB;AAAC,SAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAYpD
|
|
1
|
+
{"version":3,"names":["React","useCallback","useMemo","Text","View","TouchableOpacity","StyleSheet","BottomSheetFlatList","useTheme","iso2ToFlagEmoji","jsxs","_jsxs","jsx","_jsx","CountryRow","memo","item","onSelectCountry","nameStyle","codeStyle","handlePress","style","styles","countryRow","onPress","children","flag","iso2","countryText","name","code","CountryPickerView","countries","listTitle","listTitleStyle","countryNameStyle","countryCodeStyle","theme","memoizedNameStyle","countryName","color","text","memoizedCodeStyle","countryCode","helper","renderCountry","popup","popupTitle","data","keyExtractor","c","renderItem","contentContainerStyle","paddingBottom","initialNumToRender","maxToRenderPerBatch","create","flex","width","paddingHorizontal","loaderContainer","alignItems","justifyContent","fontSize","fontWeight","marginBottom","paddingTop","flexDirection","paddingVertical","height","marginLeft"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/Input/CountryPickerView.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAyBC,WAAW,EAAEC,OAAO,QAAQ,OAAO;AACxE,SACEC,IAAI,EACJC,IAAI,EACJC,gBAAgB,EAChBC,UAAU,QAKL,cAAc;AACrB,SAA+BC,mBAAmB,QAAQ,sBAAsB;AAChF,SAASC,QAAQ,QAAQ,sBAAa;AACtC,SAASC,eAAe,QAAQ,sBAAmB;AAAC,SAAAC,IAAA,IAAAC,KAAA,EAAAC,GAAA,IAAAC,IAAA;AAYpD,MAAMC,UAAU,gBAAGd,KAAK,CAACe,IAAI,CAC3B,CAAC;EACCC,IAAI;EACJC,eAAe;EACfC,SAAS;EACTC;AAMF,CAAC,KAAK;EACJ,MAAMC,WAAW,GAAGA,CAAA,KAAMH,eAAe,CAACD,IAAI,CAAC;EAE/C,oBACEL,KAAA,CAACN,gBAAgB;IAACgB,KAAK,EAAEC,MAAM,CAACC,UAAW;IAACC,OAAO,EAAEJ,WAAY;IAAAK,QAAA,gBAC/Dd,KAAA,CAACR,IAAI;MAACkB,KAAK,EAAEC,MAAM,CAACI,IAAK;MAAAD,QAAA,GAAC,GAAC,EAAChB,eAAe,CAACO,IAAI,CAACW,IAAI,CAAC;IAAA,CAAO,CAAC,eAC9DhB,KAAA,CAACP,IAAI;MAACiB,KAAK,EAAEC,MAAM,CAACM,WAAY;MAAAH,QAAA,gBAC9BZ,IAAA,CAACV,IAAI;QAACkB,KAAK,EAAEH,SAAU;QAAAO,QAAA,EAAET,IAAI,CAACa;MAAI,CAAO,CAAC,eA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
|
import React, { useEffect } from "react";
|
|
4
|
-
import { Canvas, matchFont, Path, Skia, Text, useFont } from "@shopify/react-native-skia";
|
|
4
|
+
import { Canvas, matchFont, Path, Shadow, Skia, Text, useFont, DashPathEffect } from "@shopify/react-native-skia";
|
|
5
5
|
import { useSharedValue, withTiming, useDerivedValue, Easing } from "react-native-reanimated";
|
|
6
6
|
import { Platform } from "react-native";
|
|
7
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
7
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
8
8
|
const CircularProgressBar = ({
|
|
9
9
|
size = 120,
|
|
10
10
|
strokeWidth = 8,
|
|
11
|
-
progress = 0,
|
|
12
|
-
duration = 1000,
|
|
13
11
|
backgroundColor = "#E5E7EB",
|
|
14
12
|
progressColor = "#3B82F6",
|
|
15
13
|
lineCap = "round",
|
|
16
14
|
customText,
|
|
17
15
|
textColor = "white",
|
|
18
16
|
fontSize = size / 4,
|
|
19
|
-
textFont
|
|
17
|
+
textFont,
|
|
18
|
+
style,
|
|
19
|
+
innerShadowColor,
|
|
20
|
+
duration = 1000,
|
|
21
|
+
variant = "progress",
|
|
22
|
+
progress = 0,
|
|
23
|
+
progressPadding = 0,
|
|
24
|
+
currentStep = 0,
|
|
25
|
+
totalSteps = 4,
|
|
26
|
+
stepGap = 15 // Gap of 15 degrees between steps
|
|
20
27
|
}) => {
|
|
21
|
-
const
|
|
28
|
+
const animatedValue = useSharedValue(0);
|
|
22
29
|
const customFont = useFont(textFont, fontSize);
|
|
23
30
|
const font = textFont ? customFont : matchFont({
|
|
24
31
|
fontFamily: Platform.select({
|
|
@@ -28,45 +35,109 @@ const CircularProgressBar = ({
|
|
|
28
35
|
fontSize: fontSize
|
|
29
36
|
});
|
|
30
37
|
const radius = (size - strokeWidth) / 2;
|
|
38
|
+
const circumference = 2 * Math.PI * radius;
|
|
31
39
|
const path = Skia.Path.Make();
|
|
32
40
|
path.addCircle(size / 2, size / 2, radius);
|
|
41
|
+
const progressStrokeWidth = Math.max(0, strokeWidth - progressPadding * 2);
|
|
33
42
|
useEffect(() => {
|
|
34
|
-
|
|
43
|
+
const targetValue = variant === "steps" ? currentStep / (totalSteps || 1) : progress / 100;
|
|
44
|
+
animatedValue.value = withTiming(targetValue, {
|
|
35
45
|
duration,
|
|
36
46
|
easing: Easing.out(Easing.cubic)
|
|
37
47
|
});
|
|
38
|
-
}, [progress, duration]);
|
|
39
|
-
|
|
40
|
-
|
|
48
|
+
}, [progress, currentStep, totalSteps, duration, variant]);
|
|
49
|
+
|
|
50
|
+
// --- Text Logic ---
|
|
51
|
+
const textToDisplay = useDerivedValue(() => {
|
|
52
|
+
if (customText !== undefined) {
|
|
53
|
+
return customText;
|
|
54
|
+
}
|
|
55
|
+
if (variant === "steps") {
|
|
56
|
+
// Round the animated value to the nearest step for display
|
|
57
|
+
const displayStep = Math.round(animatedValue.value * (totalSteps || 1));
|
|
58
|
+
return `${displayStep}/${totalSteps}`;
|
|
59
|
+
}
|
|
60
|
+
return `${Math.round(animatedValue.value * 100)}%`;
|
|
41
61
|
});
|
|
42
|
-
const textToDisplay = customText !== undefined ? customText : percentageText;
|
|
43
62
|
const textX = useDerivedValue(() => {
|
|
44
63
|
if (!font) return 0;
|
|
45
|
-
const
|
|
46
|
-
const textWidth = font.measureText(text).width;
|
|
64
|
+
const textWidth = font.measureText(textToDisplay.value).width;
|
|
47
65
|
return size / 2 - textWidth / 2;
|
|
48
66
|
});
|
|
49
67
|
const textY = size / 2 + fontSize / 3;
|
|
68
|
+
|
|
69
|
+
// --- Steps Variant Logic ---
|
|
70
|
+
const renderSteps = () => {
|
|
71
|
+
// Calculate the total gap length in the circumference
|
|
72
|
+
const totalGapDegrees = (totalSteps || 1) * stepGap;
|
|
73
|
+
const totalArcDegrees = 360 - totalGapDegrees;
|
|
74
|
+
const stepArcLength = totalArcDegrees / (totalSteps || 1) / 360 * circumference;
|
|
75
|
+
const gapLength = stepGap / 360 * circumference;
|
|
76
|
+
const dashPattern = [stepArcLength, gapLength];
|
|
77
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
78
|
+
children: [/*#__PURE__*/_jsx(Path, {
|
|
79
|
+
path: path,
|
|
80
|
+
style: "stroke",
|
|
81
|
+
strokeWidth: strokeWidth,
|
|
82
|
+
strokeCap: lineCap,
|
|
83
|
+
color: backgroundColor,
|
|
84
|
+
children: /*#__PURE__*/_jsx(DashPathEffect, {
|
|
85
|
+
intervals: dashPattern
|
|
86
|
+
})
|
|
87
|
+
}), /*#__PURE__*/_jsxs(Path, {
|
|
88
|
+
path: path,
|
|
89
|
+
style: "stroke",
|
|
90
|
+
strokeWidth: strokeWidth,
|
|
91
|
+
strokeCap: lineCap,
|
|
92
|
+
color: progressColor,
|
|
93
|
+
start: 0,
|
|
94
|
+
end: animatedValue,
|
|
95
|
+
children: [/*#__PURE__*/_jsx(DashPathEffect, {
|
|
96
|
+
intervals: dashPattern
|
|
97
|
+
}), innerShadowColor && /*#__PURE__*/_jsx(Shadow, {
|
|
98
|
+
dx: 0,
|
|
99
|
+
dy: 0,
|
|
100
|
+
blur: 4,
|
|
101
|
+
color: innerShadowColor,
|
|
102
|
+
inner: true
|
|
103
|
+
})]
|
|
104
|
+
})]
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
// --- Progress Variant Logic ---
|
|
109
|
+
const renderProgress = () => {
|
|
110
|
+
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
111
|
+
children: [/*#__PURE__*/_jsx(Path, {
|
|
112
|
+
path: path,
|
|
113
|
+
style: "stroke",
|
|
114
|
+
strokeWidth: strokeWidth,
|
|
115
|
+
strokeCap: lineCap,
|
|
116
|
+
color: backgroundColor
|
|
117
|
+
}), /*#__PURE__*/_jsx(Path, {
|
|
118
|
+
path: path,
|
|
119
|
+
style: "stroke",
|
|
120
|
+
strokeWidth: progressStrokeWidth,
|
|
121
|
+
strokeCap: lineCap,
|
|
122
|
+
color: progressColor,
|
|
123
|
+
start: 0,
|
|
124
|
+
end: animatedValue,
|
|
125
|
+
children: innerShadowColor && /*#__PURE__*/_jsx(Shadow, {
|
|
126
|
+
dx: 0,
|
|
127
|
+
dy: 0,
|
|
128
|
+
blur: 4,
|
|
129
|
+
color: innerShadowColor,
|
|
130
|
+
inner: true
|
|
131
|
+
})
|
|
132
|
+
})]
|
|
133
|
+
});
|
|
134
|
+
};
|
|
50
135
|
return /*#__PURE__*/_jsxs(Canvas, {
|
|
51
|
-
style: {
|
|
136
|
+
style: [{
|
|
52
137
|
width: size,
|
|
53
138
|
height: size
|
|
54
|
-
},
|
|
55
|
-
children: [/*#__PURE__*/_jsx(
|
|
56
|
-
path: path,
|
|
57
|
-
style: "stroke",
|
|
58
|
-
strokeWidth: strokeWidth,
|
|
59
|
-
strokeCap: lineCap,
|
|
60
|
-
color: backgroundColor
|
|
61
|
-
}), /*#__PURE__*/_jsx(Path, {
|
|
62
|
-
path: path,
|
|
63
|
-
style: "stroke",
|
|
64
|
-
strokeWidth: strokeWidth,
|
|
65
|
-
strokeCap: lineCap,
|
|
66
|
-
color: progressColor,
|
|
67
|
-
start: 0,
|
|
68
|
-
end: animatedProgress
|
|
69
|
-
}), font && /*#__PURE__*/_jsx(Text, {
|
|
139
|
+
}, style],
|
|
140
|
+
children: [variant === "steps" ? renderSteps() : renderProgress(), font && /*#__PURE__*/_jsx(Text, {
|
|
70
141
|
font: font,
|
|
71
142
|
color: textColor,
|
|
72
143
|
x: textX,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["React","useEffect","Canvas","matchFont","Path","Skia","Text","useFont","useSharedValue","withTiming","useDerivedValue","Easing","Platform","jsx","_jsx","jsxs","_jsxs","
|
|
1
|
+
{"version":3,"names":["React","useEffect","Canvas","matchFont","Path","Shadow","Skia","Text","useFont","DashPathEffect","useSharedValue","withTiming","useDerivedValue","Easing","Platform","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","CircularProgressBar","size","strokeWidth","backgroundColor","progressColor","lineCap","customText","textColor","fontSize","textFont","style","innerShadowColor","duration","variant","progress","progressPadding","currentStep","totalSteps","stepGap","animatedValue","customFont","font","fontFamily","select","ios","default","radius","circumference","Math","PI","path","Make","addCircle","progressStrokeWidth","max","targetValue","value","easing","out","cubic","textToDisplay","undefined","displayStep","round","textX","textWidth","measureText","width","textY","renderSteps","totalGapDegrees","totalArcDegrees","stepArcLength","gapLength","dashPattern","children","strokeCap","color","intervals","start","end","dx","dy","blur","inner","renderProgress","height","x","y","text"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/ProgressBar/CircularProgressBar.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SACEC,MAAM,EACNC,SAAS,EACTC,IAAI,EACJC,MAAM,EACNC,IAAI,EACJC,IAAI,EACJC,OAAO,EAEPC,cAAc,QACT,4BAA4B;AACnC,SACEC,cAAc,EACdC,UAAU,EACVC,eAAe,EACfC,MAAM,QACD,yBAAyB;AAChC,SAA6BC,QAAQ,QAAmB,cAAc;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AA6BvE,MAAMC,mBAAuD,GAAGA,CAAC;EAC/DC,IAAI,GAAG,GAAG;EACVC,WAAW,GAAG,CAAC;EACfC,eAAe,GAAG,SAAS;EAC3BC,aAAa,GAAG,SAAS;EACzBC,OAAO,GAAG,OAAO;EACjBC,UAAU;EACVC,SAAS,GAAG,OAAO;EACnBC,QAAQ,GAAGP,IAAI,GAAG,CAAC;EACnBQ,QAAQ;EACRC,KAAK;EACLC,gBAAgB;EAChBC,QAAQ,GAAG,IAAI;EACfC,OAAO,GAAG,UAAU;EACpBC,QAAQ,GAAG,CAAC;EACZC,eAAe,GAAG,CAAC;EACnBC,WAAW,GAAG,CAAC;EACfC,UAAU,GAAG,CAAC;EACdC,OAAO,GAAG,EAAE,CAAE;AAChB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,EAAE,EAAE,CAAE;UAACC,EAAE,EAAE,CAAE;UAACC,IAAI,EAAE,CAAE;UAACN,KAAK,EAAE9C,gBAAiB;UAACqD,KAAK;QAAA,CAAE;MAChE,CACG,CAAC;IAAA,CACP,CAAC;EAEP,CAAC;EAED,oBACEnE,KAAA,CAAChB,MAAM;IAAC6B,KAAK,EAAE,CAAC;MAAEqC,KAAK,EAAE9C,IAAI;MAAEiE,MAAM,EAAEjE;IAAK,CAAC,EAAES,KAAK,CAAE;IAAA6C,QAAA,GACnD1C,OAAO,KAAK,OAAO,GAAGoC,WAAW,CAAC,CAAC,GAAGgB,cAAc,CAAC,CAAC,EAGtD5C,IAAI,iBACH1B,IAAA,CAACT,IAAI;MACHmC,IAAI,EAAEA,IAAK;MACXoC,KAAK,EAAElD,SAAU;MACjB4D,CAAC,EAAEvB,KAAM;MACTwB,CAAC,EAAEpB,KAAM;MACTqB,IAAI,EAAE7B;IAAc,CACrB,CACF;EAAA,CACK,CAAC;AAEb,CAAC;AAED,eAAexC,mBAAmB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["BottomSheet","BottomSheetBackdrop","React","useCallback","useEffect","useMemo","useRef","useState","BackHandler","StyleSheet","Animated","FadeIn","FadeOut","useSafeAreaInsets","BottomSheetStackContext","jsx","_jsx","jsxs","_jsxs","BottomSheetStackProvider","children","stack","setStack","sheetRef","top","push","item","prev","clear","current","close","pop","length","slice","replace","currentItem","canGoBack","isOpen","snapToIndex","backHandlerSubscription","addEventListener","remove","AnimatedView","View","enteringAnimation","duration","exitingAnimation","renderBackdrop","props","disappearsOnIndex","style","backgroundColor","appearsOnIndex","pressBehavior","
|
|
1
|
+
{"version":3,"names":["BottomSheet","BottomSheetBackdrop","React","useCallback","useEffect","useMemo","useRef","useState","BackHandler","StyleSheet","Animated","FadeIn","FadeOut","useSafeAreaInsets","BottomSheetStackContext","jsx","_jsx","jsxs","_jsxs","BottomSheetStackProvider","children","stack","setStack","sheetRef","top","push","item","prev","clear","current","close","pop","length","slice","replace","currentItem","canGoBack","isOpen","snapToIndex","backHandlerSubscription","addEventListener","remove","AnimatedView","View","enteringAnimation","duration","exitingAnimation","renderBackdrop","props","disappearsOnIndex","style","backgroundColor","appearsOnIndex","pressBehavior","Provider","value","ref","index","snapPoints","enableDynamicSizing","dynamicSizing","enablePanDownToClose","android_keyboardInputMode","enableBlurKeyboardOnGesture","keyboardBlurBehavior","keyboardBehavior","onClose","backdropComponent","topInset","handleIndicatorStyle","styles","sheetContainer","entering","exiting","animatedView","component","create","flex"],"sourceRoot":"..\\..\\..\\src","sources":["contexts/BottomSheetStackProvider.tsx"],"mappings":";;AAAA,OAAOA,WAAW,IAChBC,mBAAmB,QAEd,sBAAsB;AAC7B,OAAOC,KAAK,IAEVC,WAAW,EACXC,SAAS,EACTC,OAAO,EACPC,MAAM,EACNC,QAAQ,QACH,OAAO;AACd,SAASC,WAAW,EAAEC,UAAU,QAAQ,cAAc;AACtD,OAAOC,QAAQ,IAAIC,MAAM,EAAEC,OAAO,QAAQ,yBAAyB;AACnE,SAASC,iBAAiB,QAAQ,gCAAgC;AAClE,SACEC,uBAAuB,QAElB,8BAA2B;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA;AAEnC,OAAO,MAAMC,wBAA2D,GAAGA,CAAC;EAC1EC;AACF,CAAC,KAAK;EACJ,MAAM,CAACC,KAAK,EAAEC,QAAQ,CAAC,GAAGf,QAAQ,CAAyB,EAAE,CAAC;EAC9D,MAAMgB,QAAQ,GAAGjB,MAAM,CAAc,IAAI,CAAC;EAC1C,MAAM;IAAEkB;EAAI,CAAC,GAAGX,iBAAiB,CAAC,CAAC;EAEnC,MAAMY,IAAI,GAAGtB,WAAW,CAAEuB,IAA0B,IAAK;IACvDJ,QAAQ,CAAEK,IAAI,IAAK,CAAC,GAAGA,IAAI,EAAED,IAAI,CAAC,CAAC;EACrC,CAAC,EAAE,EAAE,CAAC;EAEN,MAAME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C9BC,gBAAgB,EAAC,YAAY;MAC7BC,OAAO,EAAEtC,KAAM;MACfuC,iBAAiB,EAAEpB,cAAe;MAClCqB,QAAQ,EAAE5C,GAAI;MACd6C,oBAAoB,EAAE;QAAElB,eAAe,EAAE;MAAU,CAAE;MACrDD,KAAK,EAAEoB,MAAM,CAACC,cAAe;MAAAnD,QAAA,EAE5Be,WAAW,iBACVnB,IAAA,CAAC0B,YAAY;QAEX8B,QAAQ,EAAE5B,iBAAkB;QAC5B6B,OAAO,EAAE3B,gBAAiB;QAC1BI,KAAK,EAAEoB,MAAM,CAACI,YAAa;QAAAtD,QAAA,EAE1Be,WAAW,CAACwC;MAAS,GALjBtD,KAAK,CAACW,MAMC;IACf,CACU,CAAC;EAAA,CACkB,CAAC;AAEvC,CAAC;AAED,MAAMsC,MAAM,GAAG7D,UAAU,CAACmE,MAAM,CAAC;EAC/BL,cAAc,EAAE;IACd;IACA;IACA;EAAA,CACD;EACDG,YAAY,EAAE;IACZG,IAAI,EAAE;EACR;AACF,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAqDxC,QAAA,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"app.d.ts","sourceRoot":"","sources":["../../../src/app.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAqDxC,QAAA,MAAM,GAAG,yBA6ER,CAAC;AAUF,eAAe,GAAG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CountryPickerView.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/CountryPickerView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,EAOL,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAItB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,UAAU,sBAAsB;IAC9B,SAAS,EAAE,OAAO,EAAE,CAAC;IACrB,eAAe,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxC,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACzC;
|
|
1
|
+
{"version":3,"file":"CountryPickerView.d.ts","sourceRoot":"","sources":["../../../../../src/components/Input/CountryPickerView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoD,MAAM,OAAO,CAAC;AACzE,OAAO,EAOL,SAAS,EACT,SAAS,EACV,MAAM,cAAc,CAAC;AAItB,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,UAAU,sBAAsB;IAC9B,SAAS,EAAE,OAAO,EAAE,CAAC;IACrB,eAAe,EAAE,CAAC,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC;IACtC,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACtC,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IACxC,gBAAgB,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CACzC;AA4BD,eAAO,MAAM,iBAAiB,GAAI,gGAO/B,sBAAsB,sBA2CxB,CAAC"}
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { ImageRequireSource } from "react-native";
|
|
2
|
+
import { ImageRequireSource, ViewStyle } from "react-native";
|
|
3
3
|
interface CircularProgressBarProps {
|
|
4
4
|
size?: number;
|
|
5
5
|
strokeWidth?: number;
|
|
6
|
-
progress: number;
|
|
7
|
-
duration?: number;
|
|
8
6
|
backgroundColor?: string;
|
|
9
7
|
progressColor?: string;
|
|
10
8
|
lineCap?: "butt" | "round" | "square";
|
|
@@ -12,6 +10,15 @@ interface CircularProgressBarProps {
|
|
|
12
10
|
textColor?: string;
|
|
13
11
|
fontSize?: number;
|
|
14
12
|
textFont?: ImageRequireSource;
|
|
13
|
+
style?: ViewStyle;
|
|
14
|
+
innerShadowColor?: string;
|
|
15
|
+
duration?: number;
|
|
16
|
+
variant?: "progress" | "steps";
|
|
17
|
+
progress?: number;
|
|
18
|
+
progressPadding?: number;
|
|
19
|
+
currentStep?: number;
|
|
20
|
+
totalSteps?: number;
|
|
21
|
+
stepGap?: number;
|
|
15
22
|
}
|
|
16
23
|
declare const CircularProgressBar: React.FC<CircularProgressBarProps>;
|
|
17
24
|
export default CircularProgressBar;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CircularProgressBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/ProgressBar/CircularProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"CircularProgressBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/ProgressBar/CircularProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAkBzC,OAAO,EAAE,kBAAkB,EAAY,SAAS,EAAE,MAAM,cAAc,CAAC;AAEvE,UAAU,wBAAwB;IAChC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,GAAG,QAAQ,CAAC;IACtC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAGlB,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAG/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IAGzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CA8J3D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BottomSheetStackProvider.d.ts","sourceRoot":"","sources":["../../../../src/contexts/BottomSheetStackProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EACZ,SAAS,EAMV,MAAM,OAAO,CAAC;AASf,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"BottomSheetStackProvider.d.ts","sourceRoot":"","sources":["../../../../src/contexts/BottomSheetStackProvider.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EACZ,SAAS,EAMV,MAAM,OAAO,CAAC;AASf,eAAO,MAAM,wBAAwB,EAAE,KAAK,CAAC,EAAE,CAAC;IAAE,QAAQ,EAAE,SAAS,CAAA;CAAE,CA0GtE,CAAC"}
|
package/package.json
CHANGED
package/src/app.tsx
CHANGED
|
@@ -119,7 +119,8 @@ const App = () => {
|
|
|
119
119
|
{/* <DateRangePicker onDatesChange={()=>{}} labelContainerStyle={{backgroundColor:"red"}}></DateRangePicker> */}
|
|
120
120
|
{/* <CarRentalForm onSelectionChange={console.log}></CarRentalForm> */}
|
|
121
121
|
{/* <CarouselCardStack data={DUMMY_DATA} /> */}
|
|
122
|
-
<
|
|
122
|
+
<CircularProgressBar variant="steps" totalSteps={4} currentStep={4} size={43} strokeWidth={2} progressColor="#9CA0A3"></CircularProgressBar>
|
|
123
|
+
{/* <PhoneInput value="" onChangeText={() => {}} inputContainerStyle={{height: 55}}></PhoneInput> */}
|
|
123
124
|
</SafeAreaView>
|
|
124
125
|
</BottomSheetStackProvider>
|
|
125
126
|
</RelatedProvider>
|
|
@@ -132,7 +133,7 @@ const App = () => {
|
|
|
132
133
|
const styles = StyleSheet.create({
|
|
133
134
|
appContainer: {
|
|
134
135
|
flex: 1,
|
|
135
|
-
backgroundColor:
|
|
136
|
+
backgroundColor:"grey",
|
|
136
137
|
justifyContent: "center", // Center the carousel vertically if it's the main content
|
|
137
138
|
},
|
|
138
139
|
});
|
|
@@ -23,7 +23,6 @@ interface CountryPickerViewProps {
|
|
|
23
23
|
countryCodeStyle?: StyleProp<TextStyle>;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
// ADDED: A memoized row component to ensure stability
|
|
27
26
|
const CountryRow = React.memo(
|
|
28
27
|
({
|
|
29
28
|
item,
|
|
@@ -36,7 +35,6 @@ const CountryRow = React.memo(
|
|
|
36
35
|
nameStyle: StyleProp<TextStyle>;
|
|
37
36
|
codeStyle: StyleProp<TextStyle>;
|
|
38
37
|
}) => {
|
|
39
|
-
// This handler is now stable because onSelectCountry is stable
|
|
40
38
|
const handlePress = () => onSelectCountry(item);
|
|
41
39
|
|
|
42
40
|
return (
|
|
@@ -3,9 +3,12 @@ import {
|
|
|
3
3
|
Canvas,
|
|
4
4
|
matchFont,
|
|
5
5
|
Path,
|
|
6
|
+
Shadow,
|
|
6
7
|
Skia,
|
|
7
8
|
Text,
|
|
8
9
|
useFont,
|
|
10
|
+
PathOp,
|
|
11
|
+
DashPathEffect,
|
|
9
12
|
} from "@shopify/react-native-skia";
|
|
10
13
|
import {
|
|
11
14
|
useSharedValue,
|
|
@@ -13,13 +16,11 @@ import {
|
|
|
13
16
|
useDerivedValue,
|
|
14
17
|
Easing,
|
|
15
18
|
} from "react-native-reanimated";
|
|
16
|
-
import { ImageRequireSource, Platform } from "react-native";
|
|
19
|
+
import { ImageRequireSource, Platform, ViewStyle } from "react-native";
|
|
17
20
|
|
|
18
21
|
interface CircularProgressBarProps {
|
|
19
22
|
size?: number;
|
|
20
23
|
strokeWidth?: number;
|
|
21
|
-
progress: number; // 0 to 100
|
|
22
|
-
duration?: number;
|
|
23
24
|
backgroundColor?: string;
|
|
24
25
|
progressColor?: string;
|
|
25
26
|
lineCap?: "butt" | "round" | "square";
|
|
@@ -27,13 +28,26 @@ interface CircularProgressBarProps {
|
|
|
27
28
|
textColor?: string;
|
|
28
29
|
fontSize?: number;
|
|
29
30
|
textFont?: ImageRequireSource;
|
|
31
|
+
style?: ViewStyle;
|
|
32
|
+
innerShadowColor?: string;
|
|
33
|
+
duration?: number;
|
|
34
|
+
|
|
35
|
+
// New variant prop
|
|
36
|
+
variant?: "progress" | "steps";
|
|
37
|
+
|
|
38
|
+
// Props for 'progress' variant
|
|
39
|
+
progress?: number; // 0 to 100
|
|
40
|
+
progressPadding?: number;
|
|
41
|
+
|
|
42
|
+
// Props for 'steps' variant
|
|
43
|
+
currentStep?: number;
|
|
44
|
+
totalSteps?: number;
|
|
45
|
+
stepGap?: number; // The gap between steps in degrees
|
|
30
46
|
}
|
|
31
47
|
|
|
32
48
|
const CircularProgressBar: React.FC<CircularProgressBarProps> = ({
|
|
33
49
|
size = 120,
|
|
34
50
|
strokeWidth = 8,
|
|
35
|
-
progress = 0,
|
|
36
|
-
duration = 1000,
|
|
37
51
|
backgroundColor = "#E5E7EB",
|
|
38
52
|
progressColor = "#3B82F6",
|
|
39
53
|
lineCap = "round",
|
|
@@ -41,66 +55,143 @@ const CircularProgressBar: React.FC<CircularProgressBarProps> = ({
|
|
|
41
55
|
textColor = "white",
|
|
42
56
|
fontSize = size / 4,
|
|
43
57
|
textFont,
|
|
58
|
+
style,
|
|
59
|
+
innerShadowColor,
|
|
60
|
+
duration = 1000,
|
|
61
|
+
variant = "progress",
|
|
62
|
+
progress = 0,
|
|
63
|
+
progressPadding = 0,
|
|
64
|
+
currentStep = 0,
|
|
65
|
+
totalSteps = 4,
|
|
66
|
+
stepGap = 15, // Gap of 15 degrees between steps
|
|
44
67
|
}) => {
|
|
45
|
-
const
|
|
68
|
+
const animatedValue = useSharedValue(0);
|
|
46
69
|
|
|
47
|
-
const customFont = useFont(textFont, fontSize);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
});
|
|
70
|
+
const customFont = useFont(textFont, fontSize);
|
|
71
|
+
const font = textFont
|
|
72
|
+
? customFont
|
|
73
|
+
: matchFont({
|
|
74
|
+
fontFamily: Platform.select({ ios: "Helvetica", default: "serif" }),
|
|
75
|
+
fontSize: fontSize,
|
|
76
|
+
});
|
|
55
77
|
|
|
56
|
-
const radius = (size - strokeWidth) / 2;
|
|
57
|
-
|
|
58
|
-
const path = Skia.Path.Make();
|
|
78
|
+
const radius = (size - strokeWidth) / 2;
|
|
79
|
+
const circumference = 2 * Math.PI * radius;
|
|
80
|
+
const path = Skia.Path.Make();
|
|
59
81
|
path.addCircle(size / 2, size / 2, radius);
|
|
60
82
|
|
|
83
|
+
const progressStrokeWidth = Math.max(0, strokeWidth - progressPadding * 2);
|
|
84
|
+
|
|
61
85
|
useEffect(() => {
|
|
62
|
-
|
|
86
|
+
const targetValue =
|
|
87
|
+
variant === "steps"
|
|
88
|
+
? currentStep / (totalSteps || 1)
|
|
89
|
+
: progress / 100;
|
|
90
|
+
animatedValue.value = withTiming(targetValue, {
|
|
63
91
|
duration,
|
|
64
92
|
easing: Easing.out(Easing.cubic),
|
|
65
93
|
});
|
|
66
|
-
}, [progress, duration]);
|
|
94
|
+
}, [progress, currentStep, totalSteps, duration, variant]);
|
|
67
95
|
|
|
68
|
-
|
|
69
|
-
|
|
96
|
+
// --- Text Logic ---
|
|
97
|
+
const textToDisplay = useDerivedValue(() => {
|
|
98
|
+
if (customText !== undefined) {
|
|
99
|
+
return customText;
|
|
100
|
+
}
|
|
101
|
+
if (variant === "steps") {
|
|
102
|
+
// Round the animated value to the nearest step for display
|
|
103
|
+
const displayStep = Math.round(animatedValue.value * (totalSteps || 1));
|
|
104
|
+
return `${displayStep}/${totalSteps}`;
|
|
105
|
+
}
|
|
106
|
+
return `${Math.round(animatedValue.value * 100)}%`;
|
|
70
107
|
});
|
|
71
108
|
|
|
72
|
-
const textToDisplay = customText !== undefined ? customText : percentageText;
|
|
73
|
-
|
|
74
109
|
const textX = useDerivedValue(() => {
|
|
75
110
|
if (!font) return 0;
|
|
76
|
-
const
|
|
77
|
-
typeof textToDisplay === "string" ? textToDisplay : textToDisplay.value;
|
|
78
|
-
const textWidth = font.measureText(text).width;
|
|
111
|
+
const textWidth = font.measureText(textToDisplay.value).width;
|
|
79
112
|
return size / 2 - textWidth / 2;
|
|
80
113
|
});
|
|
81
114
|
|
|
82
115
|
const textY = size / 2 + fontSize / 3;
|
|
83
116
|
|
|
117
|
+
// --- Steps Variant Logic ---
|
|
118
|
+
const renderSteps = () => {
|
|
119
|
+
// Calculate the total gap length in the circumference
|
|
120
|
+
const totalGapDegrees = (totalSteps || 1) * stepGap;
|
|
121
|
+
const totalArcDegrees = 360 - totalGapDegrees;
|
|
122
|
+
const stepArcLength = (totalArcDegrees / (totalSteps || 1) / 360) * circumference;
|
|
123
|
+
const gapLength = (stepGap / 360) * circumference;
|
|
124
|
+
|
|
125
|
+
const dashPattern = [stepArcLength, gapLength];
|
|
126
|
+
|
|
127
|
+
return (
|
|
128
|
+
<>
|
|
129
|
+
{/* Background Dashed Path */}
|
|
130
|
+
<Path
|
|
131
|
+
path={path}
|
|
132
|
+
style="stroke"
|
|
133
|
+
strokeWidth={strokeWidth}
|
|
134
|
+
strokeCap={lineCap}
|
|
135
|
+
color={backgroundColor}
|
|
136
|
+
>
|
|
137
|
+
<DashPathEffect intervals={dashPattern} />
|
|
138
|
+
</Path>
|
|
139
|
+
|
|
140
|
+
{/* Progress Dashed Path */}
|
|
141
|
+
<Path
|
|
142
|
+
path={path}
|
|
143
|
+
style="stroke"
|
|
144
|
+
strokeWidth={strokeWidth}
|
|
145
|
+
strokeCap={lineCap}
|
|
146
|
+
color={progressColor}
|
|
147
|
+
start={0}
|
|
148
|
+
end={animatedValue}
|
|
149
|
+
>
|
|
150
|
+
<DashPathEffect intervals={dashPattern} />
|
|
151
|
+
{innerShadowColor && (
|
|
152
|
+
<Shadow dx={0} dy={0} blur={4} color={innerShadowColor} inner />
|
|
153
|
+
)}
|
|
154
|
+
</Path>
|
|
155
|
+
</>
|
|
156
|
+
);
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
// --- Progress Variant Logic ---
|
|
160
|
+
const renderProgress = () => {
|
|
161
|
+
return (
|
|
162
|
+
<>
|
|
163
|
+
{/* Background Path */}
|
|
164
|
+
<Path
|
|
165
|
+
path={path}
|
|
166
|
+
style="stroke"
|
|
167
|
+
strokeWidth={strokeWidth}
|
|
168
|
+
strokeCap={lineCap}
|
|
169
|
+
color={backgroundColor}
|
|
170
|
+
/>
|
|
171
|
+
|
|
172
|
+
{/* Progress Path */}
|
|
173
|
+
<Path
|
|
174
|
+
path={path}
|
|
175
|
+
style="stroke"
|
|
176
|
+
strokeWidth={progressStrokeWidth}
|
|
177
|
+
strokeCap={lineCap}
|
|
178
|
+
color={progressColor}
|
|
179
|
+
start={0}
|
|
180
|
+
end={animatedValue}
|
|
181
|
+
>
|
|
182
|
+
{innerShadowColor && (
|
|
183
|
+
<Shadow dx={0} dy={0} blur={4} color={innerShadowColor} inner />
|
|
184
|
+
)}
|
|
185
|
+
</Path>
|
|
186
|
+
</>
|
|
187
|
+
);
|
|
188
|
+
};
|
|
189
|
+
|
|
84
190
|
return (
|
|
85
|
-
<Canvas style={{ width: size, height: size }}>
|
|
86
|
-
|
|
87
|
-
path={path}
|
|
88
|
-
style="stroke"
|
|
89
|
-
strokeWidth={strokeWidth}
|
|
90
|
-
strokeCap={lineCap}
|
|
91
|
-
color={backgroundColor}
|
|
92
|
-
/>
|
|
93
|
-
|
|
94
|
-
<Path
|
|
95
|
-
path={path}
|
|
96
|
-
style="stroke"
|
|
97
|
-
strokeWidth={strokeWidth}
|
|
98
|
-
strokeCap={lineCap}
|
|
99
|
-
color={progressColor}
|
|
100
|
-
start={0}
|
|
101
|
-
end={animatedProgress}
|
|
102
|
-
/>
|
|
191
|
+
<Canvas style={[{ width: size, height: size }, style]}>
|
|
192
|
+
{variant === "steps" ? renderSteps() : renderProgress()}
|
|
103
193
|
|
|
194
|
+
{/* Text */}
|
|
104
195
|
{font && (
|
|
105
196
|
<Text
|
|
106
197
|
font={font}
|