@coinbase/cds-web-visualization 3.3.0 → 3.3.2

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 (42) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dts/index.d.ts +1 -1
  3. package/dts/sparkline/Counter.d.ts +7 -2
  4. package/dts/sparkline/Sparkline.d.ts +26 -16
  5. package/dts/sparkline/SparklineArea.d.ts +8 -4
  6. package/dts/sparkline/SparklineAreaPattern.d.ts +7 -4
  7. package/dts/sparkline/SparklineGradient.d.ts +16 -10
  8. package/dts/sparkline/SparklinePath.d.ts +8 -6
  9. package/dts/sparkline/__figma__/Sparkline.figma.d.ts +1 -1
  10. package/dts/sparkline/generateSparklineWithId.d.ts +7 -2
  11. package/dts/sparkline/index.d.ts +1 -1
  12. package/dts/sparkline/sparkline-interactive/InnerSparklineInteractiveProvider.d.ts +9 -5
  13. package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +159 -118
  14. package/dts/sparkline/sparkline-interactive/SparklineInteractiveAnimatedPath.d.ts +19 -9
  15. package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverDate.d.ts +4 -2
  16. package/dts/sparkline/sparkline-interactive/SparklineInteractiveHoverPrice.d.ts +4 -2
  17. package/dts/sparkline/sparkline-interactive/SparklineInteractiveLineVertical.d.ts +5 -3
  18. package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts +11 -6
  19. package/dts/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.d.ts.map +1 -1
  20. package/dts/sparkline/sparkline-interactive/SparklineInteractivePaths.d.ts +20 -7
  21. package/dts/sparkline/sparkline-interactive/SparklineInteractivePeriodSelector.d.ts +21 -16
  22. package/dts/sparkline/sparkline-interactive/SparklineInteractiveProvider.d.ts +17 -12
  23. package/dts/sparkline/sparkline-interactive/SparklineInteractiveScrubHandler.d.ts +23 -10
  24. package/dts/sparkline/sparkline-interactive/SparklineInteractiveScrubProvider.d.ts +12 -12
  25. package/dts/sparkline/sparkline-interactive/SparklineInteractiveTimeseriesPaths.d.ts +22 -14
  26. package/dts/sparkline/sparkline-interactive/__figma__/SparklineInteractive.figma.d.ts +1 -1
  27. package/dts/sparkline/sparkline-interactive/fade.d.ts +1 -1
  28. package/dts/sparkline/sparkline-interactive/useSparklineInteractiveConstants.d.ts +11 -11
  29. package/dts/sparkline/sparkline-interactive-header/SparklineInteractiveHeader.d.ts +101 -93
  30. package/dts/sparkline/sparkline-interactive-header/__figma__/SparklineInteractiveHeader.figma.d.ts +1 -1
  31. package/esm/sparkline/sparkline-interactive/SparklineInteractiveMarkerDates.js +8 -4
  32. package/package.json +11 -11
  33. package/dts/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.d.ts +0 -374
  34. package/dts/sparkline/sparkline-interactive/__stories__/SparklineInteractive.stories.d.ts.map +0 -1
  35. package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractive.test.d.ts +0 -2
  36. package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractive.test.d.ts.map +0 -1
  37. package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePeriodSelector.test.d.ts +0 -2
  38. package/dts/sparkline/sparkline-interactive/__tests__/SparklineInteractivePeriodSelector.test.d.ts.map +0 -1
  39. package/dts/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.d.ts +0 -87
  40. package/dts/sparkline/sparkline-interactive-header/__stories__/SparklineInteractiveHeader.stories.d.ts.map +0 -1
  41. package/dts/sparkline/sparkline-interactive-header/__tests__/SparklineInteractiveHeader.test.d.ts +0 -2
  42. package/dts/sparkline/sparkline-interactive-header/__tests__/SparklineInteractiveHeader.test.d.ts.map +0 -1
@@ -1,11 +1,24 @@
1
1
  import type { SparklineInteractiveBaseProps } from './SparklineInteractive';
2
- export type SparklineInteractivePathsProps<Period extends string> = Pick<SparklineInteractiveBaseProps<Period>, 'fill' | 'yAxisScalingFactor' | 'strokeColor' | 'hoverData' | 'compact'> & {
3
- showHoverData: boolean;
4
- path: string;
5
- area: string;
6
- selectedPeriod: Period;
2
+ export type SparklineInteractivePathsProps<Period extends string> = Pick<
3
+ SparklineInteractiveBaseProps<Period>,
4
+ 'fill' | 'yAxisScalingFactor' | 'strokeColor' | 'hoverData' | 'compact'
5
+ > & {
6
+ showHoverData: boolean;
7
+ path: string;
8
+ area: string;
9
+ selectedPeriod: Period;
7
10
  };
8
- declare function SparklineInteractivePathsWithGeneric<Period extends string>({ showHoverData, fill, path, area, selectedPeriod, yAxisScalingFactor, strokeColor, hoverData, compact, }: SparklineInteractivePathsProps<Period>): import("react/jsx-runtime").JSX.Element;
11
+ declare function SparklineInteractivePathsWithGeneric<Period extends string>({
12
+ showHoverData,
13
+ fill,
14
+ path,
15
+ area,
16
+ selectedPeriod,
17
+ yAxisScalingFactor,
18
+ strokeColor,
19
+ hoverData,
20
+ compact,
21
+ }: SparklineInteractivePathsProps<Period>): import('react/jsx-runtime').JSX.Element;
9
22
  export declare const SparklineInteractivePaths: typeof SparklineInteractivePathsWithGeneric;
10
23
  export {};
11
- //# sourceMappingURL=SparklineInteractivePaths.d.ts.map
24
+ //# sourceMappingURL=SparklineInteractivePaths.d.ts.map
@@ -1,20 +1,25 @@
1
1
  export type SparklineInteractivePeriodSelectorProps<Period extends string> = {
2
- selectedPeriod: Period;
3
- setSelectedPeriod: (period: Period) => void;
4
- periods: {
5
- label: string;
6
- value: Period;
7
- }[];
8
- color: string;
2
+ selectedPeriod: Period;
3
+ setSelectedPeriod: (period: Period) => void;
4
+ periods: {
5
+ label: string;
6
+ value: Period;
7
+ }[];
8
+ color: string;
9
9
  };
10
10
  export type SparklineInteractivePeriodProps<Period extends string> = {
11
- period: {
12
- label: string;
13
- value: Period;
14
- };
15
- selectedPeriod: Period;
16
- setSelectedPeriod: SparklineInteractivePeriodSelectorProps<Period>['setSelectedPeriod'];
17
- color: string;
11
+ period: {
12
+ label: string;
13
+ value: Period;
14
+ };
15
+ selectedPeriod: Period;
16
+ setSelectedPeriod: SparklineInteractivePeriodSelectorProps<Period>['setSelectedPeriod'];
17
+ color: string;
18
18
  };
19
- export declare const SparklineInteractivePeriodSelector: <Period extends string>({ selectedPeriod, setSelectedPeriod, periods, color, }: SparklineInteractivePeriodSelectorProps<Period>) => import("react/jsx-runtime").JSX.Element;
20
- //# sourceMappingURL=SparklineInteractivePeriodSelector.d.ts.map
19
+ export declare const SparklineInteractivePeriodSelector: <Period extends string>({
20
+ selectedPeriod,
21
+ setSelectedPeriod,
22
+ periods,
23
+ color,
24
+ }: SparklineInteractivePeriodSelectorProps<Period>) => import('react/jsx-runtime').JSX.Element;
25
+ //# sourceMappingURL=SparklineInteractivePeriodSelector.d.ts.map
@@ -1,20 +1,25 @@
1
1
  import React from 'react';
2
2
  import type { Dispatch, SetStateAction } from 'react';
3
3
  type SparklineInteractiveProviderProps = {
4
- children: React.ReactNode;
5
- compact?: boolean;
4
+ children: React.ReactNode;
5
+ compact?: boolean;
6
6
  };
7
7
  type SparklineInteractiveContextInterface = {
8
- isFallbackVisible: boolean;
9
- compact: boolean;
10
- width: number;
11
- height: number;
12
- showFallback: () => void;
13
- hideFallback: () => void;
14
- setWidth: Dispatch<SetStateAction<number>>;
15
- setHeight: Dispatch<SetStateAction<number>>;
8
+ isFallbackVisible: boolean;
9
+ compact: boolean;
10
+ width: number;
11
+ height: number;
12
+ showFallback: () => void;
13
+ hideFallback: () => void;
14
+ setWidth: Dispatch<SetStateAction<number>>;
15
+ setHeight: Dispatch<SetStateAction<number>>;
16
16
  };
17
- export declare const SparklineInteractiveProvider: React.MemoExoticComponent<({ children, compact }: SparklineInteractiveProviderProps) => import("react/jsx-runtime").JSX.Element>;
17
+ export declare const SparklineInteractiveProvider: React.MemoExoticComponent<
18
+ ({
19
+ children,
20
+ compact,
21
+ }: SparklineInteractiveProviderProps) => import('react/jsx-runtime').JSX.Element
22
+ >;
18
23
  export declare function useSparklineInteractiveContext(): SparklineInteractiveContextInterface;
19
24
  export {};
20
- //# sourceMappingURL=SparklineInteractiveProvider.d.ts.map
25
+ //# sourceMappingURL=SparklineInteractiveProvider.d.ts.map
@@ -1,17 +1,30 @@
1
1
  import React from 'react';
2
2
  import type { ChartGetMarker } from '@coinbase/cds-common';
3
3
  import type { SparklineInteractiveBaseProps } from './SparklineInteractive';
4
- export declare const scrubHandlerStaticClassName = "cds-sparkline--scrubhandler";
4
+ export declare const scrubHandlerStaticClassName = 'cds-sparkline--scrubhandler';
5
5
  export declare function fadeInMask(domNode?: HTMLElement | null): void;
6
- type SparklineInteractiveScrubHandlerWebProps<Period extends string> = Pick<SparklineInteractiveBaseProps<Period>, 'onScrub' | 'formatHoverDate' | 'formatHoverPrice'> & {
7
- getMarker: ChartGetMarker;
8
- selectedPeriod: Period;
9
- onScrubEnd?: () => void;
10
- onScrubStart?: () => void;
11
- disabled?: boolean;
12
- children: React.ReactNode;
6
+ type SparklineInteractiveScrubHandlerWebProps<Period extends string> = Pick<
7
+ SparklineInteractiveBaseProps<Period>,
8
+ 'onScrub' | 'formatHoverDate' | 'formatHoverPrice'
9
+ > & {
10
+ getMarker: ChartGetMarker;
11
+ selectedPeriod: Period;
12
+ onScrubEnd?: () => void;
13
+ onScrubStart?: () => void;
14
+ disabled?: boolean;
15
+ children: React.ReactNode;
13
16
  };
14
- declare const SparklineInteractiveScrubHandlerWithGeneric: <Period extends string>({ onScrubEnd, onScrubStart, children, disabled, onScrub, getMarker, selectedPeriod, formatHoverDate, formatHoverPrice, }: SparklineInteractiveScrubHandlerWebProps<Period>) => import("react/jsx-runtime").JSX.Element;
17
+ declare const SparklineInteractiveScrubHandlerWithGeneric: <Period extends string>({
18
+ onScrubEnd,
19
+ onScrubStart,
20
+ children,
21
+ disabled,
22
+ onScrub,
23
+ getMarker,
24
+ selectedPeriod,
25
+ formatHoverDate,
26
+ formatHoverPrice,
27
+ }: SparklineInteractiveScrubHandlerWebProps<Period>) => import('react/jsx-runtime').JSX.Element;
15
28
  export declare const SparklineInteractiveScrubHandler: typeof SparklineInteractiveScrubHandlerWithGeneric;
16
29
  export {};
17
- //# sourceMappingURL=SparklineInteractiveScrubHandler.d.ts.map
30
+ //# sourceMappingURL=SparklineInteractiveScrubHandler.d.ts.map
@@ -1,18 +1,18 @@
1
1
  import React from 'react';
2
2
  import type { Dispatch, SetStateAction } from 'react';
3
3
  type SparklineInteractiveScrubContextInterface = {
4
- setLineDOMNode: Dispatch<SetStateAction<HTMLDivElement | null>>;
5
- setMaskDOMNode: Dispatch<SetStateAction<HTMLDivElement | null>>;
6
- setHoverDateDOMNode: Dispatch<SetStateAction<HTMLSpanElement | null>>;
7
- setHoverPriceDOMNode: Dispatch<SetStateAction<HTMLSpanElement | null>>;
8
- lineDOMNode: HTMLDivElement | null;
9
- maskDOMNode: HTMLDivElement | null;
10
- hoverDateDOMNode: HTMLSpanElement | null;
11
- hoverPriceDOMNode: HTMLSpanElement | null;
4
+ setLineDOMNode: Dispatch<SetStateAction<HTMLDivElement | null>>;
5
+ setMaskDOMNode: Dispatch<SetStateAction<HTMLDivElement | null>>;
6
+ setHoverDateDOMNode: Dispatch<SetStateAction<HTMLSpanElement | null>>;
7
+ setHoverPriceDOMNode: Dispatch<SetStateAction<HTMLSpanElement | null>>;
8
+ lineDOMNode: HTMLDivElement | null;
9
+ maskDOMNode: HTMLDivElement | null;
10
+ hoverDateDOMNode: HTMLSpanElement | null;
11
+ hoverPriceDOMNode: HTMLSpanElement | null;
12
12
  };
13
- export declare const SparklineInteractiveScrubProvider: React.MemoExoticComponent<({ children }: {
14
- children: React.ReactNode;
15
- }) => import("react/jsx-runtime").JSX.Element>;
13
+ export declare const SparklineInteractiveScrubProvider: React.MemoExoticComponent<
14
+ ({ children }: { children: React.ReactNode }) => import('react/jsx-runtime').JSX.Element
15
+ >;
16
16
  export declare function useSparklineInteractiveScrubContext(): SparklineInteractiveScrubContextInterface;
17
17
  export {};
18
- //# sourceMappingURL=SparklineInteractiveScrubProvider.d.ts.map
18
+ //# sourceMappingURL=SparklineInteractiveScrubProvider.d.ts.map
@@ -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,3 +1,3 @@
1
1
  export declare function fadeOut(domNode?: HTMLElement | null): void;
2
2
  export declare function fadeIn(domNode?: HTMLElement | null): void;
3
- //# sourceMappingURL=fade.d.ts.map
3
+ //# sourceMappingURL=fade.d.ts.map
@@ -1,13 +1,13 @@
1
1
  export declare function useSparklineInteractiveConstants(): {
2
- chartWidth: number;
3
- chartHeight: number;
4
- chartDimensionStyles: {
5
- height: number;
6
- width: number;
7
- };
8
- xRange: number[];
9
- yRange: number[];
10
- startX: number;
11
- endX: number;
2
+ chartWidth: number;
3
+ chartHeight: number;
4
+ chartDimensionStyles: {
5
+ height: number;
6
+ width: number;
7
+ };
8
+ xRange: number[];
9
+ yRange: number[];
10
+ startX: number;
11
+ endX: number;
12
12
  };
13
- //# sourceMappingURL=useSparklineInteractiveConstants.d.ts.map
13
+ //# sourceMappingURL=useSparklineInteractiveConstants.d.ts.map
@@ -1,104 +1,112 @@
1
1
  import React from 'react';
2
- import type { SharedProps, SparklineInteractiveHeaderSignVariant, SparklineInteractiveHeaderVariant } from '@coinbase/cds-common/types';
2
+ import type {
3
+ SharedProps,
4
+ SparklineInteractiveHeaderSignVariant,
5
+ SparklineInteractiveHeaderVariant,
6
+ } from '@coinbase/cds-common/types';
3
7
  export * from '@coinbase/cds-common/types/SparklineInteractiveHeaderBaseProps';
4
8
  export type SparklineInteractiveSubHead = {
5
- /**
6
- * Free form percentage change
7
- */
8
- percent: string;
9
- /**
10
- * Sign to denote the change in price
11
- */
12
- sign: SparklineInteractiveHeaderSignVariant;
13
- /**
14
- * The variant to use for the price and percentage change
15
- */
16
- variant: SparklineInteractiveHeaderVariant;
17
- /**
18
- * Show the dollar amount of price change
19
- */
20
- priceChange?: string;
21
- /**
22
- * The accessoryText to show after the price and / or percentage change. An example is "All time"
23
- */
24
- accessoryText?: string;
25
- /**
26
- * The accessibilityLabel to show for the price and / or percentage change. This should be localized
27
- * @example
28
- * // First, configure your i18n strings
29
- * const messages = defineMessages({
30
- * subHeadPrefix: {
31
- * id: `${i18nKey}.subHeadPrefix`,
32
- * defaultMessage: 'Price increase in the amount of',
33
- * description: 'A prefix to make it clear which direction the price action was moving',
34
- * }
35
- * });
36
- *
37
- * // then provide the translated string the accessibilityLabel prop
38
- * messages.subHeadPrefix
39
- */
40
- accessibilityLabel?: string;
9
+ /**
10
+ * Free form percentage change
11
+ */
12
+ percent: string;
13
+ /**
14
+ * Sign to denote the change in price
15
+ */
16
+ sign: SparklineInteractiveHeaderSignVariant;
17
+ /**
18
+ * The variant to use for the price and percentage change
19
+ */
20
+ variant: SparklineInteractiveHeaderVariant;
21
+ /**
22
+ * Show the dollar amount of price change
23
+ */
24
+ priceChange?: string;
25
+ /**
26
+ * The accessoryText to show after the price and / or percentage change. An example is "All time"
27
+ */
28
+ accessoryText?: string;
29
+ /**
30
+ * The accessibilityLabel to show for the price and / or percentage change. This should be localized
31
+ * @example
32
+ * // First, configure your i18n strings
33
+ * const messages = defineMessages({
34
+ * subHeadPrefix: {
35
+ * id: `${i18nKey}.subHeadPrefix`,
36
+ * defaultMessage: 'Price increase in the amount of',
37
+ * description: 'A prefix to make it clear which direction the price action was moving',
38
+ * }
39
+ * });
40
+ *
41
+ * // then provide the translated string the accessibilityLabel prop
42
+ * messages.subHeadPrefix
43
+ */
44
+ accessibilityLabel?: string;
41
45
  };
42
46
  export type SparklineInteractiveHeaderValues = {
43
- /**
44
- * Describes what the Header represents e.g. Bitcoin Price
45
- */
46
- label?: string;
47
- /**
48
- * Main content of header, this is usually the price
49
- */
50
- title?: React.ReactNode;
51
- /**
52
- * Provides additional information about the title, such as a price change
53
- */
54
- subHead?: SparklineInteractiveSubHead;
47
+ /**
48
+ * Describes what the Header represents e.g. Bitcoin Price
49
+ */
50
+ label?: string;
51
+ /**
52
+ * Main content of header, this is usually the price
53
+ */
54
+ title?: React.ReactNode;
55
+ /**
56
+ * Provides additional information about the title, such as a price change
57
+ */
58
+ subHead?: SparklineInteractiveSubHead;
55
59
  };
56
60
  export type SparklineInteractiveHeaderRef = {
57
- update: (params: SparklineInteractiveHeaderValues) => void;
61
+ update: (params: SparklineInteractiveHeaderValues) => void;
58
62
  };
59
63
  export type SparklineInteractiveHeaderProps = SharedProps & {
60
- /**
61
- * 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.
62
- */
63
- defaultTitle: React.ReactNode;
64
- /**
65
- * Default label, changing this prop has no effect once the default is rendered.
66
- */
67
- defaultLabel?: string;
68
- /**
69
- * Default SubHead, changing this prop has no effect once the default is rendered.
70
- */
71
- defaultSubHead?: SparklineInteractiveSubHead;
72
- /**
73
- * Adds a label node that allows React components. If you use this node then you cannot use the text based label that supports updates.
74
- */
75
- labelNode?: React.ReactNode;
76
- /**
77
- * Reduce the font size used for the header itself.
78
- */
79
- compact?: boolean;
64
+ /**
65
+ * 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.
66
+ */
67
+ defaultTitle: React.ReactNode;
68
+ /**
69
+ * Default label, changing this prop has no effect once the default is rendered.
70
+ */
71
+ defaultLabel?: string;
72
+ /**
73
+ * Default SubHead, changing this prop has no effect once the default is rendered.
74
+ */
75
+ defaultSubHead?: SparklineInteractiveSubHead;
76
+ /**
77
+ * Adds a label node that allows React components. If you use this node then you cannot use the text based label that supports updates.
78
+ */
79
+ labelNode?: React.ReactNode;
80
+ /**
81
+ * Reduce the font size used for the header itself.
82
+ */
83
+ compact?: boolean;
80
84
  };
81
85
  export declare const interpolateSubHeadText: (subHead: SparklineInteractiveSubHead) => string;
82
- export declare const SparklineInteractiveHeader: React.MemoExoticComponent<React.ForwardRefExoticComponent<SharedProps & {
83
- /**
84
- * 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.
85
- */
86
- defaultTitle: React.ReactNode;
87
- /**
88
- * Default label, changing this prop has no effect once the default is rendered.
89
- */
90
- defaultLabel?: string;
91
- /**
92
- * Default SubHead, changing this prop has no effect once the default is rendered.
93
- */
94
- defaultSubHead?: SparklineInteractiveSubHead;
95
- /**
96
- * Adds a label node that allows React components. If you use this node then you cannot use the text based label that supports updates.
97
- */
98
- labelNode?: React.ReactNode;
99
- /**
100
- * Reduce the font size used for the header itself.
101
- */
102
- compact?: boolean;
103
- } & React.RefAttributes<SparklineInteractiveHeaderRef>>>;
104
- //# sourceMappingURL=SparklineInteractiveHeader.d.ts.map
86
+ export declare const SparklineInteractiveHeader: React.MemoExoticComponent<
87
+ React.ForwardRefExoticComponent<
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
+ >
111
+ >;
112
+ //# 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
@@ -13,14 +13,15 @@ const noPointerEvents = {
13
13
  };
14
14
  const SparklineInteractiveMarkerDate = /*#__PURE__*/memo(_ref => {
15
15
  let {
16
- getFormattedDate
16
+ getFormattedDate,
17
+ containerOffsetLeft
17
18
  } = _ref;
18
19
  const [xPos, setXPos] = useState(0);
19
20
  const setupRef = useCallback(ref => {
20
21
  if (ref) {
21
- setXPos(ref.offsetLeft + ref.offsetWidth / 2);
22
+ setXPos(ref.offsetLeft + ref.offsetWidth / 2 - containerOffsetLeft);
22
23
  }
23
- }, []);
24
+ }, [containerOffsetLeft]);
24
25
  const dateStr = getFormattedDate(xPos);
25
26
 
26
27
  // take up space while loading so when it finishes loading there is no jump
@@ -48,6 +49,7 @@ function SparklineInteractiveMarkerDatesWithGeneric(_ref2) {
48
49
  timePeriodGutter = 2
49
50
  } = _ref2;
50
51
  const [numberOfLabels, setNumberOfLabels] = useState(0);
52
+ const [containerOffsetLeft, setContainerOffsetLeft] = useState(0);
51
53
  const getFormattedDate = useDateLookup({
52
54
  getMarker,
53
55
  formatDate,
@@ -57,15 +59,17 @@ function SparklineInteractiveMarkerDatesWithGeneric(_ref2) {
57
59
  if (ref) {
58
60
  const numberOfLabelsFromWidth = Math.floor(ref.offsetWidth / labelWidth);
59
61
  setNumberOfLabels(Math.max(numberOfLabelsFromWidth, 4));
62
+ setContainerOffsetLeft(ref.offsetLeft);
60
63
  }
61
64
  }, []);
62
65
  const markers = useMemo(() => {
63
66
  return times(numberOfLabels).map((_, i) => {
64
67
  return /*#__PURE__*/_jsx(SparklineInteractiveMarkerDate, {
68
+ containerOffsetLeft: containerOffsetLeft,
65
69
  getFormattedDate: getFormattedDate
66
70
  }, i);
67
71
  });
68
- }, [getFormattedDate, numberOfLabels]);
72
+ }, [getFormattedDate, numberOfLabels, containerOffsetLeft]);
69
73
  return /*#__PURE__*/_jsx(HStack, {
70
74
  ref: setupRef,
71
75
  className: fadeInCss,
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@coinbase/cds-web-visualization",
3
- "version": "3.3.0",
3
+ "version": "3.3.2",
4
4
  "description": "Coinbase Design System - Web Sparkline",
5
5
  "repository": {
6
6
  "type": "git",
7
- "url": "git@github.com:coinbase/cds-staging.git",
7
+ "url": "git@github.com:coinbase/cds.git",
8
8
  "directory": "packages/web-visualization"
9
9
  },
10
10
  "type": "module",
@@ -34,10 +34,10 @@
34
34
  "CHANGELOG"
35
35
  ],
36
36
  "peerDependencies": {
37
- "@coinbase/cds-common": "workspace:^",
38
- "@coinbase/cds-lottie-files": "workspace:^",
39
- "@coinbase/cds-utils": "workspace:^",
40
- "@coinbase/cds-web": "workspace:^",
37
+ "@coinbase/cds-common": "^8.13.5",
38
+ "@coinbase/cds-lottie-files": "^3.3.1",
39
+ "@coinbase/cds-utils": "^2.3.2",
40
+ "@coinbase/cds-web": "^8.13.5",
41
41
  "react": "^18.3.1",
42
42
  "react-dom": "^18.3.1"
43
43
  },
@@ -54,13 +54,13 @@
54
54
  "@babel/preset-env": "^7.28.0",
55
55
  "@babel/preset-react": "^7.27.1",
56
56
  "@babel/preset-typescript": "^7.27.1",
57
- "@coinbase/cds-common": "workspace:^",
58
- "@coinbase/cds-lottie-files": "workspace:^",
59
- "@coinbase/cds-utils": "workspace:^",
60
- "@coinbase/cds-web": "workspace:^",
57
+ "@coinbase/cds-common": "^8.13.5",
58
+ "@coinbase/cds-lottie-files": "^3.3.1",
59
+ "@coinbase/cds-utils": "^2.3.2",
60
+ "@coinbase/cds-web": "^8.13.5",
61
61
  "@figma/code-connect": "^1.3.4",
62
62
  "@linaria/core": "^3.0.0-beta.22",
63
63
  "@types/react": "^18.3.12",
64
64
  "@types/react-dom": "^18.3.1"
65
65
  }
66
- }
66
+ }