@lilt-ui/charts 0.10.0 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/CHANGELOG.md +253 -234
  2. package/README.md +10 -0
  3. package/dist/cards/activity-ring-card.d.ts +7 -2
  4. package/dist/cards/cartesian-card.d.ts +10 -2
  5. package/dist/cards/funnel-chart-card.d.ts +7 -2
  6. package/dist/cards/heatmap-chart-card.d.ts +7 -2
  7. package/dist/cards/horizontal-bar-chart-card.d.ts +7 -2
  8. package/dist/cards/observations-card.d.ts +7 -2
  9. package/dist/cards/radar-chart-card.d.ts +7 -2
  10. package/dist/cards/radial-chart-card.d.ts +7 -2
  11. package/dist/cards/range-select.d.ts +2 -6
  12. package/dist/cards/sankey-chart-card.d.ts +7 -2
  13. package/dist/cards/scatter-chart-card.d.ts +7 -2
  14. package/dist/cards/slope-chart-card.d.ts +7 -2
  15. package/dist/cards/stat-card.d.ts +7 -2
  16. package/dist/chart.d.ts +1 -1
  17. package/dist/finance/cards/depth-chart-card.d.ts +7 -2
  18. package/dist/finance/order-book.d.ts +7 -2
  19. package/dist/finance.js +334 -327
  20. package/dist/index.d.ts +3 -1
  21. package/dist/index.js +2441 -2371
  22. package/dist/interaction/inspection-layer.d.ts +5 -1
  23. package/dist/lifecycle/chart-empty.d.ts +29 -0
  24. package/dist/motion/animated-number.d.ts +2 -6
  25. package/dist/motion/area-flow.d.ts +36 -0
  26. package/dist/motion/motion-layout-features.d.ts +1 -0
  27. package/dist/motion/motion-scope.d.ts +12 -0
  28. package/dist/motion/use-glide.d.ts +1 -1
  29. package/dist/motion/use-motion-blur.d.ts +6 -0
  30. package/dist/motion-layout-features-CJq3xh5t.js +2 -0
  31. package/dist/{report-context-UrwaoLYZ.js → report-context-DLA3I57K.js} +314 -288
  32. package/dist/{skeleton-block-C8gOUsxn.js → skeleton-block-CxrRuqe0.js} +2885 -2672
  33. package/dist/styles.css +1 -1
  34. package/dist/types.d.ts +14 -0
  35. package/dist/watch/board/chart-board.d.ts +2 -6
  36. package/dist/watch.js +160 -154
  37. package/package.json +1 -1
@@ -1,8 +1,9 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartController, ChartMargins, ChartTooltipContext, NumericXConfig, TimeXConfig, ChartAxis, ChartBarAppearance, ChartBackground, ChartCurve, ChartMotion, ChartPalette, ChartHoverReadout, ChartHoverStyle, ChartSeries, ChartTooltipIndicator, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch, ChartLoadingStyle } from '../types';
2
+ import { ChartController, ChartMargins, ChartTooltipContext, NumericXConfig, TimeXConfig, ChartAxis, ChartBarAppearance, ChartBackground, ChartCurve, ChartMotion, ChartPalette, ChartHoverReadout, ChartHoverStyle, ChartSeries, ChartTooltipIndicator, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch, ChartLoadingStyle, ChartEmptyState } from '../types';
3
3
  import { NumericKey, ResolvedX, XKey, XKind } from './keys';
4
4
  import { CardAggregate } from './format';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
6
+ import { ChartEmptyShape } from '../lifecycle/chart-empty';
6
7
  import { NormalSpec } from '../watch/engine/normal';
7
8
  import { NormalBreakdown } from '../watch/engine/explain';
8
9
  import { NormalReport } from '../watch/board/board-state';
@@ -206,6 +207,11 @@ export interface CartesianCardProps<Row, Key extends NumericKey<Row>> {
206
207
  * Moving skeletons on a page share a clock.
207
208
  */
208
209
  loadingStyle?: ChartLoadingStyle;
210
+ /**
211
+ * What the plot shows when the period has no data: `dots` (default), the chart's own `shape`,
212
+ * your own element such as `<ChartEmpty>No visits yet</ChartEmpty>`, or `null` for nothing.
213
+ */
214
+ empty?: ChartEmptyState;
209
215
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
210
216
  motion?: ChartMotion;
211
217
  className?: string;
@@ -277,6 +283,8 @@ export interface CardMarks {
277
283
  xAxis?: boolean;
278
284
  /** Extra text after the hovered x in the headline caption, e.g. open, high and low. */
279
285
  describe?: (inspection: ChartTooltipContext) => string | null;
286
+ /** The outline the `shape` empty look draws. Defaults to `bars` for column marks. */
287
+ emptyShape?: ChartEmptyShape;
280
288
  }
281
289
  /** Panes drawn under the main plot, linked to it: same data, x, margins and crosshair. */
282
290
  export interface CardPaneContext<Row> {
@@ -301,7 +309,7 @@ export declare const CARD_PADDING = 20;
301
309
  * The shared card body: headline, delta, period, plot, and value tiles, with hover sync and
302
310
  * range comparison. Area, Line, and Bar cards differ only in their `shape`.
303
311
  */
304
- export declare function CartesianCard<Row, Key extends NumericKey<Row>>({ shape, title, header, 'aria-label': ariaLabel, data: suppliedData, x, series: seriesInput, headline: suppliedHeadline, aggregate: suppliedAggregate, headlineSeries, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, tiles, legend, legendSwatch, depth, height, valueFormat, locale, formatValue: suppliedFormatValue, formatAxisValue: suppliedFormatAxisValue, formatX, xType, compare, target: suppliedTarget, forecast, sync, axis, hover, hoverStyle, background, spotlight, decimate, surface, badge, numberStyle, palette, bleed, axisInset, pillSeries, pillValue, pillPosition, tooltipIndicator, loading, loadingStyle, motion, className, style, panes, live, heading, restCaption, normal, onNormalChange, }: Omit<CartesianCardProps<Row, Key>, 'series'> & {
312
+ export declare function CartesianCard<Row, Key extends NumericKey<Row>>({ shape, title, header, 'aria-label': ariaLabel, data: suppliedData, x, series: seriesInput, headline: suppliedHeadline, aggregate: suppliedAggregate, headlineSeries, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, tiles, legend, legendSwatch, depth, height, valueFormat, locale, formatValue: suppliedFormatValue, formatAxisValue: suppliedFormatAxisValue, formatX, xType, compare, target: suppliedTarget, forecast, sync, axis, hover, hoverStyle, background, spotlight, decimate, surface, badge, numberStyle, palette, bleed, axisInset, pillSeries, pillValue, pillPosition, tooltipIndicator, loading, loadingStyle, empty, motion, className, style, panes, live, heading, restCaption, normal, onNormalChange, }: Omit<CartesianCardProps<Row, Key>, 'series'> & {
305
313
  series: readonly CoreSeries<Key>[];
306
314
  shape: CardShape;
307
315
  /** Linked panes under the plot, such as volume or indicators. */
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch } from '../types';
2
+ import { ChartLoadingStyle, ChartEmptyState, ChartMotion, ChartPalette, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch } from '../types';
3
3
  import { CardRange } from './cartesian-card';
4
4
  import { NumericKey, TextKey } from './keys';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -67,6 +67,11 @@ export interface FunnelChartCardProps<Row, Key extends NumericKey<Row>> {
67
67
  palette?: ChartPalette;
68
68
  loading?: boolean;
69
69
  loadingStyle?: ChartLoadingStyle;
70
+ /**
71
+ * What the card shows when the period has no data: `dots` (default), the chart's own `shape`,
72
+ * your own element such as `<ChartEmpty>No visits yet</ChartEmpty>`, or `null` for nothing.
73
+ */
74
+ empty?: ChartEmptyState;
70
75
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
71
76
  motion?: ChartMotion;
72
77
  className?: string;
@@ -97,4 +102,4 @@ export declare function pipeEnd(x: number, half: number, rx: number, side: 'left
97
102
  * its percentage on the band and its count in a tile beneath. Hovering a stage reads it in the
98
103
  * headline with the conversion from the step before.
99
104
  */
100
- export declare function FunnelChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, category, value, curve, colors, tracks, depth, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, legend, legendSwatch, locale, formatValue: suppliedFormatValue, color, surface, badge, numberStyle, palette, selected, onSelectedChange, loading, loadingStyle, motion: motionMode, className, style, }: FunnelChartCardProps<Row, Key>): ReactElement;
105
+ export declare function FunnelChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, category, value, curve, colors, tracks, depth, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, legend, legendSwatch, locale, formatValue: suppliedFormatValue, color, surface, badge, numberStyle, palette, selected, onSelectedChange, loading, loadingStyle, empty: emptyState, motion: motionMode, className, style, }: FunnelChartCardProps<Row, Key>): ReactElement;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
2
+ import { ChartLoadingStyle, ChartEmptyState, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
3
3
  import { CardRange } from './cartesian-card';
4
4
  import { NumericKey, TextKey } from './keys';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -65,6 +65,11 @@ export interface HeatmapChartCardProps<Row, Key extends NumericKey<Row>> {
65
65
  palette?: ChartPalette;
66
66
  loading?: boolean;
67
67
  loadingStyle?: ChartLoadingStyle;
68
+ /**
69
+ * What the card shows when the period has no data: `dots` (default), the chart's own `shape`,
70
+ * your own element such as `<ChartEmpty>No visits yet</ChartEmpty>`, or `null` for nothing.
71
+ */
72
+ empty?: ChartEmptyState;
68
73
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
69
74
  motion?: ChartMotion;
70
75
  className?: string;
@@ -115,4 +120,4 @@ export declare function labelTier(index: number, count: number): 'major' | 'mino
115
120
  * labeled. Hovering or focusing a cell reads it in the headline; arrow keys move between cells.
116
121
  * Missing cells are hatched and say "No data", so they never read as zero.
117
122
  */
118
- export declare function HeatmapChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, x, y, value, columns, rows: rowOrder, domain, aggregate, height, radius, gap, depth, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue: suppliedFormatValue, color, surface, badge, numberStyle, palette, loading, loadingStyle, motion: motionMode, className, style, }: HeatmapChartCardProps<Row, Key>): ReactElement;
123
+ export declare function HeatmapChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, x, y, value, columns, rows: rowOrder, domain, aggregate, height, radius, gap, depth, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue: suppliedFormatValue, color, surface, badge, numberStyle, palette, loading, loadingStyle, empty: emptyState, motion: motionMode, className, style, }: HeatmapChartCardProps<Row, Key>): ReactElement;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface, RankingOrder } from '../types';
2
+ import { ChartLoadingStyle, ChartEmptyState, ChartMotion, ChartPalette, ChartStyle, ChartSurface, RankingOrder } from '../types';
3
3
  import { CardRange } from './cartesian-card';
4
4
  import { NumericKey, TextKey } from './keys';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -65,6 +65,11 @@ export interface HorizontalBarChartCardProps<Row, Key extends NumericKey<Row>> {
65
65
  palette?: ChartPalette;
66
66
  loading?: boolean;
67
67
  loadingStyle?: ChartLoadingStyle;
68
+ /**
69
+ * What the card shows when the period has no data: `dots` (default), the chart's own `shape`,
70
+ * your own element such as `<ChartEmpty>No visits yet</ChartEmpty>`, or `null` for nothing.
71
+ */
72
+ empty?: ChartEmptyState;
68
73
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
69
74
  motion?: ChartMotion;
70
75
  className?: string;
@@ -74,4 +79,4 @@ export interface HorizontalBarChartCardProps<Row, Key extends NumericKey<Row>> {
74
79
  * A ranked list card: each row carries a bar, its value, and its share of the total. Hovering a
75
80
  * row reads it in the headline; click pins it and the arrow keys move through the list.
76
81
  */
77
- export declare function HorizontalBarChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, category, value, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, sort, limit, otherLabel, share, rank, depth, barStyle, valueFormat, locale, formatValue: suppliedFormatValue, color, surface, badge, numberStyle, palette, selected, onSelectedChange, loading, loadingStyle, motion: motionMode, className, style, }: HorizontalBarChartCardProps<Row, Key>): ReactElement;
82
+ export declare function HorizontalBarChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, category, value, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, sort, limit, otherLabel, share, rank, depth, barStyle, valueFormat, locale, formatValue: suppliedFormatValue, color, surface, badge, numberStyle, palette, selected, onSelectedChange, loading, loadingStyle, empty: emptyState, motion: motionMode, className, style, }: HorizontalBarChartCardProps<Row, Key>): ReactElement;
@@ -1,5 +1,5 @@
1
1
  import { ReactNode } from 'react';
2
- import { CardLegend, ChartLegendSwatch, ChartLoadingStyle, CategorySelection } from '../types';
2
+ import { CardLegend, ChartLegendSwatch, ChartLoadingStyle, ChartEmptyState, CategorySelection } from '../types';
3
3
  import { ChartCardProps } from './chart-card';
4
4
  import { CardRange } from './cartesian-card';
5
5
  /** Shared presentation options for observation-based cards. */
@@ -24,6 +24,11 @@ export interface ObservationsCardProps<Row> extends Omit<ChartCardProps, 'childr
24
24
  legendSwatch?: ChartLegendSwatch;
25
25
  loading?: boolean;
26
26
  loadingStyle?: ChartLoadingStyle;
27
+ /**
28
+ * What the card shows when the period has no data: `dots` (default), the chart's own `shape`,
29
+ * your own element such as `<ChartEmpty>No visits yet</ChartEmpty>`, or `null` for nothing.
30
+ */
31
+ empty?: ChartEmptyState;
27
32
  onSelectionChange?: (selection: CategorySelection<Row | null> | null) => void;
28
33
  /** Optional consumer-owned readout, also available when the header is hidden. */
29
34
  renderReadout?: (selection: CategorySelection<Row | null> | null) => ReactNode;
@@ -75,7 +80,7 @@ export declare const seriesColor: (index: number) => string;
75
80
  export declare const readField: (row: unknown, key: string) => unknown;
76
81
  export declare const readNumber: (row: unknown, key: string) => number | null;
77
82
  /** Private shell: every family uses the same inspection, card and skeleton lifecycle. */
78
- export declare function ObservationsCard<Row>({ title, header, data: suppliedData, height, depth, headline, aggregate, delta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue, legend, legendSwatch, loading, loadingStyle, onSelectionChange, renderReadout, motion, className, color, layout, placeholder, family, ...frame }: ObservationsCardProps<Row> & {
83
+ export declare function ObservationsCard<Row>({ title, header, data: suppliedData, height, depth, headline, aggregate, delta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue, legend, legendSwatch, loading, loadingStyle, empty: emptyState, onSelectionChange, renderReadout, motion, className, color, layout, placeholder, family, ...frame }: ObservationsCardProps<Row> & {
79
84
  family: string;
80
85
  layout: (data: readonly Row[], width: number, height: number) => ObservationScene<Row>;
81
86
  placeholder: (width: number, height: number) => ObservationScene<Row>;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch } from '../types';
2
+ import { ChartLoadingStyle, ChartEmptyState, ChartMotion, ChartPalette, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch } from '../types';
3
3
  import { CardRange, CardSeries } from './cartesian-card';
4
4
  import { NumericKey, TextKey } from './keys';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -58,6 +58,11 @@ export interface RadarChartCardProps<Row, Key extends NumericKey<Row>> {
58
58
  palette?: ChartPalette;
59
59
  loading?: boolean;
60
60
  loadingStyle?: ChartLoadingStyle;
61
+ /**
62
+ * What the card shows when the period has no data: `dots` (default), the chart's own `shape`,
63
+ * your own element such as `<ChartEmpty>No visits yet</ChartEmpty>`, or `null` for nothing.
64
+ */
65
+ empty?: ChartEmptyState;
61
66
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
62
67
  motion?: ChartMotion;
63
68
  className?: string;
@@ -103,5 +108,5 @@ export declare function profilePath(fractions: readonly (number | null)[], radiu
103
108
  * shape of strengths and gaps reads at a glance. Hovering or stepping around the spokes reads
104
109
  * every profile at that dimension.
105
110
  */
106
- export declare function RadarChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, category, series, domain: suppliedDomain, aggregate, grid, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, legend, legendSwatch, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, loadingStyle, motion: motionMode, className, style, }: RadarChartCardProps<Row, Key>): ReactElement;
111
+ export declare function RadarChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, category, series, domain: suppliedDomain, aggregate, grid, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, legend, legendSwatch, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, loadingStyle, empty: emptyState, motion: motionMode, className, style, }: RadarChartCardProps<Row, Key>): ReactElement;
107
112
  export {};
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartMotion, ChartLoadingStyle, ChartPalette, ChartStyle, ChartSurface, RankingOrder, CardLegend, ChartLegendSwatch } from '../types';
2
+ import { ChartMotion, ChartLoadingStyle, ChartEmptyState, ChartPalette, ChartStyle, ChartSurface, RankingOrder, CardLegend, ChartLegendSwatch } from '../types';
3
3
  import { CardRange } from './cartesian-card';
4
4
  import { NumericKey, TextKey } from './keys';
5
5
  import { RankedRow } from './rank';
@@ -86,6 +86,11 @@ export interface RadialChartCardProps<Row, Key extends NumericKey<Row>> {
86
86
  loading?: boolean;
87
87
  /** Shimmer (default), a clockwise draw, or a gentle pulse. Honors reduced motion. */
88
88
  loadingStyle?: ChartLoadingStyle;
89
+ /**
90
+ * What the card shows when the period has no data: `dots` (default), the chart's own `shape`,
91
+ * your own element such as `<ChartEmpty>No visits yet</ChartEmpty>`, or `null` for nothing.
92
+ */
93
+ empty?: ChartEmptyState;
89
94
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
90
95
  motion?: ChartMotion;
91
96
  className?: string;
@@ -119,5 +124,5 @@ export declare function ringAngles(rows: readonly RankedRow[]): Slice[];
119
124
  * A donut or pie card: the headline total, slices with a matching legend, and each slice's
120
125
  * share. Hovering a slice or a legend row reads it in the headline.
121
126
  */
122
- export declare function RadialChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, category, value, variant, depth, legend, legendSwatch, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, limit, otherLabel, sort, valueFormat, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, selected, onSelectedChange, colors: fixedColors, center, loading, loadingStyle, motion: motionMode, className, style, }: RadialChartCardProps<Row, Key>): ReactElement;
127
+ export declare function RadialChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, category, value, variant, depth, legend, legendSwatch, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, limit, otherLabel, sort, valueFormat, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, selected, onSelectedChange, colors: fixedColors, center, loading, loadingStyle, empty: emptyState, motion: motionMode, className, style, }: RadialChartCardProps<Row, Key>): ReactElement;
123
128
  export {};
@@ -20,9 +20,5 @@ export declare function ChartComponentsProvider({ rangeSelect, children, }: {
20
20
  children: ReactNode;
21
21
  }): import("react/jsx-runtime").JSX.Element;
22
22
  export declare function useCustomRangeSelect(): ComponentType<ChartRangeSelectProps> | null;
23
- /**
24
- * Lilt's period select: a pill that opens a frosted list of periods. It follows the listbox
25
- * pattern, so arrows, Home, End, Enter, Escape and typing a period's first letter all work,
26
- * and focus returns to the pill when the list closes.
27
- */
28
- export declare function RangeSelect({ value, options, onValueChange, 'aria-label': ariaLabel, }: ChartRangeSelectProps): import("react/jsx-runtime").JSX.Element;
23
+ /** RangeSelect with its own MotionScope, so it animates wherever it is rendered. */
24
+ export declare function RangeSelect(props: ChartRangeSelectProps): import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
2
  import { SankeyGraph, SankeyLink, SankeyNode } from '../engine/sankey';
3
- import { ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
3
+ import { ChartLoadingStyle, ChartEmptyState, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
4
4
  import { CardRange } from './cartesian-card';
5
5
  import { NumericKey, TextKey } from './keys';
6
6
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -52,6 +52,11 @@ export interface SankeyChartCardProps<Row, Key extends NumericKey<Row>> {
52
52
  palette?: ChartPalette;
53
53
  loading?: boolean;
54
54
  loadingStyle?: ChartLoadingStyle;
55
+ /**
56
+ * What the card shows when the period has no data: `dots` (default), the chart's own `shape`,
57
+ * your own element such as `<ChartEmpty>No visits yet</ChartEmpty>`, or `null` for nothing.
58
+ */
59
+ empty?: ChartEmptyState;
55
60
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
56
61
  motion?: ChartMotion;
57
62
  className?: string;
@@ -76,5 +81,5 @@ export declare function sankeyGraph<Row>({ data, source, target, value, conserva
76
81
  * amount that moved. Hovering or stepping through flows with the arrow keys reads each in the
77
82
  * headline with its share of the step it left.
78
83
  */
79
- export declare function SankeyChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, source, target, value, conservation, depth, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, loadingStyle, motion: motionMode, className, style, }: SankeyChartCardProps<Row, Key>): ReactElement;
84
+ export declare function SankeyChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, source, target, value, conservation, depth, height, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, loadingStyle, empty: emptyState, motion: motionMode, className, style, }: SankeyChartCardProps<Row, Key>): ReactElement;
80
85
  export {};
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch } from '../types';
2
+ import { ChartLoadingStyle, ChartEmptyState, ChartMotion, ChartPalette, ChartStyle, ChartSurface, CardLegend, ChartLegendSwatch } from '../types';
3
3
  import { CardRange } from './cartesian-card';
4
4
  import { NumericKey, TextKey } from './keys';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -72,6 +72,11 @@ export interface ScatterChartCardProps<Row, Key extends NumericKey<Row>> {
72
72
  palette?: ChartPalette;
73
73
  loading?: boolean;
74
74
  loadingStyle?: ChartLoadingStyle;
75
+ /**
76
+ * What the card shows when the period has no data: `dots` (default), the chart's own `shape`,
77
+ * your own element such as `<ChartEmpty>No visits yet</ChartEmpty>`, or `null` for nothing.
78
+ */
79
+ empty?: ChartEmptyState;
75
80
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
76
81
  motion?: ChartMotion;
77
82
  className?: string;
@@ -104,4 +109,4 @@ export declare function clipTrend(fit: {
104
109
  * and colored by group. Hovering or stepping through points with the arrow keys reads each one in
105
110
  * the headline, with its position marked on both axes.
106
111
  */
107
- export declare function ScatterChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, x, y, size, sizeLabel, group, label, xLabel, yLabel, trend, depth, height, aggregate, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, legend, legendSwatch, xFormat, locale, formatValue: suppliedFormatValue, formatX: suppliedFormatX, color, surface, badge, numberStyle, palette, loading, loadingStyle, motion: motionMode, className, style, }: ScatterChartCardProps<Row, Key>): ReactElement;
112
+ export declare function ScatterChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, x, y, size, sizeLabel, group, label, xLabel, yLabel, trend, depth, height, aggregate, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, valueFormat, legend, legendSwatch, xFormat, locale, formatValue: suppliedFormatValue, formatX: suppliedFormatX, color, surface, badge, numberStyle, palette, loading, loadingStyle, empty: emptyState, motion: motionMode, className, style, }: ScatterChartCardProps<Row, Key>): ReactElement;
@@ -1,6 +1,6 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
2
  import { SlopeOrder } from '../engine/slope';
3
- import { ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
3
+ import { ChartLoadingStyle, ChartEmptyState, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
4
4
  import { CardRange } from './cartesian-card';
5
5
  import { NumericKey, TextKey } from './keys';
6
6
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -70,6 +70,11 @@ export interface SlopeChartCardProps<Row, Key extends NumericKey<Row>> {
70
70
  palette?: ChartPalette;
71
71
  loading?: boolean;
72
72
  loadingStyle?: ChartLoadingStyle;
73
+ /**
74
+ * What the card shows when the period has no data: `dots` (default), the chart's own `shape`,
75
+ * your own element such as `<ChartEmpty>No visits yet</ChartEmpty>`, or `null` for nothing.
76
+ */
77
+ empty?: ChartEmptyState;
73
78
  /** `none` turns off decorative motion; reduced-motion users get this automatically. */
74
79
  motion?: ChartMotion;
75
80
  className?: string;
@@ -81,4 +86,4 @@ export interface SlopeChartCardProps<Row, Key extends NumericKey<Row>> {
81
86
  * category reads its later value and change in the headline; click pins it, and the arrow keys
82
87
  * move through categories.
83
88
  */
84
- export declare function SlopeChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, category, from, to, fromLabel, toLabel, variant, depth, sort, aggregate, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, color, height, valueFormat, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, loadingStyle, motion: motionMode, className, style, }: SlopeChartCardProps<Row, Key>): ReactElement;
89
+ export declare function SlopeChartCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data: suppliedData, category, from, to, fromLabel, toLabel, variant, depth, sort, aggregate, headline: suppliedHeadline, delta: suppliedDelta, deltaTone, range, ranges, defaultRange, color, height, valueFormat, locale, formatValue: suppliedFormatValue, surface, badge, numberStyle, palette, loading, loadingStyle, empty: emptyState, motion: motionMode, className, style, }: SlopeChartCardProps<Row, Key>): ReactElement;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement, ReactNode } from 'react';
2
- import { ChartBarAppearance, ChartLoadingStyle, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
2
+ import { ChartBarAppearance, ChartLoadingStyle, ChartEmptyState, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types';
3
3
  import { NumericKey, XKey, XKind } from './keys';
4
4
  import { CardAggregate } from './format';
5
5
  import { AnimatedNumberVariant } from '../motion/animated-number';
@@ -70,10 +70,15 @@ export interface StatCardProps<Row, Key extends NumericKey<Row>> {
70
70
  palette?: ChartPalette;
71
71
  loading?: boolean;
72
72
  loadingStyle?: ChartLoadingStyle;
73
+ /**
74
+ * What the trend shows when the period has no data: `dots` (default), the chart's own `shape`,
75
+ * your own element, or `null` for nothing. The headline reads a dash either way.
76
+ */
77
+ empty?: ChartEmptyState;
73
78
  motion?: ChartMotion;
74
79
  className?: string;
75
80
  style?: CSSProperties | ChartStyle;
76
81
  }
77
82
  /** Cells of a meter: whole cells up to the value, then one cell trimmed to the exact remainder. */
78
83
  export declare function meterCells(ratio: number, count?: number): number[];
79
- export declare function StatCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data, value: valueKey, x, xType, headline: suppliedHeadline, aggregate, delta, deltaTone, caption, chart, depth, barStyle, target, sync, height, color, aside, valueFormat, locale, formatValue: suppliedFormatValue, formatX, surface, badge, numberStyle, palette, loading, motion, loadingStyle, className, style, }: StatCardProps<Row, Key>): ReactElement;
84
+ export declare function StatCard<Row, const Key extends NumericKey<Row>>({ title, header, 'aria-label': ariaLabel, data, value: valueKey, x, xType, headline: suppliedHeadline, aggregate, delta, deltaTone, caption, chart, depth, barStyle, target, sync, height, color, aside, valueFormat, locale, formatValue: suppliedFormatValue, formatX, surface, badge, numberStyle, palette, loading, motion, loadingStyle, empty, className, style, }: StatCardProps<Row, Key>): ReactElement;
package/dist/chart.d.ts CHANGED
@@ -15,5 +15,5 @@ type ChartPlotRendererProps<T> = Omit<ChartProps<T>, 'className' | 'style'> & Om
15
15
  controllerLinked?: boolean;
16
16
  tooltipNode?: ReactNode;
17
17
  };
18
- export declare function ChartPlotRenderer<T>({ data, x, y, series, height, compactHeight, margins: marginProps, arrangement, marks, barLayout: barsProps, compact, tooltipNode, inspectionSeries: plotInspectionSeries, className, style, 'aria-label': ariaLabel, children, status, loadingStyle, interactive, error, renderRetry, motion: motionPreference, animateIn, resetKey, onSelectionChange, controller, linkedSelection, selectedCategoryId, onSelectedCategoryIdChange, compare, focus, live, brush, visibleSeries, onVisibleSeriesChange, toolkit, model, controllerLinked, axis: axisProp, pill, pillSeries, pillValue, pillPosition, axisInset, decimate, runoff, labelOverhang, }: ChartPlotRendererProps<T>): ReactElement;
18
+ export declare function ChartPlotRenderer<T>({ data, x, y, series, height, compactHeight, margins: marginProps, arrangement, marks, barLayout: barsProps, compact, tooltipNode, inspectionSeries: plotInspectionSeries, className, style, 'aria-label': ariaLabel, children, status, loadingStyle, empty: emptyState, interactive, error, renderRetry, motion: motionPreference, animateIn, resetKey, onSelectionChange, controller, linkedSelection, selectedCategoryId, onSelectedCategoryIdChange, compare, focus, live, brush, visibleSeries, onVisibleSeriesChange, toolkit, model, controllerLinked, axis: axisProp, pill, pillSeries, pillValue, pillPosition, axisInset, decimate, runoff, labelOverhang, }: ChartPlotRendererProps<T>): ReactElement;
19
19
  export {};
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement } from 'react';
2
- import { ChartAxis, ChartBackground, ChartHoverStyle, ChartLoadingStyle, ChartMotion, ChartStyle, ChartSurface } from '../../types';
2
+ import { ChartAxis, ChartBackground, ChartHoverStyle, ChartLoadingStyle, ChartEmptyState, ChartMotion, ChartStyle, ChartSurface } from '../../types';
3
3
  import { AnimatedNumberVariant } from '../../motion/animated-number';
4
4
  import { BookLevel } from '../indicators';
5
5
  export interface DepthChartCardProps {
@@ -29,6 +29,11 @@ export interface DepthChartCardProps {
29
29
  numberStyle?: AnimatedNumberVariant;
30
30
  loading?: boolean;
31
31
  loadingStyle?: ChartLoadingStyle;
32
+ /**
33
+ * What the card shows when there is no data: `dots` (default), the chart's own `shape`, your
34
+ * own element such as `<ChartEmpty>No book yet</ChartEmpty>`, or `null` for nothing.
35
+ */
36
+ empty?: ChartEmptyState;
32
37
  motion?: ChartMotion;
33
38
  className?: string;
34
39
  style?: CSSProperties | ChartStyle;
@@ -37,4 +42,4 @@ export interface DepthChartCardProps {
37
42
  * Order book depth: how much could trade at each price, buying and selling, as stepped areas, with
38
43
  * the mid, spread and total depth in the header. Hover reads the size resting at each price.
39
44
  */
40
- export declare function DepthChartCard({ title, header, 'aria-label': ariaLabel, bids, asks, valueFormat, sizeFormat, locale, height, axis, background, hoverStyle, surface, numberStyle, loading, loadingStyle, motion, className, style, depth, }: DepthChartCardProps): ReactElement;
45
+ export declare function DepthChartCard({ title, header, 'aria-label': ariaLabel, bids, asks, valueFormat, sizeFormat, locale, height, axis, background, hoverStyle, surface, numberStyle, loading, loadingStyle, empty, motion, className, style, depth, }: DepthChartCardProps): ReactElement;
@@ -1,5 +1,5 @@
1
1
  import { CSSProperties, ReactElement } from 'react';
2
- import { ChartLoadingStyle, ChartMotion, ChartStyle, ChartSurface } from '../types';
2
+ import { ChartEmptyState, ChartLoadingStyle, ChartMotion, ChartStyle, ChartSurface } from '../types';
3
3
  import { BookLevel } from './indicators';
4
4
  export interface OrderBookProps {
5
5
  /** Optional visible table caption. */
@@ -24,6 +24,11 @@ export interface OrderBookProps {
24
24
  surface?: ChartSurface;
25
25
  loading?: boolean;
26
26
  loadingStyle?: ChartLoadingStyle;
27
+ /**
28
+ * What the card shows when there is no data: `dots` (default), the chart's own `shape`, your
29
+ * own element such as `<ChartEmpty>No book yet</ChartEmpty>`, or `null` for nothing.
30
+ */
31
+ empty?: ChartEmptyState;
27
32
  motion?: ChartMotion;
28
33
  className?: string;
29
34
  style?: CSSProperties | ChartStyle;
@@ -32,4 +37,4 @@ export interface OrderBookProps {
32
37
  * A price ladder: asks above, bids below, a spread row between, and a depth bar behind each
33
38
  * level sized by its running total. It is a real table, so screen readers read it row by row.
34
39
  */
35
- export declare function OrderBook({ title, header, 'aria-label': ariaLabel, bids, asks, levels, depth, valueFormat, sizeFormat, locale, flash, surface, loading, loadingStyle, motion, className, style, }: OrderBookProps): ReactElement;
40
+ export declare function OrderBook({ title, header, 'aria-label': ariaLabel, bids, asks, levels, depth, valueFormat, sizeFormat, locale, flash, surface, loading, loadingStyle, empty: emptyState, motion, className, style, }: OrderBookProps): ReactElement;