@sesionario/blocks 1.27.0 → 1.29.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.
@@ -0,0 +1,1450 @@
1
+ import * as React$1 from 'react';
2
+ import { ReactNode, Dispatch, SetStateAction, RefObject, CSSProperties } from 'react';
3
+ import { Transition } from 'motion/react';
4
+ import { scaleTime, scaleLinear, scaleBand } from '@visx/scale';
5
+ import { CurveFactory } from 'd3-shape';
6
+
7
+ type ChartStatus = "loading" | "ready";
8
+ /** Loading animation style: the default traveling pulse, or a diagonal
9
+ * shimmer that sweeps across the skeleton. */
10
+ type LoadingStyle = "pulse" | "sweep";
11
+ /**
12
+ * Internal visual lifecycle phase. Forward and reverse transitions add
13
+ * intermediate phases in later stack branches.
14
+ */
15
+ type ChartPhase = "loading" | "exiting" | "gridTweenReady" | "revealing" | "ready" | "exitingReady" | "gridTweenLoading" | "revealingLoading";
16
+
17
+ interface ReferenceAreaConfig {
18
+ yAxisId: string;
19
+ y1?: number;
20
+ y2?: number;
21
+ axisLabelColor?: string;
22
+ }
23
+
24
+ interface ChartSelection {
25
+ startX: number;
26
+ endX: number;
27
+ startIndex: number;
28
+ endIndex: number;
29
+ active: boolean;
30
+ }
31
+
32
+ type YDomain = [number, number];
33
+
34
+ type ScaleLinear<Output> = ReturnType<typeof scaleLinear<Output>>;
35
+ type ScaleTime<Output> = ReturnType<typeof scaleTime<Output>>;
36
+ type ScaleBand<Domain extends {
37
+ toString(): string;
38
+ }> = ReturnType<typeof scaleBand<Domain>>;
39
+
40
+ declare const chartCssVars: {
41
+ background: string;
42
+ foreground: string;
43
+ foregroundMuted: string;
44
+ label: string;
45
+ linePrimary: string;
46
+ lineSecondary: string;
47
+ crosshair: string;
48
+ grid: string;
49
+ indicatorColor: string;
50
+ indicatorSecondaryColor: string;
51
+ markerBackground: string;
52
+ markerBorder: string;
53
+ markerForeground: string;
54
+ badgeBackground: string;
55
+ badgeForeground: string;
56
+ segmentBackground: string;
57
+ segmentLine: string;
58
+ brushBorder: string;
59
+ tooltipBackground: string;
60
+ };
61
+ interface Margin {
62
+ top: number;
63
+ right: number;
64
+ bottom: number;
65
+ left: number;
66
+ }
67
+ interface TooltipData {
68
+ /** The data point being hovered */
69
+ point: Record<string, unknown>;
70
+ /** Index in the data array */
71
+ index: number;
72
+ /** X position in pixels (relative to chart area) */
73
+ x: number;
74
+ /** Y positions for each line, keyed by dataKey */
75
+ yPositions: Record<string, number>;
76
+ /** X positions for each series (for grouped bars), keyed by dataKey */
77
+ xPositions?: Record<string, number>;
78
+ }
79
+ interface LineConfig {
80
+ dataKey: string;
81
+ stroke: string;
82
+ strokeWidth: number;
83
+ /** Scale group id (Recharts `yAxisId`). Default: `"left"`. */
84
+ yAxisId?: string | number;
85
+ }
86
+ /**
87
+ * Hover/selection state — every field here changes on mouse movement.
88
+ * Lives in its own context so cold consumers (Grid, YAxis, PatternArea, …)
89
+ * can subscribe to the stable slice and skip re-rendering on every hover.
90
+ */
91
+ interface ChartHoverContextValue {
92
+ tooltipData: TooltipData | null;
93
+ setTooltipData: Dispatch<SetStateAction<TooltipData | null>>;
94
+ /** Current drag/pinch selection range */
95
+ selection?: ChartSelection | null;
96
+ /** Clear the current selection */
97
+ clearSelection?: () => void;
98
+ /** Index of currently hovered bar */
99
+ hoveredBarIndex?: number | null;
100
+ /** Setter for hovered bar index */
101
+ setHoveredBarIndex?: (index: number | null) => void;
102
+ /** Index of currently hovered candle */
103
+ hoveredCandleIndex?: number | null;
104
+ /** Setter for hovered candle index */
105
+ setHoveredCandleIndex?: (index: number | null) => void;
106
+ }
107
+ interface ChartContextValue extends ChartHoverContextValue {
108
+ data: Record<string, unknown>[];
109
+ /** Decimated subset for SVG path rendering; equals `data` when no decimation is needed. */
110
+ renderData: Record<string, unknown>[];
111
+ xScale: ScaleTime<number>;
112
+ /** Primary (left) y-scale — alias for `yScales[DEFAULT_Y_AXIS_ID]`. */
113
+ yScale: ScaleLinear<number>;
114
+ /** Per-axis y-scales keyed by `yAxisId`. */
115
+ yScales: Record<string, ScaleLinear<number>>;
116
+ width: number;
117
+ height: number;
118
+ innerWidth: number;
119
+ innerHeight: number;
120
+ margin: Margin;
121
+ columnWidth: number;
122
+ containerRef: RefObject<HTMLDivElement | null>;
123
+ lines: LineConfig[];
124
+ /** {@link ReferenceArea} bands — drives y-axis label colors in range. */
125
+ referenceAreas: ReferenceAreaConfig[];
126
+ chartPhase: ChartPhase;
127
+ chartStatus: ChartStatus;
128
+ /** Centered label while `chartPhase` shows loading chrome. */
129
+ loadingLabel?: string;
130
+ /** Y-domain tween duration when transitioning loading ↔ ready (ms). */
131
+ yDomainTweenDuration: number;
132
+ /** Nice’d y-domains per axis from skeleton data (placeholder). */
133
+ yDomainSkeletonByAxis: Record<string, YDomain>;
134
+ /** Nice’d y-domains per axis from the current target data. */
135
+ yDomainTargetByAxis: Record<string, YDomain>;
136
+ isLoaded: boolean;
137
+ animationDuration: number;
138
+ /** CSS easing for clip-reveal / line draw (cartesian charts). */
139
+ animationEasing?: string;
140
+ /** Motion enter transition (spring or tween) — drives clip reveal when spring. */
141
+ enterTransition?: Transition;
142
+ /** Increments when enter animation should replay. */
143
+ revealEpoch?: number;
144
+ /** Fired when a one-shot loading pulse (exit / enter) completes. */
145
+ notifyLoadingPulseComplete?: () => void;
146
+ xAccessor: (d: Record<string, unknown>) => Date;
147
+ dateLabels: string[];
148
+ /** Active brush zoom range — when set, axis ticks align to visible data rows. */
149
+ xDomain?: [Date, Date];
150
+ /** Full dataset length when brush zoom is enabled (for zoom vs full-range detection). */
151
+ xDomainSlotCount?: number;
152
+ /** Band scale for categorical x-axis (bar charts) */
153
+ barScale?: ScaleBand<string>;
154
+ /** Width of each bar band */
155
+ bandWidth?: number;
156
+ /** X accessor for bar charts (returns string instead of Date) */
157
+ barXAccessor?: (d: Record<string, unknown>) => string;
158
+ /** Bar chart orientation */
159
+ orientation?: "vertical" | "horizontal";
160
+ /** Whether bars are stacked */
161
+ stacked?: boolean;
162
+ /** Stack offsets: Map of data index -> Map of dataKey -> cumulative offset */
163
+ stackOffsets?: Map<number, Map<string, number>>;
164
+ /** Squares variant — snap tooltip to top square and size ring dots. */
165
+ squareSnap?: {
166
+ squareGap: number;
167
+ groupGap?: number;
168
+ fit?: boolean;
169
+ };
170
+ /** `SeriesBar` dataKeys in tree order, for grouped columns at each x */
171
+ composedBarDataKeys?: string[];
172
+ /** Target bar width in px (Recharts `barSize` style). */
173
+ composedBarSize?: number;
174
+ /** Max bar width in px (Recharts `maxBarSize`). */
175
+ composedMaxBarSize?: number;
176
+ /** Gap between grouped `SeriesBar` columns in px. */
177
+ composedBarGap?: number;
178
+ /** When true, `SeriesBar` segments stack in child order at each x. */
179
+ composedStacked?: boolean;
180
+ /** Per-row cumulative offsets for stacked `SeriesBar` (data index → dataKey → offset). */
181
+ composedStackOffsets?: Map<number, Map<string, number>>;
182
+ /** Vertical gap in px between stacked `SeriesBar` segments. Default: 0 */
183
+ composedStackGap?: number;
184
+ }
185
+ /**
186
+ * Stable slice of the chart context — everything that doesn't change on hover
187
+ * (data, scales, dimensions, animation state, layout config). Consumers that
188
+ * subscribe via `useChartStable()` skip re-renders on every mouse move.
189
+ */
190
+ type ChartStableContextValue = Omit<ChartContextValue, keyof ChartHoverContextValue>;
191
+ /**
192
+ * Splits the merged `value` into a stable slice and a volatile hover slice,
193
+ * publishing each to its own context. Each slice is memoized on its own
194
+ * field identities, so changing `tooltipData` does not bust the stable
195
+ * slice — consumers of `useChartStable()` skip re-renders on hover.
196
+ */
197
+ declare function ChartProvider({ children, value, }: {
198
+ children: ReactNode;
199
+ value: ChartContextValue;
200
+ }): React$1.JSX.Element;
201
+ /**
202
+ * Stable slice — data, scales, dimensions, animation state, layout config.
203
+ * Subscribers skip re-renders on hover (the hover slice lives in a separate
204
+ * context). Prefer this in cold consumers like axes, grid, pattern fills.
205
+ */
206
+ declare function useChartStable(): ChartStableContextValue;
207
+ /**
208
+ * Merged stable + hover context. Convenient for components that need both,
209
+ * but re-renders on every hover (because hover changes). Prefer
210
+ * `useChartStable()` or `useChartHover()` for hot consumers that only need
211
+ * one slice.
212
+ */
213
+ declare function useChart(): ChartContextValue;
214
+
215
+ type FadeEdges = boolean | "left" | "right";
216
+
217
+ type LineLoadingPulseMode = "loop" | "exit" | "enter";
218
+
219
+ interface SeriesPointMarkerStyle {
220
+ /** Fill color for the inner circle */
221
+ fill?: string;
222
+ /** Outer ring stroke color. Default: same as `fill` */
223
+ stroke?: string;
224
+ /** Outer ring stroke width in px. Default: 2. Set to 0 to disable. */
225
+ strokeWidth?: number;
226
+ /** Gap between the inner fill and outer ring in px. Default: 2 */
227
+ ringGap?: number;
228
+ /** Optional outer outline beyond the ring. Default: 0 */
229
+ outlineWidth?: number;
230
+ /** Outer outline color. Default: same as `stroke` */
231
+ outlineColor?: string;
232
+ /** Point radius in px. Default: 5 */
233
+ radius?: number;
234
+ /** Dim non-active points while hovering. Default: true */
235
+ fadeOnHover?: boolean;
236
+ /** Opacity for non-hovered points when `fadeOnHover` is true. Default: 0.5 */
237
+ inactiveOpacity?: number;
238
+ /**
239
+ * Blur in px for non-hovered points when `fadeOnHover` is true.
240
+ * Applied once on the dimmed layer (not per dot) for performance. Default: 2
241
+ */
242
+ inactiveBlur?: number;
243
+ /** Initial blur in px during enter animation. Default: 2 */
244
+ enterBlur?: number;
245
+ /** Enlarge the active point while hovering. Default: true */
246
+ showActiveHighlight?: boolean;
247
+ }
248
+
249
+ interface AreaProps {
250
+ /** Key in data to use for y values */
251
+ dataKey: string;
252
+ /** Y-scale group id (Recharts `yAxisId`). Default: `"left"`. */
253
+ yAxisId?: string | number;
254
+ /** Fill color for the area gradient start. Default: var(--chart-line-primary) */
255
+ fill?: string;
256
+ /** Fill opacity at the top of the area. Default: 0.4 */
257
+ fillOpacity?: number;
258
+ /** Stroke color for the line. Default: same as fill */
259
+ stroke?: string;
260
+ /** Stroke width. Default: 2 */
261
+ strokeWidth?: number;
262
+ /** Curve function. Default: curveMonotoneX */
263
+ curve?: CurveFactory;
264
+ /** Whether to animate the area. Default: true */
265
+ animate?: boolean;
266
+ /** Whether to show the stroke line. Default: true */
267
+ showLine?: boolean;
268
+ /** Whether to show highlight segment on hover. Default: true */
269
+ showHighlight?: boolean;
270
+ /** Gradient opacity at bottom (0 = fully transparent). Default: 0 */
271
+ gradientToOpacity?: number;
272
+ /**
273
+ * Vertical extent of the fill gradient (0–1). `1` fades across the full
274
+ * height; lower values compress the gradient toward the top.
275
+ */
276
+ gradientSpan?: number;
277
+ /**
278
+ * Fade the area fill (and stroke) toward transparent at the chart edges.
279
+ * - `true` fades both edges, `false` disables the fade entirely.
280
+ * - `"left"` / `"right"` fades only that side — useful when the opposite
281
+ * edge butts up against another element you don't want to fade into.
282
+ * Default: false
283
+ */
284
+ fadeEdges?: FadeEdges;
285
+ /** Render scatter-style circle markers at each data point. Default: false */
286
+ showMarkers?: boolean;
287
+ /** Marker styling (same options as Scatter). */
288
+ markers?: SeriesPointMarkerStyle;
289
+ /**
290
+ * Data index from which the line stroke becomes dashed (inclusive).
291
+ * Useful for projecting incomplete periods, e.g. dashed from yesterday through today.
292
+ */
293
+ dashFromIndex?: number;
294
+ /** Dash pattern for the tail segment when `dashFromIndex` is set. Default: "6,4" */
295
+ dashArray?: string;
296
+ /** Pulse stroke color while chart is loading. Default: var(--foreground) */
297
+ loadingStroke?: string;
298
+ /** Pulse stroke opacity while chart is loading. Default: 0.5 */
299
+ loadingStrokeOpacity?: number;
300
+ /**
301
+ * Show the loading pulse overlay. Default: follows chart loading phase.
302
+ * Set `false` to disable even during loading.
303
+ */
304
+ loading?: boolean;
305
+ /** Override pulse animation mode (loop / exit / enter). */
306
+ loadingPulseMode?: LineLoadingPulseMode;
307
+ /**
308
+ * Loading animation while the chart is in loading status: the default
309
+ * traveling `"pulse"`, or a diagonal `"sweep"` shimmer across the skeleton
310
+ * area. Default: `"pulse"`.
311
+ */
312
+ loadingStyle?: LoadingStyle;
313
+ }
314
+ declare function Area({ dataKey, yAxisId, fill, fillOpacity, stroke, strokeWidth, curve, animate, showLine, showHighlight, gradientToOpacity, gradientSpan, fadeEdges, showMarkers, markers, dashFromIndex, dashArray, loading, loadingStroke, loadingStrokeOpacity, loadingPulseMode, loadingStyle, }: AreaProps): React$1.JSX.Element;
315
+ declare namespace Area {
316
+ var displayName: string;
317
+ }
318
+
319
+ interface AreaChartProps {
320
+ /** Data array - each item should have a date field and numeric values */
321
+ data: Record<string, unknown>[];
322
+ /** Key in data for the x-axis (date). Default: "date" */
323
+ xDataKey?: string;
324
+ /** Chart margins */
325
+ margin?: Partial<Margin>;
326
+ /** Animation duration in milliseconds. Default: 1100 */
327
+ animationDuration?: number;
328
+ /** CSS easing for clip-reveal. Default: cubic-bezier(0.85, 0, 0.15, 1) */
329
+ animationEasing?: string;
330
+ /** Motion enter transition (spring or cubic-bezier tween). */
331
+ enterTransition?: Transition;
332
+ /** Signature of motion URL state — triggers reveal replay when it changes. */
333
+ revealSignature?: string;
334
+ /** Aspect ratio as "width / height". Default: "2 / 1" */
335
+ aspectRatio?: string;
336
+ /** Additional class name for the container */
337
+ className?: string;
338
+ /** Loading vs ready — drives chart phase and loading chrome. Default: `"ready"`. */
339
+ status?: ChartStatus;
340
+ /** Centered shimmer label while loading. */
341
+ loadingLabel?: string;
342
+ /** Animate y-domain over this duration (ms) on status transitions. Default: 500. */
343
+ yDomainTweenDuration?: number;
344
+ /** Animate y-domain when status or target domain changes. Default: true */
345
+ yDomainTween?: boolean;
346
+ /** Visible x-domain for brush zoom. */
347
+ xDomain?: [Date, Date];
348
+ /** Full dataset length for x-scale padding when `xDomain` is set. */
349
+ xDomainSlotCount?: number;
350
+ /** Tween y-domain when brush changes the visible x-range. Default: false */
351
+ tweenYDomainOnXDomainChange?: boolean;
352
+ /** Inline container styles (e.g. fixed height for brush strip). */
353
+ style?: CSSProperties;
354
+ /** Fires when the internal chart phase changes (e.g. OG capture readiness). */
355
+ onPhaseChange?: (phase: ChartPhase) => void;
356
+ /** Child components (Area, Grid, ChartTooltip, etc.) */
357
+ children: ReactNode;
358
+ }
359
+ declare function AreaChart({ data, xDataKey, margin: marginProp, animationDuration, animationEasing, enterTransition, revealSignature, aspectRatio, className, status, loadingLabel, yDomainTweenDuration, yDomainTween, xDomain, xDomainSlotCount, tweenYDomainOnXDomainChange, style, onPhaseChange, children, }: AreaChartProps): React$1.JSX.Element;
360
+
361
+ interface LineProps {
362
+ /** Key in data to use for y values */
363
+ dataKey: string;
364
+ /** Y-scale group id (Recharts `yAxisId`). Default: `"left"`. */
365
+ yAxisId?: string | number;
366
+ /** Stroke color. Default: var(--chart-line-primary) */
367
+ stroke?: string;
368
+ /** Stroke width. Default: 2.5 */
369
+ strokeWidth?: number;
370
+ /** Curve function. Default: curveNatural */
371
+ curve?: CurveFactory;
372
+ /** Whether to animate the line. Default: true */
373
+ animate?: boolean;
374
+ /**
375
+ * Fade the line stroke toward transparent at the chart edges.
376
+ * - `true` fades both edges, `false` disables the fade entirely.
377
+ * - `"left"` / `"right"` fades only that side.
378
+ * Default: true
379
+ */
380
+ fadeEdges?: FadeEdges;
381
+ /** Whether to show highlight segment on hover. Default: true */
382
+ showHighlight?: boolean;
383
+ /** Render scatter-style circle markers at each data point. Default: false */
384
+ showMarkers?: boolean;
385
+ /** Marker styling (same options as Scatter). */
386
+ markers?: SeriesPointMarkerStyle;
387
+ /**
388
+ * Data index from which the line stroke becomes dashed (inclusive).
389
+ * Useful for projecting incomplete periods, e.g. dashed from yesterday through today.
390
+ */
391
+ dashFromIndex?: number;
392
+ /** Dash pattern for the tail segment when `dashFromIndex` is set. Default: "6,4" */
393
+ dashArray?: string;
394
+ /**
395
+ * Show the loading pulse overlay. Default: follows chart loading phase.
396
+ * Set `false` to disable even during loading.
397
+ */
398
+ loading?: boolean;
399
+ /** Stroke color for the loading pulse overlay. Default: var(--foreground) */
400
+ loadingStroke?: string;
401
+ /** Loading pulse stroke opacity. Default: 0.5 */
402
+ loadingStrokeOpacity?: number;
403
+ /** Override pulse animation mode (loop / exit / enter). */
404
+ loadingPulseMode?: LineLoadingPulseMode;
405
+ /** Called when a loop-mode pulse cycle completes. */
406
+ onLoadingPulseCycleComplete?: () => void;
407
+ /**
408
+ * Loading animation while the chart is in loading status: the default
409
+ * traveling `"pulse"`, or a diagonal `"sweep"` shimmer across the skeleton
410
+ * line. Default: `"pulse"`.
411
+ */
412
+ loadingStyle?: LoadingStyle;
413
+ }
414
+ declare function Line({ dataKey, yAxisId, stroke, strokeWidth, curve, animate, fadeEdges, showHighlight, showMarkers, markers, dashFromIndex, dashArray, loading, loadingStroke, loadingStrokeOpacity, loadingPulseMode, onLoadingPulseCycleComplete, loadingStyle, }: LineProps): React$1.JSX.Element;
415
+ declare namespace Line {
416
+ var displayName: string;
417
+ }
418
+
419
+ interface LineChartProps {
420
+ /** Data array - each item should have a date field and numeric values */
421
+ data: Record<string, unknown>[];
422
+ /** Key in data for the x-axis (date). Default: "date" */
423
+ xDataKey?: string;
424
+ /** Chart margins */
425
+ margin?: Partial<Margin>;
426
+ /** Animation duration in milliseconds. Default: 1100 */
427
+ animationDuration?: number;
428
+ /** CSS easing for clip-reveal. Default: cubic-bezier(0.85, 0, 0.15, 1) */
429
+ animationEasing?: string;
430
+ enterTransition?: Transition;
431
+ revealSignature?: string;
432
+ /** Aspect ratio as "width / height". Default: "2 / 1". Omit to fill a sized parent. */
433
+ aspectRatio?: string;
434
+ /** Additional class name for the container */
435
+ className?: string;
436
+ /** Loading vs ready — drives chart phase and loading chrome. Default: `"ready"`. */
437
+ status?: ChartStatus;
438
+ /** Centered shimmer label while loading. */
439
+ loadingLabel?: string;
440
+ /** Animate y-domain over this duration (ms) on status transitions. Default: 500. */
441
+ yDomainTweenDuration?: number;
442
+ /** Animate y-domain when status or target domain changes. Default: true */
443
+ yDomainTween?: boolean;
444
+ /** Visible x-domain for brush zoom. */
445
+ xDomain?: [Date, Date];
446
+ /** Full dataset length for x-scale padding when `xDomain` is set. */
447
+ xDomainSlotCount?: number;
448
+ /** Tween y-domain when brush changes the visible x-range. Default: false */
449
+ tweenYDomainOnXDomainChange?: boolean;
450
+ /** Inline container styles (e.g. fixed height for brush strip). */
451
+ style?: CSSProperties;
452
+ /** Fires when the internal chart phase changes (e.g. OG capture readiness). */
453
+ onPhaseChange?: (phase: ChartPhase) => void;
454
+ /** Child components (Line, Grid, ChartTooltip, etc.) */
455
+ children: ReactNode;
456
+ }
457
+ declare function LineChart({ data, xDataKey, margin: marginProp, animationDuration, animationEasing, enterTransition, revealSignature, aspectRatio, className, status, loadingLabel, yDomainTweenDuration, yDomainTween, xDomain, xDomainSlotCount, tweenYDomainOnXDomainChange, style, onPhaseChange, children, }: LineChartProps): React$1.JSX.Element;
458
+
459
+ type BarOrientation = "vertical" | "horizontal";
460
+ interface BarChartProps {
461
+ /** Data array - each item should have an x-axis key and numeric values */
462
+ data: Record<string, unknown>[];
463
+ /** Key in data for the categorical axis. Default: "name" */
464
+ xDataKey?: string;
465
+ /** Chart margins */
466
+ margin?: Partial<Margin>;
467
+ /** Animation duration in milliseconds. Default: 1100 */
468
+ animationDuration?: number;
469
+ /** CSS easing for bar grow transitions. */
470
+ animationEasing?: string;
471
+ /** Motion enter transition (spring or cubic-bezier tween). */
472
+ enterTransition?: Transition;
473
+ /** Signature of motion URL state — triggers enter replay when it changes. */
474
+ revealSignature?: string;
475
+ /** Aspect ratio as "width / height". Default: "2 / 1" */
476
+ aspectRatio?: string;
477
+ /** Additional class name for the container */
478
+ className?: string;
479
+ /** Gap between bar groups as a fraction of band width (0-1). Default: 0.2 */
480
+ barGap?: number;
481
+ /** Fixed bar width in pixels. If not set, bars auto-size to fill the band. */
482
+ barWidth?: number;
483
+ /** Bar chart orientation. Default: "vertical" */
484
+ orientation?: BarOrientation;
485
+ /** Whether to stack bars instead of grouping them. Default: false */
486
+ stacked?: boolean;
487
+ /** Gap between stacked bar segments in pixels. Default: 0 */
488
+ stackGap?: number;
489
+ /** When set, tooltip Y positions snap to the top square center (shape variant). */
490
+ squareSnap?: {
491
+ squareGap: number;
492
+ groupGap?: number;
493
+ fit?: boolean;
494
+ };
495
+ /** Child components (Bar, Grid, ChartTooltip, etc.). Optional — omit for a
496
+ * pure `status="loading"` skeleton. */
497
+ children?: ReactNode;
498
+ /** Reports reveal lifecycle for OG screenshots and loading orchestration. */
499
+ onPhaseChange?: (phase: ChartPhase) => void;
500
+ /** Fetch / display status. When `"loading"`, a shimmer skeleton replaces the
501
+ * bars (no chart data required). Default: `"ready"`. */
502
+ status?: ChartStatus;
503
+ }
504
+ declare function BarChart({ data, xDataKey, margin: marginProp, animationDuration, animationEasing, enterTransition, revealSignature, aspectRatio, className, barGap, barWidth, orientation, stacked, stackGap, squareSnap, children, onPhaseChange, status, }: BarChartProps): React$1.JSX.Element;
505
+ declare namespace BarChart {
506
+ var displayName: string;
507
+ }
508
+
509
+ type BarLineCap = "round" | "butt" | number;
510
+ type BarAnimationType = "grow" | "fade";
511
+ interface BarProps {
512
+ /** Key in data to use for y values */
513
+ dataKey: string;
514
+ /** Y-scale group id for vertical bars (Recharts `yAxisId`). Default: `"left"`. */
515
+ yAxisId?: string | number;
516
+ /** Fill color for the bar. Can be a color, gradient url, or pattern url. Default: var(--chart-line-primary) */
517
+ fill?: string;
518
+ /** Color for tooltip dot. Use when fill is a gradient/pattern. Default: uses fill value */
519
+ stroke?: string;
520
+ /** Line cap style for bar ends: "round", "butt", or a number for custom radius. Default: "round" */
521
+ lineCap?: BarLineCap;
522
+ /** Whether to animate the bars. Default: true */
523
+ animate?: boolean;
524
+ /** Animation type: "grow" (height) or "fade" (opacity + blur). Default: "grow" */
525
+ animationType?: BarAnimationType;
526
+ /** Opacity when not hovered (when another bar is hovered). Default: 0.3 */
527
+ fadedOpacity?: number;
528
+ /** Stagger delay between bars in seconds. Auto-calculated if not provided. */
529
+ staggerDelay?: number;
530
+ /** Gap between stacked bars in pixels. Default: 0 */
531
+ stackGap?: number;
532
+ /** Gap between grouped bars in pixels. Default: 4 */
533
+ groupGap?: number;
534
+ /** Shrink each positive bar's top by its perspective rise so the front face
535
+ * lines up with `<BarDepthBack>`'s lid (instead of the lid sitting above the
536
+ * front face). Pass `true` whenever the chart also renders the bar-depth 3D
537
+ * surfaces. Default: false */
538
+ perspective?: boolean;
539
+ /** Minimum rendered bar height in px (non-stacked, vertical). Floors short or
540
+ * zero-value bars so they stay visible. Pair with the same value on
541
+ * `<BarDepthProvider minBarHeight>` when using the 3D surfaces. Default: 0 */
542
+ minBarHeight?: number;
543
+ }
544
+ declare function Bar(props: BarProps): React$1.JSX.Element | null;
545
+ declare namespace Bar {
546
+ var displayName: string;
547
+ }
548
+
549
+ interface ComposedChartProps {
550
+ /** Data array — each row typically has a date and multiple numeric series */
551
+ data: Record<string, unknown>[];
552
+ /** Key for the x-axis (time). Default: "date" */
553
+ xDataKey?: string;
554
+ margin?: Partial<Margin>;
555
+ animationDuration?: number;
556
+ animationEasing?: string;
557
+ enterTransition?: Transition;
558
+ /** Signature of motion URL state — triggers reveal replay when it changes. */
559
+ revealSignature?: string;
560
+ aspectRatio?: string;
561
+ className?: string;
562
+ children: ReactNode;
563
+ /** Target bar width in px (Recharts-style `barSize`). */
564
+ barSize?: number;
565
+ /** Maximum bar width in px (`maxBarSize`). */
566
+ maxBarSize?: number;
567
+ /** Gap between grouped `SeriesBar` series in px. Default: 4 */
568
+ barGap?: number;
569
+ /** Stack `SeriesBar` segments in child order at each x (line/area are not stacked). */
570
+ stacked?: boolean;
571
+ /** Gap in px between stacked segments. Default: 0 */
572
+ stackGap?: number;
573
+ onPhaseChange?: (phase: ChartPhase) => void;
574
+ }
575
+ declare function ComposedChart({ data, xDataKey, margin: marginProp, animationDuration, animationEasing, enterTransition, revealSignature, aspectRatio, className, children, barSize, maxBarSize, barGap, stacked, stackGap, onPhaseChange, }: ComposedChartProps): React$1.JSX.Element;
576
+ declare namespace ComposedChart {
577
+ var displayName: string;
578
+ }
579
+
580
+ interface LiveLinePoint {
581
+ time: number;
582
+ value: number;
583
+ }
584
+ interface LiveLineChartProps {
585
+ /** Streaming data — array of { time: unixSeconds, value } */
586
+ data: LiveLinePoint[];
587
+ /** Latest value (smoothly interpolated to) */
588
+ value: number;
589
+ /** Key used for the value field in context data. Default: "value" */
590
+ dataKey?: string;
591
+ /** Visible time window in seconds. Default: 30 */
592
+ window?: number;
593
+ /** Number of X-axis ticks (used to compute leading offset). Default: 5 */
594
+ numXTicks?: number;
595
+ /** Leading offset in X-tick units (0 = now at right edge). Default: 0 */
596
+ nowOffsetUnits?: number;
597
+ /** Tight Y-axis. Default: false */
598
+ exaggerate?: boolean;
599
+ /** Interpolation speed (0–1). Default: 0.08 */
600
+ lerpSpeed?: number;
601
+ /** Chart margins */
602
+ margin?: Partial<Margin>;
603
+ /** Freeze chart scrolling. Default: false */
604
+ paused?: boolean;
605
+ /** Child components (LiveLine, Grid, ChartTooltip, LiveXAxis, LiveYAxis, etc.) */
606
+ children: ReactNode;
607
+ className?: string;
608
+ style?: React.CSSProperties;
609
+ }
610
+ declare function LiveLineChart({ data, value, dataKey, window: windowSecs, numXTicks, nowOffsetUnits, exaggerate, lerpSpeed, margin: marginProp, paused, children, className, style, }: LiveLineChartProps): React$1.JSX.Element;
611
+
612
+ interface MomentumColors {
613
+ up: string;
614
+ down: string;
615
+ flat: string;
616
+ }
617
+ interface LiveLineProps {
618
+ /** Key in data to use for y values */
619
+ dataKey: string;
620
+ /** Stroke color. Default: var(--chart-line-primary) */
621
+ stroke?: string;
622
+ /** Stroke width. Default: 2 */
623
+ strokeWidth?: number;
624
+ /** Curve function. Default: curveMonotoneX */
625
+ curve?: CurveFactory;
626
+ /** Show gradient fill under the curve. Default: true */
627
+ fill?: boolean;
628
+ /** Show pulsing live dot at the right edge. Default: true */
629
+ pulse?: boolean;
630
+ /** Radius of the live dot. Default: 4 */
631
+ dotSize?: number;
632
+ /** Show value badge pill at the live tip. Default: true */
633
+ badge?: boolean;
634
+ /** Value label formatter for the badge */
635
+ formatValue?: (v: number) => string;
636
+ /**
637
+ * When set, the line/fill color changes based on momentum direction.
638
+ * Overrides `stroke` for the line and fill (dot always uses momentum colors).
639
+ */
640
+ momentumColors?: MomentumColors;
641
+ }
642
+ declare function LiveLine({ dataKey, stroke, strokeWidth, curve, fill, pulse, dotSize, badge, formatValue, momentumColors, }: LiveLineProps): React$1.JSX.Element;
643
+ declare namespace LiveLine {
644
+ var displayName: string;
645
+ }
646
+
647
+ interface FunnelGradientStop {
648
+ offset: string | number;
649
+ color: string;
650
+ }
651
+ interface FunnelStage {
652
+ label: string;
653
+ value: number;
654
+ displayValue?: string;
655
+ /** Override the chart-level color for this segment */
656
+ color?: string;
657
+ /**
658
+ * Apply a linear gradient to this segment.
659
+ * Provide an array of color stops, e.g. `[{ offset: "0%", color: "#8B5CF6" }, { offset: "100%", color: "#3B82F6" }]`.
660
+ * When set, this takes priority over the segment and chart-level `color` for the innermost ring.
661
+ * Outer halo rings use the first stop color as their solid color.
662
+ */
663
+ gradient?: FunnelGradientStop[];
664
+ }
665
+ interface FunnelChartProps {
666
+ data: FunnelStage[];
667
+ orientation?: "horizontal" | "vertical";
668
+ color?: string;
669
+ layers?: number;
670
+ className?: string;
671
+ style?: CSSProperties;
672
+ showPercentage?: boolean;
673
+ showValues?: boolean;
674
+ showLabels?: boolean;
675
+ /** Controlled hover state — index of the hovered segment */
676
+ hoveredIndex?: number | null;
677
+ /** Callback when hover state changes */
678
+ onHoverChange?: (index: number | null) => void;
679
+ formatPercentage?: (pct: number) => string;
680
+ formatValue?: (value: number) => string;
681
+ /** Stagger delay between segments in seconds. Default 0.12 */
682
+ staggerDelay?: number;
683
+ /** Framer Motion transition for segment enter animation */
684
+ enterTransition?: Transition;
685
+ /** Gap between segments in pixels. Default 4 */
686
+ gap?: number;
687
+ /**
688
+ * Render a visx pattern definition. Receives a unique `id` string per segment
689
+ * and the resolved `color`. Return a `<PatternLines>` (or any visx pattern)
690
+ * inside an SVG `<defs>`. The component will use `fill="url(#id)"` on the
691
+ * innermost ring while keeping outer halo rings as solid color.
692
+ */
693
+ renderPattern?: (id: string, color: string) => ReactNode;
694
+ /** Edge style for the funnel segments. Default "curved" */
695
+ edges?: "curved" | "straight";
696
+ /**
697
+ * Controls how segment labels (value, percentage, stage name) are arranged.
698
+ * - "spread": Value/percentage/label are spread apart (top/center/bottom for horizontal,
699
+ * left/center/right for vertical). This is the default.
700
+ * - "grouped": All label items stack together in a tight group.
701
+ *
702
+ * When "grouped", use `labelOrientation` and `labelAlign` for full control.
703
+ */
704
+ labelLayout?: "spread" | "grouped";
705
+ /**
706
+ * Stack direction of the label group. Only applies when `labelLayout="grouped"`.
707
+ * - "vertical": Items stack top-to-bottom. Default for horizontal funnels.
708
+ * - "horizontal": Items stack left-to-right. Default for vertical funnels.
709
+ */
710
+ labelOrientation?: "vertical" | "horizontal";
711
+ /**
712
+ * Where the label group sits within the segment cell.
713
+ * - "center" (default), "start", "end"
714
+ * For horizontal funnel: start=top, end=bottom.
715
+ * For vertical funnel: start=left, end=right.
716
+ */
717
+ labelAlign?: "center" | "start" | "end";
718
+ /** Grid configuration. Pass `true` for default bands + lines, or an object for fine control. */
719
+ grid?: boolean | {
720
+ /** Show alternating background bands behind each segment. Default true */
721
+ bands?: boolean;
722
+ /** Color of the background bands. Default "var(--color-muted)" */
723
+ bandColor?: string;
724
+ /** Show grid lines at each gap between segments. Default true */
725
+ lines?: boolean;
726
+ /** Color of the grid lines. Default "var(--chart-grid)" */
727
+ lineColor?: string;
728
+ /** Opacity of the grid lines. Default 1 */
729
+ lineOpacity?: number;
730
+ /** Width of the grid lines in pixels. Default 1 */
731
+ lineWidth?: number;
732
+ };
733
+ }
734
+ declare function FunnelChart({ data, orientation, color, layers, className, style, showPercentage, showValues, showLabels, hoveredIndex: hoveredIndexProp, onHoverChange, formatPercentage, formatValue, staggerDelay, enterTransition, gap, renderPattern, edges, labelLayout, labelOrientation, labelAlign, grid: gridProp, }: FunnelChartProps): React$1.JSX.Element | null;
735
+
736
+ declare const PATTERN_PRESET_IDS: readonly ["none", "diagonal", "horizontal", "vertical", "cross", "dots", "circles", "accent"];
737
+ type PatternPresetId = (typeof PATTERN_PRESET_IDS)[number];
738
+
739
+ type HeatmapLevelColors = readonly [
740
+ string,
741
+ string,
742
+ string,
743
+ string,
744
+ string
745
+ ];
746
+ type HeatmapLevelFillMode = "solid" | "pattern";
747
+ interface HeatmapLevelStyle {
748
+ color: string;
749
+ fillMode?: HeatmapLevelFillMode;
750
+ pattern?: PatternPresetId;
751
+ patternColor?: string;
752
+ patternScale?: number;
753
+ patternStrokeWidth?: number;
754
+ patternRadius?: number;
755
+ patternComplement?: boolean;
756
+ patternFill?: string;
757
+ patternTileBackground?: string;
758
+ patternOpacity?: number;
759
+ patternDotsFill?: boolean;
760
+ }
761
+ type HeatmapLevelStyles = readonly [
762
+ HeatmapLevelStyle,
763
+ HeatmapLevelStyle,
764
+ HeatmapLevelStyle,
765
+ HeatmapLevelStyle,
766
+ HeatmapLevelStyle
767
+ ];
768
+
769
+ /** First row of the grid — `0` = Sunday (GitHub default). */
770
+ type HeatmapWeekStartDay = 0 | 1 | 2 | 3 | 4 | 5 | 6;
771
+ /** Which Y-axis row ticks to display. */
772
+ type HeatmapYAxisTickFilter = "all" | "odd" | "even";
773
+ /** Y-axis label display — `initial` shows the first letter only (Mon → M). */
774
+ type HeatmapYAxisLabelFormat = "full" | "initial";
775
+ /** Layout spacing parsed from {@link HeatmapSeparator}. */
776
+ type HeatmapSeparatorGroupBy = "every" | "quarter";
777
+ /** Separator config from props — resolved to column indices once data is known. */
778
+ interface HeatmapSeparatorParsedConfig {
779
+ groupBy: HeatmapSeparatorGroupBy;
780
+ every?: number;
781
+ spacing: number;
782
+ }
783
+
784
+ interface HeatmapBin {
785
+ count: number;
786
+ bin: number;
787
+ date: Date;
788
+ }
789
+ interface HeatmapColumn {
790
+ bin: number;
791
+ bins: HeatmapBin[];
792
+ }
793
+
794
+ interface HeatmapCellsProps {
795
+ /** Corner radius for each cell. Default: 2 */
796
+ cornerRadius?: number;
797
+ /** Override the default GitHub-style green color scale. */
798
+ colorScale?: (count: number | null | undefined) => string;
799
+ /** Opacity for inactive cells while hovering. Default: 0.3 */
800
+ inactiveOpacity?: number;
801
+ /** Scale for inactive cells while hovering. Default: 1 */
802
+ inactiveScale?: number;
803
+ /** Scale for the highlighted cell while hovering. Default: 1 */
804
+ activeScale?: number;
805
+ /** Per-row opacity multiplier (display row index). Default: 1 */
806
+ rowOpacity?: number | readonly number[];
807
+ /** Pointer hover + dimming. Default: true */
808
+ interactive?: boolean;
809
+ /** Hide out-of-range bins (GitHub-style ghost cells). Default: true */
810
+ hideGhostCells?: boolean;
811
+ }
812
+ declare const HeatmapCells: React$1.NamedExoticComponent<HeatmapCellsProps>;
813
+
814
+ type HeatmapLayout = "fluid" | "fill";
815
+ interface HeatmapChartProps {
816
+ /** Column data — one entry per week (or category) with row bins inside. */
817
+ data: HeatmapColumn[];
818
+ /** Visible time range — filters week columns that overlap the domain. */
819
+ xDomain?: [Date, Date];
820
+ /**
821
+ * Week columns used for cell sizing when `xDomain` is set. Keeps bin height
822
+ * stable while scrubbing (filtered columns can vary by ±1 at boundaries).
823
+ */
824
+ sizingColumnCount?: number;
825
+ /**
826
+ * `fluid` — width drives square cells; chart height hugs the grid (GitHub-style).
827
+ * `fill` — expands cells to fill the parent.
828
+ */
829
+ layout?: HeatmapLayout;
830
+ /** Chart margins */
831
+ margin?: Partial<Margin>;
832
+ /** Fixed cell size in pixels. When 0, cells are square and sized to fit the plot. Default: 0 */
833
+ binSize?: number;
834
+ /** Gap between cells in pixels. Default: 2 */
835
+ gap?: number;
836
+ /** Override the default color scale. */
837
+ colorScale?: (count: number | null | undefined) => string;
838
+ /** Per-level colors for the Less → More scale (5 entries). */
839
+ levelColors?: HeatmapLevelColors;
840
+ /** Per-level fill styles (color and optional pattern). Takes precedence over `levelColors`. */
841
+ levelStyles?: HeatmapLevelStyles;
842
+ /** Optional outer aspect ratio (e.g. "2 / 1"). Omit to fill the parent. */
843
+ aspectRatio?: string;
844
+ /** Additional class name for the container */
845
+ className?: string;
846
+ /** Fetch / display status. Default: `"ready"`. */
847
+ status?: ChartStatus;
848
+ /** Centered label while loading. */
849
+ loadingLabel?: string;
850
+ /** Enter animation duration in milliseconds. Default: 1600 */
851
+ animationDuration?: number;
852
+ /** Motion enter transition (spring or cubic-bezier tween). */
853
+ enterTransition?: Transition;
854
+ /** Signature of motion URL state — triggers enter replay when it changes. */
855
+ revealSignature?: string;
856
+ /** Scales wave stagger delays (1 = default). */
857
+ enterStaggerScale?: number;
858
+ /** Play enter fade-in / loading shimmer animations. Default: true */
859
+ animate?: boolean;
860
+ /** Chart opacity while loading. Default: 0.5 */
861
+ loadingOpacity?: number;
862
+ /** Show loading cell shimmer while loading. Default: true */
863
+ showLoadingCells?: boolean;
864
+ /** Max opacity loading cells animate toward (0–1). Default: 0.5 */
865
+ loadingCellMaxOpacity?: number;
866
+ /** Share of cells that participate in loading shimmer (0–1). Default: 0.65 */
867
+ loadingCellRandomness?: number;
868
+ /**
869
+ * Inserts horizontal gaps between column groups. Overridden when a
870
+ * {@link HeatmapSeparator} child sets `every` / `spacing`.
871
+ */
872
+ columnSeparators?: HeatmapSeparatorParsedConfig;
873
+ /**
874
+ * First row of the grid — `0` = Sunday (GitHub default), `1` = Monday, etc.
875
+ * Rotates column bins for display without reshaping source data.
876
+ */
877
+ weekStartDay?: HeatmapWeekStartDay;
878
+ /** Child components (HeatmapCells, HeatmapXAxis, HeatmapYAxis) */
879
+ children: ReactNode;
880
+ }
881
+ declare function HeatmapChart({ data, xDomain, sizingColumnCount, layout, margin: marginProp, binSize, gap, colorScale: colorScaleProp, levelColors, levelStyles: levelStylesProp, aspectRatio, className, status, loadingLabel, animationDuration, enterTransition, revealSignature, enterStaggerScale, animate, loadingOpacity, showLoadingCells, loadingCellMaxOpacity, loadingCellRandomness, columnSeparators, weekStartDay, children, }: HeatmapChartProps): React$1.JSX.Element;
882
+ declare namespace HeatmapChart {
883
+ var displayName: string;
884
+ }
885
+
886
+ type HeatmapLegendVariant = "swatches" | "gradient";
887
+ interface HeatmapLegendProps {
888
+ /** Side label before the swatches. Default: "Less" */
889
+ lessLabel?: string;
890
+ /** Side label after the swatches. Default: "More" */
891
+ moreLabel?: string;
892
+ /** Swatch size in pixels. Default: 11 */
893
+ cellSize?: number;
894
+ /** Gap between swatches. Default: 2 */
895
+ gap?: number;
896
+ /** Corner radius for swatches. Default: 2 */
897
+ cornerRadius?: number;
898
+ /** Horizontal alignment within the legend cell. Default: "end" */
899
+ align?: "start" | "center" | "end";
900
+ /** Legend layout — discrete swatches or a continuous gradient bar. Default: `"swatches"` */
901
+ variant?: HeatmapLegendVariant;
902
+ /** Gradient bar width in swatch units when `variant="gradient"`. Default: 5 */
903
+ gradientSpan?: number;
904
+ /** Font size in pixels for side labels. */
905
+ fontSize?: number;
906
+ /** Additional class name for less/more labels. */
907
+ labelClassName?: string;
908
+ /** Shared level styles for cells and legend swatches. */
909
+ levelStyles?: HeatmapLevelStyles;
910
+ /** Override the default color scale (used when `levelStyles` is omitted). */
911
+ colorScale?: (count: number | null | undefined) => string;
912
+ /** Opacity for inactive swatches while interacting. Default: 0.3 */
913
+ inactiveOpacity?: number;
914
+ /** Scale for inactive swatches while interacting. Default: 1 */
915
+ inactiveScale?: number;
916
+ /** Scale for the highlighted swatch while interacting. Default: 1 */
917
+ activeScale?: number;
918
+ /** Sync dimming with chart hover. Default: true when inside HeatmapInteractionProvider */
919
+ interactive?: boolean;
920
+ className?: string;
921
+ }
922
+ declare const HeatmapLegend: React$1.NamedExoticComponent<HeatmapLegendProps>;
923
+
924
+ interface HeatmapTooltipProps {
925
+ /** Custom contribution line (bottom section). Default: `N contribution(s)`. */
926
+ formatLabel?: (count: number, date: Date) => string;
927
+ /** Custom class name */
928
+ className?: string;
929
+ /** Inline styles for the tooltip panel (background, blur, etc.). */
930
+ panelStyle?: React.CSSProperties;
931
+ /**
932
+ * Tooltip panel background color (CSS variable or color value).
933
+ * Default: `var(--chart-tooltip-background)`.
934
+ */
935
+ backgroundColor?: string;
936
+ /**
937
+ * Delay before showing the tooltip on first hover (ms).
938
+ * Moving between cells updates immediately once visible.
939
+ */
940
+ showDelay?: number;
941
+ /**
942
+ * Grace period before hiding when the pointer leaves a cell (ms).
943
+ * Helps avoid flicker when moving quickly between adjacent cells.
944
+ */
945
+ hideDelay?: number;
946
+ /**
947
+ * When true, the tooltip appears and disappears instantly with no motion.
948
+ */
949
+ instant?: boolean;
950
+ }
951
+ declare const HeatmapTooltip: React$1.NamedExoticComponent<HeatmapTooltipProps>;
952
+
953
+ interface HeatmapXAxisProps {
954
+ /** Additional class name for labels */
955
+ className?: string;
956
+ }
957
+ declare const HeatmapXAxis: React$1.NamedExoticComponent<HeatmapXAxisProps>;
958
+
959
+ interface HeatmapYAxisProps {
960
+ /** Additional class name for labels */
961
+ className?: string;
962
+ /** Which row ticks to display. Default: `"odd"` (Mon / Wed / Fri). */
963
+ tickFilter?: HeatmapYAxisTickFilter;
964
+ /** Label format — `"initial"` shows the first letter only (Mon → M). Default: `"full"`. */
965
+ labelFormat?: HeatmapYAxisLabelFormat;
966
+ /** Per-row label opacity — mirrors {@link HeatmapCells} `rowOpacity`. */
967
+ rowOpacity?: number | readonly number[];
968
+ }
969
+ declare const HeatmapYAxis: React$1.NamedExoticComponent<HeatmapYAxisProps>;
970
+
971
+ interface XAxisProps {
972
+ /** Number of ticks to show (including first and last). Default: 5. */
973
+ numTicks?: number;
974
+ /** Width of the date ticker box for fade calculation. Default: 50 */
975
+ tickerHalfWidth?: number;
976
+ /**
977
+ * `"data"` — tick labels snap to data rows so crosshair and tooltip stay aligned (default).
978
+ * `"domain"` — evenly spaced ticks across the time domain (may not align with hover).
979
+ */
980
+ tickMode?: "domain" | "data";
981
+ }
982
+ declare function XAxis(props: XAxisProps): React$1.JSX.Element | null;
983
+ declare namespace XAxis {
984
+ var displayName: string;
985
+ }
986
+
987
+ type YAxisOrientation = "left" | "right";
988
+
989
+ interface YAxisProps {
990
+ /** Scale group id (Recharts `yAxisId`). Default: `"left"`. */
991
+ yAxisId?: string | number;
992
+ /** Which side of the chart to render labels. Default: `"left"`. */
993
+ orientation?: YAxisOrientation;
994
+ /**
995
+ * Approximate tick count hint for `scale.ticks()` (d3). Actual label count may differ.
996
+ * Clamped to {@link Y_AXIS_MIN_TICK_COUNT}–{@link Y_AXIS_MAX_TICK_COUNT}. Default: 5.
997
+ */
998
+ numTicks?: number;
999
+ /** Format large numbers (e.g. 1000 as "1k"). Default: true */
1000
+ formatLargeNumbers?: boolean;
1001
+ /** Custom formatter for tick labels (e.g. USD). Overrides formatLargeNumbers when set. */
1002
+ formatValue?: (value: number) => string;
1003
+ }
1004
+ declare function YAxis(props: YAxisProps): React$1.JSX.Element | null;
1005
+ declare namespace YAxis {
1006
+ var displayName: string;
1007
+ }
1008
+
1009
+ interface GridProps {
1010
+ /** Show horizontal grid lines. Default: true */
1011
+ horizontal?: boolean;
1012
+ /** Show vertical grid lines. Default: false */
1013
+ vertical?: boolean;
1014
+ /** Number of horizontal grid lines. Default: 5 */
1015
+ numTicksRows?: number;
1016
+ /** Number of vertical grid lines. Default: 10 */
1017
+ numTicksColumns?: number;
1018
+ /** Explicit tick values for horizontal grid lines. Overrides numTicksRows. */
1019
+ rowTickValues?: number[];
1020
+ /** Grid line stroke color. Default: var(--chart-grid) */
1021
+ stroke?: string;
1022
+ /** Grid stroke while loading chrome is active. Falls back to `stroke`. */
1023
+ loadingStroke?: string;
1024
+ /** Grid line stroke opacity. Default: 1 */
1025
+ strokeOpacity?: number;
1026
+ /** Grid line stroke width. Default: 1 */
1027
+ strokeWidth?: number;
1028
+ /** Grid line dash array. Default: "4,4" for dashed lines */
1029
+ strokeDasharray?: string;
1030
+ /** Horizontal row values rendered with alternate styling (e.g. zero baseline). */
1031
+ highlightRowValues?: number[];
1032
+ /** Stroke for highlighted rows. Default: var(--chart-foreground-muted) */
1033
+ highlightRowStroke?: string;
1034
+ /** Stroke opacity for highlighted rows. Default: 1 */
1035
+ highlightRowStrokeOpacity?: number;
1036
+ /** Stroke width for highlighted rows. Default: 1 */
1037
+ highlightRowStrokeWidth?: number;
1038
+ /** Dash array for highlighted rows. Default: solid line */
1039
+ highlightRowStrokeDasharray?: string;
1040
+ /** Enable horizontal fade effect on grid rows (fades at left/right). Default: true */
1041
+ fadeHorizontal?: boolean;
1042
+ /** Enable vertical fade effect on grid columns (fades at top/bottom). Default: false */
1043
+ fadeVertical?: boolean;
1044
+ /** Omit the first and last horizontal grid lines. Default: false */
1045
+ hideHorizontalEdgeLines?: boolean;
1046
+ /** Omit the first and last vertical grid lines. Default: false */
1047
+ hideVerticalEdgeLines?: boolean;
1048
+ /** Y-scale for horizontal grid lines. Default: primary (`"left"`) axis. */
1049
+ yAxisId?: string | number;
1050
+ /** Animate a shimmer band across horizontal grid lines. Default: false */
1051
+ shimmer?: boolean;
1052
+ /** Shimmer band stroke (color and opacity via color-mix or oklch alpha). */
1053
+ shimmerStroke?: string;
1054
+ /** Shimmer band width in pixels. Default: 140 */
1055
+ shimmerLength?: number;
1056
+ /** Shimmer speed multiplier (higher = faster). Default: 1 */
1057
+ shimmerSpeed?: number;
1058
+ /** Match loop timing to the loading line pulse (cycle + inter-loop pause). */
1059
+ shimmerSync?: boolean;
1060
+ }
1061
+ declare function Grid({ horizontal, vertical, numTicksRows, numTicksColumns, rowTickValues, stroke, loadingStroke, strokeOpacity, strokeWidth, strokeDasharray, highlightRowValues, highlightRowStroke, highlightRowStrokeOpacity, highlightRowStrokeWidth, highlightRowStrokeDasharray, fadeHorizontal, fadeVertical, hideHorizontalEdgeLines, hideVerticalEdgeLines, yAxisId, shimmer, shimmerStroke, shimmerLength, shimmerSpeed, shimmerSync, }: GridProps): React$1.JSX.Element;
1062
+ declare namespace Grid {
1063
+ var displayName: string;
1064
+ }
1065
+
1066
+ interface SpringConfig {
1067
+ stiffness: number;
1068
+ damping: number;
1069
+ }
1070
+
1071
+ type IndicatorFadeEdges = "both" | "none" | "top" | "bottom";
1072
+
1073
+ interface TooltipRow {
1074
+ color: string;
1075
+ label: string;
1076
+ value: string | number;
1077
+ }
1078
+
1079
+ interface ChartTooltipProps {
1080
+ /** Whether to show the date pill at bottom. Default: true */
1081
+ showDatePill?: boolean;
1082
+ /** Whether to show the vertical crosshair line. Default: true */
1083
+ showCrosshair?: boolean;
1084
+ /** Whether to show dots on the lines. Default: true */
1085
+ showDots?: boolean;
1086
+ /** Dot style: filled circle or transparent ring. Default: "dot" */
1087
+ dotVariant?: "dot" | "ring";
1088
+ /** Dot / ring radius in pixels. Default: 5 */
1089
+ dotSize?: number;
1090
+ /** Ring corner radius as a fraction of side length (0 = square, 0.5 = circle). */
1091
+ dotRadiusFraction?: number;
1092
+ /** Multiplier applied to the computed dot / ring pixel radius. Default: 1 */
1093
+ dotScale?: number;
1094
+ /** Ring stroke width in pixels. Default: 1.5 for ring variant */
1095
+ dotStrokeWidth?: number;
1096
+ /**
1097
+ * Color for the crosshair/indicator line. When a function, receives the hovered point
1098
+ * (e.g. for candlestick: match candle color from close vs open). Default: --chart-crosshair.
1099
+ */
1100
+ indicatorColor?: string | ((point: Record<string, unknown>) => string);
1101
+ /** Custom content renderer for the tooltip box */
1102
+ content?: (props: {
1103
+ point: Record<string, unknown>;
1104
+ index: number;
1105
+ }) => React.ReactNode;
1106
+ /** Custom row renderer - return array of TooltipRow */
1107
+ rows?: (point: Record<string, unknown>) => TooltipRow[];
1108
+ /**
1109
+ * Override tooltip dot fill. When omitted and `rows` is set, dot colors match row colors.
1110
+ * When a function, receives the hovered point and line config.
1111
+ */
1112
+ dotColor?: string | ((point: Record<string, unknown>, line: LineConfig) => string);
1113
+ /** Additional content to show below rows (e.g., markers) */
1114
+ children?: React.ReactNode;
1115
+ /** Custom class name */
1116
+ className?: string;
1117
+ /** Per-chart override for the crosshair / dot / date-pill spring. */
1118
+ springConfig?: SpringConfig;
1119
+ /**
1120
+ * When `true`, the floating panel uses the crosshair spring and stays in sync.
1121
+ * Default `false` — panel follow uses `damping` (`20`).
1122
+ */
1123
+ matchCrosshair?: boolean;
1124
+ /**
1125
+ * Spring damping for the floating tooltip panel when `matchCrosshair` is `false`.
1126
+ * `0` disables spring motion (instant). Default: `20`.
1127
+ */
1128
+ damping?: number;
1129
+ /** SVG stroke dash pattern for the crosshair. Omit for solid. */
1130
+ indicatorDasharray?: string;
1131
+ /** Vertical crosshair fade: `both`, `top`, `bottom`, or `none` (solid). Default: `both`. */
1132
+ indicatorFadeEdges?: IndicatorFadeEdges;
1133
+ /** Crosshair fade zone size (% of height). Default: `10`. */
1134
+ indicatorFadeLength?: number;
1135
+ /** Per-chart override for the floating-panel spring. */
1136
+ boxSpringConfig?: SpringConfig;
1137
+ /** Inline styles for the tooltip panel (background, blur, etc.). */
1138
+ panelStyle?: React.CSSProperties;
1139
+ /**
1140
+ * Tooltip panel background color (CSS variable or color value).
1141
+ * Default: `var(--chart-tooltip-background)`.
1142
+ */
1143
+ backgroundColor?: string;
1144
+ }
1145
+ declare function ChartTooltip(props: ChartTooltipProps): React$1.JSX.Element | null;
1146
+ declare namespace ChartTooltip {
1147
+ var displayName: string;
1148
+ }
1149
+
1150
+ /** Subset of `Intl.NumberFormatOptions` supported by NumberFlow */
1151
+ interface ChartStatFlowFormat {
1152
+ notation?: "standard" | "compact";
1153
+ compactDisplay?: "short" | "long";
1154
+ minimumFractionDigits?: number;
1155
+ maximumFractionDigits?: number;
1156
+ minimumIntegerDigits?: number;
1157
+ minimumSignificantDigits?: number;
1158
+ maximumSignificantDigits?: number;
1159
+ style?: "decimal" | "percent" | "currency";
1160
+ currency?: string;
1161
+ currencyDisplay?: "symbol" | "narrowSymbol" | "code" | "name";
1162
+ unit?: string;
1163
+ unitDisplay?: "short" | "long" | "narrow";
1164
+ }
1165
+ declare const defaultChartStatFlowFormat: ChartStatFlowFormat;
1166
+ interface ChartStatFlowProps {
1167
+ value: number;
1168
+ label: string;
1169
+ formatOptions?: ChartStatFlowFormat;
1170
+ prefix?: string;
1171
+ suffix?: string;
1172
+ valueClassName?: string;
1173
+ labelClassName?: string;
1174
+ icon?: ReactNode;
1175
+ }
1176
+ /**
1177
+ * Shared value + label stack using NumberFlow (same layout as pie / ring centers).
1178
+ * Parent should provide flex alignment and sizing when needed.
1179
+ */
1180
+ declare function ChartStatFlow({ value, label, formatOptions, prefix, suffix, valueClassName, labelClassName, icon, }: ChartStatFlowProps): React$1.JSX.Element;
1181
+ declare namespace ChartStatFlow {
1182
+ var displayName: string;
1183
+ }
1184
+
1185
+ type GaugeLabelPlacement = "top" | "bottom" | "left" | "right";
1186
+ type GaugeLabelAlign = "start" | "center" | "end";
1187
+
1188
+ type GaugeOrientation = "arc" | "linear";
1189
+ interface GaugeProps {
1190
+ /** Arc (default) or horizontal linear notch track */
1191
+ orientation?: GaugeOrientation;
1192
+ /** Fill level 0–100 */
1193
+ value: number;
1194
+ /** Number of notches */
1195
+ totalNotches?: number;
1196
+ /** Percentage of the track reserved for gaps between notches */
1197
+ spacing?: number;
1198
+ notchCornerRadius?: number;
1199
+ /** `true` = rectangular notches; `false` = tapered toward center / midline */
1200
+ uniformWidth?: boolean;
1201
+ startAngle?: number;
1202
+ endAngle?: number;
1203
+ useGradient?: boolean;
1204
+ activeGradient?: readonly [string, string];
1205
+ inactiveGradient?: readonly [string, string];
1206
+ /** Center statistic — omit to hide the label block */
1207
+ centerValue?: number;
1208
+ defaultLabel?: string;
1209
+ prefix?: string;
1210
+ suffix?: string;
1211
+ formatOptions?: ChartStatFlowFormat;
1212
+ /** Label position for `orientation="linear"`. Arc gauges always overlay center. */
1213
+ labelPlacement?: GaugeLabelPlacement;
1214
+ /** Cross-axis alignment (start / center / end), same model as chart legend */
1215
+ labelAlign?: GaugeLabelAlign;
1216
+ inactiveFill?: string;
1217
+ activeFill?: string;
1218
+ inactiveFillOpacity?: number;
1219
+ activeFillOpacity?: number;
1220
+ children?: ReactNode;
1221
+ className?: string;
1222
+ width?: number;
1223
+ height?: number;
1224
+ minWidth?: number;
1225
+ notchLengthPercent?: number;
1226
+ /** Linear only — notch width as % of each slot (default 80) */
1227
+ notchWidthPercent?: number;
1228
+ /** Linear only — bar thickness in px when responsive (default 24) */
1229
+ linearHeight?: number;
1230
+ enterTransition?: Transition;
1231
+ enterStaggerScale?: number;
1232
+ /** Studio-only: static paths while scrubbing geometry controls */
1233
+ geometryScrubbing?: boolean;
1234
+ }
1235
+ declare function Gauge({ width: widthProp, height: heightProp, className, minWidth, orientation, linearHeight, ...props }: GaugeProps): React$1.JSX.Element;
1236
+ declare namespace Gauge {
1237
+ var displayName: string;
1238
+ }
1239
+
1240
+ declare const ringCssVars: {
1241
+ background: string;
1242
+ foreground: string;
1243
+ foregroundMuted: string;
1244
+ label: string;
1245
+ ringBackground: string;
1246
+ ring1: string;
1247
+ ring2: string;
1248
+ ring3: string;
1249
+ ring4: string;
1250
+ ring5: string;
1251
+ };
1252
+ declare const defaultRingColors: string[];
1253
+ interface RingData {
1254
+ /** Display label for the ring */
1255
+ label: string;
1256
+ /** Current value */
1257
+ value: number;
1258
+ /** Maximum value (determines progress percentage) */
1259
+ maxValue: number;
1260
+ /** Optional color override - falls back to palette */
1261
+ color?: string;
1262
+ }
1263
+ interface RingHoverContextValue {
1264
+ hoveredIndex: number | null;
1265
+ setHoveredIndex: (index: number | null) => void;
1266
+ }
1267
+ interface RingStableContextValue {
1268
+ data: RingData[];
1269
+ size: number;
1270
+ center: number;
1271
+ strokeWidth: number;
1272
+ ringGap: number;
1273
+ baseInnerRadius: number;
1274
+ animationKey: number;
1275
+ isLoaded: boolean;
1276
+ enterTransition?: Transition;
1277
+ enterStaggerScale: number;
1278
+ containerRef: RefObject<HTMLDivElement | null>;
1279
+ totalValue: number;
1280
+ getColor: (index: number) => string;
1281
+ getRingRadii: (index: number) => {
1282
+ innerRadius: number;
1283
+ outerRadius: number;
1284
+ };
1285
+ startAngle: number;
1286
+ endAngle: number;
1287
+ /**
1288
+ * Studio geometry scrub — skip Motion path morphing and use plain SVG paths.
1289
+ * @default false
1290
+ */
1291
+ geometryScrubbing: boolean;
1292
+ }
1293
+ type RingContextValue = RingStableContextValue & RingHoverContextValue;
1294
+ declare function RingProvider({ children, value, }: {
1295
+ children: ReactNode;
1296
+ value: RingContextValue;
1297
+ }): React$1.JSX.Element;
1298
+ declare function useRingStable(): RingStableContextValue;
1299
+ declare function useRingHover(): RingHoverContextValue;
1300
+ declare function useRing(): RingContextValue;
1301
+
1302
+ interface RingChartProps {
1303
+ /** Data array - each item represents a ring */
1304
+ data: RingData[];
1305
+ /** Chart size in pixels. If not provided, uses parent container size */
1306
+ size?: number;
1307
+ /** Stroke width of each ring. Default: 12 */
1308
+ strokeWidth?: number;
1309
+ /** Gap between rings. Default: 6 */
1310
+ ringGap?: number;
1311
+ /** Inner radius of the innermost ring. Default: 60 */
1312
+ baseInnerRadius?: number;
1313
+ /** Animation duration in milliseconds. Default: 1100 */
1314
+ animationDuration?: number;
1315
+ /** Additional class name for the container */
1316
+ className?: string;
1317
+ /** Controlled hover state - index of hovered ring */
1318
+ hoveredIndex?: number | null;
1319
+ /** Callback when hover state changes */
1320
+ onHoverChange?: (index: number | null) => void;
1321
+ /** Start angle in radians. Default: -PI/2 (top) */
1322
+ startAngle?: number;
1323
+ /** End angle in radians. Default: 3*PI/2 (full circle) */
1324
+ endAngle?: number;
1325
+ /** Framer Motion transition for ring enter animation */
1326
+ enterTransition?: Transition;
1327
+ /** Scales ring stagger delays (1 = default). */
1328
+ enterStaggerScale?: number;
1329
+ /**
1330
+ * High-frequency geometry updates (e.g. studio NumberField scrub).
1331
+ * Uses plain SVG paths instead of Motion `d` morphing.
1332
+ */
1333
+ geometryScrubbing?: boolean;
1334
+ /** Child components (Ring, RingCenter, etc.) */
1335
+ children: ReactNode;
1336
+ }
1337
+ declare function RingChart({ data, size: fixedSize, strokeWidth, ringGap, baseInnerRadius, className, hoveredIndex, onHoverChange, startAngle, endAngle, enterTransition, enterStaggerScale, geometryScrubbing, children, }: RingChartProps): React$1.JSX.Element;
1338
+
1339
+ type RingLineCap = "round" | "butt";
1340
+ interface RingProps {
1341
+ index: number;
1342
+ color?: string;
1343
+ animate?: boolean;
1344
+ showGlow?: boolean;
1345
+ lineCap?: RingLineCap;
1346
+ }
1347
+ declare const Ring: React$1.NamedExoticComponent<RingProps>;
1348
+
1349
+ interface RingCenterProps {
1350
+ /** Label shown below the value. Default: "Total" when not hovering */
1351
+ defaultLabel?: string;
1352
+ /** Format options for NumberFlow. Default: standard notation */
1353
+ formatOptions?: ChartStatFlowFormat;
1354
+ /** Custom render function for complete control over center content */
1355
+ children?: (props: {
1356
+ value: number;
1357
+ label: string;
1358
+ isHovered: boolean;
1359
+ data: {
1360
+ label: string;
1361
+ value: number;
1362
+ maxValue: number;
1363
+ color?: string;
1364
+ };
1365
+ }) => ReactNode;
1366
+ /** Additional class name for the container */
1367
+ className?: string;
1368
+ /** Class name for the value text. Scales with center size via container queries. */
1369
+ valueClassName?: string;
1370
+ /** Class name for the label text. Scales with center size via container queries. */
1371
+ labelClassName?: string;
1372
+ /** Prefix to show before the number (e.g., "$") */
1373
+ prefix?: string;
1374
+ /** Suffix to show after the number (e.g., "%") */
1375
+ suffix?: string;
1376
+ }
1377
+ /**
1378
+ * RingCenter displays content in the center of the ring chart.
1379
+ *
1380
+ * This component renders as pure HTML (not inside SVG foreignObject) to avoid
1381
+ * Safari's WebKit bug #23113 where HTML content with CSS transforms/opacity
1382
+ * inside foreignObject renders at incorrect positions.
1383
+ *
1384
+ * The parent RingChart uses CSS Grid stacking to overlay this HTML content
1385
+ * on top of the SVG rings.
1386
+ */
1387
+ declare function RingCenter({ defaultLabel, formatOptions, children, className, valueClassName, labelClassName, prefix, suffix, }: RingCenterProps): React$1.JSX.Element;
1388
+ declare namespace RingCenter {
1389
+ var displayName: string;
1390
+ }
1391
+
1392
+ declare function StatCardArea(): React$1.JSX.Element;
1393
+
1394
+ declare function StatCardLine(): React$1.JSX.Element;
1395
+
1396
+ declare function TrendBadge({ value, className, }: {
1397
+ value: number;
1398
+ className?: string;
1399
+ }): React$1.JSX.Element;
1400
+
1401
+ /**
1402
+ * Pure helpers for sparse rollup series → chart-ready points.
1403
+ * Locale-aware formatting via Intl; no React / chart deps.
1404
+ */
1405
+ type ChartPoint = {
1406
+ date: string;
1407
+ value: number;
1408
+ [key: string]: string | number | null | undefined;
1409
+ };
1410
+ type FillSeriesGapsOptions = {
1411
+ /** Inclusive start, `YYYY-MM-DD`. */
1412
+ from: string;
1413
+ /** Inclusive end, `YYYY-MM-DD`. */
1414
+ to: string;
1415
+ /** Field holding the date key (default `date`). */
1416
+ dateKey?: string;
1417
+ /** Field holding the numeric value (default `value`). */
1418
+ valueKey?: string;
1419
+ /** Fill missing days with this value (default `0`). */
1420
+ fill?: number;
1421
+ };
1422
+ /**
1423
+ * Expand a sparse daily series into a contiguous day range, filling gaps.
1424
+ */
1425
+ declare function fillSeriesGaps(points: ChartPoint[], options: FillSeriesGapsOptions): ChartPoint[];
1426
+ type TrendDelta = {
1427
+ /** Absolute change from previous → current. */
1428
+ delta: number;
1429
+ /** Percent change; `null` when previous is 0. */
1430
+ percent: number | null;
1431
+ /** Sign of the change for badges. */
1432
+ direction: "up" | "down" | "flat";
1433
+ };
1434
+ /**
1435
+ * Compare the last point to the previous (or to the first when only two).
1436
+ */
1437
+ declare function trendDelta(points: Array<{
1438
+ value: number;
1439
+ }>): TrendDelta | null;
1440
+ declare function formatChartNumber(value: number, locale: string, options?: Intl.NumberFormatOptions): string;
1441
+ declare function formatChartDate(isoDate: string, locale: string, options?: Intl.DateTimeFormatOptions): string;
1442
+ /**
1443
+ * Map `{ period, value }` rollup rows into chart points keyed by `date`.
1444
+ */
1445
+ declare function toChartPoints(rows: Array<{
1446
+ period: string;
1447
+ value: number;
1448
+ }>): ChartPoint[];
1449
+
1450
+ export { Area, AreaChart, type AreaChartProps, type AreaProps, Bar, BarChart, type BarChartProps, type BarProps, type ChartPoint, ChartProvider, ChartStatFlow, type ChartStatFlowFormat, type ChartStatFlowProps, ChartTooltip, ComposedChart, type ComposedChartProps, type FillSeriesGapsOptions, FunnelChart, type FunnelChartProps, Gauge, type GaugeLabelAlign, type GaugeLabelPlacement, type GaugeOrientation, type GaugeProps, Grid, HeatmapCells, HeatmapChart, type HeatmapChartProps, HeatmapLegend, HeatmapTooltip, HeatmapXAxis, HeatmapYAxis, Line, LineChart, type LineChartProps, type LineConfig, type LineProps, LiveLine, LiveLineChart, type LiveLineChartProps, type LiveLineProps, type Margin, Ring, RingCenter, type RingCenterProps, RingChart, type RingChartProps, type RingContextValue, type RingData, type RingHoverContextValue, type RingLineCap, type RingProps, RingProvider, type RingStableContextValue, StatCardArea, StatCardLine, TrendBadge, type TrendDelta, XAxis, YAxis, chartCssVars, defaultChartStatFlowFormat, defaultRingColors, fillSeriesGaps, formatChartDate, formatChartNumber, ringCssVars, toChartPoints, trendDelta, useChart, useChartStable, useRing, useRingHover, useRingStable };