@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@madie/madie-design-system",
3
- "version": "1.2.50",
3
+ "version": "1.2.52",
4
4
  "description": "Shared style guide across the Madie program.",
5
5
  "main": "dist/index.js",
6
6
  "homepage": "https://github.com/MeasureAuthoringTool/madie-design-system",
@@ -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;