import * as React from 'react'; import { IconElement, TooltipCommonProps } from '../common'; import { PopoverMenuProps } from '../PopoverMenu'; import { ButtonPriority, ButtonWithAsProp } from '../Button'; import { IconButtonPriority, IconButtonSkin } from '../IconButton'; export type TableActionCellPrimaryActionVisibility = 'onHover' | 'always'; export type TableActionCellSize = 'tiny' | 'small' | 'medium'; type BaseActionProps = { /** Sets the label of the action. */ text: string; /** Called when the action is clicked. */ onClick: () => void; /** Controls the skin of the action button. * @deprecated Scheduled for removal in the next major release. For a `primaryAction`, use `visibility`, which sets the button `priority`: `'primary'` for `'onHover'` and `'secondary'` for `'always'`. Until then, `skin` is still passed to the button. */ skin?: 'standard' | 'inverted' | 'premium'; /** Specifies whether the action is disabled. */ disabled?: boolean; /** Sets an icon rendered before the action label. */ prefixIcon?: IconElement; /** Sets an icon rendered after the action label. */ suffixIcon?: IconElement; /** Applies a data-hook HTML attribute that can be used in the tests. */ dataHook?: string; /** Sets the tooltip text shown while the action is disabled. Has no effect unless `disabled` is `true`. */ disabledDescription?: string; /** Controls the tooltip shown when hovering over the action. */ tooltipProps?: TooltipCommonProps; }; export type TableActionCellPrimaryAction = ButtonWithAsProp<{ visibility?: TableActionCellPrimaryActionVisibility; }> & BaseActionProps; export type TableActionCellMainAction = ButtonWithAsProp<{ priority?: ButtonPriority; }> & BaseActionProps; export type TableActionCellMainActions = TableActionCellPrimaryAction | TableActionCellMainAction[]; export type TableActionCellSecondaryAction = { text: string; icon: IconElement; onClick: (event?: React.MouseEvent) => void; disabled?: boolean; disabledDescription?: string; tooltipProps?: TooltipCommonProps; skin?: 'dark' | 'destructive' | 'premium'; subtitle?: string; dataHook?: string; }; export type TableActionCellSecondaryDivider = { divider: boolean; }; export type TableActionCellMoreActionsProps = { /** Controls the priority of the more actions icon button. */ priority?: IconButtonPriority; /** Controls the skin of the more actions icon button. */ skin?: IconButtonSkin; }; export type TableActionCellSecondaryActionsProps = { /** Controls the priority of the secondary action icon buttons shown inline. */ priority?: IconButtonPriority; }; export type TableActionCellPrimaryActionPlaceholderProps = { /** Controls the priority of the primary action placeholder icon button. */ priority?: IconButtonPriority; }; export type TableActionCellPopoverMenuProps = Omit; export interface TableActionCellProps { /** Applies a data-hook HTML attribute to be used in the tests. */ dataHook?: string; /** Called when clicking on the table action cell. */ onClick?: () => void; /** * Controls the behaviour and appearance of a primary action. * Can be a single action object or an array of action objects. */ primaryAction?: TableActionCellMainActions; /** Controls the behaviour and appearance of secondary actions. */ secondaryActions?: (TableActionCellSecondaryAction | TableActionCellSecondaryDivider)[]; /** Specifies the number of secondary actions to display outside of the popover menu. */ numOfVisibleSecondaryActions?: number; /** Specifies whether secondary actions should be visible all the time. By default secondary actions are visible on row hover only. */ alwaysShowSecondaryActions?: boolean; /** Specifies whether primary actions should be visible all the time. By default primary actions are visible on row hover only. */ alwaysShowPrimaryActions?: boolean; /** Sets the tooltip text of more actions icon button. */ moreActionsTooltipText?: string; /** Controls the appearance of the more actions icon button. */ moreActionsProps?: TableActionCellMoreActionsProps; /** Controls the appearance of the visible inline secondary action icon buttons. */ secondaryActionsProps?: TableActionCellSecondaryActionsProps; /** Controls the appearance of the primary action placeholder icon button. */ primaryActionPlaceholderProps?: TableActionCellPrimaryActionPlaceholderProps; /** Controls the appearance of secondary actions menu with all common popover menu props. */ popoverMenuProps?: TableActionCellPopoverMenuProps; /** Controls the size of action buttons. * @default medium */ size?: TableActionCellSize; } export type HoverSlotDisplay = 'always' | 'onHover' | 'notOnHover'; export interface HoverSlotProps extends React.HTMLAttributes { /** Controls when the slot is visible: always, only while the row is hovered, or only while it isn't. */ display?: HoverSlotDisplay; /** Sets the content of the slot. */ children?: React.ReactNode; } export {}; //# sourceMappingURL=TableActionCell.types.d.ts.map