import React from "react"; import { PaddingProps } from "styled-system"; import { TagProps } from "../../__internal__/utils/helpers/tags/tags"; import { BoxProps } from "../box"; type Size = "small" | "medium" | "large"; export interface RenderOpenProps { /** * @deprecated * The tabIndex prop is no longer required for the open button. */ tabIndex?: number; isOpen?: boolean; "data-element"?: string; onClick: (ev: React.KeyboardEvent | React.MouseEvent) => void; ref: React.RefObject; "aria-label"?: string; id?: string; "aria-expanded": boolean; "aria-haspopup": "dialog"; "data-popover-container-button"?: string; children: React.ReactNode; size: Size; } export declare const renderOpen: ({ onClick, "data-element": dataElement, ref, id, "aria-expanded": ariaExpanded, "aria-haspopup": ariaHasPopup, children, isOpen, size, }: RenderOpenProps) => React.JSX.Element; export interface RenderCloseProps { "data-element"?: string; /** * @deprecated * The tabIndex prop is no longer required for the close button. */ tabIndex?: number; onClick: (ev: React.KeyboardEvent | React.MouseEvent) => void; ref: React.RefObject; "aria-label": string; closeButtonDataProps?: Pick; } export declare const renderClose: ({ "data-element": dataElement, onClick, ref, "aria-label": ariaLabel, closeButtonDataProps, }: RenderCloseProps) => React.JSX.Element; type Position = "left" | "right" /** @deprecated "center" is deprecated and will be removed in a future release */ | "center"; export interface PopoverContainerProps extends PaddingProps, TagProps { /** * A function that will render the open component. * * Please note that tabIndex is deprecated and no longer required for the open button. * * `({isOpen, data-element, onClick, ref, aria-label}) => ()` * */ renderOpenComponent?: (args: RenderOpenProps) => JSX.Element; /** * A function that will render the close component. * * Please note that tabIndex is deprecated and no longer required for the close button. * * `({data-element, tabIndex, onClick, ref, aria-label}) => ()` */ renderCloseComponent?: (args: RenderCloseProps) => JSX.Element; /** The content of the popover-container */ children?: React.ReactNode; /** * Sets rendering position of dialog. * Please note the 'center' position is deprecated. * */ position?: Position; /** The popover offset from the reference element */ offset?: number; /** Sets the popover container dialog header name */ title?: string; /** * Sets the border radius of the popover container * @deprecated the `borderRadius` prop is being deprecated and will be removed in a future release. * */ borderRadius?: BoxProps["borderRadius"]; /** Callback fires when close icon clicked */ onClose?: (ev: React.KeyboardEvent | React.MouseEvent | React.FocusEvent | Event) => void; /** if `true` the popover-container is open */ open?: boolean; /** Callback fires when open component is clicked */ onOpen?: (ev: React.KeyboardEvent | React.MouseEvent) => void; /** if `true` the popover-container will cover open button */ shouldCoverButton?: boolean; /** The id of the element that describe the dialog. */ ariaDescribedBy?: string; /** * @deprecated * Accessible label passed to custom open button renderers. The default open button is named by its visible text. * Please note this prop is no longer passed as the default button has text. If you are using an icon only button, * set the aria-label on your custom button instead. * */ openButtonAriaLabel?: string; /** * Close button aria label * */ closeButtonAriaLabel?: string; /** * Data tag prop bag for close Button */ closeButtonDataProps?: Pick; /** Container aria label */ containerAriaLabel?: string; /** Disables the animation for the component */ disableAnimation?: boolean; /** Flag to enable fullWidth Button styles */ hasFullWidth?: boolean; /** Sets the roundness of the popover container corners*/ roundness?: "moderate" | "curved"; /** Sets the size of the popover container. */ size?: Size; } export type PopoverContainerHandle = { focusButton: () => void; } | null; export declare const PopoverContainer: React.ForwardRefExoticComponent>; export default PopoverContainer;