UNPKG

stream-chat-react

Version:

React components to create chat conversations or livestream style chat

27 lines 1.73 kB
import React, { type ComponentProps, type ComponentType, type PropsWithChildren } from 'react'; export type ModalCloseEvent = KeyboardEvent | React.KeyboardEvent | React.MouseEvent<HTMLButtonElement | HTMLDivElement>; export type ModalCloseSource = 'overlay' | 'button' | 'escape'; export type ModalProps = { /** If true, modal is opened or visible. */ open: boolean; /** Custom class to be applied to the modal root div */ className?: string; /** Optional stable id for this modal instance. Generated automatically when omitted. */ dialogId?: string; /** Accessible label for the modal dialog. Ignored when aria-labelledby is provided. */ 'aria-label'?: string; /** ID of the element that labels the modal dialog. */ 'aria-labelledby'?: string; /** ID of the element that describes the modal dialog. */ 'aria-describedby'?: string; /** ARIA role for the modal dialog surface. */ role?: 'alertdialog' | 'dialog'; /** If provided, the close button is rendered on overlay */ CloseButtonOnOverlay?: ComponentType<ComponentProps<'button'>>; /** Callback handler for closing of modal. */ onClose?: (event: ModalCloseEvent) => void; /** Optional handler to intercept closing logic. Return false to prevent onClose. */ onCloseAttempt?: (source: ModalCloseSource, event: ModalCloseEvent) => boolean; }; export declare const GlobalModal: ({ "aria-describedby": ariaDescribedby, "aria-label": ariaLabel, "aria-labelledby": ariaLabelledby, children, className, CloseButtonOnOverlay, dialogId, onClose, onCloseAttempt, open, role, }: PropsWithChildren<ModalProps>) => import("react/jsx-runtime").JSX.Element | null; //# sourceMappingURL=GlobalModal.d.ts.map