@swan-io/shared-business 8.15.7 → 8.15.9
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/package.json
CHANGED
|
@@ -64,15 +64,14 @@ export const FileTile = ({ file: { id, statusInfo, name, url }, showId = false,
|
|
|
64
64
|
borderColor: match(statusInfo.status)
|
|
65
65
|
.with("Uploaded", "Uploading", () => colors.gray[100])
|
|
66
66
|
.with("Pending", () => colors.shakespear[100])
|
|
67
|
-
.with("Validated", () => colors.positive[
|
|
67
|
+
.with("Validated", () => colors.positive[500])
|
|
68
68
|
.with("Refused", () => colors.negative[100])
|
|
69
69
|
.exhaustive(),
|
|
70
70
|
},
|
|
71
|
-
], children: [_jsx(Box, { alignItems: "center", direction: "row", style: styles.content, children: statusInfo.status === "Uploading" ? (_jsxs(_Fragment, { children: [_jsx(LakeText, { numberOfLines: 1, color: colors.gray[700], children: t("fileTile.uploading") }), _jsx(Space, { width: 20 }), _jsx(View, { role: "progressbar", style: styles.progressBar, children: _jsx(View, { style: [styles.progress, { width: `${statusInfo.progress * 100}%` }] }) })] })) : (_jsxs(_Fragment, { children: [_jsx(Tag, { icon: getIconNameFromFilename(name), iconSize: 20, color: match(statusInfo)
|
|
71
|
+
], children: [_jsx(Box, { alignItems: "center", direction: "row", style: styles.content, children: statusInfo.status === "Uploading" ? (_jsxs(_Fragment, { children: [_jsx(LakeText, { numberOfLines: 1, color: colors.gray[700], children: t("fileTile.uploading") }), _jsx(Space, { width: 20 }), _jsx(View, { role: "progressbar", style: styles.progressBar, children: _jsx(View, { style: [styles.progress, { width: `${statusInfo.progress * 100}%` }] }) })] })) : (_jsxs(_Fragment, { children: [statusInfo.status === "Validated" ? (_jsx(Icon, { size: 24, color: colors.positive[500], name: "checkmark-circle-regular" })) : (_jsx(Tag, { icon: getIconNameFromFilename(name), iconSize: 20, color: match(statusInfo)
|
|
72
72
|
.with({ status: P.union("Uploaded", "Pending") }, () => "shakespear")
|
|
73
|
-
.with({ status: "Validated" }, () => "positive")
|
|
74
73
|
.with({ status: "Refused" }, () => "negative")
|
|
75
|
-
.exhaustive() }), _jsx(Space, { width: 16 }), _jsxs(Box, { grow: 1, children: [_jsx(LakeText, { numberOfLines: 1, color: colors.gray[700], style: commonStyles.fill, children: name }), showId ? (_jsx(LakeTooltip, { describedBy: "copy", onHide: () => setVisibleState("copy"), togglableOnFocus: true, content: visibleState === "copy"
|
|
74
|
+
.exhaustive() })), _jsx(Space, { width: 16 }), _jsxs(Box, { grow: 1, children: [_jsx(LakeText, { numberOfLines: 1, color: colors.gray[700], style: commonStyles.fill, children: name }), showId ? (_jsx(LakeTooltip, { describedBy: "copy", onHide: () => setVisibleState("copy"), togglableOnFocus: true, content: visibleState === "copy"
|
|
76
75
|
? t("copyButton.copyTooltip")
|
|
77
76
|
: t("copyButton.copiedTooltip"), children: _jsx(Pressable, { onPress: event => {
|
|
78
77
|
event.stopPropagation();
|
|
@@ -83,7 +82,6 @@ export const FileTile = ({ file: { id, statusInfo, name, url }, showId = false,
|
|
|
83
82
|
window.open(url, "_blank");
|
|
84
83
|
}, ariaLabel: t("common.open") })), isNotNullish(onRemove) && (_jsx(LakeButton, { mode: "tertiary", size: "small", icon: "delete-regular", color: "negative", onPress: () => setIsDeleteModalVisible(true), ariaLabel: t("common.remove") })), _jsx(LakeModal, { title: t("fileTile.deleteModal.title"), icon: "subtract-circle-regular", visible: isDeleteModalVisible, onPressClose: () => setIsDeleteModalVisible(false), color: "negative", children: _jsx(LakeButtonGroup, { paddingBottom: 0, children: _jsx(LakeButton, { loading: isDeleting, grow: true, color: "negative", onPress: onPressRemove, children: t("fileTile.deleteModal.delete") }) }) })] })) }), match(statusInfo)
|
|
85
84
|
.with({ status: "Pending" }, () => (_jsx(LakeAlert, { anchored: true, title: t("fileTile.status.Pending"), variant: "info" })))
|
|
86
|
-
.with({ status: "Validated" }, () => (_jsx(LakeAlert, { anchored: true, title: t("fileTile.status.Validated"), variant: "success" })))
|
|
87
85
|
.with({ status: "Refused" }, ({ reason }) => (_jsx(LakeAlert, { anchored: true, title: t("fileTile.status.Refused"), variant: "error", children: reason })))
|
|
88
86
|
.otherwise(() => null)] }));
|
|
89
87
|
};
|