@madie/madie-design-system 1.2.50 → 1.2.52
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/MadieDialog/MadieDialog.stories.js +45 -0
- package/components/MadieDialog/index.jsx +2 -2
- package/components/index.js +2 -0
- package/dist/browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.js +13 -13
- package/dist/react/index.js.map +1 -1
- package/package.json +1 -1
- package/test/components/MadieDialog.test.js +33 -0
- package/themes/actionCenterTheme.js +31 -0
package/package.json
CHANGED
|
@@ -143,4 +143,37 @@ describe("Madie Dialog", () => {
|
|
|
143
143
|
// only one button should be there i.e. cancel model icon at top right corner
|
|
144
144
|
expect(queryAllByRole("button")).toHaveLength(1);
|
|
145
145
|
});
|
|
146
|
+
|
|
147
|
+
it("It renders of type form with required components and hides the continue button", async () => {
|
|
148
|
+
const { getByTestId, queryByText, queryByTestId } = render(
|
|
149
|
+
<div>
|
|
150
|
+
<MadieDialog
|
|
151
|
+
form={true}
|
|
152
|
+
title="Basic Form"
|
|
153
|
+
dialogProps={{
|
|
154
|
+
open: true,
|
|
155
|
+
onClose: onFormCancel,
|
|
156
|
+
onSubmit: onFormSubmit,
|
|
157
|
+
maxWidth: "sm",
|
|
158
|
+
showRequiredFieldMessage: true,
|
|
159
|
+
}}
|
|
160
|
+
cancelButtonProps={{
|
|
161
|
+
id: "cancelBtn",
|
|
162
|
+
"data-testid": "form-cancel-button",
|
|
163
|
+
variant: "secondary",
|
|
164
|
+
cancelText: "Cancel",
|
|
165
|
+
}}
|
|
166
|
+
continueButtonProps={""}
|
|
167
|
+
>
|
|
168
|
+
<div>this is a form message</div>
|
|
169
|
+
</MadieDialog>
|
|
170
|
+
</div>
|
|
171
|
+
);
|
|
172
|
+
expect(getByTestId("dialog-form")).toBeInTheDocument();
|
|
173
|
+
expect(queryByText("Indicates required field")).toBeInTheDocument();
|
|
174
|
+
const cancelButton = getByTestId("close-button");
|
|
175
|
+
const submitButton = queryByTestId("form-continue-button");
|
|
176
|
+
expect(cancelButton).toBeInTheDocument();
|
|
177
|
+
expect(submitButton).not.toBeInTheDocument();
|
|
178
|
+
});
|
|
146
179
|
});
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { createTheme } from '@mui/material/styles';
|
|
2
|
+
|
|
3
|
+
import { red } from '@mui/material/colors';
|
|
4
|
+
|
|
5
|
+
const theme = createTheme({
|
|
6
|
+
zIndex: {
|
|
7
|
+
appBar: 1251,
|
|
8
|
+
tooltip: 1250,
|
|
9
|
+
},
|
|
10
|
+
palette: {
|
|
11
|
+
primary: {
|
|
12
|
+
main: '#007bff',
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
components: {
|
|
16
|
+
MuiIconButton: {
|
|
17
|
+
styleOverrides: {
|
|
18
|
+
root: {
|
|
19
|
+
'&.DeleteClass': { color: red[700] },
|
|
20
|
+
'&.Mui-disabled': {
|
|
21
|
+
color: "#8C8C8C",
|
|
22
|
+
},
|
|
23
|
+
color: "#0073C8"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
export default theme;
|