import { ReactNode } from 'react'; import { StyledButtonType } from '../../../inputs/button'; import { DynamicToolbarAction } from '../../../custom/module/header-layout/planToolbarActions'; import { ToolbarLocale } from '../../../custom/module/header-layout/useTranslations'; /** One of the two right-cluster buttons (Figma "Right": Cancel + primary). */ export interface StyledDialogFooterButton { label: string; onClick?: () => void; disabled?: boolean; /** `submit` lets the footer drive the surrounding `
` without a click handler. */ type?: 'button' | 'submit' | 'reset'; /** Overrides the cluster default (`contained` for primary, `outlined` for secondary). */ variant?: StyledButtonType; /** Renders in the destructive palette (Figma `Danger = on`). */ tone?: 'default' | 'danger'; icon?: ReactNode; /** Trailing icon. `loading` supplies its own and wins. */ endIcon?: ReactNode; /** * Shows a spinner after the label and disables the button. Consumers previously swapped * the label *for* a spinner, which changes the button's width mid-submit — hence the * hard-coded `w-[98px]` workarounds in the footers this replaces. Keeping the label * makes the width stable on its own. */ loading?: boolean; /** * Wraps the button in a `StyledTooltip`. Falsy renders no tooltip, so the common * `tooltip={disabled && 'Locked for editing'}` reads naturally. A disabled button does * not emit pointer events, so the tooltip is anchored on a wrapper around it. */ tooltip?: ReactNode; dataTest?: string; ariaLabel?: string; } export interface StyledDialogFooterProps { /** * Left cluster (Figma "Left"): destructive and utility actions. * * One action renders inline, keeping its label while it fits and collapsing to icon-only * when it does not. Two or more always collapse into the icon-only "More" menu, matching * the Figma `More` state — so the caller never branches on count or width itself. */ leftActions?: DynamicToolbarAction[]; /** Replaces the planned left cluster with arbitrary content — Figma's "Checkbox+Label" left variant, or footer info text. */ leadingSlot?: ReactNode; /** Outlined action left of the primary — Cancel. */ secondaryAction?: StyledDialogFooterButton; /** Rightmost contained action — Save changes / Add new …. */ primaryAction?: StyledDialogFooterButton; /** Pins the footer to the bottom of its scroll container, separated by its top border only. */ fixed?: boolean; /** Bottom corners rounded to sit flush inside a dialog paper. Pass `false` for a full-bleed page footer. */ rounded?: boolean; locale?: ToolbarLocale; className?: string; dataTest?: string; } /** * Developer: alexandr.doicov@carasent.com * * @figmaNode wXrXt5uKNNzV2DnQCgyYZH#26769-135283 * @remarks Figma "Dialog footer" component set. The Figma `State` property * (Create/Edit/More/Reset filter) is **not** a prop — it follows from the actions the caller * passes: one left action is `Edit`, two or more is `More`. `Mobile` is derived from the * **container** width, not the viewport, so a footer inside a narrow popover compacts even on * a desktop screen. * * Layout: `Left` cluster (planned, adaptive) · `Right` cluster (Cancel + primary, always * visible and never overflowed — the primary action must stay reachable). * * @param leftActions - left cluster; one action inline, two or more behind the More menu * @param leadingSlot - arbitrary left content, replaces `leftActions` * @param secondaryAction - outlined Cancel * @param primaryAction - contained primary * @param fixed - sticky bottom, separated by the top border only * @param rounded - rounded bottom corners (default `true`) */ export declare function StyledDialogFooter({ leftActions, leadingSlot, secondaryAction, primaryAction, fixed, rounded, locale, className, dataTest, }: StyledDialogFooterProps): JSX.Element;