@automattic/charts 0.56.7 → 0.57.0

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 (176) hide show
  1. package/AGENTS.md +28 -98
  2. package/CHANGELOG.md +16 -0
  3. package/dist/charts/bar-chart/index.cjs +5 -6
  4. package/dist/charts/bar-chart/index.cjs.map +1 -1
  5. package/dist/charts/bar-chart/index.d.cts +3 -3
  6. package/dist/charts/bar-chart/index.d.ts +3 -3
  7. package/dist/charts/bar-chart/index.js +4 -5
  8. package/dist/charts/bar-list-chart/index.cjs +6 -7
  9. package/dist/charts/bar-list-chart/index.cjs.map +1 -1
  10. package/dist/charts/bar-list-chart/index.d.cts +3 -3
  11. package/dist/charts/bar-list-chart/index.d.ts +3 -3
  12. package/dist/charts/bar-list-chart/index.js +5 -6
  13. package/dist/charts/conversion-funnel-chart/index.cjs +5 -6
  14. package/dist/charts/conversion-funnel-chart/index.cjs.map +1 -1
  15. package/dist/charts/conversion-funnel-chart/index.d.cts +1 -1
  16. package/dist/charts/conversion-funnel-chart/index.d.ts +1 -1
  17. package/dist/charts/conversion-funnel-chart/index.js +4 -5
  18. package/dist/charts/geo-chart/index.cjs +4 -4
  19. package/dist/charts/geo-chart/index.d.cts +1 -1
  20. package/dist/charts/geo-chart/index.d.ts +1 -1
  21. package/dist/charts/geo-chart/index.js +3 -3
  22. package/dist/charts/leaderboard-chart/index.cjs +5 -5
  23. package/dist/charts/leaderboard-chart/index.css +8 -9
  24. package/dist/charts/leaderboard-chart/index.css.map +1 -1
  25. package/dist/charts/leaderboard-chart/index.d.cts +3 -3
  26. package/dist/charts/leaderboard-chart/index.d.ts +3 -3
  27. package/dist/charts/leaderboard-chart/index.js +4 -4
  28. package/dist/charts/line-chart/index.cjs +5 -6
  29. package/dist/charts/line-chart/index.cjs.map +1 -1
  30. package/dist/charts/line-chart/index.d.cts +3 -3
  31. package/dist/charts/line-chart/index.d.ts +3 -3
  32. package/dist/charts/line-chart/index.js +4 -5
  33. package/dist/charts/pie-chart/index.cjs +5 -6
  34. package/dist/charts/pie-chart/index.cjs.map +1 -1
  35. package/dist/charts/pie-chart/index.d.cts +4 -4
  36. package/dist/charts/pie-chart/index.d.ts +4 -4
  37. package/dist/charts/pie-chart/index.js +4 -5
  38. package/dist/charts/pie-semi-circle-chart/index.cjs +5 -6
  39. package/dist/charts/pie-semi-circle-chart/index.cjs.map +1 -1
  40. package/dist/charts/pie-semi-circle-chart/index.d.cts +4 -4
  41. package/dist/charts/pie-semi-circle-chart/index.d.ts +4 -4
  42. package/dist/charts/pie-semi-circle-chart/index.js +4 -5
  43. package/dist/charts/sparkline/index.cjs +6 -7
  44. package/dist/charts/sparkline/index.cjs.map +1 -1
  45. package/dist/charts/sparkline/index.js +5 -6
  46. package/dist/{chunk-XD2HV7M5.js → chunk-2NCY7R4G.js} +127 -762
  47. package/dist/chunk-2NCY7R4G.js.map +1 -0
  48. package/dist/{chunk-RFSHE3HL.js → chunk-32DH6JDF.js} +64 -43
  49. package/dist/chunk-32DH6JDF.js.map +1 -0
  50. package/dist/{chunk-SSFFCBCF.js → chunk-4OPFE4RM.js} +11 -8
  51. package/dist/chunk-4OPFE4RM.js.map +1 -0
  52. package/dist/{chunk-CAFJRZPZ.cjs → chunk-77OKCVQN.cjs} +17 -17
  53. package/dist/{chunk-CAFJRZPZ.cjs.map → chunk-77OKCVQN.cjs.map} +1 -1
  54. package/dist/{chunk-K6TGILHX.cjs → chunk-7FQX4ALL.cjs} +6 -6
  55. package/dist/{chunk-K6TGILHX.cjs.map → chunk-7FQX4ALL.cjs.map} +1 -1
  56. package/dist/{chunk-7FDQGBY7.js → chunk-BCX5THDQ.js} +9 -7
  57. package/dist/chunk-BCX5THDQ.js.map +1 -0
  58. package/dist/{chunk-KHQPN77E.js → chunk-CZGYJKG6.js} +4 -4
  59. package/dist/{chunk-3EXJP67N.cjs → chunk-D2UH4CFE.cjs} +9 -9
  60. package/dist/{chunk-3EXJP67N.cjs.map → chunk-D2UH4CFE.cjs.map} +1 -1
  61. package/dist/{chunk-TE63Y5PX.js → chunk-DAU3HNEG.js} +2 -2
  62. package/dist/chunk-DAU3HNEG.js.map +1 -0
  63. package/dist/{chunk-MDRCAGKZ.js → chunk-H2V4JMSA.js} +3 -3
  64. package/dist/{chunk-UFRBUT2D.cjs → chunk-I35UYJJR.cjs} +49 -6
  65. package/dist/chunk-I35UYJJR.cjs.map +1 -0
  66. package/dist/{chunk-GWBS65VC.js → chunk-IU4DYUAV.js} +3 -3
  67. package/dist/{chunk-E62LCBGD.js → chunk-PXLEMUGJ.js} +3 -3
  68. package/dist/{chunk-YDVHT7GS.cjs → chunk-RHHVEJHJ.cjs} +83 -62
  69. package/dist/chunk-RHHVEJHJ.cjs.map +1 -0
  70. package/dist/{chunk-YAXY5L7I.cjs → chunk-TO3OQBXG.cjs} +5 -5
  71. package/dist/{chunk-YAXY5L7I.cjs.map → chunk-TO3OQBXG.cjs.map} +1 -1
  72. package/dist/{chunk-VPAEBI2F.js → chunk-V36ERY7Y.js} +9 -7
  73. package/dist/chunk-V36ERY7Y.js.map +1 -0
  74. package/dist/{chunk-X7JL2NYJ.cjs → chunk-VJM5XCB4.cjs} +33 -30
  75. package/dist/chunk-VJM5XCB4.cjs.map +1 -0
  76. package/dist/{chunk-ZVGEDXDP.cjs → chunk-VTS3PNMS.cjs} +2 -2
  77. package/dist/{chunk-ZVGEDXDP.cjs.map → chunk-VTS3PNMS.cjs.map} +1 -1
  78. package/dist/{chunk-OMS5QIJN.js → chunk-WLODYNLB.js} +9 -7
  79. package/dist/chunk-WLODYNLB.js.map +1 -0
  80. package/dist/{chunk-NQJE2CC7.cjs → chunk-XKRJL2QT.cjs} +25 -23
  81. package/dist/chunk-XKRJL2QT.cjs.map +1 -0
  82. package/dist/{chunk-O2JIANHK.cjs → chunk-YE2T52VZ.cjs} +33 -31
  83. package/dist/chunk-YE2T52VZ.cjs.map +1 -0
  84. package/dist/{chunk-IS5YYLTV.js → chunk-Z26M4V2M.js} +46 -3
  85. package/dist/chunk-Z26M4V2M.js.map +1 -0
  86. package/dist/{chunk-55ZCOYDF.cjs → chunk-Z45KX47P.cjs} +153 -788
  87. package/dist/chunk-Z45KX47P.cjs.map +1 -0
  88. package/dist/{chunk-BXFD7JIG.cjs → chunk-ZH4F5RMG.cjs} +26 -24
  89. package/dist/chunk-ZH4F5RMG.cjs.map +1 -0
  90. package/dist/components/legend/index.cjs +3 -3
  91. package/dist/components/legend/index.d.cts +4 -4
  92. package/dist/components/legend/index.d.ts +4 -4
  93. package/dist/components/legend/index.js +2 -2
  94. package/dist/components/tooltip/index.d.cts +1 -1
  95. package/dist/components/tooltip/index.d.ts +1 -1
  96. package/dist/hooks/index.cjs +3 -3
  97. package/dist/hooks/index.d.cts +7 -3
  98. package/dist/hooks/index.d.ts +7 -3
  99. package/dist/hooks/index.js +2 -2
  100. package/dist/index.cjs +13 -14
  101. package/dist/index.cjs.map +1 -1
  102. package/dist/index.css +8 -9
  103. package/dist/index.css.map +1 -1
  104. package/dist/index.d.cts +7 -7
  105. package/dist/index.d.ts +7 -7
  106. package/dist/index.js +12 -13
  107. package/dist/{leaderboard-chart-BSgEw_Um.d.ts → leaderboard-chart-BKYYXcg2.d.ts} +5 -9
  108. package/dist/{leaderboard-chart-COtgamhe.d.cts → leaderboard-chart-DR7CGb0L.d.cts} +5 -9
  109. package/dist/{legend-C9ahiwOt.d.cts → legend-C2grwnWk.d.cts} +1 -1
  110. package/dist/{legend-jjMmhSg3.d.ts → legend-Cj0xM5dU.d.ts} +1 -1
  111. package/dist/providers/index.cjs +3 -3
  112. package/dist/providers/index.d.cts +3 -3
  113. package/dist/providers/index.d.ts +3 -3
  114. package/dist/providers/index.js +2 -2
  115. package/dist/{themes-DQzmaSze.d.ts → themes-BmVGrYnF.d.ts} +2 -2
  116. package/dist/{themes-CVR5rmIs.d.cts → themes-CyjKm-P_.d.cts} +2 -2
  117. package/dist/{types-DQNnq5Fr.d.ts → types-CuUEszrM.d.ts} +1 -1
  118. package/dist/{types-CzdN7rUe.d.cts → types-DZordNiO.d.cts} +11 -7
  119. package/dist/{types-CzdN7rUe.d.ts → types-DZordNiO.d.ts} +11 -7
  120. package/dist/types-I67mddpr.d.cts +78 -0
  121. package/dist/types-I67mddpr.d.ts +78 -0
  122. package/dist/{types-BBwg4Evw.d.cts → types-KtOPPzPX.d.cts} +1 -1
  123. package/dist/utils/index.cjs +2 -2
  124. package/dist/utils/index.d.cts +1 -1
  125. package/dist/utils/index.d.ts +1 -1
  126. package/dist/utils/index.js +1 -1
  127. package/package.json +6 -4
  128. package/src/charts/bar-chart/bar-chart.tsx +4 -3
  129. package/src/charts/bar-chart/test/bar-chart.test.tsx +30 -0
  130. package/src/charts/conversion-funnel-chart/test/conversion-funnel-chart.test.tsx +2 -2
  131. package/src/charts/leaderboard-chart/hooks/use-leaderboard-legend-items.ts +0 -2
  132. package/src/charts/leaderboard-chart/leaderboard-chart.module.scss +9 -10
  133. package/src/charts/leaderboard-chart/leaderboard-chart.tsx +95 -70
  134. package/src/charts/leaderboard-chart/test/leaderboard-chart.test.tsx +58 -29
  135. package/src/charts/leaderboard-chart/test/use-leaderboard-legend-items.test.tsx +2 -5
  136. package/src/charts/leaderboard-chart/types.ts +4 -7
  137. package/src/charts/line-chart/line-chart.tsx +2 -3
  138. package/src/charts/pie-chart/pie-chart.tsx +2 -3
  139. package/src/charts/pie-semi-circle-chart/pie-semi-circle-chart.tsx +2 -3
  140. package/src/components/legend/index.ts +8 -1
  141. package/src/components/legend/private/base-legend.tsx +32 -22
  142. package/src/components/legend/test/legend.test.tsx +148 -52
  143. package/src/components/legend/types.ts +42 -16
  144. package/src/hooks/test/use-zero-value-display.test.tsx +206 -0
  145. package/src/hooks/use-zero-value-display.ts +52 -23
  146. package/src/index.ts +7 -1
  147. package/src/providers/chart-context/test/chart-context.test.tsx +12 -6
  148. package/src/providers/chart-context/themes.ts +6 -4
  149. package/src/types.ts +11 -7
  150. package/src/utils/get-styles.ts +1 -1
  151. package/src/utils/test/get-styles.test.ts +12 -10
  152. package/dist/chunk-55ZCOYDF.cjs.map +0 -1
  153. package/dist/chunk-7FDQGBY7.js.map +0 -1
  154. package/dist/chunk-BXFD7JIG.cjs.map +0 -1
  155. package/dist/chunk-IS5YYLTV.js.map +0 -1
  156. package/dist/chunk-KNIMXN6Z.js +0 -51
  157. package/dist/chunk-KNIMXN6Z.js.map +0 -1
  158. package/dist/chunk-NQJE2CC7.cjs.map +0 -1
  159. package/dist/chunk-O2JIANHK.cjs.map +0 -1
  160. package/dist/chunk-OMS5QIJN.js.map +0 -1
  161. package/dist/chunk-RFSHE3HL.js.map +0 -1
  162. package/dist/chunk-SSFFCBCF.js.map +0 -1
  163. package/dist/chunk-SUDERBUA.cjs +0 -51
  164. package/dist/chunk-SUDERBUA.cjs.map +0 -1
  165. package/dist/chunk-TE63Y5PX.js.map +0 -1
  166. package/dist/chunk-UFRBUT2D.cjs.map +0 -1
  167. package/dist/chunk-VPAEBI2F.js.map +0 -1
  168. package/dist/chunk-X7JL2NYJ.cjs.map +0 -1
  169. package/dist/chunk-XD2HV7M5.js.map +0 -1
  170. package/dist/chunk-YDVHT7GS.cjs.map +0 -1
  171. package/dist/types-C05PdDJa.d.cts +0 -57
  172. package/dist/types-C05PdDJa.d.ts +0 -57
  173. /package/dist/{chunk-KHQPN77E.js.map → chunk-CZGYJKG6.js.map} +0 -0
  174. /package/dist/{chunk-MDRCAGKZ.js.map → chunk-H2V4JMSA.js.map} +0 -0
  175. /package/dist/{chunk-GWBS65VC.js.map → chunk-IU4DYUAV.js.map} +0 -0
  176. /package/dist/{chunk-E62LCBGD.js.map → chunk-PXLEMUGJ.js.map} +0 -0
package/dist/index.d.ts CHANGED
@@ -1,13 +1,13 @@
1
1
  export { BarChart, BarChartUnresponsive } from './charts/bar-chart/index.js';
2
2
  export { BarListChart, BarListChartUnresponsive } from './charts/bar-list-chart/index.js';
3
3
  export { ConversionFunnelChart } from './charts/conversion-funnel-chart/index.js';
4
- export { A as AnnotationStyles, B as BaseChartProps, a as ButtonWithPopover, C as ChartTheme, b as CompleteChartTheme, D as DataPoint, c as DataPointDate, d as DataPointPercentage, G as GeoData, e as GradientStop, f as GridProps, L as LeaderboardEntry, M as MultipleDataPointsDate, O as Optional, g as OrientationType, P as PopoverButtonAttributes, h as PopoverElement, i as PopoverElementAttributes, S as ScaleOptions, j as SeriesData, k as SeriesDataOptions, T as ToggleEvent } from './types-CzdN7rUe.js';
4
+ export { A as AnnotationStyles, B as BaseChartProps, a as ButtonWithPopover, C as ChartTheme, b as CompleteChartTheme, D as DataPoint, c as DataPointDate, d as DataPointPercentage, G as GeoData, e as GradientStop, f as GridProps, L as LeaderboardEntry, M as MultipleDataPointsDate, O as Optional, g as OrientationType, P as PopoverButtonAttributes, h as PopoverElement, i as PopoverElementAttributes, S as ScaleOptions, j as SeriesData, k as SeriesDataOptions, T as ToggleEvent } from './types-DZordNiO.js';
5
5
  export { GeoChart, GeoChartProps, GeoChartUnresponsive, GeoRegion, GeoResolution } from './charts/geo-chart/index.js';
6
- export { L as LeaderboardChart, a as LeaderboardChartUnresponsive } from './leaderboard-chart-BSgEw_Um.js';
7
- export { EventHandlerParams, GridStyles, LineStyles } from '@visx/xychart';
8
- export { L as Legend } from './legend-jjMmhSg3.js';
6
+ export { L as LeaderboardChart, a as LeaderboardChartUnresponsive } from './leaderboard-chart-BKYYXcg2.js';
7
+ export { L as Legend } from './legend-Cj0xM5dU.js';
9
8
  export { LegendValueDisplay, useChartLegendItems } from './components/legend/index.js';
10
- export { B as BaseLegendItem } from './types-C05PdDJa.js';
9
+ export { B as BaseLegendItem, L as LegendItemStyles, a as LegendLabelStyles, b as LegendShapeStyles } from './types-I67mddpr.js';
10
+ export { EventHandlerParams, GridStyles, LineStyles } from '@visx/xychart';
11
11
  export { LineChart, LineChartUnresponsive } from './charts/line-chart/index.js';
12
12
  export { RenderTooltipParams } from '@visx/xychart/lib/components/Tooltip';
13
13
  export { PieChart, PieChartProps, PieChartRenderTooltipParams, PieChartUnresponsive } from './charts/pie-chart/index.js';
@@ -15,7 +15,7 @@ export { PieSemiCircleChart, PieSemiCircleChartProps, PieSemiCircleChartRenderTo
15
15
  export { Sparkline, SparklineUnresponsive } from './charts/sparkline/index.js';
16
16
  export { B as BaseTooltip } from './base-tooltip-DOq93wjU.js';
17
17
  export { TrendDirection, TrendIndicator, TrendIndicatorProps } from './components/trend-indicator/index.js';
18
- export { G as GlobalChartsContext, a as GlobalChartsProvider, a as ThemeProvider, d as defaultTheme, u as useGlobalChartsContext, b as useGlobalChartsTheme } from './themes-DQzmaSze.js';
18
+ export { G as GlobalChartsContext, a as GlobalChartsProvider, a as ThemeProvider, d as defaultTheme, u as useGlobalChartsContext, b as useGlobalChartsTheme } from './themes-BmVGrYnF.js';
19
19
  export { GoogleDataTableColumn, GoogleDataTableColumnRoleType, GoogleDataTableRow } from 'react-google-charts';
20
20
  import 'react';
21
21
  import './with-responsive-CNfhzAUu.js';
@@ -31,5 +31,5 @@ import '@visx/scale';
31
31
  import '@visx/text/lib/Text';
32
32
  import '@wordpress/theme';
33
33
  import '@visx/legend';
34
- import './types-DQNnq5Fr.js';
34
+ import './types-CuUEszrM.js';
35
35
  import '@visx/shape/lib/shapes/Pie';
package/dist/index.js CHANGED
@@ -1,49 +1,48 @@
1
1
  import {
2
2
  LeaderboardChart,
3
3
  LeaderboardChartResponsive
4
- } from "./chunk-XD2HV7M5.js";
4
+ } from "./chunk-2NCY7R4G.js";
5
5
  import {
6
6
  PieChart,
7
7
  PieChartResponsive
8
- } from "./chunk-7FDQGBY7.js";
8
+ } from "./chunk-BCX5THDQ.js";
9
9
  import "./chunk-NFRB2POF.js";
10
10
  import {
11
11
  PieSemiCircleChart,
12
12
  PieSemiCircleChartResponsive
13
- } from "./chunk-VPAEBI2F.js";
13
+ } from "./chunk-V36ERY7Y.js";
14
14
  import "./chunk-KXRWNFQJ.js";
15
15
  import "./chunk-6CCZL2JJ.js";
16
16
  import {
17
17
  Sparkline,
18
18
  SparklineUnresponsive
19
- } from "./chunk-E62LCBGD.js";
19
+ } from "./chunk-PXLEMUGJ.js";
20
20
  import {
21
21
  LineChart,
22
22
  LineChartResponsive
23
- } from "./chunk-OMS5QIJN.js";
23
+ } from "./chunk-WLODYNLB.js";
24
24
  import {
25
25
  TrendIndicator
26
26
  } from "./chunk-XWYZIFZW.js";
27
27
  import {
28
28
  BarListChart,
29
29
  BarListChartResponsive
30
- } from "./chunk-MDRCAGKZ.js";
30
+ } from "./chunk-H2V4JMSA.js";
31
31
  import {
32
32
  BarChart,
33
33
  BarChartResponsive
34
- } from "./chunk-SSFFCBCF.js";
34
+ } from "./chunk-4OPFE4RM.js";
35
35
  import {
36
36
  BaseTooltip
37
37
  } from "./chunk-BPYKWMI7.js";
38
38
  import {
39
39
  ConversionFunnelChartWithProvider
40
- } from "./chunk-KHQPN77E.js";
41
- import "./chunk-IS5YYLTV.js";
42
- import "./chunk-KNIMXN6Z.js";
40
+ } from "./chunk-CZGYJKG6.js";
41
+ import "./chunk-Z26M4V2M.js";
43
42
  import {
44
43
  GeoChartResponsive,
45
44
  GeoChartWithProvider
46
- } from "./chunk-GWBS65VC.js";
45
+ } from "./chunk-IU4DYUAV.js";
47
46
  import "./chunk-OP6PHB2U.js";
48
47
  import {
49
48
  GlobalChartsContext,
@@ -53,8 +52,8 @@ import {
53
52
  useChartLegendItems,
54
53
  useGlobalChartsContext,
55
54
  useGlobalChartsTheme
56
- } from "./chunk-RFSHE3HL.js";
57
- import "./chunk-TE63Y5PX.js";
55
+ } from "./chunk-32DH6JDF.js";
56
+ import "./chunk-DAU3HNEG.js";
58
57
  import "./chunk-G3PMV62Z.js";
59
58
  export {
60
59
  BarChartResponsive as BarChart,
@@ -2,10 +2,10 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { R as ResponsiveConfig } from './with-responsive-CNfhzAUu.js';
3
3
  import * as react from 'react';
4
4
  import { ReactNode, FC } from 'react';
5
- import { a as BaseLegendProps, B as BaseLegendItem } from './types-C05PdDJa.js';
6
- import { B as BaseChartProps, L as LeaderboardEntry } from './types-CzdN7rUe.js';
5
+ import { b as LegendShapeStyles, c as BaseLegendProps, B as BaseLegendItem } from './types-I67mddpr.js';
6
+ import { B as BaseChartProps, L as LeaderboardEntry } from './types-DZordNiO.js';
7
7
 
8
- interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | 'data' | 'showLegend' | 'legendOrientation' | 'legendPosition' | 'legendAlignment' | 'legendShape' | 'chartId' | 'width' | 'height' | 'size' | 'legendInteractive' | 'animation'> {
8
+ interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | 'data' | 'showLegend' | 'legendOrientation' | 'legendPosition' | 'legendAlignment' | 'legendShape' | 'chartId' | 'width' | 'height' | 'size' | 'gap' | 'legendInteractive' | 'animation'> {
9
9
  /**
10
10
  * Whether to show comparison data
11
11
  */
@@ -41,13 +41,9 @@ interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, '
41
41
  '--a8c--charts--leaderboard--bar--border-radius'?: string;
42
42
  };
43
43
  /**
44
- * Width of legend shapes in pixels
44
+ * Styles for legend shapes (width, height, margin).
45
45
  */
46
- legendShapeWidth?: number;
47
- /**
48
- * Height of legend shapes in pixels
49
- */
50
- legendShapeHeight?: number;
46
+ legendShapeStyles?: LegendShapeStyles;
51
47
  /**
52
48
  * Custom labels for legend items
53
49
  */
@@ -2,10 +2,10 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
2
2
  import { R as ResponsiveConfig } from './with-responsive-CNfhzAUu.cjs';
3
3
  import * as react from 'react';
4
4
  import { ReactNode, FC } from 'react';
5
- import { a as BaseLegendProps, B as BaseLegendItem } from './types-C05PdDJa.cjs';
6
- import { B as BaseChartProps, L as LeaderboardEntry } from './types-CzdN7rUe.cjs';
5
+ import { b as LegendShapeStyles, c as BaseLegendProps, B as BaseLegendItem } from './types-I67mddpr.cjs';
6
+ import { B as BaseChartProps, L as LeaderboardEntry } from './types-DZordNiO.cjs';
7
7
 
8
- interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | 'data' | 'showLegend' | 'legendOrientation' | 'legendPosition' | 'legendAlignment' | 'legendShape' | 'chartId' | 'width' | 'height' | 'size' | 'legendInteractive' | 'animation'> {
8
+ interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | 'data' | 'showLegend' | 'legendOrientation' | 'legendPosition' | 'legendAlignment' | 'legendShape' | 'chartId' | 'width' | 'height' | 'size' | 'gap' | 'legendInteractive' | 'animation'> {
9
9
  /**
10
10
  * Whether to show comparison data
11
11
  */
@@ -41,13 +41,9 @@ interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, '
41
41
  '--a8c--charts--leaderboard--bar--border-radius'?: string;
42
42
  };
43
43
  /**
44
- * Width of legend shapes in pixels
44
+ * Styles for legend shapes (width, height, margin).
45
45
  */
46
- legendShapeWidth?: number;
47
- /**
48
- * Height of legend shapes in pixels
49
- */
50
- legendShapeHeight?: number;
46
+ legendShapeStyles?: LegendShapeStyles;
51
47
  /**
52
48
  * Custom labels for legend items
53
49
  */
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { a as BaseLegendProps, B as BaseLegendItem } from './types-C05PdDJa.cjs';
2
+ import { c as BaseLegendProps, B as BaseLegendItem } from './types-I67mddpr.cjs';
3
3
 
4
4
  declare const Legend: react.ForwardRefExoticComponent<Omit<BaseLegendProps, "items"> & {
5
5
  items?: BaseLegendItem[];
@@ -1,5 +1,5 @@
1
1
  import * as react from 'react';
2
- import { a as BaseLegendProps, B as BaseLegendItem } from './types-C05PdDJa.js';
2
+ import { c as BaseLegendProps, B as BaseLegendItem } from './types-I67mddpr.js';
3
3
 
4
4
  declare const Legend: react.ForwardRefExoticComponent<Omit<BaseLegendProps, "items"> & {
5
5
  items?: BaseLegendItem[];
@@ -6,8 +6,8 @@
6
6
 
7
7
 
8
8
 
9
- var _chunkYDVHT7GScjs = require('../chunk-YDVHT7GS.cjs');
10
- require('../chunk-ZVGEDXDP.cjs');
9
+ var _chunkRHHVEJHJcjs = require('../chunk-RHHVEJHJ.cjs');
10
+ require('../chunk-VTS3PNMS.cjs');
11
11
  require('../chunk-EMMSS5I5.cjs');
12
12
 
13
13
 
@@ -17,5 +17,5 @@ require('../chunk-EMMSS5I5.cjs');
17
17
 
18
18
 
19
19
 
20
- exports.GlobalChartsContext = _chunkYDVHT7GScjs.GlobalChartsContext; exports.GlobalChartsProvider = _chunkYDVHT7GScjs.GlobalChartsProvider; exports.defaultTheme = _chunkYDVHT7GScjs.defaultTheme; exports.useChartId = _chunkYDVHT7GScjs.useChartId; exports.useChartRegistration = _chunkYDVHT7GScjs.useChartRegistration; exports.useGlobalChartsContext = _chunkYDVHT7GScjs.useGlobalChartsContext; exports.useGlobalChartsTheme = _chunkYDVHT7GScjs.useGlobalChartsTheme;
20
+ exports.GlobalChartsContext = _chunkRHHVEJHJcjs.GlobalChartsContext; exports.GlobalChartsProvider = _chunkRHHVEJHJcjs.GlobalChartsProvider; exports.defaultTheme = _chunkRHHVEJHJcjs.defaultTheme; exports.useChartId = _chunkRHHVEJHJcjs.useChartId; exports.useChartRegistration = _chunkRHHVEJHJcjs.useChartRegistration; exports.useGlobalChartsContext = _chunkRHHVEJHJcjs.useGlobalChartsContext; exports.useGlobalChartsTheme = _chunkRHHVEJHJcjs.useGlobalChartsTheme;
21
21
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
- export { C as ChartRegistration, E as ElementStyles, c as GetElementStylesParams, G as GlobalChartsContext, e as GlobalChartsContextValue, a as GlobalChartsProvider, d as defaultTheme, u as useGlobalChartsContext, b as useGlobalChartsTheme } from '../themes-CVR5rmIs.cjs';
2
- import { B as BaseLegendItem } from '../types-C05PdDJa.cjs';
1
+ export { C as ChartRegistration, E as ElementStyles, c as GetElementStylesParams, G as GlobalChartsContext, e as GlobalChartsContextValue, a as GlobalChartsProvider, d as defaultTheme, u as useGlobalChartsContext, b as useGlobalChartsTheme } from '../themes-CyjKm-P_.cjs';
2
+ import { B as BaseLegendItem } from '../types-I67mddpr.cjs';
3
3
  import 'react';
4
- import '../types-CzdN7rUe.cjs';
4
+ import '../types-DZordNiO.cjs';
5
5
  import '@visx/annotation/lib/components/CircleSubject';
6
6
  import '@visx/annotation/lib/components/Connector';
7
7
  import '@visx/annotation/lib/components/Label';
@@ -1,7 +1,7 @@
1
- export { C as ChartRegistration, E as ElementStyles, c as GetElementStylesParams, G as GlobalChartsContext, e as GlobalChartsContextValue, a as GlobalChartsProvider, d as defaultTheme, u as useGlobalChartsContext, b as useGlobalChartsTheme } from '../themes-DQzmaSze.js';
2
- import { B as BaseLegendItem } from '../types-C05PdDJa.js';
1
+ export { C as ChartRegistration, E as ElementStyles, c as GetElementStylesParams, G as GlobalChartsContext, e as GlobalChartsContextValue, a as GlobalChartsProvider, d as defaultTheme, u as useGlobalChartsContext, b as useGlobalChartsTheme } from '../themes-BmVGrYnF.js';
2
+ import { B as BaseLegendItem } from '../types-I67mddpr.js';
3
3
  import 'react';
4
- import '../types-CzdN7rUe.js';
4
+ import '../types-DZordNiO.js';
5
5
  import '@visx/annotation/lib/components/CircleSubject';
6
6
  import '@visx/annotation/lib/components/Connector';
7
7
  import '@visx/annotation/lib/components/Label';
@@ -6,8 +6,8 @@ import {
6
6
  useChartRegistration,
7
7
  useGlobalChartsContext,
8
8
  useGlobalChartsTheme
9
- } from "../chunk-RFSHE3HL.js";
10
- import "../chunk-TE63Y5PX.js";
9
+ } from "../chunk-32DH6JDF.js";
10
+ import "../chunk-DAU3HNEG.js";
11
11
  import "../chunk-G3PMV62Z.js";
12
12
  export {
13
13
  GlobalChartsContext,
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, CSSProperties, FC } from 'react';
3
- import { b as CompleteChartTheme, j as SeriesData, d as DataPointPercentage, C as ChartTheme } from './types-CzdN7rUe.js';
4
- import { B as BaseLegendItem } from './types-C05PdDJa.js';
3
+ import { b as CompleteChartTheme, j as SeriesData, d as DataPointPercentage, C as ChartTheme } from './types-DZordNiO.js';
4
+ import { B as BaseLegendItem } from './types-I67mddpr.js';
5
5
  import { LegendShape } from '@visx/legend/lib/types';
6
6
  import { LineStyles, GlyphProps } from '@visx/xychart';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, CSSProperties, FC } from 'react';
3
- import { b as CompleteChartTheme, j as SeriesData, d as DataPointPercentage, C as ChartTheme } from './types-CzdN7rUe.cjs';
4
- import { B as BaseLegendItem } from './types-C05PdDJa.cjs';
3
+ import { b as CompleteChartTheme, j as SeriesData, d as DataPointPercentage, C as ChartTheme } from './types-DZordNiO.cjs';
4
+ import { B as BaseLegendItem } from './types-I67mddpr.cjs';
5
5
  import { LegendShape } from '@visx/legend/lib/types';
6
6
  import { LineStyles, GlyphProps } from '@visx/xychart';
7
7
 
@@ -1,4 +1,4 @@
1
- import { L as Legend } from './legend-jjMmhSg3.js';
1
+ import { L as Legend } from './legend-Cj0xM5dU.js';
2
2
  import { ComponentType, FC, PropsWithChildren } from 'react';
3
3
 
4
4
  /**
@@ -192,14 +192,17 @@ type ChartTheme = {
192
192
  xAxisLineStyles?: LineStyles;
193
193
  /** Styles for series lines */
194
194
  seriesLineStyles?: LineStyles[];
195
- /** Styles for legend shapes */
196
- legendShapeStyles?: Record<string, unknown>[];
197
195
  /** Array of render functions for glyphs */
198
196
  glyphs?: Array<(<Datum extends object>(props: GlyphProps<Datum>) => ReactNode)>;
199
- /** Styles for legend labels */
200
- legendLabelStyles?: CSSProperties;
201
- /** Styles for legend container */
202
- legendContainerStyles?: CSSProperties;
197
+ /** Legend specific settings */
198
+ legend?: {
199
+ /** Styles for legend shapes */
200
+ shapeStyles?: Record<string, unknown>[];
201
+ /** Styles for legend labels */
202
+ labelStyles?: CSSProperties;
203
+ /** Styles for legend container */
204
+ containerStyles?: CSSProperties;
205
+ };
203
206
  /** Styles for small SVG text (eg. axis tick labels), passed through to the XYChart theme. */
204
207
  svgLabelSmall?: TextProps;
205
208
  annotationStyles?: AnnotationStyles;
@@ -260,6 +263,7 @@ type CompleteChartTheme = Required<ChartTheme> & {
260
263
  lineChart: {
261
264
  lineStyles: Record<NonNullable<SeriesDataOptions['type']>, LineStyles>;
262
265
  };
266
+ legend: Required<NonNullable<ChartTheme['legend']>>;
263
267
  sparkline: Required<NonNullable<ChartTheme['sparkline']>> & {
264
268
  margin: Required<NonNullable<ChartTheme['sparkline']>['margin']>;
265
269
  };
@@ -416,7 +420,7 @@ type BaseChartProps<T = DataPoint | DataPointDate | LeaderboardEntry> = {
416
420
  legendItemClassName?: string;
417
421
  /**
418
422
  * Enable interactive legend items that can toggle series visibility.
419
- * Supported for LineChart, PieChart, and PieSemiCircleChart.
423
+ * Supported for all chart types that render series.
420
424
  * Requires chartId and GlobalChartsProvider.
421
425
  * For pie charts, percentages are recalculated so visible segments total 100%.
422
426
  */
@@ -192,14 +192,17 @@ type ChartTheme = {
192
192
  xAxisLineStyles?: LineStyles;
193
193
  /** Styles for series lines */
194
194
  seriesLineStyles?: LineStyles[];
195
- /** Styles for legend shapes */
196
- legendShapeStyles?: Record<string, unknown>[];
197
195
  /** Array of render functions for glyphs */
198
196
  glyphs?: Array<(<Datum extends object>(props: GlyphProps<Datum>) => ReactNode)>;
199
- /** Styles for legend labels */
200
- legendLabelStyles?: CSSProperties;
201
- /** Styles for legend container */
202
- legendContainerStyles?: CSSProperties;
197
+ /** Legend specific settings */
198
+ legend?: {
199
+ /** Styles for legend shapes */
200
+ shapeStyles?: Record<string, unknown>[];
201
+ /** Styles for legend labels */
202
+ labelStyles?: CSSProperties;
203
+ /** Styles for legend container */
204
+ containerStyles?: CSSProperties;
205
+ };
203
206
  /** Styles for small SVG text (eg. axis tick labels), passed through to the XYChart theme. */
204
207
  svgLabelSmall?: TextProps;
205
208
  annotationStyles?: AnnotationStyles;
@@ -260,6 +263,7 @@ type CompleteChartTheme = Required<ChartTheme> & {
260
263
  lineChart: {
261
264
  lineStyles: Record<NonNullable<SeriesDataOptions['type']>, LineStyles>;
262
265
  };
266
+ legend: Required<NonNullable<ChartTheme['legend']>>;
263
267
  sparkline: Required<NonNullable<ChartTheme['sparkline']>> & {
264
268
  margin: Required<NonNullable<ChartTheme['sparkline']>['margin']>;
265
269
  };
@@ -416,7 +420,7 @@ type BaseChartProps<T = DataPoint | DataPointDate | LeaderboardEntry> = {
416
420
  legendItemClassName?: string;
417
421
  /**
418
422
  * Enable interactive legend items that can toggle series visibility.
419
- * Supported for LineChart, PieChart, and PieSemiCircleChart.
423
+ * Supported for all chart types that render series.
420
424
  * Requires chartId and GlobalChartsProvider.
421
425
  * For pie charts, percentages are recalculated so visible segments total 100%.
422
426
  */
@@ -0,0 +1,78 @@
1
+ import { LegendOrdinal } from '@visx/legend';
2
+ import { GlyphProps, LineStyles } from '@visx/xychart';
3
+ import { ComponentProps, ReactNode, CSSProperties } from 'react';
4
+
5
+ type VisxLegendProps = Pick<ComponentProps<typeof LegendOrdinal>, 'className' | 'shape' | 'fill' | 'size' | 'labelFormat' | 'labelTransform'>;
6
+ type LegendItemStyles = {
7
+ /** Margin around each legend item. */
8
+ margin?: CSSProperties['margin'];
9
+ /** Flex direction for items within each legend entry. */
10
+ flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
11
+ };
12
+ type LegendLabelStyles = Pick<CSSProperties, 'justifyContent' | 'flex' | 'margin'> & {
13
+ /**
14
+ * Maximum width for legend label text as a CSS value (e.g. '200px', '50%', '10rem').
15
+ * When set, text overflow behavior is controlled by textOverflow.
16
+ */
17
+ maxWidth?: string;
18
+ /**
19
+ * Controls how text behaves when it exceeds maxWidth.
20
+ * - 'ellipsis': Truncate with ellipsis (ideal for widgets/small devices)
21
+ * - 'wrap': Wrap text to multiple lines (default, ideal for larger displays)
22
+ */
23
+ textOverflow?: 'ellipsis' | 'wrap';
24
+ };
25
+ type LegendShapeStyles = {
26
+ /** Width of the legend shape in pixels. */
27
+ width?: number;
28
+ /** Height of the legend shape in pixels. */
29
+ height?: number;
30
+ /** Margin around the legend shape. */
31
+ margin?: CSSProperties['margin'];
32
+ };
33
+ type BaseLegendProps = VisxLegendProps & {
34
+ items: BaseLegendItem[];
35
+ orientation?: 'horizontal' | 'vertical';
36
+ /**
37
+ * TODO: Add 'left' | 'right' positioning support in future implementation
38
+ */
39
+ position?: 'top' | 'bottom';
40
+ alignment?: 'start' | 'center' | 'end';
41
+ /** Additional CSS class name for legend items. */
42
+ itemClassName?: string;
43
+ /** CSS styles for each legend item (margin, flexDirection). */
44
+ itemStyles?: LegendItemStyles;
45
+ /** Additional CSS class name for legend labels. */
46
+ labelClassName?: string;
47
+ /** CSS styles for legend labels (justifyContent, flex, margin). */
48
+ labelStyles?: LegendLabelStyles;
49
+ /** Styles for legend shapes (width, height, margin). */
50
+ shapeStyles?: LegendShapeStyles;
51
+ /**
52
+ * Function for rendering a custom legend layout.
53
+ */
54
+ render?: (items: BaseLegendItem[]) => ReactNode;
55
+ /**
56
+ * Enable interactive legend items that can toggle series visibility.
57
+ * Requires GlobalChartsProvider and chartId to be set.
58
+ */
59
+ interactive?: boolean;
60
+ /**
61
+ * Chart ID for series visibility tracking when interactive mode is enabled.
62
+ */
63
+ chartId?: string;
64
+ };
65
+ type LegendProps = Omit<BaseLegendProps, 'items'> & {
66
+ items?: BaseLegendItem[];
67
+ chartId?: string;
68
+ };
69
+ type BaseLegendItem = {
70
+ label: string;
71
+ value?: number | string;
72
+ color: string;
73
+ glyphSize?: number;
74
+ renderGlyph?: <Datum extends object>(props: GlyphProps<Datum>) => ReactNode;
75
+ shapeStyle?: CSSProperties & LineStyles;
76
+ };
77
+
78
+ export type { BaseLegendItem as B, LegendItemStyles as L, LegendLabelStyles as a, LegendShapeStyles as b, BaseLegendProps as c, LegendProps as d };
@@ -0,0 +1,78 @@
1
+ import { LegendOrdinal } from '@visx/legend';
2
+ import { GlyphProps, LineStyles } from '@visx/xychart';
3
+ import { ComponentProps, ReactNode, CSSProperties } from 'react';
4
+
5
+ type VisxLegendProps = Pick<ComponentProps<typeof LegendOrdinal>, 'className' | 'shape' | 'fill' | 'size' | 'labelFormat' | 'labelTransform'>;
6
+ type LegendItemStyles = {
7
+ /** Margin around each legend item. */
8
+ margin?: CSSProperties['margin'];
9
+ /** Flex direction for items within each legend entry. */
10
+ flexDirection?: 'row' | 'row-reverse' | 'column' | 'column-reverse';
11
+ };
12
+ type LegendLabelStyles = Pick<CSSProperties, 'justifyContent' | 'flex' | 'margin'> & {
13
+ /**
14
+ * Maximum width for legend label text as a CSS value (e.g. '200px', '50%', '10rem').
15
+ * When set, text overflow behavior is controlled by textOverflow.
16
+ */
17
+ maxWidth?: string;
18
+ /**
19
+ * Controls how text behaves when it exceeds maxWidth.
20
+ * - 'ellipsis': Truncate with ellipsis (ideal for widgets/small devices)
21
+ * - 'wrap': Wrap text to multiple lines (default, ideal for larger displays)
22
+ */
23
+ textOverflow?: 'ellipsis' | 'wrap';
24
+ };
25
+ type LegendShapeStyles = {
26
+ /** Width of the legend shape in pixels. */
27
+ width?: number;
28
+ /** Height of the legend shape in pixels. */
29
+ height?: number;
30
+ /** Margin around the legend shape. */
31
+ margin?: CSSProperties['margin'];
32
+ };
33
+ type BaseLegendProps = VisxLegendProps & {
34
+ items: BaseLegendItem[];
35
+ orientation?: 'horizontal' | 'vertical';
36
+ /**
37
+ * TODO: Add 'left' | 'right' positioning support in future implementation
38
+ */
39
+ position?: 'top' | 'bottom';
40
+ alignment?: 'start' | 'center' | 'end';
41
+ /** Additional CSS class name for legend items. */
42
+ itemClassName?: string;
43
+ /** CSS styles for each legend item (margin, flexDirection). */
44
+ itemStyles?: LegendItemStyles;
45
+ /** Additional CSS class name for legend labels. */
46
+ labelClassName?: string;
47
+ /** CSS styles for legend labels (justifyContent, flex, margin). */
48
+ labelStyles?: LegendLabelStyles;
49
+ /** Styles for legend shapes (width, height, margin). */
50
+ shapeStyles?: LegendShapeStyles;
51
+ /**
52
+ * Function for rendering a custom legend layout.
53
+ */
54
+ render?: (items: BaseLegendItem[]) => ReactNode;
55
+ /**
56
+ * Enable interactive legend items that can toggle series visibility.
57
+ * Requires GlobalChartsProvider and chartId to be set.
58
+ */
59
+ interactive?: boolean;
60
+ /**
61
+ * Chart ID for series visibility tracking when interactive mode is enabled.
62
+ */
63
+ chartId?: string;
64
+ };
65
+ type LegendProps = Omit<BaseLegendProps, 'items'> & {
66
+ items?: BaseLegendItem[];
67
+ chartId?: string;
68
+ };
69
+ type BaseLegendItem = {
70
+ label: string;
71
+ value?: number | string;
72
+ color: string;
73
+ glyphSize?: number;
74
+ renderGlyph?: <Datum extends object>(props: GlyphProps<Datum>) => ReactNode;
75
+ shapeStyle?: CSSProperties & LineStyles;
76
+ };
77
+
78
+ export type { BaseLegendItem as B, LegendItemStyles as L, LegendLabelStyles as a, LegendShapeStyles as b, BaseLegendProps as c, LegendProps as d };
@@ -1,4 +1,4 @@
1
- import { L as Legend } from './legend-C9ahiwOt.cjs';
1
+ import { L as Legend } from './legend-C2grwnWk.cjs';
2
2
  import { ComponentType, FC, PropsWithChildren } from 'react';
3
3
 
4
4
  /**
@@ -18,7 +18,7 @@
18
18
 
19
19
 
20
20
 
21
- var _chunkZVGEDXDPcjs = require('../chunk-ZVGEDXDP.cjs');
21
+ var _chunkVTS3PNMScjs = require('../chunk-VTS3PNMS.cjs');
22
22
  require('../chunk-EMMSS5I5.cjs');
23
23
 
24
24
 
@@ -40,5 +40,5 @@ require('../chunk-EMMSS5I5.cjs');
40
40
 
41
41
 
42
42
 
43
- exports.attachSubComponents = _chunkZVGEDXDPcjs.attachSubComponents; exports.formatMetricValue = _chunkZVGEDXDPcjs.formatMetricValue; exports.formatPercentage = _chunkZVGEDXDPcjs.formatPercentage; exports.getColorDistance = _chunkZVGEDXDPcjs.getColorDistance; exports.getItemShapeStyles = _chunkZVGEDXDPcjs.getItemShapeStyles; exports.getLongestTickWidth = _chunkZVGEDXDPcjs.getLongestTickWidth; exports.getSeriesLineStyles = _chunkZVGEDXDPcjs.getSeriesLineStyles; exports.getSeriesStroke = _chunkZVGEDXDPcjs.getSeriesStroke; exports.hexToRgba = _chunkZVGEDXDPcjs.hexToRgba; exports.isSafari = _chunkZVGEDXDPcjs.isSafari; exports.isValidHexColor = _chunkZVGEDXDPcjs.isValidHexColor; exports.lightenHexColor = _chunkZVGEDXDPcjs.lightenHexColor; exports.mergeThemes = _chunkZVGEDXDPcjs.mergeThemes; exports.normalizeColorToHex = _chunkZVGEDXDPcjs.normalizeColorToHex; exports.parseAsLocalDate = _chunkZVGEDXDPcjs.parseAsLocalDate; exports.parseHslString = _chunkZVGEDXDPcjs.parseHslString; exports.parseRgbString = _chunkZVGEDXDPcjs.parseRgbString; exports.resolveCssVariable = _chunkZVGEDXDPcjs.resolveCssVariable; exports.validateHexColor = _chunkZVGEDXDPcjs.validateHexColor;
43
+ exports.attachSubComponents = _chunkVTS3PNMScjs.attachSubComponents; exports.formatMetricValue = _chunkVTS3PNMScjs.formatMetricValue; exports.formatPercentage = _chunkVTS3PNMScjs.formatPercentage; exports.getColorDistance = _chunkVTS3PNMScjs.getColorDistance; exports.getItemShapeStyles = _chunkVTS3PNMScjs.getItemShapeStyles; exports.getLongestTickWidth = _chunkVTS3PNMScjs.getLongestTickWidth; exports.getSeriesLineStyles = _chunkVTS3PNMScjs.getSeriesLineStyles; exports.getSeriesStroke = _chunkVTS3PNMScjs.getSeriesStroke; exports.hexToRgba = _chunkVTS3PNMScjs.hexToRgba; exports.isSafari = _chunkVTS3PNMScjs.isSafari; exports.isValidHexColor = _chunkVTS3PNMScjs.isValidHexColor; exports.lightenHexColor = _chunkVTS3PNMScjs.lightenHexColor; exports.mergeThemes = _chunkVTS3PNMScjs.mergeThemes; exports.normalizeColorToHex = _chunkVTS3PNMScjs.normalizeColorToHex; exports.parseAsLocalDate = _chunkVTS3PNMScjs.parseAsLocalDate; exports.parseHslString = _chunkVTS3PNMScjs.parseHslString; exports.parseRgbString = _chunkVTS3PNMScjs.parseRgbString; exports.resolveCssVariable = _chunkVTS3PNMScjs.resolveCssVariable; exports.validateHexColor = _chunkVTS3PNMScjs.validateHexColor;
44
44
  //# sourceMappingURL=index.cjs.map
@@ -1,7 +1,7 @@
1
1
  export { M as MetricValueType, f as formatMetricValue } from '../format-metric-value-MXm5DtQ_.cjs';
2
2
  import { TickFormatter } from '@visx/axis';
3
3
  import { AnyD3Scale, ScaleInput } from '@visx/scale';
4
- import { j as SeriesData, C as ChartTheme, b as CompleteChartTheme } from '../types-CzdN7rUe.cjs';
4
+ import { j as SeriesData, C as ChartTheme, b as CompleteChartTheme } from '../types-DZordNiO.cjs';
5
5
  import { LegendShape } from '@visx/legend/lib/types';
6
6
  import { LineStyles } from '@visx/xychart';
7
7
  import '@visx/annotation/lib/components/CircleSubject';
@@ -1,7 +1,7 @@
1
1
  export { M as MetricValueType, f as formatMetricValue } from '../format-metric-value-MXm5DtQ_.js';
2
2
  import { TickFormatter } from '@visx/axis';
3
3
  import { AnyD3Scale, ScaleInput } from '@visx/scale';
4
- import { j as SeriesData, C as ChartTheme, b as CompleteChartTheme } from '../types-CzdN7rUe.js';
4
+ import { j as SeriesData, C as ChartTheme, b as CompleteChartTheme } from '../types-DZordNiO.js';
5
5
  import { LegendShape } from '@visx/legend/lib/types';
6
6
  import { LineStyles } from '@visx/xychart';
7
7
  import '@visx/annotation/lib/components/CircleSubject';
@@ -18,7 +18,7 @@ import {
18
18
  parseRgbString,
19
19
  resolveCssVariable,
20
20
  validateHexColor
21
- } from "../chunk-TE63Y5PX.js";
21
+ } from "../chunk-DAU3HNEG.js";
22
22
  import "../chunk-G3PMV62Z.js";
23
23
  export {
24
24
  attachSubComponents,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/charts",
3
- "version": "0.56.7",
3
+ "version": "0.57.0",
4
4
  "description": "Display charts within Automattic products.",
5
5
  "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/charts/#readme",
6
6
  "bugs": {
@@ -177,10 +177,10 @@
177
177
  "storybook": "cd ../storybook && pnpm run storybook:dev",
178
178
  "test": "TZ=UTC jest --config=tests/jest.config.cjs",
179
179
  "test-coverage": "pnpm run test --coverage",
180
- "typecheck": "tsc --noEmit"
180
+ "typecheck": "tsgo --noEmit"
181
181
  },
182
182
  "dependencies": {
183
- "@automattic/number-formatters": "^1.1.0",
183
+ "@automattic/number-formatters": "^1.1.1",
184
184
  "@babel/runtime": "7.28.6",
185
185
  "@react-spring/web": "9.7.5",
186
186
  "@visx/annotation": "^3.12.0",
@@ -224,6 +224,7 @@
224
224
  "@types/jest": "^30.0.0",
225
225
  "@types/react": "18.3.28",
226
226
  "@types/react-dom": "18.3.7",
227
+ "@typescript/native-preview": "7.0.0-dev.20260225.1",
227
228
  "@visx/glyph": "3.12.0",
228
229
  "@wordpress/components": "32.2.0",
229
230
  "@wordpress/element": "6.40.0",
@@ -232,13 +233,14 @@
232
233
  "esbuild": "0.25.9",
233
234
  "esbuild-plugin-babel": "^0.2.3",
234
235
  "esbuild-sass-plugin": "^3.1.0",
236
+ "identity-obj-proxy": "^3.0.0",
235
237
  "jest": "30.2.0",
236
238
  "jest-extended": "7.0.0",
237
239
  "postcss": "8.5.6",
238
240
  "postcss-modules": "6.0.1",
239
241
  "react": "18.3.1",
240
242
  "react-dom": "18.3.1",
241
- "sass-embedded": "1.97.2",
243
+ "sass-embedded": "1.97.3",
242
244
  "storybook": "10.2.11",
243
245
  "tsup": "8.5.1",
244
246
  "typescript": "5.9.3"
@@ -110,8 +110,10 @@ const BarChartInternal: FC< BarChartProps > = ( {
110
110
  const dataSorted = useChartDataTransform( data );
111
111
 
112
112
  // Transform data to add a small value for zero bars to make them visible
113
+ // For vertical bars, height determines bar pixel height; for horizontal bars, width does
113
114
  const dataWithVisibleZeros = useZeroValueDisplay( dataSorted, {
114
115
  enabled: showZeroValues,
116
+ valueAxisLength: horizontal ? width : height,
115
117
  } );
116
118
 
117
119
  // Create legend items using the reusable hook
@@ -330,9 +332,8 @@ const BarChartInternal: FC< BarChartProps > = ( {
330
332
  orientation={ legendOrientation }
331
333
  position={ legendPosition }
332
334
  alignment={ legendAlignment }
333
- maxWidth={ legendMaxWidth }
334
- textOverflow={ legendTextOverflow }
335
- legendItemClassName={ legendItemClassName }
335
+ labelStyles={ { maxWidth: legendMaxWidth, textOverflow: legendTextOverflow } }
336
+ itemClassName={ legendItemClassName }
336
337
  className={ styles[ 'bar-chart__legend' ] }
337
338
  shape={ legendShape }
338
339
  chartId={ chartId }