import React from 'react'; export type ApprovalGateRisk = 'low' | 'medium' | 'high'; export type ApprovalGateStatus = 'pending' | 'approved' | 'rejected' | 'expired'; export interface ApprovalGateProps extends Omit, 'title' | 'onChange'> { /** * What is being approved, stated as the action and its object — "Delete 14 * projects", not "Confirm action". Required: it is the region's accessible * name, and a decision the user cannot name is not a decision. */ title: React.ReactNode; /** Why it stopped here, and what happens on approval. */ children?: React.ReactNode; /** * How much is at stake. Drives emphasis only — it does NOT change what the * component enforces, because the component enforces nothing. */ risk?: ApprovalGateRisk; /** Where the decision has got to. `pending` is the only state with buttons. */ status?: ApprovalGateStatus; onApprove?: () => void; onReject?: () => void; /** * Offer "edit" as a third way out. Omit it when the proposal cannot be * amended — an approve/reject pair the user cannot influence is honest; * an edit button that discards their edit is not. */ onEdit?: () => void; approveLabel?: string; rejectLabel?: string; editLabel?: string; /** * What happened, in words — "Approved", "Rejected", "Expired without a * decision" in English. Announced when `status` changes, and shown in place * of the actions when there is no `resolution`. Pass the translation for * `status`. */ statusLabel?: string; /** A decision is in flight. Both actions disable; neither disappears. */ isSubmitting?: boolean; /** Shown in place of the actions once the decision is made. */ resolution?: React.ReactNode; } /** * ApprovalGate — a proposed action, held until a person decides. * * The human-in-the-loop control. An agent proposes; this is where a person * approves, rejects, or amends before anything happens. In regulated contexts * demonstrable human oversight is a compliance surface rather than a nicety, * which is why this is a first-class component and not a Modal with two * buttons in it. * * IT ENFORCES NOTHING, AND SAYING SO IS THE POINT * * This renders a decision. It does not gate execution — the caller does, by not * acting until `onApprove` fires. A component that *looked* like it enforced a * policy would be the worst possible thing to ship here: teams would rely on a * guarantee that lives entirely in their own call site. `risk` changes emphasis * and nothing else, for the same reason. * * NOT A MODAL, DELIBERATELY * * A modal steals focus and hides the page. But the page is the evidence: the * user needs the plan, the diff, the tool call and the context in front of them * while deciding. This sits inline, keeps everything visible, and never * traps focus — an approval a user was rushed through is not oversight. * * NEITHER BUTTON IS FOCUSED ON MOUNT. Autofocusing approve turns a decision * into an Enter keypress on a page the user has not read. Focus is moved to the * region's heading instead, so a screen-reader user lands on what is being * asked rather than on the answer. * * THE RESOLVED STATES ARE NOT DECORATION. `approved`, `rejected` and `expired` * replace the actions with what happened, so the record of the decision stays * on the page. `expired` exists because an approval request that nobody answers * is the common real outcome, and a gate that sits pending for ever is * indistinguishable from one that is broken. */ export declare const ApprovalGate: React.ForwardRefExoticComponent>; //# sourceMappingURL=ApprovalGate.d.ts.map