import { CommonProps, type Styleable } from "@trackunit/react-components"; import { ActionModel, DropdownModel } from "./Actions"; export interface ActionSheetProps extends CommonProps, Styleable { /** * Actions to be displayed in the ActionSheet as primary actions (normally visible) */ actions: Array; /** * Secondary Actions to be displayed in the ActionSheet via the more menu */ moreActions?: Array; /** * Actions to be displayed as primary actions with capability to pass MenuContent as dropdown */ dropdownActions?: Array; /** * array of selected element-ids is used for calculating the number of selected elements - and available for eventhandlers. */ selections: Array; /** * Called when users closes the action sheet - must reset the selection. */ resetSelection: () => void; } /** * The `` component appears as a floating bar when one or more items * are selected from a table, providing bulk actions for the selection. * * It primarily accommodates 1-3 main actions that represent the most crucial and * frequently accessed functions on the specific page. If the page supports more * than 3 actions, the ones that are performed less often can be placed in a * contextual menu, represented by the 'three dots' icon via `moreActions`. * * ### When to use * - Provide bulk operations when users select multiple table rows * - For batch actions like delete, export, assign, or status changes * - When actions need to operate on a collection of selected items * * ### When not to use * - For single row actions - use `RowActions` instead * - For page-level actions not tied to selection - use regular buttons * - When the table doesn't support multi-selection * * @example Basic usage with table selection * ```tsx * import { Table, ActionSheet, useTableSelection } from "@trackunit/react-table"; * * const MyTable = ({ data }) => { * const { selections, resetSelection, rowSelection, onRowSelectionChange } = * useTableSelection(data); * * return ( * <> * * {selections.length > 0 && ( * handleExport(selections), * }, * { * label: "Delete", * iconName: "Trash", * variant: "danger", * onClick: () => handleDelete(selections), * }, * ]} * /> * )} * * ); * }; * ``` * @example With overflow actions * ```tsx * import { ActionSheet } from "@trackunit/react-table"; * * setSelectedIds([])} * actions={[ * { label: "Export", iconName: "ArrowDownTray", onClick: handleExport }, * { label: "Assign", iconName: "UserPlus", onClick: handleAssign }, * ]} * moreActions={[ * { label: "Archive", iconName: "ArchiveBox", onClick: handleArchive }, * { label: "Move", iconName: "FolderArrowDown", onClick: handleMove }, * { label: "Delete", iconName: "Trash", variant: "danger", onClick: handleDelete }, * ]} * /> * ``` * @example With dropdown actions * ```tsx * import { ActionSheet } from "@trackunit/react-table"; * import { MenuContent, MenuItem } from "@trackunit/react-components"; * * ( * * { setStatus("active"); close(); }} /> * { setStatus("inactive"); close(); }} /> * * ), * }, * ]} * /> * ``` * @param {ActionSheetProps} props - The props for the ActionSheet component * @returns {ReactElement} ActionSheet component */ export declare const ActionSheet: ({ actions, dropdownActions, moreActions, selections, resetSelection, className, style, "data-testid": dataTestId, }: ActionSheetProps) => import("react/jsx-runtime").JSX.Element;