@bonprix-ds/react-alert 1.0.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.
- package/dist/index.d.ts +35 -0
- package/dist/index.js +8909 -0
- package/dist/index.js.map +1 -0
- package/package.json +51 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
|
|
3
|
+
declare const Alert: FC<AlertProps>;
|
|
4
|
+
export default Alert;
|
|
5
|
+
|
|
6
|
+
export declare interface AlertProps {
|
|
7
|
+
/** Toggles the visibility of the component. Must be used in conjunction with `onClose`. */
|
|
8
|
+
isOpen: boolean;
|
|
9
|
+
/** The status of the alert. The colors and the icon of the component will adjust appropriately to signal the status level.*/
|
|
10
|
+
status: StatusLevel;
|
|
11
|
+
/** The message of the alert. */
|
|
12
|
+
children: string;
|
|
13
|
+
/** Callback, which is triggered when the visibility of the component (opened/closed) changes. Should be used to control the component from the outside, if the user clicks on the close icon. */
|
|
14
|
+
onClose?: () => void;
|
|
15
|
+
/** Variant of the alert. Depends on the prominence level you require. */
|
|
16
|
+
variant?: VariantValue;
|
|
17
|
+
/** An optional title of the alert. The titel sums up the message briefly. */
|
|
18
|
+
title?: string;
|
|
19
|
+
/** Controls, if the close icon should be shown. When the alert shoulnd't be closed actively, this property can be set to `false`. */
|
|
20
|
+
showCloseIcon?: boolean;
|
|
21
|
+
/** Removes role="alert" from component if set to `true`. The alert content is not read by assistive technologies right away then. */
|
|
22
|
+
nonCritical?: boolean;
|
|
23
|
+
/** If `title` is used, you can define the used header element. */
|
|
24
|
+
titleTag?: "h1" | "h2" | "h3" | "h4" | "h5" | "h6";
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export declare const levels: readonly ["success", "info", "warning", "error"];
|
|
28
|
+
|
|
29
|
+
declare type StatusLevel = (typeof levels)[number];
|
|
30
|
+
|
|
31
|
+
export declare const values: readonly ["primary", "secondary"];
|
|
32
|
+
|
|
33
|
+
declare type VariantValue = (typeof values)[number];
|
|
34
|
+
|
|
35
|
+
export { }
|