import { type ReactNode } from 'react'; export type WorkflowStatusTone = 'neutral' | 'info' | 'success' | 'warning' | 'error' | 'accent'; export type WorkflowStatusSize = 'sm' | 'md' | 'lg'; export interface WorkflowStatusOption { value: string; label: string; icon: ReactNode; tone: WorkflowStatusTone; disabled?: boolean; } export interface WorkflowStatusDisplayProps { value: string; option: WorkflowStatusOption; size?: WorkflowStatusSize; workflowLabel?: string; id?: string; className?: string; dir?: 'ltr' | 'rtl'; } export declare const WorkflowStatusDisplay: import("react").ForwardRefExoticComponent>; export interface WorkflowStatusControlHandle { getValue: () => string; getIsOpen: () => boolean; /** True while the host's `saving` is set or a returned promise is pending. */ getIsSaving: () => boolean; /** Returns the host's promise, already marked handled, so a caller may * await a rejection without raising an unhandled-rejection warning. */ setValue: (value: string) => void | Promise; open: () => void; close: () => void; focus: () => void; } export interface WorkflowStatusControlProps { value: string; options: readonly WorkflowStatusOption[]; /** * Called with the status the person picked. Update `value` only once the * change is saved. * * Return a promise to let the control track the save, and resolve it only * once `value` shows the saved status. While it is pending the control * shows its saving state (spinner, aria-busy, locked). If it rejects, or * the callback throws, the control keeps showing `value` and shows the * error. * * The contract: reject, or throw, only with an `Error` whose message is * already translated and written for the person. The control shows that * message word for word and never translates or filters it, so a raw * network or server message, or a bug's own text, reaches the person as * it is. Catch every failure and reject with your own translated message. * A failure with no message shows the control's own translated default. * * The error clears on the next change, or when `value` moves to another * status. A host that changed `value` before the save finished must set * it back itself before rejecting. * * The pending save and its error belong to this instance. A host that * reuses one control for another record must remount it with * `key={recordId}`. */ onValueChange: (value: string) => void | Promise; size?: WorkflowStatusSize; disabled?: boolean; /** Host-driven saving flag. Not needed when `onValueChange` returns a * promise; the two combine. */ saving?: boolean; /** Host-driven failed state. Shows the default message unless * `errorMessage` is set. */ error?: boolean; /** Translated failure text. Setting it shows the alert at once, so set it * only while a save has failed. It wins over a rejection's own message; * to word a rejection, reject with a translated Error instead. */ errorMessage?: string; workflowLabel?: string; menuLabel?: string; savingLabel?: string; open?: boolean; defaultOpen?: boolean; onOpenChange?: (open: boolean) => void; id?: string; className?: string; dir?: 'ltr' | 'rtl'; 'aria-label'?: string; 'aria-describedby'?: string; } export declare const WorkflowStatusControl: import("react").ForwardRefExoticComponent>; //# sourceMappingURL=workflow-status.d.ts.map