@gemeente-denhaag/alert 0.1.1-alpha.99 → 0.1.2
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 → cjs/index.d.ts} +13 -6
- package/dist/cjs/index.js +4126 -0
- package/dist/index.css +108 -0
- package/dist/index.js +1 -517
- package/dist/mjs/index.d.ts +45 -0
- package/dist/mjs/index.js +4126 -0
- package/package.json +23 -17
- package/dist/.tsbuildinfo +0 -1
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import './index.scss';
|
|
3
|
+
export interface AlertProps {
|
|
4
|
+
/**
|
|
5
|
+
* The id attribute is used to specify a unique id for an HTML element.
|
|
6
|
+
*/
|
|
7
|
+
id?: string;
|
|
8
|
+
/**
|
|
9
|
+
* Extend the styles of the component by adding new classes.
|
|
10
|
+
*/
|
|
11
|
+
className?: string;
|
|
12
|
+
/**
|
|
13
|
+
* The title of the alert.
|
|
14
|
+
*/
|
|
15
|
+
title: ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* The main text of the alert.
|
|
18
|
+
*/
|
|
19
|
+
text: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* The variant of the alert, determines which color and icon are displayed.
|
|
22
|
+
*/
|
|
23
|
+
variant: 'error' | 'info' | 'success' | 'warning';
|
|
24
|
+
/**
|
|
25
|
+
* The support icon shown top-left.
|
|
26
|
+
* When left undefined, a default icon corresponding to 'variant' is provided.
|
|
27
|
+
*/
|
|
28
|
+
supportIcon?: React.ReactNode;
|
|
29
|
+
/**
|
|
30
|
+
* The action of the alert, displays a clickable button that will fire this event.
|
|
31
|
+
*/
|
|
32
|
+
action?: {
|
|
33
|
+
buttonText: string;
|
|
34
|
+
onClick: () => void;
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* The action of the alert, displays a clickable CloseIcon Button that will fire this event.
|
|
38
|
+
*/
|
|
39
|
+
close?: () => void;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Primary UI component for user interaction
|
|
43
|
+
*/
|
|
44
|
+
export declare const Alert: ({ id, title, text, variant, action, close, supportIcon, className }: AlertProps) => React.JSX.Element;
|
|
45
|
+
export default Alert;
|