import { CSSProperties, ReactElement, ReactNode } from 'react'; import { SlopeOrder } from '../engine/slope'; import { ChartLoadingStyle, ChartEmptyState, ChartMotion, ChartPalette, ChartStyle, ChartSurface } from '../types'; import { CardRange } from './cartesian-card'; import { NumericKey, TextKey } from './keys'; import { AnimatedNumberVariant } from '../motion/animated-number'; export type { SlopeOrder } from '../engine/slope'; export interface SlopeChartCardProps> { /** Optional visible title. Use aria-label to name an embedded chart. */ title?: string; /** Show the header, including headline and period controls. Defaults to true. */ header?: boolean; /** Accessible name, independent of the visible title. */ 'aria-label'?: string; /** One row per category with both measurements. Omit when `ranges` supplies the data. */ data?: readonly Row[]; /** Text field that names each row. Names must be unique. */ category: TextKey; /** Numeric field with the earlier value, e.g. last year. */ from: Key; /** Numeric field with the later value, e.g. this year. */ to: Key; /** Names the earlier measurement. Defaults to the `from` key. */ fromLabel?: string; /** Names the later measurement. Defaults to the `to` key. */ toLabel?: string; /** * `slope` (default) joins each category's two values across two columns; `dumbbell` lists * categories as rows with both values on one shared scale. */ variant?: 'slope' | 'dumbbell'; /** * Draws each change as a lit tube between two spheres, with a soft shadow. Ends stay exactly on * their values. */ depth?: boolean; /** `change` (default) puts the largest gain first, `to` the largest later value, `input` keeps your order. */ sort?: SlopeOrder; /** * How the headline and its change summarize categories: `sum` (default) for counts and money, * `mean` for rates and shares. */ aggregate?: 'sum' | 'mean'; /** Resting headline. Defaults to the later values summarized with `aggregate`. */ headline?: number; /** * Fractional change for the chip. Defaults to the change in total across categories measured * at both ends. */ delta?: number; /** Direction is not desirability. Use `inverse` when a decrease is good, `neutral` for neither. */ deltaTone?: 'default' | 'inverse' | 'neutral'; /** Static period label, e.g. "2025 → 2026". */ range?: string; /** Period select. Each range replaces data, delta and headline. */ ranges?: readonly CardRange[]; defaultRange?: string; /** One color for every category. By default rises and falls take the positive and negative colors. */ color?: string; /** Plot height in pixels for the slope variant. Defaults to 260. */ height?: number; valueFormat?: Intl.NumberFormatOptions; locale?: string; formatValue?: (value: number) => string; surface?: ChartSurface; /** A glass tab tucked behind the card's top edge, e.g. a caption, a command, or actions. */ badge?: ReactNode; /** Headline motion: `count` (default), `pop`, `slide`, `roll`, `flow`, or `scramble`. */ numberStyle?: AnimatedNumberVariant; palette?: ChartPalette; loading?: boolean; loadingStyle?: ChartLoadingStyle; /** * What the card shows when the period has no data: `dots` (default), the chart's own `shape`, * your own element such as `No visits yet`, or `null` for nothing. */ empty?: ChartEmptyState; /** `none` turns off decorative motion; reduced-motion users get this automatically. */ motion?: ChartMotion; className?: string; style?: CSSProperties | ChartStyle; } /** * Two measurements per category, such as last year and this year. The slope variant shows who * rose and who fell at a glance; the dumbbell variant lists the gap for each category. Hovering a * category reads its later value and change in the headline; click pins it, and the arrow keys * move through categories. */ export declare function SlopeChartCard>({ 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): ReactElement;