@coinbase/cds-web-visualization 3.4.0-beta.2 → 3.4.0-beta.21

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 (198) hide show
  1. package/CHANGELOG.md +122 -0
  2. package/dts/chart/CartesianChart.d.ts +56 -3
  3. package/dts/chart/CartesianChart.d.ts.map +1 -1
  4. package/dts/chart/ChartProvider.d.ts +3 -0
  5. package/dts/chart/ChartProvider.d.ts.map +1 -1
  6. package/dts/chart/Path.d.ts +64 -7
  7. package/dts/chart/Path.d.ts.map +1 -1
  8. package/dts/chart/PeriodSelector.d.ts +5 -15
  9. package/dts/chart/PeriodSelector.d.ts.map +1 -1
  10. package/dts/chart/area/Area.d.ts +50 -25
  11. package/dts/chart/area/Area.d.ts.map +1 -1
  12. package/dts/chart/area/AreaChart.d.ts +46 -6
  13. package/dts/chart/area/AreaChart.d.ts.map +1 -1
  14. package/dts/chart/area/DottedArea.d.ts +21 -44
  15. package/dts/chart/area/DottedArea.d.ts.map +1 -1
  16. package/dts/chart/area/GradientArea.d.ts +21 -12
  17. package/dts/chart/area/GradientArea.d.ts.map +1 -1
  18. package/dts/chart/area/SolidArea.d.ts +16 -1
  19. package/dts/chart/area/SolidArea.d.ts.map +1 -1
  20. package/dts/chart/axis/Axis.d.ts +109 -63
  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 +50 -12
  31. package/dts/chart/bar/Bar.d.ts.map +1 -1
  32. package/dts/chart/bar/BarChart.d.ts +20 -8
  33. package/dts/chart/bar/BarChart.d.ts.map +1 -1
  34. package/dts/chart/bar/BarPlot.d.ts +3 -1
  35. package/dts/chart/bar/BarPlot.d.ts.map +1 -1
  36. package/dts/chart/bar/BarStack.d.ts +41 -46
  37. package/dts/chart/bar/BarStack.d.ts.map +1 -1
  38. package/dts/chart/bar/BarStackGroup.d.ts +2 -0
  39. package/dts/chart/bar/BarStackGroup.d.ts.map +1 -1
  40. package/dts/chart/bar/DefaultBar.d.ts.map +1 -1
  41. package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -1
  42. package/dts/chart/gradient/Gradient.d.ts +35 -0
  43. package/dts/chart/gradient/Gradient.d.ts.map +1 -0
  44. package/dts/chart/gradient/index.d.ts +2 -0
  45. package/dts/chart/gradient/index.d.ts.map +1 -0
  46. package/dts/chart/index.d.ts +3 -1
  47. package/dts/chart/index.d.ts.map +1 -1
  48. package/dts/chart/legend/DefaultLegendEntry.d.ts +21 -0
  49. package/dts/chart/legend/DefaultLegendEntry.d.ts.map +1 -0
  50. package/dts/chart/legend/DefaultLegendShape.d.ts +7 -0
  51. package/dts/chart/legend/DefaultLegendShape.d.ts.map +1 -0
  52. package/dts/chart/legend/Legend.d.ts +169 -0
  53. package/dts/chart/legend/Legend.d.ts.map +1 -0
  54. package/dts/chart/legend/index.d.ts +4 -0
  55. package/dts/chart/legend/index.d.ts.map +1 -0
  56. package/dts/chart/line/DefaultReferenceLineLabel.d.ts +9 -0
  57. package/dts/chart/line/DefaultReferenceLineLabel.d.ts.map +1 -0
  58. package/dts/chart/line/DottedLine.d.ts +15 -3
  59. package/dts/chart/line/DottedLine.d.ts.map +1 -1
  60. package/dts/chart/line/Line.d.ts +84 -28
  61. package/dts/chart/line/Line.d.ts.map +1 -1
  62. package/dts/chart/line/LineChart.d.ts +28 -8
  63. package/dts/chart/line/LineChart.d.ts.map +1 -1
  64. package/dts/chart/line/ReferenceLine.d.ts +99 -44
  65. package/dts/chart/line/ReferenceLine.d.ts.map +1 -1
  66. package/dts/chart/line/SolidLine.d.ts +14 -3
  67. package/dts/chart/line/SolidLine.d.ts.map +1 -1
  68. package/dts/chart/line/index.d.ts +1 -1
  69. package/dts/chart/line/index.d.ts.map +1 -1
  70. package/dts/chart/point/DefaultPointLabel.d.ts +10 -0
  71. package/dts/chart/point/DefaultPointLabel.d.ts.map +1 -0
  72. package/dts/chart/point/Point.d.ts +217 -0
  73. package/dts/chart/point/Point.d.ts.map +1 -0
  74. package/dts/chart/point/index.d.ts +3 -0
  75. package/dts/chart/point/index.d.ts.map +1 -0
  76. package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts +41 -0
  77. package/dts/chart/scrubber/DefaultScrubberBeacon.d.ts.map +1 -0
  78. package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts +12 -0
  79. package/dts/chart/scrubber/DefaultScrubberBeaconLabel.d.ts.map +1 -0
  80. package/dts/chart/scrubber/DefaultScrubberLabel.d.ts +10 -0
  81. package/dts/chart/scrubber/DefaultScrubberLabel.d.ts.map +1 -0
  82. package/dts/chart/scrubber/Scrubber.d.ts +303 -70
  83. package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
  84. package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts +80 -0
  85. package/dts/chart/scrubber/ScrubberBeaconGroup.d.ts.map +1 -0
  86. package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts +56 -0
  87. package/dts/chart/scrubber/ScrubberBeaconLabelGroup.d.ts.map +1 -0
  88. package/dts/chart/scrubber/index.d.ts +3 -0
  89. package/dts/chart/scrubber/index.d.ts.map +1 -1
  90. package/dts/chart/text/ChartText.d.ts +46 -43
  91. package/dts/chart/text/ChartText.d.ts.map +1 -1
  92. package/dts/chart/text/{SmartChartTextGroup.d.ts → ChartTextGroup.d.ts} +9 -3
  93. package/dts/chart/text/ChartTextGroup.d.ts.map +1 -0
  94. package/dts/chart/text/index.d.ts +1 -1
  95. package/dts/chart/text/index.d.ts.map +1 -1
  96. package/dts/chart/utils/axis.d.ts +25 -1
  97. package/dts/chart/utils/axis.d.ts.map +1 -1
  98. package/dts/chart/utils/bar.d.ts +34 -0
  99. package/dts/chart/utils/bar.d.ts.map +1 -1
  100. package/dts/chart/utils/chart.d.ts +45 -7
  101. package/dts/chart/utils/chart.d.ts.map +1 -1
  102. package/dts/chart/utils/context.d.ts +6 -0
  103. package/dts/chart/utils/context.d.ts.map +1 -1
  104. package/dts/chart/utils/gradient.d.ts +104 -0
  105. package/dts/chart/utils/gradient.d.ts.map +1 -0
  106. package/dts/chart/utils/index.d.ts +4 -0
  107. package/dts/chart/utils/index.d.ts.map +1 -1
  108. package/dts/chart/utils/interpolate.d.ts +112 -0
  109. package/dts/chart/utils/interpolate.d.ts.map +1 -0
  110. package/dts/chart/utils/path.d.ts +30 -1
  111. package/dts/chart/utils/path.d.ts.map +1 -1
  112. package/dts/chart/utils/point.d.ts +40 -7
  113. package/dts/chart/utils/point.d.ts.map +1 -1
  114. package/dts/chart/utils/scale.d.ts +11 -0
  115. package/dts/chart/utils/scale.d.ts.map +1 -1
  116. package/dts/chart/utils/scrubber.d.ts +40 -0
  117. package/dts/chart/utils/scrubber.d.ts.map +1 -0
  118. package/dts/chart/utils/transition.d.ts +101 -0
  119. package/dts/chart/utils/transition.d.ts.map +1 -0
  120. package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts.map +1 -1
  121. package/esm/chart/CartesianChart.js +170 -83
  122. package/esm/chart/ChartProvider.js +2 -2
  123. package/esm/chart/Path.js +59 -54
  124. package/esm/chart/PeriodSelector.js +36 -32
  125. package/esm/chart/area/Area.js +26 -34
  126. package/esm/chart/area/AreaChart.js +29 -15
  127. package/esm/chart/area/DottedArea.js +39 -89
  128. package/esm/chart/area/GradientArea.js +37 -80
  129. package/esm/chart/area/SolidArea.js +32 -11
  130. package/esm/chart/axis/Axis.js +4 -39
  131. package/esm/chart/axis/DefaultAxisTickLabel.js +15 -0
  132. package/esm/chart/axis/XAxis.js +184 -63
  133. package/esm/chart/axis/YAxis.js +190 -57
  134. package/esm/chart/axis/index.js +1 -0
  135. package/esm/chart/bar/Bar.js +7 -1
  136. package/esm/chart/bar/BarChart.js +17 -32
  137. package/esm/chart/bar/BarPlot.js +5 -2
  138. package/esm/chart/bar/BarStack.js +74 -22
  139. package/esm/chart/bar/BarStackGroup.js +8 -18
  140. package/esm/chart/bar/DefaultBar.js +23 -28
  141. package/esm/chart/bar/DefaultBarStack.js +24 -20
  142. package/esm/chart/gradient/Gradient.js +104 -0
  143. package/esm/chart/gradient/index.js +1 -0
  144. package/esm/chart/index.js +3 -1
  145. package/esm/chart/legend/DefaultLegendEntry.css +1 -0
  146. package/esm/chart/legend/DefaultLegendEntry.js +50 -0
  147. package/esm/chart/legend/DefaultLegendShape.css +5 -0
  148. package/esm/chart/legend/DefaultLegendShape.js +47 -0
  149. package/esm/chart/legend/Legend.js +76 -0
  150. package/esm/chart/legend/index.js +3 -0
  151. package/esm/chart/line/DefaultReferenceLineLabel.js +81 -0
  152. package/esm/chart/line/DottedLine.js +41 -17
  153. package/esm/chart/line/Line.js +87 -75
  154. package/esm/chart/line/LineChart.js +24 -8
  155. package/esm/chart/line/ReferenceLine.js +45 -43
  156. package/esm/chart/line/SolidLine.js +39 -15
  157. package/esm/chart/line/index.js +1 -1
  158. package/esm/chart/{line/GradientLine.js → point/DefaultPointLabel.js} +31 -45
  159. package/esm/chart/point/Point.css +2 -0
  160. package/esm/chart/{Point.js → point/Point.js} +87 -62
  161. package/esm/chart/point/index.js +2 -0
  162. package/esm/chart/scrubber/DefaultScrubberBeacon.js +154 -0
  163. package/esm/chart/scrubber/DefaultScrubberBeaconLabel.js +57 -0
  164. package/esm/chart/scrubber/{ScrubberBeaconLabel.js → DefaultScrubberLabel.js} +15 -18
  165. package/esm/chart/scrubber/Scrubber.js +101 -392
  166. package/esm/chart/scrubber/ScrubberBeaconGroup.js +174 -0
  167. package/esm/chart/scrubber/ScrubberBeaconLabelGroup.js +209 -0
  168. package/esm/chart/scrubber/index.js +3 -1
  169. package/esm/chart/text/ChartText.js +15 -20
  170. package/esm/chart/text/{SmartChartTextGroup.js → ChartTextGroup.js} +4 -3
  171. package/esm/chart/text/index.js +1 -1
  172. package/esm/chart/utils/axis.js +47 -31
  173. package/esm/chart/utils/bar.js +48 -0
  174. package/esm/chart/utils/chart.js +42 -3
  175. package/esm/chart/utils/gradient.js +257 -0
  176. package/esm/chart/utils/index.js +4 -0
  177. package/esm/chart/utils/interpolate.js +644 -0
  178. package/esm/chart/utils/path.js +41 -9
  179. package/esm/chart/utils/point.js +99 -12
  180. package/esm/chart/utils/scale.js +13 -2
  181. package/esm/chart/utils/scrubber.js +137 -0
  182. package/esm/chart/utils/transition.js +133 -0
  183. package/esm/sparkline/__figma__/Sparkline.figma.js +1 -1
  184. package/esm/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.js +8 -4
  185. package/esm/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.js +1 -1
  186. package/esm/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.js +1 -1
  187. package/package.json +12 -11
  188. package/dts/chart/Point.d.ts +0 -153
  189. package/dts/chart/Point.d.ts.map +0 -1
  190. package/dts/chart/line/GradientLine.d.ts +0 -42
  191. package/dts/chart/line/GradientLine.d.ts.map +0 -1
  192. package/dts/chart/scrubber/ScrubberBeacon.d.ts +0 -93
  193. package/dts/chart/scrubber/ScrubberBeacon.d.ts.map +0 -1
  194. package/dts/chart/scrubber/ScrubberBeaconLabel.d.ts +0 -7
  195. package/dts/chart/scrubber/ScrubberBeaconLabel.d.ts.map +0 -1
  196. package/dts/chart/text/SmartChartTextGroup.d.ts.map +0 -1
  197. package/esm/chart/Point.css +0 -2
  198. package/esm/chart/scrubber/ScrubberBeacon.js +0 -195
@@ -1,27 +1,162 @@
1
1
  import React from 'react';
2
2
  import type { SharedProps } from '@coinbase/cds-common/types';
3
- import { type ReferenceLineProps } from '../line';
4
- import { type ScrubberBeaconProps, type ScrubberBeaconRef } from './ScrubberBeacon';
5
- import { type ScrubberBeaconLabelProps } from './ScrubberBeaconLabel';
6
- export type ScrubberRef = ScrubberBeaconRef;
7
- /**
8
- * Configuration for scrubber functionality across chart components.
9
- * Provides consistent API with smart defaults and component customization.
10
- */
11
- export type ScrubberProps = SharedProps &
12
- Pick<ScrubberBeaconProps, 'idlePulse'> & {
3
+ import { type Transition } from 'framer-motion';
4
+ import { type ReferenceLineBaseProps, type ReferenceLineLabelComponentProps } from '../line';
5
+ import type { ChartTextChildren, ChartTextProps } from '../text';
6
+ import { type ChartInset, type Series } from '../utils';
7
+ import {
8
+ type ScrubberBeaconGroupBaseProps,
9
+ type ScrubberBeaconGroupProps,
10
+ type ScrubberBeaconGroupRef,
11
+ } from './ScrubberBeaconGroup';
12
+ import {
13
+ type ScrubberBeaconLabelGroupBaseProps,
14
+ type ScrubberBeaconLabelGroupProps,
15
+ } from './ScrubberBeaconLabelGroup';
16
+ export type ScrubberBeaconRef = {
17
+ /**
18
+ * Triggers a single pulse animation.
19
+ * Only works when the beacon is in idle state (not actively scrubbing).
20
+ */
21
+ pulse: () => void;
22
+ };
23
+ export type ScrubberBeaconBaseProps = {
24
+ /**
25
+ * Id of the series.
26
+ */
27
+ seriesId: Series['id'];
28
+ /**
29
+ * Color of the series.
30
+ */
31
+ color?: string;
32
+ /**
33
+ * X coordinate in data space.
34
+ */
35
+ dataX: number;
36
+ /**
37
+ * Y coordinate in data space.
38
+ */
39
+ dataY: number;
40
+ /**
41
+ * Whether the beacon is in idle state (not actively scrubbing).
42
+ */
43
+ isIdle?: boolean;
44
+ /**
45
+ * Pulse the beacon while it is at rest.
46
+ *
47
+ * @note Only has an effect when `isIdle` is `true`. Pulse animations work
48
+ * regardless of the chart's `animate` prop.
49
+ */
50
+ idlePulse?: boolean;
51
+ /**
52
+ * Whether position animations are enabled.
53
+ * @default to ChartContext's animate value
54
+ */
55
+ animate?: boolean;
56
+ /**
57
+ * Opacity of the beacon.
58
+ * @default 1
59
+ */
60
+ opacity?: number;
61
+ /**
62
+ * Stroke color of the beacon circle.
63
+ * @default 'var(--color-bg)'
64
+ */
65
+ stroke?: string;
66
+ };
67
+ export type ScrubberBeaconProps = SharedProps &
68
+ ScrubberBeaconBaseProps & {
69
+ /**
70
+ * Transition configuration for beacon animations.
71
+ */
72
+ transitions?: {
73
+ /**
74
+ * Transition for the initial enter/reveal animation.
75
+ * Set to `null` to disable.
76
+ */
77
+ enter?: Transition | null;
78
+ /**
79
+ * Transition for subsequent data update animations.
80
+ * Set to `null` to disable.
81
+ */
82
+ update?: Transition | null;
83
+ /**
84
+ * Transition used for the pulse animation.
85
+ * @default transition { duration: 1.6, ease: 'easeInOut' }
86
+ */
87
+ pulse?: Transition;
88
+ /**
89
+ * Delay, in seconds between pulse transitions
90
+ * when `idlePulse` is enabled.
91
+ * @default 0.4
92
+ */
93
+ pulseRepeatDelay?: number;
94
+ };
95
+ /**
96
+ * Custom className for styling.
97
+ */
98
+ className?: string;
99
+ /**
100
+ * Custom inline styles.
101
+ */
102
+ style?: React.CSSProperties;
103
+ };
104
+ export type ScrubberBeaconComponent = React.FC<
105
+ ScrubberBeaconProps & {
106
+ ref?: React.Ref<ScrubberBeaconRef>;
107
+ }
108
+ >;
109
+ export type ScrubberBeaconLabelProps = Pick<Series, 'color'> &
110
+ Pick<
111
+ ChartTextProps,
112
+ | 'x'
113
+ | 'y'
114
+ | 'dx'
115
+ | 'horizontalAlignment'
116
+ | 'onDimensionsChange'
117
+ | 'opacity'
118
+ | 'font'
119
+ | 'className'
120
+ | 'style'
121
+ > & {
122
+ /**
123
+ * Label for the series.
124
+ */
125
+ label: ChartTextChildren;
126
+ /**
127
+ * Id of the series.
128
+ */
129
+ seriesId: Series['id'];
130
+ /**
131
+ * Transition configuration for position animations.
132
+ * When provided, the label component should animate its y position using this transition.
133
+ */
134
+ transition?: Transition;
135
+ };
136
+ export type ScrubberBeaconLabelComponent = React.FC<ScrubberBeaconLabelProps>;
137
+ export type ScrubberLabelProps = ReferenceLineLabelComponentProps;
138
+ export type ScrubberLabelComponent = React.FC<ScrubberLabelProps>;
139
+ export type ScrubberBaseProps = SharedProps &
140
+ Pick<ScrubberBeaconGroupBaseProps, 'idlePulse'> &
141
+ Pick<ReferenceLineBaseProps, 'LineComponent' | 'LabelComponent' | 'labelElevated'> &
142
+ Pick<ScrubberBeaconGroupProps, 'BeaconComponent'> &
143
+ Pick<ScrubberBeaconLabelGroupProps, 'BeaconLabelComponent'> & {
13
144
  /**
14
- * An array of series IDs that will receive visual emphasis as the user scrubs through the chart.
15
- * Use this prop to restrict the scrubbing visual behavior to specific series.
16
- * By default, all series will be highlighted by the Scrubber.
145
+ * Array of series IDs to highlight when scrubbing with scrubber beacons.
146
+ * By default, all series will be highlighted.
17
147
  */
18
148
  seriesIds?: string[];
19
149
  /**
20
- * Hides the scrubber line
150
+ * Hides the beacon labels while keeping the line label visible (if provided).
151
+ */
152
+ hideBeaconLabels?: boolean;
153
+ /**
154
+ * Hides the scrubber line.
155
+ * @note This hides Scrubber's ReferenceLine including the label.
21
156
  */
22
157
  hideLine?: boolean;
23
158
  /**
24
- * Whether to hide the overlay rect which obscures future data.
159
+ * Hides the overlay rect which obscures data beyond the scrubber position.
25
160
  */
26
161
  hideOverlay?: boolean;
27
162
  /**
@@ -31,68 +166,121 @@ export type ScrubberProps = SharedProps &
31
166
  */
32
167
  overlayOffset?: number;
33
168
  /**
34
- * Label text displayed above the scrubber line.
169
+ * Minimum gap between beacon labels to prevent overlap.
170
+ * Measured in pixels.
35
171
  */
36
- label?: ReferenceLineProps['label'] | ((dataIndex: number) => ReferenceLineProps['label']);
172
+ beaconLabelMinGap?: ScrubberBeaconLabelGroupBaseProps['labelMinGap'];
37
173
  /**
38
- * Props passed to the scrubber line's label.
174
+ * Horizontal offset for beacon labels from their beacon position.
175
+ * Measured in pixels.
39
176
  */
40
- labelProps?: ReferenceLineProps['labelProps'];
177
+ beaconLabelHorizontalOffset?: ScrubberBeaconLabelGroupBaseProps['labelHorizontalOffset'];
41
178
  /**
42
- * Stroke color for the scrubber line.
179
+ * Preferred side for beacon labels.
180
+ * @note labels will switch to the opposite side if there's not enough space on the preferred side.
181
+ * @default 'right'
43
182
  */
44
- lineStroke?: ReferenceLineProps['stroke'];
183
+ beaconLabelPreferredSide?: ScrubberBeaconLabelGroupBaseProps['labelPreferredSide'];
45
184
  /**
46
- * Custom styles for scrubber elements.
185
+ * Label text displayed above the scrubber line.
186
+ * Can be a static string or a function that receives the current dataIndex.
47
187
  */
48
- styles?: {
49
- overlay?: React.CSSProperties;
50
- beacon?: React.CSSProperties;
51
- line?: React.CSSProperties;
52
- beaconLabel?: React.CSSProperties;
53
- };
188
+ label?:
189
+ | ReferenceLineBaseProps['label']
190
+ | ((dataIndex: number) => ReferenceLineBaseProps['label']);
54
191
  /**
55
- * Custom class names for scrubber elements.
192
+ * Font style for the scrubber line label.
56
193
  */
57
- classNames?: {
58
- overlay?: string;
59
- beacon?: string;
60
- line?: string;
61
- beaconLabel?: string;
62
- };
194
+ labelFont?: ChartTextProps['font'];
63
195
  /**
64
- * Custom component for the scrubber beacon.
196
+ * Bounds inset for the scrubber line label to prevent cutoff at chart edges.
197
+ * @default inset { top: 4, bottom: 20, left: 12, right: 12 } when labelElevated is true, otherwise none
65
198
  */
66
- BeaconComponent?: React.ComponentType<ScrubberBeaconProps>;
199
+ labelBoundsInset?: number | ChartInset;
67
200
  /**
68
- * Custom component for the scrubber beacon label.
201
+ * Font style for the beacon labels.
202
+ */
203
+ beaconLabelFont?: ChartTextProps['font'];
204
+ /**
205
+ * Stroke color for the scrubber line.
69
206
  */
70
- BeaconLabelComponent?: React.ComponentType<ScrubberBeaconLabelProps>;
207
+ lineStroke?: ReferenceLineBaseProps['stroke'];
71
208
  /**
72
- * Custom component for the scrubber line.
209
+ * Stroke color of the scrubber beacon circle.
210
+ * @default 'var(--color-bg)'
73
211
  */
74
- LineComponent?: React.ComponentType<ReferenceLineProps>;
212
+ beaconStroke?: string;
75
213
  };
214
+ export type ScrubberProps = ScrubberBaseProps & {
215
+ /**
216
+ * Transition configuration for the scrubber.
217
+ * Controls enter, update, and pulse animations for beacons and beacon labels.
218
+ */
219
+ transitions?: ScrubberBeaconProps['transitions'];
220
+ /**
221
+ * Transition configuration for the scrubber beacon.
222
+ * @deprecated Use `transitions` instead.
223
+ */
224
+ beaconTransitions?: ScrubberBeaconProps['transitions'];
225
+ /**
226
+ * Accessibility label for the scrubber. Can be a static string or a function that receives the current dataIndex.
227
+ * If not provided, label will be used if it resolves to a string.
228
+ */
229
+ accessibilityLabel?: string | ((dataIndex: number) => string);
230
+ /** Custom styles for individual elements of the Scrubber component */
231
+ styles?: {
232
+ /** Overlay element */
233
+ overlay?: React.CSSProperties;
234
+ /** Beacon circle element */
235
+ beacon?: React.CSSProperties;
236
+ /** Scrubber line element */
237
+ line?: React.CSSProperties;
238
+ /** Scrubber line label element */
239
+ label?: React.CSSProperties;
240
+ /** Beacon label element */
241
+ beaconLabel?: React.CSSProperties;
242
+ };
243
+ /** Custom class names for individual elements of the Scrubber component */
244
+ classNames?: {
245
+ /** Overlay element */
246
+ overlay?: string;
247
+ /** Beacon circle element */
248
+ beacon?: string;
249
+ /** Scrubber line element */
250
+ line?: string;
251
+ /** Scrubber line label element */
252
+ label?: string;
253
+ /** Beacon label element */
254
+ beaconLabel?: string;
255
+ };
256
+ };
257
+ export type ScrubberRef = ScrubberBeaconGroupRef;
76
258
  /**
77
- * Unified component that manages all scrubber elements (beacons, line, labels)
78
- * with intelligent collision detection and consistent positioning.
259
+ * Unified component that manages all scrubber elements (beacons, line, labels).
79
260
  */
80
261
  export declare const Scrubber: React.MemoExoticComponent<
81
262
  React.ForwardRefExoticComponent<
82
263
  SharedProps &
83
- Pick<ScrubberBeaconProps, 'idlePulse'> & {
264
+ Pick<ScrubberBeaconGroupBaseProps, 'idlePulse'> &
265
+ Pick<ReferenceLineBaseProps, 'LabelComponent' | 'LineComponent' | 'labelElevated'> &
266
+ Pick<ScrubberBeaconGroupProps, 'BeaconComponent'> &
267
+ Pick<ScrubberBeaconLabelGroupProps, 'BeaconLabelComponent'> & {
84
268
  /**
85
- * An array of series IDs that will receive visual emphasis as the user scrubs through the chart.
86
- * Use this prop to restrict the scrubbing visual behavior to specific series.
87
- * By default, all series will be highlighted by the Scrubber.
269
+ * Array of series IDs to highlight when scrubbing with scrubber beacons.
270
+ * By default, all series will be highlighted.
88
271
  */
89
272
  seriesIds?: string[];
90
273
  /**
91
- * Hides the scrubber line
274
+ * Hides the beacon labels while keeping the line label visible (if provided).
275
+ */
276
+ hideBeaconLabels?: boolean;
277
+ /**
278
+ * Hides the scrubber line.
279
+ * @note This hides Scrubber's ReferenceLine including the label.
92
280
  */
93
281
  hideLine?: boolean;
94
282
  /**
95
- * Whether to hide the overlay rect which obscures future data.
283
+ * Hides the overlay rect which obscures data beyond the scrubber position.
96
284
  */
97
285
  hideOverlay?: boolean;
98
286
  /**
@@ -101,49 +289,94 @@ export declare const Scrubber: React.MemoExoticComponent<
101
289
  * @default 2
102
290
  */
103
291
  overlayOffset?: number;
292
+ /**
293
+ * Minimum gap between beacon labels to prevent overlap.
294
+ * Measured in pixels.
295
+ */
296
+ beaconLabelMinGap?: ScrubberBeaconLabelGroupBaseProps['labelMinGap'];
297
+ /**
298
+ * Horizontal offset for beacon labels from their beacon position.
299
+ * Measured in pixels.
300
+ */
301
+ beaconLabelHorizontalOffset?: ScrubberBeaconLabelGroupBaseProps['labelHorizontalOffset'];
302
+ /**
303
+ * Preferred side for beacon labels.
304
+ * @note labels will switch to the opposite side if there's not enough space on the preferred side.
305
+ * @default 'right'
306
+ */
307
+ beaconLabelPreferredSide?: ScrubberBeaconLabelGroupBaseProps['labelPreferredSide'];
104
308
  /**
105
309
  * Label text displayed above the scrubber line.
310
+ * Can be a static string or a function that receives the current dataIndex.
311
+ */
312
+ label?:
313
+ | ReferenceLineBaseProps['label']
314
+ | ((dataIndex: number) => ReferenceLineBaseProps['label']);
315
+ /**
316
+ * Font style for the scrubber line label.
317
+ */
318
+ labelFont?: ChartTextProps['font'];
319
+ /**
320
+ * Bounds inset for the scrubber line label to prevent cutoff at chart edges.
321
+ * @default inset { top: 4, bottom: 20, left: 12, right: 12 } when labelElevated is true, otherwise none
106
322
  */
107
- label?: ReferenceLineProps['label'] | ((dataIndex: number) => ReferenceLineProps['label']);
323
+ labelBoundsInset?: number | ChartInset;
108
324
  /**
109
- * Props passed to the scrubber line's label.
325
+ * Font style for the beacon labels.
110
326
  */
111
- labelProps?: ReferenceLineProps['labelProps'];
327
+ beaconLabelFont?: ChartTextProps['font'];
112
328
  /**
113
329
  * Stroke color for the scrubber line.
114
330
  */
115
- lineStroke?: ReferenceLineProps['stroke'];
331
+ lineStroke?: ReferenceLineBaseProps['stroke'];
116
332
  /**
117
- * Custom styles for scrubber elements.
333
+ * Stroke color of the scrubber beacon circle.
334
+ * @default 'var(--color-bg)'
118
335
  */
336
+ beaconStroke?: string;
337
+ } & {
338
+ /**
339
+ * Transition configuration for the scrubber.
340
+ * Controls enter, update, and pulse animations for beacons and beacon labels.
341
+ */
342
+ transitions?: ScrubberBeaconProps['transitions'];
343
+ /**
344
+ * Transition configuration for the scrubber beacon.
345
+ * @deprecated Use `transitions` instead.
346
+ */
347
+ beaconTransitions?: ScrubberBeaconProps['transitions'];
348
+ /**
349
+ * Accessibility label for the scrubber. Can be a static string or a function that receives the current dataIndex.
350
+ * If not provided, label will be used if it resolves to a string.
351
+ */
352
+ accessibilityLabel?: string | ((dataIndex: number) => string);
353
+ /** Custom styles for individual elements of the Scrubber component */
119
354
  styles?: {
355
+ /** Overlay element */
120
356
  overlay?: React.CSSProperties;
357
+ /** Beacon circle element */
121
358
  beacon?: React.CSSProperties;
359
+ /** Scrubber line element */
122
360
  line?: React.CSSProperties;
361
+ /** Scrubber line label element */
362
+ label?: React.CSSProperties;
363
+ /** Beacon label element */
123
364
  beaconLabel?: React.CSSProperties;
124
365
  };
125
- /**
126
- * Custom class names for scrubber elements.
127
- */
366
+ /** Custom class names for individual elements of the Scrubber component */
128
367
  classNames?: {
368
+ /** Overlay element */
129
369
  overlay?: string;
370
+ /** Beacon circle element */
130
371
  beacon?: string;
372
+ /** Scrubber line element */
131
373
  line?: string;
374
+ /** Scrubber line label element */
375
+ label?: string;
376
+ /** Beacon label element */
132
377
  beaconLabel?: string;
133
378
  };
134
- /**
135
- * Custom component for the scrubber beacon.
136
- */
137
- BeaconComponent?: React.ComponentType<ScrubberBeaconProps>;
138
- /**
139
- * Custom component for the scrubber beacon label.
140
- */
141
- BeaconLabelComponent?: React.ComponentType<ScrubberBeaconLabelProps>;
142
- /**
143
- * Custom component for the scrubber line.
144
- */
145
- LineComponent?: React.ComponentType<ReferenceLineProps>;
146
- } & React.RefAttributes<ScrubberBeaconRef>
379
+ } & React.RefAttributes<ScrubberBeaconGroupRef>
147
380
  >
148
381
  >;
149
382
  //# sourceMappingURL=Scrubber.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Scrubber.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/Scrubber.tsx"],"names":[],"mappings":"AAAA,OAAO,KASN,MAAM,OAAO,CAAC;AAEf,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAK9D,OAAO,EAAiB,KAAK,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAGjE,OAAO,EAAkB,KAAK,mBAAmB,EAAE,KAAK,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACpG,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AAI3F,MAAM,MAAM,WAAW,GAAG,iBAAiB,CAAC;AAE5C;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,WAAW,GACrC,IAAI,CAAC,mBAAmB,EAAE,WAAW,CAAC,GAAG;IACvC;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB;;OAEG;IACH,QAAQ,CAAC,EAAE,OAAO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IAChD;;;OAGG;wBACiB,mBAAmB,CAAC,aAAa,CAAC;IACtD;;;OAGG;yBACkB,MAAM,GAAG,CAAC,CAAC,SAAS,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7D,sEAAsE;aAC7D;QACP,sBAAsB;QACtB,OAAO,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC9B,4BAA4B;QAC5B,MAAM,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC7B,4BAA4B;QAC5B,IAAI,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC3B,kCAAkC;QAClC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;QAC5B,2BAA2B;QAC3B,WAAW,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;KACnC;IACD,2EAA2E;iBAC9D;QACX,sBAAsB;QACtB,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,4BAA4B;QAC5B,MAAM,CAAC,EAAE,MAAM,CAAC;QAChB,4BAA4B;QAC5B,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,kCAAkC;QAClC,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,2BAA2B;QAC3B,WAAW,CAAC,EAAE,MAAM,CAAC;KACtB;iDAiMF,CAAC"}
@@ -0,0 +1,80 @@
1
+ import type { SharedProps } from '@coinbase/cds-common/types';
2
+ import type { ScrubberBeaconComponent, ScrubberBeaconProps } from './Scrubber';
3
+ export type ScrubberBeaconGroupRef = {
4
+ /**
5
+ * Triggers a pulse animation on all beacons.
6
+ */
7
+ pulse: () => void;
8
+ };
9
+ export type ScrubberBeaconGroupBaseProps = SharedProps & {
10
+ /**
11
+ * Array of series IDs to render beacons for.
12
+ */
13
+ seriesIds: string[];
14
+ /**
15
+ * Pulse the beacons while at rest.
16
+ */
17
+ idlePulse?: boolean;
18
+ };
19
+ export type ScrubberBeaconGroupProps = ScrubberBeaconGroupBaseProps & {
20
+ /**
21
+ * Transition configuration for beacon animations.
22
+ */
23
+ transitions?: ScrubberBeaconProps['transitions'];
24
+ /**
25
+ * Custom component for the scrubber beacon.
26
+ * @default DefaultScrubberBeacon
27
+ */
28
+ BeaconComponent?: ScrubberBeaconComponent;
29
+ /**
30
+ * Custom className for beacon styling.
31
+ */
32
+ className?: string;
33
+ /**
34
+ * Custom inline styles for beacons.
35
+ */
36
+ style?: React.CSSProperties;
37
+ /**
38
+ * Stroke color of the beacon circle.
39
+ * @default 'var(--color-bg)'
40
+ */
41
+ stroke?: string;
42
+ };
43
+ export declare const ScrubberBeaconGroup: import('react').MemoExoticComponent<
44
+ import('react').ForwardRefExoticComponent<
45
+ SharedProps & {
46
+ /**
47
+ * Array of series IDs to render beacons for.
48
+ */
49
+ seriesIds: string[];
50
+ /**
51
+ * Pulse the beacons while at rest.
52
+ */
53
+ idlePulse?: boolean;
54
+ } & {
55
+ /**
56
+ * Transition configuration for beacon animations.
57
+ */
58
+ transitions?: ScrubberBeaconProps['transitions'];
59
+ /**
60
+ * Custom component for the scrubber beacon.
61
+ * @default DefaultScrubberBeacon
62
+ */
63
+ BeaconComponent?: ScrubberBeaconComponent;
64
+ /**
65
+ * Custom className for beacon styling.
66
+ */
67
+ className?: string;
68
+ /**
69
+ * Custom inline styles for beacons.
70
+ */
71
+ style?: React.CSSProperties;
72
+ /**
73
+ * Stroke color of the beacon circle.
74
+ * @default 'var(--color-bg)'
75
+ */
76
+ stroke?: string;
77
+ } & import('react').RefAttributes<ScrubberBeaconGroupRef>
78
+ >
79
+ >;
80
+ //# sourceMappingURL=ScrubberBeaconGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScrubberBeaconGroup.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/ScrubberBeaconGroup.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAW9D,OAAO,KAAK,EAAE,uBAAuB,EAAE,mBAAmB,EAAqB,MAAM,YAAY,CAAC;AAyGlG,MAAM,MAAM,sBAAsB,GAAG;IACnC;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG,WAAW,GAAG;IACvD;;OAEG;IACH,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAAG,4BAA4B,GAAG;IACpE;;OAEG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACjD;;;OAGG;IACH,eAAe,CAAC,EAAE,uBAAuB,CAAC;IAC1C;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,eAAO,MAAM,mBAAmB;IAnC9B;;OAEG;eACQ,MAAM,EAAE;IACnB;;OAEG;gBACS,OAAO;;IAInB;;OAEG;kBACW,mBAAmB,CAAC,aAAa,CAAC;IAChD;;;OAGG;sBACe,uBAAuB;IACzC;;OAEG;gBACS,MAAM;IAClB;;OAEG;YACK,KAAK,CAAC,aAAa;IAC3B;;;OAGG;aACM,MAAM;2DAyFhB,CAAC"}
@@ -0,0 +1,56 @@
1
+ import { type CSSProperties } from 'react';
2
+ import type { SharedProps } from '@coinbase/cds-common/types';
3
+ import type { ChartTextProps } from '../text';
4
+ import { type ScrubberLabelPosition } from '../utils/scrubber';
5
+ import type {
6
+ ScrubberBeaconLabelComponent,
7
+ ScrubberBeaconLabelProps,
8
+ ScrubberBeaconProps,
9
+ } from './Scrubber';
10
+ export type ScrubberBeaconLabelGroupBaseProps = SharedProps & {
11
+ /**
12
+ * Labels to be displayed.
13
+ */
14
+ labels: Array<Pick<ScrubberBeaconLabelProps, 'seriesId' | 'label' | 'color'>>;
15
+ /**
16
+ * Minimum gap between labels in pixels.
17
+ * @default 4
18
+ */
19
+ labelMinGap?: number;
20
+ /**
21
+ * Horizontal offset of labels from the scrubber line in pixels.
22
+ * @default 16
23
+ */
24
+ labelHorizontalOffset?: number;
25
+ /**
26
+ * Font style for the beacon labels.
27
+ */
28
+ labelFont?: ChartTextProps['font'];
29
+ /**
30
+ * Preferred side for labels.
31
+ * @note labels will switch to the opposite side if there's not enough space on the preferred side.
32
+ * @default 'right'
33
+ */
34
+ labelPreferredSide?: ScrubberLabelPosition;
35
+ };
36
+ export type ScrubberBeaconLabelGroupProps = ScrubberBeaconLabelGroupBaseProps & {
37
+ /**
38
+ * Custom component to render as a scrubber beacon label.
39
+ * @default DefaultScrubberBeaconLabel
40
+ */
41
+ BeaconLabelComponent?: ScrubberBeaconLabelComponent;
42
+ /**
43
+ * Transition configuration for beacon label animations.
44
+ */
45
+ transitions?: ScrubberBeaconProps['transitions'];
46
+ /**
47
+ * Custom class name for each beacon label.
48
+ */
49
+ className?: string;
50
+ /**
51
+ * Custom inline styles for each beacon label.
52
+ */
53
+ style?: CSSProperties;
54
+ };
55
+ export declare const ScrubberBeaconLabelGroup: import('react').NamedExoticComponent<ScrubberBeaconLabelGroupProps>;
56
+ //# sourceMappingURL=ScrubberBeaconLabelGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ScrubberBeaconLabelGroup.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/ScrubberBeaconLabelGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAwC,MAAM,OAAO,CAAC;AAEjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAI9D,OAAO,KAAK,EAAqB,cAAc,EAAE,MAAM,SAAS,CAAC;AAQjE,OAAO,EAKL,KAAK,qBAAqB,EAC3B,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EACV,4BAA4B,EAC5B,wBAAwB,EACxB,mBAAmB,EACpB,MAAM,YAAY,CAAC;AA+DpB,MAAM,MAAM,iCAAiC,GAAG,WAAW,GAAG;IAC5D;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC,IAAI,CAAC,wBAAwB,EAAE,UAAU,GAAG,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAC9E;;;OAGG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAC/B;;OAEG;IACH,SAAS,CAAC,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC;IACnC;;;;OAIG;IACH,kBAAkB,CAAC,EAAE,qBAAqB,CAAC;CAC5C,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,iCAAiC,GAAG;IAC9E;;;OAGG;IACH,oBAAoB,CAAC,EAAE,4BAA4B,CAAC;IACpD;;OAEG;IACH,WAAW,CAAC,EAAE,mBAAmB,CAAC,aAAa,CAAC,CAAC;IACjD;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,aAAa,CAAC;CACvB,CAAC;AAEF,eAAO,MAAM,wBAAwB,qEA0MpC,CAAC"}
@@ -1,2 +1,5 @@
1
+ export * from './DefaultScrubberBeacon';
2
+ export * from './DefaultScrubberBeaconLabel';
3
+ export * from './DefaultScrubberLabel';
1
4
  export * from './Scrubber';
2
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/index.ts"],"names":[],"mappings":"AACA,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/chart/scrubber/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,wBAAwB,CAAC;AACvC,cAAc,YAAY,CAAC"}