@ctlyst.id/internal-ui 3.4.5 → 3.4.6

Sign up to get free protection for your applications and to get access to all the features.
package/dist/index.js CHANGED
@@ -5876,7 +5876,6 @@ var Uploader = ({
5876
5876
  onDrop,
5877
5877
  maxFiles: 1,
5878
5878
  noClick: isDisabled,
5879
- disabled: !!filePreview,
5880
5879
  noDrag: isDisabled
5881
5880
  });
5882
5881
  const renderHelperText = () => {
@@ -5979,60 +5978,49 @@ var Uploader = ({
5979
5978
  )
5980
5979
  }
5981
5980
  ) }),
5982
- !filePreview && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [
5983
- /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5984
- "input",
5985
- {
5986
- "data-test-id": `CT_component_base-image-uploader_input-file${testId ? `_${testId}` : ""}`,
5987
- ...getInputProps()
5988
- }
5989
- ),
5990
- isDragActive ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react88.Text, { children: dragActiveText != null ? dragActiveText : messages.dragActive }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react88.Flex, { gap: 2, flexDirection: "column", alignItems: "center", color: isError ? "danger.500" : color, children: [
5991
- size2 === "sm" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_internal_icon11.Plus, { size: 6, color }),
5992
- /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react88.Box, { children: [
5993
- !filePreview && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5994
- import_react88.Heading,
5995
- {
5996
- fontWeight: "400",
5997
- fontSize: size2 === "sm" ? "text.md" : "text.xl",
5998
- mb: size2 === "sm" ? "0" : "2",
5999
- textAlign: "center",
6000
- children: uploadFileText && size2 === "lg" ? uploadFileText : "Upload"
6001
- }
6002
- ),
6003
- size2 === "lg" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react88.Text, { fontSize: 12, children: filePreview ? dragReplaceText != null ? dragReplaceText : messages.dragReplace : dragInActiveText != null ? dragInActiveText : messages.dragInActive })
6004
- ] })
5981
+ !filePreview && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_jsx_runtime66.Fragment, { children: isDragActive ? /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react88.Text, { children: dragActiveText != null ? dragActiveText : messages.dragActive }) : /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react88.Flex, { gap: 2, flexDirection: "column", alignItems: "center", color: isError ? "danger.500" : color, children: [
5982
+ size2 === "sm" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_internal_icon11.Plus, { size: 6, color }),
5983
+ /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react88.Box, { children: [
5984
+ !filePreview && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5985
+ import_react88.Heading,
5986
+ {
5987
+ fontWeight: "400",
5988
+ fontSize: size2 === "sm" ? "text.md" : "text.xl",
5989
+ mb: size2 === "sm" ? "0" : "2",
5990
+ textAlign: "center",
5991
+ children: uploadFileText && size2 === "lg" ? uploadFileText : "Upload"
5992
+ }
5993
+ ),
5994
+ size2 === "lg" && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react88.Text, { fontSize: 12, children: filePreview ? dragReplaceText != null ? dragReplaceText : messages.dragReplace : dragInActiveText != null ? dragInActiveText : messages.dragInActive })
6005
5995
  ] })
6006
- ] })
5996
+ ] }) })
6007
5997
  ]
6008
5998
  }
6009
5999
  ),
6010
- filePreview && !isSmall && /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_react88.Flex, { align: "center", justify: "center", my: 2, children: [
6011
- /* @__PURE__ */ (0, import_react90.createElement)(
6012
- "input",
6013
- {
6014
- ...getInputProps(),
6015
- key: Math.random(),
6016
- ref: inputRef,
6017
- accept: "image/*",
6018
- "data-test-id": `CT_component_base-image-uploader_change-img${testId ? `_${testId}` : ""}`
6019
- }
6020
- ),
6021
- isShowReupload && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6022
- import_react88.Button,
6023
- {
6024
- "data-test-id": `CT_component_base-image-uploader_change-img-btn${testId ? `_${testId}` : ""}`,
6025
- type: "button",
6026
- size: "sm",
6027
- variant: "outline",
6028
- onClick: () => {
6029
- var _a;
6030
- (_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.click();
6031
- },
6032
- children: "Ubah Foto"
6033
- }
6034
- )
6035
- ] }),
6000
+ /* @__PURE__ */ (0, import_react90.createElement)(
6001
+ "input",
6002
+ {
6003
+ ...getInputProps(),
6004
+ key: Math.random(),
6005
+ ref: inputRef,
6006
+ accept: "image/*",
6007
+ "data-test-id": `CT_component_base-image-uploader_change-img${testId ? `_${testId}` : ""}`
6008
+ }
6009
+ ),
6010
+ filePreview && !isSmall && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_react88.Flex, { align: "center", justify: "center", my: 2, children: isShowReupload && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
6011
+ import_react88.Button,
6012
+ {
6013
+ "data-test-id": `CT_component_base-image-uploader_change-img-btn${testId ? `_${testId}` : ""}`,
6014
+ type: "button",
6015
+ size: "sm",
6016
+ variant: "outline",
6017
+ onClick: () => {
6018
+ var _a;
6019
+ (_a = inputRef == null ? void 0 : inputRef.current) == null ? void 0 : _a.click();
6020
+ },
6021
+ children: "Ubah Foto"
6022
+ }
6023
+ ) }),
6036
6024
  renderErrorText(errorText),
6037
6025
  renderHelperText()
6038
6026
  ] });