import { type FC } from "react"; /** * The kind of instrument, which selects the leading icon. Overridden by * `ExclamationMarkIcon` when `state` is `"error"`. */ export type InstrumentType = "info" | "questionnaire" | "numeric" | "document" | "contact" | "other" | "scripted" | "sum"; type BaseProps = { /** Selects the leading icon. */ type: InstrumentType; /** * Name of the instrument. Truncates with an ellipsis in the `detailed` * variant; in `compact` it is the pill label, and is replaced by * `errorMessage` when `state` is `"error"`. */ title: string; /** * First cell of the meta row, e.g. `"Lesson"`. `detailed` only, and not * rendered when `state` is `"error"` — the error message takes its place. */ category?: string; /** * Second cell of the meta row, e.g. `"Comments ON"`, separated from * `category` by a vertical rule. Rendered only alongside `category`. * `detailed` only, and replaced by the error message in the error state. */ meta?: string; /** * Instrument identifier, e.g. `"Id-30ry3-7240"`. Rendered as a bordered * tag beneath the meta row. `detailed` only; omitted when absent. */ id?: string; /** * Number shown in the trailing tag — how many times the instrument is used. * `detailed` only; omitted when absent. `0` renders, it is not treated as * empty. */ count?: number; /** * `"compact"` is an inline pill of icon plus label, for listing * instruments inside an action card. `"detailed"` is a full-width row with * a title, meta row and tags. * * @default "compact" */ variant?: "compact" | "detailed"; /** Merged onto the root element. */ className?: string; }; /** * `errorMessage` is what the error state renders — it replaces the label in * the compact variant and the meta row in the detailed variant. Requiring it * alongside `state="error"` makes the empty-error-label state impossible to * express, rather than guarding against it at runtime. * * In the error state the icon becomes `ExclamationMarkIcon` and the icon, * title and message all take the error colour. * * @default state "default" */ type StateProps = { state?: "default"; errorMessage?: never; } | { state: "error"; errorMessage: string; }; export type Props = BaseProps & StateProps; /** * Renders a single instrument belonging to an action. * * Use `variant="compact"` for the inline pills listed on an `ActionCard`, and * `variant="detailed"` for the full rows in `ActionCardDetailed`. Both of * those consumers force the variant, so it is not part of the props they * accept. * * @example * ```tsx * * * * * * ``` */ export declare const InstrumentCard: FC; export {};