@automattic/charts 0.50.2 → 0.52.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 (261) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/charts/bar-chart/index.cjs +15 -0
  3. package/dist/charts/bar-chart/index.cjs.map +1 -0
  4. package/dist/{components/bar-list-chart → charts/bar-chart}/index.css +11 -11
  5. package/dist/charts/bar-chart/index.css.map +1 -0
  6. package/dist/{components → charts}/bar-chart/index.d.cts +1 -1
  7. package/dist/{components → charts}/bar-chart/index.d.ts +1 -1
  8. package/dist/{components → charts}/bar-chart/index.js +4 -4
  9. package/dist/charts/bar-list-chart/index.cjs +16 -0
  10. package/dist/charts/bar-list-chart/index.cjs.map +1 -0
  11. package/dist/{components/bar-chart → charts/bar-list-chart}/index.css +11 -11
  12. package/dist/charts/bar-list-chart/index.css.map +1 -0
  13. package/dist/{components → charts}/bar-list-chart/index.d.cts +1 -1
  14. package/dist/{components → charts}/bar-list-chart/index.d.ts +1 -1
  15. package/dist/{components → charts}/bar-list-chart/index.js +5 -5
  16. package/dist/charts/conversion-funnel-chart/index.cjs +10 -0
  17. package/dist/charts/conversion-funnel-chart/index.cjs.map +1 -0
  18. package/dist/{components → charts}/conversion-funnel-chart/index.css +23 -23
  19. package/dist/charts/conversion-funnel-chart/index.css.map +1 -0
  20. package/dist/{components → charts}/conversion-funnel-chart/index.d.cts +1 -1
  21. package/dist/{components → charts}/conversion-funnel-chart/index.d.ts +1 -1
  22. package/dist/{components → charts}/conversion-funnel-chart/index.js +2 -2
  23. package/dist/charts/leaderboard-chart/index.cjs +20 -0
  24. package/dist/charts/leaderboard-chart/index.cjs.map +1 -0
  25. package/dist/{components → charts}/leaderboard-chart/index.css +16 -16
  26. package/dist/charts/leaderboard-chart/index.css.map +1 -0
  27. package/dist/{components → charts}/leaderboard-chart/index.d.cts +2 -2
  28. package/dist/{components → charts}/leaderboard-chart/index.d.ts +2 -2
  29. package/dist/{components → charts}/leaderboard-chart/index.js +5 -5
  30. package/dist/charts/line-chart/index.cjs +15 -0
  31. package/dist/charts/line-chart/index.cjs.map +1 -0
  32. package/dist/{components → charts}/line-chart/index.css +21 -21
  33. package/dist/charts/line-chart/index.css.map +1 -0
  34. package/dist/{components → charts}/line-chart/index.d.cts +1 -1
  35. package/dist/{components → charts}/line-chart/index.d.ts +1 -1
  36. package/dist/{components → charts}/line-chart/index.js +4 -4
  37. package/dist/charts/pie-chart/index.cjs +18 -0
  38. package/dist/charts/pie-chart/index.cjs.map +1 -0
  39. package/dist/{components → charts}/pie-chart/index.css +3 -3
  40. package/dist/charts/pie-chart/index.css.map +1 -0
  41. package/dist/{components → charts}/pie-chart/index.d.cts +7 -7
  42. package/dist/{components → charts}/pie-chart/index.d.ts +7 -7
  43. package/dist/{components → charts}/pie-chart/index.js +6 -6
  44. package/dist/charts/pie-semi-circle-chart/index.cjs +17 -0
  45. package/dist/charts/pie-semi-circle-chart/index.cjs.map +1 -0
  46. package/dist/{components → charts}/pie-semi-circle-chart/index.css +5 -5
  47. package/dist/charts/pie-semi-circle-chart/index.css.map +1 -0
  48. package/dist/{components → charts}/pie-semi-circle-chart/index.d.cts +7 -7
  49. package/dist/{components → charts}/pie-semi-circle-chart/index.d.ts +7 -7
  50. package/dist/{components → charts}/pie-semi-circle-chart/index.js +6 -6
  51. package/dist/{chunk-N4ZDNOPY.cjs → chunk-44EBMDFI.cjs} +107 -236
  52. package/dist/chunk-44EBMDFI.cjs.map +1 -0
  53. package/dist/{chunk-XVMWJANV.js → chunk-624IQX64.js} +27 -27
  54. package/dist/chunk-624IQX64.js.map +1 -0
  55. package/dist/{chunk-BZQFCAX7.cjs → chunk-67BAKCI2.cjs} +9 -9
  56. package/dist/chunk-67BAKCI2.cjs.map +1 -0
  57. package/dist/{chunk-3OVXJFQY.js → chunk-A3AEEGKR.js} +2 -2
  58. package/dist/chunk-A3AEEGKR.js.map +1 -0
  59. package/dist/{chunk-6SGGF26Z.js → chunk-AI6GM6HS.js} +40 -37
  60. package/dist/chunk-AI6GM6HS.js.map +1 -0
  61. package/dist/{chunk-EKVFMS3A.cjs → chunk-BMWFTOSR.cjs} +38 -38
  62. package/dist/chunk-BMWFTOSR.cjs.map +1 -0
  63. package/dist/{chunk-D3DZT2EK.js → chunk-CEZGL6YP.js} +4 -4
  64. package/dist/chunk-CEZGL6YP.js.map +1 -0
  65. package/dist/{chunk-EKVLCYHS.js → chunk-DILKZ4MP.js} +5 -5
  66. package/dist/chunk-DILKZ4MP.js.map +1 -0
  67. package/dist/{chunk-VOWX5TBY.js → chunk-E6VKSUGP.js} +16 -16
  68. package/dist/chunk-E6VKSUGP.js.map +1 -0
  69. package/dist/{chunk-7OWIZ5S7.js → chunk-EELV2LG7.js} +4 -4
  70. package/dist/chunk-EELV2LG7.js.map +1 -0
  71. package/dist/{chunk-HA7WACBI.cjs → chunk-GOZNZD3N.cjs} +9 -9
  72. package/dist/chunk-GOZNZD3N.cjs.map +1 -0
  73. package/dist/{chunk-PTEEI2QM.js → chunk-GSG54JGM.js} +19 -19
  74. package/dist/chunk-GSG54JGM.js.map +1 -0
  75. package/dist/{chunk-3Z526IL2.cjs → chunk-HIWNB5PK.cjs} +4 -4
  76. package/dist/chunk-HIWNB5PK.cjs.map +1 -0
  77. package/dist/{chunk-6WQWN5BF.js → chunk-IDTLZ7KT.js} +17 -17
  78. package/dist/chunk-IDTLZ7KT.js.map +1 -0
  79. package/dist/{chunk-6UZHWL6W.cjs → chunk-JSGCFUVQ.cjs} +34 -34
  80. package/dist/chunk-JSGCFUVQ.cjs.map +1 -0
  81. package/dist/{chunk-5NI3TGRD.cjs → chunk-MUUSZ7J5.cjs} +2 -2
  82. package/dist/{chunk-D3E235JJ.js.map → chunk-MUUSZ7J5.cjs.map} +1 -1
  83. package/dist/{chunk-3PRIZR7Y.cjs → chunk-N4NZ4VJK.cjs} +34 -34
  84. package/dist/chunk-N4NZ4VJK.cjs.map +1 -0
  85. package/dist/{chunk-D3E235JJ.js → chunk-NONODB3K.js} +2 -2
  86. package/dist/chunk-NONODB3K.js.map +1 -0
  87. package/dist/{chunk-SDNRKKBP.cjs → chunk-OTZT3MC2.cjs} +2 -2
  88. package/dist/chunk-OTZT3MC2.cjs.map +1 -0
  89. package/dist/{chunk-RUG2O62B.js → chunk-S5UDYA4M.js} +22 -22
  90. package/dist/chunk-S5UDYA4M.js.map +1 -0
  91. package/dist/{chunk-KE4EDAQI.cjs → chunk-UJIP7ICA.cjs} +34 -34
  92. package/dist/chunk-UJIP7ICA.cjs.map +1 -0
  93. package/dist/{chunk-MRCTAUHL.js → chunk-ULRFJ3IU.js} +128 -257
  94. package/dist/chunk-ULRFJ3IU.js.map +1 -0
  95. package/dist/{chunk-SLO4NLKC.cjs → chunk-VEJIPJN7.cjs} +56 -53
  96. package/dist/chunk-VEJIPJN7.cjs.map +1 -0
  97. package/dist/{chunk-PEUZZ3WY.cjs → chunk-ZOCE4WND.cjs} +34 -34
  98. package/dist/chunk-ZOCE4WND.cjs.map +1 -0
  99. package/dist/components/legend/index.cjs +3 -3
  100. package/dist/components/legend/index.d.cts +1 -1
  101. package/dist/components/legend/index.d.ts +1 -1
  102. package/dist/components/legend/index.js +2 -2
  103. package/dist/components/tooltip/index.d.cts +1 -1
  104. package/dist/components/tooltip/index.d.ts +1 -1
  105. package/dist/hooks/index.cjs +2 -2
  106. package/dist/hooks/index.d.cts +1 -1
  107. package/dist/hooks/index.d.ts +1 -1
  108. package/dist/hooks/index.js +1 -1
  109. package/dist/index.cjs +188 -38
  110. package/dist/index.cjs.map +1 -1
  111. package/dist/index.css +96 -79
  112. package/dist/index.css.map +1 -1
  113. package/dist/index.d.cts +111 -12
  114. package/dist/index.d.ts +111 -12
  115. package/dist/index.js +179 -29
  116. package/dist/index.js.map +1 -1
  117. package/dist/{leaderboard-chart-BlBexVz4.d.cts → leaderboard-chart-Bf7z7SoM.d.cts} +1 -1
  118. package/dist/{leaderboard-chart-B3dPiEl8.d.ts → leaderboard-chart-Bh8M5JWL.d.ts} +1 -1
  119. package/dist/providers/index.cjs +2 -6
  120. package/dist/providers/index.cjs.map +1 -1
  121. package/dist/providers/index.d.cts +2 -2
  122. package/dist/providers/index.d.ts +2 -2
  123. package/dist/providers/index.js +3 -7
  124. package/dist/{themes-CNy453Lb.d.ts → themes-09M-mQE6.d.ts} +2 -10
  125. package/dist/{themes-Dv70Dz7B.d.cts → themes-DYhtyXtJ.d.cts} +2 -10
  126. package/dist/{types-4wyyzjot.d.cts → types-BtYG-Fdk.d.cts} +19 -0
  127. package/dist/{types-4wyyzjot.d.ts → types-BtYG-Fdk.d.ts} +19 -0
  128. package/dist/utils/index.d.cts +1 -1
  129. package/dist/utils/index.d.ts +1 -1
  130. package/package.json +38 -30
  131. package/src/{components → charts}/bar-chart/bar-chart.tsx +2 -2
  132. package/src/{components → charts}/conversion-funnel-chart/test/conversion-funnel-chart.test.tsx +0 -1
  133. package/src/charts/index.ts +8 -0
  134. package/src/{components → charts}/leaderboard-chart/hooks/use-leaderboard-legend-items.ts +1 -1
  135. package/src/{components → charts}/leaderboard-chart/leaderboard-chart.tsx +1 -1
  136. package/src/{components → charts}/line-chart/line-chart.tsx +8 -5
  137. package/src/{components → charts}/line-chart/test/line-chart.test.tsx +7 -9
  138. package/src/{components → charts}/pie-chart/pie-chart.tsx +3 -3
  139. package/src/{components → charts}/pie-semi-circle-chart/pie-semi-circle-chart.tsx +3 -3
  140. package/src/{components → charts}/private/chart-composition/types.ts +1 -1
  141. package/src/charts/sparkline/index.ts +2 -0
  142. package/src/charts/sparkline/sparkline.module.scss +18 -0
  143. package/src/charts/sparkline/sparkline.tsx +200 -0
  144. package/src/charts/sparkline/test/sparkline.test.tsx +196 -0
  145. package/src/charts/sparkline/types.ts +92 -0
  146. package/src/components/index.ts +2 -0
  147. package/src/components/legend/legend.tsx +1 -1
  148. package/src/compositions/index.ts +2 -0
  149. package/src/index.ts +12 -14
  150. package/src/providers/chart-context/test/chart-context.test.tsx +0 -35
  151. package/src/providers/chart-context/test/use-global-charts-theme.test.tsx +1 -23
  152. package/src/providers/chart-context/themes.ts +5 -127
  153. package/src/types.ts +19 -0
  154. package/dist/chunk-3OVXJFQY.js.map +0 -1
  155. package/dist/chunk-3PRIZR7Y.cjs.map +0 -1
  156. package/dist/chunk-3Z526IL2.cjs.map +0 -1
  157. package/dist/chunk-5NI3TGRD.cjs.map +0 -1
  158. package/dist/chunk-6SGGF26Z.js.map +0 -1
  159. package/dist/chunk-6UZHWL6W.cjs.map +0 -1
  160. package/dist/chunk-6WQWN5BF.js.map +0 -1
  161. package/dist/chunk-7OWIZ5S7.js.map +0 -1
  162. package/dist/chunk-BZQFCAX7.cjs.map +0 -1
  163. package/dist/chunk-D3DZT2EK.js.map +0 -1
  164. package/dist/chunk-EKVFMS3A.cjs.map +0 -1
  165. package/dist/chunk-EKVLCYHS.js.map +0 -1
  166. package/dist/chunk-HA7WACBI.cjs.map +0 -1
  167. package/dist/chunk-KE4EDAQI.cjs.map +0 -1
  168. package/dist/chunk-MRCTAUHL.js.map +0 -1
  169. package/dist/chunk-N4ZDNOPY.cjs.map +0 -1
  170. package/dist/chunk-PEUZZ3WY.cjs.map +0 -1
  171. package/dist/chunk-PTEEI2QM.js.map +0 -1
  172. package/dist/chunk-RUG2O62B.js.map +0 -1
  173. package/dist/chunk-SDNRKKBP.cjs.map +0 -1
  174. package/dist/chunk-SLO4NLKC.cjs.map +0 -1
  175. package/dist/chunk-VOWX5TBY.js.map +0 -1
  176. package/dist/chunk-XVMWJANV.js.map +0 -1
  177. package/dist/components/bar-chart/index.cjs +0 -15
  178. package/dist/components/bar-chart/index.cjs.map +0 -1
  179. package/dist/components/bar-chart/index.css.map +0 -1
  180. package/dist/components/bar-list-chart/index.cjs +0 -16
  181. package/dist/components/bar-list-chart/index.cjs.map +0 -1
  182. package/dist/components/bar-list-chart/index.css.map +0 -1
  183. package/dist/components/conversion-funnel-chart/index.cjs +0 -10
  184. package/dist/components/conversion-funnel-chart/index.cjs.map +0 -1
  185. package/dist/components/conversion-funnel-chart/index.css.map +0 -1
  186. package/dist/components/leaderboard-chart/index.cjs +0 -20
  187. package/dist/components/leaderboard-chart/index.cjs.map +0 -1
  188. package/dist/components/leaderboard-chart/index.css.map +0 -1
  189. package/dist/components/line-chart/index.cjs +0 -15
  190. package/dist/components/line-chart/index.cjs.map +0 -1
  191. package/dist/components/line-chart/index.css.map +0 -1
  192. package/dist/components/pie-chart/index.cjs +0 -18
  193. package/dist/components/pie-chart/index.cjs.map +0 -1
  194. package/dist/components/pie-chart/index.css.map +0 -1
  195. package/dist/components/pie-semi-circle-chart/index.cjs +0 -17
  196. package/dist/components/pie-semi-circle-chart/index.cjs.map +0 -1
  197. package/dist/components/pie-semi-circle-chart/index.css.map +0 -1
  198. /package/dist/{components → charts}/bar-chart/index.js.map +0 -0
  199. /package/dist/{components → charts}/bar-list-chart/index.js.map +0 -0
  200. /package/dist/{components → charts}/conversion-funnel-chart/index.js.map +0 -0
  201. /package/dist/{components → charts}/leaderboard-chart/index.js.map +0 -0
  202. /package/dist/{components → charts}/line-chart/index.js.map +0 -0
  203. /package/dist/{components → charts}/pie-chart/index.js.map +0 -0
  204. /package/dist/{components → charts}/pie-semi-circle-chart/index.js.map +0 -0
  205. /package/src/{components → charts}/bar-chart/bar-chart.module.scss +0 -0
  206. /package/src/{components → charts}/bar-chart/index.ts +0 -0
  207. /package/src/{components → charts}/bar-chart/private/index.ts +0 -0
  208. /package/src/{components → charts}/bar-chart/private/use-bar-chart-options.ts +0 -0
  209. /package/src/{components → charts}/bar-chart/test/bar-chart.test.tsx +0 -0
  210. /package/src/{components → charts}/bar-list-chart/bar-list-chart.tsx +0 -0
  211. /package/src/{components → charts}/bar-list-chart/index.ts +0 -0
  212. /package/src/{components → charts}/bar-list-chart/test/bar-list-chart.test.tsx +0 -0
  213. /package/src/{components → charts}/conversion-funnel-chart/conversion-funnel-chart.module.scss +0 -0
  214. /package/src/{components → charts}/conversion-funnel-chart/conversion-funnel-chart.tsx +0 -0
  215. /package/src/{components → charts}/conversion-funnel-chart/index.ts +0 -0
  216. /package/src/{components → charts}/conversion-funnel-chart/private/index.ts +0 -0
  217. /package/src/{components → charts}/conversion-funnel-chart/private/use-funnel-selection.ts +0 -0
  218. /package/src/{components → charts}/conversion-funnel-chart/test/use-funnel-selection.test.ts +0 -0
  219. /package/src/{components → charts}/conversion-funnel-chart/types.ts +0 -0
  220. /package/src/{components → charts}/leaderboard-chart/hooks/index.ts +0 -0
  221. /package/src/{components → charts}/leaderboard-chart/index.ts +0 -0
  222. /package/src/{components → charts}/leaderboard-chart/leaderboard-chart.module.scss +0 -0
  223. /package/src/{components → charts}/leaderboard-chart/test/leaderboard-chart.test.tsx +0 -0
  224. /package/src/{components → charts}/leaderboard-chart/test/use-leaderboard-legend-items.test.tsx +0 -0
  225. /package/src/{components → charts}/leaderboard-chart/types.ts +0 -0
  226. /package/src/{components → charts}/line-chart/index.ts +0 -0
  227. /package/src/{components → charts}/line-chart/line-chart.module.scss +0 -0
  228. /package/src/{components → charts}/line-chart/private/index.ts +0 -0
  229. /package/src/{components → charts}/line-chart/private/line-chart-annotation-label-popover.tsx +0 -0
  230. /package/src/{components → charts}/line-chart/private/line-chart-annotation.tsx +0 -0
  231. /package/src/{components → charts}/line-chart/private/line-chart-annotations-overlay.tsx +0 -0
  232. /package/src/{components → charts}/line-chart/private/line-chart-glyph.tsx +0 -0
  233. /package/src/{components → charts}/line-chart/test/line-chart-annotation-label-popover.test.tsx +0 -0
  234. /package/src/{components → charts}/line-chart/test/line-chart-annotation.test.tsx +0 -0
  235. /package/src/{components → charts}/line-chart/types.ts +0 -0
  236. /package/src/{components → charts}/pie-chart/index.ts +0 -0
  237. /package/src/{components → charts}/pie-chart/pie-chart.module.scss +0 -0
  238. /package/src/{components → charts}/pie-chart/test/composition-api.test.tsx +0 -0
  239. /package/src/{components → charts}/pie-chart/test/pie-chart.test.tsx +0 -0
  240. /package/src/{components → charts}/pie-semi-circle-chart/index.ts +0 -0
  241. /package/src/{components → charts}/pie-semi-circle-chart/pie-semi-circle-chart.module.scss +0 -0
  242. /package/src/{components → charts}/pie-semi-circle-chart/test/pie-semi-circle-chart.test.tsx +0 -0
  243. /package/src/{components → charts}/private/chart-composition/chart-html.tsx +0 -0
  244. /package/src/{components → charts}/private/chart-composition/chart-svg.tsx +0 -0
  245. /package/src/{components → charts}/private/chart-composition/index.ts +0 -0
  246. /package/src/{components → charts}/private/chart-composition/test/use-chart-children.test.tsx +0 -0
  247. /package/src/{components → charts}/private/chart-composition/use-chart-children.ts +0 -0
  248. /package/src/{components → charts}/private/default-glyph/default-glyph.tsx +0 -0
  249. /package/src/{components → charts}/private/default-glyph/index.ts +0 -0
  250. /package/src/{components → charts}/private/grid-control/grid-control.module.scss +0 -0
  251. /package/src/{components → charts}/private/grid-control/grid-control.tsx +0 -0
  252. /package/src/{components → charts}/private/grid-control/index.ts +0 -0
  253. /package/src/{components → charts}/private/grid-control/test/grid-control.test.tsx +0 -0
  254. /package/src/{components → charts}/private/radial-wipe-animation/index.ts +0 -0
  255. /package/src/{components → charts}/private/radial-wipe-animation/radial-wipe-animation.tsx +0 -0
  256. /package/src/{components → charts}/private/single-chart-context/index.ts +0 -0
  257. /package/src/{components → charts}/private/single-chart-context/single-chart-context.tsx +0 -0
  258. /package/src/{components → charts}/private/single-chart-context/use-single-chart-context.ts +0 -0
  259. /package/src/{components → charts}/private/with-responsive/index.ts +0 -0
  260. /package/src/{components → charts}/private/with-responsive/test/with-responsive.test.tsx +0 -0
  261. /package/src/{components → charts}/private/with-responsive/with-responsive.tsx +0 -0
package/dist/index.d.ts CHANGED
@@ -1,20 +1,21 @@
1
- export { BarChart, BarChartUnresponsive } from './components/bar-chart/index.js';
2
- export { LineChart, LineChartUnresponsive } from './components/line-chart/index.js';
3
- export { A as AnnotationStyles, B as BaseChartProps, i as ButtonWithPopover, C as ChartTheme, e as CompleteChartTheme, D as DataPoint, b as DataPointDate, d as DataPointPercentage, G as GradientStop, g as GridProps, L as LeaderboardEntry, M as MultipleDataPointsDate, O as Optional, a as OrientationType, P as PopoverButtonAttributes, j as PopoverElement, h as PopoverElementAttributes, f as ScaleOptions, c as SeriesData, S as SeriesDataOptions, T as ToggleEvent } from './types-4wyyzjot.js';
1
+ export { BarChart, BarChartUnresponsive } from './charts/bar-chart/index.js';
2
+ export { LineChart, LineChartUnresponsive } from './charts/line-chart/index.js';
3
+ export { A as AnnotationStyles, B as BaseChartProps, i as ButtonWithPopover, C as ChartTheme, e as CompleteChartTheme, D as DataPoint, b as DataPointDate, d as DataPointPercentage, G as GradientStop, g as GridProps, L as LeaderboardEntry, M as MultipleDataPointsDate, O as Optional, a as OrientationType, P as PopoverButtonAttributes, j as PopoverElement, h as PopoverElementAttributes, f as ScaleOptions, c as SeriesData, S as SeriesDataOptions, T as ToggleEvent } from './types-BtYG-Fdk.js';
4
4
  export { EventHandlerParams, GridStyles, LineStyles } from '@visx/xychart';
5
5
  export { RenderTooltipParams } from '@visx/xychart/lib/components/Tooltip';
6
- export { PieChart, PieChartProps, PieChartUnresponsive } from './components/pie-chart/index.js';
7
- export { PieSemiCircleChart, PieSemiCircleChartUnresponsive } from './components/pie-semi-circle-chart/index.js';
8
- export { BarListChart, BarListChartUnresponsive } from './components/bar-list-chart/index.js';
9
- export { L as LeaderboardChart, a as LeaderboardChartUnresponsive } from './leaderboard-chart-B3dPiEl8.js';
6
+ export { PieChart, PieChartProps, PieChartUnresponsive } from './charts/pie-chart/index.js';
7
+ export { PieSemiCircleChart, PieSemiCircleChartUnresponsive } from './charts/pie-semi-circle-chart/index.js';
8
+ export { BarListChart, BarListChartUnresponsive } from './charts/bar-list-chart/index.js';
9
+ export { L as LeaderboardChart, a as LeaderboardChartUnresponsive } from './leaderboard-chart-Bh8M5JWL.js';
10
10
  export { L as Legend } from './legend-jjMmhSg3.js';
11
11
  export { LegendValueDisplay, useChartLegendItems } from './components/legend/index.js';
12
12
  export { B as BaseLegendItem } from './types-C05PdDJa.js';
13
- export { ConversionFunnelChart } from './components/conversion-funnel-chart/index.js';
13
+ export { ConversionFunnelChart } from './charts/conversion-funnel-chart/index.js';
14
+ import * as react_jsx_runtime from 'react/jsx-runtime';
15
+ import { R as ResponsiveConfig } from './with-responsive-Cp2qnQPo.js';
16
+ import * as react from 'react';
14
17
  export { B as BaseTooltip } from './base-tooltip-DOq93wjU.js';
15
- export { b as GlobalChartsContext, G as GlobalChartsProvider, G as ThemeProvider, d as defaultTheme, j as jetpackTheme, u as useGlobalChartsContext, a as useGlobalChartsTheme, w as wooTheme } from './themes-CNy453Lb.js';
16
- import 'react';
17
- import './with-responsive-Cp2qnQPo.js';
18
+ export { b as GlobalChartsContext, G as GlobalChartsProvider, G as ThemeProvider, d as defaultTheme, u as useGlobalChartsContext, a as useGlobalChartsTheme } from './themes-09M-mQE6.js';
18
19
  import '@visx/annotation/lib/components/CircleSubject';
19
20
  import '@visx/annotation/lib/components/Connector';
20
21
  import '@visx/annotation/lib/components/Label';
@@ -25,6 +26,104 @@ import '@visx/scale';
25
26
  import '@visx/text/lib/Text';
26
27
  import './types-DQNnq5Fr.js';
27
28
  import '@visx/shape/lib/shapes/Pie';
28
- import 'react/jsx-runtime';
29
29
  import '@visx/text';
30
30
  import '@visx/legend';
31
+
32
+ type SparklineDataPoint = number;
33
+ type GradientConfig = {
34
+ /**
35
+ * Start color for gradient (defaults to color prop)
36
+ */
37
+ from?: string;
38
+ /**
39
+ * End color for gradient (defaults to theme backgroundColor)
40
+ */
41
+ to?: string;
42
+ /**
43
+ * Start opacity (0-1)
44
+ * @default 0.5
45
+ */
46
+ fromOpacity?: number;
47
+ /**
48
+ * End opacity (0-1)
49
+ * @default 0.0
50
+ */
51
+ toOpacity?: number;
52
+ };
53
+ interface SparklineProps {
54
+ /**
55
+ * Array of numeric values to plot
56
+ * @example [10, 25, 15, 30, 22, 35]
57
+ */
58
+ data: SparklineDataPoint[];
59
+ /**
60
+ * Width of the sparkline in pixels
61
+ * @default 100
62
+ */
63
+ width?: number;
64
+ /**
65
+ * Height of the sparkline in pixels
66
+ * @default 40
67
+ */
68
+ height?: number;
69
+ /**
70
+ * Size (used by responsive variant, equivalent to width for square charts)
71
+ */
72
+ size?: number;
73
+ /**
74
+ * Color for the line stroke (hex or CSS color)
75
+ * @default Theme color (first color in theme.colors array)
76
+ */
77
+ color?: string;
78
+ /**
79
+ * Line stroke width in pixels
80
+ * @default 1
81
+ */
82
+ strokeWidth?: number;
83
+ /**
84
+ * Whether to render the gradient fill beneath the line
85
+ * @default true
86
+ */
87
+ withGradientFill?: boolean;
88
+ /**
89
+ * Gradient configuration for area fill
90
+ * If not provided, uses color prop with default opacity values
91
+ */
92
+ gradient?: GradientConfig;
93
+ /**
94
+ * Additional CSS class name
95
+ */
96
+ className?: string;
97
+ /**
98
+ * Chart ID for unique gradient/element identification
99
+ */
100
+ chartId?: string;
101
+ /**
102
+ * Margin around the chart
103
+ * @default { top: 2, right: 2, bottom: 2, left: 2 }
104
+ */
105
+ margin?: {
106
+ top?: number;
107
+ right?: number;
108
+ bottom?: number;
109
+ left?: number;
110
+ };
111
+ }
112
+
113
+ /**
114
+ * Sparkline - A minimal line chart for inline data visualization.
115
+ *
116
+ * Sparklines are compact charts designed to be embedded inline with text or
117
+ * displayed in small spaces like table cells or dashboards. They show trends
118
+ * without axes, labels, or other chart chrome.
119
+ *
120
+ * This component is built on top of LineChart with preconfigured settings
121
+ * for minimal display (no axes, grid, tooltips, or legend).
122
+ */
123
+ declare const SparklineUnresponsive: react.ForwardRefExoticComponent<SparklineProps & react.RefAttributes<HTMLDivElement>>;
124
+ /**
125
+ * Responsive Sparkline chart component
126
+ */
127
+ declare const Sparkline: ({ resizeDebounceTime, maxWidth, aspectRatio, ...chartProps }: Pick<Partial<SparklineProps>, "width" | "height" | "size"> & Omit<SparklineProps, "width" | "height" | "size"> & ResponsiveConfig) => react_jsx_runtime.JSX.Element;
128
+
129
+ export { Sparkline, SparklineUnresponsive };
package/dist/index.js CHANGED
@@ -1,52 +1,202 @@
1
- import {
2
- BarListChart,
3
- BarListChartResponsive
4
- } from "./chunk-EKVLCYHS.js";
5
- import {
6
- ConversionFunnelChartWithProvider
7
- } from "./chunk-XVMWJANV.js";
8
- import {
9
- LeaderboardChart,
10
- LeaderboardChartResponsive
11
- } from "./chunk-RUG2O62B.js";
12
1
  import {
13
2
  LineChart,
14
3
  LineChartResponsive
15
- } from "./chunk-6SGGF26Z.js";
4
+ } from "./chunk-AI6GM6HS.js";
16
5
  import {
17
6
  PieChart,
18
7
  PieChartResponsive
19
- } from "./chunk-6WQWN5BF.js";
8
+ } from "./chunk-IDTLZ7KT.js";
20
9
  import {
21
10
  PieSemiCircleChart,
22
11
  PieSemiCircleChartResponsive
23
- } from "./chunk-VOWX5TBY.js";
24
- import "./chunk-3OVXJFQY.js";
25
- import "./chunk-D3DZT2EK.js";
12
+ } from "./chunk-E6VKSUGP.js";
13
+ import "./chunk-A3AEEGKR.js";
26
14
  import "./chunk-NFRB2POF.js";
15
+ import {
16
+ BarListChart,
17
+ BarListChartResponsive
18
+ } from "./chunk-DILKZ4MP.js";
27
19
  import {
28
20
  BarChart,
29
21
  BarChartResponsive
30
- } from "./chunk-PTEEI2QM.js";
31
- import "./chunk-D3E235JJ.js";
32
- import {
33
- Legend,
34
- useChartLegendItems
35
- } from "./chunk-7OWIZ5S7.js";
22
+ } from "./chunk-GSG54JGM.js";
36
23
  import {
37
24
  BaseTooltip
38
25
  } from "./chunk-5XI443YP.js";
26
+ import {
27
+ ConversionFunnelChartWithProvider
28
+ } from "./chunk-624IQX64.js";
29
+ import {
30
+ LeaderboardChart,
31
+ LeaderboardChartResponsive
32
+ } from "./chunk-S5UDYA4M.js";
33
+ import "./chunk-CEZGL6YP.js";
34
+ import {
35
+ withResponsive
36
+ } from "./chunk-NONODB3K.js";
37
+ import {
38
+ Legend,
39
+ useChartLegendItems
40
+ } from "./chunk-EELV2LG7.js";
39
41
  import {
40
42
  GlobalChartsContext,
41
43
  GlobalChartsProvider,
42
44
  defaultTheme,
43
- jetpackTheme,
44
45
  useGlobalChartsContext,
45
- useGlobalChartsTheme,
46
- wooTheme
47
- } from "./chunk-MRCTAUHL.js";
46
+ useGlobalChartsTheme
47
+ } from "./chunk-ULRFJ3IU.js";
48
48
  import "./chunk-7IZD3F7B.js";
49
49
  import "./chunk-G3PMV62Z.js";
50
+
51
+ // src/charts/sparkline/sparkline.tsx
52
+ import clsx from "clsx";
53
+ import { useMemo, forwardRef } from "react";
54
+
55
+ // src/charts/sparkline/sparkline.module.scss
56
+ var sparkline_module_default = {
57
+ "sparkline": "a8ccharts-o-3Z8B",
58
+ "sparkline--empty": "a8ccharts-CbLbcd"
59
+ };
60
+
61
+ // src/charts/sparkline/sparkline.tsx
62
+ import { jsx } from "react/jsx-runtime";
63
+ var DEFAULT_WIDTH = 100;
64
+ var DEFAULT_HEIGHT = 40;
65
+ var transformToSeriesData = (data, color, strokeWidth) => {
66
+ const baseDate = new Date(2e3, 0, 1);
67
+ return [
68
+ {
69
+ label: "sparkline",
70
+ data: data.map((value, index) => ({
71
+ date: new Date(baseDate.getTime() + index * 864e5),
72
+ // Add days
73
+ value
74
+ })),
75
+ options: {
76
+ stroke: color,
77
+ seriesLineStyle: strokeWidth ? { strokeWidth } : void 0
78
+ }
79
+ }
80
+ ];
81
+ };
82
+ var SparklineComponent = forwardRef(
83
+ ({
84
+ data,
85
+ width = DEFAULT_WIDTH,
86
+ height = DEFAULT_HEIGHT,
87
+ color,
88
+ strokeWidth: strokeWidthProp,
89
+ withGradientFill = true,
90
+ gradient,
91
+ className,
92
+ chartId,
93
+ margin: marginProp
94
+ }, ref) => {
95
+ const theme = useGlobalChartsTheme();
96
+ const themeStrokeWidth = theme.sparkline?.strokeWidth ?? 1.5;
97
+ const strokeWidth = strokeWidthProp ?? themeStrokeWidth;
98
+ const seriesData = useMemo(() => {
99
+ if (!data || data.length === 0) {
100
+ return [];
101
+ }
102
+ return transformToSeriesData(data, color, strokeWidth);
103
+ }, [data, color, strokeWidth]);
104
+ const finalMargin = useMemo(() => {
105
+ const themeMargin = theme.sparkline?.margin ?? { top: 2, right: 2, bottom: 2, left: 2 };
106
+ const margin = marginProp ?? themeMargin;
107
+ return {
108
+ ...themeMargin,
109
+ ...margin
110
+ };
111
+ }, [marginProp, theme.sparkline?.margin]);
112
+ const seriesWithGradient = useMemo(() => {
113
+ if (!gradient || seriesData.length === 0) {
114
+ return seriesData;
115
+ }
116
+ return seriesData.map((series) => ({
117
+ ...series,
118
+ options: {
119
+ ...series.options,
120
+ gradient: {
121
+ from: gradient.from || color || "#000000",
122
+ to: gradient.to || "#ffffff",
123
+ fromOpacity: gradient.fromOpacity ?? 0.5,
124
+ toOpacity: gradient.toOpacity ?? 0
125
+ }
126
+ }
127
+ }));
128
+ }, [seriesData, gradient, color]);
129
+ if (!data || data.length === 0) {
130
+ return /* @__PURE__ */ jsx(
131
+ "div",
132
+ {
133
+ ref,
134
+ className: clsx(
135
+ "sparkline",
136
+ sparkline_module_default.sparkline,
137
+ sparkline_module_default["sparkline--empty"],
138
+ className
139
+ ),
140
+ style: { width, height },
141
+ "data-testid": "sparkline-empty"
142
+ }
143
+ );
144
+ }
145
+ if (data.length === 1) {
146
+ const cx = width / 2;
147
+ const cy = height / 2;
148
+ const resolvedColor = color || "#000000";
149
+ return /* @__PURE__ */ jsx(
150
+ "div",
151
+ {
152
+ ref,
153
+ className: clsx(
154
+ "sparkline",
155
+ sparkline_module_default.sparkline,
156
+ sparkline_module_default["sparkline--single-point"],
157
+ className
158
+ ),
159
+ style: { width, height },
160
+ "data-testid": "sparkline-single-point",
161
+ children: /* @__PURE__ */ jsx("svg", { width, height, "aria-hidden": "true", children: /* @__PURE__ */ jsx("circle", { cx, cy, r: strokeWidth * 1.5, fill: resolvedColor }) })
162
+ }
163
+ );
164
+ }
165
+ return /* @__PURE__ */ jsx(
166
+ "div",
167
+ {
168
+ ref,
169
+ className: clsx("sparkline", sparkline_module_default.sparkline, className),
170
+ "data-testid": "sparkline",
171
+ children: /* @__PURE__ */ jsx(
172
+ LineChart,
173
+ {
174
+ data: seriesWithGradient,
175
+ width,
176
+ height,
177
+ margin: finalMargin,
178
+ chartId,
179
+ withGradientFill,
180
+ withTooltips: false,
181
+ showLegend: false,
182
+ gridVisibility: "none",
183
+ options: {
184
+ axis: {
185
+ x: { display: false },
186
+ y: { display: false }
187
+ }
188
+ },
189
+ curveType: "monotone"
190
+ }
191
+ )
192
+ }
193
+ );
194
+ }
195
+ );
196
+ SparklineComponent.displayName = "SparklineComponent";
197
+ var SparklineUnresponsive = SparklineComponent;
198
+ SparklineUnresponsive.displayName = "SparklineUnresponsive";
199
+ var Sparkline = withResponsive(SparklineUnresponsive);
50
200
  export {
51
201
  BarChartResponsive as BarChart,
52
202
  BarChart as BarChartUnresponsive,
@@ -65,12 +215,12 @@ export {
65
215
  PieChart as PieChartUnresponsive,
66
216
  PieSemiCircleChartResponsive as PieSemiCircleChart,
67
217
  PieSemiCircleChart as PieSemiCircleChartUnresponsive,
218
+ Sparkline,
219
+ SparklineUnresponsive,
68
220
  GlobalChartsProvider as ThemeProvider,
69
221
  defaultTheme,
70
- jetpackTheme,
71
222
  useChartLegendItems,
72
223
  useGlobalChartsContext,
73
- useGlobalChartsTheme,
74
- wooTheme
224
+ useGlobalChartsTheme
75
225
  };
76
226
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
1
+ {"version":3,"sources":["../src/charts/sparkline/sparkline.tsx","../src/charts/sparkline/sparkline.module.scss"],"sourcesContent":["import clsx from 'clsx';\nimport { useMemo, forwardRef } from 'react';\nimport { useGlobalChartsTheme } from '../../providers';\nimport { LineChartUnresponsive } from '../line-chart';\nimport { withResponsive } from '../private/with-responsive';\nimport styles from './sparkline.module.scss';\nimport type { SparklineProps } from './types';\nimport type { SeriesData } from '../../types';\n\nconst DEFAULT_WIDTH = 100;\nconst DEFAULT_HEIGHT = 40;\n\n/**\n * Transforms a simple number array into SeriesData format for LineChart.\n * Uses index-based dates to create a linear x-axis.\n *\n * @param data - Array of numeric values to plot\n * @param color - Optional color for the line stroke\n * @param strokeWidth - Optional stroke width for the line\n * @return SeriesData array suitable for LineChart\n */\nconst transformToSeriesData = (\n\tdata: number[],\n\tcolor?: string,\n\tstrokeWidth?: number\n): SeriesData[] => {\n\t// Use a fixed base date and increment by index to create linear spacing\n\tconst baseDate = new Date( 2000, 0, 1 );\n\n\treturn [\n\t\t{\n\t\t\tlabel: 'sparkline',\n\t\t\tdata: data.map( ( value, index ) => ( {\n\t\t\t\tdate: new Date( baseDate.getTime() + index * 86400000 ), // Add days\n\t\t\t\tvalue,\n\t\t\t} ) ),\n\t\t\toptions: {\n\t\t\t\tstroke: color,\n\t\t\t\tseriesLineStyle: strokeWidth ? { strokeWidth } : undefined,\n\t\t\t},\n\t\t},\n\t];\n};\n\nconst SparklineComponent = forwardRef< HTMLDivElement, SparklineProps >(\n\t(\n\t\t{\n\t\t\tdata,\n\t\t\twidth = DEFAULT_WIDTH,\n\t\t\theight = DEFAULT_HEIGHT,\n\t\t\tcolor,\n\t\t\tstrokeWidth: strokeWidthProp,\n\t\t\twithGradientFill = true,\n\t\t\tgradient,\n\t\t\tclassName,\n\t\t\tchartId,\n\t\t\tmargin: marginProp,\n\t\t},\n\t\tref\n\t) => {\n\t\tconst theme = useGlobalChartsTheme();\n\n\t\t// Get theme defaults for sparkline\n\t\tconst themeStrokeWidth = theme.sparkline?.strokeWidth ?? 1.5;\n\n\t\t// Use prop values or fall back to theme defaults\n\t\tconst strokeWidth = strokeWidthProp ?? themeStrokeWidth;\n\n\t\t// Transform number[] to SeriesData[] for LineChart\n\t\tconst seriesData = useMemo( () => {\n\t\t\tif ( ! data || data.length === 0 ) {\n\t\t\t\treturn [];\n\t\t\t}\n\t\t\treturn transformToSeriesData( data, color, strokeWidth );\n\t\t}, [ data, color, strokeWidth ] );\n\n\t\t// Merge margins with theme defaults\n\t\tconst finalMargin = useMemo( () => {\n\t\t\tconst themeMargin = theme.sparkline?.margin ?? { top: 2, right: 2, bottom: 2, left: 2 };\n\t\t\tconst margin = marginProp ?? themeMargin;\n\t\t\treturn {\n\t\t\t\t...themeMargin,\n\t\t\t\t...margin,\n\t\t\t};\n\t\t}, [ marginProp, theme.sparkline?.margin ] );\n\n\t\t// Build gradient options for the series if custom gradient is provided\n\t\t// Note: This must be called before any early returns to follow React hooks rules\n\t\tconst seriesWithGradient = useMemo( () => {\n\t\t\tif ( ! gradient || seriesData.length === 0 ) {\n\t\t\t\treturn seriesData;\n\t\t\t}\n\n\t\t\treturn seriesData.map( series => ( {\n\t\t\t\t...series,\n\t\t\t\toptions: {\n\t\t\t\t\t...series.options,\n\t\t\t\t\tgradient: {\n\t\t\t\t\t\tfrom: gradient.from || color || '#000000',\n\t\t\t\t\t\tto: gradient.to || '#ffffff',\n\t\t\t\t\t\tfromOpacity: gradient.fromOpacity ?? 0.5,\n\t\t\t\t\t\ttoOpacity: gradient.toOpacity ?? 0.0,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t} ) );\n\t\t}, [ seriesData, gradient, color ] );\n\n\t\t// Handle empty data\n\t\tif ( ! data || data.length === 0 ) {\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'sparkline',\n\t\t\t\t\t\tstyles.sparkline,\n\t\t\t\t\t\tstyles[ 'sparkline--empty' ],\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ { width, height } }\n\t\t\t\t\tdata-testid=\"sparkline-empty\"\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\t// Handle single data point - render a simple dot\n\t\tif ( data.length === 1 ) {\n\t\t\tconst cx = width / 2;\n\t\t\tconst cy = height / 2;\n\t\t\tconst resolvedColor = color || '#000000';\n\n\t\t\treturn (\n\t\t\t\t<div\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t'sparkline',\n\t\t\t\t\t\tstyles.sparkline,\n\t\t\t\t\t\tstyles[ 'sparkline--single-point' ],\n\t\t\t\t\t\tclassName\n\t\t\t\t\t) }\n\t\t\t\t\tstyle={ { width, height } }\n\t\t\t\t\tdata-testid=\"sparkline-single-point\"\n\t\t\t\t>\n\t\t\t\t\t<svg width={ width } height={ height } aria-hidden=\"true\">\n\t\t\t\t\t\t<circle cx={ cx } cy={ cy } r={ strokeWidth * 1.5 } fill={ resolvedColor } />\n\t\t\t\t\t</svg>\n\t\t\t\t</div>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<div\n\t\t\t\tref={ ref }\n\t\t\t\tclassName={ clsx( 'sparkline', styles.sparkline, className ) }\n\t\t\t\tdata-testid=\"sparkline\"\n\t\t\t>\n\t\t\t\t<LineChartUnresponsive\n\t\t\t\t\tdata={ seriesWithGradient }\n\t\t\t\t\twidth={ width }\n\t\t\t\t\theight={ height }\n\t\t\t\t\tmargin={ finalMargin }\n\t\t\t\t\tchartId={ chartId }\n\t\t\t\t\twithGradientFill={ withGradientFill }\n\t\t\t\t\twithTooltips={ false }\n\t\t\t\t\tshowLegend={ false }\n\t\t\t\t\tgridVisibility=\"none\"\n\t\t\t\t\toptions={ {\n\t\t\t\t\t\taxis: {\n\t\t\t\t\t\t\tx: { display: false },\n\t\t\t\t\t\t\ty: { display: false },\n\t\t\t\t\t\t},\n\t\t\t\t\t} }\n\t\t\t\t\tcurveType=\"monotone\"\n\t\t\t\t/>\n\t\t\t</div>\n\t\t);\n\t}\n);\n\nSparklineComponent.displayName = 'SparklineComponent';\n\n/**\n * Sparkline - A minimal line chart for inline data visualization.\n *\n * Sparklines are compact charts designed to be embedded inline with text or\n * displayed in small spaces like table cells or dashboards. They show trends\n * without axes, labels, or other chart chrome.\n *\n * This component is built on top of LineChart with preconfigured settings\n * for minimal display (no axes, grid, tooltips, or legend).\n */\nconst SparklineUnresponsive = SparklineComponent;\n\nSparklineUnresponsive.displayName = 'SparklineUnresponsive';\n\n/**\n * Responsive Sparkline chart component\n */\nconst Sparkline = withResponsive< SparklineProps >( SparklineUnresponsive );\n\nexport { Sparkline as default, SparklineUnresponsive };\n","import 'css-chunk:src/charts/sparkline/sparkline.module.scss';export default {\n \"sparkline\": \"a8ccharts-o-3Z8B\",\n \"sparkline--empty\": \"a8ccharts-CbLbcd\"\n};"],"mappings":"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","names":[]}
@@ -3,7 +3,7 @@ import { R as ResponsiveConfig } from './with-responsive-Cp2qnQPo.cjs';
3
3
  import * as react from 'react';
4
4
  import { ReactNode, FC } from 'react';
5
5
  import { a as BaseLegendProps, B as BaseLegendItem } from './types-C05PdDJa.cjs';
6
- import { B as BaseChartProps, L as LeaderboardEntry } from './types-4wyyzjot.cjs';
6
+ import { B as BaseChartProps, L as LeaderboardEntry } from './types-BtYG-Fdk.cjs';
7
7
 
8
8
  interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | 'data' | 'showLegend' | 'legendOrientation' | 'legendPosition' | 'legendAlignment' | 'legendShape' | 'chartId' | 'width' | 'height' | 'size' | 'legendInteractive' | 'animation'> {
9
9
  /**
@@ -3,7 +3,7 @@ import { R as ResponsiveConfig } from './with-responsive-Cp2qnQPo.js';
3
3
  import * as react from 'react';
4
4
  import { ReactNode, FC } from 'react';
5
5
  import { a as BaseLegendProps, B as BaseLegendItem } from './types-C05PdDJa.js';
6
- import { B as BaseChartProps, L as LeaderboardEntry } from './types-4wyyzjot.js';
6
+ import { B as BaseChartProps, L as LeaderboardEntry } from './types-BtYG-Fdk.js';
7
7
 
8
8
  interface LeaderboardChartProps extends Pick<BaseChartProps<LeaderboardEntry>, 'className' | 'data' | 'showLegend' | 'legendOrientation' | 'legendPosition' | 'legendAlignment' | 'legendShape' | 'chartId' | 'width' | 'height' | 'size' | 'legendInteractive' | 'animation'> {
9
9
  /**
@@ -6,9 +6,7 @@
6
6
 
7
7
 
8
8
 
9
-
10
-
11
- var _chunkN4ZDNOPYcjs = require('../chunk-N4ZDNOPY.cjs');
9
+ var _chunk44EBMDFIcjs = require('../chunk-44EBMDFI.cjs');
12
10
  require('../chunk-FI5B6KSH.cjs');
13
11
  require('../chunk-EMMSS5I5.cjs');
14
12
 
@@ -19,7 +17,5 @@ require('../chunk-EMMSS5I5.cjs');
19
17
 
20
18
 
21
19
 
22
-
23
-
24
- exports.GlobalChartsContext = _chunkN4ZDNOPYcjs.GlobalChartsContext; exports.GlobalChartsProvider = _chunkN4ZDNOPYcjs.GlobalChartsProvider; exports.defaultTheme = _chunkN4ZDNOPYcjs.defaultTheme; exports.jetpackTheme = _chunkN4ZDNOPYcjs.jetpackTheme; exports.useChartId = _chunkN4ZDNOPYcjs.useChartId; exports.useChartRegistration = _chunkN4ZDNOPYcjs.useChartRegistration; exports.useGlobalChartsContext = _chunkN4ZDNOPYcjs.useGlobalChartsContext; exports.useGlobalChartsTheme = _chunkN4ZDNOPYcjs.useGlobalChartsTheme; exports.wooTheme = _chunkN4ZDNOPYcjs.wooTheme;
20
+ exports.GlobalChartsContext = _chunk44EBMDFIcjs.GlobalChartsContext; exports.GlobalChartsProvider = _chunk44EBMDFIcjs.GlobalChartsProvider; exports.defaultTheme = _chunk44EBMDFIcjs.defaultTheme; exports.useChartId = _chunk44EBMDFIcjs.useChartId; exports.useChartRegistration = _chunk44EBMDFIcjs.useChartRegistration; exports.useGlobalChartsContext = _chunk44EBMDFIcjs.useGlobalChartsContext; exports.useGlobalChartsTheme = _chunk44EBMDFIcjs.useGlobalChartsTheme;
25
21
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/providers/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,ojBAAC","file":"/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/providers/index.cjs"}
1
+ {"version":3,"sources":["/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/providers/index.cjs"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B,iCAA8B;AAC9B,iCAA8B;AAC9B;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACF,8cAAC","file":"/home/runner/work/jetpack/jetpack/projects/js-packages/charts/dist/providers/index.cjs"}
@@ -1,7 +1,7 @@
1
- export { C as ChartRegistration, E as ElementStyles, e as GetElementStylesParams, b as GlobalChartsContext, c as GlobalChartsContextValue, G as GlobalChartsProvider, d as defaultTheme, j as jetpackTheme, u as useGlobalChartsContext, a as useGlobalChartsTheme, w as wooTheme } from '../themes-Dv70Dz7B.cjs';
1
+ export { C as ChartRegistration, E as ElementStyles, e as GetElementStylesParams, b as GlobalChartsContext, c as GlobalChartsContextValue, G as GlobalChartsProvider, d as defaultTheme, u as useGlobalChartsContext, a as useGlobalChartsTheme } from '../themes-DYhtyXtJ.cjs';
2
2
  import { B as BaseLegendItem } from '../types-C05PdDJa.cjs';
3
3
  import 'react';
4
- import '../types-4wyyzjot.cjs';
4
+ import '../types-BtYG-Fdk.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, e as GetElementStylesParams, b as GlobalChartsContext, c as GlobalChartsContextValue, G as GlobalChartsProvider, d as defaultTheme, j as jetpackTheme, u as useGlobalChartsContext, a as useGlobalChartsTheme, w as wooTheme } from '../themes-CNy453Lb.js';
1
+ export { C as ChartRegistration, E as ElementStyles, e as GetElementStylesParams, b as GlobalChartsContext, c as GlobalChartsContextValue, G as GlobalChartsProvider, d as defaultTheme, u as useGlobalChartsContext, a as useGlobalChartsTheme } from '../themes-09M-mQE6.js';
2
2
  import { B as BaseLegendItem } from '../types-C05PdDJa.js';
3
3
  import 'react';
4
- import '../types-4wyyzjot.js';
4
+ import '../types-BtYG-Fdk.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';
@@ -2,24 +2,20 @@ import {
2
2
  GlobalChartsContext,
3
3
  GlobalChartsProvider,
4
4
  defaultTheme,
5
- jetpackTheme,
6
5
  useChartId,
7
6
  useChartRegistration,
8
7
  useGlobalChartsContext,
9
- useGlobalChartsTheme,
10
- wooTheme
11
- } from "../chunk-MRCTAUHL.js";
8
+ useGlobalChartsTheme
9
+ } from "../chunk-ULRFJ3IU.js";
12
10
  import "../chunk-7IZD3F7B.js";
13
11
  import "../chunk-G3PMV62Z.js";
14
12
  export {
15
13
  GlobalChartsContext,
16
14
  GlobalChartsProvider,
17
15
  defaultTheme,
18
- jetpackTheme,
19
16
  useChartId,
20
17
  useChartRegistration,
21
18
  useGlobalChartsContext,
22
- useGlobalChartsTheme,
23
- wooTheme
19
+ useGlobalChartsTheme
24
20
  };
25
21
  //# sourceMappingURL=index.js.map
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, CSSProperties, FC } from 'react';
3
- import { e as CompleteChartTheme, c as SeriesData, d as DataPointPercentage, C as ChartTheme } from './types-4wyyzjot.js';
3
+ import { e as CompleteChartTheme, c as SeriesData, d as DataPointPercentage, C as ChartTheme } from './types-BtYG-Fdk.js';
4
4
  import { B as BaseLegendItem } from './types-C05PdDJa.js';
5
5
  import { LegendShape } from '@visx/legend/lib/types';
6
6
  import { LineStyles, GlyphProps } from '@visx/xychart';
@@ -54,13 +54,5 @@ declare const useGlobalChartsTheme: () => CompleteChartTheme;
54
54
  * Default theme configuration
55
55
  */
56
56
  declare const defaultTheme: CompleteChartTheme;
57
- /**
58
- * Jetpack theme configuration
59
- */
60
- declare const jetpackTheme: ChartTheme;
61
- /**
62
- * Woo theme configuration
63
- */
64
- declare const wooTheme: ChartTheme;
65
57
 
66
- export { type ChartRegistration as C, type ElementStyles as E, GlobalChartsProvider as G, useGlobalChartsTheme as a, GlobalChartsContext as b, type GlobalChartsContextValue as c, defaultTheme as d, type GetElementStylesParams as e, jetpackTheme as j, useGlobalChartsContext as u, wooTheme as w };
58
+ export { type ChartRegistration as C, type ElementStyles as E, GlobalChartsProvider as G, useGlobalChartsTheme as a, GlobalChartsContext as b, type GlobalChartsContextValue as c, defaultTheme as d, type GetElementStylesParams as e, useGlobalChartsContext as u };
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode, CSSProperties, FC } from 'react';
3
- import { e as CompleteChartTheme, c as SeriesData, d as DataPointPercentage, C as ChartTheme } from './types-4wyyzjot.cjs';
3
+ import { e as CompleteChartTheme, c as SeriesData, d as DataPointPercentage, C as ChartTheme } from './types-BtYG-Fdk.cjs';
4
4
  import { B as BaseLegendItem } from './types-C05PdDJa.cjs';
5
5
  import { LegendShape } from '@visx/legend/lib/types';
6
6
  import { LineStyles, GlyphProps } from '@visx/xychart';
@@ -54,13 +54,5 @@ declare const useGlobalChartsTheme: () => CompleteChartTheme;
54
54
  * Default theme configuration
55
55
  */
56
56
  declare const defaultTheme: CompleteChartTheme;
57
- /**
58
- * Jetpack theme configuration
59
- */
60
- declare const jetpackTheme: ChartTheme;
61
- /**
62
- * Woo theme configuration
63
- */
64
- declare const wooTheme: ChartTheme;
65
57
 
66
- export { type ChartRegistration as C, type ElementStyles as E, GlobalChartsProvider as G, useGlobalChartsTheme as a, GlobalChartsContext as b, type GlobalChartsContextValue as c, defaultTheme as d, type GetElementStylesParams as e, jetpackTheme as j, useGlobalChartsContext as u, wooTheme as w };
58
+ export { type ChartRegistration as C, type ElementStyles as E, GlobalChartsProvider as G, useGlobalChartsTheme as a, GlobalChartsContext as b, type GlobalChartsContextValue as c, defaultTheme as d, type GetElementStylesParams as e, useGlobalChartsContext as u };
@@ -198,6 +198,18 @@ type ChartTheme = {
198
198
  lineChart?: {
199
199
  lineStyles?: Partial<Record<NonNullable<SeriesDataOptions['type']>, LineStyles>>;
200
200
  };
201
+ /** Sparkline specific settings */
202
+ sparkline?: {
203
+ /** Margin around the sparkline chart */
204
+ margin?: {
205
+ top?: number;
206
+ right?: number;
207
+ bottom?: number;
208
+ left?: number;
209
+ };
210
+ /** Stroke width for the sparkline line */
211
+ strokeWidth?: number;
212
+ };
201
213
  };
202
214
  /**
203
215
  * Theme configuration with all properties guaranteed to be defined.
@@ -209,6 +221,9 @@ type CompleteChartTheme = Required<ChartTheme> & {
209
221
  lineChart: {
210
222
  lineStyles: Record<NonNullable<SeriesDataOptions['type']>, LineStyles>;
211
223
  };
224
+ sparkline: Required<NonNullable<ChartTheme['sparkline']>> & {
225
+ margin: Required<NonNullable<ChartTheme['sparkline']>['margin']>;
226
+ };
212
227
  };
213
228
  declare type AxisOptions = {
214
229
  orientation?: OrientationType;
@@ -218,6 +233,10 @@ declare type AxisOptions = {
218
233
  labelClassName?: string;
219
234
  tickClassName?: string;
220
235
  tickFormat?: TickFormatter<ScaleInput<AxisScale>>;
236
+ /**
237
+ * Whether to display this axis. Defaults to true.
238
+ */
239
+ display?: boolean;
221
240
  /**
222
241
  * For more control over rendering or to add event handlers to datum, pass a function as children.
223
242
  */
@@ -198,6 +198,18 @@ type ChartTheme = {
198
198
  lineChart?: {
199
199
  lineStyles?: Partial<Record<NonNullable<SeriesDataOptions['type']>, LineStyles>>;
200
200
  };
201
+ /** Sparkline specific settings */
202
+ sparkline?: {
203
+ /** Margin around the sparkline chart */
204
+ margin?: {
205
+ top?: number;
206
+ right?: number;
207
+ bottom?: number;
208
+ left?: number;
209
+ };
210
+ /** Stroke width for the sparkline line */
211
+ strokeWidth?: number;
212
+ };
201
213
  };
202
214
  /**
203
215
  * Theme configuration with all properties guaranteed to be defined.
@@ -209,6 +221,9 @@ type CompleteChartTheme = Required<ChartTheme> & {
209
221
  lineChart: {
210
222
  lineStyles: Record<NonNullable<SeriesDataOptions['type']>, LineStyles>;
211
223
  };
224
+ sparkline: Required<NonNullable<ChartTheme['sparkline']>> & {
225
+ margin: Required<NonNullable<ChartTheme['sparkline']>['margin']>;
226
+ };
212
227
  };
213
228
  declare type AxisOptions = {
214
229
  orientation?: OrientationType;
@@ -218,6 +233,10 @@ declare type AxisOptions = {
218
233
  labelClassName?: string;
219
234
  tickClassName?: string;
220
235
  tickFormat?: TickFormatter<ScaleInput<AxisScale>>;
236
+ /**
237
+ * Whether to display this axis. Defaults to true.
238
+ */
239
+ display?: boolean;
221
240
  /**
222
241
  * For more control over rendering or to add event handlers to datum, pass a function as children.
223
242
  */
@@ -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 { c as SeriesData, C as ChartTheme, e as CompleteChartTheme } from '../types-4wyyzjot.cjs';
4
+ import { c as SeriesData, C as ChartTheme, e as CompleteChartTheme } from '../types-BtYG-Fdk.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 { c as SeriesData, C as ChartTheme, e as CompleteChartTheme } from '../types-4wyyzjot.js';
4
+ import { c as SeriesData, C as ChartTheme, e as CompleteChartTheme } from '../types-BtYG-Fdk.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';