stream-chat-react
Version:
React components to create chat conversations or livestream style chat
21 lines (20 loc) • 968 B
TypeScript
import type { ComponentProps, PropsWithChildren } from 'react';
import React from 'react';
import type { PopperLikePlacement } from './hooks';
export interface DialogAnchorOptions {
open: boolean;
placement: PopperLikePlacement;
referenceElement: HTMLElement | null;
allowFlip?: boolean;
}
export declare function useDialogAnchor<T extends HTMLElement>({ allowFlip, open, placement, referenceElement, }: DialogAnchorOptions): {
setPopperElement: React.Dispatch<React.SetStateAction<T | null>>;
styles: React.CSSProperties;
};
export type DialogAnchorProps = PropsWithChildren<Partial<DialogAnchorOptions>> & {
id: string;
dialogManagerId?: string;
focus?: boolean;
trapFocus?: boolean;
} & ComponentProps<'div'>;
export declare const DialogAnchor: ({ allowFlip, children, className, dialogManagerId, focus, id, placement, referenceElement, tabIndex, trapFocus, ...restDivProps }: DialogAnchorProps) => React.JSX.Element | null;