import { type MouseEventHandler, type ReactElement, type ReactNode } from 'react'; import type { LinkTarget } from './AppLink.js'; import { type BarTone, type ProgressSegment } from './Meter.js'; import { type BadgeVariant } from './StatusBadge.js'; /** A tile's lamp, as a status's: lit in a tone, unlit with `off`, or an icon in its place. Its * tone says what the state means, as every status lamp's does: work under way is `info` with * `pulse`, something waiting its turn or off (pending jobs, idle nodes) is `off`, a failure is * `error`, work done is `success`, and `warning` is only for a state that needs a look. */ export interface StatTileLamp { variant?: BadgeVariant | undefined; /** Unlit, a hollow ring, for a count of something waiting or off, such as pending jobs or idle * nodes. */ off?: boolean | undefined; /** A ping from the lamp, three times, for work under way: once the count has loaded and is * above zero. */ pulse?: boolean | undefined; /** An icon in place of the lamp, such as a `RunStatusIcon`. */ icon?: ReactNode | undefined; } /** A tile's bar: a `ProgressBar` in one or more stretches, such as nodes in use, then partly in * use, then down, on a track whose empty rest is the idle ones. */ export interface StatTileBar { value: number; max?: number; tone?: BarTone; segments?: ReadonlyArray | undefined; /** What the bar shows, read by assistive technology, such as "60 of 102 nodes in use". */ 'aria-label': string; getAriaValueText?: ((formatted: string | null, value: number | null) => string) | undefined; } export interface StatTileProps extends LinkTarget { /** The count. A number reads in the app's locale, grouped as it groups digits; anything else, * such as a dash for a count not known, shows as given. */ value: ReactNode; /** Quieter text after the value, such as "/ 102 free". */ suffix?: ReactNode; /** What the value counts, under it, such as "Running". A long one wraps. */ label: ReactNode; /** A status lamp level with the label, for a count of things in one state. */ lamp?: StatTileLamp | undefined; /** A bar under the label: a `ProgressBar`'s value and stretches, or a bar of the host's own, * such as one in a tooltip. */ bar?: StatTileBar | ReactElement | undefined; /** How a number is written, such as `{ notation: 'compact' }` for 1.3M; whole and grouped * by default. */ format?: Intl.NumberFormatOptions | undefined; /** What assistive technology reads for the tile, when the value, suffix and label in a row * don't read well, such as "35 of 102 nodes free". */ spoken?: string | undefined; /** Makes the tile a button. With `href` it is a link instead. */ onClick?: MouseEventHandler | undefined; /** In a `StatTileGroup`, the tile takes a row of its own on a phone, such as one with a bar. */ wide?: boolean | undefined; /** Sketches the value while it loads; the label shows, since it is known. */ loading?: boolean | undefined; /** The locale numbers are written in; the provider's `locale`, then the browser's, without it. */ locale?: string | undefined; className?: string | undefined; } /** A count and what it counts, as a tile at the top of a page, such as a queue's running jobs: * a large value, a label under it, and optionally a status lamp beside the label and a bar * under it. With `href` or `onClick`, the whole tile is a link or a button, such as to the list * the count is of. Lay several out with `StatTileGroup`. * * Assistive technology reads the value and label as one phrase, such as "3 Running", not as two * lines; `spoken` words it otherwise. */ export declare function StatTile({ value, suffix, label, lamp, bar, format, spoken, onClick, wide, loading, locale: localeProp, href, reloadDocument, target, className, }: StatTileProps): import("react").JSX.Element; export interface StatTileGroupProps { /** `StatTile`s, each a direct child, so the group reads their `wide`. */ children: ReactNode; className?: string | undefined; } /** Tiles in a row as wide as the content around them, edge to edge with it. Where the row is * too narrow for them, such as on a phone, they take two columns, with a `wide` tile across * both, and any tile that would sit alone in half a row across both too: * four counts and a wide tile read as two rows of two and the wide one under them. */ export declare function StatTileGroup({ children, className }: StatTileGroupProps): import("react").JSX.Element;