@madie/madie-design-system 1.0.47 → 1.0.49
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/.babelrc +2 -8
- package/.eslintrc.js +15 -15
- package/.storybook/main.js +39 -40
- package/.storybook/preview-head.html +3 -3
- package/.storybook/preview.js +2 -2
- package/README.md +0 -1
- package/components/AutoComplete/AutoComplete.jsx +56 -46
- package/components/AutoComplete/AutoComplete.stories.js +18 -7
- package/components/Breadcrumb/Breadcrumb.md +7 -7
- package/components/DateField/DateField.jsx +85 -0
- package/components/DateField/DateField.stories.jsx +25 -0
- package/components/MadieDeleteDialog/MadieDeleteDialog.stories.js +1 -1
- package/components/MadieDeleteDialog/index.jsx +1 -1
- package/components/Pagination/index.jsx +6 -8
- package/components/Popover/Popover.stories.js +7 -5
- package/components/Popover/index.js +2 -1
- package/components/RadioButton/RadioButton.jsx +29 -20
- package/components/RadioButton/RadioButton.stories.jsx +4 -4
- package/components/Select/Select.stories.js +76 -73
- package/components/Select/index.jsx +54 -43
- package/components/Tabs/Tab.js +24 -31
- package/components/Tabs/Tabs.stories.js +157 -42
- package/components/Tabs/index.js +22 -30
- package/components/TextArea/TextArea.stories.js +7 -3
- package/components/TextArea/index.jsx +64 -56
- package/components/TextField/TextField.stories.js +37 -34
- package/components/TextField/index.jsx +89 -77
- package/components/Toast/index.jsx +3 -1
- package/components/index.js +3 -1
- package/dist/browser.js +1 -1
- package/dist/index.js +1 -1
- package/dist/react/index.js +19 -19
- package/dist/react/index.js.LICENSE.txt +9 -0
- package/dist/react/index.js.map +1 -1
- package/index.js +9 -10
- package/jest/mediaFileTransformer.js +2 -2
- package/jest.config.js +7 -7
- package/lib/Chevron.jsx +22 -22
- package/lib/SvgComponents.jsx +384 -359
- package/package.json +3 -1
- package/storybook-static/602.f6d1ca28.iframe.bundle.js +103 -0
- package/storybook-static/{533.ce3f16be.iframe.bundle.js.map → 602.f6d1ca28.iframe.bundle.js.map} +1 -1
- package/storybook-static/iframe.html +1 -1
- package/storybook-static/main.04a59fc2.iframe.bundle.js +1 -0
- package/storybook-static/project.json +1 -1
- package/svgo.config.js +1 -1
- package/test/components/DateField.test.js +29 -0
- package/test-setup.js +4 -4
- package/webpack.config.js +116 -116
- package/webpack.config.react.js +69 -69
- package/storybook-static/533.ce3f16be.iframe.bundle.js +0 -103
- package/storybook-static/main.24906d7d.iframe.bundle.js +0 -1
- /package/storybook-static/{533.ce3f16be.iframe.bundle.js.LICENSE.txt → 602.f6d1ca28.iframe.bundle.js.LICENSE.txt} +0 -0
|
@@ -7,10 +7,10 @@ export default {
|
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
const options = [
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
{ label: "option 1", value: true },
|
|
11
|
+
{ label: "option 2", value: false },
|
|
12
|
+
{ label: "options 3", value: "options 3" },
|
|
13
|
+
];
|
|
14
14
|
|
|
15
15
|
const TemplateRadioButton = (args) => {
|
|
16
16
|
const [value, setValue] = useState("test");
|
|
@@ -11,7 +11,10 @@ export default {
|
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
const Wrapper = ({ children }) => (
|
|
14
|
-
<div
|
|
14
|
+
<div
|
|
15
|
+
className="qpp-u-padding--16"
|
|
16
|
+
style={{ width: 300, marginBottom: "16px" }}
|
|
17
|
+
>
|
|
15
18
|
{children}
|
|
16
19
|
</div>
|
|
17
20
|
);
|
|
@@ -155,78 +158,78 @@ export const Error = () => (
|
|
|
155
158
|
</Wrapper>
|
|
156
159
|
);
|
|
157
160
|
|
|
158
|
-
|
|
159
|
-
|
|
160
161
|
export const VariedHeights = () => (
|
|
161
|
-
<div
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
162
|
+
<div
|
|
163
|
+
className="qpp-u-padding--16"
|
|
164
|
+
style={{ width: 900, marginBottom: "16px" }}
|
|
165
|
+
>
|
|
166
|
+
<Box sx={{ display: "flex", flexDirection: "row" }}>
|
|
167
|
+
<Select
|
|
168
|
+
error
|
|
169
|
+
placeHolder={{ name: "placeholder", value: "" }}
|
|
170
|
+
defaultValue=""
|
|
171
|
+
label="Text Label"
|
|
172
|
+
id="measureName"
|
|
173
|
+
inputProps={{ "data-testid": "measure-name-input" }}
|
|
174
|
+
data-testid="measure-name-text-field"
|
|
175
|
+
size="small"
|
|
176
|
+
helperText="An error message"
|
|
177
|
+
options={options.map(({ key, value, testId, name }) => {
|
|
178
|
+
return (
|
|
179
|
+
<MenuItem
|
|
180
|
+
key={key}
|
|
181
|
+
value={value}
|
|
182
|
+
data-testid={`option-${testId}`}
|
|
183
|
+
>
|
|
184
|
+
{name}
|
|
185
|
+
</MenuItem>
|
|
186
|
+
);
|
|
187
|
+
})}
|
|
188
|
+
/>
|
|
189
|
+
<Select
|
|
190
|
+
// error
|
|
191
|
+
placeHolder={{ name: "placeholder", value: "" }}
|
|
192
|
+
defaultValue=""
|
|
193
|
+
label="Text Label"
|
|
194
|
+
id="measureName"
|
|
195
|
+
inputProps={{ "data-testid": "measure-name-input" }}
|
|
196
|
+
data-testid="measure-name-text-field"
|
|
197
|
+
size="small"
|
|
198
|
+
helperText=""
|
|
199
|
+
options={options.map(({ key, value, testId, name }) => {
|
|
200
|
+
return (
|
|
201
|
+
<MenuItem
|
|
202
|
+
key={key}
|
|
203
|
+
value={value}
|
|
204
|
+
data-testid={`option-${testId}`}
|
|
205
|
+
>
|
|
206
|
+
{name}
|
|
207
|
+
</MenuItem>
|
|
208
|
+
);
|
|
209
|
+
})}
|
|
210
|
+
/>
|
|
211
|
+
<Select
|
|
212
|
+
// error
|
|
213
|
+
placeHolder={{ name: "placeholder", value: "" }}
|
|
214
|
+
defaultValue=""
|
|
215
|
+
label="Text Label"
|
|
216
|
+
id="measureName"
|
|
217
|
+
inputProps={{ "data-testid": "measure-name-input" }}
|
|
218
|
+
data-testid="measure-name-text-field"
|
|
219
|
+
size="small"
|
|
220
|
+
helperText="An error message designed to take up a lot of space to see how we space multiple input elements within the same row in a responsive manner "
|
|
221
|
+
options={options.map(({ key, value, testId, name }) => {
|
|
222
|
+
return (
|
|
223
|
+
<MenuItem
|
|
224
|
+
key={key}
|
|
225
|
+
value={value}
|
|
226
|
+
data-testid={`option-${testId}`}
|
|
227
|
+
>
|
|
228
|
+
{name}
|
|
229
|
+
</MenuItem>
|
|
230
|
+
);
|
|
231
|
+
})}
|
|
232
|
+
/>
|
|
230
233
|
</Box>
|
|
231
234
|
</div>
|
|
232
|
-
)
|
|
235
|
+
);
|
|
@@ -32,14 +32,21 @@ const Select = ({
|
|
|
32
32
|
return (
|
|
33
33
|
<FormControl error={error} fullWidth>
|
|
34
34
|
{/* to deal with multiple height helper text in a single row*/}
|
|
35
|
-
<div
|
|
35
|
+
<div
|
|
36
|
+
style={{
|
|
37
|
+
width: 1,
|
|
38
|
+
display: "flex",
|
|
39
|
+
flexDirection: "column",
|
|
40
|
+
flexGrow: 1,
|
|
41
|
+
}}
|
|
42
|
+
/>
|
|
36
43
|
<InputLabel
|
|
37
44
|
// {/* has init at .2rem/3.2 px bottom. passing sx breaks style. */}
|
|
38
45
|
id={`${id}-label`}
|
|
39
46
|
disabled={disabled}
|
|
40
47
|
required={required}
|
|
41
48
|
shrink
|
|
42
|
-
style={{marginBottom: 0, height: 16}} // force a heignt
|
|
49
|
+
style={{ marginBottom: 0, height: 16 }} // force a heignt
|
|
43
50
|
sx={[
|
|
44
51
|
{
|
|
45
52
|
backgroundColor: "transparent",
|
|
@@ -76,65 +83,69 @@ const Select = ({
|
|
|
76
83
|
>
|
|
77
84
|
{label}
|
|
78
85
|
</InputLabel>
|
|
79
|
-
|
|
86
|
+
{helperText && (
|
|
87
|
+
<FormHelperText
|
|
80
88
|
tabIndex={0}
|
|
81
89
|
aria-live="polite"
|
|
82
90
|
data-testid={`${id}-helper-text`}
|
|
83
91
|
id={`${id}-helper-text`}
|
|
84
|
-
sx={[
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
sx={[
|
|
93
|
+
{
|
|
94
|
+
margin: "4px 0px 0px 0px",
|
|
95
|
+
color: "#515151",
|
|
96
|
+
lineHeight: 1,
|
|
97
|
+
},
|
|
98
|
+
error && {
|
|
99
|
+
color: "#AE1C1C !important",
|
|
100
|
+
},
|
|
101
|
+
]}
|
|
93
102
|
>
|
|
94
103
|
{helperText}
|
|
95
|
-
</FormHelperText>
|
|
104
|
+
</FormHelperText>
|
|
105
|
+
)}
|
|
96
106
|
<MUISelect
|
|
97
|
-
sx={[
|
|
98
|
-
|
|
99
|
-
height: 40,
|
|
100
|
-
border: "1px solid #DDDDDD",
|
|
101
|
-
marginTop: "8px",
|
|
102
|
-
"& .MuiOutlinedInput-notchedOutline": {
|
|
107
|
+
sx={[
|
|
108
|
+
{
|
|
103
109
|
borderRadius: "3px",
|
|
104
|
-
|
|
105
|
-
|
|
110
|
+
height: 40,
|
|
111
|
+
border: "1px solid #DDDDDD",
|
|
112
|
+
marginTop: "8px",
|
|
113
|
+
"& .MuiOutlinedInput-notchedOutline": {
|
|
114
|
+
borderRadius: "3px",
|
|
115
|
+
"& legend": {
|
|
116
|
+
width: 0,
|
|
117
|
+
},
|
|
106
118
|
},
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
119
|
+
"& .MuiOutlinedInput-root": {
|
|
120
|
+
"&&": {
|
|
121
|
+
borderRadius: "3px",
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
// input base selector
|
|
125
|
+
"& .MuiInputBase-input": {
|
|
126
|
+
color: "#333",
|
|
127
|
+
fontFamily: "Rubik",
|
|
128
|
+
fontSize: 14,
|
|
110
129
|
borderRadius: "3px",
|
|
130
|
+
padding: "9px 14px",
|
|
131
|
+
"&::placeholder": {
|
|
132
|
+
color: "#717171",
|
|
133
|
+
},
|
|
111
134
|
},
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
borderRadius: "3px",
|
|
119
|
-
padding: "9px 14px",
|
|
120
|
-
"&::placeholder": {
|
|
121
|
-
color: "#717171"
|
|
135
|
+
"& .MuiSelect-icon": {
|
|
136
|
+
color: "#323232",
|
|
137
|
+
},
|
|
138
|
+
"& .Mui-disabled": {
|
|
139
|
+
backgroundColor: "#EDEDED",
|
|
140
|
+
border: "#EDEDED",
|
|
122
141
|
},
|
|
123
142
|
},
|
|
124
|
-
"& .MuiSelect-icon": {
|
|
125
|
-
color: "#323232",
|
|
126
|
-
},
|
|
127
|
-
"& .Mui-disabled" : {
|
|
128
|
-
backgroundColor: "#EDEDED",
|
|
129
|
-
border: "#EDEDED",
|
|
130
|
-
}},
|
|
131
143
|
error && {
|
|
132
144
|
"& .MuiOutlinedInput-notchedOutline": {
|
|
133
145
|
borderColor: "#AE1C1C !important",
|
|
134
146
|
},
|
|
135
147
|
},
|
|
136
|
-
]
|
|
137
|
-
}
|
|
148
|
+
]}
|
|
138
149
|
displayEmpty
|
|
139
150
|
IconComponent={ExpandMoreIcon}
|
|
140
151
|
disabled={disabled}
|
package/components/Tabs/Tab.js
CHANGED
|
@@ -6,71 +6,64 @@ const typeA = {
|
|
|
6
6
|
color: "#fff",
|
|
7
7
|
borderRadius: "4px 4px 0px 0px !important",
|
|
8
8
|
backgroundColor: "#003366",
|
|
9
|
-
"&:hover":{
|
|
10
|
-
background: "#001F3D"
|
|
9
|
+
"&:hover": {
|
|
10
|
+
background: "#001F3D",
|
|
11
11
|
},
|
|
12
|
-
"&:focus":{
|
|
12
|
+
"&:focus": {
|
|
13
13
|
background: "#125496",
|
|
14
14
|
boxShadow: "0px 0px 0px 4px #CBE4FF",
|
|
15
15
|
},
|
|
16
16
|
};
|
|
17
17
|
const typeB = {
|
|
18
18
|
color: "#515151",
|
|
19
|
-
"&:hover":{
|
|
19
|
+
"&:hover": {
|
|
20
20
|
background: "#F2F9FF",
|
|
21
|
-
color: "#242424"
|
|
21
|
+
color: "#242424",
|
|
22
22
|
},
|
|
23
|
-
"&:focus":{
|
|
23
|
+
"&:focus": {
|
|
24
24
|
boxShadow: "0px 0px 0px 4px #CBE4FF",
|
|
25
|
-
background: "#fff"
|
|
26
|
-
}
|
|
25
|
+
background: "#fff",
|
|
26
|
+
},
|
|
27
27
|
};
|
|
28
28
|
const typeC = {
|
|
29
29
|
color: "#333",
|
|
30
30
|
background: "#EDEDED",
|
|
31
|
-
"&:hover":{
|
|
31
|
+
"&:hover": {
|
|
32
32
|
background: "#FAFAFA",
|
|
33
|
-
color: "#515151"
|
|
33
|
+
color: "#515151",
|
|
34
34
|
},
|
|
35
|
-
"&:focus":{
|
|
35
|
+
"&:focus": {
|
|
36
36
|
boxShadow: "0px 0px 0px 4px #CBE4FF",
|
|
37
|
-
background: "#fff"
|
|
38
|
-
}
|
|
37
|
+
background: "#fff",
|
|
38
|
+
},
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
|
|
42
41
|
const Tab = ({ type, orientation, size, ...rest }) => {
|
|
43
42
|
const baseStyle = {
|
|
44
|
-
height: size ===
|
|
43
|
+
height: size === "standard" ? "48px" : "60px",
|
|
45
44
|
fontFamily: "Rubik, sans serif",
|
|
46
45
|
fontWeight: 400,
|
|
47
|
-
padding: size ===
|
|
46
|
+
padding: size === "standard" ? "14.5px 24.5px" : "20.5px 24px",
|
|
48
47
|
textTransform: "none",
|
|
49
48
|
fontSize: "16px",
|
|
50
|
-
alignItems: orientation ===
|
|
51
|
-
|
|
49
|
+
alignItems: orientation === "vertical" && "flex-start",
|
|
50
|
+
"& .Mui-disabled": {
|
|
52
51
|
background: "#DDDDDD",
|
|
53
|
-
color: "#717171"
|
|
52
|
+
color: "#717171",
|
|
54
53
|
},
|
|
55
|
-
}
|
|
54
|
+
};
|
|
56
55
|
const style = ((type) => {
|
|
57
56
|
if (type === "A") {
|
|
58
|
-
return
|
|
57
|
+
return { ...baseStyle, ...typeA };
|
|
59
58
|
}
|
|
60
59
|
if (type === "B" || type === "D") {
|
|
61
|
-
return
|
|
60
|
+
return { ...baseStyle, ...typeB };
|
|
62
61
|
}
|
|
63
62
|
if (type === "C") {
|
|
64
|
-
return
|
|
63
|
+
return { ...baseStyle, ...typeC };
|
|
65
64
|
}
|
|
66
|
-
})(type)
|
|
67
|
-
return
|
|
68
|
-
<MuiTab
|
|
69
|
-
tabIndex={0}
|
|
70
|
-
sx={style}
|
|
71
|
-
{...rest}
|
|
72
|
-
/>
|
|
73
|
-
);
|
|
65
|
+
})(type);
|
|
66
|
+
return <MuiTab tabIndex={0} sx={style} {...rest} />;
|
|
74
67
|
};
|
|
75
68
|
|
|
76
69
|
Tab.propTypes = {
|