Skip to content

Commit

Permalink
types(Modal): fix type of close event for Modal
Browse files Browse the repository at this point in the history
it can be either a MouseEvent of clicking a button ("x" close button), clicking on a div (backdrop), or clicking with the keyboard on Escape key
  • Loading branch information
YossiSaadi committed Sep 10, 2024
1 parent 216d786 commit bb7dbe0
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/core/src/components/ModalNew/Modal/Modal.types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ import { ModalTopActionsProps } from "../ModalTopActions/ModalTopActions.types";

export type ModalSize = "small" | "medium" | "large";

export type ModalCloseEvent =
| React.MouseEvent<HTMLDivElement | HTMLButtonElement>
| React.KeyboardEvent<HTMLDivElement>;

export interface ModalProps extends VibeComponentProps {
id: string;
show: boolean;
size?: ModalSize;
closeButtonTheme?: ModalTopActionsProps["color"];
closeButtonAriaLabel?: ModalTopActionsProps["closeButtonAriaLabel"];
onClose?: ModalTopActionsProps["onClose"];
onClose?: (e: ModalCloseEvent) => void;
renderHeaderAction?: ModalTopActionsProps["renderAction"];
children: React.ReactNode;
}

0 comments on commit bb7dbe0

Please sign in to comment.