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

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 +9 -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 +65 -22
  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 +168 -41
  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 +73 -62
  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 +130 -148
  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 +221 -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/CHANGELOG.md CHANGED
@@ -8,6 +8,15 @@ All notable changes to this project will be documented in this file.
8
8
 
9
9
  <!-- template-start -->
10
10
 
11
+ ## 3.4.0-beta.6 (10/16/2025 PST)
12
+
13
+ #### 🚀 Updates
14
+
15
+ - Support connecting null values in Area and Line
16
+ - Added label to XAxis and YAxis
17
+ - Switched charts to @shopify/react-native-skia
18
+ - Added gradient support
19
+
11
20
  ## 3.4.0-beta.5 (11/4/2025 PST)
12
21
 
13
22
  This is an artificial version bump with no new change.
@@ -1,9 +1,10 @@
1
1
  import React from 'react';
2
- import { type View, type ViewStyle } from 'react-native';
2
+ import { type StyleProp, type View, type ViewStyle } from 'react-native';
3
3
  import type { BoxBaseProps, BoxProps } from '@coinbase/cds-mobile/layout';
4
+ import { type SkTypefaceFontProvider } from '@shopify/react-native-skia';
4
5
  import { type ScrubberProviderProps } from './scrubber/ScrubberProvider';
5
6
  import { type AxisConfigProps, type ChartInset, type Series } from './utils';
6
- export type CartesianChartBaseProps = BoxBaseProps &
7
+ export type CartesianChartBaseProps = Omit<BoxBaseProps, 'fontFamily'> &
7
8
  Pick<ScrubberProviderProps, 'enableScrubbing' | 'onScrubberPositionChange'> & {
8
9
  /**
9
10
  * Configuration objects that define how to visualize the data.
@@ -21,7 +22,6 @@ export type CartesianChartBaseProps = BoxBaseProps &
21
22
  xAxis?: Partial<Omit<AxisConfigProps, 'id'>>;
22
23
  /**
23
24
  * Configuration for y-axis(es). Can be a single config or array of configs.
24
- * If array, first axis becomes default if no id is specified.
25
25
  */
26
26
  yAxis?: Partial<AxisConfigProps> | Partial<AxisConfigProps>[];
27
27
  /**
@@ -31,37 +31,41 @@ export type CartesianChartBaseProps = BoxBaseProps &
31
31
  };
32
32
  export type CartesianChartProps = CartesianChartBaseProps &
33
33
  Pick<ScrubberProviderProps, 'allowOverflowGestures'> &
34
- BoxProps & {
34
+ Omit<BoxProps, 'fontFamily'> & {
35
35
  /**
36
- * Chart width. If not provided, will use the container's measured width.
36
+ * Default font families to use within ChartText.
37
+ * If not provided, will be the default for the system.
38
+ * @example
39
+ * ['Helvetica', 'sans-serif']
37
40
  */
38
- width?: number | string;
41
+ fontFamilies?: string[];
39
42
  /**
40
- * Chart height. If not provided, will use the container's measured height.
43
+ * Skia font provider to allow for custom fonts.
44
+ * If not provided, the only available fonts will be those defined by the system.
41
45
  */
42
- height?: number | string;
46
+ fontProvider?: SkTypefaceFontProvider;
47
+ /**
48
+ * Custom styles for the root element.
49
+ */
50
+ style?: StyleProp<ViewStyle>;
51
+ /**
52
+ * Custom styles for the component.
53
+ */
54
+ styles?: {
55
+ /**
56
+ * Custom styles for the root element.
57
+ */
58
+ root?: StyleProp<ViewStyle>;
59
+ /**
60
+ * Custom styles for the chart canvas element.
61
+ */
62
+ chart?: StyleProp<ViewStyle>;
63
+ };
43
64
  };
44
65
  export declare const CartesianChart: React.MemoExoticComponent<
45
66
  React.ForwardRefExoticComponent<
46
- import('@coinbase/cds-mobile/styles/styleProps').StyleProps & {
47
- children?: React.ReactNode;
48
- style?: import('react-native').Animated.WithAnimatedValue<
49
- import('react-native').StyleProp<ViewStyle>
50
- >;
51
- animated?: boolean;
52
- elevation?: import('@coinbase/cds-common').ElevationLevels;
53
- font?: import('@coinbase/cds-common').ThemeVars.FontFamily | 'inherit';
54
- pin?: import('@coinbase/cds-common').PinningDirection;
55
- bordered?: boolean;
56
- borderedTop?: boolean;
57
- borderedBottom?: boolean;
58
- borderedStart?: boolean;
59
- borderedEnd?: boolean;
60
- borderedHorizontal?: boolean;
61
- borderedVertical?: boolean;
62
- dangerouslySetBackground?: string;
63
- testID?: string;
64
- } & Pick<ScrubberProviderProps, 'enableScrubbing' | 'onScrubberPositionChange'> & {
67
+ Omit<BoxBaseProps, 'fontFamily'> &
68
+ Pick<ScrubberProviderProps, 'enableScrubbing' | 'onScrubberPositionChange'> & {
65
69
  /**
66
70
  * Configuration objects that define how to visualize the data.
67
71
  * Each series contains its own data array.
@@ -78,7 +82,6 @@ export declare const CartesianChart: React.MemoExoticComponent<
78
82
  xAxis?: Partial<Omit<AxisConfigProps, 'id'>>;
79
83
  /**
80
84
  * Configuration for y-axis(es). Can be a single config or array of configs.
81
- * If array, first axis becomes default if no id is specified.
82
85
  */
83
86
  yAxis?: Partial<AxisConfigProps> | Partial<AxisConfigProps>[];
84
87
  /**
@@ -86,15 +89,36 @@ export declare const CartesianChart: React.MemoExoticComponent<
86
89
  */
87
90
  inset?: number | Partial<ChartInset>;
88
91
  } & Pick<ScrubberProviderProps, 'allowOverflowGestures'> &
89
- Omit<import('react-native').ViewProps, 'style'> & {
92
+ Omit<BoxProps, 'fontFamily'> & {
93
+ /**
94
+ * Default font families to use within ChartText.
95
+ * If not provided, will be the default for the system.
96
+ * @example
97
+ * ['Helvetica', 'sans-serif']
98
+ */
99
+ fontFamilies?: string[];
100
+ /**
101
+ * Skia font provider to allow for custom fonts.
102
+ * If not provided, the only available fonts will be those defined by the system.
103
+ */
104
+ fontProvider?: SkTypefaceFontProvider;
90
105
  /**
91
- * Chart width. If not provided, will use the container's measured width.
106
+ * Custom styles for the root element.
92
107
  */
93
- width?: number | string;
108
+ style?: StyleProp<ViewStyle>;
94
109
  /**
95
- * Chart height. If not provided, will use the container's measured height.
110
+ * Custom styles for the component.
96
111
  */
97
- height?: number | string;
112
+ styles?: {
113
+ /**
114
+ * Custom styles for the root element.
115
+ */
116
+ root?: StyleProp<ViewStyle>;
117
+ /**
118
+ * Custom styles for the chart canvas element.
119
+ */
120
+ chart?: StyleProp<ViewStyle>;
121
+ };
98
122
  } & React.RefAttributes<View>
99
123
  >
100
124
  >;
@@ -1 +1 @@
1
- {"version":3,"file":"CartesianChart.d.ts","sourceRoot":"","sources":["../../src/chart/CartesianChart.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAiD,MAAM,OAAO,CAAC;AACtE,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AAIzD,OAAO,KAAK,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAG1E,OAAO,EAAoB,KAAK,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAE3F,OAAO,EAEL,KAAK,eAAe,EAEpB,KAAK,UAAU,EAUf,KAAK,MAAM,EAEZ,MAAM,SAAS,CAAC;AAEjB,MAAM,MAAM,uBAAuB,GAAG,YAAY,GAChD,IAAI,CAAC,qBAAqB,EAAE,iBAAiB,GAAG,0BAA0B,CAAC,GAAG;IAC5E;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,CAAC,CAAC,CAAC;IAC7C;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC,EAAE,CAAC;IAC9D;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACtC,CAAC;AAEJ,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,GACvD,IAAI,CAAC,qBAAqB,EAAE,uBAAuB,CAAC,GACpD,QAAQ,GAAG;IACT;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,MAA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AC5B;;OAEG;aACM;QACP;;WAEG;QACH,IAAI,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;QAC5B;;WAEG;QACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;KAC9B;+BAqWJ,CAAC"}
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Simplified context bridge utilities for React Native.
3
+ * Adapted from its-fine to enable context sharing across React renderers
4
+ * https://github.com/pmndrs/its-fine/blob/598b81f02778c22ed21121c2b1a786bdefb14e23/src/index.tsx
5
+ */
6
+ import * as React from 'react';
7
+ /**
8
+ * A react-internal tree node provider that binds React children to the React tree for chart context bridging.
9
+ */
10
+ export declare class ChartBridgeProvider extends React.Component<{
11
+ children?: React.ReactNode;
12
+ }> {
13
+ private _reactInternals;
14
+ render(): import('react/jsx-runtime').JSX.Element;
15
+ }
16
+ export type ContextMap = Map<React.Context<any>, any> & {
17
+ get<T>(context: React.Context<T>): T | undefined;
18
+ };
19
+ /**
20
+ * Represents a chart context bridge provider component.
21
+ */
22
+ export type ChartContextBridge = React.FC<React.PropsWithChildren<object>>;
23
+ /**
24
+ * Returns a ChartContextBridge of live context providers to pierce Context across renderers.
25
+ * Pass ChartContextBridge as a component to a secondary renderer (e.g., Skia Canvas) to enable context-sharing in charts.
26
+ */
27
+ export declare function useChartContextBridge(): ChartContextBridge;
28
+ //# sourceMappingURL=ChartContextBridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ChartContextBridge.d.ts","sourceRoot":"","sources":["../../src/chart/ChartContextBridge.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAwE/B;;GAEG;AACH,qBAAa,mBAAoB,SAAQ,KAAK,CAAC,SAAS,CAAC;IAAE,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,CAAC;IACtF,OAAO,CAAC,eAAe,CAAY;IAEnC,MAAM;CAOP;AA4BD,MAAM,MAAM,UAAU,GAAG,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,GAAG;IACtD,GAAG,CAAC,CAAC,EAAE,OAAO,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,SAAS,CAAC;CAClD,CAAC;AA8BF;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,MAAM,CAAC,CAAC,CAAC;AAE3E;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,kBAAkB,CAgB1D"}
@@ -1,48 +1,91 @@
1
- import { type PathProps as SvgPathProps } from 'react-native-svg';
2
- import type { Rect as RectType, SharedProps } from '@coinbase/cds-common/types';
3
- export type PathProps = SharedProps &
4
- SvgPathProps & {
1
+ import type { Rect } from '@coinbase/cds-common/types';
2
+ import { type AnimatedProp, type PathProps as SkiaPathProps } from '@shopify/react-native-skia';
3
+ import type { Transition } from './utils/transition';
4
+ /**
5
+ * Duration in milliseconds for path enter transition.
6
+ */
7
+ export declare const pathEnterTransitionDuration = 500;
8
+ export type PathBaseProps = {
9
+ /**
10
+ * Whether to animate this path. Overrides the animate prop on the Chart component.
11
+ */
12
+ animate?: boolean;
13
+ /**
14
+ * Initial path for enter animation.
15
+ * When provided, the first animation will go from initialPath to d.
16
+ * If not provided, defaults to d (no enter animation).
17
+ */
18
+ initialPath?: string;
19
+ /**
20
+ * Fill color for the path.
21
+ * When provided, will render a fill with the given color.
22
+ * If not provided, will not render a fill.
23
+ */
24
+ fill?: string;
25
+ /**
26
+ * Opacity for the path fill.
27
+ */
28
+ fillOpacity?: number;
29
+ /**
30
+ * Stroke color for the path.
31
+ * When provided, will render a fill with the given color.
32
+ * If not provided, will not render a fill.
33
+ */
34
+ stroke?: string;
35
+ /**
36
+ * Opacity for the path stroke.
37
+ */
38
+ strokeOpacity?: number;
39
+ };
40
+ export type PathProps = PathBaseProps &
41
+ Pick<
42
+ SkiaPathProps,
43
+ | 'antiAlias'
44
+ | 'blendMode'
45
+ | 'children'
46
+ | 'dither'
47
+ | 'invertClip'
48
+ | 'origin'
49
+ | 'matrix'
50
+ | 'strokeCap'
51
+ | 'strokeJoin'
52
+ | 'strokeMiter'
53
+ | 'strokeWidth'
54
+ | 'style'
55
+ | 'transform'
56
+ > & {
5
57
  /**
6
- * The SVG path data string
58
+ * The SVG path data string.
7
59
  */
8
- d?: string;
60
+ d?: AnimatedProp<string | undefined>;
9
61
  /**
10
- * Path fill color
62
+ * Offset added to the clip rect boundaries.
11
63
  */
12
- fill?: string;
13
- /**
14
- * Path stroke color
15
- */
16
- stroke?: string;
17
- /**
18
- * Path stroke width
19
- */
20
- strokeWidth?: number;
21
- /**
22
- * Path stroke opacity
23
- */
24
- strokeOpacity?: number;
64
+ clipOffset?: number;
25
65
  /**
26
- * Path fill opacity
66
+ * Custom clip path.
67
+ * When set, overrides clipRect.
68
+ * @note pass null to disable clipping.
27
69
  */
28
- fillOpacity?: number;
70
+ clipPath?: string | null;
29
71
  /**
30
72
  * Custom clip path rect. If provided, this overrides the default chart rect for clipping.
73
+ * @default drawingArea of chart + clipOffset
74
+ * Will be overridden by clipPath if set.
31
75
  */
32
- clipRect?: RectType;
33
- /**
34
- * Stroke dash array for dashed lines
35
- */
36
- strokeDasharray?: string;
76
+ clipRect?: Rect;
37
77
  /**
38
- * Whether to animate the path.
39
- * Overrides the animate prop on the Chart component.
78
+ * Animation transition
79
+ *
80
+ * @example
81
+ * // Duration based
82
+ * transition={{ type: 'timing', duration: 300 }}
83
+ *
84
+ * @example
85
+ * // Spring based
86
+ * transition={{ type: 'spring', damping: 20, stiffness: 300 }}
40
87
  */
41
- animate?: boolean;
42
- /**
43
- * The offset to add to the clip rect boundaries.
44
- */
45
- clipOffset?: number;
88
+ transition?: Transition;
46
89
  };
47
90
  export declare const Path: import('react').NamedExoticComponent<PathProps>;
48
91
  //# sourceMappingURL=Path.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../src/chart/Path.tsx"],"names":[],"mappings":"AAQA,OAAO,EAKL,KAAK,SAAS,IAAI,YAAY,EAG/B,MAAM,kBAAkB,CAAC;AAE1B,OAAO,KAAK,EAAE,IAAI,IAAI,QAAQ,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAmChF,MAAM,MAAM,SAAS,GAAG,WAAW,GACjC,YAAY,GAAG;IACb;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IACX;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB;;OAEG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEJ,eAAO,MAAM,IAAI,iDA2HhB,CAAC"}
1
+ {"version":3,"file":"Path.d.ts","sourceRoot":"","sources":["../../src/chart/Path.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AACvD,OAAO,EACL,KAAK,YAAY,EAGjB,KAAK,SAAS,IAAI,aAAa,EAGhC,MAAM,4BAA4B,CAAC;AAEpC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD;;GAEG;AACH,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C,MAAM,MAAM,aAAa,GAAG;IAC1B;;OAEG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,aAAa,GACnC,IAAI,CACF,aAAa,EACX,WAAW,GACX,WAAW,GACX,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,QAAQ,GACR,QAAQ,GACR,WAAW,GACX,YAAY,GACZ,aAAa,GACb,aAAa,GACb,OAAO,GACP,WAAW,CACd,GAAG;IACF;;OAEG;IACH,CAAC,CAAC,EAAE,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;IACrC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,IAAI,CAAC;IAChB;;;;;;;;;;OAUG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAmEJ,eAAO,MAAM,IAAI,iDAwJf,CAAC"}
@@ -7,7 +7,7 @@ export declare const PeriodSelectorActiveIndicator: ({
7
7
  background,
8
8
  position,
9
9
  borderRadius,
10
- }: TabsActiveIndicatorProps) => import('react/jsx-runtime').JSX.Element | null;
10
+ }: TabsActiveIndicatorProps) => import('react/jsx-runtime').JSX.Element | undefined;
11
11
  export type LiveTabLabelBaseProps = TextBaseProps & {
12
12
  /**
13
13
  * The label to display.
@@ -1 +1 @@
1
- {"version":3,"file":"PeriodSelector.d.ts","sourceRoot":"","sources":["../../src/chart/PeriodSelector.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,EAAc,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AAO,CAAC;IAClB;;OAEG;IACH,KAAK,CAAC,EAAE,GAAG,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG,qBAAqB,CAAC;AAStD,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;IAxBvB;;;OAGG;YACK,MAAM;IACd;;OAEG;cACO,OAAO;IACjB;;OAEG;YACK,GAAG;+BAyCZ,CAAC;AASF,MAAM,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAErD;;;GAGG;AACH,eAAO,MAAM,cAAc,6TA0B1B,CAAC"}
@@ -1,33 +1,14 @@
1
1
  import React from 'react';
2
- import type { Rect } from '@coinbase/cds-common/types';
3
- import { type ChartPathCurveType } from '../utils';
4
- export type AreaComponentProps = {
5
- d: string;
6
- fill: string;
7
- fillOpacity?: number;
8
- clipRect?: Rect;
9
- stroke?: string;
10
- strokeWidth?: number;
11
- /**
12
- * ID of the y-axis to use.
13
- * If not provided, defaults to the default y-axis.
14
- */
15
- yAxisId?: string;
16
- /**
17
- * Baseline value for the gradient.
18
- * When set, overrides the default baseline.
19
- */
20
- baseline?: number;
21
- };
22
- export type AreaComponent = React.FC<AreaComponentProps>;
23
- export type AreaProps = {
2
+ import { type ChartPathCurveType, type Transition } from '../utils';
3
+ import type { GradientDefinition } from '../utils/gradient';
4
+ export type AreaBaseProps = {
24
5
  /**
25
6
  * The ID of the series to render. Will be used to find the data from the chart context.
26
7
  */
27
8
  seriesId: string;
28
9
  /**
29
10
  * The curve interpolation method to use for the line.
30
- * @default 'linear'
11
+ * @default 'bump'
31
12
  */
32
13
  curve?: ChartPathCurveType;
33
14
  /**
@@ -40,23 +21,57 @@ export type AreaProps = {
40
21
  * Takes precedence over the type prop if provided.
41
22
  */
42
23
  AreaComponent?: AreaComponent;
24
+ /**
25
+ * When true, the area is connected across null values.
26
+ */
27
+ connectNulls?: boolean;
43
28
  /**
44
29
  * The color of the area.
45
- * @default color of the series or theme.color.fgPrimary
30
+ * @default color of the series or 'var(--color-fgPrimary)'
46
31
  */
47
32
  fill?: string;
48
33
  /**
49
- * Opacity of the area.
34
+ * Opacity of the area
35
+ * @note when combined with gradient, both will be applied
50
36
  * @default 1
51
37
  */
52
38
  fillOpacity?: number;
53
- stroke?: string;
54
- strokeWidth?: number;
55
39
  /**
56
40
  * Baseline value for the gradient.
57
41
  * When set, overrides the default baseline.
58
42
  */
59
43
  baseline?: number;
44
+ /**
45
+ * Gradient configuration.
46
+ * When provided, creates gradient or threshold-based coloring.
47
+ */
48
+ gradient?: GradientDefinition;
49
+ /**
50
+ * Whether to animate the area.
51
+ * Overrides the animate value from the chart context.
52
+ */
53
+ animate?: boolean;
54
+ };
55
+ export type AreaProps = AreaBaseProps & {
56
+ /**
57
+ * Transition configuration for path animations.
58
+ */
59
+ transition?: Transition;
60
+ };
61
+ export type AreaComponentProps = Pick<
62
+ AreaProps,
63
+ 'fill' | 'fillOpacity' | 'baseline' | 'gradient' | 'animate' | 'transition'
64
+ > & {
65
+ /**
66
+ * Path of the area
67
+ */
68
+ d: string;
69
+ /**
70
+ * ID of the y-axis to use.
71
+ * If not provided, defaults to the default y-axis.
72
+ */
73
+ yAxisId?: string;
60
74
  };
75
+ export type AreaComponent = React.FC<AreaComponentProps>;
61
76
  export declare const Area: React.NamedExoticComponent<AreaProps>;
62
77
  //# sourceMappingURL=Area.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Area.d.ts","sourceRoot":"","sources":["../../../src/chart/area/Area.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAwB,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,4BAA4B,CAAC;AAIvD,OAAO,EAAE,KAAK,kBAAkB,EAAe,MAAM,UAAU,CAAC;AAMhE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,CAAC,EAAE,MAAM,CAAC;IACV,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,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GAAG,UAAU,CAAC;IACvC;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B;;OAEG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;IAC9B;;;OAGG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG;IACtC;;OAEG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,kBAAkB,GAAG,IAAI,CACnC,SAAS,EACT,MAAM,GAAG,aAAa,GAAG,UAAU,GAAG,UAAU,GAAG,SAAS,GAAG,YAAY,CAC5E,GAAG;IACF;;OAEG;IACH,CAAC,EAAE,MAAM,CAAC;IACV;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,EAAE,CAAC,kBAAkB,CAAC,CAAC;AAEzD,eAAO,MAAM,IAAI,uCA+EhB,CAAC"}
@@ -1,14 +1,29 @@
1
1
  import type { View } from 'react-native';
2
2
  import { type XAxisProps, type YAxisProps } from '../axis';
3
- import { type CartesianChartProps } from '../CartesianChart';
3
+ import { type CartesianChartBaseProps, type CartesianChartProps } from '../CartesianChart';
4
4
  import { type LineProps } from '../line/Line';
5
5
  import { type AxisConfigProps, type Series } from '../utils';
6
6
  import { type AreaProps } from './Area';
7
7
  export type AreaSeries = Series &
8
- Partial<Pick<AreaProps, 'AreaComponent' | 'curve' | 'fillOpacity' | 'type' | 'fill'>> &
9
- Partial<Pick<LineProps, 'LineComponent' | 'strokeWidth' | 'stroke' | 'opacity'>>;
10
- export type AreaChartProps = Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'series'> &
11
- Pick<AreaProps, 'AreaComponent' | 'curve' | 'fillOpacity' | 'type'> &
8
+ Partial<
9
+ Pick<
10
+ AreaProps,
11
+ 'AreaComponent' | 'curve' | 'fillOpacity' | 'type' | 'fill' | 'connectNulls' | 'transition'
12
+ >
13
+ > &
14
+ Partial<Pick<LineProps, 'LineComponent' | 'strokeWidth' | 'stroke' | 'opacity'>> & {
15
+ /**
16
+ * The type of line to render for this series.
17
+ * Overrides the chart-level lineType if provided.
18
+ * @default 'solid'
19
+ */
20
+ lineType?: 'solid' | 'dotted';
21
+ };
22
+ export type AreaChartBaseProps = Omit<CartesianChartBaseProps, 'xAxis' | 'yAxis' | 'series'> &
23
+ Pick<
24
+ AreaProps,
25
+ 'AreaComponent' | 'curve' | 'fillOpacity' | 'type' | 'connectNulls' | 'transition'
26
+ > &
12
27
  Pick<LineProps, 'LineComponent' | 'strokeWidth'> & {
13
28
  /**
14
29
  * Configuration objects that define how to visualize the data.
@@ -41,14 +56,29 @@ export type AreaChartProps = Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'seri
41
56
  * The type of line to render.
42
57
  * @default 'solid'
43
58
  */
44
- lineType?: 'solid' | 'dotted' | 'gradient';
59
+ lineType?: 'solid' | 'dotted';
60
+ /**
61
+ * Configuration for x-axis.
62
+ * Accepts axis config and axis props.
63
+ * To show the axis, set `showXAxis` to true.
64
+ */
45
65
  xAxis?: Partial<AxisConfigProps> & XAxisProps;
66
+ /**
67
+ * Configuration for y-axis.
68
+ * Accepts axis config and axis props.
69
+ * To show the axis, set `showYAxis` to true.
70
+ */
46
71
  yAxis?: Partial<AxisConfigProps> & YAxisProps;
47
72
  };
73
+ export type AreaChartProps = AreaChartBaseProps &
74
+ Omit<CartesianChartProps, 'xAxis' | 'yAxis' | 'series'>;
48
75
  export declare const AreaChart: import('react').MemoExoticComponent<
49
76
  import('react').ForwardRefExoticComponent<
50
- Omit<CartesianChartProps, 'series' | 'xAxis' | 'yAxis'> &
51
- Pick<AreaProps, 'type' | 'curve' | 'fillOpacity' | 'AreaComponent'> &
77
+ Omit<CartesianChartBaseProps, 'series' | 'xAxis' | 'yAxis'> &
78
+ Pick<
79
+ AreaProps,
80
+ 'type' | 'curve' | 'connectNulls' | 'transition' | 'fillOpacity' | 'AreaComponent'
81
+ > &
52
82
  Pick<LineProps, 'strokeWidth' | 'LineComponent'> & {
53
83
  /**
54
84
  * Configuration objects that define how to visualize the data.
@@ -81,10 +111,21 @@ export declare const AreaChart: import('react').MemoExoticComponent<
81
111
  * The type of line to render.
82
112
  * @default 'solid'
83
113
  */
84
- lineType?: 'solid' | 'dotted' | 'gradient';
114
+ lineType?: 'solid' | 'dotted';
115
+ /**
116
+ * Configuration for x-axis.
117
+ * Accepts axis config and axis props.
118
+ * To show the axis, set `showXAxis` to true.
119
+ */
85
120
  xAxis?: Partial<AxisConfigProps> & XAxisProps;
121
+ /**
122
+ * Configuration for y-axis.
123
+ * Accepts axis config and axis props.
124
+ * To show the axis, set `showYAxis` to true.
125
+ */
86
126
  yAxis?: Partial<AxisConfigProps> & YAxisProps;
87
- } & import('react').RefAttributes<View>
127
+ } & Omit<CartesianChartProps, 'series' | 'xAxis' | 'yAxis'> &
128
+ import('react').RefAttributes<View>
88
129
  >
89
130
  >;
90
131
  //# sourceMappingURL=AreaChart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"AreaChart.d.ts","sourceRoot":"","sources":["../../../src/chart/area/AreaChart.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAEzC,OAAO,EAAS,KAAK,UAAU,EAAS,KAAK,UAAU,EAAE,MAAM,SAAS,CAAC;AACzE,OAAO,EAAkB,KAAK,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,cAAc,CAAC;AACpD,OAAO,EACL,KAAK,eAAe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,GAAG,aAAa,CAAC,GAAG;IACjD;;;OAGG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IAC3B;;;;;;;OAOG;IACH,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,GAAG,QAAQ,CAAC;IAC9B;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;IAC9C;;;;OAIG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU,CAAC;CAC/C,CAAC;AAEJ,MAAM,MAAM,cAAc,GAAG,kBAAkB,GAC7C,IAAI,CAAC,mBAAmB,EAAE,OAAO,GAAG,OAAO,GAAG,QAAQ,CAAC,CAAC;AAE1D,eAAO,MAAM,SAAS;IAjDlB;;;OAGG;aACM,KAAK,CAAC,UAAU,CAAC;IAC1B;;;;;;;OAOG;cACO,OAAO;IACjB;;OAEG;gBACS,OAAO;IACnB;;OAEG;gBACS,OAAO;IACnB;;;OAGG;gBACS,OAAO;IACnB;;;OAGG;eACQ,OAAO,GAAG,QAAQ;IAC7B;;;;OAIG;YACK,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU;IAC7C;;;;OAIG;YACK,OAAO,CAAC,eAAe,CAAC,GAAG,UAAU;mGAkLhD,CAAC"}
@@ -1,6 +1,18 @@
1
1
  import { type PathProps } from '../Path';
2
2
  import type { AreaComponentProps } from './Area';
3
- export type DottedAreaProps = Omit<PathProps, 'd' | 'fill' | 'fillOpacity'> &
3
+ export type DottedAreaProps = Pick<
4
+ PathProps,
5
+ | 'initialPath'
6
+ | 'children'
7
+ | 'stroke'
8
+ | 'strokeOpacity'
9
+ | 'strokeWidth'
10
+ | 'strokeCap'
11
+ | 'strokeJoin'
12
+ | 'clipRect'
13
+ | 'clipPath'
14
+ | 'clipOffset'
15
+ > &
4
16
  AreaComponentProps & {
5
17
  /**
6
18
  * Size of the pattern unit (width and height).
@@ -14,14 +26,21 @@ export type DottedAreaProps = Omit<PathProps, 'd' | 'fill' | 'fillOpacity'> &
14
26
  dotSize?: number;
15
27
  /**
16
28
  * Opacity at the peak values (top/bottom of gradient).
17
- * @default 0.3
29
+ * @note only used when no gradient is provided
30
+ * @default 1
18
31
  */
19
32
  peakOpacity?: number;
20
33
  /**
21
34
  * Opacity at the baseline (0 or edge closest to 0).
35
+ * @note only used when no gradient is provided
22
36
  * @default 0
23
37
  */
24
38
  baselineOpacity?: number;
25
39
  };
40
+ /**
41
+ * A customizable dotted area gradient component.
42
+ * When no gradient is provided, renders a default gradient based
43
+ * on the fill color and peak/baseline opacities.
44
+ */
26
45
  export declare const DottedArea: import('react').NamedExoticComponent<DottedAreaProps>;
27
46
  //# sourceMappingURL=DottedArea.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"DottedArea.d.ts","sourceRoot":"","sources":["../../../src/chart/area/DottedArea.tsx"],"names":[],"mappings":"AAKA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAE/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,SAAS,EAAE,GAAG,GAAG,MAAM,GAAG,aAAa,CAAC,GACzE,kBAAkB,GAAG;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEJ,eAAO,MAAM,UAAU,uDA+HtB,CAAC"}
1
+ {"version":3,"file":"DottedArea.d.ts","sourceRoot":"","sources":["../../../src/chart/area/DottedArea.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,SAAS,CAAC;AAK/C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,QAAQ,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG,IAAI,CAChC,SAAS,EACP,aAAa,GACb,UAAU,GACV,QAAQ,GACR,eAAe,GACf,aAAa,GACb,WAAW,GACX,YAAY,GACZ,UAAU,GACV,UAAU,GACV,YAAY,CACf,GACC,kBAAkB,GAAG;IACnB;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEJ;;;;GAIG;AACH,eAAO,MAAM,UAAU,uDAwEtB,CAAC"}