/** * @fileoverview Saasflare BarList — horizontal "top N" rankings. * @author Saasflare™ * * Each row renders a horizontal bar whose fill width is proportional to the * largest value in the list. Useful for "top countries", "top pages", * "top errors" style dashboard widgets — a pattern shadcn doesn't ship but * Tremor popularized. * * @module packages/ui/components/ui/bar-list * @package ui * @layer core * * @example * n.toLocaleString()} * /> */ import { type ReactNode } from "react"; import { type SaasflareComponentProps } from "../../providers"; /** A single row in the list. */ export interface BarListItem { /** Row label. */ name: string; /** Numeric value driving the bar width. */ value: number; /** Optional icon shown left of the label. */ icon?: ReactNode; /** Optional click target for the row label (wraps in ``). */ href?: string; /** Optional per-row color override (any CSS color). */ color?: string; } /** Props for the BarList component. */ export interface BarListProps extends SaasflareComponentProps { /** Rows to render. */ data: BarListItem[]; /** Formats the numeric value on the right edge. Default: `(n) => n.toLocaleString()`. */ valueFormatter?: (value: number) => string; /** Sort rows by value descending. Default: `true`. */ sortDescending?: boolean; /** Maximum rows rendered (truncates after sort). */ limit?: number; /** Additional class names. */ className?: string; } /** * Horizontal bar list — common dashboard "top N" rankings pattern. * * @component * @layer core */ export declare function BarList({ data, valueFormatter, sortDescending, limit, className, surface, radius, animated, iconWeight, }: BarListProps): import("react/jsx-runtime").JSX.Element;