@madie/madie-design-system 1.2.42 → 1.2.45
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/AutoComplete/AutoComplete.jsx +1 -0
- package/components/MadieDialog/MadieDialog.stories.js +119 -0
- package/components/MadieDialog/index.jsx +40 -4
- package/components/Modal/HumanReadable.ts +1322 -0
- package/components/Modal/Modal.jsx +16 -0
- package/components/Modal/Modal.stories.js +41 -0
- package/components/Tabs/Tab.js +1 -1
- 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/coverage/clover.xml +0 -6
- package/coverage/coverage-final.json +0 -1
- package/coverage/lcov-report/base.css +0 -224
- package/coverage/lcov-report/block-navigation.js +0 -87
- package/coverage/lcov-report/favicon.png +0 -0
- package/coverage/lcov-report/index.html +0 -101
- package/coverage/lcov-report/prettify.css +0 -1
- package/coverage/lcov-report/prettify.js +0 -2
- package/coverage/lcov-report/sort-arrow-sprite.png +0 -0
- package/coverage/lcov-report/sorter.js +0 -196
- package/coverage/lcov.info +0 -0
- package/doctor-storybook.log +0 -41
- package/migration-storybook.log +0 -329
- package/storybook-static/149.65bbc904.iframe.bundle.js +0 -2
- package/storybook-static/149.65bbc904.iframe.bundle.js.LICENSE.txt +0 -14
- package/storybook-static/164.e319e208c2d3a626e1f5.manager.bundle.js +0 -1
- package/storybook-static/192.69f71338.iframe.bundle.js +0 -1
- package/storybook-static/198.80608638.iframe.bundle.js +0 -2
- package/storybook-static/198.80608638.iframe.bundle.js.LICENSE.txt +0 -31
- package/storybook-static/217.b9975326.iframe.bundle.js +0 -2
- package/storybook-static/217.b9975326.iframe.bundle.js.LICENSE.txt +0 -12
- package/storybook-static/261.70d64bef7770b201fb77.manager.bundle.js +0 -1
- package/storybook-static/303.0d9893ef.iframe.bundle.js +0 -1
- package/storybook-static/319.3e8dc6b4a7d2f3e67eb0.manager.bundle.js +0 -2
- package/storybook-static/319.3e8dc6b4a7d2f3e67eb0.manager.bundle.js.LICENSE.txt +0 -8
- package/storybook-static/322.8b797be6.iframe.bundle.js +0 -103
- package/storybook-static/322.8b797be6.iframe.bundle.js.LICENSE.txt +0 -140
- package/storybook-static/322.8b797be6.iframe.bundle.js.map +0 -1
- package/storybook-static/40.df6534995de03601f813.manager.bundle.js +0 -2
- package/storybook-static/40.df6534995de03601f813.manager.bundle.js.LICENSE.txt +0 -31
- package/storybook-static/45.b37f580f.iframe.bundle.js +0 -2
- package/storybook-static/45.b37f580f.iframe.bundle.js.LICENSE.txt +0 -8
- package/storybook-static/467.7fabc4cd8819eddb42f9.manager.bundle.js +0 -2
- package/storybook-static/467.7fabc4cd8819eddb42f9.manager.bundle.js.LICENSE.txt +0 -12
- package/storybook-static/582.ffbf0b74.iframe.bundle.js +0 -1
- package/storybook-static/609.e27a5f77.iframe.bundle.js +0 -2
- package/storybook-static/609.e27a5f77.iframe.bundle.js.LICENSE.txt +0 -11
- package/storybook-static/794.cbe100d1870b4d8a130a.manager.bundle.js +0 -1
- package/storybook-static/861.0b692bf7.iframe.bundle.js +0 -1
- package/storybook-static/931.51f69825a96d7bce33f5.manager.bundle.js +0 -2
- package/storybook-static/931.51f69825a96d7bce33f5.manager.bundle.js.LICENSE.txt +0 -94
- package/storybook-static/987.874321cb40e99203aabe.manager.bundle.js +0 -1
- package/storybook-static/favicon.ico +0 -0
- package/storybook-static/iframe.html +0 -364
- package/storybook-static/index.html +0 -59
- package/storybook-static/main.07b67595538d689438e4.manager.bundle.js +0 -1
- package/storybook-static/main.8ae59f4f.iframe.bundle.js +0 -1
- package/storybook-static/project.json +0 -1
- package/storybook-static/runtime~main.09b9b14c88359f235007.manager.bundle.js +0 -1
- package/storybook-static/runtime~main.c9dcb6d8.iframe.bundle.js +0 -1
- package/storybook-static/static/media/Bitter-Bold.091bd4b7.woff +0 -0
- package/storybook-static/static/media/Bitter-Bold.24bf01e4.woff2 +0 -0
- package/storybook-static/static/media/Bitter-Bold.46bc29e4.ttf +0 -0
- package/storybook-static/static/media/Bitter-Bold.790f4f2f.eot +0 -0
- package/storybook-static/static/media/Bitter-Italic.1fa5390c.eot +0 -0
- package/storybook-static/static/media/Bitter-Italic.25e5675f.woff +0 -0
- package/storybook-static/static/media/Bitter-Italic.2eb18f5a.ttf +0 -0
- package/storybook-static/static/media/Bitter-Italic.34644574.woff2 +0 -0
- package/storybook-static/static/media/Bitter-Regular.4b22b6e8.woff +0 -0
- package/storybook-static/static/media/Bitter-Regular.559e7075.eot +0 -0
- package/storybook-static/static/media/Bitter-Regular.8db0301b.ttf +0 -0
- package/storybook-static/static/media/Bitter-Regular.f4e2f1f1.woff2 +0 -0
- package/storybook-static/static/media/FontAwesome.91f80bba.otf +0 -0
- package/storybook-static/static/media/OpenSans-Bold-webfont.202d819d.eot +0 -0
- package/storybook-static/static/media/OpenSans-Bold-webfont.92e570c6.woff2 +0 -0
- package/storybook-static/static/media/OpenSans-Bold-webfont.da71e99a.ttf +0 -0
- package/storybook-static/static/media/OpenSans-Bold-webfont.e75949bb.woff +0 -0
- package/storybook-static/static/media/OpenSans-Italic-webfont.72daa33a.woff2 +0 -0
- package/storybook-static/static/media/OpenSans-Italic-webfont.74ead3a8.woff +0 -0
- package/storybook-static/static/media/OpenSans-Italic-webfont.ae19388f.eot +0 -0
- package/storybook-static/static/media/OpenSans-Italic-webfont.ec7a2746.ttf +0 -0
- package/storybook-static/static/media/OpenSans-Regular-webfont.63a5fa7d.woff +0 -0
- package/storybook-static/static/media/OpenSans-Regular-webfont.66451be4.ttf +0 -0
- package/storybook-static/static/media/OpenSans-Regular-webfont.7882d20f.eot +0 -0
- package/storybook-static/static/media/OpenSans-Regular-webfont.ca4dd835.woff2 +0 -0
- package/storybook-static/static/media/OpenSans-Semibold-webfont.17ded75f.woff2 +0 -0
- package/storybook-static/static/media/OpenSans-Semibold-webfont.2a5adf6c.woff +0 -0
- package/storybook-static/static/media/OpenSans-Semibold-webfont.6059fecb.ttf +0 -0
- package/storybook-static/static/media/OpenSans-Semibold-webfont.c9808185.eot +0 -0
- package/storybook-static/static/media/Rubik-Bold.31bbd4d2.ttf +0 -0
- package/storybook-static/static/media/Rubik-Light.c90e2014.ttf +0 -0
- package/storybook-static/static/media/Rubik-Medium.5daa89aa.ttf +0 -0
- package/storybook-static/static/media/Rubik-Regular.cdf97d58.ttf +0 -0
- package/storybook-static/static/media/arrow-both.a0959e13.svg +0 -3
- package/storybook-static/static/media/fontawesome-webfont.1e59d233.ttf +0 -0
- package/storybook-static/static/media/fontawesome-webfont.20fd1704.woff2 +0 -0
- package/storybook-static/static/media/fontawesome-webfont.8b43027f.eot +0 -0
- package/storybook-static/static/media/fontawesome-webfont.c1e38fd9.svg +0 -2671
- package/storybook-static/static/media/fontawesome-webfont.f691f37e.woff +0 -0
- package/storybook.log +0 -26
|
@@ -6,6 +6,7 @@ import TextArea from "../TextArea/index";
|
|
|
6
6
|
import Select from "../Select/index";
|
|
7
7
|
import Button from "../Button";
|
|
8
8
|
import { Switch, FormGroup, FormControlLabel } from "@mui/material";
|
|
9
|
+
import { DialogContent, Typography } from "@mui/material";
|
|
9
10
|
|
|
10
11
|
export default {
|
|
11
12
|
title: "MadieDialog",
|
|
@@ -132,3 +133,121 @@ export const Dialog = () => {
|
|
|
132
133
|
</div>
|
|
133
134
|
);
|
|
134
135
|
};
|
|
136
|
+
|
|
137
|
+
export const DialogWithActionButtons = () => {
|
|
138
|
+
const [open, setOpen] = useState(false);
|
|
139
|
+
const onClose = () => {
|
|
140
|
+
setOpen(false);
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
return (
|
|
144
|
+
<>
|
|
145
|
+
<Button variant="cyan" onClick={() => setOpen(true)}>
|
|
146
|
+
open Dialog
|
|
147
|
+
</Button>
|
|
148
|
+
<MadieDialog
|
|
149
|
+
title="Human Readable"
|
|
150
|
+
sx={{
|
|
151
|
+
"#modal-body": {
|
|
152
|
+
h2: {
|
|
153
|
+
borderTop: "1px solid black",
|
|
154
|
+
},
|
|
155
|
+
},
|
|
156
|
+
}}
|
|
157
|
+
dialogProps={{
|
|
158
|
+
onClose,
|
|
159
|
+
open,
|
|
160
|
+
maxWidth: "lg",
|
|
161
|
+
fullWidth: true,
|
|
162
|
+
}}
|
|
163
|
+
cancelButtonProps={{
|
|
164
|
+
variant: "secondary",
|
|
165
|
+
cancelText: "Cancel",
|
|
166
|
+
"data-testid": "cancel-button",
|
|
167
|
+
}}
|
|
168
|
+
continueButtonProps={{
|
|
169
|
+
variant: "cyan",
|
|
170
|
+
type: "submit",
|
|
171
|
+
"data-testid": "continue-button",
|
|
172
|
+
continueText: "Continue",
|
|
173
|
+
}}
|
|
174
|
+
>
|
|
175
|
+
<DialogContent>
|
|
176
|
+
<div data-testid="view-modal">
|
|
177
|
+
<Typography>
|
|
178
|
+
<div>Some Text</div>
|
|
179
|
+
</Typography>
|
|
180
|
+
</div>
|
|
181
|
+
</DialogContent>
|
|
182
|
+
</MadieDialog>
|
|
183
|
+
</>
|
|
184
|
+
);
|
|
185
|
+
};
|
|
186
|
+
|
|
187
|
+
export const DialogWithPopoverActionButtons = () => {
|
|
188
|
+
const [open, setOpen] = useState(false);
|
|
189
|
+
const onClose = () => {
|
|
190
|
+
setOpen(false);
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
return (
|
|
194
|
+
<>
|
|
195
|
+
<Button variant="cyan" onClick={() => setOpen(true)}>
|
|
196
|
+
open Dialog
|
|
197
|
+
</Button>
|
|
198
|
+
<MadieDialog
|
|
199
|
+
title="Dialog with popover action buttons"
|
|
200
|
+
sx={{
|
|
201
|
+
"#modal-body": {
|
|
202
|
+
h2: {
|
|
203
|
+
borderTop: "1px solid black",
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
}}
|
|
207
|
+
dialogProps={{
|
|
208
|
+
onClose,
|
|
209
|
+
open,
|
|
210
|
+
maxWidth: "lg",
|
|
211
|
+
fullWidth: true,
|
|
212
|
+
onSubmit: () => {
|
|
213
|
+
console.log("Submitted");
|
|
214
|
+
setOpen(false);
|
|
215
|
+
},
|
|
216
|
+
}}
|
|
217
|
+
cancelButtonProps={{
|
|
218
|
+
variant: "secondary",
|
|
219
|
+
cancelText: "Cancel",
|
|
220
|
+
"data-testid": "cancel-button",
|
|
221
|
+
}}
|
|
222
|
+
continueButtonProps={{
|
|
223
|
+
variant: "cyan",
|
|
224
|
+
type: "submit",
|
|
225
|
+
"data-testid": "continue-button",
|
|
226
|
+
continueText: "Continue",
|
|
227
|
+
popoverOptions: [
|
|
228
|
+
{
|
|
229
|
+
label: "Export",
|
|
230
|
+
dataTestId: "export-option",
|
|
231
|
+
toImplementFunction: () =>
|
|
232
|
+
console.log("Export clicked"),
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
label: "Export for Publishing",
|
|
236
|
+
dataTestId: "export-publishing-option",
|
|
237
|
+
toImplementFunction: () =>
|
|
238
|
+
console.log("Export for Publishing clicked"),
|
|
239
|
+
},
|
|
240
|
+
],
|
|
241
|
+
}}
|
|
242
|
+
>
|
|
243
|
+
<DialogContent>
|
|
244
|
+
<div data-testid="view-modal">
|
|
245
|
+
<Typography>
|
|
246
|
+
<div>Some Text displayed here</div>
|
|
247
|
+
</Typography>
|
|
248
|
+
</div>
|
|
249
|
+
</DialogContent>
|
|
250
|
+
</MadieDialog>
|
|
251
|
+
</>
|
|
252
|
+
);
|
|
253
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from "react";
|
|
1
|
+
import React, { useState } from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import Draggable from "react-draggable";
|
|
4
4
|
import CloseIcon from "@mui/icons-material/Close";
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
} from "@mui/material";
|
|
14
14
|
import { Box } from "@mui/system";
|
|
15
15
|
import Button from "../Button";
|
|
16
|
+
import Popover from "../Popover";
|
|
16
17
|
|
|
17
18
|
const DraggablePaper = (props) => {
|
|
18
19
|
const { children, ...rest } = props;
|
|
@@ -32,8 +33,23 @@ const DraggablePaper = (props) => {
|
|
|
32
33
|
const Actions = ({ onClose, cancelButtonProps, continueButtonProps }) => {
|
|
33
34
|
const { cancelText, cancelIcon, ...otherCancelButtonProps } =
|
|
34
35
|
cancelButtonProps;
|
|
35
|
-
const {
|
|
36
|
-
|
|
36
|
+
const {
|
|
37
|
+
continueText,
|
|
38
|
+
continueIcon,
|
|
39
|
+
popoverOptions,
|
|
40
|
+
...otherContinueButtonProps
|
|
41
|
+
} = continueButtonProps;
|
|
42
|
+
const [anchorEl, setAnchorEl] = useState(null);
|
|
43
|
+
|
|
44
|
+
const openPopOverMenu = (event) => {
|
|
45
|
+
setAnchorEl(event.currentTarget);
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
const closePopOverMenu = () => {
|
|
49
|
+
setAnchorEl(null);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
const open = Boolean(anchorEl);
|
|
37
53
|
return (
|
|
38
54
|
<>
|
|
39
55
|
<Divider sx={{ borderColor: "#8c8c8c" }} />
|
|
@@ -57,7 +73,27 @@ const Actions = ({ onClose, cancelButtonProps, continueButtonProps }) => {
|
|
|
57
73
|
</span>
|
|
58
74
|
</Button>
|
|
59
75
|
)}
|
|
60
|
-
{
|
|
76
|
+
{popoverOptions ? (
|
|
77
|
+
<>
|
|
78
|
+
<Button
|
|
79
|
+
className="qpp-c-button--cyan"
|
|
80
|
+
onClick={openPopOverMenu}
|
|
81
|
+
style={{ marginTop: 0 }}
|
|
82
|
+
{...otherContinueButtonProps}
|
|
83
|
+
>
|
|
84
|
+
<span>
|
|
85
|
+
{continueText}
|
|
86
|
+
{continueIcon}
|
|
87
|
+
</span>
|
|
88
|
+
</Button>
|
|
89
|
+
<Popover
|
|
90
|
+
optionsOpen={open}
|
|
91
|
+
anchorEl={anchorEl}
|
|
92
|
+
handleClose={closePopOverMenu}
|
|
93
|
+
additionalSelectOptionProps={popoverOptions}
|
|
94
|
+
/>
|
|
95
|
+
</>
|
|
96
|
+
) : (
|
|
61
97
|
<Button
|
|
62
98
|
className="qpp-c-button--cyan"
|
|
63
99
|
type="submit"
|