import { HTMLAttributes, ReactElement, ReactNode } from 'react';
import { ItemInterface, ReactSortableProps, Sortable, Store } from 'react-sortablejs';
import { IconName } from '../Icon/Icon.types';
export type FileTabStatusType = 'default' | 'success' | 'neutral' | 'danger' | 'warning' | 'info';
export interface FileTabProps extends Omit, 'children'> {
onClose?: () => void;
index: number;
status?: FileTabStatusType;
icon?: IconName | ReactNode;
text: string;
/** Prefix for `data-testid`: the tab gets `-`. */
testId?: string;
/** Shows the tab as a preview, in italics. */
preview?: boolean;
}
export interface FileTabsProps extends Omit, 'onSelect' | 'list' | 'setList'> {
selectedIndex?: number;
/** `FileTabs.Tab` elements. */
children: ReactElement | ReactElement[];
/** Called when a tab is dragged to a new position. */
onReorderTab: (sourcePosition: number, destinationPosition: number) => void;
onClose: (index: number) => void;
onSelect: (index: number) => void;
/** Sortable items, one per tab. Built from `children` when omitted. */
list?: ItemInterface[];
/** Setter for a controlled `list`. */
setList?: (newState: ItemInterface[], sortable: Sortable | null, store: Store) => void;
}