@muraldevkit/ui-toolkit 2.71.0 → 2.72.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useAutoClose';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export type useAutoClose = (shouldAutoClose?: boolean, closeAfterMs?: number, onClose?: () => unknown) => [boolean, React.Dispatch<React.SetStateAction<boolean>>];
|
|
3
|
+
/**
|
|
4
|
+
* Hook that exposes a piece of state that allows components to close themselves after a delay
|
|
5
|
+
*
|
|
6
|
+
* @param shouldAutoClose - When false prevents automated close (e.g. can be used to prevent auto-dismissal of interactive elements, an accessibility anti-pattern)
|
|
7
|
+
* @param closeAfterMs - Delay in milliseconds before the component closes
|
|
8
|
+
* @param onClose - Callback to be called when component closes
|
|
9
|
+
* @returns [closed, setClosed] - a boolean tracking closed state, and a setter for that same state
|
|
10
|
+
*/
|
|
11
|
+
export declare const useAutoClose: useAutoClose;
|