import type { MouseEvent, ReactNode, KeyboardEvent } from 'react'; import React from 'react'; type AriaLandmarkRoles = 'none' | 'main' | 'navigation' | 'banner' | 'complementary' | 'contentinfo' | 'form' | 'region' | 'search'; type Html5Tag = 'main' | 'div' | 'section' | 'article' | 'aside' | 'nav' | 'header' | 'footer'; interface BaseProps { /** * Unique ID for the component */ id?: string; /** * Content of Overlay */ children?: ReactNode; /** * On overlay element mouse click */ onClick?: (e: MouseEvent) => void; /** * Callback function for keydown events on the overlay element to be used with prop `onClick`. * This can be used to handle keyboard interactions, such as closing the overlay with the Escape key. */ onKeyDown?: (e: KeyboardEvent) => void; /** * Allows to set DOM node to which Overlay component will be appended. The node must already exist. * Use `false` to render in place without use of `createPortal` * * For more information about `createPortal`, see https://react.dev/reference/react-dom/createPortal * * @default 'body' */ portalContainer?: string | false; /** * Allows to hide application from assistive screenreaders and other assistive technologies while the Overlay is shown * * @default '#__next' */ appElement?: string; /** * Allows to set `overflow: hidden` CSS attribute to body element * * @default true */ preventBodyScroll?: boolean; /** * Allows to pass testid string for testing purposes */ 'data-testid'?: string; /** * Allows to pass a custom className */ className?: string; /** * Specifies the HTML5 tag to be used for the content wrapper. * It is recommended to use native semantic HTML elements whenever possible. * If a suitable semantic element is not available, a `
` with an appropriate ARIA role should be used (role from `role`). * ARIA roles from https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Reference/Roles * * @param {Html5Tag} main Uses `
` tag for the content wrapper. * @param {Html5Tag} div Uses `
` tag for the content wrapper. * @param {Html5Tag} section Uses `
` tag for the content wrapper. * @param {Html5Tag} article Uses `
` tag for the content wrapper. * @param {Html5Tag} aside Uses `