@coinbase/cds-web-visualization 3.4.0-beta.24 → 3.4.0-beta.25

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 (43) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dts/chart/Path.d.ts +4 -2
  3. package/dts/chart/Path.d.ts.map +1 -1
  4. package/dts/chart/PeriodSelector.d.ts +1 -1
  5. package/dts/chart/bar/Bar.d.ts +18 -54
  6. package/dts/chart/bar/Bar.d.ts.map +1 -1
  7. package/dts/chart/bar/BarPlot.d.ts.map +1 -1
  8. package/dts/chart/bar/BarStack.d.ts +4 -4
  9. package/dts/chart/bar/BarStack.d.ts.map +1 -1
  10. package/dts/chart/bar/DefaultBar.d.ts.map +1 -1
  11. package/dts/chart/bar/DefaultBarStack.d.ts.map +1 -1
  12. package/dts/chart/point/Point.d.ts +2 -1
  13. package/dts/chart/point/Point.d.ts.map +1 -1
  14. package/dts/chart/scrubber/Scrubber.d.ts +4 -2
  15. package/dts/chart/scrubber/Scrubber.d.ts.map +1 -1
  16. package/dts/chart/utils/bar.d.ts +153 -0
  17. package/dts/chart/utils/bar.d.ts.map +1 -1
  18. package/dts/chart/utils/chart.d.ts +2 -1
  19. package/dts/chart/utils/chart.d.ts.map +1 -1
  20. package/dts/chart/utils/path.d.ts.map +1 -1
  21. package/dts/sparkline/Sparkline.d.ts +2 -1
  22. package/dts/sparkline/Sparkline.d.ts.map +1 -1
  23. package/dts/sparkline/SparklineArea.d.ts +2 -1
  24. package/dts/sparkline/SparklineArea.d.ts.map +1 -1
  25. package/dts/sparkline/SparklineGradient.d.ts +2 -1
  26. package/dts/sparkline/SparklineGradient.d.ts.map +1 -1
  27. package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts +2 -1
  28. package/dts/sparkline/sparkline-interactive/SparklineInteractive.d.ts.map +1 -1
  29. package/esm/chart/Path.js +2 -1
  30. package/esm/chart/bar/Bar.js +4 -6
  31. package/esm/chart/bar/BarChart.js +7 -7
  32. package/esm/chart/bar/BarPlot.js +17 -27
  33. package/esm/chart/bar/BarStack.js +90 -295
  34. package/esm/chart/bar/DefaultBar.js +13 -19
  35. package/esm/chart/bar/DefaultBarStack.js +12 -19
  36. package/esm/chart/utils/bar.js +813 -0
  37. package/esm/chart/utils/chart.js +2 -1
  38. package/esm/chart/utils/path.js +5 -13
  39. package/esm/sparkline/Sparkline.js +2 -1
  40. package/esm/sparkline/SparklineArea.js +2 -1
  41. package/esm/sparkline/SparklineGradient.js +2 -1
  42. package/esm/sparkline/sparkline-interactive/SparklineInteractive.js +2 -1
  43. package/package.json +5 -5
@@ -239,7 +239,8 @@ export const defaultHorizontalLayoutChartInset = {
239
239
  };
240
240
 
241
241
  /**
242
- * @deprecated Use `defaultVerticalLayoutChartInset` for vertical layout charts or
242
+ * @deprecated Use `defaultVerticalLayoutChartInset` for vertical layout charts or. This will be removed in a future major release.
243
+ * @deprecationExpectedRemoval v4
243
244
  * `defaultHorizontalLayoutChartInset` for horizontal layout charts.
244
245
  */
245
246
  export const defaultChartInset = defaultVerticalLayoutChartInset;
@@ -231,21 +231,13 @@ export const lineToPath = (x1, y1, x2, y2) => {
231
231
  */
232
232
  export const getBarPath = function (x, y, width, height, radius, roundTop, roundBottom) {
233
233
  let layout = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : 'vertical';
234
+ const isVerticalLayout = layout === 'vertical';
234
235
  const roundBothSides = roundTop && roundBottom;
235
- const barsGrowVertically = layout !== 'horizontal';
236
236
  const r = Math.min(radius, width / 2, roundBothSides ? height / 2 : height);
237
-
238
- // In vertical layout (bars grow up/down):
239
- // - roundTop rounds the top face (min Y)
240
- // - roundBottom rounds the bottom face (max Y)
241
- // In horizontal layout (bars grow left/right):
242
- // - roundTop rounds the right face (max X)
243
- // - roundBottom rounds the left face (min X)
244
-
245
- const rTL = barsGrowVertically ? roundTop ? r : 0 : roundBottom ? r : 0;
246
- const rTR = barsGrowVertically ? roundTop ? r : 0 : roundTop ? r : 0;
247
- const rBR = barsGrowVertically ? roundBottom ? r : 0 : roundTop ? r : 0;
248
- const rBL = barsGrowVertically ? roundBottom ? r : 0 : roundBottom ? r : 0;
237
+ const rTL = isVerticalLayout ? roundTop ? r : 0 : roundBottom ? r : 0;
238
+ const rTR = isVerticalLayout ? roundTop ? r : 0 : roundTop ? r : 0;
239
+ const rBR = isVerticalLayout ? roundBottom ? r : 0 : roundTop ? r : 0;
240
+ const rBL = isVerticalLayout ? roundBottom ? r : 0 : roundBottom ? r : 0;
249
241
 
250
242
  // Build path with selective rounding
251
243
  let path = "M ".concat(x + rTL, " ").concat(y);
@@ -15,7 +15,8 @@ import { SparklineAreaPattern } from './SparklineAreaPattern';
15
15
  import { SparklinePath } from './SparklinePath';
16
16
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
17
17
  /**
18
- * @deprecated Use LineChart instead.
18
+ * @deprecated Use LineChart instead. This will be removed in a future major release.
19
+ * @deprecationExpectedRemoval v4
19
20
  */
20
21
  export const Sparkline = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
21
22
  let {
@@ -1,7 +1,8 @@
1
1
  import React, { forwardRef, memo } from 'react';
2
2
  import { jsx as _jsx } from "react/jsx-runtime";
3
3
  /**
4
- * @deprecated Use AreaChart instead.
4
+ * @deprecated Use AreaChart instead. This will be removed in a future major release.
5
+ * @deprecationExpectedRemoval v4
5
6
  */
6
7
  export const SparklineArea = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
7
8
  let {
@@ -2,7 +2,8 @@ import React, { forwardRef, memo } from 'react';
2
2
  import { Sparkline } from './Sparkline';
3
3
  import { jsx as _jsx } from "react/jsx-runtime";
4
4
  /**
5
- * @deprecated Use LineChart instead.
5
+ * @deprecated Use LineChart instead. This will be removed in a future major release.
6
+ * @deprecationExpectedRemoval v4
6
7
  */
7
8
  export const SparklineGradient = /*#__PURE__*/memo(/*#__PURE__*/forwardRef((_ref, ref) => {
8
9
  let {
@@ -312,6 +312,7 @@ function SparklineInteractiveWithGeneric(_ref4) {
312
312
  }
313
313
 
314
314
  /**
315
- * @deprecated Use LineChart instead.
315
+ * @deprecated Use LineChart instead. This will be removed in a future major release.
316
+ * @deprecationExpectedRemoval v4
316
317
  */
317
318
  export const SparklineInteractive = /*#__PURE__*/memo(SparklineInteractiveWithGeneric);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coinbase/cds-web-visualization",
3
- "version": "3.4.0-beta.24",
3
+ "version": "3.4.0-beta.25",
4
4
  "description": "Coinbase Design System - Web Sparkline",
5
5
  "repository": {
6
6
  "type": "git",
@@ -38,10 +38,10 @@
38
38
  "CHANGELOG"
39
39
  ],
40
40
  "peerDependencies": {
41
- "@coinbase/cds-common": "^8.52.2",
41
+ "@coinbase/cds-common": "^8.57.0",
42
42
  "@coinbase/cds-lottie-files": "^3.3.4",
43
43
  "@coinbase/cds-utils": "^2.3.5",
44
- "@coinbase/cds-web": "^8.52.2",
44
+ "@coinbase/cds-web": "^8.57.0",
45
45
  "framer-motion": "^10.18.0",
46
46
  "react": "^18.3.1",
47
47
  "react-dom": "^18.3.1"
@@ -59,10 +59,10 @@
59
59
  "@babel/preset-env": "^7.28.0",
60
60
  "@babel/preset-react": "^7.27.1",
61
61
  "@babel/preset-typescript": "^7.27.1",
62
- "@coinbase/cds-common": "^8.52.2",
62
+ "@coinbase/cds-common": "^8.57.0",
63
63
  "@coinbase/cds-lottie-files": "^3.3.4",
64
64
  "@coinbase/cds-utils": "^2.3.5",
65
- "@coinbase/cds-web": "^8.52.2",
65
+ "@coinbase/cds-web": "^8.57.0",
66
66
  "@linaria/core": "^3.0.0-beta.22",
67
67
  "@types/react": "^18.3.12",
68
68
  "@types/react-dom": "^18.3.1",