stream-chat-react
Version:
React components to create chat conversations or livestream style chat
27 lines (26 loc) • 1.05 kB
TypeScript
import type { Placement } from '@popperjs/core';
import type { ComponentProps, PropsWithChildren } from 'react';
import React from 'react';
export interface DialogAnchorOptions {
open: boolean;
placement: Placement;
referenceElement: HTMLElement | null;
allowFlip?: boolean;
}
export declare function useDialogAnchor<T extends HTMLElement>({ allowFlip, open, placement, referenceElement, }: DialogAnchorOptions): {
attributes: {
[key: string]: {
[key: string]: string;
} | undefined;
};
setPopperElement: React.Dispatch<React.SetStateAction<T | null>>;
styles: {
[key: string]: React.CSSProperties;
};
};
export type DialogAnchorProps = PropsWithChildren<Partial<DialogAnchorOptions>> & {
id: string;
focus?: boolean;
trapFocus?: boolean;
} & ComponentProps<'div'>;
export declare const DialogAnchor: ({ allowFlip, children, className, focus, id, placement, referenceElement, tabIndex, trapFocus, ...restDivProps }: DialogAnchorProps) => React.JSX.Element | null;