@inkline/inkline
Version:
Inkline is the intuitive UI Components library that gives you a developer-friendly foundation for building high-quality, accessible, and customizable Vue.js 3 Design Systems.
34 lines (33 loc) • 1.07 kB
TypeScript
import type { ComponentPublicInstance, Ref } from 'vue';
import type { Placement, Strategy } from '@floating-ui/dom';
export type PopupEvent = 'hover' | 'click' | 'focus' | 'manual';
export declare function usePopupControl(props: {
triggerRef: Ref<ComponentPublicInstance | HTMLElement | null>;
popupRef: Ref<HTMLElement | null>;
arrowRef: Ref<HTMLElement | null>;
componentProps: Ref<{
disabled?: boolean;
readonly?: boolean;
events: PopupEvent | PopupEvent[];
placement: Placement;
interactable: boolean;
visible?: boolean;
animationDuration: number;
hoverHideDelay: number;
offset: number;
popupOptions?: {
strategy?: Strategy;
};
}>;
emit: (event: any, ...args: any[]) => void;
}): {
visible: Ref<boolean | undefined>;
show: () => void;
hide: () => void;
onClick: () => void;
onClickOutside: () => void;
onKeyEscape: () => void;
focusTrigger: () => void;
createPopup: () => void;
destroyPopup: () => void;
};