import "./status.css"; import type * as React from "react"; import { useRender } from "@base-ui/react/use-render"; import { type StyleProps } from "./style_props"; import { type ColorName } from "./colors"; /** * One select option, as carried by a query CELL (`readSelect`) or the option * LIST (`useFieldOptions`) in `@lotics/app-sdk`. `key` is optional — used only * as a stable React key. `color` is a palette token; it may be absent (a cell * carries only key + label) or a token this UI build doesn't recognize — either * way the mark degrades to a neutral colour. */ export interface OptionValue { key?: string; label: string; color?: string | null; } /** * ONE OPTION OF A SELECT FIELD, as the platform RESOLVES it — the key a write * sends back, required, with the field's own colour. The same shape as * {@link OptionValue} with the key promised, because a field's own option set is * keyed by construction while a cell's value may carry only a label. */ export interface FieldOption extends OptionValue { key: T; } export interface StatusProps extends StyleProps { label?: string; color?: ColorName; /** * A select field's stored value, resolved — the OPTION's own colour paints the * mark. One option, an array (a multi-select cell → one mark each) or * null/empty, which renders nothing. Supersedes `label` and `color`. * * ONE mark or several, the ROW is the element — `className`, `style` and `ref` * land on it either way. * * Feed it straight from `@lotics/app-sdk`: a `useFieldOptions` option for a * picker, or `byKey(readSelect(cell)[0]?.key)` for a stored value. */ option?: OptionValue | OptionValue[] | null; /** * The status-indicator weight — DEFAULT to `dot`: * - "dot": pill-less — a colored dot + label. The everyday status indicator: * legends, register cells, inline/secondary status, a metric's quality cue. * Light enough to sit anywhere without shouting. Reach for this by default. * - "tonal": a filled pill — HEAVY. Reserve it for the ONE prominent status of * a surface. "One per view" counts status KINDS, not rows. Not for option * lists; if in doubt, use `dot`. * * In a TABLE CELL, pass `style={{ alignSelf: "flex-start" }}`: a cell * stretches its child, so a tonal pill fills the whole column otherwise. It * cannot be defaulted here — `flex-start` means TOP in a row-direction * parent. */ variant?: "tonal" | "dot"; /** * Whether the state is still RUNNING. `live` breathes the dot — the only * difference between a live automation and a paused one at a glance. A * `settled` state rests: a pulse on it animates a screen that is not changing. */ activity?: "live" | "settled"; tooltip?: string; userSelect?: "none" | "auto"; testID?: string; ref?: React.Ref; render?: useRender.RenderProp; } /** * A STATUS a record wears — a lifecycle state, a risk level, a quality cue — that * reads at a GLANCE. Keep the vocabulary scarce so a colored mark always MEANS * state. * * NOT for a type / category / attribute / count — render that as inline TEXT. If * you're adding one "to show more info", STOP: that's text, not a status. * * Default `variant="dot"`; `tonal` is the heavy exception (see the prop doc). */ export declare function Status({ label, color, option, variant, activity, tooltip, userSelect, testID, render, ref, ...props }: StatusProps): React.JSX.Element | null;