@muraldevkit/ui-toolkit 2.74.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
@@ -2,7 +2,7 @@ import { DSIconType } from '../..';
2
2
  export declare const allowedValues: {
3
3
  kinds: readonly ["info", "success", "warning", "error", "private", "general"];
4
4
  levels: readonly ["2", "3", "4", "5", "6"];
5
- scopes: readonly ["page", "component"];
5
+ scopes: readonly ["page", "component", "inline"];
6
6
  states: readonly ["open", "close"];
7
7
  };
8
8
  export type NotificationKind = (typeof allowedValues.kinds)[number];
@@ -115,7 +115,7 @@ export declare const colorPictoStoryData: {
115
115
  export declare const animateStoryData: {
116
116
  args: {
117
117
  delay: number;
118
- state: "play" | "stop";
118
+ state: "stop" | "play";
119
119
  };
120
120
  argTypes: {
121
121
  delay: {