@misael703/ui 1.62.1 → 1.63.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.
@@ -28,6 +28,13 @@ function valueAxisProps(valueFormatter, allowDecimals) {
28
28
  if (valueFormatter) props.tickFormatter = (v) => valueFormatter(Number(v));
29
29
  return props;
30
30
  }
31
+ var TOOLTIP_BASE_STYLE = { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 };
32
+ function tooltipContentStyle(tooltip) {
33
+ return { ...TOOLTIP_BASE_STYLE, maxWidth: tooltip?.maxWidth ?? "min(220px, 90vw)", whiteSpace: "normal" };
34
+ }
35
+ function tooltipChrome(tooltip) {
36
+ return tooltip?.allowEscapeViewBox ? { allowEscapeViewBox: tooltip.allowEscapeViewBox } : {};
37
+ }
31
38
  function tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) {
32
39
  const props = {};
33
40
  if (valueFormatter) props.formatter = (v) => valueFormatter(Number(v));
@@ -61,7 +68,8 @@ function LineChart({
61
68
  xTickAngle,
62
69
  valueFormatter,
63
70
  allowDecimals,
64
- tooltipLabelFormatter
71
+ tooltipLabelFormatter,
72
+ tooltip
65
73
  }) {
66
74
  const lineType = curve ?? (smooth ? "monotone" : "linear");
67
75
  const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));
@@ -69,7 +77,7 @@ function LineChart({
69
77
  showGrid && /* @__PURE__ */ jsx(R.CartesianGrid, { stroke: "var(--border-default)", strokeDasharray: "3 3", vertical: false }),
70
78
  /* @__PURE__ */ jsx(R.XAxis, { dataKey: categoryKey, stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle }) }),
71
79
  /* @__PURE__ */ jsx(R.YAxis, { stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...valueAxisProps(valueFormatter, allowDec) }),
72
- /* @__PURE__ */ jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
80
+ /* @__PURE__ */ jsx(R.Tooltip, { contentStyle: tooltipContentStyle(tooltip), ...tooltipChrome(tooltip), ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
73
81
  showLegend && /* @__PURE__ */ jsx(R.Legend, { wrapperStyle: { fontSize: 12 } }),
74
82
  series.map((s, i) => /* @__PURE__ */ jsx(
75
83
  R.Line,
@@ -104,7 +112,8 @@ function AreaChart({
104
112
  xTickAngle,
105
113
  valueFormatter,
106
114
  allowDecimals,
107
- tooltipLabelFormatter
115
+ tooltipLabelFormatter,
116
+ tooltip
108
117
  }) {
109
118
  const lineType = curve ?? (smooth ? "monotone" : "linear");
110
119
  const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));
@@ -112,7 +121,7 @@ function AreaChart({
112
121
  showGrid && /* @__PURE__ */ jsx(R.CartesianGrid, { stroke: "var(--border-default)", strokeDasharray: "3 3", vertical: false }),
113
122
  /* @__PURE__ */ jsx(R.XAxis, { dataKey: categoryKey, stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle }) }),
114
123
  /* @__PURE__ */ jsx(R.YAxis, { stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...valueAxisProps(valueFormatter, allowDec) }),
115
- /* @__PURE__ */ jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
124
+ /* @__PURE__ */ jsx(R.Tooltip, { contentStyle: tooltipContentStyle(tooltip), ...tooltipChrome(tooltip), ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
116
125
  showLegend && /* @__PURE__ */ jsx(R.Legend, { wrapperStyle: { fontSize: 12 } }),
117
126
  series.map((s, i) => /* @__PURE__ */ jsx(
118
127
  R.Area,
@@ -148,7 +157,8 @@ function BarChart({
148
157
  xTickAngle,
149
158
  valueFormatter,
150
159
  allowDecimals,
151
- tooltipLabelFormatter
160
+ tooltipLabelFormatter,
161
+ tooltip
152
162
  }) {
153
163
  const isHorizontal = layout === "horizontal";
154
164
  const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));
@@ -165,7 +175,7 @@ function BarChart({
165
175
  /* @__PURE__ */ jsx(R.XAxis, { dataKey: categoryKey, stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...catTicks }),
166
176
  /* @__PURE__ */ jsx(R.YAxis, { stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...valueAxisProps(valueFormatter, allowDec) })
167
177
  ] }),
168
- /* @__PURE__ */ jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, cursor: { fill: "var(--bg-subtle)" }, ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
178
+ /* @__PURE__ */ jsx(R.Tooltip, { contentStyle: tooltipContentStyle(tooltip), ...tooltipChrome(tooltip), cursor: { fill: "var(--bg-subtle)" }, ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
169
179
  showLegend && /* @__PURE__ */ jsx(R.Legend, { wrapperStyle: { fontSize: 12 } }),
170
180
  series.map((s, i) => {
171
181
  const barRadius = stacked ? i === lastIdx ? endRadius : [0, 0, 0, 0] : endRadius;
@@ -195,13 +205,14 @@ function DonutChart({
195
205
  innerRadius = 60,
196
206
  outerRadius = 88,
197
207
  nameFormatter,
198
- valueFormatter
208
+ valueFormatter,
209
+ tooltip
199
210
  }) {
200
211
  const tooltipProps2 = nameFormatter || valueFormatter ? { formatter: (v, n) => [valueFormatter ? valueFormatter(Number(v)) : v, nameFormatter ? nameFormatter(String(n)) : n] } : {};
201
212
  return /* @__PURE__ */ jsxs("div", { className: cx("chart chart--donut", className), role: "img", "aria-label": ariaLabel, children: [
202
213
  /* @__PURE__ */ jsxs("div", { className: "chart__donut-area", style: { height }, children: [
203
214
  /* @__PURE__ */ jsx(R.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(R.PieChart, { children: [
204
- /* @__PURE__ */ jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, ...tooltipProps2 }),
215
+ /* @__PURE__ */ jsx(R.Tooltip, { contentStyle: tooltipContentStyle(tooltip), ...tooltipChrome(tooltip), ...tooltipProps2 }),
205
216
  /* @__PURE__ */ jsx(
206
217
  R.Pie,
207
218
  {
@@ -239,12 +250,13 @@ function Sparkline({
239
250
  color = "var(--color-primary)",
240
251
  fill = true,
241
252
  interactive = false,
253
+ tooltip,
242
254
  className,
243
255
  ariaLabel
244
256
  }) {
245
257
  const margin = interactive ? { top: 4, right: 4, bottom: 4, left: 4 } : { top: 2, right: 0, bottom: 2, left: 0 };
246
- return /* @__PURE__ */ jsx("div", { className: cx("sparkline", className), role: "img", "aria-label": ariaLabel, style: { width, height }, children: /* @__PURE__ */ jsx(R.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(R.AreaChart, { data, margin, children: [
247
- interactive && /* @__PURE__ */ jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 } }),
258
+ return /* @__PURE__ */ jsx("div", { className: cx("sparkline", interactive && "sparkline--interactive", className), role: "img", "aria-label": ariaLabel, style: { width, height }, children: /* @__PURE__ */ jsx(R.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxs(R.AreaChart, { data, margin, children: [
259
+ interactive && /* @__PURE__ */ jsx(R.Tooltip, { contentStyle: tooltipContentStyle(tooltip), ...tooltipChrome(tooltip) }),
248
260
  /* @__PURE__ */ jsx(
249
261
  R.Area,
250
262
  {
@@ -262,5 +274,5 @@ function Sparkline({
262
274
  }
263
275
 
264
276
  export { AreaChart, BarChart, DonutChart, LineChart, Sparkline };
265
- //# sourceMappingURL=chunk-2GCYYHNG.mjs.map
266
- //# sourceMappingURL=chunk-2GCYYHNG.mjs.map
277
+ //# sourceMappingURL=chunk-37ZCEETH.mjs.map
278
+ //# sourceMappingURL=chunk-37ZCEETH.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Charts.tsx"],"names":["tooltipProps"],"mappings":";;;AA8CA,IAAM,OAAA,GAAU;AAAA,EACd,sBAAA;AAAA,EACA,wBAAA;AAAA,EACA,0BAAA;AAAA,EACA,sBAAA;AAAA,EACA,sBAAA;AAAA,EACA,qBAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA;AA6DA,IAAM,kBAAA,GAAmC,kBAAA;AAKzC,SAAS,iBAAA,CACP,IAAA,EACA,MAAA,GAAS,IAAA,EACgB;AACzB,EAAA,MAAM,KAAA,GAAiC,EAAE,QAAA,EAAU,IAAA,CAAK,iBAAiB,kBAAA,EAAmB;AAC5F,EAAA,IAAI,IAAA,CAAK,cAAA,EAAgB,KAAA,CAAM,aAAA,GAAgB,IAAA,CAAK,cAAA;AACpD,EAAA,IAAI,MAAA,IAAU,KAAK,UAAA,EAAY;AAC7B,IAAA,KAAA,CAAM,QAAQ,IAAA,CAAK,UAAA;AACnB,IAAA,KAAA,CAAM,UAAA,GAAa,KAAA;AACnB,IAAA,KAAA,CAAM,MAAA,GAAS,EAAA;AAAA,EACjB;AACA,EAAA,OAAO,KAAA;AACT;AAIA,SAAS,cAAA,CAAe,gBAAqD,aAAA,EAAiD;AAC5H,EAAA,MAAM,KAAA,GAAiC,EAAE,aAAA,EAAc;AACvD,EAAA,IAAI,cAAA,QAAsB,aAAA,GAAgB,CAAC,MAAc,cAAA,CAAe,MAAA,CAAO,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A;AAAA,QACR,WAAA,EAAa,GAAA;AAAA,QACb,IAAA,EAAM,OAAO,KAAA,GAAQ,MAAA;AAAA,QACrB,WAAA,EAAa,OAAO,IAAA,GAAO,CAAA;AAAA,QAC3B,iBAAA,EAAmB,KAAA;AAAA,QACnB,SAAA,EAAW,cAAc,EAAE,CAAA,EAAG,KAAK,WAAA,EAAa,CAAA,EAAG,IAAA,EAAM,KAAA,EAAM,GAAI;AAAA;AAAA;AACrE,GAAA,EACF,GACF,CAAA,EACF,CAAA;AAEJ","file":"chunk-37ZCEETH.mjs","sourcesContent":["'use client';\nimport * as React from 'react';\nimport { cx } from '../utils/cx';\n\n/**\n * Lightweight chart wrappers. We do NOT bundle Recharts — the host app provides it\n * and passes the modules in via the `recharts` prop so consumers only pay for what they use.\n *\n * Recharts is treated as an implicit peer dependency: install it in the host\n * app if you use any chart component. Use **recharts ≥ 3** — earlier versions use\n * `defaultProps` on function components, which logs a deprecation warning under\n * React 19. recharts 3 removed them; these wrappers use default parameters, so on\n * recharts 3.8+ the console stays clean (verified).\n *\n * Usage in a Next.js client component:\n *\n * import * as Recharts from 'recharts';\n * import { LineChart } from '@misael703/elalba-ui';\n * <LineChart recharts={Recharts} data={...} dataKey=\"value\" categoryKey=\"month\" />\n */\n\n// Structural mirror of the Recharts public API. `any` is intentional here:\n// each Recharts component has a different prop shape, and typing them\n// exhaustively would mean depending on `recharts` types — which would force\n// consumers to install recharts even when they don't use any chart.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype RechartsComp = React.ComponentType<any>;\n\nexport type RechartsLike = {\n ResponsiveContainer: RechartsComp;\n LineChart: RechartsComp;\n AreaChart: RechartsComp;\n BarChart: RechartsComp;\n PieChart: RechartsComp;\n Line: RechartsComp;\n Area: RechartsComp;\n Bar: RechartsComp;\n Pie: RechartsComp;\n Cell: RechartsComp;\n CartesianGrid: RechartsComp;\n XAxis: RechartsComp;\n YAxis: RechartsComp;\n Tooltip: RechartsComp;\n Legend: RechartsComp;\n};\n\nconst PALETTE = [\n 'var(--color-primary)',\n 'var(--color-secondary)',\n 'var(--color-primary-900)',\n 'var(--color-success)',\n 'var(--color-warning)',\n 'var(--color-danger)',\n '#6b7e95',\n '#d4a574',\n];\n\n/** Tooltip chrome shared by every chart. */\nexport interface ChartTooltipConfig {\n /**\n * Cap the tooltip width so long content wraps instead of overflowing a narrow\n * (mobile) chart. Default `min(220px, 90vw)`. Number = px; or any CSS length.\n */\n maxWidth?: number | string;\n /** Let the tooltip escape the chart's plotting box. Default: recharts (stays inside). */\n allowEscapeViewBox?: { x?: boolean; y?: boolean };\n}\n\nexport interface BaseChartProps<D = any> {\n recharts: RechartsLike;\n data: D[];\n height?: number;\n className?: string;\n ariaLabel?: string;\n /** Tooltip sizing/positioning. By default the tooltip caps its width and wraps. */\n tooltip?: ChartTooltipConfig;\n}\n\n// Mirror of Recharts' AxisInterval. Controls how category ticks thin on\n// collision so dense series (e.g. daily points) don't crowd the axis.\nexport type AxisInterval =\n | number\n | 'preserveStart'\n | 'preserveEnd'\n | 'preserveStartEnd'\n | 'equidistantPreserveStart'\n | 'equidistantPreserveEnd';\n\n// Shared cartesian controls (Line/Area/Bar). DonutChart/Sparkline don't have a\n// category axis, so they keep BaseChartProps.\nexport interface CartesianChartProps<D = any> extends BaseChartProps<D> {\n categoryKey: keyof D & string;\n series: Array<{ key: keyof D & string; label?: string; color?: string }>;\n showGrid?: boolean;\n showLegend?: boolean;\n /** Format each category-axis tick label, e.g. shorten `2026-05-23`. → XAxis.tickFormatter */\n xTickFormatter?: (value: string) => string;\n /** Thin out category ticks on collision. → XAxis.interval. Default `preserveStartEnd`. */\n xTickInterval?: AxisInterval;\n /** Rotate category-axis labels N degrees (anchors end + reserves height so they don't clip). */\n xTickAngle?: number;\n /** Format numeric values (value-axis ticks + tooltip). */\n valueFormatter?: (value: number) => string;\n /**\n * Allow fractional value-axis ticks. Default: auto — `false` when every series\n * value is an integer (count data → no `0.25` ticks), `true` otherwise. Pass\n * explicitly to override the auto-detection.\n */\n allowDecimals?: boolean;\n /**\n * Format the category label in the tooltip. Defaults to `xTickFormatter` so the\n * tooltip matches the axis (e.g. both show `18 jun`, not the raw `2026-06-18`).\n */\n tooltipLabelFormatter?: (value: string) => string;\n}\n\nconst DEFAULT_X_INTERVAL: AxisInterval = 'preserveStartEnd';\n\n// Recharts XAxis/YAxis are `any`-typed (structural mirror), so tick controls go\n// in as a spread. `rotate` is off when the category axis is the Y axis\n// (horizontal bars: those labels are already horizontal).\nfunction categoryTickProps(\n opts: Pick<CartesianChartProps, 'xTickFormatter' | 'xTickInterval' | 'xTickAngle'>,\n rotate = true,\n): Record<string, unknown> {\n const props: Record<string, unknown> = { interval: opts.xTickInterval ?? DEFAULT_X_INTERVAL };\n if (opts.xTickFormatter) props.tickFormatter = opts.xTickFormatter;\n if (rotate && opts.xTickAngle) {\n props.angle = opts.xTickAngle;\n props.textAnchor = 'end';\n props.height = 56; // reserve room so the rotated label isn't clipped\n }\n return props;\n}\n\n// Value axis: `allowDecimals` (count data → integer-only ticks) + optional\n// numeric tick formatter.\nfunction valueAxisProps(valueFormatter: ((v: number) => string) | undefined, allowDecimals: boolean): Record<string, unknown> {\n const props: Record<string, unknown> = { allowDecimals };\n if (valueFormatter) props.tickFormatter = (v: number) => valueFormatter(Number(v));\n return props;\n}\n\n// Tooltip box style: the kit chrome + a width cap with wrapping so long content\n// (long labels / many series) doesn't overflow a narrow chart. `min(220px, 90vw)`\n// stays inside on mobile and caps to 220px on desktop.\nconst TOOLTIP_BASE_STYLE = { background: 'var(--bg-surface)', border: '1px solid var(--border-default)', borderRadius: 8, fontSize: 12 } as const;\n\nfunction tooltipContentStyle(tooltip?: ChartTooltipConfig): Record<string, unknown> {\n return { ...TOOLTIP_BASE_STYLE, maxWidth: tooltip?.maxWidth ?? 'min(220px, 90vw)', whiteSpace: 'normal' };\n}\n\nfunction tooltipChrome(tooltip?: ChartTooltipConfig): Record<string, unknown> {\n return tooltip?.allowEscapeViewBox ? { allowEscapeViewBox: tooltip.allowEscapeViewBox } : {};\n}\n\n// Tooltip: value formatter + a category-label formatter that defaults to the\n// axis tick formatter (so the hovered label matches the axis).\nfunction tooltipProps(\n valueFormatter: ((v: number) => string) | undefined,\n tooltipLabelFormatter: ((v: string) => string) | undefined,\n xTickFormatter: ((v: string) => string) | undefined,\n): Record<string, unknown> {\n const props: Record<string, unknown> = {};\n if (valueFormatter) props.formatter = (v: unknown) => valueFormatter(Number(v));\n const labelFormatter = tooltipLabelFormatter ?? xTickFormatter;\n if (labelFormatter) props.labelFormatter = (v: unknown) => labelFormatter(String(v));\n return props;\n}\n\n// True when every plotted value is an integer → drives the `allowDecimals` auto-\n// detection (count series shouldn't get `0.25`-style ticks).\nfunction allIntegerValues<D>(data: D[], keys: string[]): boolean {\n for (const row of data) {\n for (const k of keys) {\n const v = (row as Record<string, unknown>)[k];\n if (typeof v === 'number' && Number.isFinite(v) && !Number.isInteger(v)) return false;\n }\n }\n return true;\n}\n\n// ---------- LineChart ---------------------------------------------------\nexport interface LineChartProps<D = any> extends CartesianChartProps<D> {\n smooth?: boolean;\n /** Interpolation. `monotone` smooths (default, back-compat); `linear` draws honest\n * straight segments — recommended for counts/stepped series (no phantom humps over zeros). */\n curve?: 'linear' | 'monotone';\n}\n\nexport function LineChart<D = any>({\n recharts: R, data, categoryKey, series,\n height = 280, className, ariaLabel,\n showGrid = true, showLegend = true, smooth = true, curve,\n xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, tooltip,\n}: LineChartProps<D>) {\n const lineType = curve ?? (smooth ? 'monotone' : 'linear');\n const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));\n return (\n <div className={cx('chart', className)} role=\"img\" aria-label={ariaLabel}>\n <R.ResponsiveContainer width=\"100%\" height={height}>\n <R.LineChart data={data} margin={{ top: 8, right: 16, bottom: 0, left: 0 }}>\n {showGrid && <R.CartesianGrid stroke=\"var(--border-default)\" strokeDasharray=\"3 3\" vertical={false} />}\n <R.XAxis dataKey={categoryKey} stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle })} />\n <R.YAxis stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...valueAxisProps(valueFormatter, allowDec)} />\n <R.Tooltip contentStyle={tooltipContentStyle(tooltip)} {...tooltipChrome(tooltip)} {...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter)} />\n {showLegend && <R.Legend wrapperStyle={{ fontSize: 12 }} />}\n {series.map((s, i) => (\n <R.Line\n key={s.key}\n type={lineType}\n dataKey={s.key}\n name={s.label ?? s.key}\n stroke={s.color ?? PALETTE[i % PALETTE.length]}\n strokeWidth={2}\n dot={false}\n activeDot={{ r: 4 }}\n />\n ))}\n </R.LineChart>\n </R.ResponsiveContainer>\n </div>\n );\n}\n\n// ---------- AreaChart ---------------------------------------------------\nexport interface AreaChartProps<D = any> extends LineChartProps<D> {\n stacked?: boolean;\n}\n\nexport function AreaChart<D = any>({\n recharts: R, data, categoryKey, series,\n height = 280, className, ariaLabel,\n showGrid = true, showLegend = true, smooth = true, curve, stacked,\n xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, tooltip,\n}: AreaChartProps<D>) {\n const lineType = curve ?? (smooth ? 'monotone' : 'linear');\n const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));\n return (\n <div className={cx('chart', className)} role=\"img\" aria-label={ariaLabel}>\n <R.ResponsiveContainer width=\"100%\" height={height}>\n <R.AreaChart data={data} margin={{ top: 8, right: 16, bottom: 0, left: 0 }}>\n {showGrid && <R.CartesianGrid stroke=\"var(--border-default)\" strokeDasharray=\"3 3\" vertical={false} />}\n <R.XAxis dataKey={categoryKey} stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle })} />\n <R.YAxis stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...valueAxisProps(valueFormatter, allowDec)} />\n <R.Tooltip contentStyle={tooltipContentStyle(tooltip)} {...tooltipChrome(tooltip)} {...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter)} />\n {showLegend && <R.Legend wrapperStyle={{ fontSize: 12 }} />}\n {series.map((s, i) => (\n <R.Area\n key={s.key}\n type={lineType}\n dataKey={s.key}\n name={s.label ?? s.key}\n stackId={stacked ? '1' : undefined}\n stroke={s.color ?? PALETTE[i % PALETTE.length]}\n fill={s.color ?? PALETTE[i % PALETTE.length]}\n fillOpacity={0.18}\n strokeWidth={2}\n />\n ))}\n </R.AreaChart>\n </R.ResponsiveContainer>\n </div>\n );\n}\n\n// ---------- BarChart ----------------------------------------------------\nexport interface BarChartProps<D = any> extends CartesianChartProps<D> {\n layout?: 'vertical' | 'horizontal';\n stacked?: boolean;\n}\n\nconst BAR_RADIUS = 4;\n\nexport function BarChart<D = any>({\n recharts: R, data, categoryKey, series,\n height = 280, className, ariaLabel,\n layout = 'vertical', stacked, showGrid = true, showLegend = true,\n xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, tooltip,\n}: BarChartProps<D>) {\n const isHorizontal = layout === 'horizontal';\n const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));\n // Radius must round the VALUE end: top for columns ([tl,tr,br,bl] → [R,R,0,0]),\n // right for horizontal bars ([0,R,R,0]). The old hardcoded [4,4,0,0] left\n // horizontal bars rounded-top / pointed-bottom.\n const endRadius = isHorizontal ? [0, BAR_RADIUS, BAR_RADIUS, 0] : [BAR_RADIUS, BAR_RADIUS, 0, 0];\n const lastIdx = series.length - 1;\n const catTicks = categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle });\n const catTicksNoRotate = categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle }, false);\n return (\n <div className={cx('chart', className)} role=\"img\" aria-label={ariaLabel}>\n <R.ResponsiveContainer width=\"100%\" height={height}>\n <R.BarChart data={data} layout={isHorizontal ? 'vertical' : 'horizontal'} margin={{ top: 8, right: 16, bottom: 0, left: 0 }}>\n {showGrid && <R.CartesianGrid stroke=\"var(--border-default)\" strokeDasharray=\"3 3\" vertical={isHorizontal} horizontal={!isHorizontal} />}\n {isHorizontal ? (\n <>\n <R.XAxis type=\"number\" stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...valueAxisProps(valueFormatter, allowDec)} />\n <R.YAxis dataKey={categoryKey} type=\"category\" stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} width={96} {...catTicksNoRotate} />\n </>\n ) : (\n <>\n <R.XAxis dataKey={categoryKey} stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...catTicks} />\n <R.YAxis stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...valueAxisProps(valueFormatter, allowDec)} />\n </>\n )}\n <R.Tooltip contentStyle={tooltipContentStyle(tooltip)} {...tooltipChrome(tooltip)} cursor={{ fill: 'var(--bg-subtle)' }} {...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter)} />\n {showLegend && <R.Legend wrapperStyle={{ fontSize: 12 }} />}\n {series.map((s, i) => {\n // Stacked: only the outermost (last) segment carries the end radius;\n // inner segments stay square so the stack reads as one bar.\n const barRadius = stacked ? (i === lastIdx ? endRadius : [0, 0, 0, 0]) : endRadius;\n return (\n <R.Bar\n key={s.key}\n dataKey={s.key}\n name={s.label ?? s.key}\n stackId={stacked ? '1' : undefined}\n fill={s.color ?? PALETTE[i % PALETTE.length]}\n radius={barRadius}\n maxBarSize={48}\n />\n );\n })}\n </R.BarChart>\n </R.ResponsiveContainer>\n </div>\n );\n}\n\n// ---------- DonutChart --------------------------------------------------\nexport interface DonutChartProps extends Omit<BaseChartProps, 'data'> {\n data: Array<{ name: string; value: number; color?: string }>;\n centerLabel?: React.ReactNode;\n showLegend?: boolean;\n innerRadius?: number;\n outerRadius?: number;\n /** Format slice names in tooltip + legend, e.g. `V_REGION` → `V Región` (no need to pre-map the data). */\n nameFormatter?: (name: string) => string;\n /** Format slice values in the tooltip. */\n valueFormatter?: (value: number) => string;\n}\n\nexport function DonutChart({\n recharts: R, data, height = 240, className, ariaLabel,\n centerLabel, showLegend = true, innerRadius = 60, outerRadius = 88,\n nameFormatter, valueFormatter, tooltip,\n}: DonutChartProps) {\n // Recharts Tooltip formatter returns [formattedValue, formattedName].\n const tooltipProps = (nameFormatter || valueFormatter)\n ? { formatter: (v: unknown, n: unknown) => [valueFormatter ? valueFormatter(Number(v)) : v, nameFormatter ? nameFormatter(String(n)) : n] }\n : {};\n return (\n <div className={cx('chart chart--donut', className)} role=\"img\" aria-label={ariaLabel}>\n <div className=\"chart__donut-area\" style={{ height }}>\n <R.ResponsiveContainer width=\"100%\" height=\"100%\">\n <R.PieChart>\n <R.Tooltip contentStyle={tooltipContentStyle(tooltip)} {...tooltipChrome(tooltip)} {...tooltipProps} />\n <R.Pie\n data={data}\n dataKey=\"value\"\n nameKey=\"name\"\n innerRadius={innerRadius}\n outerRadius={outerRadius}\n paddingAngle={2}\n stroke=\"var(--bg-surface)\"\n >\n {data.map((d, i) => <R.Cell key={i} fill={d.color ?? PALETTE[i % PALETTE.length]} />)}\n </R.Pie>\n </R.PieChart>\n </R.ResponsiveContainer>\n {centerLabel && <div className=\"chart__center\">{centerLabel}</div>}\n </div>\n {showLegend && (\n <ul className=\"chart__legend\" aria-hidden=\"true\">\n {data.map((d, i) => (\n <li key={d.name} className=\"chart__legend-item\">\n <span\n className=\"chart__legend-swatch\"\n style={{ background: d.color ?? PALETTE[i % PALETTE.length] }}\n />\n <span className=\"chart__legend-label\">{nameFormatter ? nameFormatter(d.name) : d.name}</span>\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n}\n\n// ---------- Sparkline ---------------------------------------------------\nexport interface SparklineProps<D = any> {\n recharts: RechartsLike;\n data: D[];\n dataKey: keyof D & string;\n width?: number;\n height?: number;\n color?: string;\n fill?: boolean;\n /**\n * Show a hover dot. Default `false` — a sparkline is glanceable/non-interactive\n * (the fine detail lives in the big LineChart). When off there's no active dot\n * to clip at the edges/base; when on, the margins are widened so it isn't cut.\n */\n interactive?: boolean;\n /** Tooltip sizing/positioning (only used when `interactive`). */\n tooltip?: ChartTooltipConfig;\n className?: string;\n ariaLabel?: string;\n}\n\nexport function Sparkline<D = any>({\n recharts: R, data, dataKey,\n width = 120, height = 32, color = 'var(--color-primary)',\n fill = true, interactive = false, tooltip, className, ariaLabel,\n}: SparklineProps<D>) {\n // No hover dot by default (it clips against the tiny margins at the first/last\n // point and the baseline). When interactive, leave room so it can't be cut off.\n const margin = interactive ? { top: 4, right: 4, bottom: 4, left: 4 } : { top: 2, right: 0, bottom: 2, left: 0 };\n return (\n <div className={cx('sparkline', interactive && 'sparkline--interactive', className)} role=\"img\" aria-label={ariaLabel} style={{ width, height }}>\n <R.ResponsiveContainer width=\"100%\" height=\"100%\">\n <R.AreaChart data={data} margin={margin}>\n {interactive && <R.Tooltip contentStyle={tooltipContentStyle(tooltip)} {...tooltipChrome(tooltip)} />}\n <R.Area\n type=\"monotone\"\n dataKey={dataKey}\n stroke={color}\n strokeWidth={1.5}\n fill={fill ? color : 'none'}\n fillOpacity={fill ? 0.18 : 0}\n isAnimationActive={false}\n activeDot={interactive ? { r: 2.5, strokeWidth: 0, fill: color } : false}\n />\n </R.AreaChart>\n </R.ResponsiveContainer>\n </div>\n );\n}\n"]}
@@ -30,6 +30,13 @@ function valueAxisProps(valueFormatter, allowDecimals) {
30
30
  if (valueFormatter) props.tickFormatter = (v) => valueFormatter(Number(v));
31
31
  return props;
32
32
  }
33
+ var TOOLTIP_BASE_STYLE = { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 };
34
+ function tooltipContentStyle(tooltip) {
35
+ return { ...TOOLTIP_BASE_STYLE, maxWidth: tooltip?.maxWidth ?? "min(220px, 90vw)", whiteSpace: "normal" };
36
+ }
37
+ function tooltipChrome(tooltip) {
38
+ return tooltip?.allowEscapeViewBox ? { allowEscapeViewBox: tooltip.allowEscapeViewBox } : {};
39
+ }
33
40
  function tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) {
34
41
  const props = {};
35
42
  if (valueFormatter) props.formatter = (v) => valueFormatter(Number(v));
@@ -63,7 +70,8 @@ function LineChart({
63
70
  xTickAngle,
64
71
  valueFormatter,
65
72
  allowDecimals,
66
- tooltipLabelFormatter
73
+ tooltipLabelFormatter,
74
+ tooltip
67
75
  }) {
68
76
  const lineType = curve ?? (smooth ? "monotone" : "linear");
69
77
  const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));
@@ -71,7 +79,7 @@ function LineChart({
71
79
  showGrid && /* @__PURE__ */ jsxRuntime.jsx(R.CartesianGrid, { stroke: "var(--border-default)", strokeDasharray: "3 3", vertical: false }),
72
80
  /* @__PURE__ */ jsxRuntime.jsx(R.XAxis, { dataKey: categoryKey, stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle }) }),
73
81
  /* @__PURE__ */ jsxRuntime.jsx(R.YAxis, { stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...valueAxisProps(valueFormatter, allowDec) }),
74
- /* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
82
+ /* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: tooltipContentStyle(tooltip), ...tooltipChrome(tooltip), ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
75
83
  showLegend && /* @__PURE__ */ jsxRuntime.jsx(R.Legend, { wrapperStyle: { fontSize: 12 } }),
76
84
  series.map((s, i) => /* @__PURE__ */ jsxRuntime.jsx(
77
85
  R.Line,
@@ -106,7 +114,8 @@ function AreaChart({
106
114
  xTickAngle,
107
115
  valueFormatter,
108
116
  allowDecimals,
109
- tooltipLabelFormatter
117
+ tooltipLabelFormatter,
118
+ tooltip
110
119
  }) {
111
120
  const lineType = curve ?? (smooth ? "monotone" : "linear");
112
121
  const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));
@@ -114,7 +123,7 @@ function AreaChart({
114
123
  showGrid && /* @__PURE__ */ jsxRuntime.jsx(R.CartesianGrid, { stroke: "var(--border-default)", strokeDasharray: "3 3", vertical: false }),
115
124
  /* @__PURE__ */ jsxRuntime.jsx(R.XAxis, { dataKey: categoryKey, stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle }) }),
116
125
  /* @__PURE__ */ jsxRuntime.jsx(R.YAxis, { stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...valueAxisProps(valueFormatter, allowDec) }),
117
- /* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
126
+ /* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: tooltipContentStyle(tooltip), ...tooltipChrome(tooltip), ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
118
127
  showLegend && /* @__PURE__ */ jsxRuntime.jsx(R.Legend, { wrapperStyle: { fontSize: 12 } }),
119
128
  series.map((s, i) => /* @__PURE__ */ jsxRuntime.jsx(
120
129
  R.Area,
@@ -150,7 +159,8 @@ function BarChart({
150
159
  xTickAngle,
151
160
  valueFormatter,
152
161
  allowDecimals,
153
- tooltipLabelFormatter
162
+ tooltipLabelFormatter,
163
+ tooltip
154
164
  }) {
155
165
  const isHorizontal = layout === "horizontal";
156
166
  const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));
@@ -167,7 +177,7 @@ function BarChart({
167
177
  /* @__PURE__ */ jsxRuntime.jsx(R.XAxis, { dataKey: categoryKey, stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...catTicks }),
168
178
  /* @__PURE__ */ jsxRuntime.jsx(R.YAxis, { stroke: "var(--fg-subtle)", fontSize: 12, tickLine: false, axisLine: false, ...valueAxisProps(valueFormatter, allowDec) })
169
179
  ] }),
170
- /* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, cursor: { fill: "var(--bg-subtle)" }, ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
180
+ /* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: tooltipContentStyle(tooltip), ...tooltipChrome(tooltip), cursor: { fill: "var(--bg-subtle)" }, ...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter) }),
171
181
  showLegend && /* @__PURE__ */ jsxRuntime.jsx(R.Legend, { wrapperStyle: { fontSize: 12 } }),
172
182
  series.map((s, i) => {
173
183
  const barRadius = stacked ? i === lastIdx ? endRadius : [0, 0, 0, 0] : endRadius;
@@ -197,13 +207,14 @@ function DonutChart({
197
207
  innerRadius = 60,
198
208
  outerRadius = 88,
199
209
  nameFormatter,
200
- valueFormatter
210
+ valueFormatter,
211
+ tooltip
201
212
  }) {
202
213
  const tooltipProps2 = nameFormatter || valueFormatter ? { formatter: (v, n) => [valueFormatter ? valueFormatter(Number(v)) : v, nameFormatter ? nameFormatter(String(n)) : n] } : {};
203
214
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkPASF6T4H_js.cx("chart chart--donut", className), role: "img", "aria-label": ariaLabel, children: [
204
215
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "chart__donut-area", style: { height }, children: [
205
216
  /* @__PURE__ */ jsxRuntime.jsx(R.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(R.PieChart, { children: [
206
- /* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 }, ...tooltipProps2 }),
217
+ /* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: tooltipContentStyle(tooltip), ...tooltipChrome(tooltip), ...tooltipProps2 }),
207
218
  /* @__PURE__ */ jsxRuntime.jsx(
208
219
  R.Pie,
209
220
  {
@@ -241,12 +252,13 @@ function Sparkline({
241
252
  color = "var(--color-primary)",
242
253
  fill = true,
243
254
  interactive = false,
255
+ tooltip,
244
256
  className,
245
257
  ariaLabel
246
258
  }) {
247
259
  const margin = interactive ? { top: 4, right: 4, bottom: 4, left: 4 } : { top: 2, right: 0, bottom: 2, left: 0 };
248
- return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkPASF6T4H_js.cx("sparkline", className), role: "img", "aria-label": ariaLabel, style: { width, height }, children: /* @__PURE__ */ jsxRuntime.jsx(R.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(R.AreaChart, { data, margin, children: [
249
- interactive && /* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: { background: "var(--bg-surface)", border: "1px solid var(--border-default)", borderRadius: 8, fontSize: 12 } }),
260
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkPASF6T4H_js.cx("sparkline", interactive && "sparkline--interactive", className), role: "img", "aria-label": ariaLabel, style: { width, height }, children: /* @__PURE__ */ jsxRuntime.jsx(R.ResponsiveContainer, { width: "100%", height: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(R.AreaChart, { data, margin, children: [
261
+ interactive && /* @__PURE__ */ jsxRuntime.jsx(R.Tooltip, { contentStyle: tooltipContentStyle(tooltip), ...tooltipChrome(tooltip) }),
250
262
  /* @__PURE__ */ jsxRuntime.jsx(
251
263
  R.Area,
252
264
  {
@@ -268,5 +280,5 @@ exports.BarChart = BarChart;
268
280
  exports.DonutChart = DonutChart;
269
281
  exports.LineChart = LineChart;
270
282
  exports.Sparkline = Sparkline;
271
- //# sourceMappingURL=chunk-K4VUQFUA.js.map
272
- //# sourceMappingURL=chunk-K4VUQFUA.js.map
283
+ //# sourceMappingURL=chunk-BC7BNFXX.js.map
284
+ //# sourceMappingURL=chunk-BC7BNFXX.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/components/Charts.tsx"],"names":["jsx","cx","jsxs","Fragment","tooltipProps"],"mappings":";;;;;AA8CA,IAAM,OAAA,GAAU;AAAA,EACd,sBAAA;AAAA,EACA,wBAAA;AAAA,EACA,0BAAA;AAAA,EACA,sBAAA;AAAA,EACA,sBAAA;AAAA,EACA,qBAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF,CAAA;AA6DA,IAAM,kBAAA,GAAmC,kBAAA;AAKzC,SAAS,iBAAA,CACP,IAAA,EACA,MAAA,GAAS,IAAA,EACgB;AACzB,EAAA,MAAM,KAAA,GAAiC,EAAE,QAAA,EAAU,IAAA,CAAK,iBAAiB,kBAAA,EAAmB;AAC5F,EAAA,IAAI,IAAA,CAAK,cAAA,EAAgB,KAAA,CAAM,aAAA,GAAgB,IAAA,CAAK,cAAA;AACpD,EAAA,IAAI,MAAA,IAAU,KAAK,UAAA,EAAY;AAC7B,IAAA,KAAA,CAAM,QAAQ,IAAA,CAAK,UAAA;AACnB,IAAA,KAAA,CAAM,UAAA,GAAa,KAAA;AACnB,IAAA,KAAA,CAAM,MAAA,GAAS,EAAA;AAAA,EACjB;AACA,EAAA,OAAO,KAAA;AACT;AAIA,SAAS,cAAA,CAAe,gBAAqD,aAAA,EAAiD;AAC5H,EAAA,MAAM,KAAA,GAAiC,EAAE,aAAA,EAAc;AACvD,EAAA,IAAI,cAAA,QAAsB,aAAA,GAAgB,CAAC,MAAc,cAAA,C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MAAF;AAAA,QACC,IAAA,EAAK,UAAA;AAAA,QACL,OAAA;AAAA,QACA,MAAA,EAAQ,KAAA;AAAA,QACR,WAAA,EAAa,GAAA;AAAA,QACb,IAAA,EAAM,OAAO,KAAA,GAAQ,MAAA;AAAA,QACrB,WAAA,EAAa,OAAO,IAAA,GAAO,CAAA;AAAA,QAC3B,iBAAA,EAAmB,KAAA;AAAA,QACnB,SAAA,EAAW,cAAc,EAAE,CAAA,EAAG,KAAK,WAAA,EAAa,CAAA,EAAG,IAAA,EAAM,KAAA,EAAM,GAAI;AAAA;AAAA;AACrE,GAAA,EACF,GACF,CAAA,EACF,CAAA;AAEJ","file":"chunk-BC7BNFXX.js","sourcesContent":["'use client';\nimport * as React from 'react';\nimport { cx } from '../utils/cx';\n\n/**\n * Lightweight chart wrappers. We do NOT bundle Recharts — the host app provides it\n * and passes the modules in via the `recharts` prop so consumers only pay for what they use.\n *\n * Recharts is treated as an implicit peer dependency: install it in the host\n * app if you use any chart component. Use **recharts ≥ 3** — earlier versions use\n * `defaultProps` on function components, which logs a deprecation warning under\n * React 19. recharts 3 removed them; these wrappers use default parameters, so on\n * recharts 3.8+ the console stays clean (verified).\n *\n * Usage in a Next.js client component:\n *\n * import * as Recharts from 'recharts';\n * import { LineChart } from '@misael703/elalba-ui';\n * <LineChart recharts={Recharts} data={...} dataKey=\"value\" categoryKey=\"month\" />\n */\n\n// Structural mirror of the Recharts public API. `any` is intentional here:\n// each Recharts component has a different prop shape, and typing them\n// exhaustively would mean depending on `recharts` types — which would force\n// consumers to install recharts even when they don't use any chart.\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype RechartsComp = React.ComponentType<any>;\n\nexport type RechartsLike = {\n ResponsiveContainer: RechartsComp;\n LineChart: RechartsComp;\n AreaChart: RechartsComp;\n BarChart: RechartsComp;\n PieChart: RechartsComp;\n Line: RechartsComp;\n Area: RechartsComp;\n Bar: RechartsComp;\n Pie: RechartsComp;\n Cell: RechartsComp;\n CartesianGrid: RechartsComp;\n XAxis: RechartsComp;\n YAxis: RechartsComp;\n Tooltip: RechartsComp;\n Legend: RechartsComp;\n};\n\nconst PALETTE = [\n 'var(--color-primary)',\n 'var(--color-secondary)',\n 'var(--color-primary-900)',\n 'var(--color-success)',\n 'var(--color-warning)',\n 'var(--color-danger)',\n '#6b7e95',\n '#d4a574',\n];\n\n/** Tooltip chrome shared by every chart. */\nexport interface ChartTooltipConfig {\n /**\n * Cap the tooltip width so long content wraps instead of overflowing a narrow\n * (mobile) chart. Default `min(220px, 90vw)`. Number = px; or any CSS length.\n */\n maxWidth?: number | string;\n /** Let the tooltip escape the chart's plotting box. Default: recharts (stays inside). */\n allowEscapeViewBox?: { x?: boolean; y?: boolean };\n}\n\nexport interface BaseChartProps<D = any> {\n recharts: RechartsLike;\n data: D[];\n height?: number;\n className?: string;\n ariaLabel?: string;\n /** Tooltip sizing/positioning. By default the tooltip caps its width and wraps. */\n tooltip?: ChartTooltipConfig;\n}\n\n// Mirror of Recharts' AxisInterval. Controls how category ticks thin on\n// collision so dense series (e.g. daily points) don't crowd the axis.\nexport type AxisInterval =\n | number\n | 'preserveStart'\n | 'preserveEnd'\n | 'preserveStartEnd'\n | 'equidistantPreserveStart'\n | 'equidistantPreserveEnd';\n\n// Shared cartesian controls (Line/Area/Bar). DonutChart/Sparkline don't have a\n// category axis, so they keep BaseChartProps.\nexport interface CartesianChartProps<D = any> extends BaseChartProps<D> {\n categoryKey: keyof D & string;\n series: Array<{ key: keyof D & string; label?: string; color?: string }>;\n showGrid?: boolean;\n showLegend?: boolean;\n /** Format each category-axis tick label, e.g. shorten `2026-05-23`. → XAxis.tickFormatter */\n xTickFormatter?: (value: string) => string;\n /** Thin out category ticks on collision. → XAxis.interval. Default `preserveStartEnd`. */\n xTickInterval?: AxisInterval;\n /** Rotate category-axis labels N degrees (anchors end + reserves height so they don't clip). */\n xTickAngle?: number;\n /** Format numeric values (value-axis ticks + tooltip). */\n valueFormatter?: (value: number) => string;\n /**\n * Allow fractional value-axis ticks. Default: auto — `false` when every series\n * value is an integer (count data → no `0.25` ticks), `true` otherwise. Pass\n * explicitly to override the auto-detection.\n */\n allowDecimals?: boolean;\n /**\n * Format the category label in the tooltip. Defaults to `xTickFormatter` so the\n * tooltip matches the axis (e.g. both show `18 jun`, not the raw `2026-06-18`).\n */\n tooltipLabelFormatter?: (value: string) => string;\n}\n\nconst DEFAULT_X_INTERVAL: AxisInterval = 'preserveStartEnd';\n\n// Recharts XAxis/YAxis are `any`-typed (structural mirror), so tick controls go\n// in as a spread. `rotate` is off when the category axis is the Y axis\n// (horizontal bars: those labels are already horizontal).\nfunction categoryTickProps(\n opts: Pick<CartesianChartProps, 'xTickFormatter' | 'xTickInterval' | 'xTickAngle'>,\n rotate = true,\n): Record<string, unknown> {\n const props: Record<string, unknown> = { interval: opts.xTickInterval ?? DEFAULT_X_INTERVAL };\n if (opts.xTickFormatter) props.tickFormatter = opts.xTickFormatter;\n if (rotate && opts.xTickAngle) {\n props.angle = opts.xTickAngle;\n props.textAnchor = 'end';\n props.height = 56; // reserve room so the rotated label isn't clipped\n }\n return props;\n}\n\n// Value axis: `allowDecimals` (count data → integer-only ticks) + optional\n// numeric tick formatter.\nfunction valueAxisProps(valueFormatter: ((v: number) => string) | undefined, allowDecimals: boolean): Record<string, unknown> {\n const props: Record<string, unknown> = { allowDecimals };\n if (valueFormatter) props.tickFormatter = (v: number) => valueFormatter(Number(v));\n return props;\n}\n\n// Tooltip box style: the kit chrome + a width cap with wrapping so long content\n// (long labels / many series) doesn't overflow a narrow chart. `min(220px, 90vw)`\n// stays inside on mobile and caps to 220px on desktop.\nconst TOOLTIP_BASE_STYLE = { background: 'var(--bg-surface)', border: '1px solid var(--border-default)', borderRadius: 8, fontSize: 12 } as const;\n\nfunction tooltipContentStyle(tooltip?: ChartTooltipConfig): Record<string, unknown> {\n return { ...TOOLTIP_BASE_STYLE, maxWidth: tooltip?.maxWidth ?? 'min(220px, 90vw)', whiteSpace: 'normal' };\n}\n\nfunction tooltipChrome(tooltip?: ChartTooltipConfig): Record<string, unknown> {\n return tooltip?.allowEscapeViewBox ? { allowEscapeViewBox: tooltip.allowEscapeViewBox } : {};\n}\n\n// Tooltip: value formatter + a category-label formatter that defaults to the\n// axis tick formatter (so the hovered label matches the axis).\nfunction tooltipProps(\n valueFormatter: ((v: number) => string) | undefined,\n tooltipLabelFormatter: ((v: string) => string) | undefined,\n xTickFormatter: ((v: string) => string) | undefined,\n): Record<string, unknown> {\n const props: Record<string, unknown> = {};\n if (valueFormatter) props.formatter = (v: unknown) => valueFormatter(Number(v));\n const labelFormatter = tooltipLabelFormatter ?? xTickFormatter;\n if (labelFormatter) props.labelFormatter = (v: unknown) => labelFormatter(String(v));\n return props;\n}\n\n// True when every plotted value is an integer → drives the `allowDecimals` auto-\n// detection (count series shouldn't get `0.25`-style ticks).\nfunction allIntegerValues<D>(data: D[], keys: string[]): boolean {\n for (const row of data) {\n for (const k of keys) {\n const v = (row as Record<string, unknown>)[k];\n if (typeof v === 'number' && Number.isFinite(v) && !Number.isInteger(v)) return false;\n }\n }\n return true;\n}\n\n// ---------- LineChart ---------------------------------------------------\nexport interface LineChartProps<D = any> extends CartesianChartProps<D> {\n smooth?: boolean;\n /** Interpolation. `monotone` smooths (default, back-compat); `linear` draws honest\n * straight segments — recommended for counts/stepped series (no phantom humps over zeros). */\n curve?: 'linear' | 'monotone';\n}\n\nexport function LineChart<D = any>({\n recharts: R, data, categoryKey, series,\n height = 280, className, ariaLabel,\n showGrid = true, showLegend = true, smooth = true, curve,\n xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, tooltip,\n}: LineChartProps<D>) {\n const lineType = curve ?? (smooth ? 'monotone' : 'linear');\n const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));\n return (\n <div className={cx('chart', className)} role=\"img\" aria-label={ariaLabel}>\n <R.ResponsiveContainer width=\"100%\" height={height}>\n <R.LineChart data={data} margin={{ top: 8, right: 16, bottom: 0, left: 0 }}>\n {showGrid && <R.CartesianGrid stroke=\"var(--border-default)\" strokeDasharray=\"3 3\" vertical={false} />}\n <R.XAxis dataKey={categoryKey} stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle })} />\n <R.YAxis stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...valueAxisProps(valueFormatter, allowDec)} />\n <R.Tooltip contentStyle={tooltipContentStyle(tooltip)} {...tooltipChrome(tooltip)} {...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter)} />\n {showLegend && <R.Legend wrapperStyle={{ fontSize: 12 }} />}\n {series.map((s, i) => (\n <R.Line\n key={s.key}\n type={lineType}\n dataKey={s.key}\n name={s.label ?? s.key}\n stroke={s.color ?? PALETTE[i % PALETTE.length]}\n strokeWidth={2}\n dot={false}\n activeDot={{ r: 4 }}\n />\n ))}\n </R.LineChart>\n </R.ResponsiveContainer>\n </div>\n );\n}\n\n// ---------- AreaChart ---------------------------------------------------\nexport interface AreaChartProps<D = any> extends LineChartProps<D> {\n stacked?: boolean;\n}\n\nexport function AreaChart<D = any>({\n recharts: R, data, categoryKey, series,\n height = 280, className, ariaLabel,\n showGrid = true, showLegend = true, smooth = true, curve, stacked,\n xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, tooltip,\n}: AreaChartProps<D>) {\n const lineType = curve ?? (smooth ? 'monotone' : 'linear');\n const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));\n return (\n <div className={cx('chart', className)} role=\"img\" aria-label={ariaLabel}>\n <R.ResponsiveContainer width=\"100%\" height={height}>\n <R.AreaChart data={data} margin={{ top: 8, right: 16, bottom: 0, left: 0 }}>\n {showGrid && <R.CartesianGrid stroke=\"var(--border-default)\" strokeDasharray=\"3 3\" vertical={false} />}\n <R.XAxis dataKey={categoryKey} stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle })} />\n <R.YAxis stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...valueAxisProps(valueFormatter, allowDec)} />\n <R.Tooltip contentStyle={tooltipContentStyle(tooltip)} {...tooltipChrome(tooltip)} {...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter)} />\n {showLegend && <R.Legend wrapperStyle={{ fontSize: 12 }} />}\n {series.map((s, i) => (\n <R.Area\n key={s.key}\n type={lineType}\n dataKey={s.key}\n name={s.label ?? s.key}\n stackId={stacked ? '1' : undefined}\n stroke={s.color ?? PALETTE[i % PALETTE.length]}\n fill={s.color ?? PALETTE[i % PALETTE.length]}\n fillOpacity={0.18}\n strokeWidth={2}\n />\n ))}\n </R.AreaChart>\n </R.ResponsiveContainer>\n </div>\n );\n}\n\n// ---------- BarChart ----------------------------------------------------\nexport interface BarChartProps<D = any> extends CartesianChartProps<D> {\n layout?: 'vertical' | 'horizontal';\n stacked?: boolean;\n}\n\nconst BAR_RADIUS = 4;\n\nexport function BarChart<D = any>({\n recharts: R, data, categoryKey, series,\n height = 280, className, ariaLabel,\n layout = 'vertical', stacked, showGrid = true, showLegend = true,\n xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, tooltip,\n}: BarChartProps<D>) {\n const isHorizontal = layout === 'horizontal';\n const allowDec = allowDecimals ?? !allIntegerValues(data, series.map((s) => s.key));\n // Radius must round the VALUE end: top for columns ([tl,tr,br,bl] → [R,R,0,0]),\n // right for horizontal bars ([0,R,R,0]). The old hardcoded [4,4,0,0] left\n // horizontal bars rounded-top / pointed-bottom.\n const endRadius = isHorizontal ? [0, BAR_RADIUS, BAR_RADIUS, 0] : [BAR_RADIUS, BAR_RADIUS, 0, 0];\n const lastIdx = series.length - 1;\n const catTicks = categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle });\n const catTicksNoRotate = categoryTickProps({ xTickFormatter, xTickInterval, xTickAngle }, false);\n return (\n <div className={cx('chart', className)} role=\"img\" aria-label={ariaLabel}>\n <R.ResponsiveContainer width=\"100%\" height={height}>\n <R.BarChart data={data} layout={isHorizontal ? 'vertical' : 'horizontal'} margin={{ top: 8, right: 16, bottom: 0, left: 0 }}>\n {showGrid && <R.CartesianGrid stroke=\"var(--border-default)\" strokeDasharray=\"3 3\" vertical={isHorizontal} horizontal={!isHorizontal} />}\n {isHorizontal ? (\n <>\n <R.XAxis type=\"number\" stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...valueAxisProps(valueFormatter, allowDec)} />\n <R.YAxis dataKey={categoryKey} type=\"category\" stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} width={96} {...catTicksNoRotate} />\n </>\n ) : (\n <>\n <R.XAxis dataKey={categoryKey} stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...catTicks} />\n <R.YAxis stroke=\"var(--fg-subtle)\" fontSize={12} tickLine={false} axisLine={false} {...valueAxisProps(valueFormatter, allowDec)} />\n </>\n )}\n <R.Tooltip contentStyle={tooltipContentStyle(tooltip)} {...tooltipChrome(tooltip)} cursor={{ fill: 'var(--bg-subtle)' }} {...tooltipProps(valueFormatter, tooltipLabelFormatter, xTickFormatter)} />\n {showLegend && <R.Legend wrapperStyle={{ fontSize: 12 }} />}\n {series.map((s, i) => {\n // Stacked: only the outermost (last) segment carries the end radius;\n // inner segments stay square so the stack reads as one bar.\n const barRadius = stacked ? (i === lastIdx ? endRadius : [0, 0, 0, 0]) : endRadius;\n return (\n <R.Bar\n key={s.key}\n dataKey={s.key}\n name={s.label ?? s.key}\n stackId={stacked ? '1' : undefined}\n fill={s.color ?? PALETTE[i % PALETTE.length]}\n radius={barRadius}\n maxBarSize={48}\n />\n );\n })}\n </R.BarChart>\n </R.ResponsiveContainer>\n </div>\n );\n}\n\n// ---------- DonutChart --------------------------------------------------\nexport interface DonutChartProps extends Omit<BaseChartProps, 'data'> {\n data: Array<{ name: string; value: number; color?: string }>;\n centerLabel?: React.ReactNode;\n showLegend?: boolean;\n innerRadius?: number;\n outerRadius?: number;\n /** Format slice names in tooltip + legend, e.g. `V_REGION` → `V Región` (no need to pre-map the data). */\n nameFormatter?: (name: string) => string;\n /** Format slice values in the tooltip. */\n valueFormatter?: (value: number) => string;\n}\n\nexport function DonutChart({\n recharts: R, data, height = 240, className, ariaLabel,\n centerLabel, showLegend = true, innerRadius = 60, outerRadius = 88,\n nameFormatter, valueFormatter, tooltip,\n}: DonutChartProps) {\n // Recharts Tooltip formatter returns [formattedValue, formattedName].\n const tooltipProps = (nameFormatter || valueFormatter)\n ? { formatter: (v: unknown, n: unknown) => [valueFormatter ? valueFormatter(Number(v)) : v, nameFormatter ? nameFormatter(String(n)) : n] }\n : {};\n return (\n <div className={cx('chart chart--donut', className)} role=\"img\" aria-label={ariaLabel}>\n <div className=\"chart__donut-area\" style={{ height }}>\n <R.ResponsiveContainer width=\"100%\" height=\"100%\">\n <R.PieChart>\n <R.Tooltip contentStyle={tooltipContentStyle(tooltip)} {...tooltipChrome(tooltip)} {...tooltipProps} />\n <R.Pie\n data={data}\n dataKey=\"value\"\n nameKey=\"name\"\n innerRadius={innerRadius}\n outerRadius={outerRadius}\n paddingAngle={2}\n stroke=\"var(--bg-surface)\"\n >\n {data.map((d, i) => <R.Cell key={i} fill={d.color ?? PALETTE[i % PALETTE.length]} />)}\n </R.Pie>\n </R.PieChart>\n </R.ResponsiveContainer>\n {centerLabel && <div className=\"chart__center\">{centerLabel}</div>}\n </div>\n {showLegend && (\n <ul className=\"chart__legend\" aria-hidden=\"true\">\n {data.map((d, i) => (\n <li key={d.name} className=\"chart__legend-item\">\n <span\n className=\"chart__legend-swatch\"\n style={{ background: d.color ?? PALETTE[i % PALETTE.length] }}\n />\n <span className=\"chart__legend-label\">{nameFormatter ? nameFormatter(d.name) : d.name}</span>\n </li>\n ))}\n </ul>\n )}\n </div>\n );\n}\n\n// ---------- Sparkline ---------------------------------------------------\nexport interface SparklineProps<D = any> {\n recharts: RechartsLike;\n data: D[];\n dataKey: keyof D & string;\n width?: number;\n height?: number;\n color?: string;\n fill?: boolean;\n /**\n * Show a hover dot. Default `false` — a sparkline is glanceable/non-interactive\n * (the fine detail lives in the big LineChart). When off there's no active dot\n * to clip at the edges/base; when on, the margins are widened so it isn't cut.\n */\n interactive?: boolean;\n /** Tooltip sizing/positioning (only used when `interactive`). */\n tooltip?: ChartTooltipConfig;\n className?: string;\n ariaLabel?: string;\n}\n\nexport function Sparkline<D = any>({\n recharts: R, data, dataKey,\n width = 120, height = 32, color = 'var(--color-primary)',\n fill = true, interactive = false, tooltip, className, ariaLabel,\n}: SparklineProps<D>) {\n // No hover dot by default (it clips against the tiny margins at the first/last\n // point and the baseline). When interactive, leave room so it can't be cut off.\n const margin = interactive ? { top: 4, right: 4, bottom: 4, left: 4 } : { top: 2, right: 0, bottom: 2, left: 0 };\n return (\n <div className={cx('sparkline', interactive && 'sparkline--interactive', className)} role=\"img\" aria-label={ariaLabel} style={{ width, height }}>\n <R.ResponsiveContainer width=\"100%\" height=\"100%\">\n <R.AreaChart data={data} margin={margin}>\n {interactive && <R.Tooltip contentStyle={tooltipContentStyle(tooltip)} {...tooltipChrome(tooltip)} />}\n <R.Area\n type=\"monotone\"\n dataKey={dataKey}\n stroke={color}\n strokeWidth={1.5}\n fill={fill ? color : 'none'}\n fillOpacity={fill ? 0.18 : 0}\n isAnimationActive={false}\n activeDot={interactive ? { r: 2.5, strokeWidth: 0, fill: color } : false}\n />\n </R.AreaChart>\n </R.ResponsiveContainer>\n </div>\n );\n}\n"]}
@@ -35,12 +35,27 @@ type RechartsLike = {
35
35
  Tooltip: RechartsComp;
36
36
  Legend: RechartsComp;
37
37
  };
38
+ /** Tooltip chrome shared by every chart. */
39
+ interface ChartTooltipConfig {
40
+ /**
41
+ * Cap the tooltip width so long content wraps instead of overflowing a narrow
42
+ * (mobile) chart. Default `min(220px, 90vw)`. Number = px; or any CSS length.
43
+ */
44
+ maxWidth?: number | string;
45
+ /** Let the tooltip escape the chart's plotting box. Default: recharts (stays inside). */
46
+ allowEscapeViewBox?: {
47
+ x?: boolean;
48
+ y?: boolean;
49
+ };
50
+ }
38
51
  interface BaseChartProps<D = any> {
39
52
  recharts: RechartsLike;
40
53
  data: D[];
41
54
  height?: number;
42
55
  className?: string;
43
56
  ariaLabel?: string;
57
+ /** Tooltip sizing/positioning. By default the tooltip caps its width and wraps. */
58
+ tooltip?: ChartTooltipConfig;
44
59
  }
45
60
  type AxisInterval = number | 'preserveStart' | 'preserveEnd' | 'preserveStartEnd' | 'equidistantPreserveStart' | 'equidistantPreserveEnd';
46
61
  interface CartesianChartProps<D = any> extends BaseChartProps<D> {
@@ -78,16 +93,16 @@ interface LineChartProps<D = any> extends CartesianChartProps<D> {
78
93
  * straight segments — recommended for counts/stepped series (no phantom humps over zeros). */
79
94
  curve?: 'linear' | 'monotone';
80
95
  }
81
- declare function LineChart<D = any>({ recharts: R, data, categoryKey, series, height, className, ariaLabel, showGrid, showLegend, smooth, curve, xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, }: LineChartProps<D>): react_jsx_runtime.JSX.Element;
96
+ declare function LineChart<D = any>({ recharts: R, data, categoryKey, series, height, className, ariaLabel, showGrid, showLegend, smooth, curve, xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, tooltip, }: LineChartProps<D>): react_jsx_runtime.JSX.Element;
82
97
  interface AreaChartProps<D = any> extends LineChartProps<D> {
83
98
  stacked?: boolean;
84
99
  }
85
- declare function AreaChart<D = any>({ recharts: R, data, categoryKey, series, height, className, ariaLabel, showGrid, showLegend, smooth, curve, stacked, xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, }: AreaChartProps<D>): react_jsx_runtime.JSX.Element;
100
+ declare function AreaChart<D = any>({ recharts: R, data, categoryKey, series, height, className, ariaLabel, showGrid, showLegend, smooth, curve, stacked, xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, tooltip, }: AreaChartProps<D>): react_jsx_runtime.JSX.Element;
86
101
  interface BarChartProps<D = any> extends CartesianChartProps<D> {
87
102
  layout?: 'vertical' | 'horizontal';
88
103
  stacked?: boolean;
89
104
  }
90
- declare function BarChart<D = any>({ recharts: R, data, categoryKey, series, height, className, ariaLabel, layout, stacked, showGrid, showLegend, xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, }: BarChartProps<D>): react_jsx_runtime.JSX.Element;
105
+ declare function BarChart<D = any>({ recharts: R, data, categoryKey, series, height, className, ariaLabel, layout, stacked, showGrid, showLegend, xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, tooltip, }: BarChartProps<D>): react_jsx_runtime.JSX.Element;
91
106
  interface DonutChartProps extends Omit<BaseChartProps, 'data'> {
92
107
  data: Array<{
93
108
  name: string;
@@ -103,7 +118,7 @@ interface DonutChartProps extends Omit<BaseChartProps, 'data'> {
103
118
  /** Format slice values in the tooltip. */
104
119
  valueFormatter?: (value: number) => string;
105
120
  }
106
- declare function DonutChart({ recharts: R, data, height, className, ariaLabel, centerLabel, showLegend, innerRadius, outerRadius, nameFormatter, valueFormatter, }: DonutChartProps): react_jsx_runtime.JSX.Element;
121
+ declare function DonutChart({ recharts: R, data, height, className, ariaLabel, centerLabel, showLegend, innerRadius, outerRadius, nameFormatter, valueFormatter, tooltip, }: DonutChartProps): react_jsx_runtime.JSX.Element;
107
122
  interface SparklineProps<D = any> {
108
123
  recharts: RechartsLike;
109
124
  data: D[];
@@ -118,9 +133,11 @@ interface SparklineProps<D = any> {
118
133
  * to clip at the edges/base; when on, the margins are widened so it isn't cut.
119
134
  */
120
135
  interactive?: boolean;
136
+ /** Tooltip sizing/positioning (only used when `interactive`). */
137
+ tooltip?: ChartTooltipConfig;
121
138
  className?: string;
122
139
  ariaLabel?: string;
123
140
  }
124
- declare function Sparkline<D = any>({ recharts: R, data, dataKey, width, height, color, fill, interactive, className, ariaLabel, }: SparklineProps<D>): react_jsx_runtime.JSX.Element;
141
+ declare function Sparkline<D = any>({ recharts: R, data, dataKey, width, height, color, fill, interactive, tooltip, className, ariaLabel, }: SparklineProps<D>): react_jsx_runtime.JSX.Element;
125
142
 
126
- export { AreaChart, type AreaChartProps, type AxisInterval, BarChart, type BarChartProps, type BaseChartProps, type CartesianChartProps, DonutChart, type DonutChartProps, LineChart, type LineChartProps, type RechartsLike, Sparkline, type SparklineProps };
143
+ export { AreaChart, type AreaChartProps, type AxisInterval, BarChart, type BarChartProps, type BaseChartProps, type CartesianChartProps, type ChartTooltipConfig, DonutChart, type DonutChartProps, LineChart, type LineChartProps, type RechartsLike, Sparkline, type SparklineProps };
@@ -35,12 +35,27 @@ type RechartsLike = {
35
35
  Tooltip: RechartsComp;
36
36
  Legend: RechartsComp;
37
37
  };
38
+ /** Tooltip chrome shared by every chart. */
39
+ interface ChartTooltipConfig {
40
+ /**
41
+ * Cap the tooltip width so long content wraps instead of overflowing a narrow
42
+ * (mobile) chart. Default `min(220px, 90vw)`. Number = px; or any CSS length.
43
+ */
44
+ maxWidth?: number | string;
45
+ /** Let the tooltip escape the chart's plotting box. Default: recharts (stays inside). */
46
+ allowEscapeViewBox?: {
47
+ x?: boolean;
48
+ y?: boolean;
49
+ };
50
+ }
38
51
  interface BaseChartProps<D = any> {
39
52
  recharts: RechartsLike;
40
53
  data: D[];
41
54
  height?: number;
42
55
  className?: string;
43
56
  ariaLabel?: string;
57
+ /** Tooltip sizing/positioning. By default the tooltip caps its width and wraps. */
58
+ tooltip?: ChartTooltipConfig;
44
59
  }
45
60
  type AxisInterval = number | 'preserveStart' | 'preserveEnd' | 'preserveStartEnd' | 'equidistantPreserveStart' | 'equidistantPreserveEnd';
46
61
  interface CartesianChartProps<D = any> extends BaseChartProps<D> {
@@ -78,16 +93,16 @@ interface LineChartProps<D = any> extends CartesianChartProps<D> {
78
93
  * straight segments — recommended for counts/stepped series (no phantom humps over zeros). */
79
94
  curve?: 'linear' | 'monotone';
80
95
  }
81
- declare function LineChart<D = any>({ recharts: R, data, categoryKey, series, height, className, ariaLabel, showGrid, showLegend, smooth, curve, xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, }: LineChartProps<D>): react_jsx_runtime.JSX.Element;
96
+ declare function LineChart<D = any>({ recharts: R, data, categoryKey, series, height, className, ariaLabel, showGrid, showLegend, smooth, curve, xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, tooltip, }: LineChartProps<D>): react_jsx_runtime.JSX.Element;
82
97
  interface AreaChartProps<D = any> extends LineChartProps<D> {
83
98
  stacked?: boolean;
84
99
  }
85
- declare function AreaChart<D = any>({ recharts: R, data, categoryKey, series, height, className, ariaLabel, showGrid, showLegend, smooth, curve, stacked, xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, }: AreaChartProps<D>): react_jsx_runtime.JSX.Element;
100
+ declare function AreaChart<D = any>({ recharts: R, data, categoryKey, series, height, className, ariaLabel, showGrid, showLegend, smooth, curve, stacked, xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, tooltip, }: AreaChartProps<D>): react_jsx_runtime.JSX.Element;
86
101
  interface BarChartProps<D = any> extends CartesianChartProps<D> {
87
102
  layout?: 'vertical' | 'horizontal';
88
103
  stacked?: boolean;
89
104
  }
90
- declare function BarChart<D = any>({ recharts: R, data, categoryKey, series, height, className, ariaLabel, layout, stacked, showGrid, showLegend, xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, }: BarChartProps<D>): react_jsx_runtime.JSX.Element;
105
+ declare function BarChart<D = any>({ recharts: R, data, categoryKey, series, height, className, ariaLabel, layout, stacked, showGrid, showLegend, xTickFormatter, xTickInterval, xTickAngle, valueFormatter, allowDecimals, tooltipLabelFormatter, tooltip, }: BarChartProps<D>): react_jsx_runtime.JSX.Element;
91
106
  interface DonutChartProps extends Omit<BaseChartProps, 'data'> {
92
107
  data: Array<{
93
108
  name: string;
@@ -103,7 +118,7 @@ interface DonutChartProps extends Omit<BaseChartProps, 'data'> {
103
118
  /** Format slice values in the tooltip. */
104
119
  valueFormatter?: (value: number) => string;
105
120
  }
106
- declare function DonutChart({ recharts: R, data, height, className, ariaLabel, centerLabel, showLegend, innerRadius, outerRadius, nameFormatter, valueFormatter, }: DonutChartProps): react_jsx_runtime.JSX.Element;
121
+ declare function DonutChart({ recharts: R, data, height, className, ariaLabel, centerLabel, showLegend, innerRadius, outerRadius, nameFormatter, valueFormatter, tooltip, }: DonutChartProps): react_jsx_runtime.JSX.Element;
107
122
  interface SparklineProps<D = any> {
108
123
  recharts: RechartsLike;
109
124
  data: D[];
@@ -118,9 +133,11 @@ interface SparklineProps<D = any> {
118
133
  * to clip at the edges/base; when on, the margins are widened so it isn't cut.
119
134
  */
120
135
  interactive?: boolean;
136
+ /** Tooltip sizing/positioning (only used when `interactive`). */
137
+ tooltip?: ChartTooltipConfig;
121
138
  className?: string;
122
139
  ariaLabel?: string;
123
140
  }
124
- declare function Sparkline<D = any>({ recharts: R, data, dataKey, width, height, color, fill, interactive, className, ariaLabel, }: SparklineProps<D>): react_jsx_runtime.JSX.Element;
141
+ declare function Sparkline<D = any>({ recharts: R, data, dataKey, width, height, color, fill, interactive, tooltip, className, ariaLabel, }: SparklineProps<D>): react_jsx_runtime.JSX.Element;
125
142
 
126
- export { AreaChart, type AreaChartProps, type AxisInterval, BarChart, type BarChartProps, type BaseChartProps, type CartesianChartProps, DonutChart, type DonutChartProps, LineChart, type LineChartProps, type RechartsLike, Sparkline, type SparklineProps };
143
+ export { AreaChart, type AreaChartProps, type AxisInterval, BarChart, type BarChartProps, type BaseChartProps, type CartesianChartProps, type ChartTooltipConfig, DonutChart, type DonutChartProps, LineChart, type LineChartProps, type RechartsLike, Sparkline, type SparklineProps };
@@ -1,30 +1,30 @@
1
1
  'use client';
2
2
  'use strict';
3
3
 
4
- var chunkK4VUQFUA_js = require('../chunk-K4VUQFUA.js');
4
+ var chunkBC7BNFXX_js = require('../chunk-BC7BNFXX.js');
5
5
  require('../chunk-PASF6T4H.js');
6
6
 
7
7
 
8
8
 
9
9
  Object.defineProperty(exports, "AreaChart", {
10
10
  enumerable: true,
11
- get: function () { return chunkK4VUQFUA_js.AreaChart; }
11
+ get: function () { return chunkBC7BNFXX_js.AreaChart; }
12
12
  });
13
13
  Object.defineProperty(exports, "BarChart", {
14
14
  enumerable: true,
15
- get: function () { return chunkK4VUQFUA_js.BarChart; }
15
+ get: function () { return chunkBC7BNFXX_js.BarChart; }
16
16
  });
17
17
  Object.defineProperty(exports, "DonutChart", {
18
18
  enumerable: true,
19
- get: function () { return chunkK4VUQFUA_js.DonutChart; }
19
+ get: function () { return chunkBC7BNFXX_js.DonutChart; }
20
20
  });
21
21
  Object.defineProperty(exports, "LineChart", {
22
22
  enumerable: true,
23
- get: function () { return chunkK4VUQFUA_js.LineChart; }
23
+ get: function () { return chunkBC7BNFXX_js.LineChart; }
24
24
  });
25
25
  Object.defineProperty(exports, "Sparkline", {
26
26
  enumerable: true,
27
- get: function () { return chunkK4VUQFUA_js.Sparkline; }
27
+ get: function () { return chunkBC7BNFXX_js.Sparkline; }
28
28
  });
29
29
  //# sourceMappingURL=Charts.js.map
30
30
  //# sourceMappingURL=Charts.js.map
@@ -1,5 +1,5 @@
1
1
  'use client';
2
- export { AreaChart, BarChart, DonutChart, LineChart, Sparkline } from '../chunk-2GCYYHNG.mjs';
2
+ export { AreaChart, BarChart, DonutChart, LineChart, Sparkline } from '../chunk-37ZCEETH.mjs';
3
3
  import '../chunk-IEPCH3JB.mjs';
4
4
  //# sourceMappingURL=Charts.mjs.map
5
5
  //# sourceMappingURL=Charts.mjs.map
package/dist/index.d.mts CHANGED
@@ -17,7 +17,7 @@ export { CheckboxGroup, CheckboxGroupProps, MoneyInput, MoneyInputProps, OptionI
17
17
  export { Avatar, AvatarGroup, AvatarGroupProps, AvatarProps, Menu, MenuItemProps, MenuProps, Stat, StatProps } from './components/Display2.mjs';
18
18
  export { CommandItem, CommandPalette, CommandPaletteProps, DateRange, DateRangePicker, DateRangePickerProps, DateRangePresetItem, DateRangePresetKey, DateRangePresetsOptions, MultiCombobox, MultiComboboxOption, MultiComboboxProps, UseCommandPaletteOptions, dateRangePresets, useCommandPalette } from './components/AdvancedPickers.mjs';
19
19
  export { AppShell, AppShellHeader, AppShellHeaderApi, AppShellHeaderSlot, AppShellProps, AppShellTheme, NavItem, NavSection, PageHeader, PageHeaderProps } from './components/AppShell.mjs';
20
- export { AreaChart, AreaChartProps, AxisInterval, BarChart, BarChartProps, BaseChartProps, CartesianChartProps, DonutChart, DonutChartProps, LineChart, LineChartProps, RechartsLike, Sparkline, SparklineProps } from './components/Charts.mjs';
20
+ export { AreaChart, AreaChartProps, AxisInterval, BarChart, BarChartProps, BaseChartProps, CartesianChartProps, ChartTooltipConfig, DonutChart, DonutChartProps, LineChart, LineChartProps, RechartsLike, Sparkline, SparklineProps } from './components/Charts.mjs';
21
21
  export { BulletChart, BulletChartProps, BulletTone, CalendarHeatmap, CalendarHeatmapProps, DeltaBadge, DeltaBadgeProps, DeltaTone, HeatmapCell, Meter, MeterOptimum, MeterProps, ProportionBar, ProportionBarProps, ProportionSegment, Sparkbar, SparkbarProps, StatCard, StatCardProps } from './components/Metrics.mjs';
22
22
  export { AlertCircle, AlertTriangle, AlignCenter, AlignLeft, AlignRight, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Bell, Bold, Building, CalendarDays, CalendarIcon, Check, CheckCircle, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Clock, Columns3, Copy, CreditCard, Download, Edit, ExternalLink, Eye, EyeOff, FileText, Filter, Folder, Globe, Heart, History, Home, IconProps, Info, Italic, LayoutGrid, Link, List, Loader, Lock, LogOut, Mail, Map, MapPin, MenuIcon, Minus, Moon, MoreHorizontal, MoreVertical, Package, Phone, Plus, RefreshCw, Rows3, Search, Settings, ShoppingCart, Star, Sun, Tag, Tool, Trash, Truck, Underline, Unlock, Upload, User, Users, Wallet, Wrench, X } from './components/Icons.mjs';
23
23
  export { Logo, LogoBg, LogoFormat, LogoProps, LogoVariant } from './components/Logo.mjs';
package/dist/index.d.ts CHANGED
@@ -17,7 +17,7 @@ export { CheckboxGroup, CheckboxGroupProps, MoneyInput, MoneyInputProps, OptionI
17
17
  export { Avatar, AvatarGroup, AvatarGroupProps, AvatarProps, Menu, MenuItemProps, MenuProps, Stat, StatProps } from './components/Display2.js';
18
18
  export { CommandItem, CommandPalette, CommandPaletteProps, DateRange, DateRangePicker, DateRangePickerProps, DateRangePresetItem, DateRangePresetKey, DateRangePresetsOptions, MultiCombobox, MultiComboboxOption, MultiComboboxProps, UseCommandPaletteOptions, dateRangePresets, useCommandPalette } from './components/AdvancedPickers.js';
19
19
  export { AppShell, AppShellHeader, AppShellHeaderApi, AppShellHeaderSlot, AppShellProps, AppShellTheme, NavItem, NavSection, PageHeader, PageHeaderProps } from './components/AppShell.js';
20
- export { AreaChart, AreaChartProps, AxisInterval, BarChart, BarChartProps, BaseChartProps, CartesianChartProps, DonutChart, DonutChartProps, LineChart, LineChartProps, RechartsLike, Sparkline, SparklineProps } from './components/Charts.js';
20
+ export { AreaChart, AreaChartProps, AxisInterval, BarChart, BarChartProps, BaseChartProps, CartesianChartProps, ChartTooltipConfig, DonutChart, DonutChartProps, LineChart, LineChartProps, RechartsLike, Sparkline, SparklineProps } from './components/Charts.js';
21
21
  export { BulletChart, BulletChartProps, BulletTone, CalendarHeatmap, CalendarHeatmapProps, DeltaBadge, DeltaBadgeProps, DeltaTone, HeatmapCell, Meter, MeterOptimum, MeterProps, ProportionBar, ProportionBarProps, ProportionSegment, Sparkbar, SparkbarProps, StatCard, StatCardProps } from './components/Metrics.js';
22
22
  export { AlertCircle, AlertTriangle, AlignCenter, AlignLeft, AlignRight, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, Bell, Bold, Building, CalendarDays, CalendarIcon, Check, CheckCircle, ChevronDown, ChevronLeft, ChevronRight, ChevronUp, Clock, Columns3, Copy, CreditCard, Download, Edit, ExternalLink, Eye, EyeOff, FileText, Filter, Folder, Globe, Heart, History, Home, IconProps, Info, Italic, LayoutGrid, Link, List, Loader, Lock, LogOut, Mail, Map, MapPin, MenuIcon, Minus, Moon, MoreHorizontal, MoreVertical, Package, Phone, Plus, RefreshCw, Rows3, Search, Settings, ShoppingCart, Star, Sun, Tag, Tool, Trash, Truck, Underline, Unlock, Upload, User, Users, Wallet, Wrench, X } from './components/Icons.js';
23
23
  export { Logo, LogoBg, LogoFormat, LogoProps, LogoVariant } from './components/Logo.js';