@madie/madie-design-system 1.0.48 → 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.
@@ -4,99 +4,82 @@ import InputLabel from "../InputLabel";
4
4
  import { DatePicker } from "@mui/x-date-pickers/DatePicker";
5
5
  import { LocalizationProvider } from "@mui/x-date-pickers/LocalizationProvider";
6
6
  import { AdapterDayjs } from "@mui/x-date-pickers/AdapterDayjs";
7
- import InputAdornment from "@mui/material/InputAdornment";
8
- import EventIcon from "@mui/icons-material/Event";
9
7
  import { kebabCase } from "lodash";
10
8
 
11
- export const textFieldStyle = {
12
- width: "160px",
13
- borderRadius: "3px",
14
- height: 40,
15
- border: "1px solid #DDDDDD",
16
- marginTop: "8px",
17
- "& .MuiOutlinedInput-notchedOutline": {
9
+ export const dateTextFieldStyle = {
10
+ width: "170px",
18
11
  borderRadius: "3px",
19
- "& legend": {
20
- width: 0,
12
+ height: 40,
13
+ border: "1px solid #B0B0B0",
14
+ marginTop: "8px",
15
+ "& .MuiOutlinedInput-notchedOutline": {
16
+ borderRadius: "3px",
17
+ "& legend": {
18
+ width: 0,
19
+ },
21
20
  },
22
- },
23
- "& .MuiOutlinedInput-root": {
24
- "&&": {
25
- borderRadius: "3px",
21
+ "& .MuiOutlinedInput-root": {
22
+ "&&": {
23
+ borderRadius: "3px",
24
+ },
26
25
  },
27
- },
28
- "& .MuiInputBase-input": {
29
- color: "#333333",
30
- fontFamily: "Rubik",
31
- fontSize: 14,
32
- borderRadius: "3px",
33
- padding: "9px 5px 9px 4px",
34
- Width: "160px",
35
- "&::placeholder": {
36
- opacity: 1,
37
- color: "#717171",
38
- fontFamily: "Rubik",
39
- fontSize: 14,
40
- padding: "9px 5px 9px 4px",
26
+ "& .MuiInputBase-input": {
27
+ color: "#333333",
28
+ fontFamily: "Rubik",
29
+ fontSize: 14,
30
+ borderRadius: "3px",
31
+ padding: "9px",
32
+ Width: "170px",
33
+ "&::placeholder": {
34
+ opacity: 1,
35
+ color: "#717171",
36
+ fontFamily: "Rubik",
37
+ fontSize: 14,
38
+ },
41
39
  },
42
- },
43
40
  };
44
41
 
45
- const DateField = ({ label, value, onChange }) => {
42
+ const DateField = ({ label, value, handlDateTimeChange }) => {
46
43
  return (
47
- <LocalizationProvider dateAdapter={AdapterDayjs}>
48
- <InputLabel
49
- data-testid={`${kebabCase(label)}-date`}
50
- style={{ marginBottom: 0, height: 16 }}
51
- sx={[
52
- {
53
- backgroundColor: "transparent",
54
- textTransform: "none",
55
- height: 17,
56
- left: 0,
57
- right: 0,
58
- top: 0,
59
- fontFamily: "Rubik",
60
- fontStyle: "normal",
61
- fontWeight: 500,
62
- fontSize: 14,
63
- color: "#333333",
64
- },
65
- ]}
66
- >
67
- {`${label} Date`}
68
- </InputLabel>
69
- <DatePicker
70
- disableOpenPicker
71
- value={value ? value : null}
72
- onChange={onChange}
73
- slotProps={{
74
- textField: {
75
- id: "date",
76
- sx: textFieldStyle,
77
- InputProps: {
78
- startAdornment: (
79
- <InputAdornment
80
- position="start"
81
- style={{
82
- color: "#515151",
83
- left: "10.42%",
84
- }}
85
- >
86
- <EventIcon />
87
- </InputAdornment>
88
- ),
89
- },
90
- },
91
- }}
92
- />
93
- </LocalizationProvider>
44
+ <LocalizationProvider dateAdapter={AdapterDayjs}>
45
+ <InputLabel
46
+ data-testid={`${kebabCase(label)}-date`}
47
+ style={{ marginBottom: 0, height: 16 }}
48
+ sx={[
49
+ {
50
+ backgroundColor: "transparent",
51
+ textTransform: "none",
52
+ height: 17,
53
+ left: 0,
54
+ right: 0,
55
+ top: 0,
56
+ fontFamily: "Rubik",
57
+ fontStyle: "normal",
58
+ fontWeight: 500,
59
+ fontSize: 14,
60
+ color: "#333333",
61
+ },
62
+ ]}
63
+ >
64
+ {`${label} Date`}
65
+ </InputLabel>
66
+ <DatePicker
67
+ value={value ? value : null}
68
+ onChange={handlDateTimeChange}
69
+ slotProps={{
70
+ textField: {
71
+ id: "date",
72
+ sx: dateTextFieldStyle,
73
+ },
74
+ }}
75
+ />
76
+ </LocalizationProvider>
94
77
  );
95
78
  };
96
79
  DateField.propTypes = {
97
80
  label: PropTypes.string.isRequired,
98
81
  value: PropTypes.any,
99
- onChange: PropTypes.func.isRequired,
82
+ handlDateTimeChange: PropTypes.func.isRequired,
100
83
  };
101
84
 
102
85
  export default DateField;
@@ -9,7 +9,7 @@ export default {
9
9
  };
10
10
  export const DateFieldComponent = (args) => {
11
11
  const [value, setValue] = useState("");
12
- const handleChange = (e) => {
12
+ const handlDateTimeChange = (e) => {
13
13
  console.log("Handle change triggered", e.target.value);
14
14
  setValue(e.target.value);
15
15
  };
@@ -17,7 +17,7 @@ export const DateFieldComponent = (args) => {
17
17
  <div className="qpp-u-padding--16">
18
18
  <DateField
19
19
  label="Status"
20
- onChange={handleChange}
20
+ handlDateTimeChange={handlDateTimeChange}
21
21
  value={value}
22
22
  />
23
23
  </div>