@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.
Files changed (53) hide show
  1. package/.babelrc +2 -8
  2. package/.eslintrc.js +15 -15
  3. package/.storybook/main.js +39 -40
  4. package/.storybook/preview-head.html +3 -3
  5. package/.storybook/preview.js +2 -2
  6. package/README.md +0 -1
  7. package/components/AutoComplete/AutoComplete.jsx +56 -46
  8. package/components/AutoComplete/AutoComplete.stories.js +18 -7
  9. package/components/Breadcrumb/Breadcrumb.md +7 -7
  10. package/components/DateField/DateField.jsx +85 -0
  11. package/components/DateField/DateField.stories.jsx +25 -0
  12. package/components/MadieDeleteDialog/MadieDeleteDialog.stories.js +1 -1
  13. package/components/MadieDeleteDialog/index.jsx +1 -1
  14. package/components/Pagination/index.jsx +6 -8
  15. package/components/Popover/Popover.stories.js +7 -5
  16. package/components/Popover/index.js +2 -1
  17. package/components/RadioButton/RadioButton.jsx +29 -20
  18. package/components/RadioButton/RadioButton.stories.jsx +4 -4
  19. package/components/Select/Select.stories.js +76 -73
  20. package/components/Select/index.jsx +54 -43
  21. package/components/Tabs/Tab.js +24 -31
  22. package/components/Tabs/Tabs.stories.js +157 -42
  23. package/components/Tabs/index.js +22 -30
  24. package/components/TextArea/TextArea.stories.js +7 -3
  25. package/components/TextArea/index.jsx +64 -56
  26. package/components/TextField/TextField.stories.js +37 -34
  27. package/components/TextField/index.jsx +89 -77
  28. package/components/Toast/index.jsx +3 -1
  29. package/components/index.js +3 -1
  30. package/dist/browser.js +1 -1
  31. package/dist/index.js +1 -1
  32. package/dist/react/index.js +19 -19
  33. package/dist/react/index.js.LICENSE.txt +9 -0
  34. package/dist/react/index.js.map +1 -1
  35. package/index.js +9 -10
  36. package/jest/mediaFileTransformer.js +2 -2
  37. package/jest.config.js +7 -7
  38. package/lib/Chevron.jsx +22 -22
  39. package/lib/SvgComponents.jsx +384 -359
  40. package/package.json +3 -1
  41. package/storybook-static/602.f6d1ca28.iframe.bundle.js +103 -0
  42. package/storybook-static/{533.ce3f16be.iframe.bundle.js.map → 602.f6d1ca28.iframe.bundle.js.map} +1 -1
  43. package/storybook-static/iframe.html +1 -1
  44. package/storybook-static/main.04a59fc2.iframe.bundle.js +1 -0
  45. package/storybook-static/project.json +1 -1
  46. package/svgo.config.js +1 -1
  47. package/test/components/DateField.test.js +29 -0
  48. package/test-setup.js +4 -4
  49. package/webpack.config.js +116 -116
  50. package/webpack.config.react.js +69 -69
  51. package/storybook-static/533.ce3f16be.iframe.bundle.js +0 -103
  52. package/storybook-static/main.24906d7d.iframe.bundle.js +0 -1
  53. /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
- { label: "option 1", value: true },
11
- { label: "option 2", value: false},
12
- { label: "options 3", value: "options 3"},
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 className="qpp-u-padding--16" style={{ width: 300, marginBottom: "16px" }} >
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 className="qpp-u-padding--16" style={{ width: 900, marginBottom: "16px" }} >
162
- <Box sx={{display: "flex",
163
- flexDirection: "row"}}>
164
- <Select
165
- error
166
- placeHolder={{ name: "placeholder", value: "" }}
167
- defaultValue=""
168
- label="Text Label"
169
- id="measureName"
170
- inputProps={{ "data-testid": "measure-name-input" }}
171
- data-testid="measure-name-text-field"
172
- size="small"
173
- helperText="An error message"
174
- options={options.map(({ key, value, testId, name }) => {
175
- return (
176
- <MenuItem
177
- key={key}
178
- value={value}
179
- data-testid={`option-${testId}`}
180
- >
181
- {name}
182
- </MenuItem>
183
- );
184
- })}
185
- />
186
- <Select
187
- // error
188
- placeHolder={{ name: "placeholder", value: "" }}
189
- defaultValue=""
190
- label="Text Label"
191
- id="measureName"
192
- inputProps={{ "data-testid": "measure-name-input" }}
193
- data-testid="measure-name-text-field"
194
- size="small"
195
- helperText=""
196
- options={options.map(({ key, value, testId, name }) => {
197
- return (
198
- <MenuItem
199
- key={key}
200
- value={value}
201
- data-testid={`option-${testId}`}
202
- >
203
- {name}
204
- </MenuItem>
205
- );
206
- })}
207
- />
208
- <Select
209
- // error
210
- placeHolder={{ name: "placeholder", value: "" }}
211
- defaultValue=""
212
- label="Text Label"
213
- id="measureName"
214
- inputProps={{ "data-testid": "measure-name-input" }}
215
- data-testid="measure-name-text-field"
216
- size="small"
217
- 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 "
218
- options={options.map(({ key, value, testId, name }) => {
219
- return (
220
- <MenuItem
221
- key={key}
222
- value={value}
223
- data-testid={`option-${testId}`}
224
- >
225
- {name}
226
- </MenuItem>
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 style={{ width: 1, display: "flex", flexDirection: "column", flexGrow: 1}}/>
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
- {helperText && (<FormHelperText
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
- margin: "4px 0px 0px 0px",
86
- color: "#515151",
87
- lineHeight: 1
88
- },
89
- error && {
90
- color: "#AE1C1C !important",
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
- borderRadius: "3px",
99
- height: 40,
100
- border: "1px solid #DDDDDD",
101
- marginTop: "8px",
102
- "& .MuiOutlinedInput-notchedOutline": {
107
+ sx={[
108
+ {
103
109
  borderRadius: "3px",
104
- "& legend": {
105
- width: 0,
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
- "& .MuiOutlinedInput-root": {
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
- // input base selector
114
- "& .MuiInputBase-input": {
115
- color: "#333",
116
- fontFamily: "Rubik",
117
- fontSize: 14,
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}
@@ -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 === 'standard' ? '48px' : '60px',
43
+ height: size === "standard" ? "48px" : "60px",
45
44
  fontFamily: "Rubik, sans serif",
46
45
  fontWeight: 400,
47
- padding: size === 'standard' ? "14.5px 24.5px" : "20.5px 24px",
46
+ padding: size === "standard" ? "14.5px 24.5px" : "20.5px 24px",
48
47
  textTransform: "none",
49
48
  fontSize: "16px",
50
- alignItems: orientation === 'vertical' && "flex-start",
51
- '& .Mui-disabled': {
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 { ...baseStyle, ...typeA}
57
+ return { ...baseStyle, ...typeA };
59
58
  }
60
59
  if (type === "B" || type === "D") {
61
- return { ...baseStyle, ...typeB, }
60
+ return { ...baseStyle, ...typeB };
62
61
  }
63
62
  if (type === "C") {
64
- return { ...baseStyle, ...typeC}
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 = {