@helpwave/hightide
Version:
helpwave's component and theming library
39 lines (36 loc) • 1.41 kB
text/typescript
import * as react_jsx_runtime from 'react/jsx-runtime';
import { PropsWithChildren } from 'react';
import { SolidButtonColor } from '../Button.mjs';
import { PropsForTranslation } from '../../hooks/useTranslation.mjs';
import { ModalProps } from './Modal.mjs';
import '../../hooks/useLanguage.mjs';
type ConfirmDialogTranslation = {
confirm: string;
cancel: string;
decline: string;
};
type ConfirmDialogType = 'positive' | 'negative' | 'neutral';
type ButtonOverwriteType = {
text?: string;
color?: SolidButtonColor;
disabled?: boolean;
};
type ConfirmDialogProps = ModalProps & {
isShowingDecline?: boolean;
requireAnswer?: boolean;
onCancel?: () => void;
onConfirm: () => void;
onDecline?: () => void;
confirmType?: ConfirmDialogType;
/**
* Order: Cancel, Decline, Confirm
*/
buttonOverwrites?: [ButtonOverwriteType, ButtonOverwriteType, ButtonOverwriteType];
};
/**
* A Dialog for asking the user for Confirmation
*
* To require an answer omit the onBackgroundClick
*/
declare const ConfirmDialog: ({ overwriteTranslation, children, onCancel, onConfirm, onDecline, confirmType, buttonOverwrites, ...restProps }: PropsForTranslation<ConfirmDialogTranslation, PropsWithChildren<ConfirmDialogProps>>) => react_jsx_runtime.JSX.Element;
export { type ButtonOverwriteType, ConfirmDialog, type ConfirmDialogProps, type ConfirmDialogType };