import { FASTElement } from "@microsoft/fast-element"; import type { TeachingBubblePlacement, TeachingBubbleSize } from "./teaching-bubble.options.js"; /** * TeachingBubble * @summary A customizable teaching bubble component for providing contextual help or instruction. * * @example * ```html * * Image content * Close button * Heading content *
Default content
* Footer content *
* ``` * * @attr {string} target - The ID of the target element for the teaching bubble. * @attr {TeachingBubblePlacements} placement - The placement of the teaching bubble. * @attr {boolean} open - Controls whether the teaching bubble is open. * @attr {boolean} disable-trap-focus - Controls whether trap focus is disabled. * @attr {TeachingBubbleSize} size - The size of the teaching bubble. * * @prop {ElementInternals} elementInternals - The internal ElementInternals instance for the component. * * @slot image - Slot for adding an image inside the teaching bubble. * @slot close - Slot for adding a close button inside the teaching bubble. * @slot heading - Slot for adding a heading inside the teaching bubble. * @slot default - Default slot for adding content inside the teaching bubble. * @slot footer - Slot for adding a footer inside the teaching bubble. * * @csspart image - Style part for the image inside the teaching bubble. * @csspart content - Style part for the content inside the teaching bubble. * @csspart close - Style part for the close button inside the teaching bubble. * @csspart heading - Style part for the heading inside the teaching bubble. * @csspart footer - Style part for the footer inside the teaching bubble. * @csspart arrow - Style part for the arrow of the teaching bubble. * * @method show() - Shows the teaching bubble. * @method hide(dismiss: boolean) - Hides the teaching bubble, optionally dismissing it. * @method openChanged() - Handles changes to the open attribute. * * @fires open-change - Fires when the 'open' attribute changes. * @fires dismiss - Fires when the teaching bubble is dismissed. * * @extends FASTElement * @tagname fabric-teaching-bubble * @public */ export declare class TeachingBubble extends FASTElement { /** * Called when the element is connected to the DOM. * @public */ connectedCallback(): void; /** * Called when the element is disconnected from the DOM. * @public */ disconnectedCallback(): void; /** * The ID of the target element for the teaching bubble. * @public * @attr target * @type {string} */ target: string; /** * The placement of the teaching bubble. * @public * @type {TeachingBubblePlacement} * @attr placement * @default auto (via Floating UI autoPlacement) */ placement?: TeachingBubblePlacement; /** * Indicates whether the teaching bubble is open. * @public * @attr open * @type {boolean} */ open?: boolean; /** * Indicates whether trap focus is disabled. * @public * @attr disable-trap-focus * @type {boolean} * @default false */ disableTrapFocus?: boolean; /** * The size of the teaching bubble. * @public * @attr * @type {TeachingBubbleSize} * @default medium */ size?: TeachingBubbleSize; /** * The internal ElementInternals instance for the component. * @public */ elementInternals: ElementInternals; /** * The target element for the teaching bubble. * @private * @type {HTMLElement | null} */ private targetEl?; /** * The arrow element of the teaching bubble. * @public * @type {HTMLElement | null} */ arrowEl?: HTMLElement | null; /** * Indicates whether the teaching bubble is trapping focus. * @private * @type {boolean} * @default false */ private isTrappingFocus; /** * Indicates whether a focus operation is currently in progress. * Used to prevent infinite recursion in focus handling. * @private * @type {boolean} * @default false */ private focusInProgress; /** * Indicates whether the teaching bubble should trap focus. * @private * @type {boolean} * @default false */ private trapFocus; /** * Function to clean up auto updates. * @private * @type {() => void | null} */ private cleanAutoUpdate; /** * Static registry of open TeachingBubble instances. */ private static openInstances; /** * Shows the teaching bubble. * @public */ show: () => void; /** * Hides the teaching bubble. * @public * @param {boolean} - Indicates whether the bubble should be dismissed. * @fires dismiss - Fires when the teaching bubble is dismissed. */ hide: (dismiss?: boolean) => void; /** * Handles changes to the open attribute. * @public * @fires open-change - Emitted when the open attribute changes. */ openChanged(): void; /** * Sets the target, current, and arrow elements. * @private */ private setElements; /** * Updates the position of the teaching bubble. * @private */ private updatePosition; /** * Handles keydown events on the document. * @private * @param {KeyboardEvent} e - The keyboard event. */ private handleDocumentKeydown; /** * Handles the tab keydown event. * @private * @param {KeyboardEvent} e - The keyboard event. */ private handleTabKeyDown; /** * Gets the bounds of the tab queue. * @private * @returns {(HTMLElement | SVGElement)[]} */ private getTabQueueBounds; /** * Reduces tabbable items to a list of elements. * @private * @param {HTMLElement[]} elements - The current list of elements. * @param {FASTElement} element - The current element to check. * @returns {HTMLElement[]} */ private reduceTabbableItems; /** * Determines if a FAST element is focusable. * @private * @static * @param {FASTElement} element - The element to check. * @returns {boolean} */ private static isFocusableFastElement; /** * Updates the focus trap state. * @private * @param {boolean} [shouldTrapFocusOverride] - Optional override for whether to trap focus. */ private updateTrapFocus; /** * Handles focus moving out of the component; re-focus inside when trapping. * @private */ private handleFocusOut; /** * Focuses the first element in the tab queue. * @private */ private focusFirstElement; /** * Determines if the focus should be forced to the teaching bubble. * @private * @param {Element | null} currentFocusElement - The current focused element. * @returns {boolean} */ private shouldForceFocus; /** * Determines if the teaching bubble should trap focus. * @private * @returns {boolean} */ private shouldTrapFocus; /** * Handles the trap focus disable state. * @private */ private disableTrapFocusHandler; /** * Initializes the position of the teaching bubble. * @private */ private initializePosition; } //# sourceMappingURL=teaching-bubble.d.ts.map