@madie/madie-design-system 1.0.13 → 1.0.14
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.
|
@@ -15,26 +15,26 @@ import Button from "../Button";
|
|
|
15
15
|
|
|
16
16
|
const MadieDialog = ({
|
|
17
17
|
/*
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
18
|
+
Lets make a reusable component
|
|
19
|
+
form booleon determines layout
|
|
20
|
+
Dialog props: props to be passed to the Dialog itself
|
|
21
|
+
{
|
|
22
|
+
open: bool,
|
|
23
|
+
onClose: function on close,
|
|
24
|
+
onSubmit: function onSubmit,
|
|
25
|
+
showRequiredFieldMessage: functional
|
|
26
|
+
}
|
|
27
|
+
Children: React components to be inside
|
|
28
|
+
Action Props for cancel or continue:
|
|
29
|
+
{
|
|
30
|
+
variants listed in design system like cyan
|
|
31
|
+
className
|
|
32
|
+
type
|
|
33
|
+
data-testid,
|
|
34
|
+
onClick
|
|
35
|
+
disabled
|
|
36
|
+
}
|
|
37
|
+
*/
|
|
38
38
|
form,
|
|
39
39
|
title,
|
|
40
40
|
dialogProps,
|
|
@@ -108,7 +108,7 @@ const MadieDialog = ({
|
|
|
108
108
|
</div>
|
|
109
109
|
</Box>
|
|
110
110
|
<Divider />
|
|
111
|
-
<DialogContent>
|
|
111
|
+
<DialogContent sx={{ padding: '32px' }}>
|
|
112
112
|
{showRequiredFieldMessage && (
|
|
113
113
|
<Box
|
|
114
114
|
sx={{
|
|
@@ -141,7 +141,7 @@ const MadieDialog = ({
|
|
|
141
141
|
|
|
142
142
|
{children}
|
|
143
143
|
</DialogContent>
|
|
144
|
-
<Divider
|
|
144
|
+
<Divider />
|
|
145
145
|
<DialogActions
|
|
146
146
|
sx={{
|
|
147
147
|
padding: "16px",
|
|
@@ -205,8 +205,8 @@ const MadieDialog = ({
|
|
|
205
205
|
</div>
|
|
206
206
|
</Box>
|
|
207
207
|
<Divider />
|
|
208
|
-
<DialogContent>{children}</DialogContent>
|
|
209
|
-
<Divider
|
|
208
|
+
<DialogContent sx={{ padding: '32px'}}>{children}</DialogContent>
|
|
209
|
+
<Divider />
|
|
210
210
|
<DialogActions
|
|
211
211
|
sx={{
|
|
212
212
|
padding: "16px",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import PropTypes from "prop-types";
|
|
3
3
|
import { withKnobs } from "@storybook/addon-knobs";
|
|
4
|
-
import
|
|
5
|
-
import { MenuItem
|
|
4
|
+
import Select from "./index";
|
|
5
|
+
import { MenuItem } from "@mui/material";
|
|
6
6
|
|
|
7
7
|
export default {
|
|
8
8
|
title: "Select",
|
|
@@ -25,9 +25,9 @@ const options = [
|
|
|
25
25
|
{ key: "key2", value: "value2", testId: "testid2", name: "name2" },
|
|
26
26
|
{ key: "key3", value: "value2", testId: "testid3", name: "name3" },
|
|
27
27
|
];
|
|
28
|
-
export const
|
|
28
|
+
export const SelectWithLabel = () => (
|
|
29
29
|
<Wrapper>
|
|
30
|
-
<
|
|
30
|
+
<Select
|
|
31
31
|
defaultValue=""
|
|
32
32
|
placeHolder={{ name: "placeholder", value: "" }}
|
|
33
33
|
label="Text Label"
|
|
@@ -52,7 +52,7 @@ export const Select = () => (
|
|
|
52
52
|
|
|
53
53
|
export const WithHelperText = () => (
|
|
54
54
|
<Wrapper>
|
|
55
|
-
<
|
|
55
|
+
<Select
|
|
56
56
|
placeHolder={{ name: "placeholder", value: "" }}
|
|
57
57
|
defaultValue=""
|
|
58
58
|
label="Text Label"
|
|
@@ -60,12 +60,7 @@ export const WithHelperText = () => (
|
|
|
60
60
|
inputProps={{ "data-testid": "measure-name-input" }}
|
|
61
61
|
data-testid="measure-name-text-field"
|
|
62
62
|
size="small"
|
|
63
|
-
helperText=
|
|
64
|
-
<FormHelperText data-testid={`helper-text`} error={false}>
|
|
65
|
-
{" "}
|
|
66
|
-
A descriptive message
|
|
67
|
-
</FormHelperText>
|
|
68
|
-
}
|
|
63
|
+
helperText="A descriptive message"
|
|
69
64
|
options={options.map(({ key, value, testId, name }) => {
|
|
70
65
|
return (
|
|
71
66
|
<MenuItem
|
|
@@ -83,7 +78,7 @@ export const WithHelperText = () => (
|
|
|
83
78
|
|
|
84
79
|
export const Disabled = () => (
|
|
85
80
|
<Wrapper>
|
|
86
|
-
<
|
|
81
|
+
<Select
|
|
87
82
|
placeHolder={{ name: "placeholder", value: "" }}
|
|
88
83
|
defaultValue=""
|
|
89
84
|
label="Text Label"
|
|
@@ -109,7 +104,7 @@ export const Disabled = () => (
|
|
|
109
104
|
|
|
110
105
|
export const Required = () => (
|
|
111
106
|
<Wrapper>
|
|
112
|
-
<
|
|
107
|
+
<Select
|
|
113
108
|
required
|
|
114
109
|
placeHolder={{ name: "placeholder", value: "" }}
|
|
115
110
|
defaultValue=""
|
|
@@ -135,7 +130,7 @@ export const Required = () => (
|
|
|
135
130
|
|
|
136
131
|
export const Error = () => (
|
|
137
132
|
<Wrapper>
|
|
138
|
-
<
|
|
133
|
+
<Select
|
|
139
134
|
error
|
|
140
135
|
placeHolder={{ name: "placeholder", value: "" }}
|
|
141
136
|
defaultValue=""
|
|
@@ -144,11 +139,7 @@ export const Error = () => (
|
|
|
144
139
|
inputProps={{ "data-testid": "measure-name-input" }}
|
|
145
140
|
data-testid="measure-name-text-field"
|
|
146
141
|
size="small"
|
|
147
|
-
helperText=
|
|
148
|
-
<FormHelperText data-testid={`helper-text`} error={true}>
|
|
149
|
-
An error message
|
|
150
|
-
</FormHelperText>
|
|
151
|
-
}
|
|
142
|
+
helperText="An error message"
|
|
152
143
|
options={options.map(({ key, value, testId, name }) => {
|
|
153
144
|
return (
|
|
154
145
|
<MenuItem
|
|
@@ -24,7 +24,6 @@ const Select = ({
|
|
|
24
24
|
],
|
|
25
25
|
...rest
|
|
26
26
|
}) => {
|
|
27
|
-
// const classes = useStyles();
|
|
28
27
|
const placehold = (
|
|
29
28
|
<span style={{ opacity: 0.6 }}>
|
|
30
29
|
{placeHolder?.name || "placeholder"}
|
|
@@ -73,7 +72,6 @@ const Select = ({
|
|
|
73
72
|
}}
|
|
74
73
|
displayEmpty
|
|
75
74
|
IconComponent={ExpandMoreIcon}
|
|
76
|
-
error={error}
|
|
77
75
|
disabled={disabled}
|
|
78
76
|
required={required}
|
|
79
77
|
id={id}
|
|
@@ -90,7 +88,7 @@ const Select = ({
|
|
|
90
88
|
>
|
|
91
89
|
{options && options}
|
|
92
90
|
</MUISelect>
|
|
93
|
-
{helperText && <FormHelperText>{helperText}</FormHelperText>}
|
|
91
|
+
{helperText && <FormHelperText data-testid={`helper-text`}>{helperText}</FormHelperText>}
|
|
94
92
|
</FormControl>
|
|
95
93
|
);
|
|
96
94
|
};
|