sprint-asia-custom-component 0.1.130 → 0.1.131

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/dist/index.js CHANGED
@@ -26055,13 +26055,16 @@
26055
26055
  onDrop,
26056
26056
  maxFiles = 1,
26057
26057
  selectedFile,
26058
- error = ""
26058
+ error = "",
26059
+ disabled
26059
26060
  }) => {
26060
26061
  const [errorMessage, setErrorMessage] = React.useState("");
26061
26062
  const onDropRejected = rejectedFiles => {
26062
26063
  const file = rejectedFiles[0];
26063
26064
  if (file.errors[0]?.code === "file-too-large") {
26064
- setErrorMessage("Your file is too large, Max file size is 5 MB");
26065
+ setErrorMessage("Your file is too large. Max file size is 5 MB");
26066
+ } else if (file.errors[0]?.code === "file-invalid-type") {
26067
+ setErrorMessage("File format not supported. Please try again with PNG, JPEG, JPG, or PDF file within 5 MB");
26065
26068
  }
26066
26069
  };
26067
26070
  const {
@@ -26071,12 +26074,14 @@
26071
26074
  onDrop,
26072
26075
  maxFiles,
26073
26076
  accept: {
26074
- "image/*": [".jpeg", ".png"],
26077
+ "image/jpeg": [".jpeg", ".jpg"],
26078
+ "image/png": [".png"],
26075
26079
  "application/pdf": [".pdf"]
26076
26080
  },
26077
26081
  noKeyboard: true,
26078
26082
  maxSize: 5242881,
26079
- onDropRejected
26083
+ onDropRejected,
26084
+ disabled
26080
26085
  });
26081
26086
  return /*#__PURE__*/React__default["default"].createElement("div", {
26082
26087
  className: "w-full"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "sprint-asia-custom-component",
3
3
  "main": "dist/index.js",
4
- "version": "0.1.130",
4
+ "version": "0.1.131",
5
5
  "private": false,
6
6
  "dependencies": {
7
7
  "@headlessui/react": "^1.7.18",
@@ -10,13 +10,16 @@ const DropzoneUploadFile = ({
10
10
  maxFiles = 1,
11
11
  selectedFile,
12
12
  error = "",
13
+ disabled,
13
14
  }) => {
14
15
  const [errorMessage, setErrorMessage] = useState("");
15
16
 
16
17
  const onDropRejected = (rejectedFiles) => {
17
18
  const file = rejectedFiles[0];
18
19
  if (file.errors[0]?.code === "file-too-large") {
19
- setErrorMessage("Your file is too large, Max file size is 5 MB");
20
+ setErrorMessage("Your file is too large. Max file size is 5 MB");
21
+ } else if (file.errors[0]?.code === "file-invalid-type") {
22
+ setErrorMessage("File format not supported. Please try again with PNG, JPEG, JPG, or PDF file within 5 MB");
20
23
  }
21
24
  };
22
25
 
@@ -24,12 +27,14 @@ const DropzoneUploadFile = ({
24
27
  onDrop,
25
28
  maxFiles,
26
29
  accept: {
27
- "image/*": [".jpeg", ".png"],
30
+ "image/jpeg": [".jpeg", ".jpg"],
31
+ "image/png": [".png"],
28
32
  "application/pdf": [".pdf"],
29
33
  },
30
34
  noKeyboard: true,
31
35
  maxSize: 5242881,
32
36
  onDropRejected,
37
+ disabled,
33
38
  });
34
39
 
35
40
  return (