import { ReactElement } from 'react'; export interface DynamicToolbarActionRenderOptions { showLabel: boolean; } export interface DynamicToolbarAction { id: string; label: string; onClick: () => void; icon?: ReactElement; disabled?: boolean; hidden?: boolean; variant?: 'contained' | 'outlined' | 'text' | 'textGray' | 'textWhite'; /** Visual tone. `danger` renders the action in the destructive/red palette. */ tone?: 'default' | 'danger'; size?: 'large' | 'small' | 'medium'; /** * Higher priority resists overflow longer — lower-priority actions move * into the More menu first. Label collapse is positional (right to left). */ priority?: number; /** Never move into the More overflow menu. */ keepVisible?: boolean; /** Allow label + icon to collapse to icon-only. */ canHideLabel?: boolean; /** Allow moving into the More overflow menu. */ canOverflow?: boolean; dataTest?: string; estimatedWidthPx?: number; ariaLabel?: string; /** Custom inline renderer for richer actions such as popover triggers. */ render?: (options: DynamicToolbarActionRenderOptions) => ReactElement; } export interface PlannedToolbarAction { action: DynamicToolbarAction; showLabel: boolean; width: number; } export interface PlannedToolbarActions { inlineActions: PlannedToolbarAction[]; overflowActions: DynamicToolbarAction[]; showMoreMenu: boolean; } export declare const ACTION_GAP_PX = 8; /** Fallback width of the icon-only "More" overflow trigger button. */ export declare const MORE_BUTTON_PX = 40; /** * Supplies the real (measured) width of an action. Returning `undefined` * falls back to `estimateToolbarActionWidth`. */ export type ResolveToolbarActionWidth = (action: DynamicToolbarAction, showLabel: boolean) => number | undefined; export declare function estimateToolbarActionWidth(action: DynamicToolbarAction, showLabel: boolean): number; export declare function resolveToolbarActionWidth(action: DynamicToolbarAction, showLabel: boolean, resolveActionWidth?: ResolveToolbarActionWidth): number; export declare function planToolbarActions(options: { actions: DynamicToolbarAction[]; availableWidth: number; maxInlineActions?: number; collapseLabels?: boolean; resolveActionWidth?: ResolveToolbarActionWidth; moreButtonWidthPx?: number; }): PlannedToolbarActions; /** * Bulk actions overflow progressively: every action keeps its full label, * and the lowest-priority actions drop into the "More" menu until the * remaining inline strip fits the available width. */ export declare function planBulkToolbarActions(options: { actions: DynamicToolbarAction[]; availableWidth: number; maxVisibleBulkActions?: number; resolveActionWidth?: ResolveToolbarActionWidth; moreButtonWidthPx?: number; }): PlannedToolbarActions;