@muraldevkit/ui-toolkit 2.75.0 → 2.76.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.
|
@@ -3,6 +3,7 @@ import { AttrsObject } from '../../../utils';
|
|
|
3
3
|
import { NotificationKind, NotificationIconConfig, NotificationScope, NotificationState, NotificationLevel } from '../constants';
|
|
4
4
|
import { DSIconType } from '../..';
|
|
5
5
|
import './MrlBlockNotification.global.scss';
|
|
6
|
+
import { useAutoClose } from '../../../hooks/useAutoClose';
|
|
6
7
|
export interface MrlBlockNotificationProps {
|
|
7
8
|
/**
|
|
8
9
|
* Block Notification Wrapper Class
|
|
@@ -14,6 +15,10 @@ export interface MrlBlockNotificationProps {
|
|
|
14
15
|
closeQa?: string;
|
|
15
16
|
/**
|
|
16
17
|
* Children
|
|
18
|
+
*
|
|
19
|
+
* IMPORTANT! — Make sure to set shouldAutoClose: false if children of this component
|
|
20
|
+
* contain interactive elements. Autoclosing interactive elements is an accessibility
|
|
21
|
+
* anti-pattern and should be avoided.
|
|
17
22
|
*/
|
|
18
23
|
children?: ReactNode;
|
|
19
24
|
/**
|
|
@@ -73,6 +78,18 @@ export interface MrlBlockNotificationProps {
|
|
|
73
78
|
* Example usage: html attributes, custom data attributes (data-qa), aria
|
|
74
79
|
*/
|
|
75
80
|
attrs?: AttrsObject;
|
|
81
|
+
/**
|
|
82
|
+
* When false prevents automated close (e.g. can be used to prevent auto-dismissal of interactive elements, an accessibility anti-pattern) (see useAutoClose)
|
|
83
|
+
*/
|
|
84
|
+
shouldAutoClose?: Parameters<useAutoClose>[0];
|
|
85
|
+
/**
|
|
86
|
+
* Delay in milliseconds before the component closes (see useAutoClose)
|
|
87
|
+
*/
|
|
88
|
+
autoCloseAfterMs?: Parameters<useAutoClose>[1];
|
|
89
|
+
/**
|
|
90
|
+
* Callback to be called when component closes (see useAutoClose)
|
|
91
|
+
*/
|
|
92
|
+
onAutoClose?: Parameters<useAutoClose>[2];
|
|
76
93
|
}
|
|
77
94
|
/**
|
|
78
95
|
* Block Notification Component
|