UNPKG

@workday/canvas-kit-react

Version:

The parent module that contains all Workday Canvas Kit React components

31 lines 1.57 kB
import React from 'react'; /** * This hook will hide all sibling elements from assistive technology. Very useful for modal * dialogs. This will set `aria-hidden` for sibling elements of the provided PopupModel's * `state.stackRef` element and restore the previous `aria-hidden` to each component when the * component is unmounted. For example, if added to a Modal component, all children of * `document.body` will have an `aria-hidden=true` applied _except_ for the provided `stackRef` * element (the Modal). This will effectively hide all content outside the Modal from assistive * technology including Web Rotor for VoiceOver for example. * * This should be used on popup elements that need to hide content (i.e. Modals). */ export declare const useAssistiveHideSiblings: import("@workday/canvas-kit-react/common").BehaviorHook<{ state: { stackRef: React.RefObject<HTMLDivElement>; targetRef: React.RefObject<HTMLButtonElement>; initialFocusRef: React.RefObject<any> | undefined; returnFocusRef: React.RefObject<any> | undefined; placement: import("@popperjs/core").Placement; id: string; visibility: "hidden" | "visible"; }; events: { updatePlacement(data: { placement: import("@popperjs/core").Placement; }): void; show(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void; hide(event?: Event | React.SyntheticEvent<Element, Event> | undefined): void; }; }, {}>; //# sourceMappingURL=useAssistiveHideSiblings.d.ts.map