Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
32 lines
1.0 KiB
Plaintext
32 lines
1.0 KiB
Plaintext
import type { Options } from 'focus-trap';
|
|
import React, { ElementType, HTMLProps } from 'react';
|
|
import { IModalContext } from '../ModalProvider/context.js';
|
|
export type ModalPropsWithContext = ModalProps & {
|
|
modal?: IModalContext;
|
|
};
|
|
export type ChildFunction = (propsWithContext: ModalPropsWithContext) => React.ReactNode;
|
|
export interface ModalProps extends Omit<HTMLProps<HTMLElement>, 'children'> {
|
|
slug: string;
|
|
closeOnBlur?: boolean;
|
|
lockBodyScroll?: boolean;
|
|
htmlElement?: ElementType;
|
|
classPrefix?: string;
|
|
onOpen?: () => void;
|
|
onClose?: () => void;
|
|
onEnter?: () => void;
|
|
onEntered?: () => void;
|
|
onEntering?: () => void;
|
|
onExit?: () => void;
|
|
onExiting?: () => void;
|
|
onExited?: () => void;
|
|
openOnInit?: boolean;
|
|
children?: React.ReactNode | ChildFunction;
|
|
trapFocus?: boolean;
|
|
focusTrapOptions?: Options;
|
|
}
|
|
export declare const Modal: React.FC<ModalProps & {
|
|
modal?: IModalContext;
|
|
} & {
|
|
children?: React.ReactNode | ChildFunction;
|
|
}>;
|