@coinbase/cds-mobile-visualization 3.4.0-beta.5 → 3.4.0-beta.7

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.
Files changed (179) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dts/chart/CartesianChart.d.ts +57 -33
  3. package/dts/chart/CartesianChart.d.ts.map +1 -1
  4. package/dts/chart/ChartContextBridge.d.ts +28 -0
  5. package/dts/chart/ChartContextBridge.d.ts.map +1 -0
  6. package/dts/chart/Path.d.ts +77 -34
  7. package/dts/chart/Path.d.ts.map +1 -1
  8. package/dts/chart/PeriodSelector.d.ts +1 -1
  9. package/dts/chart/PeriodSelector.d.ts.map +1 -1
  10. package/dts/chart/area/Area.d.ts +42 -27
  11. package/dts/chart/area/Area.d.ts.map +1 -1
  12. package/dts/chart/area/AreaChart.d.ts +51 -10
  13. package/dts/chart/area/AreaChart.d.ts.map +1 -1
  14. package/dts/chart/area/DottedArea.d.ts +21 -2
  15. package/dts/chart/area/DottedArea.d.ts.map +1 -1
  16. package/dts/chart/area/GradientArea.d.ts +19 -13
  17. package/dts/chart/area/GradientArea.d.ts.map +1 -1
  18. package/dts/chart/area/SolidArea.d.ts +17 -2
  19. package/dts/chart/area/SolidArea.d.ts.map +1 -1
  20. package/dts/chart/axis/Axis.d.ts +68 -78
  21. package/dts/chart/axis/Axis.d.ts.map +1 -1
  22. package/dts/chart/axis/DefaultAxisTickLabel.d.ts +8 -0
  23. package/dts/chart/axis/DefaultAxisTickLabel.d.ts.map +1 -0
  24. package/dts/chart/axis/XAxis.d.ts +1 -1
  25. package/dts/chart/axis/XAxis.d.ts.map +1 -1
  26. package/dts/chart/axis/YAxis.d.ts +2 -2
  27. package/dts/chart/axis/YAxis.d.ts.map +1 -1
  28. package/dts/chart/axis/index.d.ts +1 -0
  29. package/dts/chart/axis/index.d.ts.map +1 -1
  30. package/dts/chart/bar/Bar.d.ts +16 -13
  31. package/dts/chart/bar/Bar.d.ts.map +1 -1
  32. package/dts/chart/bar/BarChart.d.ts +36 -20
  33. package/dts/chart/bar/BarChart.d.ts.map +1 -1
  34. package/dts/chart/bar/BarPlot.d.ts +2 -1
  35. package/dts/chart/bar/BarPlot.d.ts.map +1 -1
  36. package/dts/chart/bar/BarStack.d.ts +39 -48
  37. package/dts/chart/bar/BarStack.d.ts.map +1 -1
  38. package/dts/chart/bar/BarStackGroup.d.ts +1 -0
  39. package/dts/chart/bar/BarStackGroup.d.ts.map +1 -1
  40. package/dts/chart/bar/DefaultBar.d.ts +1 -1
  41. package/dts/chart/bar/DefaultBar.d.ts.map +1 -1
  42. package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -1
  43. package/dts/chart/gradient/Gradient.d.ts +25 -0
  44. package/dts/chart/gradient/Gradient.d.ts.map +1 -0
  45. package/dts/chart/gradient/index.d.ts +2 -0
  46. package/dts/chart/gradient/index.d.ts.map +1 -0
  47. package/dts/chart/index.d.ts +3 -1
  48. package/dts/chart/index.d.ts.map +1 -1
  49. package/dts/chart/line/DefaultReferenceLineLabel.d.ts +9 -0
  50. package/dts/chart/line/DefaultReferenceLineLabel.d.ts.map +1 -0
  51. package/dts/chart/line/DottedLine.d.ts +13 -5
  52. package/dts/chart/line/DottedLine.d.ts.map +1 -1
  53. package/dts/chart/line/Line.d.ts +62 -25
  54. package/dts/chart/line/Line.d.ts.map +1 -1
  55. package/dts/chart/line/LineChart.d.ts +43 -9
  56. package/dts/chart/line/LineChart.d.ts.map +1 -1
  57. package/dts/chart/line/ReferenceLine.d.ts +68 -20
  58. package/dts/chart/line/ReferenceLine.d.ts.map +1 -1
  59. package/dts/chart/line/SolidLine.d.ts +8 -5
  60. package/dts/chart/line/SolidLine.d.ts.map +1 -1
  61. package/dts/chart/line/index.d.ts +1 -1
  62. package/dts/chart/line/index.d.ts.map +1 -1
  63. package/dts/chart/point/DefaultPointLabel.d.ts +10 -0
  64. package/dts/chart/point/DefaultPointLabel.d.ts.map +1 -0
  65. package/dts/chart/point/Point.d.ts +120 -0
  66. package/dts/chart/point/Point.d.ts.map +1 -0
  67. package/dts/chart/point/index.d.ts +3 -0
  68. package/dts/chart/point/index.d.ts.map +1 -0
  69. package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts +8 -0
  70. package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts.map +1 -0
  71. package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts +12 -0
  72. package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts.map +1 -0
  73. package/dts/chart/scrubber/DefaultScrubberLabel.d.ts +11 -0
  74. package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -0
  75. package/dts/chart/scrubber/Scrubber.d.ts +172 -43
  76. package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
  77. package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +44 -0
  78. package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -0
  79. package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +31 -0
  80. package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -0
  81. package/dts/chart/scrubber/ScrubberProvider.d.ts +6 -3
  82. package/dts/chart/scrubber/ScrubberProvider.d.ts.map +1 -1
  83. package/dts/chart/scrubber/index.d.ts +3 -0
  84. package/dts/chart/scrubber/index.d.ts.map +1 -1
  85. package/dts/chart/text/ChartText.d.ts +151 -77
  86. package/dts/chart/text/ChartText.d.ts.map +1 -1
  87. package/dts/chart/text/{SmartChartTextGroup.d.ts → ChartTextGroup.d.ts} +9 -3
  88. package/dts/chart/text/ChartTextGroup.d.ts.map +1 -0
  89. package/dts/chart/text/index.d.ts +1 -1
  90. package/dts/chart/text/index.d.ts.map +1 -1
  91. package/dts/chart/utils/chart.d.ts +34 -7
  92. package/dts/chart/utils/chart.d.ts.map +1 -1
  93. package/dts/chart/utils/context.d.ts +28 -7
  94. package/dts/chart/utils/context.d.ts.map +1 -1
  95. package/dts/chart/utils/gradient.d.ts +117 -0
  96. package/dts/chart/utils/gradient.d.ts.map +1 -0
  97. package/dts/chart/utils/index.d.ts +3 -0
  98. package/dts/chart/utils/index.d.ts.map +1 -1
  99. package/dts/chart/utils/path.d.ts +53 -0
  100. package/dts/chart/utils/path.d.ts.map +1 -1
  101. package/dts/chart/utils/point.d.ts +60 -1
  102. package/dts/chart/utils/point.d.ts.map +1 -1
  103. package/dts/chart/utils/scale.d.ts +91 -0
  104. package/dts/chart/utils/scale.d.ts.map +1 -1
  105. package/dts/chart/utils/scrubber.d.ts +39 -0
  106. package/dts/chart/utils/scrubber.d.ts.map +1 -0
  107. package/dts/chart/utils/transition.d.ts +140 -0
  108. package/dts/chart/utils/transition.d.ts.map +1 -0
  109. package/esm/chart/CartesianChart.js +164 -70
  110. package/esm/chart/ChartContextBridge.js +148 -0
  111. package/esm/chart/Path.js +196 -113
  112. package/esm/chart/PeriodSelector.js +1 -1
  113. package/esm/chart/__stories__/CartesianChart.stories.js +371 -129
  114. package/esm/chart/__stories__/Chart.stories.js +2 -4
  115. package/esm/chart/area/Area.js +25 -35
  116. package/esm/chart/area/AreaChart.js +17 -12
  117. package/esm/chart/area/DottedArea.js +61 -109
  118. package/esm/chart/area/GradientArea.js +35 -91
  119. package/esm/chart/area/SolidArea.js +22 -8
  120. package/esm/chart/area/__stories__/AreaChart.stories.js +1 -1
  121. package/esm/chart/axis/Axis.js +2 -0
  122. package/esm/chart/axis/DefaultAxisTickLabel.js +11 -0
  123. package/esm/chart/axis/XAxis.js +62 -56
  124. package/esm/chart/axis/YAxis.js +58 -52
  125. package/esm/chart/axis/__stories__/Axis.stories.js +0 -1
  126. package/esm/chart/axis/index.js +1 -0
  127. package/esm/chart/bar/Bar.js +3 -1
  128. package/esm/chart/bar/BarChart.js +15 -37
  129. package/esm/chart/bar/BarPlot.js +41 -35
  130. package/esm/chart/bar/BarStack.js +75 -38
  131. package/esm/chart/bar/BarStackGroup.js +6 -16
  132. package/esm/chart/bar/DefaultBar.js +26 -48
  133. package/esm/chart/bar/DefaultBarStack.js +23 -58
  134. package/esm/chart/bar/__stories__/BarChart.stories.js +463 -77
  135. package/esm/chart/gradient/Gradient.js +53 -0
  136. package/esm/chart/gradient/index.js +1 -0
  137. package/esm/chart/index.js +3 -1
  138. package/esm/chart/line/DefaultReferenceLineLabel.js +66 -0
  139. package/esm/chart/line/DottedLine.js +29 -14
  140. package/esm/chart/line/Line.js +106 -67
  141. package/esm/chart/line/LineChart.js +20 -14
  142. package/esm/chart/line/ReferenceLine.js +80 -63
  143. package/esm/chart/line/SolidLine.js +25 -10
  144. package/esm/chart/line/__stories__/LineChart.stories.js +2098 -1975
  145. package/esm/chart/line/__stories__/ReferenceLine.stories.js +83 -28
  146. package/esm/chart/line/index.js +1 -1
  147. package/esm/chart/point/DefaultPointLabel.js +39 -0
  148. package/esm/chart/point/Point.js +188 -0
  149. package/esm/chart/point/index.js +2 -0
  150. package/esm/chart/scrubber/DefaultScrubberBeacon.js +179 -0
  151. package/esm/chart/scrubber/DefaultScrubberBeaconLabel.js +43 -0
  152. package/esm/chart/scrubber/DefaultScrubberLabel.js +28 -0
  153. package/esm/chart/scrubber/Scrubber.js +126 -146
  154. package/esm/chart/scrubber/ScrubberBeaconGroup.js +161 -0
  155. package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +185 -0
  156. package/esm/chart/scrubber/ScrubberProvider.js +46 -54
  157. package/esm/chart/scrubber/index.js +3 -1
  158. package/esm/chart/text/ChartText.js +242 -174
  159. package/esm/chart/text/{SmartChartTextGroup.js → ChartTextGroup.js} +6 -5
  160. package/esm/chart/text/index.js +1 -1
  161. package/esm/chart/utils/chart.js +44 -3
  162. package/esm/chart/utils/gradient.js +305 -0
  163. package/esm/chart/utils/index.js +3 -0
  164. package/esm/chart/utils/path.js +76 -8
  165. package/esm/chart/utils/point.js +116 -5
  166. package/esm/chart/utils/scale.js +230 -1
  167. package/esm/chart/utils/scrubber.js +139 -0
  168. package/esm/chart/utils/transition.js +214 -0
  169. package/package.json +7 -5
  170. package/dts/chart/Point.d.ts +0 -103
  171. package/dts/chart/Point.d.ts.map +0 -1
  172. package/dts/chart/line/GradientLine.d.ts +0 -45
  173. package/dts/chart/line/GradientLine.d.ts.map +0 -1
  174. package/dts/chart/scrubber/ScrubberBeacon.d.ts +0 -75
  175. package/dts/chart/scrubber/ScrubberBeacon.d.ts.map +0 -1
  176. package/dts/chart/text/SmartChartTextGroup.d.ts.map +0 -1
  177. package/esm/chart/Point.js +0 -111
  178. package/esm/chart/line/GradientLine.js +0 -62
  179. package/esm/chart/scrubber/ScrubberBeacon.js +0 -199
package/esm/chart/Path.js CHANGED
@@ -1,133 +1,216 @@
1
- const _excluded = ["clipRect", "clipOffset", "d", "fill", "stroke", "strokeWidth", "strokeOpacity", "fillOpacity", "strokeDasharray", "testID", "animate"];
2
- function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
1
+ const _excluded = ["d", "initialPath", "fill", "fillOpacity", "stroke", "strokeOpacity", "strokeWidth", "strokeCap", "strokeJoin", "children", "transition"],
2
+ _excluded2 = ["animate", "clipRect", "clipPath", "clipOffset", "d", "initialPath", "fill", "fillOpacity", "stroke", "strokeOpacity", "strokeWidth", "strokeCap", "strokeJoin", "children", "transition"];
3
3
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
4
- import { memo, useCallback, useEffect, useId, useMemo, useRef } from 'react';
5
- import Reanimated, { runOnJS, useAnimatedProps, useAnimatedReaction, useSharedValue, withTiming } from 'react-native-reanimated';
6
- import { ClipPath, Defs, G, Path as SvgPath, Rect } from 'react-native-svg';
7
- import { usePreviousValue } from '@coinbase/cds-common/hooks/usePreviousValue';
8
- import * as interpolate from 'd3-interpolate-path';
4
+ function _objectWithoutPropertiesLoose(r, e) { if (null == r) return {}; var t = {}; for (var n in r) if ({}.hasOwnProperty.call(r, n)) { if (-1 !== e.indexOf(n)) continue; t[n] = r[n]; } return t; }
5
+ import { memo, useEffect, useMemo } from 'react';
6
+ import { useDerivedValue, useSharedValue, withTiming } from 'react-native-reanimated';
7
+ import { Group, Path as SkiaPath, Skia, usePathInterpolation } from '@shopify/react-native-skia';
8
+ import { usePathTransition } from './utils/transition';
9
9
  import { useCartesianChartContext } from './ChartProvider';
10
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
11
- const AnimatedRect = Reanimated.createAnimatedComponent(Rect);
12
- const AnimatedSvgRect = /*#__PURE__*/memo(_ref => {
10
+ import { unwrapAnimatedValue } from './utils';
11
+
12
+ /**
13
+ * Duration in milliseconds for path enter transition.
14
+ */
15
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
16
+ export const pathEnterTransitionDuration = 500;
17
+ const AnimatedPath = /*#__PURE__*/memo(_ref => {
18
+ var _d$value;
13
19
  let {
14
- width,
15
- totalOffset,
16
- rectProps
17
- } = _ref;
18
- const animatedWidth = useSharedValue(width + totalOffset);
19
- const animatedProps = useAnimatedProps(() => {
20
- return {
21
- width: animatedWidth.value
22
- };
20
+ d = '',
21
+ initialPath,
22
+ fill,
23
+ fillOpacity,
24
+ stroke,
25
+ strokeOpacity,
26
+ strokeWidth,
27
+ strokeCap,
28
+ strokeJoin,
29
+ children,
30
+ transition
31
+ } = _ref,
32
+ pathProps = _objectWithoutPropertiesLoose(_ref, _excluded);
33
+ const isDAnimated = typeof d !== 'string';
34
+ const animatedPath = usePathTransition({
35
+ currentPath: isDAnimated ? (_d$value = d.value) != null ? _d$value : '' : d,
36
+ initialPath,
37
+ transition
38
+ });
39
+ const isFilled = fill !== undefined && fill !== 'none';
40
+ const isStroked = stroke !== undefined && stroke !== 'none';
41
+ const activePath = useDerivedValue(() => {
42
+ if (isDAnimated) {
43
+ var _d$value2;
44
+ return (_d$value2 = d.value) != null ? _d$value2 : Skia.Path.Make();
45
+ }
46
+ return animatedPath.value;
47
+ });
48
+ return /*#__PURE__*/_jsxs(_Fragment, {
49
+ children: [isFilled && /*#__PURE__*/_jsx(SkiaPath, _extends({
50
+ color: fill,
51
+ opacity: fillOpacity,
52
+ path: activePath,
53
+ style: "fill"
54
+ }, pathProps, {
55
+ children: children
56
+ })), isStroked && /*#__PURE__*/_jsx(SkiaPath, _extends({
57
+ color: stroke,
58
+ opacity: strokeOpacity,
59
+ path: activePath,
60
+ strokeCap: strokeCap,
61
+ strokeJoin: strokeJoin,
62
+ strokeWidth: strokeWidth,
63
+ style: "stroke"
64
+ }, pathProps, {
65
+ children: children
66
+ }))]
23
67
  });
24
- useEffect(() => {
25
- animatedWidth.value = withTiming(width + totalOffset, {
26
- duration: 1000
27
- });
28
- }, [animatedWidth, width, totalOffset]);
29
- return /*#__PURE__*/_jsx(AnimatedRect, _extends({
30
- animatedProps: animatedProps
31
- }, rectProps));
32
68
  });
33
- export const Path = /*#__PURE__*/memo(_ref2 => {
34
- let {
69
+ export const Path = /*#__PURE__*/memo(props => {
70
+ const {
71
+ animate: animateProp,
35
72
  clipRect,
36
- clipOffset,
73
+ clipPath: clipPathProp,
74
+ clipOffset = 0,
37
75
  d = '',
76
+ initialPath,
38
77
  fill,
78
+ fillOpacity,
39
79
  stroke,
40
- strokeWidth,
41
80
  strokeOpacity,
42
- fillOpacity,
43
- strokeDasharray,
44
- testID,
45
- animate: animateProp
46
- } = _ref2,
47
- pathProps = _objectWithoutPropertiesLoose(_ref2, _excluded);
48
- const pathRef = useRef(null);
49
- const {
50
- animate: animateContext,
51
- drawingArea: contextRect
52
- } = useCartesianChartContext();
53
- const rect = clipRect != null ? clipRect : contextRect;
54
- const animate = animateProp != null ? animateProp : animateContext;
55
- const clipPathId = useId();
56
- const animationProgress = useSharedValue(0);
57
- const targetPath = useMemo(() => d, [d]);
58
- const previousPath = usePreviousValue(targetPath);
59
- const fromPath = useMemo(() => {
60
- if (!animate) return targetPath;
61
- return previousPath != null ? previousPath : targetPath;
62
- }, [animate, previousPath, targetPath]);
63
- const pathInterpolator = useMemo(() => interpolate.interpolatePath(fromPath, targetPath), [fromPath, targetPath]);
64
- const updatePath = useCallback(progress => {
65
- var _pathRef$current;
66
- if (!pathInterpolator) return;
67
- const val = Number(progress.toFixed(4));
68
- (_pathRef$current = pathRef.current) == null || _pathRef$current.setNativeProps({
69
- d: pathInterpolator(val)
70
- });
71
- }, [pathInterpolator]);
72
- useAnimatedReaction(() => animationProgress.value, progress => {
73
- 'worklet';
81
+ strokeWidth,
82
+ strokeCap,
83
+ strokeJoin,
84
+ children,
85
+ transition
86
+ } = props,
87
+ pathProps = _objectWithoutPropertiesLoose(props, _excluded2);
88
+ const context = useCartesianChartContext();
89
+ const rect = clipRect != null ? clipRect : context.drawingArea;
90
+ const animate = animateProp != null ? animateProp : context.animate;
91
+
92
+ // The clip offset provides extra padding to prevent path from being cut off
93
+ // Area charts typically use offset=0 for exact clipping, while lines use offset=2 for breathing room
94
+ const totalOffset = clipOffset * 2; // Applied on both sides
95
+
96
+ // Animation progress for clip path reveal
97
+ const clipProgress = useSharedValue(animate ? 0 : 1);
74
98
 
75
- runOnJS(updatePath)(progress);
76
- }, [updatePath]);
99
+ // Trigger clip path animation when component mounts and animate is true
77
100
  useEffect(() => {
78
- if (!pathRef.current) return;
79
- if (!animate || !pathInterpolator) {
80
- pathRef.current.setNativeProps({
81
- d: targetPath
101
+ if (animate) {
102
+ clipProgress.value = withTiming(1, {
103
+ duration: pathEnterTransitionDuration
82
104
  });
83
- animationProgress.value = 1;
84
- return;
85
105
  }
86
- animationProgress.value = 0;
87
- animationProgress.value = withTiming(1, {
88
- duration: 200
106
+ }, [animate, clipProgress]);
107
+
108
+ // Create initial and target clip paths for animation
109
+ const {
110
+ initialClipPath,
111
+ targetClipPath
112
+ } = useMemo(() => {
113
+ if (!rect) return {
114
+ initialClipPath: null,
115
+ targetClipPath: null
116
+ };
117
+
118
+ // Initial clip path (width = 0)
119
+ const initial = Skia.Path.Make();
120
+ initial.addRect({
121
+ x: rect.x - clipOffset,
122
+ y: rect.y - clipOffset,
123
+ width: 0,
124
+ height: rect.height + totalOffset
89
125
  });
90
- }, [animate, animationProgress, targetPath, pathInterpolator]);
91
- if (!d || !rect) return;
92
126
 
93
- // The clip offset provides extra padding to prevent path from being cut off
94
- // Area charts typically use offset=0 for exact clipping, while lines use offset=2 for breathing room
95
- const totalOffset = (clipOffset != null ? clipOffset : 0) * 2; // Applied on both sides
127
+ // Target clip path (full width)
128
+ const target = Skia.Path.Make();
129
+ target.addRect({
130
+ x: rect.x - clipOffset,
131
+ y: rect.y - clipOffset,
132
+ width: rect.width + totalOffset,
133
+ height: rect.height + totalOffset
134
+ });
135
+ return {
136
+ initialClipPath: initial,
137
+ targetClipPath: target
138
+ };
139
+ }, [rect, clipOffset, totalOffset]);
140
+
141
+ // Use usePathInterpolation for animated clip path
142
+ const animatedClipPath = usePathInterpolation(clipProgress, [0, 1], animate && initialClipPath && targetClipPath ? [initialClipPath, targetClipPath] : targetClipPath ? [targetClipPath, targetClipPath] : [Skia.Path.Make(), Skia.Path.Make()]);
96
143
 
97
- return /*#__PURE__*/_jsxs(G, {
98
- children: [/*#__PURE__*/_jsx(Defs, {
99
- children: animate ? /*#__PURE__*/_jsx(ClipPath, {
100
- id: clipPathId,
101
- children: /*#__PURE__*/_jsx(AnimatedSvgRect, {
102
- rectProps: {
103
- height: rect.height + totalOffset,
104
- x: rect.x - (clipOffset != null ? clipOffset : 0),
105
- y: rect.y - (clipOffset != null ? clipOffset : 0)
106
- },
107
- totalOffset: totalOffset,
108
- width: rect.width
109
- })
110
- }) : /*#__PURE__*/_jsx(ClipPath, {
111
- id: clipPathId,
112
- children: /*#__PURE__*/_jsx(Rect, {
113
- height: contextRect.height + totalOffset,
114
- width: contextRect.width + totalOffset,
115
- x: contextRect.x - (clipOffset != null ? clipOffset : 0),
116
- y: contextRect.y - (clipOffset != null ? clipOffset : 0)
117
- })
118
- })
119
- }), /*#__PURE__*/_jsx(SvgPath, _extends({
120
- ref: pathRef,
121
- clipPath: "url(#" + clipPathId + ")",
122
- clipRule: "nonzero",
123
- d: fromPath,
124
- fill: fill,
125
- fillOpacity: fillOpacity,
126
- stroke: stroke,
127
- strokeDasharray: strokeDasharray,
128
- strokeOpacity: strokeOpacity,
144
+ // Resolve the final clip path:
145
+ // 1. If clipPath prop was explicitly provided, use it (even if null = no clipping)
146
+ // 2. If animating, use the interpolated clip path
147
+ // 3. Otherwise, use static target clip path
148
+ const resolvedClipPath = useMemo(() => {
149
+ // If clipPath was explicitly provided (null or string), use it directly
150
+ if (clipPathProp !== undefined) {
151
+ return clipPathProp;
152
+ }
153
+
154
+ // If not animating or paths are null, return target clip path
155
+ if (!animate || !targetClipPath) {
156
+ return targetClipPath;
157
+ }
158
+
159
+ // Return undefined here since we'll use animatedClipPath directly
160
+ return undefined;
161
+ }, [clipPathProp, animate, targetClipPath]);
162
+
163
+ // Convert SVG path string to SkPath for static rendering
164
+ const staticPath = useDerivedValue(() => {
165
+ var _Skia$Path$MakeFromSV;
166
+ const dValue = unwrapAnimatedValue(d);
167
+ if (!dValue) return Skia.Path.Make();
168
+ return (_Skia$Path$MakeFromSV = Skia.Path.MakeFromSVGString(dValue)) != null ? _Skia$Path$MakeFromSV : Skia.Path.Make();
169
+ }, [d]);
170
+ const isFilled = fill !== undefined && fill !== 'none';
171
+ const isStroked = stroke !== undefined && stroke !== 'none';
172
+ const content = !animate ? /*#__PURE__*/_jsxs(_Fragment, {
173
+ children: [isFilled && /*#__PURE__*/_jsx(SkiaPath, _extends({
174
+ color: fill,
175
+ opacity: fillOpacity,
176
+ path: staticPath,
177
+ style: "fill"
178
+ }, pathProps, {
179
+ children: children
180
+ })), isStroked && /*#__PURE__*/_jsx(SkiaPath, _extends({
181
+ color: stroke,
182
+ opacity: strokeOpacity,
183
+ path: staticPath,
184
+ strokeCap: strokeCap,
185
+ strokeJoin: strokeJoin,
129
186
  strokeWidth: strokeWidth,
130
- testID: testID
131
- }, pathProps))]
187
+ style: "stroke"
188
+ }, pathProps, {
189
+ children: children
190
+ }))]
191
+ }) : /*#__PURE__*/_jsx(AnimatedPath, {
192
+ d: d,
193
+ fill: fill,
194
+ fillOpacity: fillOpacity,
195
+ initialPath: initialPath,
196
+ stroke: stroke,
197
+ strokeCap: strokeCap,
198
+ strokeJoin: strokeJoin,
199
+ strokeOpacity: strokeOpacity,
200
+ strokeWidth: strokeWidth,
201
+ transition: transition,
202
+ children: children
203
+ });
204
+
205
+ // Determine which clip path to use
206
+ const finalClipPath = animate && resolvedClipPath === undefined ? animatedClipPath : resolvedClipPath;
207
+
208
+ // If finalClipPath is null, render without clipping
209
+ if (finalClipPath === null) {
210
+ return content;
211
+ }
212
+ return /*#__PURE__*/_jsx(Group, {
213
+ clip: finalClipPath,
214
+ children: content
132
215
  });
133
216
  });
@@ -55,7 +55,7 @@ export const PeriodSelectorActiveIndicator = _ref => {
55
55
  width: animatedValues.value.width,
56
56
  backgroundColor: animatedValues.value.backgroundColor
57
57
  }), [animatedValues]);
58
- if (!width) return null;
58
+ if (!width) return;
59
59
  return /*#__PURE__*/_jsx(Animated.View, {
60
60
  style: [{
61
61
  position: position,