import { Cre8Element } from '../cre8-element'; import '../heading/heading'; /** * The Popover is for progressive disclosure of relevant content often hidden behind a help or info icon. * Its content should be no longer than 3-4 lines in addition to a line of heading text and an optional button. * @slot - The component content */ export declare class Cre8Popover extends Cre8Element { static styles: import("lit").CSSResult[]; /** * The heading text that appears at the top of the popover panel. Should only be 2-3 lines max. * @attr {string | undefined} */ heading?: string; /** * Positions the popover panel absolutely to the trigger * - **default** positions the popover panel below the trigger * - **top** positions the popover panel below the trigger * - **left** positions the popover panel below the trigger * - **right** positions the popover panel below the trigger * @attr {string | undefined} */ position?: 'top' | 'left' | 'right'; /** * Set to prevent the popover panel from hiding on scroll * @attr {boolean | undefined} */ isVisibleOnScroll?: boolean; /** * The dynamic state for the popover * - If true, the popover panel placement is determined by its position in the viewport * - If false, the popover panel placement will be placed according to the position value * @attr {boolean | undefined} */ isDynamic?: boolean; /** * The dynamic active state * _This property is dynamically set_ * @attr {boolean | undefined} */ isActiveDynamic?: boolean; /** * The active state for the popover * - If true, the popover panel is visible * - If false, the popover panel is hidden * * _This property is dynamically set_ * @attr {boolean | undefined} */ isActive?: boolean; /** * Query the popover panel element */ _Cre8Popover: HTMLElement; /** * Query the popover panel element */ _Cre8PopoverPanel: HTMLElement; /** * Query the assigned elements in the trigger slot */ _Cre8PopoverTrigger: Array; /** * Query the assigned elements in the footer slot */ _Cre8PopoverFooter: Array; /** * Query the document direction value *

_*This property is dynamically set_ */ get isRTL(): boolean; /** * Connected Callback Lifecycle * 1. Add window resize event listener * 2. Add window scroll event listener * 3. Add window orientation change event listener * 4. Add mousedown event listener */ connectedCallback(): void; /** * Disconnected Callback Lifecycle * 1. Remove window resize event listener * 2. Remove window scroll event listener * 3. Remove window orientation change event listener * 4. Remove mousedown event listener */ disconnectedCallback(): void; /** * First Updated Lifecycle * 1. Set attribute since aria expanded can't be passed down through the slot */ firstUpdated(): void; /** * Add aria attributes on the trigger button * 1. Select the element within the trigger slot * 2. Set aria-expanded on the popover trigger to the active state if provided. Otherwise, set to false. * 3 Set the type to button. */ addAria(): void; /** * Handle all dynamic placement */ dynamicPosition(): void; /** * Set Popover Active State * 1. Toggle the active state between true and false * 2. Set attribute since aria expanded can't be passed down through the slot * 3. If the active state is toggled to false, close the panel and return focus to the dropdown trigger. * This accounts for both design system buttons and native HTML buttons */ private _toggleActive; /** * Handle Keydown * 1. If the panel is open and escape is keyed, close the popover panel and return focus to the trigger button * 2. If the panel is opened, tab away closes the popover panel * 3. The panel can be opened and closed by Enter or Space keys. */ private _handleKeydown; private _handleTabNavigation; private _navigateInsidePopover; private _getFocusableElements; private _closePopoverAndFocusTrigger; /** * Handle click outside the component * 1. Close the show/hide popover panel on click outside * 2. If the popover panel is already closed then we don't care about outside clicks and we can bail early * 3. By the time a user clicks on the page the shadowRoot will almost certainly be * defined, but TypeScript isn't that trusting and sees this.shadowRoot as possibly * undefined. To work around that we'll check that we have a shadowRoot (and a * rendered .host) element here to appease the TypeScript compiler. This should never * actually be shown or run for a human end user. * 4. Check to see if we clicked inside the active panel * 5. If the panel is active and we've clicked outside of the panel then it should be closed. */ handleOnClickOutside: (e: MouseEvent) => void; /** * Remove Active State on Scroll * 1. If a scroll event is fired and visibileOnScroll is not true, remove the active state * 2. If the popover height is less than the window height, then allow the active to remove on scroll */ removeActiveOnScroll: () => void; /** * Remove Active State * 1. If a specific event is fired, remove the active state. */ removeActive: () => void; render(): import("lit-html").TemplateResult<1>; } declare global { interface HTMLElementTagNameMap { 'cre8-popover': Cre8Popover; } } export default Cre8Popover; //# sourceMappingURL=popover.d.ts.map