@cmk/fe_utils
Version:
frontend utility library
70 lines (68 loc) • 2.73 kB
TypeScript
import { ReactNode } from 'react';
import { DialogProps } from '@mui/material/Dialog';
import { DialogActionsProps } from '@mui/material/DialogActions';
import { DialogContentProps } from '@mui/material/DialogContent';
import { BoxProps, PaperProps, StackProps, TooltipProps, TypographyProps } from '@mui/material';
import { TransitionProps } from '@mui/material/transitions';
import { IconProps } from '@mdi/react/dist/IconProps';
import { FlexProps } from '../_wrapper';
import { CButtonProps } from '../buttons/Button';
export type CModalBaseProps = Omit<DialogProps, 'open' | 'onClose' | 'maxWidth' | 'PaperProps' | 'slotProps'> & {
buttonBorderRadiuses?: number;
borderRadius?: number;
open: boolean;
header: ReactNode;
isConfirmation?: boolean;
onConfirm?: (data?: unknown) => void;
confirmationIcon?: ReactNode;
confirmationDisabled?: boolean;
confirmationLabel?: string;
cancelConfirmationLabel?: string;
cancelConfirmationIcon?: ReactNode;
onClose?: () => void;
maxWidth?: number;
width?: number;
onSecondaryAction?: () => void;
secondaryActionLabel?: string;
secondaryActionIcon?: ReactNode;
placeNonConfirmationButtonOnLeft?: boolean;
nonConfirmationLabel?: string;
minHeight?: string | number;
disableCloseOnConfirmation?: boolean;
hideConfirmationButton?: boolean;
minWidth?: string | number;
height?: string | number;
loading?: boolean;
subheader?: ReactNode;
confirmationTooltip?: string;
disableTopRightCloseButton?: boolean;
slotProps?: DialogProps['slotProps'] & {
paper?: PaperProps;
cancelConfirmButton?: CButtonProps;
confirmButton?: CButtonProps;
secondaryButton?: CButtonProps;
nonConfirmationButton?: CButtonProps;
dialogContainertransition?: TransitionProps;
headerFlexContainer?: FlexProps;
headerLeftSubcontainer?: BoxProps;
headerLeftSubcontainerSubheader?: BoxProps;
subheaderTypography?: TypographyProps;
closeButtonContainer?: BoxProps;
closeButton?: CButtonProps;
closeIcon?: IconProps;
dialogTitleTypography?: TypographyProps;
dialogContent?: DialogContentProps;
dialogContentText?: BoxProps;
dialogActionsRoot?: DialogActionsProps;
dialogActionsContainer?: StackProps;
dialogLeftActionsContainer?: StackProps;
closButtonTooltip?: TooltipProps;
dialogContentTypography?: TypographyProps;
};
};
export type CModalProps = (CModalBaseProps & {
content: ReactNode;
}) | (CModalBaseProps & {
children: ReactNode;
});
export declare const Modal: (props: CModalProps) => import("react/jsx-runtime").JSX.Element;