@madie/madie-design-system 1.2.85 → 1.2.87
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/MadieDeleteDialog/MadieDeleteDialog.stories.js +30 -1
- package/components/MadieDeleteDialog/index.jsx +14 -3
- package/components/MadieTooltip/MadieTooltip.stories.js +7 -7
- package/components/MadieTooltip/index.jsx +34 -39
- package/components/TextField/index.jsx +2 -2
- package/dist/browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.js +85 -85
- package/dist/react/index.js.LICENSE.txt +1 -17
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
- package/styles/components/_text.scss +3 -3
- package/test/components/MadieDeleteDialog.test.js +46 -6
- package/test/components/TextField.test.js +20 -54
|
@@ -21,7 +21,6 @@ Wrapper.propTypes = {
|
|
|
21
21
|
const contentWithHtmlTag =
|
|
22
22
|
'<p><strong>test &</strong></p><table class="rich-text-table" style="min-width: 75px"><colgroup><col style="min-width: 25px"><col style="min-width: 25px"><col style="min-width: 25px"></colgroup><tbody><tr><th colspan="1" rowspan="1"><p></p></th><th colspan="1" rowspan="1"><p></p></th><th colspan="1" rowspan="1"><p></p></th></tr><tr><td colspan="1" rowspan="1"><p>table col 1</p></td><td colspan="1" rowspan="1"><p>table col 2</p></td><td colspan="1" rowspan="1"><p>table col 3</p></td></tr><tr><td colspan="1" rowspan="1"><p>table col 4</p></td><td colspan="1" rowspan="1"><p>table col 5</p></td><td colspan="1" rowspan="1"><p>table col 6</p></td></tr></tbody></table><ol><li><p><strong>test2</strong></p></li><li><p><strong>test3</strong></p></li></ol>';
|
|
23
23
|
|
|
24
|
-
|
|
25
24
|
export const DeleteDialog = () => {
|
|
26
25
|
const [open, setOpen] = useState(false);
|
|
27
26
|
const onClose = () => {
|
|
@@ -86,6 +85,7 @@ export const DeleteDialogWithHtmlTags = () => {
|
|
|
86
85
|
hideWarning={true}
|
|
87
86
|
dialogTitle="Delete Measure Reference"
|
|
88
87
|
name={contentWithHtmlTag}
|
|
88
|
+
statement={true}
|
|
89
89
|
/>
|
|
90
90
|
</Wrapper>
|
|
91
91
|
);
|
|
@@ -113,3 +113,32 @@ export const DeleteDialogWithAlternateText = () => {
|
|
|
113
113
|
</Wrapper>
|
|
114
114
|
);
|
|
115
115
|
};
|
|
116
|
+
|
|
117
|
+
export const DeleteDialogWithCustomDialogBody = () => {
|
|
118
|
+
const [open, setOpen] = useState(false);
|
|
119
|
+
const onClose = () => setOpen(false);
|
|
120
|
+
const onContinue = () => setOpen(false);
|
|
121
|
+
|
|
122
|
+
return (
|
|
123
|
+
<Wrapper>
|
|
124
|
+
<Button variant="cyan" onClick={() => setOpen(true)}>
|
|
125
|
+
open Dialog
|
|
126
|
+
</Button>
|
|
127
|
+
<MadieDeleteDialog
|
|
128
|
+
open={open}
|
|
129
|
+
onContinue={onContinue}
|
|
130
|
+
onClose={onClose}
|
|
131
|
+
hideWarning={true}
|
|
132
|
+
dialogTitle="Are you sure?"
|
|
133
|
+
customDialogBody={
|
|
134
|
+
"You are choosing to delete the following Test Case(s)!"
|
|
135
|
+
}
|
|
136
|
+
alternateText="Delete Case(s)"
|
|
137
|
+
statement={true}
|
|
138
|
+
name={
|
|
139
|
+
"<p><ol><li><p><strong>test2</strong></p></li><li><p><strong>test3</strong></p></li></ol></p>"
|
|
140
|
+
}
|
|
141
|
+
/>
|
|
142
|
+
</Wrapper>
|
|
143
|
+
);
|
|
144
|
+
};
|
|
@@ -35,14 +35,25 @@ const MadieDeleteDialog = ({
|
|
|
35
35
|
variant: "danger-primary",
|
|
36
36
|
type: "submit",
|
|
37
37
|
"data-testid": "delete-dialog-continue-button",
|
|
38
|
-
continueText: otherDialogProps.alternateText
|
|
38
|
+
continueText: otherDialogProps.alternateText
|
|
39
|
+
? `${otherDialogProps.alternateText}`
|
|
40
|
+
: "Yes, Delete",
|
|
39
41
|
onClick: onContinue,
|
|
40
42
|
}}
|
|
41
43
|
>
|
|
42
44
|
<div id="delete-dialog-body">
|
|
43
45
|
<section className="dialog-warning-body">
|
|
44
46
|
<p>
|
|
45
|
-
|
|
47
|
+
{otherDialogProps?.customDialogBody ? (
|
|
48
|
+
otherDialogProps.customDialogBody
|
|
49
|
+
) : (
|
|
50
|
+
<>
|
|
51
|
+
Are you sure you want to{" "}
|
|
52
|
+
{otherDialogProps.alternateText
|
|
53
|
+
? otherDialogProps.alternateText.toLowerCase()
|
|
54
|
+
: "delete"}{" "}
|
|
55
|
+
</>
|
|
56
|
+
)}
|
|
46
57
|
<span className="strong">
|
|
47
58
|
{parse(
|
|
48
59
|
otherDialogProps?.name
|
|
@@ -51,7 +62,7 @@ const MadieDeleteDialog = ({
|
|
|
51
62
|
options
|
|
52
63
|
)}
|
|
53
64
|
</span>
|
|
54
|
-
?
|
|
65
|
+
{otherDialogProps?.statement ? "" : "?"}
|
|
55
66
|
</p>
|
|
56
67
|
</section>
|
|
57
68
|
{otherDialogProps.hideWarning !== true && (
|
|
@@ -11,15 +11,15 @@ export default {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export const ExampleTooltip = () => (
|
|
14
|
-
<div>
|
|
15
|
-
<div>
|
|
16
|
-
<MadieTooltip
|
|
14
|
+
<div style={{width: "14px"}}>
|
|
15
|
+
<div style={{width: 20, marginBottom: 20}}>
|
|
16
|
+
<MadieTooltip title="Input the new version #" placement="left"/>
|
|
17
17
|
</div>
|
|
18
|
-
<div style={{
|
|
19
|
-
<MadieTooltip
|
|
18
|
+
<div style={{width: 20, marginBottom: 20}}>
|
|
19
|
+
<MadieTooltip title="Input the new version #" placement="right"/>
|
|
20
20
|
</div>
|
|
21
|
-
<div style={{
|
|
22
|
-
<MadieTooltip
|
|
21
|
+
<div style={{width: 20, marginBottom: 20}}>
|
|
22
|
+
<MadieTooltip title="Input the new version #" placement="bottom"/>
|
|
23
23
|
</div>
|
|
24
24
|
</div>
|
|
25
25
|
);
|
|
@@ -1,49 +1,44 @@
|
|
|
1
|
-
import React
|
|
2
|
-
import TooltipIcon from "../MadieTooltipIcon";
|
|
1
|
+
import React from "react";
|
|
3
2
|
import PropTypes from "prop-types";
|
|
3
|
+
import { Tooltip } from "@mui/material";
|
|
4
|
+
import TooltipIcon from "../MadieTooltipIcon";
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
const MadieToolTip =
|
|
7
|
+
({
|
|
8
|
+
id,
|
|
9
|
+
widthContainer = 14,
|
|
10
|
+
heightContainer = 14,
|
|
11
|
+
...rest
|
|
12
|
+
}) => {
|
|
8
13
|
return (
|
|
9
|
-
<
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
setActiveTip(false);
|
|
25
|
-
}
|
|
26
|
-
}}
|
|
27
|
-
className="madie-tooltip-button"
|
|
28
|
-
onClick={(e) => e.preventDefault()}
|
|
14
|
+
<Tooltip
|
|
15
|
+
placement="bottom"
|
|
16
|
+
arrow
|
|
17
|
+
slotProps={{
|
|
18
|
+
tooltip: {
|
|
19
|
+
sx: {
|
|
20
|
+
zIndex: 99,
|
|
21
|
+
backgroundColor: "#333",
|
|
22
|
+
"& .MuiTooltip-arrow": {
|
|
23
|
+
color: "#333",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
}}
|
|
28
|
+
{...rest}
|
|
29
29
|
>
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
aria-live="polite"
|
|
36
|
-
className={activeTip ? "madie-tooltip" : "madie-tooltip hidden"}
|
|
37
|
-
>
|
|
38
|
-
<p>{tooltipText}</p>
|
|
39
|
-
</div>
|
|
40
|
-
</button>
|
|
41
|
-
);
|
|
30
|
+
<div style={{ width: widthContainer, height: heightContainer}} data-testId={id} id={id}>
|
|
31
|
+
<TooltipIcon />
|
|
32
|
+
</div>
|
|
33
|
+
</Tooltip>
|
|
34
|
+
);
|
|
42
35
|
};
|
|
43
36
|
|
|
37
|
+
|
|
44
38
|
MadieToolTip.propTypes = {
|
|
45
|
-
|
|
46
|
-
|
|
39
|
+
id: PropTypes.string,
|
|
40
|
+
widthContainer: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
41
|
+
heightContainer: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
|
|
47
42
|
};
|
|
48
43
|
|
|
49
44
|
export default MadieToolTip;
|
|
@@ -99,7 +99,7 @@ const TextField = ({
|
|
|
99
99
|
flexGrow: 1,
|
|
100
100
|
}}
|
|
101
101
|
/>
|
|
102
|
-
<div style={{ display: "flex", flexDirection: "row" }}>
|
|
102
|
+
<div style={{ display: "flex", flexDirection: "row", alignItems: "baseline" }}>
|
|
103
103
|
<InputLabel
|
|
104
104
|
disabled={disabled}
|
|
105
105
|
shrink
|
|
@@ -151,7 +151,7 @@ const TextField = ({
|
|
|
151
151
|
</InputLabel>
|
|
152
152
|
{tooltipText && (
|
|
153
153
|
<MadieToolTip
|
|
154
|
-
|
|
154
|
+
title={tooltipText}
|
|
155
155
|
id={`${id}-tooltip`}
|
|
156
156
|
/>
|
|
157
157
|
)}
|