@madie/madie-design-system 1.2.55 → 1.2.56
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/components/MadieAlert/index.jsx +1 -1
- package/components/MadieDeleteDialog/MadieDeleteDialog.stories.js +24 -0
- package/components/MadieDeleteDialog/index.jsx +6 -4
- package/dist/browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.js +1 -1
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
- package/test/components/MadieDeleteDialog.test.js +27 -0
|
@@ -41,3 +41,27 @@ export const DeleteDialog = () => {
|
|
|
41
41
|
</div>
|
|
42
42
|
);
|
|
43
43
|
};
|
|
44
|
+
|
|
45
|
+
export const DeleteDialogNoWarning = () => {
|
|
46
|
+
const [open, setOpen] = useState(false);
|
|
47
|
+
const onClose = () => {
|
|
48
|
+
setOpen(false);
|
|
49
|
+
};
|
|
50
|
+
const onContinue = () => {
|
|
51
|
+
setOpen(false);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
return (
|
|
55
|
+
<div className="qpp-u-padding--16" style={{ width: 300 }}>
|
|
56
|
+
<Button variant="cyan" onClick={() => setOpen(true)}>
|
|
57
|
+
open Dialog
|
|
58
|
+
</Button>
|
|
59
|
+
<MadieDeleteDialog
|
|
60
|
+
open={open}
|
|
61
|
+
onContinue={onContinue}
|
|
62
|
+
onClose={onClose}
|
|
63
|
+
hideWarning={true}
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
);
|
|
67
|
+
};
|
|
@@ -37,10 +37,12 @@ const MadieDeleteDialog = ({
|
|
|
37
37
|
<span className="strong">{otherDialogProps.name}</span>?
|
|
38
38
|
</p>
|
|
39
39
|
</section>
|
|
40
|
-
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
{otherDialogProps.hideWarning !== true && (
|
|
41
|
+
<section className="dialog-warning-action">
|
|
42
|
+
<ErrorIcon />
|
|
43
|
+
<p>This Action cannot be undone.</p>
|
|
44
|
+
</section>
|
|
45
|
+
)}
|
|
44
46
|
</div>
|
|
45
47
|
</MadieDialog>
|
|
46
48
|
);
|