@coinbase/cds-mobile-visualization 3.3.0 → 3.4.0-beta.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.
Files changed (223) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dts/chart/CartesianChart.d.ts +101 -0
  3. package/dts/chart/CartesianChart.d.ts.map +1 -0
  4. package/dts/chart/ChartProvider.d.ts +6 -0
  5. package/dts/chart/ChartProvider.d.ts.map +1 -0
  6. package/dts/chart/Path.d.ts +48 -0
  7. package/dts/chart/Path.d.ts.map +1 -0
  8. package/dts/chart/PeriodSelector.d.ts +85 -0
  9. package/dts/chart/PeriodSelector.d.ts.map +1 -0
  10. package/dts/chart/Point.d.ts +103 -0
  11. package/dts/chart/Point.d.ts.map +1 -0
  12. package/dts/chart/area/Area.d.ts +62 -0
  13. package/dts/chart/area/Area.d.ts.map +1 -0
  14. package/dts/chart/area/AreaChart.d.ts +90 -0
  15. package/dts/chart/area/AreaChart.d.ts.map +1 -0
  16. package/dts/chart/area/DottedArea.d.ts +27 -0
  17. package/dts/chart/area/DottedArea.d.ts.map +1 -0
  18. package/dts/chart/area/GradientArea.d.ts +30 -0
  19. package/dts/chart/area/GradientArea.d.ts.map +1 -0
  20. package/dts/chart/area/SolidArea.d.ts +8 -0
  21. package/dts/chart/area/SolidArea.d.ts.map +1 -0
  22. package/dts/chart/area/index.d.ts +6 -0
  23. package/dts/chart/area/index.d.ts.map +1 -0
  24. package/dts/chart/axis/Axis.d.ts +204 -0
  25. package/dts/chart/axis/Axis.d.ts.map +1 -0
  26. package/dts/chart/axis/XAxis.d.ts +16 -0
  27. package/dts/chart/axis/XAxis.d.ts.map +1 -0
  28. package/dts/chart/axis/YAxis.d.ts +21 -0
  29. package/dts/chart/axis/YAxis.d.ts.map +1 -0
  30. package/dts/chart/axis/index.d.ts +4 -0
  31. package/dts/chart/axis/index.d.ts.map +1 -0
  32. package/dts/chart/bar/Bar.d.ts +89 -0
  33. package/dts/chart/bar/Bar.d.ts.map +1 -0
  34. package/dts/chart/bar/BarChart.d.ts +97 -0
  35. package/dts/chart/bar/BarChart.d.ts.map +1 -0
  36. package/dts/chart/bar/BarPlot.d.ts +29 -0
  37. package/dts/chart/bar/BarPlot.d.ts.map +1 -0
  38. package/dts/chart/bar/BarStack.d.ts +111 -0
  39. package/dts/chart/bar/BarStack.d.ts.map +1 -0
  40. package/dts/chart/bar/BarStackGroup.d.ts +35 -0
  41. package/dts/chart/bar/BarStackGroup.d.ts.map +1 -0
  42. package/dts/chart/bar/DefaultBar.d.ts +7 -0
  43. package/dts/chart/bar/DefaultBar.d.ts.map +1 -0
  44. package/dts/chart/bar/DefaultBarStack.d.ts +7 -0
  45. package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -0
  46. package/dts/chart/bar/index.d.ts +8 -0
  47. package/dts/chart/bar/index.d.ts.map +1 -0
  48. package/dts/chart/index.d.ts +13 -0
  49. package/dts/chart/index.d.ts.map +1 -0
  50. package/dts/chart/line/DottedLine.d.ts +12 -0
  51. package/dts/chart/line/DottedLine.d.ts.map +1 -0
  52. package/dts/chart/line/GradientLine.d.ts +45 -0
  53. package/dts/chart/line/GradientLine.d.ts.map +1 -0
  54. package/dts/chart/line/Line.d.ts +78 -0
  55. package/dts/chart/line/Line.d.ts.map +1 -0
  56. package/dts/chart/line/LineChart.d.ts +84 -0
  57. package/dts/chart/line/LineChart.d.ts.map +1 -0
  58. package/dts/chart/line/ReferenceLine.d.ts +91 -0
  59. package/dts/chart/line/ReferenceLine.d.ts.map +1 -0
  60. package/dts/chart/line/SolidLine.d.ts +12 -0
  61. package/dts/chart/line/SolidLine.d.ts.map +1 -0
  62. package/dts/chart/line/index.d.ts +7 -0
  63. package/dts/chart/line/index.d.ts.map +1 -0
  64. package/dts/chart/scrubber/Scrubber.d.ts +104 -0
  65. package/dts/chart/scrubber/Scrubber.d.ts.map +1 -0
  66. package/dts/chart/scrubber/ScrubberBeacon.d.ts +75 -0
  67. package/dts/chart/scrubber/ScrubberBeacon.d.ts.map +1 -0
  68. package/dts/chart/scrubber/ScrubberProvider.d.ts +17 -0
  69. package/dts/chart/scrubber/ScrubberProvider.d.ts.map +1 -0
  70. package/dts/chart/scrubber/index.d.ts +2 -0
  71. package/dts/chart/scrubber/index.d.ts.map +1 -0
  72. package/dts/chart/text/ChartText.d.ts +90 -0
  73. package/dts/chart/text/ChartText.d.ts.map +1 -0
  74. package/dts/chart/text/SmartChartTextGroup.d.ts +55 -0
  75. package/dts/chart/text/SmartChartTextGroup.d.ts.map +1 -0
  76. package/dts/chart/text/index.d.ts +3 -0
  77. package/dts/chart/text/index.d.ts.map +1 -0
  78. package/dts/chart/utils/axis.d.ts +342 -0
  79. package/dts/chart/utils/axis.d.ts.map +1 -0
  80. package/dts/chart/utils/bar.d.ts +20 -0
  81. package/dts/chart/utils/bar.d.ts.map +1 -0
  82. package/dts/chart/utils/chart.d.ts +97 -0
  83. package/dts/chart/utils/chart.d.ts.map +1 -0
  84. package/dts/chart/utils/context.d.ts +95 -0
  85. package/dts/chart/utils/context.d.ts.map +1 -0
  86. package/dts/chart/utils/index.d.ts +8 -0
  87. package/dts/chart/utils/index.d.ts.map +1 -0
  88. package/dts/chart/utils/path.d.ts +107 -0
  89. package/dts/chart/utils/path.d.ts.map +1 -0
  90. package/dts/chart/utils/point.d.ts +75 -0
  91. package/dts/chart/utils/point.d.ts.map +1 -0
  92. package/dts/chart/utils/scale.d.ts +43 -0
  93. package/dts/chart/utils/scale.d.ts.map +1 -0
  94. package/dts/index.d.ts +2 -1
  95. package/dts/index.d.ts.map +1 -1
  96. package/dts/sparkline/Counter.d.ts +7 -2
  97. package/dts/sparkline/Sparkline.d.ts +67 -16
  98. package/dts/sparkline/Sparkline.d.ts.map +1 -1
  99. package/dts/sparkline/SparklineArea.d.ts +10 -4
  100. package/dts/sparkline/SparklineArea.d.ts.map +1 -1
  101. package/dts/sparkline/SparklineAreaPattern.d.ts +12 -4
  102. package/dts/sparkline/SparklineAreaPattern.d.ts.map +1 -1
  103. package/dts/sparkline/SparklineGradient.d.ts +21 -10
  104. package/dts/sparkline/SparklineGradient.d.ts.map +1 -1
  105. package/dts/sparkline/__figma__/Sparkline.figma.d.ts +1 -1
  106. package/dts/sparkline/generateSparklineWithId.d.ts +8 -2
  107. package/dts/sparkline/generateSparklineWithId.d.ts.map +1 -1
  108. package/dts/sparkline/index.d.ts +1 -1
  109. package/dts/sparkline/sparkline-interactive/SparklineAccessibleView.d.ts +8 -3
  110. package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +132 -110
  111. package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts.map +1 -1
  112. package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts +22 -9
  113. package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts.map +1 -1
  114. package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.d.ts +18 -7
  115. package/dts/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.d.ts +9 -4
  116. package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts +11 -6
  117. package/dts/sparkline/sparkline-interactive/SparklineInteractiveMinMax.d.ts +7 -5
  118. package/dts/sparkline/sparkline-interactive/SparklineInteractivePanGestureHandler.d.ts +22 -10
  119. package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts +21 -7
  120. package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts.map +1 -1
  121. package/dts/sparkline/sparkline-interactive/SparklineInteractivePeriodSelector.d.ts +21 -16
  122. package/dts/sparkline/sparkline-interactive/SparklineInteractiveProvider.d.ts +29 -23
  123. package/dts/sparkline/sparkline-interactive/SparklineInteractiveTimeseriesPaths.d.ts +22 -14
  124. package/dts/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.d.ts +1 -1
  125. package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.d.ts +9 -5
  126. package/dts/sparkline/sparkline-interactive/useMinMaxTransform.d.ts +11 -6
  127. package/dts/sparkline/sparkline-interactive/useOpacityAnimation.d.ts +5 -2
  128. package/dts/sparkline/sparkline-interactive/useSparklineInteractiveConstants.d.ts +17 -17
  129. package/dts/sparkline/sparkline-interactive/useSparklineInteractiveLineStyles.d.ts +16 -13
  130. package/dts/sparkline/sparkline-interactive-header/SparklineInteractiveHeader.d.ts +106 -98
  131. package/dts/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.d.ts +1 -1
  132. package/dts/sparkline/sparkline-interactive-header/useSparklineInteractiveHeaderStyles.d.ts +22 -19
  133. package/esm/chart/CartesianChart.js +241 -0
  134. package/esm/chart/ChartProvider.js +10 -0
  135. package/esm/chart/Path.js +133 -0
  136. package/esm/chart/PeriodSelector.js +136 -0
  137. package/esm/chart/Point.js +111 -0
  138. package/esm/chart/__stories__/CartesianChart.stories.js +476 -0
  139. package/esm/chart/__stories__/Chart.stories.js +79 -0
  140. package/esm/chart/__stories__/PeriodSelector.stories.js +294 -0
  141. package/esm/chart/area/Area.js +85 -0
  142. package/esm/chart/area/AreaChart.js +146 -0
  143. package/esm/chart/area/DottedArea.js +128 -0
  144. package/esm/chart/area/GradientArea.js +110 -0
  145. package/esm/chart/area/SolidArea.js +24 -0
  146. package/esm/chart/area/__stories__/AreaChart.stories.js +100 -0
  147. package/esm/chart/area/index.js +7 -0
  148. package/esm/chart/axis/Axis.js +43 -0
  149. package/esm/chart/axis/XAxis.js +181 -0
  150. package/esm/chart/axis/YAxis.js +170 -0
  151. package/esm/chart/axis/__stories__/Axis.stories.js +277 -0
  152. package/esm/chart/axis/index.js +5 -0
  153. package/esm/chart/bar/Bar.js +67 -0
  154. package/esm/chart/bar/BarChart.js +147 -0
  155. package/esm/chart/bar/BarPlot.js +96 -0
  156. package/esm/chart/bar/BarStack.js +514 -0
  157. package/esm/chart/bar/BarStackGroup.js +89 -0
  158. package/esm/chart/bar/DefaultBar.js +78 -0
  159. package/esm/chart/bar/DefaultBarStack.js +82 -0
  160. package/esm/chart/bar/__stories__/BarChart.stories.js +282 -0
  161. package/esm/chart/bar/index.js +9 -0
  162. package/esm/chart/index.js +14 -0
  163. package/esm/chart/line/DottedLine.js +35 -0
  164. package/esm/chart/line/GradientLine.js +62 -0
  165. package/esm/chart/line/Line.js +139 -0
  166. package/esm/chart/line/LineChart.js +115 -0
  167. package/esm/chart/line/ReferenceLine.js +115 -0
  168. package/esm/chart/line/SolidLine.js +31 -0
  169. package/esm/chart/line/__stories__/LineChart.stories.js +2248 -0
  170. package/esm/chart/line/__stories__/ReferenceLine.stories.js +77 -0
  171. package/esm/chart/line/index.js +8 -0
  172. package/esm/chart/scrubber/Scrubber.js +186 -0
  173. package/esm/chart/scrubber/ScrubberBeacon.js +199 -0
  174. package/esm/chart/scrubber/ScrubberProvider.js +143 -0
  175. package/esm/chart/scrubber/index.js +2 -0
  176. package/esm/chart/text/ChartText.js +237 -0
  177. package/esm/chart/text/SmartChartTextGroup.js +210 -0
  178. package/esm/chart/text/index.js +4 -0
  179. package/esm/chart/utils/axis.js +592 -0
  180. package/esm/chart/utils/bar.js +24 -0
  181. package/esm/chart/utils/chart.js +229 -0
  182. package/esm/chart/utils/context.js +15 -0
  183. package/esm/chart/utils/index.js +9 -0
  184. package/esm/chart/utils/path.js +206 -0
  185. package/esm/chart/utils/point.js +118 -0
  186. package/esm/chart/utils/scale.js +48 -0
  187. package/esm/index.js +4 -1
  188. package/esm/sparkline/Sparkline.js +129 -16
  189. package/esm/sparkline/SparklineArea.js +7 -2
  190. package/esm/sparkline/SparklineAreaPattern.js +4 -2
  191. package/esm/sparkline/SparklineGradient.js +4 -0
  192. package/esm/sparkline/generateSparklineWithId.js +3 -2
  193. package/esm/sparkline/sparkline-interactive/SparklineInteractive.js +5 -1
  194. package/esm/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.js +5 -2
  195. package/esm/sparkline/sparkline-interactive/SparklineInteractivePaths.js +4 -0
  196. package/esm/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.js +27 -0
  197. package/package.json +11 -11
  198. package/dts/sparkline/__stories__/Sparkline.stories.d.ts +0 -3
  199. package/dts/sparkline/__stories__/Sparkline.stories.d.ts.map +0 -1
  200. package/dts/sparkline/__stories__/SparklineGradient.stories.d.ts +0 -3
  201. package/dts/sparkline/__stories__/SparklineGradient.stories.d.ts.map +0 -1
  202. package/dts/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.d.ts +0 -3
  203. package/dts/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.d.ts.map +0 -1
  204. package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractive.test.d.ts +0 -2
  205. package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractive.test.d.ts.map +0 -1
  206. package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveHoverDate.test.d.ts +0 -2
  207. package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveHoverDate.test.d.ts.map +0 -1
  208. package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePanGestureHandler.test.d.ts +0 -2
  209. package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePanGestureHandler.test.d.ts.map +0 -1
  210. package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePeriodSelector.test.d.ts +0 -2
  211. package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePeriodSelector.test.d.ts.map +0 -1
  212. package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveTimeseriesPaths.test.d.ts +0 -2
  213. package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractiveTimeseriesPaths.test.d.ts.map +0 -1
  214. package/dts/sparkline/sparkline-interactive/__tests__/useMinMaxTransform.test.d.ts +0 -2
  215. package/dts/sparkline/sparkline-interactive/__tests__/useMinMaxTransform.test.d.ts.map +0 -1
  216. package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.test.disable.d.ts +0 -2
  217. package/dts/sparkline/sparkline-interactive/useInterruptiblePathAnimation.test.disable.d.ts.map +0 -1
  218. package/dts/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.d.ts +0 -4
  219. package/dts/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.d.ts.map +0 -1
  220. package/dts/sparkline/sparkline-interactive-header/__tests__/SparklineInteractiveHeader.test.d.ts +0 -2
  221. package/dts/sparkline/sparkline-interactive-header/__tests__/SparklineInteractiveHeader.test.d.ts.map +0 -1
  222. package/dts/sparkline/sparkline-interactive-header/__tests__/useSparklineInteractiveHeaderStyles.test.d.ts +0 -2
  223. package/dts/sparkline/sparkline-interactive-header/__tests__/useSparklineInteractiveHeaderStyles.test.d.ts.map +0 -1
@@ -2,22 +2,30 @@ import React from 'react';
2
2
  import type { ChartDataPoint, ChartTimeseries } from '@coinbase/cds-common/types';
3
3
  import type { Area, Line } from 'd3-shape';
4
4
  export type TimeseriesPathOnRenderParams = {
5
- path: string;
6
- area: string;
5
+ path: string;
6
+ area: string;
7
7
  };
8
8
  export type TimeseriesPathProps = {
9
- lineFn: Line<ChartDataPoint>;
10
- areaFn: Area<ChartDataPoint>;
11
- timeseries: ChartTimeseries;
12
- initialPath: string;
13
- onRender?: ({ path, area }: TimeseriesPathOnRenderParams) => void;
9
+ lineFn: Line<ChartDataPoint>;
10
+ areaFn: Area<ChartDataPoint>;
11
+ timeseries: ChartTimeseries;
12
+ initialPath: string;
13
+ onRender?: ({ path, area }: TimeseriesPathOnRenderParams) => void;
14
14
  };
15
15
  export type SparklineInteractiveTimeseriesPathsProps = {
16
- initialPath: string;
17
- data: ChartTimeseries[];
18
- width: number;
19
- height: number;
20
- onRender: ({ path, area }: TimeseriesPathOnRenderParams) => void;
16
+ initialPath: string;
17
+ data: ChartTimeseries[];
18
+ width: number;
19
+ height: number;
20
+ onRender: ({ path, area }: TimeseriesPathOnRenderParams) => void;
21
21
  };
22
- export declare const SparklineInteractiveTimeseriesPaths: React.MemoExoticComponent<({ data, width, height, initialPath, onRender }: SparklineInteractiveTimeseriesPathsProps) => import("react/jsx-runtime").JSX.Element>;
23
- //# sourceMappingURL=SparklineInteractiveTimeseriesPaths.d.ts.map
22
+ export declare const SparklineInteractiveTimeseriesPaths: React.MemoExoticComponent<
23
+ ({
24
+ data,
25
+ width,
26
+ height,
27
+ initialPath,
28
+ onRender,
29
+ }: SparklineInteractiveTimeseriesPathsProps) => import('react/jsx-runtime').JSX.Element
30
+ >;
31
+ //# sourceMappingURL=SparklineInteractiveTimeseriesPaths.d.ts.map
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=SparklineInteractive.figma.d.ts.map
2
+ //# sourceMappingURL=SparklineInteractive.figma.d.ts.map
@@ -1,9 +1,13 @@
1
1
  import { Animated } from 'react-native';
2
2
  type Params = {
3
- animationListener: Animated.ValueListenerCallback;
4
- onInterrupt: () => void;
5
- ignoreMinMax?: boolean;
3
+ animationListener: Animated.ValueListenerCallback;
4
+ onInterrupt: () => void;
5
+ ignoreMinMax?: boolean;
6
6
  };
7
- export declare const useInterruptiblePathAnimation: ({ animationListener, onInterrupt, ignoreMinMax, }: Params) => () => void;
7
+ export declare const useInterruptiblePathAnimation: ({
8
+ animationListener,
9
+ onInterrupt,
10
+ ignoreMinMax,
11
+ }: Params) => () => void;
8
12
  export {};
9
- //# sourceMappingURL=useInterruptiblePathAnimation.d.ts.map
13
+ //# sourceMappingURL=useInterruptiblePathAnimation.d.ts.map
@@ -1,11 +1,16 @@
1
1
  import { Animated } from 'react-native';
2
2
  import type { LayoutRectangle } from 'react-native';
3
3
  type MinMaxTransformParams = {
4
- minMaxLayout: LayoutRectangle;
5
- x: number;
6
- transform: Animated.ValueXY;
7
- opacity: Animated.Value;
4
+ minMaxLayout: LayoutRectangle;
5
+ x: number;
6
+ transform: Animated.ValueXY;
7
+ opacity: Animated.Value;
8
8
  };
9
- export declare function useMinMaxTransform({ minMaxLayout, x, transform, opacity }: MinMaxTransformParams): void;
9
+ export declare function useMinMaxTransform({
10
+ minMaxLayout,
11
+ x,
12
+ transform,
13
+ opacity,
14
+ }: MinMaxTransformParams): void;
10
15
  export {};
11
- //# sourceMappingURL=useMinMaxTransform.d.ts.map
16
+ //# sourceMappingURL=useMinMaxTransform.d.ts.map
@@ -1,3 +1,6 @@
1
1
  import { Animated } from 'react-native';
2
- export declare function useOpacityAnimation(initialValue?: number | undefined, duration?: number | undefined): [Animated.Value, Animated.CompositeAnimation, Animated.CompositeAnimation];
3
- //# sourceMappingURL=useOpacityAnimation.d.ts.map
2
+ export declare function useOpacityAnimation(
3
+ initialValue?: number | undefined,
4
+ duration?: number | undefined,
5
+ ): [Animated.Value, Animated.CompositeAnimation, Animated.CompositeAnimation];
6
+ //# sourceMappingURL=useOpacityAnimation.d.ts.map
@@ -1,22 +1,22 @@
1
1
  type Props = {
2
- compact?: boolean;
2
+ compact?: boolean;
3
3
  };
4
4
  export declare function useSparklineInteractiveConstants({ compact }: Props): {
5
- chartHorizontalGutter: number;
6
- chartWidth: number;
7
- chartHeight: number;
8
- chartDimensionStyles: {
9
- height: number;
10
- width: number;
11
- };
12
- chartMarkerSize: number;
13
- SparklineInteractiveMinMaxLabelHeight: number;
14
- SparklineInteractiveMinMaxVerticalGutter: number;
15
- chartVerticalLineWidth: number;
16
- xRange: number[];
17
- yRange: number[];
18
- startX: number;
19
- endX: number;
5
+ chartHorizontalGutter: number;
6
+ chartWidth: number;
7
+ chartHeight: number;
8
+ chartDimensionStyles: {
9
+ height: number;
10
+ width: number;
11
+ };
12
+ chartMarkerSize: number;
13
+ SparklineInteractiveMinMaxLabelHeight: number;
14
+ SparklineInteractiveMinMaxVerticalGutter: number;
15
+ chartVerticalLineWidth: number;
16
+ xRange: number[];
17
+ yRange: number[];
18
+ startX: number;
19
+ endX: number;
20
20
  };
21
21
  export {};
22
- //# sourceMappingURL=useSparklineInteractiveConstants.d.ts.map
22
+ //# sourceMappingURL=useSparklineInteractiveConstants.d.ts.map
@@ -1,5 +1,6 @@
1
1
  export declare function useSparklineInteractiveLineStyles(): {
2
- dotStyle: ({
2
+ dotStyle: (
3
+ | {
3
4
  backgroundColor: string;
4
5
  position?: undefined;
5
6
  top?: undefined;
@@ -8,7 +9,8 @@ export declare function useSparklineInteractiveLineStyles(): {
8
9
  width?: undefined;
9
10
  borderRadius?: undefined;
10
11
  opacity?: undefined;
11
- } | {
12
+ }
13
+ | {
12
14
  position: string;
13
15
  top: number;
14
16
  left: number;
@@ -17,15 +19,16 @@ export declare function useSparklineInteractiveLineStyles(): {
17
19
  borderRadius: number;
18
20
  opacity: number;
19
21
  backgroundColor?: undefined;
20
- })[];
21
- lineProps: {
22
- strokeWidth: number;
23
- stroke: string;
24
- x1: number;
25
- x2: number;
26
- y1: number;
27
- y2: number;
28
- strokeDasharray: number[];
29
- };
22
+ }
23
+ )[];
24
+ lineProps: {
25
+ strokeWidth: number;
26
+ stroke: string;
27
+ x1: number;
28
+ x2: number;
29
+ y1: number;
30
+ y2: number;
31
+ strokeDasharray: number[];
32
+ };
30
33
  };
31
- //# sourceMappingURL=useSparklineInteractiveLineStyles.d.ts.map
34
+ //# sourceMappingURL=useSparklineInteractiveLineStyles.d.ts.map
@@ -1,110 +1,118 @@
1
1
  import React from 'react';
2
2
  import type { ReactNode } from 'react';
3
- import type { SharedProps, SparklineInteractiveHeaderSignVariant, SparklineInteractiveHeaderVariant } from '@coinbase/cds-common/types';
3
+ import type {
4
+ SharedProps,
5
+ SparklineInteractiveHeaderSignVariant,
6
+ SparklineInteractiveHeaderVariant,
7
+ } from '@coinbase/cds-common/types';
4
8
  export * from '@coinbase/cds-common/types/SparklineInteractiveHeaderBaseProps';
5
9
  export type SparklineInteractiveSubHead = {
6
- /**
7
- * Free form percentage change
8
- */
9
- percent: string;
10
- /**
11
- * Sign to denote the change in price
12
- */
13
- sign: SparklineInteractiveHeaderSignVariant;
14
- /**
15
- * The variant to use for the price and percentage change
16
- */
17
- variant: SparklineInteractiveHeaderVariant;
18
- /**
19
- * Show the dollar amount of price change
20
- */
21
- priceChange?: string;
22
- /**
23
- * The accessoryText to show after the price and / or percentage change. An example is "All time"
24
- */
25
- accessoryText?: string;
26
- /**
27
- * The accessibilityLabel to show for the price and / or percentage change. This should be localized
28
- * @example
29
- * // First, configure your i18n strings
30
- * const messages = defineMessages({
31
- * subHeadPrefix: {
32
- * id: `${i18nKey}.subHeadPrefix`,
33
- * defaultMessage: 'Price increase in the amount of',
34
- * description: 'A prefix to make it clear which direction the price action was moving',
35
- * }
36
- * });
37
- *
38
- * // then provide the translated string the accessibilityLabel prop
39
- * messages.subHeadPrefix
40
- */
41
- accessibilityLabel?: string;
10
+ /**
11
+ * Free form percentage change
12
+ */
13
+ percent: string;
14
+ /**
15
+ * Sign to denote the change in price
16
+ */
17
+ sign: SparklineInteractiveHeaderSignVariant;
18
+ /**
19
+ * The variant to use for the price and percentage change
20
+ */
21
+ variant: SparklineInteractiveHeaderVariant;
22
+ /**
23
+ * Show the dollar amount of price change
24
+ */
25
+ priceChange?: string;
26
+ /**
27
+ * The accessoryText to show after the price and / or percentage change. An example is "All time"
28
+ */
29
+ accessoryText?: string;
30
+ /**
31
+ * The accessibilityLabel to show for the price and / or percentage change. This should be localized
32
+ * @example
33
+ * // First, configure your i18n strings
34
+ * const messages = defineMessages({
35
+ * subHeadPrefix: {
36
+ * id: `${i18nKey}.subHeadPrefix`,
37
+ * defaultMessage: 'Price increase in the amount of',
38
+ * description: 'A prefix to make it clear which direction the price action was moving',
39
+ * }
40
+ * });
41
+ *
42
+ * // then provide the translated string the accessibilityLabel prop
43
+ * messages.subHeadPrefix
44
+ */
45
+ accessibilityLabel?: string;
42
46
  };
43
47
  export type SparklineInteractiveHeaderValues = {
44
- /**
45
- * Describes what the Header represents e.g. Bitcoin Price
46
- */
47
- label?: string;
48
- /**
49
- * Main content of header, this is usually the price
50
- */
51
- title?: React.ReactNode;
52
- /**
53
- * Provides additional information about the title, such as a price change
54
- */
55
- subHead?: SparklineInteractiveSubHead;
48
+ /**
49
+ * Describes what the Header represents e.g. Bitcoin Price
50
+ */
51
+ label?: string;
52
+ /**
53
+ * Main content of header, this is usually the price
54
+ */
55
+ title?: React.ReactNode;
56
+ /**
57
+ * Provides additional information about the title, such as a price change
58
+ */
59
+ subHead?: SparklineInteractiveSubHead;
56
60
  };
57
61
  export type SparklineInteractiveHeaderRef = {
58
- update: (params: SparklineInteractiveHeaderValues) => void;
62
+ update: (params: SparklineInteractiveHeaderValues) => void;
59
63
  };
60
64
  export type SparklineInteractiveHeaderProps = SharedProps & {
61
- /**
62
- * Default title, changing this prop has no effect once the default is rendered. If you use a ReactNode that is not a string, then you cannot use the text based label that supports updates.
63
- */
64
- defaultTitle: React.ReactNode;
65
- /**
66
- * Default label, changing this prop has no effect once the default is rendered.
67
- */
68
- defaultLabel?: string;
69
- /**
70
- * Default SubHead, changing this prop has no effect once the default is rendered.
71
- */
72
- defaultSubHead?: SparklineInteractiveSubHead;
73
- /**
74
- * Adds a label node that allows React components. If you use this node then you cannot use the text based label that supports updates.
75
- */
76
- labelNode?: React.ReactNode;
77
- /**
78
- * Reduce the font size used for the header itself.
79
- */
80
- compact?: boolean;
65
+ /**
66
+ * Default title, changing this prop has no effect once the default is rendered. If you use a ReactNode that is not a string, then you cannot use the text based label that supports updates.
67
+ */
68
+ defaultTitle: React.ReactNode;
69
+ /**
70
+ * Default label, changing this prop has no effect once the default is rendered.
71
+ */
72
+ defaultLabel?: string;
73
+ /**
74
+ * Default SubHead, changing this prop has no effect once the default is rendered.
75
+ */
76
+ defaultSubHead?: SparklineInteractiveSubHead;
77
+ /**
78
+ * Adds a label node that allows React components. If you use this node then you cannot use the text based label that supports updates.
79
+ */
80
+ labelNode?: React.ReactNode;
81
+ /**
82
+ * Reduce the font size used for the header itself.
83
+ */
84
+ compact?: boolean;
81
85
  };
82
86
  export declare const interpolateSubHeadText: (subHead: SparklineInteractiveSubHead) => string;
83
- export declare const SparklineInteractiveHeader: React.MemoExoticComponent<React.ForwardRefExoticComponent<{
84
- /**
85
- * Adds content next to the header. This is useful for interactive buttons
86
- */
87
- trailing?: ReactNode;
88
- } & SharedProps & {
89
- /**
90
- * Default title, changing this prop has no effect once the default is rendered. If you use a ReactNode that is not a string, then you cannot use the text based label that supports updates.
91
- */
92
- defaultTitle: React.ReactNode;
93
- /**
94
- * Default label, changing this prop has no effect once the default is rendered.
95
- */
96
- defaultLabel?: string;
97
- /**
98
- * Default SubHead, changing this prop has no effect once the default is rendered.
99
- */
100
- defaultSubHead?: SparklineInteractiveSubHead;
101
- /**
102
- * Adds a label node that allows React components. If you use this node then you cannot use the text based label that supports updates.
103
- */
104
- labelNode?: React.ReactNode;
105
- /**
106
- * Reduce the font size used for the header itself.
107
- */
108
- compact?: boolean;
109
- } & React.RefAttributes<SparklineInteractiveHeaderRef>>>;
110
- //# sourceMappingURL=SparklineInteractiveHeader.d.ts.map
87
+ export declare const SparklineInteractiveHeader: React.MemoExoticComponent<
88
+ React.ForwardRefExoticComponent<
89
+ {
90
+ /**
91
+ * Adds content next to the header. This is useful for interactive buttons
92
+ */
93
+ trailing?: ReactNode;
94
+ } & SharedProps & {
95
+ /**
96
+ * Default title, changing this prop has no effect once the default is rendered. If you use a ReactNode that is not a string, then you cannot use the text based label that supports updates.
97
+ */
98
+ defaultTitle: React.ReactNode;
99
+ /**
100
+ * Default label, changing this prop has no effect once the default is rendered.
101
+ */
102
+ defaultLabel?: string;
103
+ /**
104
+ * Default SubHead, changing this prop has no effect once the default is rendered.
105
+ */
106
+ defaultSubHead?: SparklineInteractiveSubHead;
107
+ /**
108
+ * Adds a label node that allows React components. If you use this node then you cannot use the text based label that supports updates.
109
+ */
110
+ labelNode?: React.ReactNode;
111
+ /**
112
+ * Reduce the font size used for the header itself.
113
+ */
114
+ compact?: boolean;
115
+ } & React.RefAttributes<SparklineInteractiveHeaderRef>
116
+ >
117
+ >;
118
+ //# sourceMappingURL=SparklineInteractiveHeader.d.ts.map
@@ -1,2 +1,2 @@
1
1
  export {};
2
- //# sourceMappingURL=SparklineInteractiveHeader.figma.d.ts.map
2
+ //# sourceMappingURL=SparklineInteractiveHeader.figma.d.ts.map
@@ -2,25 +2,28 @@ import type { StyleProp, TextStyle } from 'react-native';
2
2
  import type { SparklineInteractiveSubHead } from './SparklineInteractiveHeader';
3
3
  export type SparklineInteractiveSubHeadIconColor = SparklineInteractiveSubHead['variant'];
4
4
  export declare const styles: {
5
- inputReset: {
6
- padding: number;
7
- margin: number;
8
- backgroundColor: string;
9
- overflow: "visible";
10
- lineHeight: undefined;
11
- };
12
- fullWidth: {
13
- width: "100%";
14
- };
15
- tabularNumbers: {
16
- fontVariant: "tabular-nums"[];
17
- };
5
+ inputReset: {
6
+ padding: number;
7
+ margin: number;
8
+ backgroundColor: string;
9
+ overflow: 'visible';
10
+ lineHeight: undefined;
11
+ };
12
+ fullWidth: {
13
+ width: '100%';
14
+ };
15
+ tabularNumbers: {
16
+ fontVariant: 'tabular-nums'[];
17
+ };
18
18
  };
19
19
  export declare function useSparklineInteractiveHeaderStyles(): {
20
- readonly title: (text: string) => StyleProp<TextStyle>;
21
- readonly label: StyleProp<TextStyle>;
22
- readonly subHeadIcon: (color: SparklineInteractiveSubHeadIconColor) => StyleProp<TextStyle>;
23
- readonly subHead: (color: SparklineInteractiveSubHeadIconColor, useFullWidth?: boolean) => StyleProp<TextStyle>;
24
- readonly subHeadAccessory: () => StyleProp<TextStyle>;
20
+ readonly title: (text: string) => StyleProp<TextStyle>;
21
+ readonly label: StyleProp<TextStyle>;
22
+ readonly subHeadIcon: (color: SparklineInteractiveSubHeadIconColor) => StyleProp<TextStyle>;
23
+ readonly subHead: (
24
+ color: SparklineInteractiveSubHeadIconColor,
25
+ useFullWidth?: boolean,
26
+ ) => StyleProp<TextStyle>;
27
+ readonly subHeadAccessory: () => StyleProp<TextStyle>;
25
28
  };
26
- //# sourceMappingURL=useSparklineInteractiveHeaderStyles.d.ts.map
29
+ //# sourceMappingURL=useSparklineInteractiveHeaderStyles.d.ts.map