import { RuleOverlap } from '@zeniai/client-epic-state'; import { ApprovalRuleWithUser } from './RuleOverlapCard'; /** * Approval Rules 3.0 — frontend overlap warning surface. * * Sits above the Add Rule / detail form when 'detectRuleOverlap' * returns a non-empty list. Outer width matches the form column * (same 'FormSection.D.width' tuple) so the banner stacks cleanly * above the first SectionCard. * * Structure (per design): * ┌─[gold border]──────────────────────────────────────┐ * │ [warm warning fill — header only] │ * │ ⚠ Partial rule overlap detected │ * │ Conditions partially overlap with… │ * ├────────────────────────────────────────────────────┤ * │ [grey-5 surface — body] │ * │ ┌─ inner rule card ───────────────────────────┐ │ * │ │ Rule name [SoD][Set at Priority] │ │ * │ │ Description │ │ * │ │ When: [chip] [chip] │ │ * │ │ Then: 1. Require approval from … │ │ * │ └─────────────────────────────────────────────┘ │ * │ [Ignore & Proceed] [Edit] │ * └────────────────────────────────────────────────────┘ * * Colors are explicit static tokens per the design (not theme- * adaptive) — the warning surface stays warm-amber in both themes, * the body stays light, the rule card stays white. See the styled * components below for the token-by-token mapping. * * Action buttons sit at the bottom-right of the body. 'Ignore & * Proceed' fires the parent's save flow as-is. 'Edit Existing Rule' * navigates same-tab to the conflicting rule's detail page; when * multiple overlaps are present we suppress this button because it * has no unambiguous target — the user can pick a card via its own * header context (TODO: multi-overlap design pass). */ export interface RuleOverlapBannerProps { overlaps: RuleOverlap[]; departmentNamesById?: Record; /** * Disables both action buttons while the page is in an in-flight * save (so the user can't double-fire or navigate away mid-write). */ disableButtons?: boolean; vendorNamesById?: Record; /** * Called when the user clicks Edit Existing Rule. The parent's * connector navigates same-tab to that rule's edit page. Only * invoked when 'overlaps.length === 1'. */ onEditExistingRule: (ruleId: string) => void; /** * Called when the user accepts the overlap and wants the save to * proceed. The parent dispatches the underlying save here. */ onIgnoreAndProceed: () => void; } declare const RuleOverlapBanner: ({ overlaps, vendorNamesById, departmentNamesById, onIgnoreAndProceed, onEditExistingRule, disableButtons, }: RuleOverlapBannerProps) => import("react/jsx-runtime").JSX.Element | null; export default RuleOverlapBanner;