@sproutsocial/seeds-react-data-viz 0.7.32 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/dist/axis-DXzufRRj.d.mts +116 -0
  2. package/dist/axis-PJwu5Xmo.d.ts +116 -0
  3. package/dist/bar/index.d.mts +98 -0
  4. package/dist/bar/index.d.ts +98 -0
  5. package/dist/bar/index.js +186 -0
  6. package/dist/bar/index.js.map +1 -0
  7. package/dist/chartExport-CKYpuhik.d.mts +28 -0
  8. package/dist/chartExport-CKYpuhik.d.ts +28 -0
  9. package/dist/chunk-EEVKTTT3.js +968 -0
  10. package/dist/chunk-EEVKTTT3.js.map +1 -0
  11. package/dist/chunk-JXARPHQE.js +193 -0
  12. package/dist/chunk-JXARPHQE.js.map +1 -0
  13. package/dist/chunk-VSZSIN34.js +796 -0
  14. package/dist/chunk-VSZSIN34.js.map +1 -0
  15. package/dist/esm/bar/index.js +186 -0
  16. package/dist/esm/bar/index.js.map +1 -0
  17. package/dist/esm/chunk-HQM3EIZW.js +193 -0
  18. package/dist/esm/chunk-HQM3EIZW.js.map +1 -0
  19. package/dist/esm/chunk-LC3HGWDD.js +968 -0
  20. package/dist/esm/chunk-LC3HGWDD.js.map +1 -0
  21. package/dist/esm/chunk-OAN5VC7M.js +796 -0
  22. package/dist/esm/chunk-OAN5VC7M.js.map +1 -0
  23. package/dist/esm/export/index.js +41 -0
  24. package/dist/esm/export/index.js.map +1 -0
  25. package/dist/esm/index.js +262 -1315
  26. package/dist/esm/index.js.map +1 -1
  27. package/dist/esm/line-area/index.js +151 -0
  28. package/dist/esm/line-area/index.js.map +1 -0
  29. package/dist/esm/pdfExportLibs-NWLZH5KL.js +10 -0
  30. package/dist/esm/pdfExportLibs-NWLZH5KL.js.map +1 -0
  31. package/dist/export/index.d.mts +25 -0
  32. package/dist/export/index.d.ts +25 -0
  33. package/dist/export/index.js +41 -0
  34. package/dist/export/index.js.map +1 -0
  35. package/dist/index.d.mts +56 -93
  36. package/dist/index.d.ts +56 -93
  37. package/dist/index.js +407 -1544
  38. package/dist/index.js.map +1 -1
  39. package/dist/line-area/index.d.mts +83 -0
  40. package/dist/line-area/index.d.ts +83 -0
  41. package/dist/line-area/index.js +151 -0
  42. package/dist/line-area/index.js.map +1 -0
  43. package/dist/pdfExportLibs-BZR2D3RA.js +10 -0
  44. package/dist/pdfExportLibs-BZR2D3RA.js.map +1 -0
  45. package/dist/types-B7ILUQ6_.d.mts +99 -0
  46. package/dist/types-B7ILUQ6_.d.ts +99 -0
  47. package/package.json +37 -11
@@ -0,0 +1,83 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { TypeIconName } from '@sproutsocial/seeds-react-icon';
4
+ import { C as ChartDataPoint, a as CategoryAxis, D as DatetimeAxis, V as ValueFormat, b as ChartTooltipProps, c as ChartAnnotation } from '../axis-DXzufRRj.mjs';
5
+ import { C as ChartExportHandle } from '../chartExport-CKYpuhik.mjs';
6
+ import { h as TypeChartStylePattern } from '../types-B7ILUQ6_.mjs';
7
+ import 'highcharts';
8
+
9
+ /**
10
+ * Chart variant. `line`/`area` connect points with straight segments;
11
+ * `spline`/`areaspline` smooth them into curves; `area`/`areaspline` fill the
12
+ * region below the line. Maps directly to the Highcharts series type.
13
+ */
14
+ type LineAreaVariant = "line" | "spline" | "area" | "areaspline";
15
+ interface LineAreaSeries {
16
+ name: string;
17
+ /**
18
+ * Y-values indexed parallel to `xAxis.categories` on a category axis, or
19
+ * `[timestamp, value]` / `{ x, y }` points on a datetime axis.
20
+ */
21
+ data: Array<ChartDataPoint>;
22
+ color?: string;
23
+ /** Seeds icon or partner-logo name rendered before the series name in the legend. */
24
+ icon?: TypeIconName;
25
+ /** Line dash style. Applies to `line`/`spline` variants; a no-op on filled area variants. Default `"solid"`. */
26
+ pattern?: TypeChartStylePattern;
27
+ }
28
+ type LineAreaXAxis = CategoryAxis | DatetimeAxis;
29
+ interface LineAreaYAxis {
30
+ min?: number;
31
+ max?: number;
32
+ /** Default: true. */
33
+ showGridLines?: boolean;
34
+ title?: string;
35
+ /**
36
+ * Declarative value formatting applied to y-axis tick labels. Omit for the
37
+ * zero-config decimal default (smart 1k/10k abbreviation).
38
+ */
39
+ format?: ValueFormat;
40
+ }
41
+ interface LineAreaChartProps {
42
+ /** Wired into Highcharts' `accessibility.description`. */
43
+ description: string;
44
+ /** Applied to the chart's container element — e.g. Tailwind utility classes for sizing or spacing. */
45
+ className?: string;
46
+ /** Chart variant: `line` | `spline` | `area` | `areaspline`. */
47
+ variant: LineAreaVariant;
48
+ series: Array<LineAreaSeries>;
49
+ xAxis: LineAreaXAxis;
50
+ yAxis?: LineAreaYAxis;
51
+ /** IANA timezone for datetime-axis ticks and tooltips. Default `"UTC"`. Ignored for category axes. */
52
+ timezone?: string;
53
+ /**
54
+ * Stacking for multi-series charts. `"normal"` stacks values; `"percent"`
55
+ * normalizes each point to 100%. Honored only on `area`/`areaspline` variants
56
+ * (a `stacked-area` chart); ignored on `line`/`spline`. Unstacked when omitted.
57
+ */
58
+ stacking?: "normal" | "percent";
59
+ /** Appended to each tooltip value (e.g., `"%"`). */
60
+ valueSuffix?: string;
61
+ /** Override for the default tooltip content. */
62
+ tooltip?: (args: ChartTooltipProps) => ReactNode;
63
+ /** Declarative annotations rendered at positions on the chart. */
64
+ annotations?: ChartAnnotation[];
65
+ /** Click handler invoked with the x-axis value of the clicked point — the category name on a category axis, the numeric timestamp on a datetime axis. */
66
+ onClick?: ({ position }: {
67
+ position: number | string;
68
+ }) => void;
69
+ /** Footer content shown in the default tooltip when `onClick` is set. */
70
+ tooltipClickLabel?: ReactNode;
71
+ /** Override for the value shown when a data point is invalid/missing (null). Defaults to an em-dash. */
72
+ invalidNumberLabel?: ReactNode;
73
+ /**
74
+ * Fired once per chart instance with an opaque {@link ChartExportHandle} for
75
+ * triggering PNG/SVG/PDF/CSV downloads. Re-fires only on a genuine remount,
76
+ * never on data or prop updates.
77
+ */
78
+ onReady?: (handle: ChartExportHandle) => void;
79
+ }
80
+
81
+ declare const LineAreaChart: react.NamedExoticComponent<LineAreaChartProps>;
82
+
83
+ export { CategoryAxis, ChartExportHandle, DatetimeAxis, LineAreaChart, type LineAreaChartProps, type LineAreaSeries, type LineAreaVariant, type LineAreaXAxis, type LineAreaYAxis };
@@ -0,0 +1,83 @@
1
+ import * as react from 'react';
2
+ import { ReactNode } from 'react';
3
+ import { TypeIconName } from '@sproutsocial/seeds-react-icon';
4
+ import { C as ChartDataPoint, a as CategoryAxis, D as DatetimeAxis, V as ValueFormat, b as ChartTooltipProps, c as ChartAnnotation } from '../axis-PJwu5Xmo.js';
5
+ import { C as ChartExportHandle } from '../chartExport-CKYpuhik.js';
6
+ import { h as TypeChartStylePattern } from '../types-B7ILUQ6_.js';
7
+ import 'highcharts';
8
+
9
+ /**
10
+ * Chart variant. `line`/`area` connect points with straight segments;
11
+ * `spline`/`areaspline` smooth them into curves; `area`/`areaspline` fill the
12
+ * region below the line. Maps directly to the Highcharts series type.
13
+ */
14
+ type LineAreaVariant = "line" | "spline" | "area" | "areaspline";
15
+ interface LineAreaSeries {
16
+ name: string;
17
+ /**
18
+ * Y-values indexed parallel to `xAxis.categories` on a category axis, or
19
+ * `[timestamp, value]` / `{ x, y }` points on a datetime axis.
20
+ */
21
+ data: Array<ChartDataPoint>;
22
+ color?: string;
23
+ /** Seeds icon or partner-logo name rendered before the series name in the legend. */
24
+ icon?: TypeIconName;
25
+ /** Line dash style. Applies to `line`/`spline` variants; a no-op on filled area variants. Default `"solid"`. */
26
+ pattern?: TypeChartStylePattern;
27
+ }
28
+ type LineAreaXAxis = CategoryAxis | DatetimeAxis;
29
+ interface LineAreaYAxis {
30
+ min?: number;
31
+ max?: number;
32
+ /** Default: true. */
33
+ showGridLines?: boolean;
34
+ title?: string;
35
+ /**
36
+ * Declarative value formatting applied to y-axis tick labels. Omit for the
37
+ * zero-config decimal default (smart 1k/10k abbreviation).
38
+ */
39
+ format?: ValueFormat;
40
+ }
41
+ interface LineAreaChartProps {
42
+ /** Wired into Highcharts' `accessibility.description`. */
43
+ description: string;
44
+ /** Applied to the chart's container element — e.g. Tailwind utility classes for sizing or spacing. */
45
+ className?: string;
46
+ /** Chart variant: `line` | `spline` | `area` | `areaspline`. */
47
+ variant: LineAreaVariant;
48
+ series: Array<LineAreaSeries>;
49
+ xAxis: LineAreaXAxis;
50
+ yAxis?: LineAreaYAxis;
51
+ /** IANA timezone for datetime-axis ticks and tooltips. Default `"UTC"`. Ignored for category axes. */
52
+ timezone?: string;
53
+ /**
54
+ * Stacking for multi-series charts. `"normal"` stacks values; `"percent"`
55
+ * normalizes each point to 100%. Honored only on `area`/`areaspline` variants
56
+ * (a `stacked-area` chart); ignored on `line`/`spline`. Unstacked when omitted.
57
+ */
58
+ stacking?: "normal" | "percent";
59
+ /** Appended to each tooltip value (e.g., `"%"`). */
60
+ valueSuffix?: string;
61
+ /** Override for the default tooltip content. */
62
+ tooltip?: (args: ChartTooltipProps) => ReactNode;
63
+ /** Declarative annotations rendered at positions on the chart. */
64
+ annotations?: ChartAnnotation[];
65
+ /** Click handler invoked with the x-axis value of the clicked point — the category name on a category axis, the numeric timestamp on a datetime axis. */
66
+ onClick?: ({ position }: {
67
+ position: number | string;
68
+ }) => void;
69
+ /** Footer content shown in the default tooltip when `onClick` is set. */
70
+ tooltipClickLabel?: ReactNode;
71
+ /** Override for the value shown when a data point is invalid/missing (null). Defaults to an em-dash. */
72
+ invalidNumberLabel?: ReactNode;
73
+ /**
74
+ * Fired once per chart instance with an opaque {@link ChartExportHandle} for
75
+ * triggering PNG/SVG/PDF/CSV downloads. Re-fires only on a genuine remount,
76
+ * never on data or prop updates.
77
+ */
78
+ onReady?: (handle: ChartExportHandle) => void;
79
+ }
80
+
81
+ declare const LineAreaChart: react.NamedExoticComponent<LineAreaChartProps>;
82
+
83
+ export { CategoryAxis, ChartExportHandle, DatetimeAxis, LineAreaChart, type LineAreaChartProps, type LineAreaSeries, type LineAreaVariant, type LineAreaXAxis, type LineAreaYAxis };
@@ -0,0 +1,151 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+ var _chunkVSZSIN34js = require('../chunk-VSZSIN34.js');
11
+
12
+
13
+
14
+ var _chunkEEVKTTT3js = require('../chunk-EEVKTTT3.js');
15
+
16
+ // src/charts/line-area/LineAreaChart.tsx
17
+ var _react = require('react');
18
+
19
+ // src/charts/line-area/adapter.ts
20
+ var AREA_VARIANTS = /* @__PURE__ */ new Set(["area", "areaspline"]);
21
+ function pointY(point) {
22
+ if (point === null) return null;
23
+ if (typeof point === "number") return point;
24
+ if (Array.isArray(point)) return point[1];
25
+ return point.y;
26
+ }
27
+ function withIsolatedPointMarkers(data) {
28
+ return data.map((point, i) => {
29
+ if (point === null) return null;
30
+ if (pointY(point) === null) return point;
31
+ const prevY = i === 0 ? null : pointY(data[i - 1]);
32
+ const nextY = i === data.length - 1 ? null : pointY(data[i + 1]);
33
+ if (prevY !== null || nextY !== null) return point;
34
+ const marker = { enabled: true, symbol: "circle" };
35
+ if (typeof point === "number") return { y: point, marker };
36
+ if (Array.isArray(point)) return { x: point[0], y: point[1], marker };
37
+ return { ...point, marker };
38
+ });
39
+ }
40
+ function buildLineAreaChartOptions(props) {
41
+ const tooltipTimezone = _chunkVSZSIN34js.resolveTooltipTimezone.call(void 0, props.xAxis, props.timezone);
42
+ const isStacked = AREA_VARIANTS.has(props.variant) && Boolean(props.stacking);
43
+ const { annotations, lookup: annotationLookup } = _chunkVSZSIN34js.buildAnnotationConfig.call(void 0,
44
+ props.annotations
45
+ );
46
+ const options = {
47
+ ..._chunkVSZSIN34js.buildBaseChartOptions.call(void 0, {
48
+ type: props.variant,
49
+ description: props.description,
50
+ valueSuffix: props.valueSuffix,
51
+ reserveTopMargin: Boolean(annotations),
52
+ timezone: tooltipTimezone
53
+ }),
54
+ xAxis: _chunkVSZSIN34js.buildDimensionalAxis.call(void 0, props.xAxis, _nullishCoalesce(tooltipTimezone, () => ( "UTC"))),
55
+ yAxis: {
56
+ min: _optionalChain([props, 'access', _ => _.yAxis, 'optionalAccess', _2 => _2.min]),
57
+ max: _optionalChain([props, 'access', _3 => _3.yAxis, 'optionalAccess', _4 => _4.max]),
58
+ // Anchor the value axis to 0 (like v1/bar/area): line/spline otherwise
59
+ // auto-scale above 0, which truncates the axis and pushes the annotation
60
+ // anchor (y: 0) out of range. `soft` still extends for negative data.
61
+ softMin: 0,
62
+ softMax: 0,
63
+ gridLineWidth: _optionalChain([props, 'access', _5 => _5.yAxis, 'optionalAccess', _6 => _6.showGridLines]) === false ? 0 : 1,
64
+ title: { text: _nullishCoalesce(_optionalChain([props, 'access', _7 => _7.yAxis, 'optionalAccess', _8 => _8.title]), () => ( "")) },
65
+ // Zero-config default: abbreviate value-axis ticks (1.20K / 1.20M / 1.20B).
66
+ labels: {
67
+ // A declarative `format` drives ticks through the shared valueFormatter;
68
+ // absent it, the zero-config decimal default (1.20K / 1.20M / 1.20B).
69
+ formatter: _optionalChain([props, 'access', _9 => _9.yAxis, 'optionalAccess', _10 => _10.format]) ? _chunkVSZSIN34js.makeValueAxisLabelFormatter.call(void 0, props.yAxis.format) : _chunkVSZSIN34js.defaultValueAxisLabelFormatter
70
+ }
71
+ },
72
+ plotOptions: {
73
+ series: {
74
+ animation: false,
75
+ // Hide point markers by default (matching v1 + designs); isolated points
76
+ // re-enable their own marker via `withIsolatedPointMarkers`.
77
+ marker: { enabled: false },
78
+ ...props.onClick ? {
79
+ point: {
80
+ events: {
81
+ click: (event) => props.onClick({ position: event.point.x })
82
+ }
83
+ }
84
+ } : {}
85
+ },
86
+ // Type-scoped stacking: only the (area) variant stacks. `isStacked` already
87
+ // guarantees `props.variant` is an area variant here, so the computed key is
88
+ // always a valid plotOptions slot. Matches bar's per-type placement and keeps
89
+ // line/spline unstacked.
90
+ ...isStacked ? { [props.variant]: { stacking: props.stacking } } : {}
91
+ },
92
+ series: props.series.map((s) => ({
93
+ type: props.variant,
94
+ name: s.name,
95
+ data: withIsolatedPointMarkers(s.data)
96
+ })),
97
+ ...annotations ? { annotations } : {}
98
+ };
99
+ return { options, annotationLookup, tooltipTimezone };
100
+ }
101
+
102
+ // src/charts/line-area/styles.ts
103
+ var _styledcomponents = require('styled-components'); var _styledcomponents2 = _interopRequireDefault(_styledcomponents);
104
+ var LineAreaChartContainer = _styledcomponents2.default.div`
105
+ background-color: ${({ theme }) => theme.colors.container.background.base};
106
+ ${(props) => props.$isArea ? _chunkEEVKTTT3js.areaChartStyles : _chunkEEVKTTT3js.lineChartStyles}
107
+ `;
108
+
109
+ // src/charts/line-area/LineAreaChart.tsx
110
+ var _jsxruntime = require('react/jsx-runtime');
111
+ var AREA_VARIANTS2 = /* @__PURE__ */ new Set(["area", "areaspline"]);
112
+ var LineAreaChart = _react.memo.call(void 0, function LineAreaChart2(props) {
113
+ const { colors, patterns } = _chunkVSZSIN34js.useSeedsChartSetup.call(void 0, {
114
+ series: props.series,
115
+ includePatterns: true
116
+ });
117
+ const { options, annotationLookup, tooltipTimezone } = _react.useMemo.call(void 0,
118
+ () => buildLineAreaChartOptions(props),
119
+ [props]
120
+ );
121
+ const hasOnClick = Boolean(props.onClick);
122
+ return /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
123
+ LineAreaChartContainer,
124
+ {
125
+ $colors: colors,
126
+ $patterns: patterns,
127
+ $hasOnClick: hasOnClick,
128
+ $isArea: AREA_VARIANTS2.has(props.variant),
129
+ className: props.className,
130
+ children: /* @__PURE__ */ _jsxruntime.jsx.call(void 0,
131
+ _chunkVSZSIN34js.ChartRenderer,
132
+ {
133
+ options,
134
+ series: props.series,
135
+ colors,
136
+ tooltip: props.tooltip,
137
+ annotationLookup,
138
+ hasOnClick,
139
+ tooltipClickLabel: props.tooltipClickLabel,
140
+ timezone: tooltipTimezone,
141
+ invalidNumberLabel: props.invalidNumberLabel,
142
+ onReady: props.onReady
143
+ }
144
+ )
145
+ }
146
+ );
147
+ });
148
+
149
+
150
+ exports.LineAreaChart = LineAreaChart;
151
+ //# sourceMappingURL=index.js.map
@@ -0,0 +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","../../src/charts/line-area/styles.ts"],"names":["AREA_VARIANTS","LineAreaChart"],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,uDAA6B;AAC7B;AACE;AACA;AACF,uDAA6B;AAC7B;AACA;ACfA,8BAA8B;ADiB9B;AACA;AEEA,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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CAAC","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 { buildLineAreaChartOptions } from \"./adapter\";\nimport { LineAreaChartContainer } from \"./styles\";\nimport type { LineAreaChartProps, LineAreaVariant } from \"./types\";\n\nconst AREA_VARIANTS = new Set<LineAreaVariant>([\"area\", \"areaspline\"]);\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\n return (\n <LineAreaChartContainer\n $colors={colors}\n $patterns={patterns}\n $hasOnClick={hasOnClick}\n $isArea={AREA_VARIANTS.has(props.variant)}\n className={props.className}\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 onReady={props.onReady}\n />\n </LineAreaChartContainer>\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 {\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// Mirrors v1's marker handling: point markers are hidden by default (set on\n// `plotOptions.series`), but an *isolated* non-null point — one with a null (or\n// the chart edge) on both sides — gets a circle marker so a point with no\n// connecting line segment stays visible. Connected points pass through\n// unchanged so the line/area renders dot-free, matching v1 and 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 options: SeedsChartOptions = {\n ...buildBaseChartOptions({\n type: props.variant,\n description: props.description,\n valueSuffix: props.valueSuffix,\n reserveTopMargin: Boolean(annotations),\n timezone: tooltipTimezone,\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 (like v1/bar/area): 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 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 (matching v1 + designs); isolated points\n // re-enable their own marker via `withIsolatedPointMarkers`.\n marker: { enabled: false },\n ...(props.onClick\n ? {\n point: {\n events: {\n click: (event) => props.onClick!({ position: event.point.x }),\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","import styled from \"styled-components\";\nimport { lineChartStyles, areaChartStyles } from \"../../styles/chartStyles\";\nimport type {\n TypeChartStyleColor,\n TypeChartStyleHasOnClick,\n TypeChartStylePattern,\n} from \"../../types\";\n\ntype StyleProps = Readonly<{\n $colors: ReadonlyArray<TypeChartStyleColor>;\n $patterns: ReadonlyArray<TypeChartStylePattern>;\n $hasOnClick: TypeChartStyleHasOnClick;\n /** `area`/`areaspline` fill below the line; `line`/`spline` show only the stroke. */\n $isArea: boolean;\n}>;\n\n// Plain styled `div` — not `Box`. Per the DS Tailwind direction, components\n// render semantic elements internally (and accept `className`) rather than\n// depending on the `Box` component. The container background — previously Box's\n// `bg` prop — is set explicitly here.\n//\n// The line/area CSS is still v1's styled-components layer (`chartStyles.ts`);\n// migrating those styles to CSS modules is a tracked clean-up follow-up.\nexport const LineAreaChartContainer = styled.div<StyleProps>`\n background-color: ${({ theme }) => theme.colors.container.background.base};\n ${(props) => (props.$isArea ? areaChartStyles : lineChartStyles)}\n`;\n"]}
@@ -0,0 +1,10 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/charts/shared/pdfExportLibs.ts
2
+ var _jspdf = require('jspdf');
3
+ require('svg2pdf.js');
4
+ function loadPdfExportLibs() {
5
+ window.jspdf = { jsPDF: _jspdf.jsPDF };
6
+ }
7
+
8
+
9
+ exports.loadPdfExportLibs = loadPdfExportLibs;
10
+ //# sourceMappingURL=pdfExportLibs-BZR2D3RA.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/pdfExportLibs-BZR2D3RA.js","../src/charts/shared/pdfExportLibs.ts"],"names":[],"mappings":"AAAA;ACOA,8BAAsB;AAGtB,sBAAO;AAYA,SAAS,iBAAA,CAAA,EAA0B;AACxC,EAAC,MAAA,CAAkC,MAAA,EAAQ,EAAE,oBAAM,CAAA;AACrD;ADlBA;AACE;AACF,8CAAC","file":"/home/runner/_work/seeds/seeds/seeds-react/seeds-react-data-viz/dist/pdfExportLibs-BZR2D3RA.js","sourcesContent":[null,"// Lazily-loaded PDF export dependencies. This module is imported via a dynamic\n// `import(\"./pdfExportLibs\")` from `chartBase` so jspdf + svg2pdf.js land in a\n// deferred chunk (tsup `splitting: true`) and are fetched only when a consumer\n// actually exports a PDF — they stay out of the main bundle.\n//\n// It is Highcharts-free (imports jspdf/svg2pdf, never \"highcharts\"), so it does\n// not touch the engine-boundary invariant.\nimport { jsPDF } from \"jspdf\";\n// Side-effect import: svg2pdf.js patches `jsPDF.API.svg`, the method Highcharts'\n// offline-exporting calls (`pdfDoc.svg(...)`) to render the chart SVG into the PDF.\nimport \"svg2pdf.js\";\n\ninterface JsPdfGlobal {\n jspdf?: { jsPDF: typeof jsPDF };\n}\n\n/**\n * Expose jsPDF on `window.jspdf` so Highcharts' offline-exporting resolves PDF\n * support locally instead of fetching jspdf/svg2pdf from its CDN\n * (`exporting.libURL`). Highcharts checks `window.jspdf.jsPDF` and constructs\n * `new window.jspdf.jsPDF(...)`. Idempotent — safe to call before every export.\n */\nexport function loadPdfExportLibs(): void {\n (window as unknown as JsPdfGlobal).jspdf = { jsPDF };\n}\n"]}
@@ -0,0 +1,99 @@
1
+ import { ReactNode } from 'react';
2
+ import { AxisLabelsFormatterContextObject, TimeTicksInfoObject, Chart, Annotation } from 'highcharts';
3
+
4
+ /**
5
+ * Type of series to render. See {@link https://api.highcharts.com/highcharts/series} for detailed series configuration options.
6
+ */
7
+ type TypeSeriesType = "areaspline" | "spline" | "column";
8
+ interface ExtendedTimeTicksInfoObject extends TimeTicksInfoObject {
9
+ unitName: "hour" | "day" | "week" | "month" | "year";
10
+ }
11
+ interface ExtendedAxisLabelsFormatterContextObject extends AxisLabelsFormatterContextObject {
12
+ tickPositionInfo: ExtendedTimeTicksInfoObject;
13
+ }
14
+ type TypeChartDataPoint = Readonly<{
15
+ x: number | string;
16
+ y: number | null;
17
+ }>;
18
+ type TypeChartDataStyles = Readonly<{
19
+ color?: TypeChartStyleColor;
20
+ }>;
21
+ type TypeChartNumberFormat = "decimal" | "percent" | "currency" | "duration";
22
+ type TypeChartTimeFormat = "12" | "24";
23
+ type TypeChartTooltipDateFormatter = ({ x, }: {
24
+ x: number | string;
25
+ }) => ReactNode;
26
+ type TypeChartTooltipProps = Readonly<{
27
+ data: ReadonlyArray<Readonly<{
28
+ color: TypeChartStyleColor;
29
+ name: string;
30
+ value: number | null;
31
+ icon?: ReactNode;
32
+ }>>;
33
+ x: number | string;
34
+ /** True when the chart has an `onClick` handler — used by the default tooltip to render the click-label footer. */
35
+ hasOnClick?: boolean;
36
+ /** Footer content shown in the default tooltip when the chart is clickable. */
37
+ tooltipClickLabel?: ReactNode;
38
+ }>;
39
+ type TypeChartYAxisLabelFormatter = ({ y, yValues, }: Readonly<{
40
+ y: number;
41
+ yValues: ReadonlyArray<number>;
42
+ }>) => string;
43
+ type TypeChartXAnnotationsDetails = () => ReactNode;
44
+ type TypeChartXAnnotations = Readonly<{
45
+ [x: number]: Readonly<{
46
+ marker: () => ReactNode;
47
+ details: TypeChartXAnnotationsDetails;
48
+ }>;
49
+ }> | undefined;
50
+ type TypeChartStyleColor = string;
51
+ type TypeChartStylePattern = "solid" | "dashed";
52
+ type TypeChartStyleHasOnClick = boolean;
53
+ type TypeVerticalBarChartProps = Readonly<{
54
+ data: ReadonlyArray<Readonly<{
55
+ name: string;
56
+ points: ReadonlyArray<TypeChartDataPoint>;
57
+ icon?: ReactNode;
58
+ styles?: TypeChartDataStyles & Readonly<{
59
+ pattern?: TypeChartStylePattern;
60
+ }>;
61
+ }>>;
62
+ invalidNumberLabel: ReactNode;
63
+ numberLocale: Intl.LocalesArgument;
64
+ textLocale: Intl.LocalesArgument;
65
+ tooltipDateFormatter: TypeChartTooltipDateFormatter;
66
+ currency?: string;
67
+ numberFormat?: TypeChartNumberFormat;
68
+ /**
69
+ * The maximum number of series to display.
70
+ * @default 10
71
+ * @description We recommend limiting the number of series to 10 to maintain chart readability and accessibility.
72
+ */
73
+ seriesLimit?: number;
74
+ /**
75
+ * If false, disables the warning when the number of series exceeds the seriesLimit.
76
+ * @default true
77
+ */
78
+ showSeriesLimitWarning?: boolean;
79
+ tooltip?: ({ data, x }: TypeChartTooltipProps) => ReactNode;
80
+ yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
81
+ onClick?: ({ x }: Readonly<{
82
+ x: number;
83
+ }>) => void;
84
+ tooltipClickLabel?: ReactNode;
85
+ timeFormat?: TypeChartTimeFormat;
86
+ xAnnotations?: TypeChartXAnnotations;
87
+ xAxisLabelFormatter?: (params: {
88
+ textLocale: Intl.LocalesArgument;
89
+ tickPositions: number[];
90
+ unitName: string;
91
+ value: string | number;
92
+ timeFormat?: string;
93
+ }) => string;
94
+ }>;
95
+ interface TypeExtendedChart extends Chart {
96
+ annotations?: Annotation[];
97
+ }
98
+
99
+ export type { ExtendedTimeTicksInfoObject as E, TypeChartDataPoint as T, TypeChartDataStyles as a, TypeChartTooltipDateFormatter as b, TypeChartNumberFormat as c, TypeChartTooltipProps as d, TypeChartYAxisLabelFormatter as e, TypeChartTimeFormat as f, TypeChartXAnnotations as g, TypeChartStylePattern as h, TypeVerticalBarChartProps as i, TypeSeriesType as j, TypeChartStyleColor as k, TypeChartStyleHasOnClick as l, ExtendedAxisLabelsFormatterContextObject as m, TypeChartXAnnotationsDetails as n, TypeExtendedChart as o };
@@ -0,0 +1,99 @@
1
+ import { ReactNode } from 'react';
2
+ import { AxisLabelsFormatterContextObject, TimeTicksInfoObject, Chart, Annotation } from 'highcharts';
3
+
4
+ /**
5
+ * Type of series to render. See {@link https://api.highcharts.com/highcharts/series} for detailed series configuration options.
6
+ */
7
+ type TypeSeriesType = "areaspline" | "spline" | "column";
8
+ interface ExtendedTimeTicksInfoObject extends TimeTicksInfoObject {
9
+ unitName: "hour" | "day" | "week" | "month" | "year";
10
+ }
11
+ interface ExtendedAxisLabelsFormatterContextObject extends AxisLabelsFormatterContextObject {
12
+ tickPositionInfo: ExtendedTimeTicksInfoObject;
13
+ }
14
+ type TypeChartDataPoint = Readonly<{
15
+ x: number | string;
16
+ y: number | null;
17
+ }>;
18
+ type TypeChartDataStyles = Readonly<{
19
+ color?: TypeChartStyleColor;
20
+ }>;
21
+ type TypeChartNumberFormat = "decimal" | "percent" | "currency" | "duration";
22
+ type TypeChartTimeFormat = "12" | "24";
23
+ type TypeChartTooltipDateFormatter = ({ x, }: {
24
+ x: number | string;
25
+ }) => ReactNode;
26
+ type TypeChartTooltipProps = Readonly<{
27
+ data: ReadonlyArray<Readonly<{
28
+ color: TypeChartStyleColor;
29
+ name: string;
30
+ value: number | null;
31
+ icon?: ReactNode;
32
+ }>>;
33
+ x: number | string;
34
+ /** True when the chart has an `onClick` handler — used by the default tooltip to render the click-label footer. */
35
+ hasOnClick?: boolean;
36
+ /** Footer content shown in the default tooltip when the chart is clickable. */
37
+ tooltipClickLabel?: ReactNode;
38
+ }>;
39
+ type TypeChartYAxisLabelFormatter = ({ y, yValues, }: Readonly<{
40
+ y: number;
41
+ yValues: ReadonlyArray<number>;
42
+ }>) => string;
43
+ type TypeChartXAnnotationsDetails = () => ReactNode;
44
+ type TypeChartXAnnotations = Readonly<{
45
+ [x: number]: Readonly<{
46
+ marker: () => ReactNode;
47
+ details: TypeChartXAnnotationsDetails;
48
+ }>;
49
+ }> | undefined;
50
+ type TypeChartStyleColor = string;
51
+ type TypeChartStylePattern = "solid" | "dashed";
52
+ type TypeChartStyleHasOnClick = boolean;
53
+ type TypeVerticalBarChartProps = Readonly<{
54
+ data: ReadonlyArray<Readonly<{
55
+ name: string;
56
+ points: ReadonlyArray<TypeChartDataPoint>;
57
+ icon?: ReactNode;
58
+ styles?: TypeChartDataStyles & Readonly<{
59
+ pattern?: TypeChartStylePattern;
60
+ }>;
61
+ }>>;
62
+ invalidNumberLabel: ReactNode;
63
+ numberLocale: Intl.LocalesArgument;
64
+ textLocale: Intl.LocalesArgument;
65
+ tooltipDateFormatter: TypeChartTooltipDateFormatter;
66
+ currency?: string;
67
+ numberFormat?: TypeChartNumberFormat;
68
+ /**
69
+ * The maximum number of series to display.
70
+ * @default 10
71
+ * @description We recommend limiting the number of series to 10 to maintain chart readability and accessibility.
72
+ */
73
+ seriesLimit?: number;
74
+ /**
75
+ * If false, disables the warning when the number of series exceeds the seriesLimit.
76
+ * @default true
77
+ */
78
+ showSeriesLimitWarning?: boolean;
79
+ tooltip?: ({ data, x }: TypeChartTooltipProps) => ReactNode;
80
+ yAxisLabelFormatter?: TypeChartYAxisLabelFormatter;
81
+ onClick?: ({ x }: Readonly<{
82
+ x: number;
83
+ }>) => void;
84
+ tooltipClickLabel?: ReactNode;
85
+ timeFormat?: TypeChartTimeFormat;
86
+ xAnnotations?: TypeChartXAnnotations;
87
+ xAxisLabelFormatter?: (params: {
88
+ textLocale: Intl.LocalesArgument;
89
+ tickPositions: number[];
90
+ unitName: string;
91
+ value: string | number;
92
+ timeFormat?: string;
93
+ }) => string;
94
+ }>;
95
+ interface TypeExtendedChart extends Chart {
96
+ annotations?: Annotation[];
97
+ }
98
+
99
+ export type { ExtendedTimeTicksInfoObject as E, TypeChartDataPoint as T, TypeChartDataStyles as a, TypeChartTooltipDateFormatter as b, TypeChartNumberFormat as c, TypeChartTooltipProps as d, TypeChartYAxisLabelFormatter as e, TypeChartTimeFormat as f, TypeChartXAnnotations as g, TypeChartStylePattern as h, TypeVerticalBarChartProps as i, TypeSeriesType as j, TypeChartStyleColor as k, TypeChartStyleHasOnClick as l, ExtendedAxisLabelsFormatterContextObject as m, TypeChartXAnnotationsDetails as n, TypeExtendedChart as o };
package/package.json CHANGED
@@ -1,12 +1,34 @@
1
1
  {
2
2
  "name": "@sproutsocial/seeds-react-data-viz",
3
- "version": "0.7.32",
3
+ "version": "0.15.0",
4
4
  "description": "Seeds React Data Viz Components",
5
5
  "author": "Sprout Social, Inc.",
6
6
  "license": "MIT",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/esm/index.js",
9
9
  "types": "dist/index.d.ts",
10
+ "exports": {
11
+ ".": {
12
+ "types": "./dist/index.d.ts",
13
+ "import": "./dist/esm/index.js",
14
+ "require": "./dist/index.js"
15
+ },
16
+ "./bar": {
17
+ "types": "./dist/bar/index.d.ts",
18
+ "import": "./dist/esm/bar/index.js",
19
+ "require": "./dist/bar/index.js"
20
+ },
21
+ "./line-area": {
22
+ "types": "./dist/line-area/index.d.ts",
23
+ "import": "./dist/esm/line-area/index.js",
24
+ "require": "./dist/line-area/index.js"
25
+ },
26
+ "./export": {
27
+ "types": "./dist/export/index.d.ts",
28
+ "import": "./dist/esm/export/index.js",
29
+ "require": "./dist/export/index.js"
30
+ }
31
+ },
10
32
  "files": [
11
33
  "dist"
12
34
  ],
@@ -23,18 +45,22 @@
23
45
  "dependencies": {
24
46
  "@sproutsocial/seeds-dataviz": "^0.7.3",
25
47
  "@sproutsocial/seeds-networkcolor": "^2.22.0",
26
- "@sproutsocial/seeds-react-box": "^1.1.16",
27
- "@sproutsocial/seeds-react-duration": "^1.0.17",
28
- "@sproutsocial/seeds-react-icon": "^2.3.7",
29
- "@sproutsocial/seeds-react-numeral": "^1.0.39",
30
- "@sproutsocial/seeds-react-partner-logo": "^1.7.8",
31
- "@sproutsocial/seeds-react-system-props": "^3.0.1",
32
- "@sproutsocial/seeds-react-table": "^1.0.33",
33
- "@sproutsocial/seeds-react-text": "^1.4.0",
34
- "@sproutsocial/seeds-react-theme": "^3.6.2",
48
+ "@sproutsocial/seeds-react-box": "^1.1.21",
49
+ "@sproutsocial/seeds-react-button": "^2.2.1",
50
+ "@sproutsocial/seeds-react-duration": "^1.0.23",
51
+ "@sproutsocial/seeds-react-icon": "^2.4.0",
52
+ "@sproutsocial/seeds-react-menu": "^1.15.10",
53
+ "@sproutsocial/seeds-react-numeral": "^1.0.47",
54
+ "@sproutsocial/seeds-react-partner-logo": "^1.7.13",
55
+ "@sproutsocial/seeds-react-system-props": "^3.1.1",
56
+ "@sproutsocial/seeds-react-table": "^1.0.41",
57
+ "@sproutsocial/seeds-react-text": "^1.4.3",
58
+ "@sproutsocial/seeds-react-theme": "^4.1.0",
35
59
  "highcharts": "^11.4.3",
36
60
  "highcharts-react-official": "^3.2.1",
37
- "lodash": "^4.17.23"
61
+ "jspdf": "^4.2.1",
62
+ "lodash": "^4.17.23",
63
+ "svg2pdf.js": "^2.7.0"
38
64
  },
39
65
  "devDependencies": {
40
66
  "@sproutsocial/seeds-react-testing-library": "*",