@particle-network/ui-native 0.3.2-beta.3 → 0.4.0-beta.4

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.
@@ -26,7 +26,7 @@ export interface ProgressWrapperProps extends Omit<FlexProps, 'radius' | 'width'
26
26
  /**
27
27
  * 进度条颜色
28
28
  */
29
- color?: UXForegroundColor | 'transparent';
29
+ color?: UXForegroundColor | 'transparent' | `#${string}`;
30
30
  /**
31
31
  * SVG 样式
32
32
  */
@@ -35,8 +35,21 @@ const ProgressWrapper = ({ style, svgStyle, value = 0, width, height, radius = '
35
35
  const rectXY = strokeWidth / 2 + padding / 2;
36
36
  const perimeter = 2 * (rectWidth + rectHeight);
37
37
  const strokeDashoffset = perimeter * (1 - clampedProgress / 100);
38
- const colorValue = 'transparent' === color ? 'transparent' : getColor(color);
39
- const trackColor = 'transparent' === color ? 'transparent' : `${colorValue}40`;
38
+ const colorValue = useMemo(()=>{
39
+ if ('transparent' === color) return 'transparent';
40
+ if (color.startsWith('#')) return color;
41
+ return getColor(color);
42
+ }, [
43
+ color,
44
+ getColor
45
+ ]);
46
+ const trackColor = useMemo(()=>{
47
+ if ('transparent' === color) return 'transparent';
48
+ return `${colorValue}40`;
49
+ }, [
50
+ color,
51
+ colorValue
52
+ ]);
40
53
  const radiusValue = getRadius(radius);
41
54
  const createPathData = (x, y, w, h, r)=>{
42
55
  if (0 === r) return `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@particle-network/ui-native",
3
- "version": "0.3.2-beta.3",
3
+ "version": "0.4.0-beta.4",
4
4
  "main": "./entry.js",
5
5
  "react-native": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -90,8 +90,8 @@
90
90
  "vite": "^6.3.5",
91
91
  "zustand": "^5.0.8",
92
92
  "@particle-network/eslint-config": "0.3.0",
93
- "@particle-network/icons": "0.4.0-beta.3",
94
- "@particle-network/lintstaged-config": "0.1.0"
93
+ "@particle-network/lintstaged-config": "0.1.0",
94
+ "@particle-network/icons": "0.4.0-beta.3"
95
95
  },
96
96
  "overrides": {
97
97
  "react-docgen-typescript": "2.2.2",