related-ui-components 3.0.0 → 3.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/lib/module/app.js CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  import React, { useState } from "react";
4
4
  import { SafeAreaView, StyleSheet, StatusBar } from "react-native";
5
- import CarouselCardStack from "./components/CarouselCardStack/CarouselCardStack.js"; // Adjust path as needed
5
+ // Adjust path as needed
6
6
  import { GestureHandlerRootView } from "react-native-gesture-handler";
7
- import { SelaDealCard } from "./components/index.js";
8
7
  import { lightTheme, RelatedProvider, useTheme } from "./theme/index.js";
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
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
@@ -40,27 +40,17 @@ const App = () => {
40
40
  children: /*#__PURE__*/_jsxs(BottomSheetStackProvider, {
41
41
  children: [/*#__PURE__*/_jsx(StatusBar, {
42
42
  barStyle: "light-content"
43
- }), /*#__PURE__*/_jsxs(SafeAreaView, {
43
+ }), /*#__PURE__*/_jsx(SafeAreaView, {
44
44
  style: styles.appContainer,
45
- children: [/*#__PURE__*/_jsx(CarouselCardStack, {
46
- data: DUMMY_DATA
47
- // backgroundColor="#333" // Set a background color for the component area
48
- // onActiveIndexChange={(index) => {
49
- // console.log("Active item index:", index);
50
- // }}
51
- }), /*#__PURE__*/_jsx(SelaDealCard, {
52
- variant: "horizontal",
53
- width: 300,
54
- height: 300,
55
- label: "discount",
56
- description: "HELLO",
57
- providerName: "Riva Club",
58
- price: "100",
59
- lockOverlay: true
60
- // grayscaleIntensity={80}
61
- ,
62
- backgroundImage: require("./assets/images/namshi-banner.png")
63
- })]
45
+ children: /*#__PURE__*/_jsx(CircularProgressBar, {
46
+ progress: 40,
47
+ customText: 'بلاتينم',
48
+ totalSteps: 4,
49
+ currentStep: 4,
50
+ size: 150,
51
+ strokeWidth: 2,
52
+ progressColor: "#9CA0A3"
53
+ })
64
54
  })]
65
55
  })
66
56
  })
@@ -1 +1 @@
1
- {"version":3,"names":["React","useState","SafeAreaView","StyleSheet","StatusBar","CarouselCardStack","GestureHandlerRootView","SelaDealCard","lightTheme","RelatedProvider","useTheme","BottomSheetStackProvider","SafeAreaProvider","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DUMMY_DATA","Array","from","length","_","i","id","image","title","App","theme","departureDate","setDepartureDate","undefined","returnDate","setReturnDate","progress","setProgress","handleAnimate","newProgress","Math","floor","random","children","style","flex","barStyle","styles","appContainer","data","variant","width","height","label","description","providerName","price","lockOverlay","backgroundImage","require","create","backgroundColor","justifyContent","alignItems"],"sourceRoot":"..\\..\\src","sources":["app.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAeC,QAAQ,QAAQ,OAAO;AAClD,SAASC,YAAY,EAAEC,UAAU,EAAEC,SAAS,QAAkC,cAAc;AAC5F,OAAOC,iBAAiB,MAAM,qDAAkD,CAAC,CAAC;AAClF,SAASC,sBAAsB,QAAQ,8BAA8B;AACrE,SAUEC,YAAY,QACP,uBAAc;AACrB,SAAoBC,UAAU,EAAEC,eAAe,EAAEC,QAAQ,QAAQ,kBAAS;AAG1E,SAASC,wBAAwB,QAAQ,qBAAY;AACrD,SAASC,gBAAgB,QAAQ,gCAAgC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAIlE,MAAMC,UAAU,GAAGC,KAAK,CAACC,IAAI,CAAC;EAAEC,MAAM,EAAE;AAAG,CAAC,EAAE,CAACC,CAAC,EAAEC,CAAC,MAAM;EACvDC,EAAE,EAAE,SAASD,CAAC,GAAG,CAAC,EAAE;EACpB;EACAE,KAAK,EAAE,2CAA2C;EAClDC,KAAK,EAAE,UAAUH,CAAC,GAAG,CAAC;AACxB,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;gBACnBC,YAAY,EAAC,WAAW;gBACxBC,KAAK,EAAC,KAAK;gBACXC,WAAW;gBACX;gBAAA;gBACAC,eAAe,EAAEC,OAAO,CAAC,mCAAmC;cAAE,CACjD,CAAC;YAAA,CAEJ,CAAC;UAAA,CACS;QAAC,CACZ;MAAC,CACI;IAAC,CACT;EAAC,CACnB,CAAC;AAEP,CAAC;AAED,MAAMZ,MAAM,GAAG3C,UAAU,CAACwD,MAAM,CAAC;EAC/BZ,YAAY,EAAE;IACZH,IAAI,EAAE,CAAC;IACPgB,eAAe,EAAE,MAAM;IACvBC,cAAc,EAAE,QAAQ;IAAE;IAC1BC,UAAU,EAAC;EACb;AACF,CAAC,CAAC;AAEF,eAAelC,GAAG","ignoreList":[]}
1
+ {"version":3,"names":["React","useState","SafeAreaView","StyleSheet","StatusBar","GestureHandlerRootView","lightTheme","RelatedProvider","useTheme","CircularProgressBar","BottomSheetStackProvider","SafeAreaProvider","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","DUMMY_DATA","Array","from","length","_","i","id","image","title","App","theme","departureDate","setDepartureDate","undefined","returnDate","setReturnDate","progress","setProgress","handleAnimate","newProgress","Math","floor","random","children","style","flex","barStyle","styles","appContainer","customText","totalSteps","currentStep","size","strokeWidth","progressColor","create","backgroundColor","justifyContent","alignItems"],"sourceRoot":"..\\..\\src","sources":["app.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAeC,QAAQ,QAAQ,OAAO;AAClD,SAASC,YAAY,EAAEC,UAAU,EAAEC,SAAS,QAAkC,cAAc;AACV;AAClF,SAASC,sBAAsB,QAAQ,8BAA8B;AAarE,SAAoBC,UAAU,EAAEC,eAAe,EAAEC,QAAQ,QAAQ,kBAAS;AAC1E,OAAOC,mBAAmB,MAAM,iDAA8C;AAE9E,SAASC,wBAAwB,QAAQ,qBAAY;AACrD,SAASC,gBAAgB,QAAQ,gCAAgC;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,E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AM,CAACC,YAAa;cAAAL,QAAA,eAuDvC5B,IAAA,CAACJ,mBAAmB;gBAACyB,QAAQ,EAAE,EAAG;gBAAEa,UAAU,EAAE,SAAU;gBAACC,UAAU,EAAE,CAAE;gBAACC,WAAW,EAAE,CAAE;gBAACC,IAAI,EAAE,GAAI;gBAAEC,WAAW,EAAE,CAAE;gBAACC,aAAa,EAAC;cAAS,CAAsB;YAAC,CAqBxJ,CAAC;UAAA,CACS;QAAC,CACZ;MAAC,CACI;IAAC,CACT;EAAC,CACnB,CAAC;AAEP,CAAC;AAED,MAAMP,MAAM,GAAG1C,UAAU,CAACkD,MAAM,CAAC;EAC/BP,YAAY,EAAE;IACZH,IAAI,EAAE,CAAC;IACPW,eAAe,EAAE,MAAM;IACvBC,cAAc,EAAE,QAAQ;IAAE;IAC1BC,UAAU,EAAC;EACb;AACF,CAAC,CAAC;AAEF,eAAe7B,GAAG","ignoreList":[]}
@@ -1,20 +1,20 @@
1
1
  "use strict";
2
2
 
3
3
  import React, { useEffect } from "react";
4
- import { Canvas, matchFont, Path, Shadow, Skia, Text, useFont, DashPathEffect } from "@shopify/react-native-skia";
5
- import { useSharedValue, withTiming, useDerivedValue, Easing } from "react-native-reanimated";
6
- import { Platform } from "react-native";
4
+ import { Canvas, Path, Shadow, Skia, DashPathEffect } from "@shopify/react-native-skia";
5
+ import { useSharedValue, withTiming, Easing } from "react-native-reanimated";
6
+ import { StyleSheet, Text, View } from "react-native";
7
+ import { useTheme } from "../../theme/index.js";
7
8
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
8
9
  const CircularProgressBar = ({
9
10
  size = 120,
10
11
  strokeWidth = 8,
11
- backgroundColor = "#E5E7EB",
12
- progressColor = "#3B82F6",
12
+ backgroundColor,
13
+ progressColor,
13
14
  lineCap = "round",
14
15
  customText,
15
- textColor = "white",
16
+ textColor,
16
17
  fontSize = size / 4,
17
- textFont,
18
18
  style,
19
19
  innerShadowColor,
20
20
  duration = 1000,
@@ -23,17 +23,16 @@ const CircularProgressBar = ({
23
23
  progressPadding = 0,
24
24
  currentStep = 0,
25
25
  totalSteps = 4,
26
- stepGap = 15 // Gap of 15 degrees between steps
26
+ stepGap = 15,
27
+ textStyle
27
28
  }) => {
29
+ const {
30
+ theme
31
+ } = useTheme();
28
32
  const animatedValue = useSharedValue(0);
29
- const customFont = useFont(textFont, fontSize);
30
- const font = textFont ? customFont : matchFont({
31
- fontFamily: Platform.select({
32
- ios: "Helvetica",
33
- default: "serif"
34
- }),
35
- fontSize: fontSize
36
- });
33
+ const finalProgressColor = progressColor || theme.primary;
34
+ const finalBackgroundColor = backgroundColor || theme.disabled;
35
+ const finalTextColor = textColor || theme.onSurface;
37
36
  const radius = (size - strokeWidth) / 2;
38
37
  const circumference = 2 * Math.PI * radius;
39
38
  const path = Skia.Path.Make();
@@ -45,30 +44,8 @@ const CircularProgressBar = ({
45
44
  duration,
46
45
  easing: Easing.out(Easing.cubic)
47
46
  });
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)}%`;
61
- });
62
- const textX = useDerivedValue(() => {
63
- if (!font) return 0;
64
- const textWidth = font.measureText(textToDisplay.value).width;
65
- return size / 2 - textWidth / 2;
66
- });
67
- const textY = size / 2 + fontSize / 3;
68
-
69
- // --- Steps Variant Logic ---
47
+ }, [progress, currentStep, totalSteps, duration, variant, animatedValue]);
70
48
  const renderSteps = () => {
71
- // Calculate the total gap length in the circumference
72
49
  const totalGapDegrees = (totalSteps || 1) * stepGap;
73
50
  const totalArcDegrees = 360 - totalGapDegrees;
74
51
  const stepArcLength = totalArcDegrees / (totalSteps || 1) / 360 * circumference;
@@ -80,7 +57,7 @@ const CircularProgressBar = ({
80
57
  style: "stroke",
81
58
  strokeWidth: strokeWidth,
82
59
  strokeCap: lineCap,
83
- color: backgroundColor,
60
+ color: finalBackgroundColor,
84
61
  children: /*#__PURE__*/_jsx(DashPathEffect, {
85
62
  intervals: dashPattern
86
63
  })
@@ -89,7 +66,7 @@ const CircularProgressBar = ({
89
66
  style: "stroke",
90
67
  strokeWidth: strokeWidth,
91
68
  strokeCap: lineCap,
92
- color: progressColor,
69
+ color: finalProgressColor,
93
70
  start: 0,
94
71
  end: animatedValue,
95
72
  children: [/*#__PURE__*/_jsx(DashPathEffect, {
@@ -104,45 +81,49 @@ const CircularProgressBar = ({
104
81
  })]
105
82
  });
106
83
  };
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
- };
135
- return /*#__PURE__*/_jsxs(Canvas, {
84
+ const renderProgress = () => /*#__PURE__*/_jsxs(_Fragment, {
85
+ children: [/*#__PURE__*/_jsx(Path, {
86
+ path: path,
87
+ style: "stroke",
88
+ strokeWidth: strokeWidth,
89
+ strokeCap: lineCap,
90
+ color: finalBackgroundColor
91
+ }), /*#__PURE__*/_jsx(Path, {
92
+ path: path,
93
+ style: "stroke",
94
+ strokeWidth: progressStrokeWidth,
95
+ strokeCap: lineCap,
96
+ color: finalProgressColor,
97
+ start: 0,
98
+ end: animatedValue,
99
+ children: innerShadowColor && /*#__PURE__*/_jsx(Shadow, {
100
+ dx: 0,
101
+ dy: 0,
102
+ blur: 4,
103
+ color: innerShadowColor,
104
+ inner: true
105
+ })
106
+ })]
107
+ });
108
+ return /*#__PURE__*/_jsxs(View, {
136
109
  style: [{
137
110
  width: size,
138
- height: size
111
+ height: size,
112
+ justifyContent: "center",
113
+ alignItems: "center"
139
114
  }, style],
140
- children: [variant === "steps" ? renderSteps() : renderProgress(), font && /*#__PURE__*/_jsx(Text, {
141
- font: font,
142
- color: textColor,
143
- x: textX,
144
- y: textY,
145
- text: textToDisplay
115
+ children: [/*#__PURE__*/_jsx(Canvas, {
116
+ style: StyleSheet.absoluteFill,
117
+ children: variant === "steps" ? renderSteps() : renderProgress()
118
+ }), /*#__PURE__*/_jsx(Text
119
+ // bold
120
+ , {
121
+ style: [{
122
+ color: finalTextColor,
123
+ fontSize: fontSize,
124
+ textAlign: "center"
125
+ }, textStyle],
126
+ children: customText
146
127
  })]
147
128
  });
148
129
  };
@@ -1 +1 @@
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,K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AA,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
+ {"version":3,"names":["React","useEffect","Canvas","Path","Shadow","Skia","DashPathEffect","useSharedValue","withTiming","Easing","StyleSheet","Text","View","useTheme","jsx","_jsx","jsxs","_jsxs","Fragment","_Fragment","CircularProgressBar","size","strokeWidth","backgroundColor","progressColor","lineCap","customText","textColor","fontSize","style","innerShadowColor","duration","variant","progress","progressPadding","currentStep","totalSteps","stepGap","textStyle","theme","animatedValue","finalProgressColor","primary","finalBackgroundColor","disabled","finalTextColor","onSurface","radius","circumference","Math","PI","path","Make","addCircle","progressStrokeWidth","max","targetValue","value","easing","out","cubic","renderSteps","totalGapDegrees","totalArcDegrees","stepArcLength","gapLength","dashPattern","children","strokeCap","color","intervals","start","end","dx","dy","blur","inner","renderProgress","width","height","justifyContent","alignItems","absoluteFill","textAlign"],"sourceRoot":"..\\..\\..\\..\\src","sources":["components/ProgressBar/CircularProgressBar.tsx"],"mappings":";;AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SACEC,MAAM,EAENC,IAAI,EACJC,MAAM,EACNC,IAAI,EAGJC,cAAc,QACT,4BAA4B;AACnC,SACEC,cAAc,EACdC,UAAU,EAEVC,MAAM,QACD,yBAAyB;AAChC,SAIEC,UAAU,EACVC,IAAI,EAEJC,IAAI,QAEC,cAAc;AACrB,SAASC,QAAQ,QAAQ,sBAAa;AAAC,SAAAC,GAAA,IAAAC,IAAA,EAAAC,IAAA,IAAAC,KAAA,EAAAC,QAAA,IAAAC,SAAA;AAuBvC,MAAMC,mBAAuD,GAAGA,CAAC;EAC/DC,IAAI,GAAG,GAAG;EACVC,WAAW,GAAG,CAAC;EACf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GgB,cAAc,CAAC;IAAC,CACjD,CAAC,eACT9D,IAAA,CAACJ;IACC;IAAA;MACAkB,KAAK,EAAE,CACL;QACEwC,KAAK,EAAExB,cAAc;QACrBjB,QAAQ,EAAEA,QAAQ;QAClBuD,SAAS,EAAE;MACb,CAAC,EACD7C,SAAS,CACT;MAAA6B,QAAA,EAEDzC;IAAU,CACP,CAAC;EAAA,CACH,CAAC;AAEX,CAAC;AAED,eAAeN,mBAAmB","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import { ImageRequireSource, ViewStyle } from "react-native";
2
+ import { StyleProp, TextStyle, ViewStyle } from "react-native";
3
3
  interface CircularProgressBarProps {
4
4
  size?: number;
5
5
  strokeWidth?: number;
@@ -9,7 +9,6 @@ interface CircularProgressBarProps {
9
9
  customText?: string;
10
10
  textColor?: string;
11
11
  fontSize?: number;
12
- textFont?: ImageRequireSource;
13
12
  style?: ViewStyle;
14
13
  innerShadowColor?: string;
15
14
  duration?: number;
@@ -19,6 +18,7 @@ interface CircularProgressBarProps {
19
18
  currentStep?: number;
20
19
  totalSteps?: number;
21
20
  stepGap?: number;
21
+ textStyle?: StyleProp<TextStyle>;
22
22
  }
23
23
  declare const CircularProgressBar: React.FC<CircularProgressBarProps>;
24
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;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
+ {"version":3,"file":"CircularProgressBar.d.ts","sourceRoot":"","sources":["../../../../../src/components/ProgressBar/CircularProgressBar.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoB,MAAM,OAAO,CAAC;AAiBzC,OAAO,EAGL,SAAS,EAGT,SAAS,EAET,SAAS,EACV,MAAM,cAAc,CAAC;AAGtB,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,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;CAClC;AAED,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAuI3D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "related-ui-components",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "main": "./src/index.ts",
5
5
  "scripts": {
6
6
  "start": "expo start",
package/src/app.tsx CHANGED
@@ -52,13 +52,13 @@ const App = () => {
52
52
  <BottomSheetStackProvider>
53
53
  <StatusBar barStyle="light-content" />
54
54
  <SafeAreaView style={styles.appContainer}>
55
- <CarouselCardStack
55
+ {/* <CarouselCardStack
56
56
  data={DUMMY_DATA}
57
57
  // backgroundColor="#333" // Set a background color for the component area
58
58
  // onActiveIndexChange={(index) => {
59
59
  // console.log("Active item index:", index);
60
60
  // }}
61
- />
61
+ /> */}
62
62
  {/* <CircularProgressBar
63
63
  progress={5}
64
64
  lineCap="round"
@@ -106,7 +106,7 @@ const App = () => {
106
106
  {/* <DateRangePicker onDatesChange={()=>{}} labelContainerStyle={{backgroundColor:"red"}}></DateRangePicker> */}
107
107
  {/* <CarRentalForm onSelectionChange={console.log}></CarRentalForm> */}
108
108
  {/* <CarouselCardStack data={DUMMY_DATA} /> */}
109
- {/* <CircularProgressBar variant="steps" totalSteps={4} currentStep={4} size={43} strokeWidth={2} progressColor="#9CA0A3"></CircularProgressBar> */}
109
+ <CircularProgressBar progress={40} customText={'بلاتينم'} totalSteps={4} currentStep={4} size={150} strokeWidth={2} progressColor="#9CA0A3"></CircularProgressBar>
110
110
  {/* <RangeSlider initialMinValue={0} initialMaxValue={100} min={0} max={500} sliderWidth={300} onValueChange={console.log}></RangeSlider> */}
111
111
  {/* <PhoneInput
112
112
  value=""
@@ -114,7 +114,7 @@ const App = () => {
114
114
  inputContainerStyle={{ height: 55 }}
115
115
  ></PhoneInput> */}
116
116
 
117
- <SelaDealCard
117
+ {/* <SelaDealCard
118
118
  variant="horizontal"
119
119
  width={300}
120
120
  height={300}
@@ -126,7 +126,7 @@ const App = () => {
126
126
  // grayscaleIntensity={80}
127
127
  backgroundImage={require("./assets/images/namshi-banner.png")}
128
128
  ></SelaDealCard>
129
-
129
+ */}
130
130
  </SafeAreaView>
131
131
  </BottomSheetStackProvider>
132
132
  </RelatedProvider>
@@ -5,7 +5,6 @@ import {
5
5
  Path,
6
6
  Shadow,
7
7
  Skia,
8
- Text,
9
8
  useFont,
10
9
  PathOp,
11
10
  DashPathEffect,
@@ -16,7 +15,17 @@ import {
16
15
  useDerivedValue,
17
16
  Easing,
18
17
  } from "react-native-reanimated";
19
- import { ImageRequireSource, Platform, ViewStyle } from "react-native";
18
+ import {
19
+ ImageRequireSource,
20
+ Platform,
21
+ StyleProp,
22
+ StyleSheet,
23
+ Text,
24
+ TextStyle,
25
+ View,
26
+ ViewStyle,
27
+ } from "react-native";
28
+ import { useTheme } from "../../theme";
20
29
 
21
30
  interface CircularProgressBarProps {
22
31
  size?: number;
@@ -27,34 +36,27 @@ interface CircularProgressBarProps {
27
36
  customText?: string;
28
37
  textColor?: string;
29
38
  fontSize?: number;
30
- textFont?: ImageRequireSource;
31
39
  style?: ViewStyle;
32
40
  innerShadowColor?: string;
33
41
  duration?: number;
34
-
35
- // New variant prop
36
42
  variant?: "progress" | "steps";
37
-
38
- // Props for 'progress' variant
39
- progress?: number; // 0 to 100
43
+ progress?: number;
40
44
  progressPadding?: number;
41
-
42
- // Props for 'steps' variant
43
45
  currentStep?: number;
44
46
  totalSteps?: number;
45
- stepGap?: number; // The gap between steps in degrees
47
+ stepGap?: number;
48
+ textStyle?: StyleProp<TextStyle>;
46
49
  }
47
50
 
48
51
  const CircularProgressBar: React.FC<CircularProgressBarProps> = ({
49
52
  size = 120,
50
53
  strokeWidth = 8,
51
- backgroundColor = "#E5E7EB",
52
- progressColor = "#3B82F6",
54
+ backgroundColor,
55
+ progressColor,
53
56
  lineCap = "round",
54
57
  customText,
55
- textColor = "white",
58
+ textColor,
56
59
  fontSize = size / 4,
57
- textFont,
58
60
  style,
59
61
  innerShadowColor,
60
62
  duration = 1000,
@@ -63,17 +65,15 @@ const CircularProgressBar: React.FC<CircularProgressBarProps> = ({
63
65
  progressPadding = 0,
64
66
  currentStep = 0,
65
67
  totalSteps = 4,
66
- stepGap = 15, // Gap of 15 degrees between steps
68
+ stepGap = 15,
69
+ textStyle,
67
70
  }) => {
71
+ const { theme } = useTheme();
68
72
  const animatedValue = useSharedValue(0);
69
73
 
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
- });
74
+ const finalProgressColor = progressColor || theme.primary;
75
+ const finalBackgroundColor = backgroundColor || theme.disabled;
76
+ const finalTextColor = textColor || theme.onSurface;
77
77
 
78
78
  const radius = (size - strokeWidth) / 2;
79
79
  const circumference = 2 * Math.PI * radius;
@@ -84,66 +84,38 @@ const CircularProgressBar: React.FC<CircularProgressBarProps> = ({
84
84
 
85
85
  useEffect(() => {
86
86
  const targetValue =
87
- variant === "steps"
88
- ? currentStep / (totalSteps || 1)
89
- : progress / 100;
87
+ variant === "steps" ? currentStep / (totalSteps || 1) : progress / 100;
90
88
  animatedValue.value = withTiming(targetValue, {
91
89
  duration,
92
90
  easing: Easing.out(Easing.cubic),
93
91
  });
94
- }, [progress, currentStep, totalSteps, duration, variant]);
95
-
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)}%`;
107
- });
108
-
109
- const textX = useDerivedValue(() => {
110
- if (!font) return 0;
111
- const textWidth = font.measureText(textToDisplay.value).width;
112
- return size / 2 - textWidth / 2;
113
- });
114
-
115
- const textY = size / 2 + fontSize / 3;
92
+ }, [progress, currentStep, totalSteps, duration, variant, animatedValue]);
116
93
 
117
- // --- Steps Variant Logic ---
118
94
  const renderSteps = () => {
119
- // Calculate the total gap length in the circumference
120
95
  const totalGapDegrees = (totalSteps || 1) * stepGap;
121
96
  const totalArcDegrees = 360 - totalGapDegrees;
122
- const stepArcLength = (totalArcDegrees / (totalSteps || 1) / 360) * circumference;
97
+ const stepArcLength =
98
+ (totalArcDegrees / (totalSteps || 1) / 360) * circumference;
123
99
  const gapLength = (stepGap / 360) * circumference;
124
-
125
100
  const dashPattern = [stepArcLength, gapLength];
126
101
 
127
102
  return (
128
103
  <>
129
- {/* Background Dashed Path */}
130
104
  <Path
131
105
  path={path}
132
106
  style="stroke"
133
107
  strokeWidth={strokeWidth}
134
108
  strokeCap={lineCap}
135
- color={backgroundColor}
109
+ color={finalBackgroundColor}
136
110
  >
137
111
  <DashPathEffect intervals={dashPattern} />
138
112
  </Path>
139
-
140
- {/* Progress Dashed Path */}
141
113
  <Path
142
114
  path={path}
143
115
  style="stroke"
144
116
  strokeWidth={strokeWidth}
145
117
  strokeCap={lineCap}
146
- color={progressColor}
118
+ color={finalProgressColor}
147
119
  start={0}
148
120
  end={animatedValue}
149
121
  >
@@ -156,52 +128,60 @@ const CircularProgressBar: React.FC<CircularProgressBarProps> = ({
156
128
  );
157
129
  };
158
130
 
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
- };
131
+ const renderProgress = () => (
132
+ <>
133
+ <Path
134
+ path={path}
135
+ style="stroke"
136
+ strokeWidth={strokeWidth}
137
+ strokeCap={lineCap}
138
+ color={finalBackgroundColor}
139
+ />
140
+ <Path
141
+ path={path}
142
+ style="stroke"
143
+ strokeWidth={progressStrokeWidth}
144
+ strokeCap={lineCap}
145
+ color={finalProgressColor}
146
+ start={0}
147
+ end={animatedValue}
148
+ >
149
+ {innerShadowColor && (
150
+ <Shadow dx={0} dy={0} blur={4} color={innerShadowColor} inner />
151
+ )}
152
+ </Path>
153
+ </>
154
+ );
189
155
 
190
156
  return (
191
- <Canvas style={[{ width: size, height: size }, style]}>
192
- {variant === "steps" ? renderSteps() : renderProgress()}
193
-
194
- {/* Text */}
195
- {font && (
196
- <Text
197
- font={font}
198
- color={textColor}
199
- x={textX}
200
- y={textY}
201
- text={textToDisplay}
202
- />
203
- )}
204
- </Canvas>
157
+ <View
158
+ style={[
159
+ {
160
+ width: size,
161
+ height: size,
162
+ justifyContent: "center",
163
+ alignItems: "center",
164
+ },
165
+ style,
166
+ ]}
167
+ >
168
+ <Canvas style={StyleSheet.absoluteFill}>
169
+ {variant === "steps" ? renderSteps() : renderProgress()}
170
+ </Canvas>
171
+ <Text
172
+ // bold
173
+ style={[
174
+ {
175
+ color: finalTextColor,
176
+ fontSize: fontSize,
177
+ textAlign: "center",
178
+ },
179
+ textStyle,
180
+ ]}
181
+ >
182
+ {customText}
183
+ </Text>
184
+ </View>
205
185
  );
206
186
  };
207
187