@wix/design-system
Version:
@wix/design-system
73 lines (62 loc) • 1.98 kB
TypeScript
import * as React from 'react';
import { IconElement, TooltipCommonProps } from '../common';
import { PopoverMenuProps } from '../PopoverMenu';
import { ButtonPriority, ButtonWithAsProp } from '../Button';
type CommonTableActionCellProps = {
dataHook?: string;
primaryAction?: TableActionCellMainActions;
secondaryActions?: (
| TableActionCellSecondaryAction
| TableActionCellSecondaryDivider
)[];
numOfVisibleSecondaryActions?: number;
alwaysShowSecondaryActions?: boolean;
alwaysShowPrimaryActions?: boolean;
moreActionsTooltipText?: string;
size?: 'tiny' | 'small' | 'medium';
};
export type TableActionCellProps = CommonTableActionCellProps & {
popoverMenuProps?: Omit<
PopoverMenuProps,
'triggerElement' | 'children' | 'dataHook' | 'className'
>;
};
export declare const TableActionCell: React.FC<TableActionCellProps>;
export default TableActionCell;
export type TableActionCellPrimaryActionVisibility = 'onHover' | 'always';
type BaseActionProps = {
text: string;
onClick: () => void;
skin?: 'standard' | 'inverted' | 'premium';
disabled?: boolean;
prefixIcon?: IconElement;
suffixIcon?: IconElement;
dataHook?: string;
disabledDescription?: string;
tooltipProps?: TooltipCommonProps;
};
export type TableActionCellMainAction = ButtonWithAsProp<{
priority?: ButtonPriority;
}> &
BaseActionProps;
export type TableActionCellPrimaryAction = ButtonWithAsProp<{
visibility?: TableActionCellPrimaryActionVisibility;
}> &
BaseActionProps;
export type TableActionCellMainActions =
| TableActionCellPrimaryAction
| TableActionCellMainAction[];
export type TableActionCellSecondaryAction = {
text: string;
icon: IconElement;
onClick: () => void;
disabled?: boolean;
disabledDescription?: string;
tooltipProps?: TooltipCommonProps;
skin?: 'dark' | 'destructive' | 'premium';
subtitle?: string;
dataHook?: string;
};
export type TableActionCellSecondaryDivider = {
divider: boolean;
};