@sc4rfurryx/proteusjs
Version:
The Modern Web Development Framework for Accessible, Responsive, and High-Performance Applications. Intelligent container queries, fluid typography, WCAG compliance, and performance optimization.
34 lines (32 loc) • 862 B
TypeScript
/**
* @sc4rfurryx/proteusjs/popover
* HTML Popover API wrapper with robust focus/inert handling
*
* @version 2.0.0
* @author sc4rfurry
* @license MIT
*/
interface PopoverOptions {
type?: 'menu' | 'dialog' | 'tooltip';
trapFocus?: boolean;
restoreFocus?: boolean;
closeOnEscape?: boolean;
onOpen?: () => void;
onClose?: () => void;
}
interface PopoverController {
open(): void;
close(): void;
toggle(): void;
destroy(): void;
}
/**
* Unified API for menus, tooltips, and dialogs using the native Popover API
* with robust focus/inert handling
*/
declare function attach(trigger: Element | string, panel: Element | string, opts?: PopoverOptions): PopoverController;
declare const _default: {
attach: typeof attach;
};
export { attach, _default as default };
export type { PopoverController, PopoverOptions };