import { type LucideIcon } from "lucide-react"; import type { ReactNode } from "react"; import { type SemanticTone } from "./status-dot.js"; export type StatusBadgeVariant = "dot" | "outline" | "tinted"; interface ProductStatusMeta { label: string; tone: SemanticTone; /** The icon used when `icon="auto"`. Falls back to the tone's icon. */ icon?: LucideIcon | undefined; /** Live states pulse their dot (reduced-motion safe). */ live?: boolean | undefined; } /** * Every status the product shows, with its one label and one tone. Add a * status here rather than inventing a label at the call site. */ export declare const PRODUCT_STATUSES: { readonly connected: { readonly label: "Connected"; readonly tone: "success"; }; readonly active: { readonly label: "Active"; readonly tone: "success"; }; readonly succeeded: { readonly label: "Succeeded"; readonly tone: "success"; }; readonly installed: { readonly label: "Installed"; readonly tone: "success"; }; readonly ready: { readonly label: "Ready"; readonly tone: "success"; }; readonly needs_you: { readonly label: "Needs you"; readonly tone: "attention"; }; readonly needs_reconnect: { readonly label: "Needs reconnect"; readonly tone: "attention"; }; readonly token_expired: { readonly label: "Token expired"; readonly tone: "attention"; }; readonly locked: { readonly label: "Locked"; readonly tone: "attention"; readonly icon: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; }; readonly incomplete: { readonly label: "Incomplete"; readonly tone: "attention"; }; readonly not_finished: { readonly label: "Not finished"; readonly tone: "attention"; }; readonly expiring: { readonly label: "Expiring"; readonly tone: "attention"; readonly icon: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; }; readonly pending_review: { readonly label: "Pending review"; readonly tone: "attention"; }; readonly near_limit: { readonly label: "Near limit"; readonly tone: "attention"; }; readonly running: { readonly label: "Running"; readonly tone: "progress"; readonly live: true; }; readonly syncing: { readonly label: "Syncing"; readonly tone: "progress"; readonly live: true; }; readonly rate_limited: { readonly label: "Rate limited"; readonly tone: "progress"; }; readonly failed: { readonly label: "Failed"; readonly tone: "danger"; }; readonly sync_failed: { readonly label: "Sync failed"; readonly tone: "danger"; }; readonly expired: { readonly label: "Expired"; readonly tone: "danger"; readonly icon: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; }; readonly invite_failed: { readonly label: "Invitation failed"; readonly tone: "danger"; readonly icon: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; }; readonly out_of_usage: { readonly label: "Out of usage"; readonly tone: "danger"; }; readonly limit_reached: { readonly label: "Limit reached"; readonly tone: "danger"; }; readonly paused: { readonly label: "Paused"; readonly tone: "neutral"; readonly icon: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; }; readonly disabled: { readonly label: "Disabled"; readonly tone: "neutral"; }; readonly queued: { readonly label: "Queued"; readonly tone: "neutral"; readonly icon: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; }; readonly invited: { readonly label: "Invited"; readonly tone: "neutral"; readonly icon: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; }; readonly not_connected: { readonly label: "Not connected"; readonly tone: "neutral"; }; readonly unavailable: { readonly label: "Unavailable"; readonly tone: "neutral"; readonly icon: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; }; readonly offline: { readonly label: "Offline"; readonly tone: "neutral"; readonly icon: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; }; readonly suspended: { readonly label: "Suspended"; readonly tone: "neutral"; readonly icon: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; }; readonly revoked: { readonly label: "Revoked"; readonly tone: "neutral"; readonly icon: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; }; readonly never_run: { readonly label: "Never run"; readonly tone: "neutral"; readonly icon: import("react").ForwardRefExoticComponent & import("react").RefAttributes>; }; readonly off: { readonly label: "Off"; readonly tone: "neutral"; }; }; export type ProductStatus = keyof typeof PRODUCT_STATUSES; export declare const PRODUCT_STATUS_KEYS: ProductStatus[]; /** Resolves the label and tone for a status key or an explicit tone. */ export declare function resolveStatus(status: ProductStatus | undefined, tone: SemanticTone | undefined): { label: string | null; tone: SemanticTone; meta: ProductStatusMeta | null; }; export interface StatusBadgeProps { /** A known product status. Gives the label, tone and icon. */ status?: ProductStatus | undefined; /** Overrides the status tone, or sets it for a custom label. */ tone?: SemanticTone | undefined; /** Overrides the label, for example "Invited ยท expires in 5 days". */ children?: ReactNode | undefined; /** A (dot), B (outline, the default) or C (tinted). */ variant?: StatusBadgeVariant | undefined; /** "auto" uses the status icon instead of the dot; pass a node for a custom one. */ icon?: "auto" | ReactNode | undefined; /** Pulse the dot. Defaults to on for live statuses (Running, Syncing). */ pulse?: boolean | undefined; /** * Why this status, and who can fix it. Shown in a touch-safe tooltip and * read by screen readers; the badge becomes focusable. */ reason?: ReactNode | undefined; className?: string | undefined; } export declare function StatusBadge({ status, tone: toneProp, children, variant, icon, pulse, reason, className, }: StatusBadgeProps): import("react").JSX.Element; /** A placeholder while a status is loading. Same footprint as the badge. */ export declare function StatusBadgeSkeleton({ variant, className, }: { variant?: StatusBadgeVariant | undefined; className?: string | undefined; }): import("react").JSX.Element; export {};