import { type Styleable } from "@trackunit/react-components"; import type { MouseEventHandler, ReactElement } from "react"; export interface SelectAllBannerProps extends Styleable { /** Whether all items across all pages are currently selected */ readonly areAllSelected: boolean; /** Number of items currently selected (on this page or total) */ readonly selectedCount: number; /** Called when user clicks "Select all" to select all items across pages */ readonly onClickSelectAll: MouseEventHandler; /** Called when user clicks "Clear selection" */ readonly onClickClearSelection: MouseEventHandler; /** Optional label override for the "Select all" button */ readonly selectAllLabel?: string; } /** * A generic banner displayed inside a table's `subHeaderActions` slot when all * rows on the current page are selected. It offers the user two actions: * * 1. **Select all** across every page (when `areAllSelected` is `false`). * 2. **Clear selection** (when `areAllSelected` is `true`). * * Domain-specific data-fetching and state management are left to the consumer * via the `onClickSelectAll` / `onClickClearSelection` callbacks. * * ### When to use * * - The table is **paginated** and users need to select items beyond the * visible page (e.g. bulk assign, bulk delete). * - The full set of matching IDs is fetched lazily via a separate lightweight * query when the user explicitly clicks "Select all". * - The table supports **filters** and the selection should respect the * currently applied filter set. Use the `selectAllLabel` prop to communicate * that only matching items will be selected (e.g. "Select all matching assets * in Service Plans"). * * ### When **not** to use * * - The table loads **all data at once** (no pagination). In that case the * built-in header checkbox from `useTableSelection` already selects every * row — there is nothing extra to select. * - The dataset is small enough that all rows fit on a single page. * - Selection is limited to a single row (e.g. a details panel use-case). * * @example * ```tsx * = totalCount} * selectedCount={selectedIds.length} * onClickSelectAll={handleSelectAll} * onClickClearSelection={handleClearSelection} * /> * ) : undefined * } * /> * ``` */ export declare const SelectAllBanner: ({ areAllSelected, selectedCount, onClickSelectAll, onClickClearSelection, selectAllLabel, style, }: SelectAllBannerProps) => ReactElement;