@sproutsocial/seeds-react-data-viz 0.21.3 → 0.22.1

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 (60) hide show
  1. package/dist/bar/index.d.mts +5 -9
  2. package/dist/bar/index.d.ts +5 -9
  3. package/dist/bar/index.js +12 -12
  4. package/dist/bar/index.js.map +1 -1
  5. package/dist/bubble/index.d.mts +102 -0
  6. package/dist/bubble/index.d.ts +102 -0
  7. package/dist/bubble/index.js +235 -0
  8. package/dist/bubble/index.js.map +1 -0
  9. package/dist/bubble.css +104 -0
  10. package/dist/{chartBase-Cn_5CUJi.d.mts → chartBase-BClSc5EN.d.mts} +4 -0
  11. package/dist/{chartBase-C-l7yYGx.d.ts → chartBase-CycEw2vy.d.ts} +4 -0
  12. package/dist/chartOptions-DHzoGRdG.d.mts +24 -0
  13. package/dist/chartOptions-DHzoGRdG.d.ts +24 -0
  14. package/dist/charts.css +105 -0
  15. package/dist/{chunk-46L4YBLC.js → chunk-2H2Z7PKZ.js} +1 -14
  16. package/dist/chunk-2H2Z7PKZ.js.map +1 -0
  17. package/dist/{chunk-CYQXUAJC.js → chunk-33Y5FZTT.js} +10 -2
  18. package/dist/chunk-33Y5FZTT.js.map +1 -0
  19. package/dist/{chunk-27M4FDNK.js → chunk-GWP3PWIG.js} +84 -27
  20. package/dist/chunk-GWP3PWIG.js.map +1 -0
  21. package/dist/{chunk-XYE6O77Z.js → chunk-KMJD7BW3.js} +3 -3
  22. package/dist/{chunk-XYE6O77Z.js.map → chunk-KMJD7BW3.js.map} +1 -1
  23. package/dist/donut/index.d.mts +4 -8
  24. package/dist/donut/index.d.ts +4 -8
  25. package/dist/donut/index.js +7 -7
  26. package/dist/esm/bar/index.js +8 -8
  27. package/dist/esm/bubble/index.js +235 -0
  28. package/dist/esm/bubble/index.js.map +1 -0
  29. package/dist/esm/{chunk-QSSYSKRP.js → chunk-JGM4M7QV.js} +70 -13
  30. package/dist/esm/chunk-JGM4M7QV.js.map +1 -0
  31. package/dist/esm/{chunk-KMFRRUTY.js → chunk-KQKAVIYW.js} +2 -2
  32. package/dist/esm/{chunk-XEKQTAUH.js → chunk-NZX3WPXT.js} +9 -22
  33. package/dist/esm/chunk-NZX3WPXT.js.map +1 -0
  34. package/dist/esm/{chunk-XMYGML25.js → chunk-XRZJACCB.js} +10 -2
  35. package/dist/esm/{chunk-XMYGML25.js.map → chunk-XRZJACCB.js.map} +1 -1
  36. package/dist/esm/donut/index.js +3 -3
  37. package/dist/esm/index.js +10 -2
  38. package/dist/esm/index.js.map +1 -1
  39. package/dist/esm/line-area/index.js +8 -8
  40. package/dist/esm/sparkline/index.js +2 -2
  41. package/dist/index.d.mts +3 -19
  42. package/dist/index.d.ts +3 -19
  43. package/dist/index.js +66 -58
  44. package/dist/index.js.map +1 -1
  45. package/dist/{interactions-DoWoL7bu.d.mts → interactions-pEXA1XxF.d.mts} +16 -1
  46. package/dist/{interactions-DoWoL7bu.d.ts → interactions-pEXA1XxF.d.ts} +16 -1
  47. package/dist/line-area/index.d.mts +4 -8
  48. package/dist/line-area/index.d.ts +4 -8
  49. package/dist/line-area/index.js +12 -12
  50. package/dist/line-area/index.js.map +1 -1
  51. package/dist/sparkline/index.d.mts +1 -1
  52. package/dist/sparkline/index.d.ts +1 -1
  53. package/dist/sparkline/index.js +4 -4
  54. package/package.json +18 -12
  55. package/dist/chunk-27M4FDNK.js.map +0 -1
  56. package/dist/chunk-46L4YBLC.js.map +0 -1
  57. package/dist/chunk-CYQXUAJC.js.map +0 -1
  58. package/dist/esm/chunk-QSSYSKRP.js.map +0 -1
  59. package/dist/esm/chunk-XEKQTAUH.js.map +0 -1
  60. /package/dist/esm/{chunk-KMFRRUTY.js.map → chunk-KQKAVIYW.js.map} +0 -0
@@ -1,3 +1,18 @@
1
+ import { TypeIconName } from '@sproutsocial/seeds-react-icon';
2
+
3
+ /** Base identity every chart data point or series carries. */
4
+ interface ChartNamedEntity {
5
+ name: string;
6
+ }
7
+ /** A named entity with an optional per-entity color override — falls through to the shared data-viz palette when omitted. */
8
+ interface ChartColorableEntity extends ChartNamedEntity {
9
+ color?: string;
10
+ }
11
+ /** A named entity with an optional Seeds icon or partner-logo name. */
12
+ interface ChartIconableEntity extends ChartNamedEntity {
13
+ icon?: TypeIconName;
14
+ }
15
+
1
16
  /**
2
17
  * Series identity attached to a multi-series bar hover. Absent for
3
18
  * single-series bar and for line/area and donut.
@@ -26,4 +41,4 @@ type ChartHoverHandler<P extends number | string = number | string> = ({ positio
26
41
  series?: ChartHoverSeries;
27
42
  }) => void;
28
43
 
29
- export type { ChartClickHandler as C, ChartHoverHandler as a, ChartHoverSeries as b };
44
+ export type { ChartColorableEntity as C, ChartIconableEntity as a, ChartClickHandler as b, ChartHoverHandler as c, ChartHoverSeries as d };
@@ -1,3 +1,18 @@
1
+ import { TypeIconName } from '@sproutsocial/seeds-react-icon';
2
+
3
+ /** Base identity every chart data point or series carries. */
4
+ interface ChartNamedEntity {
5
+ name: string;
6
+ }
7
+ /** A named entity with an optional per-entity color override — falls through to the shared data-viz palette when omitted. */
8
+ interface ChartColorableEntity extends ChartNamedEntity {
9
+ color?: string;
10
+ }
11
+ /** A named entity with an optional Seeds icon or partner-logo name. */
12
+ interface ChartIconableEntity extends ChartNamedEntity {
13
+ icon?: TypeIconName;
14
+ }
15
+
1
16
  /**
2
17
  * Series identity attached to a multi-series bar hover. Absent for
3
18
  * single-series bar and for line/area and donut.
@@ -26,4 +41,4 @@ type ChartHoverHandler<P extends number | string = number | string> = ({ positio
26
41
  series?: ChartHoverSeries;
27
42
  }) => void;
28
43
 
29
- export type { ChartClickHandler as C, ChartHoverHandler as a, ChartHoverSeries as b };
44
+ export type { ChartColorableEntity as C, ChartIconableEntity as a, ChartClickHandler as b, ChartHoverHandler as c, ChartHoverSeries as d };
@@ -1,12 +1,12 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { TypeIconName } from '@sproutsocial/seeds-react-icon';
4
3
  import { C as ChartAnnotation } from '../annotations-CjFoRPXf.mjs';
5
- import { V as ValueFormat, C as ChartTooltipProps } from '../chartBase-Cn_5CUJi.mjs';
4
+ import { V as ValueFormat, C as ChartTooltipProps } from '../chartBase-BClSc5EN.mjs';
6
5
  import { C as ChartExportHandle } from '../chartExport-CKYpuhik.mjs';
7
- import { C as ChartClickHandler, a as ChartHoverHandler } from '../interactions-DoWoL7bu.mjs';
6
+ import { C as ChartColorableEntity, a as ChartIconableEntity, b as ChartClickHandler, c as ChartHoverHandler } from '../interactions-pEXA1XxF.mjs';
8
7
  import { C as ChartDataPoint, a as CategoryAxis, D as DatetimeAxis } from '../axis-WOeYkTO1.mjs';
9
8
  import { h as TypeChartStylePattern } from '../types-DxrhdAdn.mjs';
9
+ import '@sproutsocial/seeds-react-icon';
10
10
  import 'highcharts';
11
11
 
12
12
  /**
@@ -15,16 +15,12 @@ import 'highcharts';
15
15
  * region below the line. Maps directly to the Highcharts series type.
16
16
  */
17
17
  type LineAreaVariant = "line" | "spline" | "area" | "areaspline";
18
- interface LineAreaSeries {
19
- name: string;
18
+ interface LineAreaSeries extends ChartColorableEntity, ChartIconableEntity {
20
19
  /**
21
20
  * Y-values indexed parallel to `xAxis.categories` on a category axis, or
22
21
  * `[timestamp, value]` / `{ x, y }` points on a datetime axis.
23
22
  */
24
23
  data: Array<ChartDataPoint>;
25
- color?: string;
26
- /** Seeds icon or partner-logo name rendered before the series name in the legend. */
27
- icon?: TypeIconName;
28
24
  /** Line dash style. Applies to `line`/`spline` variants; a no-op on filled area variants. Default `"solid"`. */
29
25
  pattern?: TypeChartStylePattern;
30
26
  }
@@ -1,12 +1,12 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { TypeIconName } from '@sproutsocial/seeds-react-icon';
4
3
  import { C as ChartAnnotation } from '../annotations-CjFoRPXf.js';
5
- import { V as ValueFormat, C as ChartTooltipProps } from '../chartBase-C-l7yYGx.js';
4
+ import { V as ValueFormat, C as ChartTooltipProps } from '../chartBase-CycEw2vy.js';
6
5
  import { C as ChartExportHandle } from '../chartExport-CKYpuhik.js';
7
- import { C as ChartClickHandler, a as ChartHoverHandler } from '../interactions-DoWoL7bu.js';
6
+ import { C as ChartColorableEntity, a as ChartIconableEntity, b as ChartClickHandler, c as ChartHoverHandler } from '../interactions-pEXA1XxF.js';
8
7
  import { C as ChartDataPoint, a as CategoryAxis, D as DatetimeAxis } from '../axis-WOeYkTO1.js';
9
8
  import { h as TypeChartStylePattern } from '../types-DxrhdAdn.js';
9
+ import '@sproutsocial/seeds-react-icon';
10
10
  import 'highcharts';
11
11
 
12
12
  /**
@@ -15,16 +15,12 @@ import 'highcharts';
15
15
  * region below the line. Maps directly to the Highcharts series type.
16
16
  */
17
17
  type LineAreaVariant = "line" | "spline" | "area" | "areaspline";
18
- interface LineAreaSeries {
19
- name: string;
18
+ interface LineAreaSeries extends ChartColorableEntity, ChartIconableEntity {
20
19
  /**
21
20
  * Y-values indexed parallel to `xAxis.categories` on a category axis, or
22
21
  * `[timestamp, value]` / `{ x, y }` points on a datetime axis.
23
22
  */
24
23
  data: Array<ChartDataPoint>;
25
- color?: string;
26
- /** Seeds icon or partner-logo name rendered before the series name in the legend. */
27
- icon?: TypeIconName;
28
24
  /** Line dash style. Applies to `line`/`spline` variants; a no-op on filled area variants. Default `"solid"`. */
29
25
  pattern?: TypeChartStylePattern;
30
26
  }
@@ -2,23 +2,23 @@
2
2
 
3
3
 
4
4
 
5
- var _chunkXYE6O77Zjs = require('../chunk-XYE6O77Z.js');
5
+ var _chunkKMJD7BW3js = require('../chunk-KMJD7BW3.js');
6
6
 
7
7
 
8
- var _chunk6EIJCJCNjs = require('../chunk-6EIJCJCN.js');
9
8
 
9
+ var _chunk6D7P3IOTjs = require('../chunk-6D7P3IOT.js');
10
10
 
11
- var _chunkCYQXUAJCjs = require('../chunk-CYQXUAJC.js');
12
11
 
12
+ var _chunk6EIJCJCNjs = require('../chunk-6EIJCJCN.js');
13
13
 
14
14
 
15
- var _chunk6D7P3IOTjs = require('../chunk-6D7P3IOT.js');
15
+ var _chunk33Y5FZTTjs = require('../chunk-33Y5FZTT.js');
16
16
 
17
17
 
18
18
 
19
19
 
20
- var _chunk27M4FDNKjs = require('../chunk-27M4FDNK.js');
21
- require('../chunk-46L4YBLC.js');
20
+ var _chunkGWP3PWIGjs = require('../chunk-GWP3PWIG.js');
21
+ require('../chunk-2H2Z7PKZ.js');
22
22
 
23
23
  // src/charts/line-area/LineAreaChart.tsx
24
24
  var _react = require('react');
@@ -47,10 +47,10 @@ function withIsolatedPointMarkers(data) {
47
47
  function buildLineAreaChartOptions(props) {
48
48
  const tooltipTimezone = _chunk6D7P3IOTjs.resolveTooltipTimezone.call(void 0, props.xAxis, props.timezone);
49
49
  const isStacked = AREA_VARIANTS.has(props.variant) && Boolean(props.stacking);
50
- const { annotations, lookup: annotationLookup } = _chunkXYE6O77Zjs.buildAnnotationConfig.call(void 0,
50
+ const { annotations, lookup: annotationLookup } = _chunkKMJD7BW3js.buildAnnotationConfig.call(void 0,
51
51
  props.annotations
52
52
  );
53
- const base = _chunk27M4FDNKjs.buildBaseChartOptions.call(void 0, {
53
+ const base = _chunkGWP3PWIGjs.buildBaseChartOptions.call(void 0, {
54
54
  type: props.variant,
55
55
  description: props.description,
56
56
  valueSuffix: props.valueSuffix,
@@ -66,7 +66,7 @@ function buildLineAreaChartOptions(props) {
66
66
  // Re-assert the definite `type` so spreading the optionally-typed
67
67
  // `base.chart` doesn't widen the required `type` field to optional.
68
68
  type: props.variant,
69
- height: _nullishCoalesce(props.height, () => ( _chunkCYQXUAJCjs.TIME_SERIES_CHART_HEIGHT)),
69
+ height: _nullishCoalesce(props.height, () => ( _chunk33Y5FZTTjs.TIME_SERIES_CHART_HEIGHT)),
70
70
  // Tight time-series spacing (from constants/chartOptions.ts) so the plot
71
71
  // area fills the 275px container; without it Highcharts' larger default
72
72
  // spacing ([10, 10, 15, 10]) shrinks the plot area.
@@ -90,7 +90,7 @@ function buildLineAreaChartOptions(props) {
90
90
  labels: {
91
91
  // A declarative `format` drives ticks through the shared valueFormatter;
92
92
  // absent it, the zero-config decimal default (1.20K / 1.20M / 1.20B).
93
- formatter: _optionalChain([props, 'access', _9 => _9.yAxis, 'optionalAccess', _10 => _10.format]) ? _chunkXYE6O77Zjs.makeValueAxisLabelFormatter.call(void 0, props.yAxis.format) : _chunkXYE6O77Zjs.defaultValueAxisLabelFormatter
93
+ formatter: _optionalChain([props, 'access', _9 => _9.yAxis, 'optionalAccess', _10 => _10.format]) ? _chunkKMJD7BW3js.makeValueAxisLabelFormatter.call(void 0, props.yAxis.format) : _chunkKMJD7BW3js.defaultValueAxisLabelFormatter
94
94
  }
95
95
  },
96
96
  plotOptions: {
@@ -133,7 +133,7 @@ function buildLineAreaChartOptions(props) {
133
133
  var _jsxruntime = require('react/jsx-runtime');
134
134
  var AREA_VARIANTS2 = /* @__PURE__ */ new Set(["area", "areaspline"]);
135
135
  var LineAreaChart = _react.memo.call(void 0, function LineAreaChart2(props) {
136
- const { colors, patterns } = _chunk27M4FDNKjs.useSeedsChartSetup.call(void 0, {
136
+ const { colors, patterns } = _chunkGWP3PWIGjs.useSeedsChartSetup.call(void 0, {
137
137
  series: props.series,
138
138
  includePatterns: true
139
139
  });
@@ -161,7 +161,7 @@ var LineAreaChart = _react.memo.call(void 0, function LineAreaChart2(props) {
161
161
  className: props.className
162
162
  }),
163
163
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
164
- _chunk27M4FDNKjs.ChartRenderer,
164
+ _chunkGWP3PWIGjs.ChartRenderer,
165
165
  {
166
166
  options,
167
167
  series: props.series,
@@ -1 +1 @@
1
- {"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/line-area/index.js","../../src/charts/line-area/LineAreaChart.tsx","../../src/charts/line-area/adapter.ts"],"names":["AREA_VARIANTS","LineAreaChart"],"mappings":"AAAA;AACE;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;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,EAAmB,KAAA,CAAM,iBAAA;AAAA,UACzB,QAAA,EAAU,eAAA;AAAA,UACV,kBAAA,EAAoB,KAAA,CAAM,kBAAA;AAAA,UAC1B,WAAA,kBAAa,KAAA,uBAAM,KAAA,+BAAO,QAAA;AAAA,UAC1B,WAAA,EAAa,KAAA,CAAM,WAAA;AAAA,UACnB,OAAA,EAAS,KAAA,CAAM;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EACF,CAAA;AAEJ,CAAC,CAAA;ADgHD;AACE;AACF,sCAAC","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/line-area/index.js","sourcesContent":[null,"import { memo, useMemo } from \"react\";\nimport { useSeedsChartSetup, ChartRenderer } from \"../shared/chartBase\";\nimport { getChartContainerProps } from \"../shared/chartContainer\";\nimport { buildLineAreaChartOptions } from \"./adapter\";\nimport type { LineAreaChartProps, LineAreaVariant } from \"./types\";\n\nconst AREA_VARIANTS = new Set<LineAreaVariant>([\"area\", \"areaspline\"]);\n\n/**\n * LineAreaChart — the v2 time-series line/area family.\n *\n * Like SparklineChart, the wrapper carries no styled-components: it is a plain\n * <div> whose className / inline custom properties / data-attributes come from\n * the shared getChartContainerProps contract (CE-164), and its Highcharts\n * styling ships as a static line-area.css. chart-styles.css owns the shared\n * base (background, per-series color fallback, click cursor, tooltip, legend)\n * AND the shared cross-family .seeds-chart-time-series layer (crosshair,\n * grid/axis lines, ticks, zero line, axis-label typography) that bar also uses;\n * line-area.css owns only the .seeds-chart-line / .seeds-chart-area selectors.\n * Neither is imported here — matching the Sparkline/bar convention, the component never\n * self-imports its stylesheet; consumers import both explicitly (see\n * charts/README.md).\n */\nexport const LineAreaChart = memo(function LineAreaChart(\n props: LineAreaChartProps\n) {\n const { colors, patterns } = useSeedsChartSetup({\n series: props.series,\n includePatterns: true,\n });\n const { options, annotationLookup, tooltipTimezone } = useMemo(\n () => buildLineAreaChartOptions(props),\n [props]\n );\n const hasOnClick = Boolean(props.onClick);\n const isArea = AREA_VARIANTS.has(props.variant);\n\n return (\n <div\n {...getChartContainerProps({\n familyClasses: [\n \"seeds-chart-time-series\",\n isArea ? \"seeds-chart-area\" : \"seeds-chart-line\",\n ],\n // RAW per-series colors: only an explicit consumer override is inlined\n // as --highcharts-color-N; an unset series falls through to the DS\n // palette default in chart-styles.css. ChartRenderer below still gets\n // the palette-RESOLVED `colors` for its own styled-components engine.\n colors: props.series.map((s) => s.color),\n patterns,\n hasOnClick,\n className: props.className,\n })}\n >\n <ChartRenderer\n options={options}\n series={props.series}\n colors={colors}\n tooltip={props.tooltip}\n annotationLookup={annotationLookup}\n hasOnClick={hasOnClick}\n tooltipClickLabel={props.tooltipClickLabel}\n timezone={tooltipTimezone}\n invalidNumberLabel={props.invalidNumberLabel}\n valueFormat={props.yAxis?.format}\n exportTitle={props.exportTitle}\n onReady={props.onReady}\n />\n </div>\n );\n});\n","import { buildAnnotationConfig } from \"../shared/annotations\";\nimport type { ChartAnnotationLookup } from \"../shared/annotations\";\nimport type {\n SeedsChartDataPoint,\n SeedsChartOptions,\n} from \"../shared/chartBase\";\nimport { buildBaseChartOptions } from \"../shared/baseChartOptions\";\nimport { TIME_SERIES_CHART_HEIGHT } from \"../../constants/chartOptions\";\nimport {\n buildDimensionalAxis,\n resolveTooltipTimezone,\n} from \"../shared/axisOptions\";\nimport {\n defaultValueAxisLabelFormatter,\n makeValueAxisLabelFormatter,\n} from \"../shared/valueAxisLabelFormatter\";\nimport type { ChartDataPoint } from \"../shared/axis\";\nimport type { LineAreaChartProps, LineAreaVariant } from \"./types\";\n\n// `stacking` is meaningful only for filled variants; on `line`/`spline` it's a\n// no-op, so the adapter drops it rather than emitting a misleading option.\nconst AREA_VARIANTS = new Set<LineAreaVariant>([\"area\", \"areaspline\"]);\n\ntype SeriesPoint =\n | number\n | null\n | [number, number | null]\n | SeedsChartDataPoint;\n\nfunction pointY(point: ChartDataPoint): number | null {\n if (point === null) return null;\n if (typeof point === \"number\") return point;\n if (Array.isArray(point)) return point[1];\n return point.y;\n}\n\n// Point markers are hidden by default (set on `plotOptions.series`), but an\n// *isolated* non-null point — one with a null (or the chart edge) on both\n// sides — gets a circle marker so a point with no connecting line segment\n// stays visible. Connected points pass through unchanged so the line/area\n// renders dot-free, matching the designs.\nfunction withIsolatedPointMarkers(\n data: ReadonlyArray<ChartDataPoint>\n): SeriesPoint[] {\n return data.map((point, i): SeriesPoint => {\n if (point === null) return null; // explicit gap\n if (pointY(point) === null) return point; // tuple/object with null y — a gap\n const prevY = i === 0 ? null : pointY(data[i - 1]!);\n const nextY = i === data.length - 1 ? null : pointY(data[i + 1]!);\n if (prevY !== null || nextY !== null) return point; // connected → no marker\n const marker = { enabled: true, symbol: \"circle\" as const };\n if (typeof point === \"number\") return { y: point, marker };\n if (Array.isArray(point)) return { x: point[0], y: point[1], marker };\n return { ...point, marker };\n });\n}\n\nexport function buildLineAreaChartOptions(props: LineAreaChartProps): {\n options: SeedsChartOptions;\n annotationLookup: ChartAnnotationLookup | undefined;\n /** Resolved timezone for the tooltip date formatter; undefined on category axes. */\n tooltipTimezone: string | undefined;\n} {\n const tooltipTimezone = resolveTooltipTimezone(props.xAxis, props.timezone);\n const isStacked = AREA_VARIANTS.has(props.variant) && Boolean(props.stacking);\n const { annotations, lookup: annotationLookup } = buildAnnotationConfig(\n props.annotations\n );\n\n const base = buildBaseChartOptions({\n type: props.variant,\n description: props.description,\n valueSuffix: props.valueSuffix,\n reserveTopMargin: Boolean(annotations),\n timezone: tooltipTimezone,\n });\n\n const options: SeedsChartOptions = {\n ...base,\n // Default height baseline (overridable via `props.height`) so consumers\n // who don't configure sizing keep the design-reviewed default.\n chart: {\n ...base.chart,\n // Re-assert the definite `type` so spreading the optionally-typed\n // `base.chart` doesn't widen the required `type` field to optional.\n type: props.variant,\n height: props.height ?? TIME_SERIES_CHART_HEIGHT,\n // Tight time-series spacing (from constants/chartOptions.ts) so the plot\n // area fills the 275px container; without it Highcharts' larger default\n // spacing ([10, 10, 15, 10]) shrinks the plot area.\n spacing: [5, 1, 0, 2],\n },\n xAxis: buildDimensionalAxis(props.xAxis, tooltipTimezone ?? \"UTC\"),\n yAxis: {\n min: props.yAxis?.min,\n max: props.yAxis?.max,\n // Anchor the value axis to 0 (as the bar/area families do): line/spline otherwise\n // auto-scale above 0, which truncates the axis and pushes the annotation\n // anchor (y: 0) out of range. `soft` still extends for negative data.\n softMin: 0,\n softMax: 0,\n gridLineWidth: props.yAxis?.showGridLines === false ? 0 : 1,\n // A dedicated plotLine at 0, styled distinctly from regular gridlines\n // (see chartStyles.ts).\n plotLines: [{ value: 0, className: \"y-axis-zero-line\", zIndex: 3 }],\n title: { text: props.yAxis?.title ?? \"\" },\n // Zero-config default: abbreviate value-axis ticks (1.20K / 1.20M / 1.20B).\n labels: {\n // A declarative `format` drives ticks through the shared valueFormatter;\n // absent it, the zero-config decimal default (1.20K / 1.20M / 1.20B).\n formatter: props.yAxis?.format\n ? makeValueAxisLabelFormatter(props.yAxis.format)\n : defaultValueAxisLabelFormatter,\n },\n },\n plotOptions: {\n series: {\n animation: false,\n // Hide point markers by default (per the designs); isolated points\n // re-enable their own marker via `withIsolatedPointMarkers`.\n marker: { enabled: false },\n ...(props.onClick || props.onMouseEnter || props.onMouseLeave\n ? {\n point: {\n events: {\n click: props.onClick\n ? (event) => props.onClick!({ position: event.point.x })\n : undefined,\n mouseOver: props.onMouseEnter\n ? function (this: { x: number | string }) {\n props.onMouseEnter!({ position: this.x });\n }\n : undefined,\n mouseOut: props.onMouseLeave\n ? function (this: { x: number | string }) {\n props.onMouseLeave!({ position: this.x });\n }\n : undefined,\n },\n },\n }\n : {}),\n },\n // Type-scoped stacking: only the (area) variant stacks. `isStacked` already\n // guarantees `props.variant` is an area variant here, so the computed key is\n // always a valid plotOptions slot. Matches bar's per-type placement and keeps\n // line/spline unstacked.\n ...(isStacked ? { [props.variant]: { stacking: props.stacking } } : {}),\n },\n series: props.series.map((s) => ({\n type: props.variant,\n name: s.name,\n data: withIsolatedPointMarkers(s.data),\n })),\n ...(annotations ? { annotations } : {}),\n };\n\n return { options, annotationLookup, tooltipTimezone };\n}\n"]}
1
+ {"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/line-area/index.js","../../src/charts/line-area/LineAreaChart.tsx","../../src/charts/line-area/adapter.ts"],"names":["AREA_VARIANTS","LineAreaChart"],"mappings":"AAAA;AACE;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACF,uDAA6B;AAC7B;AACE;AACF,uDAA6B;AAC7B;AACE;AACF,uDAA6B;AAC7B;AACE;AACA;AACA;AACF,uDAA6B;AAC7B,gCAA6B;AAC7B;AACA;ACtBA,8BAA8B;ADwB9B;AACA;AEJA,IAAM,cAAA,kBAAgB,IAAI,GAAA,CAAqB,CAAC,MAAA,EAAQ,YAAY,CAAC,CAAA;AAQrE,SAAS,MAAA,CAAO,KAAA,EAAsC;AACpD,EAAA,GAAA,CAAI,MAAA,IAAU,IAAA,EAAM,OAAO,IAAA;AAC3B,EAAA,GAAA,CAAI,OAAO,MAAA,IAAU,QAAA,EAAU,OAAO,KAAA;AACtC,EAAA,GAAA,CAAI,KAAA,CAAM,OAAA,CAAQ,KAAK,CAAA,EAAG,OAAO,KAAA,CAAM,CAAC,CAAA;AACxC,EAAA,OAAO,KAAA,CAAM,CAAA;AACf;AAOA,SAAS,wBAAA,CACP,IAAA,EACe;AACf,EAAA,OAAO,IAAA,CAAK,GAAA,CAAI,CAAC,KAAA,EAAO,CAAA,EAAA,GAAmB;AACzC,IAAA,GAAA,CAAI,MAAA,IAAU,IAAA,EAAM,OAAO,IAAA;AAC3B,IAAA,GAAA,CAAI,MAAA,CAAO,KAAK,EAAA,IAAM,IAAA,EAAM,OAAO,KAAA;AACnC,IAAA,MAAM,MAAA,EAAQ,EAAA,IAAM,EAAA,EAAI,KAAA,EAAO,MAAA,CAAO,IAAA,CAAK,EAAA,EAAI,CAAC,CAAE,CAAA;AAClD,IAAA,MAAM,MAAA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AA,QACA,SAAA,EAAW,KAAA,CAAM;AAAA,MACnB,CAAC,CAAA;AAAA,MAED,QAAA,kBAAA,6BAAA;AAAA,QAAC,8BAAA;AAAA,QAAA;AAAA,UACC,OAAA;AAAA,UACA,MAAA,EAAQ,KAAA,CAAM,MAAA;AAAA,UACd,MAAA;AAAA,UACA,OAAA,EAAS,KAAA,CAAM,OAAA;AAAA,UACf,gBAAA;AAAA,UACA,UAAA;AAAA,UACA,iBAAA,EAAmB,KAAA,CAAM,iBAAA;AAAA,UACzB,QAAA,EAAU,eAAA;AAAA,UACV,kBAAA,EAAoB,KAAA,CAAM,kBAAA;AAAA,UAC1B,WAAA,kBAAa,KAAA,uBAAM,KAAA,+BAAO,QAAA;AAAA,UAC1B,WAAA,EAAa,KAAA,CAAM,WAAA;AAAA,UACnB,OAAA,EAAS,KAAA,CAAM;AAAA,QAAA;AAAA,MACjB;AAAA,IAAA;AAAA,EACF,CAAA;AAEJ,CAAC,CAAA;ADgHD;AACE;AACF,sCAAC","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/line-area/index.js","sourcesContent":[null,"import { memo, useMemo } from \"react\";\nimport { useSeedsChartSetup, ChartRenderer } from \"../shared/chartBase\";\nimport { getChartContainerProps } from \"../shared/chartContainer\";\nimport { buildLineAreaChartOptions } from \"./adapter\";\nimport type { LineAreaChartProps, LineAreaVariant } from \"./types\";\n\nconst AREA_VARIANTS = new Set<LineAreaVariant>([\"area\", \"areaspline\"]);\n\n/**\n * LineAreaChart — the v2 time-series line/area family.\n *\n * Like SparklineChart, the wrapper carries no styled-components: it is a plain\n * <div> whose className / inline custom properties / data-attributes come from\n * the shared getChartContainerProps contract (CE-164), and its Highcharts\n * styling ships as a static line-area.css. chart-styles.css owns the shared\n * base (background, per-series color fallback, click cursor, tooltip, legend)\n * AND the shared cross-family .seeds-chart-time-series layer (crosshair,\n * grid/axis lines, ticks, zero line, axis-label typography) that bar also uses;\n * line-area.css owns only the .seeds-chart-line / .seeds-chart-area selectors.\n * Neither is imported here — matching the Sparkline/bar convention, the component never\n * self-imports its stylesheet; consumers import both explicitly (see\n * charts/README.md).\n */\nexport const LineAreaChart = memo(function LineAreaChart(\n props: LineAreaChartProps\n) {\n const { colors, patterns } = useSeedsChartSetup({\n series: props.series,\n includePatterns: true,\n });\n const { options, annotationLookup, tooltipTimezone } = useMemo(\n () => buildLineAreaChartOptions(props),\n [props]\n );\n const hasOnClick = Boolean(props.onClick);\n const isArea = AREA_VARIANTS.has(props.variant);\n\n return (\n <div\n {...getChartContainerProps({\n familyClasses: [\n \"seeds-chart-time-series\",\n isArea ? \"seeds-chart-area\" : \"seeds-chart-line\",\n ],\n // RAW per-series colors: only an explicit consumer override is inlined\n // as --highcharts-color-N; an unset series falls through to the DS\n // palette default in chart-styles.css. ChartRenderer below still gets\n // the palette-RESOLVED `colors` for its own styled-components engine.\n colors: props.series.map((s) => s.color),\n patterns,\n hasOnClick,\n className: props.className,\n })}\n >\n <ChartRenderer\n options={options}\n series={props.series}\n colors={colors}\n tooltip={props.tooltip}\n annotationLookup={annotationLookup}\n hasOnClick={hasOnClick}\n tooltipClickLabel={props.tooltipClickLabel}\n timezone={tooltipTimezone}\n invalidNumberLabel={props.invalidNumberLabel}\n valueFormat={props.yAxis?.format}\n exportTitle={props.exportTitle}\n onReady={props.onReady}\n />\n </div>\n );\n});\n","import { buildAnnotationConfig } from \"../shared/annotations\";\nimport type { ChartAnnotationLookup } from \"../shared/annotations\";\nimport type {\n SeedsChartDataPoint,\n SeedsChartOptions,\n} from \"../shared/chartBase\";\nimport { buildBaseChartOptions } from \"../shared/baseChartOptions\";\nimport { TIME_SERIES_CHART_HEIGHT } from \"../../constants/chartOptions\";\nimport {\n buildDimensionalAxis,\n resolveTooltipTimezone,\n} from \"../shared/axisOptions\";\nimport {\n defaultValueAxisLabelFormatter,\n makeValueAxisLabelFormatter,\n} from \"../shared/valueAxisLabelFormatter\";\nimport type { ChartDataPoint } from \"../shared/axis\";\nimport type { LineAreaChartProps, LineAreaVariant } from \"./types\";\n\n// `stacking` is meaningful only for filled variants; on `line`/`spline` it's a\n// no-op, so the adapter drops it rather than emitting a misleading option.\nconst AREA_VARIANTS = new Set<LineAreaVariant>([\"area\", \"areaspline\"]);\n\ntype SeriesPoint =\n | number\n | null\n | [number, number | null]\n | SeedsChartDataPoint;\n\nfunction pointY(point: ChartDataPoint): number | null {\n if (point === null) return null;\n if (typeof point === \"number\") return point;\n if (Array.isArray(point)) return point[1];\n return point.y;\n}\n\n// Point markers are hidden by default (set on `plotOptions.series`), but an\n// *isolated* non-null point — one with a null (or the chart edge) on both\n// sides — gets a circle marker so a point with no connecting line segment\n// stays visible. Connected points pass through unchanged so the line/area\n// renders dot-free, matching the designs.\nfunction withIsolatedPointMarkers(\n data: ReadonlyArray<ChartDataPoint>\n): SeriesPoint[] {\n return data.map((point, i): SeriesPoint => {\n if (point === null) return null; // explicit gap\n if (pointY(point) === null) return point; // tuple/object with null y — a gap\n const prevY = i === 0 ? null : pointY(data[i - 1]!);\n const nextY = i === data.length - 1 ? null : pointY(data[i + 1]!);\n if (prevY !== null || nextY !== null) return point; // connected → no marker\n const marker = { enabled: true, symbol: \"circle\" as const };\n if (typeof point === \"number\") return { y: point, marker };\n if (Array.isArray(point)) return { x: point[0], y: point[1], marker };\n return { ...point, marker };\n });\n}\n\nexport function buildLineAreaChartOptions(props: LineAreaChartProps): {\n options: SeedsChartOptions;\n annotationLookup: ChartAnnotationLookup | undefined;\n /** Resolved timezone for the tooltip date formatter; undefined on category axes. */\n tooltipTimezone: string | undefined;\n} {\n const tooltipTimezone = resolveTooltipTimezone(props.xAxis, props.timezone);\n const isStacked = AREA_VARIANTS.has(props.variant) && Boolean(props.stacking);\n const { annotations, lookup: annotationLookup } = buildAnnotationConfig(\n props.annotations\n );\n\n const base = buildBaseChartOptions({\n type: props.variant,\n description: props.description,\n valueSuffix: props.valueSuffix,\n reserveTopMargin: Boolean(annotations),\n timezone: tooltipTimezone,\n });\n\n const options: SeedsChartOptions = {\n ...base,\n // Default height baseline (overridable via `props.height`) so consumers\n // who don't configure sizing keep the design-reviewed default.\n chart: {\n ...base.chart,\n // Re-assert the definite `type` so spreading the optionally-typed\n // `base.chart` doesn't widen the required `type` field to optional.\n type: props.variant,\n height: props.height ?? TIME_SERIES_CHART_HEIGHT,\n // Tight time-series spacing (from constants/chartOptions.ts) so the plot\n // area fills the 275px container; without it Highcharts' larger default\n // spacing ([10, 10, 15, 10]) shrinks the plot area.\n spacing: [5, 1, 0, 2],\n },\n xAxis: buildDimensionalAxis(props.xAxis, tooltipTimezone ?? \"UTC\"),\n yAxis: {\n min: props.yAxis?.min,\n max: props.yAxis?.max,\n // Anchor the value axis to 0 (as the bar/area families do): line/spline otherwise\n // auto-scale above 0, which truncates the axis and pushes the annotation\n // anchor (y: 0) out of range. `soft` still extends for negative data.\n softMin: 0,\n softMax: 0,\n gridLineWidth: props.yAxis?.showGridLines === false ? 0 : 1,\n // A dedicated plotLine at 0, styled distinctly from regular gridlines\n // (see chartStyles.ts).\n plotLines: [{ value: 0, className: \"y-axis-zero-line\", zIndex: 3 }],\n title: { text: props.yAxis?.title ?? \"\" },\n // Zero-config default: abbreviate value-axis ticks (1.20K / 1.20M / 1.20B).\n labels: {\n // A declarative `format` drives ticks through the shared valueFormatter;\n // absent it, the zero-config decimal default (1.20K / 1.20M / 1.20B).\n formatter: props.yAxis?.format\n ? makeValueAxisLabelFormatter(props.yAxis.format)\n : defaultValueAxisLabelFormatter,\n },\n },\n plotOptions: {\n series: {\n animation: false,\n // Hide point markers by default (per the designs); isolated points\n // re-enable their own marker via `withIsolatedPointMarkers`.\n marker: { enabled: false },\n ...(props.onClick || props.onMouseEnter || props.onMouseLeave\n ? {\n point: {\n events: {\n click: props.onClick\n ? (event) => props.onClick!({ position: event.point.x })\n : undefined,\n mouseOver: props.onMouseEnter\n ? function (this: { x: number | string }) {\n props.onMouseEnter!({ position: this.x });\n }\n : undefined,\n mouseOut: props.onMouseLeave\n ? function (this: { x: number | string }) {\n props.onMouseLeave!({ position: this.x });\n }\n : undefined,\n },\n },\n }\n : {}),\n },\n // Type-scoped stacking: only the (area) variant stacks. `isStacked` already\n // guarantees `props.variant` is an area variant here, so the computed key is\n // always a valid plotOptions slot. Matches bar's per-type placement and keeps\n // line/spline unstacked.\n ...(isStacked ? { [props.variant]: { stacking: props.stacking } } : {}),\n },\n series: props.series.map((s) => ({\n type: props.variant,\n name: s.name,\n data: withIsolatedPointMarkers(s.data),\n })),\n ...(annotations ? { annotations } : {}),\n };\n\n return { options, annotationLookup, tooltipTimezone };\n}\n"]}
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { C as ChartTooltipProps } from '../chartBase-Cn_5CUJi.mjs';
3
+ import { C as ChartTooltipProps } from '../chartBase-BClSc5EN.mjs';
4
4
  import { C as ChartExportHandle } from '../chartExport-CKYpuhik.mjs';
5
5
  import { C as ChartDataPoint, c as DimensionalAxis } from '../axis-WOeYkTO1.mjs';
6
6
  export { a as CategoryAxis, D as DatetimeAxis } from '../axis-WOeYkTO1.mjs';
@@ -1,6 +1,6 @@
1
1
  import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
- import { C as ChartTooltipProps } from '../chartBase-C-l7yYGx.js';
3
+ import { C as ChartTooltipProps } from '../chartBase-CycEw2vy.js';
4
4
  import { C as ChartExportHandle } from '../chartExport-CKYpuhik.js';
5
5
  import { C as ChartDataPoint, c as DimensionalAxis } from '../axis-WOeYkTO1.js';
6
6
  export { a as CategoryAxis, D as DatetimeAxis } from '../axis-WOeYkTO1.js';
@@ -5,8 +5,8 @@ var _chunk6D7P3IOTjs = require('../chunk-6D7P3IOT.js');
5
5
 
6
6
 
7
7
 
8
- var _chunk27M4FDNKjs = require('../chunk-27M4FDNK.js');
9
- require('../chunk-46L4YBLC.js');
8
+ var _chunkGWP3PWIGjs = require('../chunk-GWP3PWIG.js');
9
+ require('../chunk-2H2Z7PKZ.js');
10
10
 
11
11
  // src/charts/sparkline/SparklineChart.tsx
12
12
  var _react = require('react');
@@ -24,7 +24,7 @@ function buildSparklineChartOptions(props) {
24
24
  ..._chunk6D7P3IOTjs.buildDimensionalAxis.call(void 0, props.xAxis, _nullishCoalesce(tooltipTimezone, () => ( "UTC"))),
25
25
  visible: false
26
26
  } : { type: "linear", visible: false };
27
- const base = _chunk27M4FDNKjs.buildBaseChartOptions.call(void 0, {
27
+ const base = _chunkGWP3PWIGjs.buildBaseChartOptions.call(void 0, {
28
28
  type,
29
29
  description: props.description,
30
30
  valueSuffix: props.valueSuffix,
@@ -102,7 +102,7 @@ var SparklineChart = _react.memo.call(void 0, function SparklineChart2(props) {
102
102
  className,
103
103
  style: { "--seeds-sparkline-color": trendColor },
104
104
  children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
105
- _chunk27M4FDNKjs.ChartRenderer,
105
+ _chunkGWP3PWIGjs.ChartRenderer,
106
106
  {
107
107
  options,
108
108
  series: [{ name: SPARKLINE_SERIES_NAME, color: trendColor }],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sproutsocial/seeds-react-data-viz",
3
- "version": "0.21.3",
3
+ "version": "0.22.1",
4
4
  "description": "Seeds React Data Viz Components",
5
5
  "author": "Sprout Social, Inc.",
6
6
  "license": "MIT",
@@ -33,11 +33,17 @@
33
33
  "import": "./dist/esm/sparkline/index.js",
34
34
  "require": "./dist/sparkline/index.js"
35
35
  },
36
+ "./bubble": {
37
+ "types": "./dist/bubble/index.d.ts",
38
+ "import": "./dist/esm/bubble/index.js",
39
+ "require": "./dist/bubble/index.js"
40
+ },
36
41
  "./sparkline.css": "./dist/sparkline.css",
37
42
  "./chart-styles.css": "./dist/chart-styles.css",
38
43
  "./bar.css": "./dist/bar.css",
39
44
  "./donut.css": "./dist/donut.css",
40
45
  "./line-area.css": "./dist/line-area.css",
46
+ "./bubble.css": "./dist/bubble.css",
41
47
  "./charts.css": "./dist/charts.css",
42
48
  "./export": {
43
49
  "types": "./dist/export/index.d.ts",
@@ -65,17 +71,17 @@
65
71
  "dependencies": {
66
72
  "@sproutsocial/seeds-dataviz": "^0.7.3",
67
73
  "@sproutsocial/seeds-networkcolor": "^2.22.0",
68
- "@sproutsocial/seeds-react-box": "^1.1.24",
69
- "@sproutsocial/seeds-react-button": "^2.2.4",
70
- "@sproutsocial/seeds-react-duration": "^1.0.27",
71
- "@sproutsocial/seeds-react-icon": "^2.4.3",
72
- "@sproutsocial/seeds-react-menu": "^1.16.6",
73
- "@sproutsocial/seeds-react-numeral": "^1.0.51",
74
- "@sproutsocial/seeds-react-partner-logo": "^1.7.16",
75
- "@sproutsocial/seeds-react-system-props": "^3.1.2",
76
- "@sproutsocial/seeds-react-table": "^1.0.45",
77
- "@sproutsocial/seeds-react-text": "^1.5.1",
78
- "@sproutsocial/seeds-react-theme": "^4.2.0",
74
+ "@sproutsocial/seeds-react-box": "^1.1.26",
75
+ "@sproutsocial/seeds-react-button": "^2.3.0",
76
+ "@sproutsocial/seeds-react-duration": "^1.0.29",
77
+ "@sproutsocial/seeds-react-icon": "^2.4.5",
78
+ "@sproutsocial/seeds-react-menu": "^1.16.8",
79
+ "@sproutsocial/seeds-react-numeral": "^1.0.53",
80
+ "@sproutsocial/seeds-react-partner-logo": "^1.7.18",
81
+ "@sproutsocial/seeds-react-system-props": "^3.1.3",
82
+ "@sproutsocial/seeds-react-table": "^1.0.47",
83
+ "@sproutsocial/seeds-react-text": "^1.5.2",
84
+ "@sproutsocial/seeds-react-theme": "^4.3.0",
79
85
  "highcharts": "^11.4.3",
80
86
  "highcharts-react-official": "^3.2.1",
81
87
  "jspdf": "^4.2.1",
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-27M4FDNK.js","../src/charts/shared/chartBase.tsx","../src/charts/shared/ChartAnnotationMarkerPortal.tsx","../src/charts/shared/DefaultChartTooltip.tsx","../src/charts/shared/formatters/valueFormatter.ts","../src/charts/shared/SeriesLegend.tsx","../src/charts/shared/chartExport.ts","../src/charts/shared/baseChartOptions.ts"],"names":["ChartAnnotationMarkerPortal","Box","Icon","memo","jsx"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,sDAA4B;AAC5B;AACA;ACXA,gGAAuB;AACvB,oEAAgC;AAChC,+HAAoC;AACpC,uHAAkC;AAClC,+GAAgC;AAChC,4IAAuC;AACvC,oHAAiC;AACjC;AACE;AACA;AACA;AACA;AACA;AAAA,8BAEK;AACP,qDAAyB;ADYzB;AACA;AE3BA;AACA,qCAA6B;AAC7B,8DAAoB;AACpB,gEAAqB;AAiBjB,+CAAA;AAVJ,SAAS,qBAAA,CAAsB;AAAA,EAC7B,UAAA;AAAA,EACA;AACF,CAAA,EAKG;AACD,EAAA,uBACE,8BAAA,kBAAC,EAAA,EAAI,OAAA,EAAQ,MAAA,EAAO,aAAA,EAAc,QAAA,EAAS,UAAA,EAAW,QAAA,EAAS,GAAA,EAAK,GAAA,EACjE,QAAA,EAAA;AAAA,IAAA,UAAA,CAAW,KAAA,kBACV,6BAAA;AAAA,MAAC,kBAAA;AAAA,MAAA;AAAA,QACC,OAAA,EAAQ,MAAA;AAAA,QACR,UAAA,EAAW,QAAA;AAAA,QACX,cAAA,EAAe,QAAA;AAAA,QACf,KAAA,EAAM,MAAA;AAAA,QACN,MAAA,EAAO,MAAA;AAAA,QACP,EAAA,EAAG,WAAA;AAAA,QACH,YAAA,EAAa,KAAA;AAAA,QAEb,QAAA,kBAAA,6BAAA,oBAAC,EAAA,EAAK,IAAA,EAAM,UAAA,CAAW,IAAA,EAAM,IAAA,EAAK,MAAA,EAAO,KAAA,EAAM,eAAA,CAAe;AAAA,MAAA;AAAA,IAChE,EAAA,EACE,IAAA;AAAA,oBACJ,6BAAA;AAAA,MAAC,kBAAA;AAAA,MAAA;AAAA,QACC,MAAA,EAAQ,CAAA,EAAA;AACF,QAAA;AACF,Q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ACD,IAAA;AACD,IAAA;AACE,MAAA;AACA,MAAA;AACA,MAAA;AACF,MAAA;AACC,MAAA;AACG,MAAA;AACX,MAAA;AACF,IAAA;AAAA;AAAA;AAGI,IAAA;AACN,EAAA;AACF;AP6kBiB;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-27M4FDNK.js","sourcesContent":[null,"// Engine boundary for the v2 chart architecture. The only file under `charts/`\n// that imports from \"highcharts\". See `charts/README.md` for invariants.\n\nimport Highcharts from \"highcharts\";\nimport { HighchartsReact } from \"highcharts-react-official\";\nimport highchartsAccessibility from \"highcharts/modules/accessibility\";\nimport highchartsAnnotations from \"highcharts/modules/annotations\";\nimport highchartsExporting from \"highcharts/modules/exporting\";\nimport highchartsOfflineExporting from \"highcharts/modules/offline-exporting\";\nimport highchartsExportData from \"highcharts/modules/export-data\";\nimport {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n useState,\n type ReactNode,\n} from \"react\";\nimport { useTheme } from \"styled-components\";\n\nimport { ChartTooltipPortal } from \"../../components/ChartTooltip/components/ChartTooltipPortal\";\nimport { transformTimeSeriesTooltipData } from \"../../helpers\";\nimport { GlobalChartStyleOverrides } from \"../../styles/chartStyles\";\nimport { ChartAnnotationMarkerPortal } from \"./ChartAnnotationMarkerPortal\";\nimport { DefaultChartTooltip } from \"./DefaultChartTooltip\";\nimport { SeriesLegend } from \"./SeriesLegend\";\nimport type { TypeIconName } from \"@sproutsocial/seeds-react-icon\";\nimport type { TypeTheme } from \"@sproutsocial/seeds-react-theme\";\nimport { defaultFilename } from \"./chartExport\";\nimport type { ChartAnnotationLookup } from \"./annotations\";\nimport type { ValueFormat } from \"./formatters/valueFormatter\";\nimport type { ChartExportHandle } from \"./chartExport\";\nimport type { TypeChartStyleColor, TypeChartStylePattern } from \"../../types\";\n\nhighchartsAccessibility(Highcharts);\nhighchartsAnnotations(Highcharts);\n// `exporting` must register before `offline-exporting` and `export-data`, which\n// extend it. `exporting` adds a native context (hamburger) button by default;\n// `ChartRenderer` disables it on the chart options so v2 charts expose export\n// only through the `onReady` handle. Export is client-side/offline only —\n// we never call the Highcharts export server.\nhighchartsExporting(Highcharts);\nhighchartsOfflineExporting(Highcharts);\nhighchartsExportData(Highcharts);\n\n/** Highcharts series type. `column` is vertical bars; `bar` is horizontal bars; the line/area family adds the rest; `pie` is donut/pie. */\nexport type SeedsChartType =\n | \"column\"\n | \"bar\"\n | \"line\"\n | \"spline\"\n | \"area\"\n | \"areaspline\"\n | \"pie\";\n\nexport interface SeedsChartMarkerOptions {\n enabled?: boolean;\n symbol?: \"circle\";\n}\n\n/** Object form of a series point — carries an optional per-point `marker` override. */\nexport interface SeedsChartDataPoint {\n x?: number;\n y: number | null;\n marker?: SeedsChartMarkerOptions;\n}\n\nexport interface SeedsChartSeriesOptions {\n type: SeedsChartType;\n name: string;\n data: Array<number | null | [number, number | null] | SeedsChartDataPoint>;\n color?: string;\n}\n\n/**\n * Seeds-local shape of the `this` context Highcharts binds when invoking an\n * axis-label `formatter`. Models only the fields our default formatter reads\n * (`value` and `axis.tickPositions`).\n */\nexport interface SeedsAxisLabelFormatterContext {\n value: number | string;\n axis: { tickPositions?: ReadonlyArray<number> };\n}\n\nexport interface SeedsChartAxisLabelOptions {\n useHTML?: boolean;\n /** Show the axis tick labels. Maps to Highcharts' `labels.enabled`; defaults to shown. */\n enabled?: boolean;\n /** `this`-bound tick-label formatter returning the rendered string. */\n formatter?: (this: SeedsAxisLabelFormatterContext) => string;\n}\n\n/**\n * Highcharts datetime tick-label formats, keyed by the auto-selected tick unit.\n * Only the units the chart families set are modeled; Highcharts merges the rest\n * with its own defaults.\n */\nexport interface SeedsChartDateTimeLabelFormats {\n hour?: string;\n day?: string;\n week?: string;\n month?: string;\n year?: string;\n}\n\nexport interface SeedsChartAxisTitleOptions {\n text: string;\n}\n\nexport interface SeedsChartXAxisOptions {\n type?: \"category\" | \"datetime\" | \"linear\";\n categories?: Array<string>;\n crosshair?: boolean;\n min?: number;\n max?: number;\n /** Hide the axis line, ticks, and labels entirely (e.g. sparklines). Maps to Highcharts' `visible`. */\n visible?: boolean;\n labels?: SeedsChartAxisLabelOptions;\n dateTimeLabelFormats?: SeedsChartDateTimeLabelFormats;\n}\n\nexport interface SeedsChartYAxisOptions {\n min?: number;\n max?: number;\n /** Soft minimum — the axis won't start above this value, but may extend below it for negative data. */\n softMin?: number;\n /** Soft maximum — the axis won't end below this value, but may extend above it. */\n softMax?: number;\n gridLineWidth?: number;\n /** Hide the axis line, ticks, and labels entirely (e.g. sparklines). Maps to Highcharts' `visible`. */\n visible?: boolean;\n title?: SeedsChartAxisTitleOptions;\n labels?: SeedsChartAxisLabelOptions;\n /** Reference lines drawn across the plot area (e.g. the 0 baseline). `color` is only needed for the styledMode:false export clone, which can't reach scoped CSS. */\n plotLines?: Array<{\n value: number;\n className?: string;\n color?: string;\n zIndex?: number;\n }>;\n}\n\nexport interface SeedsChartTooltipOptions {\n enabled?: boolean;\n // `useHTML` is intentionally not here — it's hardcoded `true` at the engine\n // boundary (ChartRenderer) because the tooltip portal can't work without it.\n outside?: boolean;\n padding?: number;\n shape?: \"rect\" | \"callout\";\n shared?: boolean;\n hideDelay?: number;\n valueSuffix?: string;\n}\n\nexport interface SeedsChartSeriesPlotOptions {\n animation?: boolean;\n /** Stacking applied across all series. Used by the line/area family for `stacked-area`. */\n stacking?: \"normal\" | \"percent\";\n /** Point-level event wiring (e.g. click). The events shape is family-agnostic. */\n point?: { events?: SeedsChartPointEvents };\n /** Default point-marker visibility. The line/area family disables markers and re-enables them per isolated point. */\n marker?: SeedsChartMarkerOptions;\n}\n\nexport interface SeedsChartPointEventContext {\n x: number | string;\n series: {\n name: string;\n index: number;\n chart: {\n series: ReadonlyArray<{\n type: string;\n data: ReadonlyArray<{\n x: number | string;\n graphic?: { element?: Element };\n }>;\n }>;\n };\n };\n}\n\nexport interface SeedsChartPointEvents {\n mouseOver?: (this: SeedsChartPointEventContext) => void;\n mouseOut?: (this: SeedsChartPointEventContext) => void;\n click?: (event: { point: { x: number | string } }) => void;\n}\n\nexport interface SeedsChartColumnPointOptions {\n events?: SeedsChartPointEvents;\n}\n\nexport interface SeedsChartColumnPlotOptions {\n stacking?: \"normal\" | \"percent\";\n pointPadding?: number;\n groupPadding?: number;\n pointWidth?: number;\n borderRadius?: number;\n borderWidth?: number;\n point?: SeedsChartColumnPointOptions;\n}\n\n/** Type-scoped stacking for filled line-area variants (parity with `column`). */\nexport interface SeedsChartAreaPlotOptions {\n stacking?: \"normal\" | \"percent\";\n}\n\nexport interface SeedsChartPiePlotOptions {\n /** `\"60%\"` for donut (hollow center), `0` for a solid pie. */\n innerSize?: string | number;\n animation?: boolean;\n /** Must be set in JS (not CSS) — Highcharts computes the arc path before CSS is applied. */\n borderRadius?: number;\n dataLabels?: { enabled?: boolean };\n states?: { inactive?: { opacity?: number } };\n /** Pie point events: `this` is the Highcharts Point object (carries `name`, etc.). */\n point?: {\n events?: {\n click?: (this: { name: string }) => void;\n mouseOver?: (this: { name: string }) => void;\n mouseOut?: (this: { name: string }) => void;\n };\n };\n}\n\n/** A single data point in a pie/donut series. Seeds-vocab — no Highcharts imports. */\nexport interface PiePoint {\n name: string;\n y: number | null;\n color?: string;\n}\n\n/** Series options for pie/donut charts. `data` is per-point objects, not x/y tuples. */\nexport interface SeedsChartPieSeriesOptions {\n type: \"pie\";\n name: string;\n data: Array<PiePoint>;\n color?: string;\n}\n\nexport interface SeedsChartPlotOptions {\n series?: SeedsChartSeriesPlotOptions;\n // `column` (vertical bars) and `bar` (horizontal bars) take the same option\n // shape; the bar adapter assigns one config under whichever key is active.\n column?: SeedsChartColumnPlotOptions;\n bar?: SeedsChartColumnPlotOptions;\n area?: SeedsChartAreaPlotOptions;\n areaspline?: SeedsChartAreaPlotOptions;\n pie?: SeedsChartPiePlotOptions;\n}\n\nexport interface SeedsChartChartOptions {\n type: SeedsChartType;\n styledMode?: boolean;\n animation?: boolean;\n marginTop?: number;\n height?: number;\n /** `[top, right, bottom, left]` chart spacing. Donut zeroes it so the ring fills the height; sparklines zero it so the plot fills the container. */\n spacing?: [number, number, number, number];\n}\n\nexport interface SeedsChartAnnotationLabelOptions {\n point: { x: number; y: number; xAxis: 0; yAxis: 0 };\n /** Highcharts shows a default label if this is empty; pass `\" \"` to suppress. */\n text?: string;\n}\n\n/**\n * Shared options applied to every label in a Highcharts annotation block.\n * `useHTML: true` is load-bearing — it makes Highcharts attach an HTML\n * `graphic.div` to each label, which `ChartAnnotationMarkerPortal` portals\n * React content into. Without it, labels render as SVG `<text>` and the\n * portal finds no containers.\n */\nexport interface SeedsChartAnnotationLabelOptionsShared {\n useHTML?: boolean;\n padding?: number;\n}\n\nexport interface SeedsChartAnnotationsOptions {\n labels?: SeedsChartAnnotationLabelOptions[];\n labelOptions?: SeedsChartAnnotationLabelOptionsShared;\n}\n\nexport interface SeedsChartAccessibilityOptions {\n description?: string;\n}\n\nexport interface SeedsChartTitleOptions {\n text?: string;\n}\n\nexport interface SeedsChartCreditsOptions {\n enabled?: boolean;\n}\n\nexport interface SeedsChartLegendOptions {\n enabled?: boolean;\n}\n\n/** Maps to Highcharts `time` — chart-global; `timezone` only affects datetime axes. */\nexport interface SeedsChartTimeOptions {\n timezone?: string;\n}\n\nexport interface SeedsChartOptions {\n chart?: SeedsChartChartOptions;\n accessibility?: SeedsChartAccessibilityOptions;\n title?: SeedsChartTitleOptions;\n credits?: SeedsChartCreditsOptions;\n legend?: SeedsChartLegendOptions;\n tooltip?: SeedsChartTooltipOptions;\n time?: SeedsChartTimeOptions;\n xAxis?: SeedsChartXAxisOptions;\n yAxis?: SeedsChartYAxisOptions;\n plotOptions?: SeedsChartPlotOptions;\n series?: Array<SeedsChartSeriesOptions | SeedsChartPieSeriesOptions>;\n annotations?: SeedsChartAnnotationsOptions[];\n}\n\n/**\n * A summed Total is only meaningful when the chart stacks its series (a stack\n * is, by definition, an additive composition). Returns true if any plotOptions\n * slot (series/column/bar/area/areaspline) carries a truthy `stacking`. Kept\n * key-agnostic so new stacked families are covered without changes here.\n */\nexport function isChartStacked(options: SeedsChartOptions): boolean {\n const plotOptions = options.plotOptions;\n if (!plotOptions) return false;\n return Object.values(plotOptions).some(\n (slot) =>\n slot != null &&\n typeof slot === \"object\" &&\n Boolean((slot as { stacking?: unknown }).stacking)\n );\n}\n\nexport interface SeedsChartSetupSeriesInput {\n color?: string;\n pattern?: TypeChartStylePattern;\n}\n\nexport interface UseSeedsChartSetupParams<\n T extends SeedsChartSetupSeriesInput = SeedsChartSetupSeriesInput\n> {\n series: Array<T>;\n /** Opt-in for the pattern array. Families that apply patterns (line, area) pass `true`. */\n includePatterns?: boolean;\n /**\n * Resolved effective cap (the family default, or the consumer's explicit\n * value). Series beyond it are dropped. Omit to disable capping entirely.\n */\n seriesLimit?: number;\n /**\n * Whether the consumer set `seriesLimit` explicitly. Suppresses the over-limit\n * warning (an explicit cap is intentional, not an accidental overflow).\n * Default `false`.\n */\n isSeriesLimitOverridden?: boolean;\n /** Opt out of the over-limit warning. Default `false`. */\n hideSeriesLimitWarning?: boolean;\n /** Component name used in the over-limit warning message (kept generic for future families). */\n componentName?: string;\n}\n\nexport interface UseSeedsChartSetupResult<\n T extends SeedsChartSetupSeriesInput = SeedsChartSetupSeriesInput\n> {\n theme: TypeTheme;\n colors: Array<TypeChartStyleColor>;\n patterns: Array<TypeChartStylePattern>;\n /** Series after applying the (optional) cap. Referentially equal to the input when no cap applies. */\n series: Array<T>;\n}\n\nexport function useSeedsChartSetup<\n T extends SeedsChartSetupSeriesInput = SeedsChartSetupSeriesInput\n>({\n series,\n includePatterns = false,\n seriesLimit,\n isSeriesLimitOverridden = false,\n hideSeriesLimitWarning = false,\n componentName,\n}: UseSeedsChartSetupParams<T>): UseSeedsChartSetupResult<T> {\n const theme = useTheme() as TypeTheme;\n const palette = theme.colors.DATAVIZ_COLORS_LIST;\n\n // Cap the series at the resolved limit. Memoized so the input reference is\n // preserved when no cap applies, keeping the colors/patterns memos\n // referentially stable.\n const cappedSeries = useMemo<Array<T>>(\n () =>\n seriesLimit !== undefined &&\n seriesLimit >= 1 &&\n series.length > seriesLimit\n ? series.slice(0, seriesLimit)\n : series,\n [series, seriesLimit]\n );\n\n // Warn when the limit was exceeded, was not explicitly overridden by the\n // consumer, and the warning isn't suppressed. Keyed off the gating conditions\n // so it fires when those change rather than on every render.\n useEffect(() => {\n if (\n seriesLimit !== undefined &&\n seriesLimit >= 1 &&\n series.length > seriesLimit &&\n !isSeriesLimitOverridden &&\n !hideSeriesLimitWarning &&\n componentName != null\n ) {\n console.warn(\n `${componentName}: Maximum number of series (${seriesLimit}) exceeded. Only the first ${seriesLimit} series will be displayed.`\n );\n }\n }, [\n series.length,\n seriesLimit,\n isSeriesLimitOverridden,\n hideSeriesLimitWarning,\n componentName,\n ]);\n\n const colors = useMemo<Array<TypeChartStyleColor>>(() => {\n const out: TypeChartStyleColor[] = [];\n const paletteLen = palette.length;\n for (let i = 0; i < cappedSeries.length; i++) {\n const s = cappedSeries[i]!;\n out.push(s.color ?? palette[i % paletteLen] ?? \"\");\n }\n return out;\n }, [cappedSeries, palette]);\n\n const patterns = useMemo<Array<TypeChartStylePattern>>(() => {\n if (!includePatterns) return [];\n const out: TypeChartStylePattern[] = [];\n for (let i = 0; i < cappedSeries.length; i++) {\n const s = cappedSeries[i]!;\n out.push(s.pattern ?? \"solid\");\n }\n return out;\n }, [cappedSeries, includePatterns]);\n\n return { theme, colors, patterns, series: cappedSeries };\n}\n\nexport interface ChartRendererSeries {\n name: string;\n color?: string;\n /** Seeds icon or partner-logo name rendered before the series name in the legend label. */\n icon?: TypeIconName;\n}\n\nexport interface ChartTooltipDataRow {\n color: TypeChartStyleColor;\n name: string;\n value: number | null;\n /** Slice percentage — populated by pie/donut tooltips; `undefined` for bar/line-area rows. */\n percent?: number;\n}\n\n/** Tooltip render-prop signature for v2 charts. */\nexport interface ChartTooltipProps {\n data: ChartTooltipDataRow[];\n /** Resolved x-axis position. Category name for category axes, numeric for time/linear. */\n position: number | string;\n /** Suppress the default tooltip's title row. Set for pie/donut, which have no x-axis position — the title would just duplicate the single slice's name. */\n hideTitle?: boolean;\n /** Resolved chart timezone — pass to date formatters when `position` is a numeric timestamp. Undefined on category axes. */\n timezone?: string;\n /** Declarative annotation anchored at this position, if any. Rendered in the tooltip header. */\n annotation?: {\n icon?: TypeIconName;\n color?: string;\n title?: string;\n description?: string;\n };\n /** True when the chart has an `onClick` handler — used by the default tooltip to render the click-label footer. */\n hasOnClick?: boolean;\n /** Footer content shown in the default tooltip when the chart is clickable. */\n tooltipClickLabel?: ReactNode;\n /** Content shown in place of a row's value when the value is null. Defaults to an em-dash. */\n invalidNumberLabel?: ReactNode;\n /** Declarative value format for the tooltip value cell. Omit for raw rendering. Applied at full precision (abbreviation off). */\n valueFormat?: ValueFormat;\n}\n\nexport interface ChartRendererProps {\n options: SeedsChartOptions;\n series: Array<ChartRendererSeries>;\n /** Theme-aware palette resolved by `useSeedsChartSetup`. Used as the swatch color for any series that doesn't carry an explicit `color`. */\n colors: ReadonlyArray<TypeChartStyleColor>;\n /** Override for the default tooltip content. Portal is always rendered — `GlobalChartStyleOverrides` makes Highcharts' native tooltip box transparent. */\n tooltip?: (args: ChartTooltipProps) => ReactNode;\n /**\n * Resolved annotations keyed by numeric x. Drives both the in-chart marker\n * portal and the tooltip-header `annotation` injection. The family component\n * builds this map (resolving category-string positions to indices); the\n * renderer is axis-type agnostic.\n */\n annotationLookup?: ChartAnnotationLookup;\n /** Forwarded into the default tooltip so it can render the click-label footer. */\n hasOnClick?: boolean;\n /** Forwarded into the default tooltip for click-label footer rendering. */\n tooltipClickLabel?: ReactNode;\n /** Resolved chart timezone, forwarded to the tooltip so its date title matches the axis ticks. Undefined on category axes. */\n timezone?: string;\n /** Forwarded into the default tooltip as the null-value override. */\n invalidNumberLabel?: ReactNode;\n /** Forwarded into the default tooltip to format the value cell declaratively. */\n valueFormat?: ValueFormat;\n /**\n * Suppress the Seeds series legend beneath the chart. Default `false` (the\n * legend renders). Decorative charts (e.g. sparklines) pass `true` to hide it.\n */\n hideLegend?: boolean;\n /**\n * Chart title baked into the exported image only. The on-screen title is a\n * React sibling outside the chart SVG, so it can't be captured on export;\n * `exportTitle` threads the text into the `styledMode:false` export clone as a\n * themed native Highcharts title. It never renders on the live chart. Omit for\n * no title.\n */\n exportTitle?: string;\n /**\n * Fired once per chart instance with an opaque {@link ChartExportHandle} for\n * triggering PNG/SVG/PDF/CSV downloads. Re-fires only on a genuine remount,\n * never on data or prop updates.\n */\n onReady?: (handle: ChartExportHandle) => void;\n}\n\n/**\n * Runtime shape of one Highcharts annotation label — only the fields the\n * marker portal reads. Re-exported so the portal stays inside the engine\n * boundary (no direct \"highcharts\" import).\n */\nexport interface ChartAnnotationRuntimeLabel {\n graphic?: { div?: HTMLDivElement };\n options?: { point?: { x?: number } };\n}\n\n/** Runtime shape of one Highcharts annotation block (a group of labels). */\nexport interface ChartAnnotationRuntime {\n labels?: ChartAnnotationRuntimeLabel[];\n}\n\n/** Highcharts doesn't include the `annotations` array on its `Chart` type. */\ninterface ChartWithAnnotations extends Highcharts.Chart {\n annotations?: ChartAnnotationRuntime[];\n}\n\n/** Inputs for the `styledMode: false` export clone (see `buildExportChartOptions`). */\ninterface ExportChartOptionsParams {\n theme: TypeTheme;\n colors: ReadonlyArray<TypeChartStyleColor>;\n /** Title baked into the export clone only; omit/blank for no native title. */\n exportTitle?: string;\n}\n\n/**\n * Theme→options map for the `styledMode: false` export clone, which can't see\n * the scoped CSS v2 charts normally style with. Mirrors `styles/chartStyles`.\n */\nfunction buildExportChartOptions({\n theme,\n colors,\n exportTitle: rawTitle,\n}: ExportChartOptionsParams): Highcharts.Options {\n // Trim so a whitespace-only title never reserves title space in the export.\n const exportTitle = rawTitle?.trim();\n // Line, gridline, and label styling are identical for both axes.\n const axisOptions = {\n lineColor: theme.colors.container.border.base,\n gridLineColor: theme.colors.container.border.base,\n labels: {\n style: {\n color: theme.colors.text.subtext,\n fontFamily: theme.fontFamily,\n fontSize: theme.typography[100].fontSize,\n fontWeight: String(theme.fontWeights.normal),\n },\n },\n };\n return {\n chart: {\n styledMode: false,\n backgroundColor: theme.colors.container.background.base,\n },\n // Series without an explicit `color` fall through to this palette by index.\n colors: [...colors],\n // The on-screen legend is a React sibling (`SeriesLegend`) outside the chart\n // SVG, so the export can't capture it. Turn on Highcharts' native legend for\n // the clone instead, themed to approximate the Seeds `ChartLegend` (centered\n // row of swatch + `text.subtext` label). It can't reproduce per-series Seeds\n // icons — those series show colour + name only.\n legend: {\n enabled: true,\n symbolRadius: 4,\n symbolHeight: 12,\n symbolWidth: 12,\n itemStyle: {\n color: theme.colors.text.subtext,\n fontFamily: theme.fontFamily,\n fontSize: theme.typography[200].fontSize,\n fontWeight: String(theme.fontWeights.normal),\n },\n },\n xAxis: {\n ...axisOptions,\n crosshair: {\n color: theme.colors.container.border.decorative.neutral,\n width: 1,\n },\n },\n yAxis: {\n ...axisOptions,\n // The live chart's plotLines (set by the adapter) merge with this by\n // array index, so `className`/`value`/`zIndex` survive — this only adds\n // the color the `y-axis-zero-line` CSS class can't reach in styledMode:false.\n plotLines: [\n { value: 0, color: theme.colors.container.border.decorative.neutral },\n ],\n },\n // The on-screen title is a React sibling (`Text.SmallSubHeadline`) rendered\n // above the chart, outside the SVG, so the export can't capture it. Bake a\n // themed native Highcharts title into the clone instead (same treatment as\n // the legend above), styled to match the Seeds SmallSubHeadline. Guarded so a\n // chart with no title produces no native title in the export.\n ...(exportTitle\n ? {\n title: {\n text: exportTitle,\n style: {\n color: theme.colors.text.headline,\n fontFamily: theme.fontFamily,\n fontSize: theme.typography[200].fontSize,\n fontWeight: String(theme.fontWeights.bold),\n },\n },\n }\n : {}),\n } as Highcharts.Options;\n}\n\n/**\n * Build the opaque export handle for a chart instance. Lives here — not in\n * `chartExport.ts` — because it closes over the live `Highcharts.Chart`, which\n * never leaves the engine boundary. The returned {@link ChartExportHandle} is\n * Highcharts-free.\n *\n * PDF lazy-loads jspdf + svg2pdf.js (a deferred chunk) on first use.\n */\nfunction createChartExportHandle(\n chart: Highcharts.Chart,\n getExportChartOptions: () => Highcharts.Options\n): ChartExportHandle {\n const resolveName = (filename?: string) =>\n filename ?? defaultFilename(chart.options.chart?.type, new Date());\n\n const exportImage = async (\n type: Highcharts.ExportingMimeTypeValue,\n filename?: string\n ): Promise<void> => {\n // Read options at call time, not when the handle was built: a light/dark\n // toggle updates the chart in place without re-firing `onReady`, so the\n // export must reflect the current theme. 2nd arg is deep-merged, so\n // `labels.style` here merges with the live axis `formatter`, not clobbers it.\n chart.exportChartLocal(\n { type, filename: resolveName(filename) },\n getExportChartOptions()\n );\n };\n\n return {\n exportPNG: ({ filename } = {}) => exportImage(\"image/png\", filename),\n exportSVG: ({ filename } = {}) => exportImage(\"image/svg+xml\", filename),\n exportPDF: async ({ filename } = {}): Promise<void> => {\n // Lazy-load jspdf + svg2pdf.js (deferred chunk) and expose `window.jspdf`\n // before exporting, so Highcharts' offline-exporting renders the PDF\n // locally rather than fetching the libs from its CDN.\n const { loadPdfExportLibs } = await import(\"./pdfExportLibs\");\n loadPdfExportLibs();\n await exportImage(\"application/pdf\", filename);\n },\n exportCSV: async ({ filename } = {}): Promise<void> => {\n // `downloadCSV()` reads the filename from `chart.options.exporting.filename`\n // via `getFilename()`. Set it transiently (direct mutation — no `update()`,\n // so no redraw) so the per-call override and generated default both apply,\n // then restore the previous value.\n const exporting = (chart.options.exporting ??= {});\n const previous = exporting.filename;\n exporting.filename = resolveName(filename);\n try {\n chart.downloadCSV();\n } finally {\n exporting.filename = previous;\n }\n },\n };\n}\n\nexport function ChartRenderer({\n options,\n series,\n colors,\n tooltip,\n annotationLookup,\n hasOnClick,\n tooltipClickLabel,\n timezone,\n invalidNumberLabel,\n valueFormat,\n hideLegend = false,\n exportTitle,\n onReady,\n}: ChartRendererProps) {\n const [chart, setChart] = useState<Highcharts.Chart | null>(null);\n const [plotHeight, setPlotHeight] = useState(0);\n // Wrap the default tooltip so unstacked families (line/spline, unstacked\n // area, grouped bar) suppress the summed Total, which is meaningless there.\n // When a consumer supplies `tooltip`, DefaultChartTooltip is bypassed and\n // never sees `hideTotal` — the escape hatch and public props stay untouched.\n const chartIsStacked = isChartStacked(options);\n const renderTooltip =\n tooltip ??\n ((args) => DefaultChartTooltip({ ...args, hideTotal: !chartIsStacked }));\n const theme = useTheme() as TypeTheme;\n\n // Hold the live theme + palette in a ref so the export handle reads the\n // *current* theme at call time (see `createChartExportHandle`). A dark-mode\n // toggle updates this each render without re-firing `onReady`.\n const exportThemeRef = useRef({ theme, colors, exportTitle });\n exportThemeRef.current = { theme, colors, exportTitle };\n\n // Capture only the live chart. Highcharts reuses a chart's `callback` when it\n // builds the throwaway clone for export (`new chart.constructor(options,\n // chart.callback)` in exporting/offline-exporting, with `chart.forExport:\n // true`). That clone is destroyed the instant its SVG is captured, so binding\n // React state to it would leave a destroyed chart whose next `update()` reads\n // `options.responsive` on `undefined` and throws.\n const captureChart = useCallback((chartInstance: Highcharts.Chart) => {\n const forExport = (\n chartInstance.options.chart as { forExport?: boolean } | undefined\n )?.forExport;\n if (!forExport) {\n setChart(chartInstance);\n // Seed plotHeight in the same commit as the chart so markers render with\n // it, not a frame later (the pop-in). The redraw handler keeps it current.\n setPlotHeight(chartInstance.plotHeight);\n }\n }, []);\n\n // Hold `onReady` in a ref so an inline callback (new identity each render)\n // doesn't re-fire the effect below — it should fire on instance change only.\n const onReadyRef = useRef(onReady);\n onReadyRef.current = onReady;\n\n // Fire `onReady` once per chart instance. The chart callback runs only on\n // instance creation — data/prop changes call `chart.update()` on the same\n // instance and don't re-run it — so keying on `[chart]` gives once-per-instance\n // semantics: re-fires on a genuine remount, never on a data update.\n useEffect(() => {\n if (!chart) return;\n onReadyRef.current?.(\n createChartExportHandle(chart, () =>\n buildExportChartOptions(exportThemeRef.current)\n )\n );\n }, [chart]);\n\n // Track the chart's actual plot-area height so the annotation marker line\n // spans it. Re-reads on Highcharts' `redraw` event (covers window resizes,\n // data updates, anything that re-lays-out the plot area).\n useEffect(() => {\n if (!chart) return;\n setPlotHeight(chart.plotHeight);\n const unbind = Highcharts.addEvent(chart, \"redraw\", () => {\n setPlotHeight(chart.plotHeight);\n });\n return () => unbind();\n }, [chart]);\n\n // Stable ref across internal re-renders (setChart/setPlotHeight): HighchartsReact\n // keys its update effect on the options ref and redraws on change, so a fresh\n // object each render would redraw — and re-flicker the annotations — every time.\n const highchartsOptions = useMemo(\n () =>\n ({\n ...options,\n // useHTML is load-bearing: the tooltip portal's target div only mounts\n // when the label renders as HTML, not SVG (see `charts/README.md`).\n tooltip: { ...options.tooltip, useHTML: true },\n // Client-side/offline export only; native context button hidden (export\n // is exposed via the `onReady` handle).\n exporting: {\n fallbackToExportServer: false,\n buttons: { contextButton: { enabled: false } },\n },\n } as Highcharts.Options),\n [options]\n );\n\n // Safety net: no series → render nothing. Families are expected to early-return\n // before calling hooks to avoid wasted work, but this guards future families\n // that forget. See `charts/README.md` (\"Empty-data handling\").\n if (series.length === 0) return null;\n\n const chartWithAnnotations = chart as ChartWithAnnotations | null;\n const hasRenderedAnnotations =\n !!chartWithAnnotations?.annotations?.length &&\n !!annotationLookup?.size &&\n plotHeight > 0;\n\n return (\n <>\n <GlobalChartStyleOverrides />\n <HighchartsReact\n highcharts={Highcharts}\n // Structural cast at the engine seam — the only place we touch Highcharts' option types.\n options={highchartsOptions}\n callback={captureChart}\n />\n {hasRenderedAnnotations ? (\n <ChartAnnotationMarkerPortal\n annotationLookup={annotationLookup}\n annotationContext={chartWithAnnotations!.annotations![0]!}\n chartContainer={chartWithAnnotations!.container}\n plotHeight={plotHeight}\n />\n ) : null}\n {chart ? (\n <ChartTooltipPortal\n chart={chart}\n renderContent={(context) => {\n // Pie context has a single `point`; time-series has a `points` array.\n // Discriminate on the absence of `points` — pie never has it.\n const ctx = context as {\n point: {\n name: string;\n y: number | null;\n color: string;\n percentage: number;\n };\n points?: unknown[];\n key?: string;\n };\n const isPie = !ctx.points;\n const data: ChartTooltipDataRow[] = isPie\n ? [\n {\n color: ctx.point.color,\n name: ctx.point.name,\n value: ctx.point.y,\n percent: ctx.point.percentage,\n },\n ]\n : // Drop v1's `readonly` array wrapper and `icon` field at the seam —\n // the v2 surface is mutable and doesn't expose row-level icons.\n transformTimeSeriesTooltipData({\n context,\n data: series.map((s, i) => ({\n name: s.name,\n points: [],\n styles: { color: s.color ?? colors[i] ?? \"\" },\n })),\n }).map((row) => ({\n color: row.color,\n name: row.name,\n value: row.value,\n }));\n // For pie, `context.x` is the numeric slice index — use `context.key`\n // (the slice name) as the tooltip title instead.\n // For time-series, `context.x` is the timestamp/category value.\n // The annotation lookup always uses `context.point.x` (numeric).\n const position = isPie\n ? ctx.key ?? ctx.point.name\n : (context.x as number | string);\n const resolved = annotationLookup?.get(context.point.x as number);\n const annotation = resolved\n ? {\n icon: resolved.icon,\n color: resolved.color,\n title: resolved.title,\n description: resolved.description,\n }\n : undefined;\n return renderTooltip({\n data,\n position,\n // Pie has no x-axis position; its title would just repeat the slice name.\n hideTitle: isPie,\n annotation,\n hasOnClick,\n tooltipClickLabel,\n timezone,\n invalidNumberLabel,\n valueFormat,\n });\n }}\n />\n ) : null}\n {hideLegend ? null : (\n <div className=\"seeds-chart-legend\">\n <SeriesLegend\n items={series.map((s, i) => ({\n name: s.name,\n icon: s.icon,\n color: s.color ?? colors[i] ?? \"\",\n }))}\n />\n </div>\n )}\n </>\n );\n}\n","// Portals DS-owned marker content into Highcharts annotation containers. The\n// marker shape (icon + vertical line in the configured color) is rendered\n// internally — consumers don't supply React nodes. See CE-7.\n\nimport { memo, useEffect, useRef, useState } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\nimport { Icon } from \"@sproutsocial/seeds-react-icon\";\nimport type { ChartAnnotationLookup, ChartAnnotation } from \"./annotations\";\nimport type {\n ChartAnnotationRuntime,\n ChartAnnotationRuntimeLabel,\n} from \"./chartBase\";\n\nfunction ChartAnnotationMarker({\n annotation,\n lineHeight,\n}: {\n annotation: ChartAnnotation;\n /** Vertical pixel length of the marker line. Driven by `chart.plotHeight`\n * so the line spans the chart's full plot area regardless of chart size. */\n lineHeight: number;\n}) {\n return (\n <Box display=\"flex\" flexDirection=\"column\" alignItems=\"center\" gap={200}>\n {annotation.icon ? (\n <Box\n display=\"flex\"\n alignItems=\"center\"\n justifyContent=\"center\"\n width=\"20px\"\n height=\"20px\"\n bg=\"icon.base\"\n borderRadius=\"50%\"\n >\n <Icon name={annotation.icon} size=\"mini\" color=\"icon.inverse\" />\n </Box>\n ) : null}\n <Box\n height={`${lineHeight}px`}\n width=\"0.5px\"\n bg={annotation.color ?? \"neutral.200\"}\n />\n </Box>\n );\n}\n\n// v2-specific marker attribute. Distinct from v1's `data-annotation-marker`\n// so v1 and v2 portals don't sweep each other's containers when both render\n// side-by-side (e.g. in the v1↔v2 comparison story).\nconst MARKER_ATTR = \"data-v2-chart-annotation-marker\";\n\nexport const ChartAnnotationMarkerPortal = memo(\n function ChartAnnotationMarkerPortal({\n annotationLookup,\n annotationContext,\n chartContainer,\n plotHeight,\n }: {\n annotationLookup: ChartAnnotationLookup;\n annotationContext: ChartAnnotationRuntime;\n /** The chart's own DOM root — every query is scoped here to keep\n * multi-chart renders from interfering. */\n chartContainer: HTMLElement;\n /** Highcharts' current plot-area height in pixels. Drives the marker\n * line length so it spans the chart's plot area at any chart size. */\n plotHeight: number;\n }) {\n const annotationContainers = useRef<Record<number, HTMLDivElement>>({});\n const [, setRenderCount] = useState(0);\n const forceRender = () => setRenderCount((prev) => prev + 1);\n\n useEffect(() => {\n if (!annotationContext.labels) return;\n\n const newContainers: Record<number, HTMLDivElement> = {};\n const existingAnnotationContainers = chartContainer.querySelectorAll(\n `div[${MARKER_ATTR}='true']`\n );\n\n // 1. Mark this chart's existing markers as stale before updating.\n // Highcharts doesn't clean these up, so we sweep them below.\n existingAnnotationContainers.forEach((annotation) =>\n annotation.setAttribute(MARKER_ATTR, \"false\")\n );\n\n annotationContext.labels.forEach((label: ChartAnnotationRuntimeLabel) => {\n const labelElement = label.graphic?.div;\n if (!labelElement) return;\n\n // 2. Reuse this label's existing marker div when present — Highcharts\n // repositions (rather than recreates) annotation graphics across\n // redraws, so reusing keeps the React portal mounted and avoids the\n // teardown→recreate flash. Only create one when absent.\n let annotationDiv = labelElement.querySelector<HTMLDivElement>(\n `div[${MARKER_ATTR}]`\n );\n if (!annotationDiv) {\n annotationDiv = document.createElement(\"div\");\n labelElement.appendChild(annotationDiv);\n }\n annotationDiv.setAttribute(MARKER_ATTR, \"true\");\n\n const xValue = label.options?.point?.x as number;\n newContainers[xValue] = annotationDiv;\n });\n\n annotationContainers.current = newContainers;\n forceRender();\n\n // 4. Within this chart's container, remove `.highcharts-annotation`\n // parents that no longer have any live v2 marker child.\n requestAnimationFrame(() => {\n chartContainer\n .querySelectorAll(\"div.highcharts-annotation\")\n .forEach((annotationDiv) => {\n const reactAnnotations = annotationDiv.querySelectorAll(\n `div[${MARKER_ATTR}]`\n );\n const hasActiveAnnotations = Array.from(reactAnnotations).some(\n (div) => div.getAttribute(MARKER_ATTR) === \"true\"\n );\n if (!hasActiveAnnotations) annotationDiv.remove();\n });\n });\n }, [annotationContext.labels, annotationLookup, chartContainer]);\n\n return (\n <>\n {Object.entries(annotationContainers.current).map(\n ([xValue, container]) => {\n const annotation = annotationLookup.get(Number(xValue));\n return annotation\n ? createPortal(\n <ChartAnnotationMarker\n annotation={annotation}\n lineHeight={plotHeight}\n />,\n container\n )\n : null;\n }\n )}\n </>\n );\n }\n);\n","// Minimal: no locale / currency / duration formatting. Consumers needing those pass their own `tooltip` render prop.\n\nimport { Box } from \"@sproutsocial/seeds-react-box\";\nimport { Icon, type TypeIconName } from \"@sproutsocial/seeds-react-icon\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\n\nimport { ChartLegendLabel } from \"../../components/ChartLegend/components/ChartLegendLabel\";\nimport {\n ChartTooltip,\n ChartTooltipFooter,\n ChartTooltipHeader,\n ChartTooltipTable,\n ChartTooltipTitle,\n type TypeChartTooltipTableProps,\n} from \"../../components/ChartTooltip\";\nimport type { ChartTooltipProps } from \"./chartBase\";\nimport { valueFormatter } from \"./formatters/valueFormatter\";\n\nfunction formatTitle(position: number | string, timezone?: string): string {\n if (typeof position === \"string\") return position;\n // `timeZone` aligns the title with the chart's configured timezone (which\n // governs the axis ticks). Omitting it would format in the browser's local\n // zone and disagree with the ticks by up to a day.\n return new Date(position).toLocaleDateString(undefined, {\n year: \"numeric\",\n month: \"long\",\n day: \"numeric\",\n weekday: \"long\",\n timeZone: timezone,\n });\n}\n\n// Inlined (not v1's `ChartXAnnotationDetails`) because that component requires\n// both iconName and text together — v2's `ChartAnnotation` documents icon,\n// title, and description as independently optional, so the renderer has to\n// match that contract instead of dropping fields silently.\nfunction AnnotationHeader({\n icon,\n title,\n description,\n}: {\n icon?: TypeIconName;\n title?: string;\n description?: string;\n}) {\n const hasIconOrTitle = Boolean(icon || title);\n if (!hasIconOrTitle && !description) return null;\n return (\n <>\n {hasIconOrTitle ? (\n <ChartTooltipHeader>\n <Box display=\"flex\" alignItems=\"center\" gap={300}>\n {icon ? <Icon name={icon} size=\"mini\" color=\"icon.base\" /> : null}\n {title ? (\n <Text color=\"text.body\" fontSize={200}>\n {title}\n </Text>\n ) : null}\n </Box>\n </ChartTooltipHeader>\n ) : null}\n {description ? (\n <ChartTooltipHeader>\n <Text fontSize={200} color=\"text.subtext\">\n {description}\n </Text>\n </ChartTooltipHeader>\n ) : null}\n </>\n );\n}\n\n// Local to the default tooltip: `hideTotal` opts out of the multi-series Total\n// row. Kept off the shared `ChartTooltipProps` render-prop contract (and off\n// `BarChart`'s public props) intentionally — the chart sets it internally; any\n// consumer-facing tooltip config is deferred to CE-35.\ntype DefaultChartTooltipProps = ChartTooltipProps & { hideTotal?: boolean };\n\nexport function DefaultChartTooltip({\n data,\n position,\n annotation,\n hasOnClick,\n tooltipClickLabel,\n timezone,\n invalidNumberLabel,\n valueFormat = {},\n hideTitle,\n hideTotal = false,\n}: DefaultChartTooltipProps) {\n const rows = data.map((d) => {\n const formattedValue =\n d.value == null\n ? invalidNumberLabel ?? \"—\"\n : valueFormatter({ ...valueFormat, value: d.value, abbreviate: false });\n\n const nameCell = {\n content: (\n <ChartLegendLabel color={d.color}>\n <Text aria-label={`${d.name}: `}>{d.name}</Text>\n </ChartLegendLabel>\n ),\n };\n\n // When a row carries `percent` (pie/donut), show percent + value grouped\n // and flush right, matching v1's DonutChartTooltip: `inline-flex` shrinks\n // the pair to its content so the cell's `align: right` right-aligns the\n // whole group (a block `flex` stretched to fill the cell, leaving a gap\n // between percent and value — svbarker review, PR #2267). Guard NaN:\n // Highcharts emits NaN% when every slice value is null (total = 0).\n return {\n cells: [\n nameCell,\n {\n content:\n d.percent != null && !isNaN(d.percent) ? (\n <Box display=\"inline-flex\" alignItems=\"center\" gap={350}>\n <Text>{Math.round(d.percent)}%</Text>\n <Text fontWeight=\"semibold\">{formattedValue}</Text>\n </Box>\n ) : (\n <Text>{formattedValue}</Text>\n ),\n align: \"right\" as const,\n },\n ],\n };\n });\n\n // Multi-series parity with v1/Trellis: append a Total row summing the\n // contributing (non-null) values. Track contribution count separately from\n // the sum — `[5, -5]` legitimately totals 0 and must render \"0\", whereas an\n // all-null set must render the null placeholder, not a misleading 0.\n const contributing = data.filter((d) => d.value != null);\n const total =\n contributing.length > 0\n ? contributing.reduce((sum, d) => sum + (d.value as number), 0)\n : null;\n\n const totalRow =\n data.length > 1 && !hideTotal\n ? [\n {\n isAppendedRow: true,\n cells: [\n {\n content: (\n <Text fontWeight=\"semibold\" aria-label=\"Total: \">\n Total\n </Text>\n ),\n },\n {\n // Mirror the per-series value cell's formatting path exactly.\n content: (\n <Text fontWeight=\"bold\">\n {total == null\n ? invalidNumberLabel ?? \"—\"\n : valueFormatter({\n ...valueFormat,\n value: total,\n abbreviate: false,\n })}\n </Text>\n ),\n align: \"right\" as const,\n },\n ],\n },\n ]\n : [];\n\n return (\n <ChartTooltip>\n {annotation ? (\n <AnnotationHeader\n icon={annotation.icon}\n title={annotation.title}\n description={annotation.description}\n />\n ) : null}\n {hideTitle ? null : (\n <ChartTooltipTitle>{formatTitle(position, timezone)}</ChartTooltipTitle>\n )}\n <ChartTooltipTable\n rows={[...rows, ...totalRow] as TypeChartTooltipTableProps[\"rows\"]}\n />\n {hasOnClick && tooltipClickLabel ? (\n <ChartTooltipFooter>\n {typeof tooltipClickLabel === \"string\" ? (\n <Box display=\"flex\" alignItems=\"center\" gap={300}>\n <Icon name=\"hand-pointer-clicking-outline\" color=\"icon.base\" />\n <Text color=\"text.subtext\" fontSize={200}>\n {tooltipClickLabel}\n </Text>\n </Box>\n ) : (\n tooltipClickLabel\n )}\n </ChartTooltipFooter>\n ) : null}\n </ChartTooltip>\n );\n}\n","import { formatDuration } from \"@sproutsocial/seeds-react-duration\";\nimport { formatNumeral } from \"@sproutsocial/seeds-react-numeral\";\n\nimport type { TypeChartNumberFormat } from \"../../../types\";\n\nexport type TypeValuePercentInput = \"decimal\" | \"whole\";\n\nexport type TypeValueFormatterOptions = Readonly<{\n /** The raw numeric value. For duration, milliseconds. */\n value: number;\n /** default \"decimal\" */\n numberFormat?: TypeChartNumberFormat;\n /** Only used when numberFormat === \"currency\". default \"USD\" */\n currency?: string;\n /** true → 10k threshold; number → max(1000, abs(n)); false → never. default true */\n abbreviate?: boolean | number;\n /** \"decimal\" scales 0.42 → \"42%\"; \"whole\" treats 42 → \"42%\". default \"decimal\" */\n percentInput?: TypeValuePercentInput;\n /** locale for decimal/currency/percent (formatNumeral) */\n numberLocale?: Intl.LocalesArgument;\n /** locale for duration (formatDuration) */\n textLocale?: Intl.LocalesArgument;\n}>;\n\n/**\n * Pure value formatter for v2 charts. Turns a numeric value plus declarative\n * config into a display string. Composes `formatNumeral` (decimal/currency/\n * percent) and `formatDuration` (duration). Contains no chart-engine types or\n * imports — it upholds the \"engine boundary is one file\" invariant documented\n * in `src/charts/README.md`.\n *\n * The axis-wide \"smart 1k/10k\" abbreviation scan that v1's `yAxisLabelFormatter`\n * derives from `tickPositions` is not available to a pure per-value function;\n * callers pass the lowered threshold via `abbreviate` (a number) instead.\n */\nexport function valueFormatter({\n value,\n numberFormat = \"decimal\",\n currency = \"USD\",\n abbreviate = true,\n percentInput = \"decimal\",\n numberLocale,\n textLocale,\n}: TypeValueFormatterOptions): string {\n const numberValue = Number(value);\n\n // v1 parity: render 0 as a bare \"0\" for every format (clean axis origin) —\n // not \"$0.00\" / \"0%\" / a duration-zero. Matches v1's yAxisLabelFormatter,\n // which checks zero first, before any format branch. Revisit if design\n // wants per-format zero rendering later.\n if (numberValue === 0) {\n return formatNumeral({ locale: numberLocale as string, number: 0 });\n }\n\n if (numberFormat === \"duration\") {\n return formatDuration({\n display: \"narrow\",\n locale: textLocale,\n milliseconds: numberValue,\n });\n }\n\n if (numberFormat === \"percent\") {\n const whole = percentInput === \"decimal\" ? numberValue * 100 : numberValue;\n return formatNumeral({\n format: \"percent\",\n locale: numberLocale as string,\n number: whole,\n });\n }\n\n // decimal | currency\n return formatNumeral({\n abbreviate,\n currency,\n format: numberFormat,\n locale: numberLocale as string,\n number: numberValue,\n });\n}\n\n/**\n * Declarative value-format config for axis ticks and the default tooltip — the\n * full {@link TypeValueFormatterOptions} surface minus `value`, which is\n * supplied per-tick / per-row by the caller (the adapter and tooltip).\n */\nexport type ValueFormat = Omit<TypeValueFormatterOptions, \"value\">;\n","import { memo } from \"react\";\nimport { Icon, type TypeIconName } from \"@sproutsocial/seeds-react-icon\";\nimport { ChartLegend } from \"../../components/ChartLegend\";\nimport { ChartLegendLabelContentWithIcon } from \"../../components/ChartLegend/components/ChartLegendLabelContentWithIcon\";\n\nexport interface SeriesLegendItem {\n name: string;\n /** Resolved swatch color — caller is responsible for resolving against the active theme. */\n color: string;\n /** Seeds icon or partner-logo name rendered before the series name. */\n icon?: TypeIconName;\n}\n\nexport interface SeriesLegendProps {\n items: ReadonlyArray<SeriesLegendItem>;\n}\n\n// Internal to `ChartRenderer` — not intended for standalone use. Swatch\n// colors must be resolved by the caller (the chart base does this via\n// `useSeedsChartSetup`) so we keep a single source of truth for the\n// theme-aware palette. If this ever becomes a publicly-exposed primitive,\n// add a `useTheme()` fallback here and relax `item.color` to optional.\nexport const SeriesLegend = memo<SeriesLegendProps>(function SeriesLegend({\n items,\n}) {\n const labels = items.map((item) => ({\n content: (\n <ChartLegendLabelContentWithIcon\n icon={\n item.icon ? (\n <Icon name={item.icon} fixedWidth aria-hidden />\n ) : undefined\n }\n >\n {item.name}\n </ChartLegendLabelContentWithIcon>\n ),\n color: item.color,\n }));\n return <ChartLegend legendLabels={labels} />;\n});\n","// Public, Highcharts-free surface for the v2 chart export API. This module\n// imports nothing — it is a leaf so it can never form an import cycle with\n// `chartBase`. The `createChartExportHandle` factory that closes over the live\n// `Highcharts.Chart` lives in `chartBase.tsx` (the one file allowed to import\n// \"highcharts\"); the instance never crosses this boundary.\n//\n/**\n * Opaque export API handed to consumers via `ChartRenderer`'s `onReady`. Each\n * callable closes over the chart instance and triggers a client-side download;\n * an optional `filename` overrides the generated default. No Highcharts type,\n * ref, or method shape crosses this boundary.\n */\nexport interface ChartExportHandle {\n exportPNG: (opts?: { filename?: string }) => Promise<void>;\n exportSVG: (opts?: { filename?: string }) => Promise<void>;\n exportPDF: (opts?: { filename?: string }) => Promise<void>;\n exportCSV: (opts?: { filename?: string }) => Promise<void>;\n}\n\n/**\n * Canonical client-side export formats offered by `ChartExportMenu`. Co-located\n * with `ChartExportHandle` so the format vocabulary lives next to the handle it\n * maps onto; this leaf imports nothing, so re-exporting it carries no cycle risk.\n */\nexport type ChartExportFormat = \"png\" | \"svg\" | \"pdf\" | \"csv\";\n\n/**\n * Default download filename when a consumer doesn't pass a `filename` override:\n * `chart-<type>-<YYYY-MM-DD-HH-mm-ss>`, lowercased with non-alphanumerics\n * collapsed to hyphens. The full datetime (not just the date) avoids collisions\n * between charts exported on the same day. `type` comes from the chart's\n * `chart.type`; it falls back to `chart` when absent.\n */\nexport function defaultFilename(type: string | undefined, now: Date): string {\n const iso = now.toISOString();\n const stamp = `${iso.slice(0, 10)}-${iso.slice(11, 19).replace(/:/g, \"-\")}`;\n return slugify(type ? `chart-${type}-${stamp}` : `chart-${stamp}`);\n}\n\nfunction slugify(value: string): string {\n return value\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\n","import type { SeedsChartOptions, SeedsChartType } from \"./chartBase\";\n\ninterface BaseChartOptionsInput {\n /** Highcharts chart/series type for the family (`column`, `line`, `area`, `pie`, …). */\n type: SeedsChartType;\n /** Accessibility description (Highcharts `accessibility.description`). */\n description: string;\n /** Appended to each tooltip value (e.g. `\" MT\"`, `\"%\"`). */\n valueSuffix?: string;\n /** Reserve top margin for content drawn above the plot area (e.g. annotation markers). */\n reserveTopMargin?: boolean;\n /**\n * Resolved IANA timezone for the chart (`time.timezone`) — governs datetime\n * ticks and the tooltip date. Pass the value from `resolveTooltipTimezone`;\n * `undefined` (a category axis) omits `time` entirely.\n */\n timezone?: string;\n}\n\n/**\n * The chart options shared by *every* v2 chart family, independent of axis type:\n * styled-mode + animation-off, the accessibility description, Highcharts' native\n * title/credits/legend disabled (Seeds renders its own legend), and the tooltip-\n * portal config. Families spread the result and add their own axes, `plotOptions`,\n * `series`, and `annotations`.\n *\n * This is the family-agnostic base layer — donut (no axes) consumes it just as\n * the X/Y families do. Axis/series/X-Y-specific sharing lives elsewhere\n * (`axisOptions` + the X/Y pattern-sharing spike), layered on top of this.\n */\nexport function buildBaseChartOptions({\n type,\n description,\n valueSuffix,\n reserveTopMargin = false,\n timezone,\n}: BaseChartOptionsInput): Pick<\n SeedsChartOptions,\n | \"chart\"\n | \"accessibility\"\n | \"title\"\n | \"credits\"\n | \"legend\"\n | \"tooltip\"\n | \"time\"\n> {\n return {\n chart: {\n type,\n styledMode: true,\n animation: false,\n ...(reserveTopMargin ? { marginTop: 24 } : {}),\n },\n accessibility: { description },\n title: { text: \"\" },\n credits: { enabled: false },\n legend: { enabled: false },\n tooltip: {\n enabled: true,\n outside: true,\n padding: 0,\n shape: \"rect\",\n shared: true,\n hideDelay: 0,\n valueSuffix,\n },\n // Chart-global in Highcharts; only meaningful for datetime axes, so it's\n // present only when a timezone was resolved (omitted for category axes).\n ...(timezone ? { time: { timezone } } : {}),\n };\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-46L4YBLC.js","../src/components/ColorBox/ColorBox.tsx","../../seeds-react-theme-provider/src/index.tsx","../src/components/ChartLegend/components/ChartLegendLabel.tsx","../src/components/ChartLegend/ChartLegend.tsx","../src/components/ChartTooltip/ChartTooltip.tsx","../src/components/ChartTooltip/components/ChartTooltipFooter.tsx","../src/components/ChartTooltip/components/ChartTooltipHeader.tsx","../src/components/ChartTooltip/components/ChartTooltipPortal.tsx","../src/components/ChartTable/ChartTable.tsx","../src/components/ChartTooltip/components/ChartTooltipTable.tsx","../src/components/ChartTooltip/components/ChartTooltipTitle.tsx","../src/helpers/transformTimeSeriesTooltipData.ts","../src/styles/chartStyles.ts","../src/components/ChartLegend/components/ChartLegendLabelContentWithIcon.tsx"],"names":["jsx","props","theme","ChartLegendLabel","jsxs","memo","ChartLegend","Box"],"mappings":"AAAA;ACAA,yHAAkC;AAClC,8DAAuC;ADEvC;AACA;AEJA,8BAAuB;AACvB;AACE;AACA;AFMF;AEJA,kEAAsB;AA6BpB,+CAAA;AAZF,IAAM,kBAAA,EAAoB,mCAAA,CAAA;AFT1B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;AACA;ACpBA;AAgBI;AATG,IAAM,SAAA,EAAW,CAAC;AAAA,EACvB,QAAA,EAAU,cAAA;AAAA,EACV,OAAA,EAAS,MAAA;AAAA,EACT,MAAA,EAAQ,MAAA;AAAA,EACR,SAAA,EAAW,KAAA;AAAA,EACX,aAAA,EAAe,KAAA;AAAA,EACf,GAAG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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAa5D;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAA;AAUC;AAAA;AAAA,YAAA;AAGwE;AAAA;AAKtE;AAAwB,EAAA;AAON;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAUnB,EAAA;AACI;AAAA,yBAAA;AAEsB;AAAA,OAAA;AAI5B;AAAE;AAIC;AAAwB,EAAA;AACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAclB;AAAyB,EAAA;AAMb;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAoBf;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAA;AAUC;Ab8RL;AACA;Ac1fA;AACA;AAeQ;AAPD;AACL,EAAA;AAC2C,IAAA;AACvC,IAAA;AACA,EAAA;AAEA,IAAA;AAEK,MAAA;AAAA,MAAA;AACA,IAAA;AAGH,EAAA;AAGN;AdifF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/chunk-46L4YBLC.js","sourcesContent":[null,"import { css, type CSSProp } from \"styled-components\";\nimport { Box, type TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\nimport ThemeProvider from \"@sproutsocial/seeds-react-theme-provider\";\nimport { type TypeSproutTheme } from \"@sproutsocial/seeds-react-theme\";\n\nexport type TypeColorBoxProps = TypeBoxProps;\n\n/**\n * ColorBox extends Box to apply basic styles.\n */\nexport const ColorBox = ({\n display = \"inline-block\",\n height = \"16px\",\n width = \"16px\",\n minWidth = width,\n borderRadius = \"400\",\n ...props\n}: TypeColorBoxProps) => {\n return (\n <Box\n {...props}\n display={display}\n height={height}\n width={width}\n minWidth={minWidth}\n borderRadius={borderRadius}\n css={\n css`\n cursor: ${(\n props: typeof ThemeProvider & {\n onClick: ((e: React.MouseEvent<HTMLElement>) => void) | void;\n }\n ) => (props?.onClick ? \"pointer\" : \"default\")};\n ` as CSSProp<TypeSproutTheme>\n }\n />\n );\n};\n","import * as React from \"react\";\nimport {\n ThemeProvider as BaseThemeProvider,\n createGlobalStyle,\n} from \"styled-components\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\nimport type {\n TypeSproutTheme,\n TypeTheme,\n} from \"@sproutsocial/seeds-react-theme\";\n\n// We can append additional themes types here\ntype TypeAllThemes = TypeTheme | TypeSproutTheme;\n\ntype TypeProps = {\n readonly theme?: TypeAllThemes;\n readonly children?: React.ReactNode;\n};\n\n// CSS custom properties for token values that cannot be represented in SCSS maps\n// (e.g. radial-gradient + color-mix). These are injected here so styled-components\n// consumers get the values without needing to load the compiled SCSS theme CSS.\nconst GlobalTokenStyles = createGlobalStyle`\n :root {\n --color-container-bg-ai-generated: radial-gradient(\n circle at bottom left,\n color-mix(in srgb, #205bc3, transparent 80%) 0%,\n color-mix(in srgb, #6f5ed3, transparent 80%) 61%,\n color-mix(in srgb, #f282f5, transparent 80%) 100%\n ), #f3f4f4;\n }\n`;\n\nconst ThemeProvider = (props: TypeProps) => (\n <BaseThemeProvider {...props} theme={props.theme || theme}>\n <GlobalTokenStyles />\n {props.children}\n </BaseThemeProvider>\n);\n\nexport default ThemeProvider;\n","import styled from \"styled-components\";\nimport { memo } from \"react\";\nimport { Box, type TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\n\nimport type { TypeLegendLabel } from \"../ChartLegend\";\n\nimport { ColorBox } from \"../../ColorBox\";\n\nconst StyledBox = styled(Box)<TypeBoxProps>`\n list-style: none;\n display: flex;\n align-items: center;\n gap: ${({ theme }) => theme.space[300]};\n`;\n\nexport type TypeChartLegendLabelProps = Readonly<{\n children: TypeLegendLabel[\"content\"];\n color: TypeLegendLabel[\"color\"];\n // optional\n containerBoxProps?: TypeBoxProps;\n}>;\n\nexport const ChartLegendLabel = memo<TypeChartLegendLabelProps>(\n function ChartLegendLabel({\n children,\n color = \"#CCC\",\n containerBoxProps = {},\n }: TypeChartLegendLabelProps) {\n return (\n <StyledBox {...containerBoxProps}>\n <ColorBox bg={color} />\n <Text as=\"div\" fontSize={200} color=\"text.subtext\">\n {children}\n </Text>\n </StyledBox>\n );\n }\n);\n","import { memo } from \"react\";\nimport { Box, type TypeBoxProps } from \"@sproutsocial/seeds-react-box\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\n\nimport { ChartLegendLabel } from \"./components/ChartLegendLabel\";\n\nexport type TypeLegendLabel = Readonly<{\n content: React.ReactNode;\n color?: string;\n}>;\n\nexport type TypeChartLegendProps = Readonly<{\n legendLabels: ReadonlyArray<TypeLegendLabel>;\n // optional\n containerBoxProps?: TypeBoxProps;\n stacked?: boolean;\n}>;\n\nexport const ChartLegend = memo<TypeChartLegendProps>(function ChartLegend({\n legendLabels,\n containerBoxProps = {},\n stacked = false,\n}: TypeChartLegendProps) {\n return (\n <Box\n as=\"ul\"\n aria-hidden=\"true\"\n display=\"flex\"\n justifyContent=\"center\"\n flexDirection={stacked ? \"column\" : \"row\"}\n flexWrap=\"wrap\"\n columnGap={450}\n rowGap={200}\n m={0}\n p={0}\n {...containerBoxProps}\n >\n {legendLabels.map(({ color, content }, index) => (\n <ChartLegendLabel\n key={`chart-legend-label-${index}`}\n color={color || theme.colors.DATAVIZ_COLORS_LIST[index]}\n containerBoxProps={{ as: \"li\" }}\n >\n {content}\n </ChartLegendLabel>\n ))}\n </Box>\n );\n});\n","import { memo } from \"react\";\nimport styled from \"styled-components\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\n// styled components\nconst StyledBox = styled(Box)`\n .Icon,\n .logo {\n stroke: none;\n }\n`;\n\n// Chart Tooltip\ntype TypeChartTooltipProps = Readonly<{\n children: React.ReactNode;\n}>;\n\nexport const ChartTooltip = memo<TypeChartTooltipProps>(function ChartTooltip({\n children,\n}: TypeChartTooltipProps) {\n return (\n <StyledBox\n bg=\"container.background.base\"\n boxShadow=\"medium\"\n border={500}\n borderColor=\"container.border.base\"\n borderRadius={500}\n p={400}\n minWidth={285}\n >\n <Box display=\"flex\" flexDirection=\"column\" gap={350}>\n {children}\n </Box>\n </StyledBox>\n );\n});\n","import { memo } from \"react\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\ntype TypeChartTooltipFooterProps = {\n children: React.ReactNode;\n};\n\nexport const ChartTooltipFooter = memo<TypeChartTooltipFooterProps>(\n function ChartTooltipFooter({ children }: TypeChartTooltipFooterProps) {\n return (\n <Box\n borderTop={500}\n borderColor=\"container.border.base\"\n mx={-400}\n mb={-200}\n px={400}\n pt={350}\n >\n {children}\n </Box>\n );\n }\n);\n","import { memo } from \"react\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\ntype TypeChartTooltipHeaderProps = {\n children: React.ReactNode;\n};\n\nexport const ChartTooltipHeader = memo<TypeChartTooltipHeaderProps>(\n function ChartTooltipHeader({ children }: TypeChartTooltipHeaderProps) {\n return (\n <Box\n borderBottom={500}\n borderColor=\"container.border.base\"\n mx={-400}\n mt={-200}\n px={400}\n pb={350}\n >\n {children}\n </Box>\n );\n }\n);\n","import { memo, useState, useRef, useEffect, type ReactNode } from \"react\";\nimport { createPortal } from \"react-dom\";\nimport type {\n Tooltip,\n Chart,\n TooltipFormatterContextObject,\n TooltipFormatterCallbackFunction,\n} from \"highcharts\";\n\ninterface ExtendedHighchartsTooltip extends Tooltip {\n label: {\n box: { attr({ height, width }: { height: number; width: number }): void };\n text: { element: HTMLElement };\n };\n}\n\nexport const generateChartTooltipPortalId = (chartId: number) =>\n `highcharts-custom-tooltip-${chartId}`;\n\ntype ChartTooltipPortalProps = Readonly<{\n chart: Chart;\n renderContent: (_context: TooltipFormatterContextObject) => ReactNode;\n}>;\n\nexport const ChartTooltipPortal = memo<ChartTooltipPortalProps>(\n function ChartTooltipPortal({\n chart,\n renderContent,\n }: ChartTooltipPortalProps) {\n const isInitialized = useRef<boolean>(false);\n const [node, setNode] = useState<HTMLElement | null>(null);\n const [context, setContext] =\n useState<TooltipFormatterContextObject | null>(null);\n\n useEffect(() => {\n const formatter: TooltipFormatterCallbackFunction = function () {\n // Ensures that tooltip DOM container is rendered before React portal is created.\n if (!isInitialized.current) {\n isInitialized.current = true;\n chart.tooltip.refresh.apply(chart.tooltip, [this.point]);\n chart.tooltip.hide(0);\n }\n\n setContext(this);\n\n return `<div id=\"${generateChartTooltipPortalId(\n chart.index\n )}\" role='tooltip'></div>`;\n };\n\n chart.update({ tooltip: { formatter } });\n }, [chart]);\n\n useEffect(() => {\n // In some cases tooltip is not available on the chart yet\n if (context?.series?.chart?.tooltip) {\n const tooltip = context.series.chart\n .tooltip as ExtendedHighchartsTooltip;\n const textElement = tooltip.label.text.element;\n\n tooltip.label.box.attr({\n height: textElement.offsetHeight,\n width: textElement.offsetWidth,\n });\n\n setNode(\n document.getElementById(generateChartTooltipPortalId(chart.index))\n );\n }\n }, [context, chart.index]);\n\n return node && context ? createPortal(renderContent(context), node) : null;\n }\n);\n","import { memo } from \"react\";\nimport styled from \"styled-components\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\nimport { Table as SeedsTable } from \"@sproutsocial/seeds-react-table\";\n\nconst StyledSeedsTable = styled<typeof SeedsTable>(SeedsTable)`\n tbody tr:last-child {\n border-bottom: none;\n }\n tr:last-child td,\n tr:last-child th {\n padding-bottom: 0;\n }\n tr:first-child td,\n tr:first-child th {\n padding-top: 0;\n }\n tr th {\n padding-left: 0;\n }\n tr td:last-child {\n padding-right: 0;\n }\n`;\n\nconst StyledSeedsTableRow = styled(SeedsTable.TableRow)<{\n $isAppendedRow?: boolean;\n}>`\n ${({ $isAppendedRow, theme }) =>\n $isAppendedRow\n ? `border-top: 2px solid ${theme.colors.container.border.base}`\n : \"\"}\n`;\n\nexport type TypeChartTableProps = Readonly<{\n rows: ReadonlyArray<{\n cells: ReadonlyArray<{\n content: React.ReactNode;\n align?: React.ComponentProps<typeof SeedsTable.Cell>[\"align\"];\n colSpan?: React.ComponentProps<typeof SeedsTable.Cell>[\"colSpan\"];\n }>;\n isAppendedRow?: boolean;\n }>;\n}>;\n\nexport const ChartTable = memo<TypeChartTableProps>(function ChartTable({\n rows,\n}: TypeChartTableProps) {\n if (!rows || rows.length === 0) {\n return null;\n }\n\n return (\n <StyledSeedsTable>\n <SeedsTable.TableBody>\n {rows.map(({ cells, isAppendedRow }, rowIndex) => {\n if (!cells || cells.length === 0) {\n return null;\n }\n\n return (\n <StyledSeedsTableRow\n key={`chart-tooltip-table-row-${rowIndex}`}\n $isAppendedRow={isAppendedRow}\n >\n {cells.map(\n ({ content, align = \"left\", colSpan = 1 }, cellIndex) => {\n const uniqueIdentifier = `chart-tooltip-table-cell-${cellIndex}`;\n return (\n <SeedsTable.Cell\n key={uniqueIdentifier}\n id={uniqueIdentifier}\n scope={cellIndex === 0 ? \"row\" : undefined}\n align={align}\n colSpan={colSpan}\n py={200}\n >\n <Text.SmallBodyCopy as=\"div\">\n {content}\n </Text.SmallBodyCopy>\n </SeedsTable.Cell>\n );\n }\n )}\n </StyledSeedsTableRow>\n );\n })}\n </SeedsTable.TableBody>\n </StyledSeedsTable>\n );\n});\n","import { memo } from \"react\";\n\nimport { ChartTable, type TypeChartTableProps } from \"../../ChartTable\";\n\nexport type TypeChartTooltipTableProps = {\n rows: TypeChartTableProps[\"rows\"];\n};\n\nexport const ChartTooltipTable = memo<TypeChartTooltipTableProps>(\n function ChartTooltipTable({ rows }: TypeChartTooltipTableProps) {\n return <ChartTable rows={rows} />;\n }\n);\n","import { memo } from \"react\";\nimport { Text } from \"@sproutsocial/seeds-react-text\";\n\ntype TypeChartTooltipTitleProps = {\n children: React.ReactNode;\n};\n\nexport const ChartTooltipTitle = memo<TypeChartTooltipTitleProps>(\n function ChartTooltipTitle({ children }: TypeChartTooltipTitleProps) {\n return <Text.SmallSubHeadline as=\"p\">{children}</Text.SmallSubHeadline>;\n }\n);\n","import type { TooltipFormatterContextObject } from \"highcharts\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\n\nimport type { TypeAreaChartProps } from \"../components/AreaChart\";\nimport type { TypeLineChartProps } from \"../components/LineChart\";\nimport type { TypeChartTooltipProps } from \"../types\";\n\ntype TypeTransformTimeSeriesTooltipDataProps = Readonly<{\n context: TooltipFormatterContextObject;\n data: TypeAreaChartProps[\"data\"] | TypeLineChartProps[\"data\"];\n}>;\ntype TypeTransformTimeSeriesTooltipDataReturn = TypeChartTooltipProps[\"data\"];\n\nexport const transformTimeSeriesTooltipData = ({\n context,\n data,\n}: TypeTransformTimeSeriesTooltipDataProps): TypeTransformTimeSeriesTooltipDataReturn => {\n // @ts-expect-error - Highcharts tooltip context series typing does not expose chart.series here\n return (context.series.chart.series || []).map((series, index) => {\n const pointIndex = context.point.index;\n const y = series?.points?.[pointIndex]?.y;\n\n return {\n color:\n data[index]?.styles?.color || theme.colors.DATAVIZ_COLORS_LIST[index],\n ...(data[index]?.icon ? { icon: data[index]?.icon } : {}),\n name: series.name,\n value: typeof y === \"number\" ? y : null,\n };\n });\n};\n","import { css, createGlobalStyle } from \"styled-components\";\nimport { theme } from \"@sproutsocial/seeds-react-theme\";\nimport {\n type TypeChartStyleColor,\n type TypeChartStyleHasOnClick,\n type TypeChartStylePattern,\n} from \"../types\";\nimport \"highcharts/css/highcharts.css\";\n\nexport const GlobalChartStyleOverrides = createGlobalStyle`\n // USAGE NOTE:\n // Put general styles in baseChartStyles instead when possible to avoid excessive global styling.\n // This global component is only for styles that can't override highcharts defaults when scoped.\n\n .highcharts-tooltip-container {\n z-index: 7 !important;\n }\n .highcharts-tooltip-box {\n fill: transparent !important;\n }\n`;\n\n// options that should apply to all charts\nexport const baseChartStyles = css<\n Readonly<{ $colors: ReadonlyArray<TypeChartStyleColor> }>\n>`\n --highcharts-background-color: ${({ theme }) =>\n theme.colors.container.background.base};\n\n // set color variables and map to each series\n ${({ $colors }) =>\n $colors\n .map((color, index) => {\n const chartColor = color || theme.colors.DATAVIZ_COLORS_LIST[index];\n return `\n\t\t\t\t// map colors to custom assigned colors or fallback to default data viz color rotation\n\t\t\t\t--highcharts-color-${index}: ${chartColor};\n\n\t\t\t\t// highcharts already accounts for 10 series, but if we have more, we need to add them\n\t\t\t\t.highcharts-color-${index} {\n\t\t\t\t\tcolor: var(--highcharts-color-${index});\n\t\t\t\t\tstroke: var(--highcharts-color-${index});\n\t\t\t\t\tfill: var(--highcharts-color-${index});\n\t\t\t\t}`;\n })\n .join(\"\\n\")}\n\n // set overall chart background color\n .highcharts-background {\n fill: ${({ theme }) => theme.colors.container.background.base};\n }\n\n g.highcharts-annotation-label {\n display: none;\n }\n\n div.highcharts-annotation-label {\n top: 0 !important;\n transform: translateX(-50%); // centers the label on the targeted axis point\n pointer-events: none; // prevents tooltip hover from being interrupted by this element since it renders after on the dom\n }\n`;\n\n// options that should apply to time series charts\nexport const timeSeriesChartStyles = css<\n Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $hasOnClick: TypeChartStyleHasOnClick;\n }>\n>`\n ${baseChartStyles}\n\n // vertical crosshair styles\n\t.highcharts-crosshair {\n stroke: ${({ theme }) => theme.colors.container.border.decorative.neutral};\n stroke-width: 1;\n }\n\n // axis and gridline styles\n .highcharts-grid-line {\n stroke: ${({ theme }) => theme.colors.container.border.base};\n }\n\n .highcharts-axis-line {\n stroke: ${({ theme }) => theme.colors.container.border.base};\n }\n\n .highcharts-tick {\n stroke: none;\n }\n .highcharts-xaxis-labels,\n .highcharts-yaxis-labels {\n // v1 HTML labels (useHTML: true). v2 SVG label styles live in\n // charts/shared/styles.ts (axisLabelV2Styles) — don't add v2 rules here.\n > span {\n font-family: ${({ theme }) => theme.fontFamily};\n ${({ theme }) => theme.typography[100]};\n font-weight: ${({ theme }) => theme.fontWeights.normal};\n color: ${({ theme }) => theme.colors.text.subtext};\n }\n }\n .highcharts-xaxis-labels {\n // v1 HTML stacked labels (useHTML: true). v2 SVG stacked-label styles live\n // in charts/shared/styles.ts (axisLabelV2Styles).\n > span {\n display: flex;\n flex-direction: column;\n align-items: center;\n > span:nth-of-type(2) {\n font-weight: ${({ theme }) => theme.fontWeights.semibold};\n }\n }\n }\n\n // we don't want to drop the opacity when another item is hovered\n .highcharts-series-inactive {\n opacity: 1;\n }\n\n // apply cursor pointer when click functionality is turned on\n ${({ $hasOnClick }) =>\n $hasOnClick &&\n `\n \t\t\t.highcharts-series,\n \t\t\t.highcharts-point {\n \t\t\t\tcursor: pointer;\n \t\t\t}\n \t\t\t.highcharts-plot-background,\n \t\t\t.highcharts-crosshair,\n \t\t\t.highcharts-grid-line {\n \t\t\t\tfill: transparent;\n \t\t\t\tcursor: pointer;\n \t\t}`}\n\n path.highcharts-plot-line.y-axis-zero-line {\n stroke: ${({ theme }) => theme.colors.container.border.decorative.neutral};\n }\n`;\n\n// options that should apply to line charts\nexport const lineChartStyles = css<\n Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $patterns: ReadonlyArray<TypeChartStylePattern>;\n $hasOnClick: TypeChartStyleHasOnClick;\n }>\n>`\n ${timeSeriesChartStyles}\n\n // set the line stroke\n\t.highcharts-graph {\n stroke-width: 3;\n }\n\n // dashed line styles\n ${({ $patterns }) =>\n $patterns.map((pattern, index) => {\n return pattern === \"dashed\"\n ? `\n \t\t\t\t\t// highcharts already accounts for 10 series, but if we have more, we need to add them\n \t\t\t\t\t.highcharts-series-${index} {\n \t\t\t\t\t\tstroke-dasharray: 2, 8;\n \t\t\t\t\t}`\n : \"\";\n })}\n`;\n\n// options that should apply to area charts\nexport const areaChartStyles = css`\n ${timeSeriesChartStyles}\n\n // don't need to show a stroke for the line part of each area\n\t.highcharts-graph {\n stroke-width: 0;\n }\n\n // fill areas to full opacity\n .highcharts-area {\n fill-opacity: 1;\n }\n`;\n\n// options that should apply to donut charts\nexport const donutChartStyles = css<\n Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $hasOnClick: TypeChartStyleHasOnClick;\n }>\n>`\n ${baseChartStyles}\n\n // remove 250ms fade in/out when hovering over different donut chart slices\n\t.highcharts-point {\n transition: opacity 0s;\n }\n\n // remove stroke on donut slices\n .highcharts-pie-series .highcharts-point {\n stroke: none;\n }\n\n // don't reduce opacity when hovering\n .highcharts-point-hover {\n fill-opacity: none;\n }\n\n // apply cursor pointer when click functionality is turned on\n ${({ $hasOnClick }) =>\n $hasOnClick &&\n `\n \t\t\t.highcharts-series,\n \t\t\t.highcharts-point {\n \t\t\t\tcursor: pointer;\n \t\t\t}\n \t\t\t.highcharts-plot-background,\n \t\t\t.highcharts-crosshair,\n \t\t\t.highcharts-grid-line {\n \t\t\t\tfill: transparent;\n \t\t\t\tcursor: pointer;\n \t\t}`}\n`;\n","import { memo } from \"react\";\nimport { Box } from \"@sproutsocial/seeds-react-box\";\n\nexport type TypeChartLegendLabelContentWithIconProps = Readonly<{\n children: React.ReactNode;\n // optional\n icon?: React.ReactNode;\n}>;\n\nexport const ChartLegendLabelContentWithIcon =\n memo<TypeChartLegendLabelContentWithIconProps>(\n function ChartLegendLabelContentWithIcon({\n children,\n icon,\n }: TypeChartLegendLabelContentWithIconProps) {\n return icon ? (\n <Box display=\"flex\" alignItems=\"center\" gap={200}>\n {icon}\n {children}\n </Box>\n ) : (\n children\n );\n }\n );\n"]}