@swan-io/shared-business 11.1.3 → 11.1.5
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 +4 -4
- package/src/components/FileTile.js +11 -8
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@swan-io/shared-business",
|
|
3
|
-
"version": "11.1.
|
|
3
|
+
"version": "11.1.5",
|
|
4
4
|
"engines": {
|
|
5
5
|
"node": ">=20.9.0",
|
|
6
|
-
"pnpm": "9.
|
|
6
|
+
"pnpm": "^9.13.0"
|
|
7
7
|
},
|
|
8
8
|
"files": [
|
|
9
9
|
"LICENSE",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
],
|
|
27
27
|
"license": "MIT",
|
|
28
28
|
"peerDependencies": {
|
|
29
|
-
"@swan-io/lake": "11.1.
|
|
29
|
+
"@swan-io/lake": "11.1.5"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@formatjs/intl": "^2.10.9",
|
|
@@ -53,6 +53,6 @@
|
|
|
53
53
|
"@types/uuid": "^10.0.0",
|
|
54
54
|
"jsdom": "^25.0.1",
|
|
55
55
|
"vitest": "^2.1.3",
|
|
56
|
-
"@swan-io/lake": "11.1.
|
|
56
|
+
"@swan-io/lake": "11.1.5"
|
|
57
57
|
}
|
|
58
58
|
}
|
|
@@ -44,6 +44,9 @@ const styles = StyleSheet.create({
|
|
|
44
44
|
borderRadius: 2,
|
|
45
45
|
backgroundColor: colors.current[500],
|
|
46
46
|
},
|
|
47
|
+
id: {
|
|
48
|
+
alignSelf: "flex-start",
|
|
49
|
+
},
|
|
47
50
|
});
|
|
48
51
|
export const FileTile = ({ file: { id, statusInfo, name, url }, showId = false, onRemove, }) => {
|
|
49
52
|
const [isDeleting, setIsDeleting] = useState(false);
|
|
@@ -71,14 +74,14 @@ export const FileTile = ({ file: { id, statusInfo, name, url }, showId = false,
|
|
|
71
74
|
], 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
75
|
.with({ status: P.union("Uploaded", "Pending") }, () => "shakespear")
|
|
73
76
|
.with({ status: "Refused" }, () => "negative")
|
|
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"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
77
|
+
.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(View, { style: styles.id, children: _jsx(LakeTooltip, { describedBy: "copy", onHide: () => setVisibleState("copy"), togglableOnFocus: true, content: visibleState === "copy"
|
|
78
|
+
? t("copyButton.copyTooltip")
|
|
79
|
+
: t("copyButton.copiedTooltip"), children: _jsx(Pressable, { onPress: event => {
|
|
80
|
+
event.stopPropagation();
|
|
81
|
+
event.preventDefault();
|
|
82
|
+
setClipboardText(id);
|
|
83
|
+
setVisibleState("copied");
|
|
84
|
+
}, children: _jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(LakeText, { numberOfLines: 1, variant: "smallRegular", children: t("fileTile.id", { id }) }), _jsx(Space, { width: 4 }), _jsx(Icon, { size: 14, name: "copy-regular" })] }) }) }) })) : null] }), _jsx(Space, { width: 12 }), isNotNullishOrEmpty(url) && (_jsx(LakeButton, { mode: "tertiary", size: "small", icon: "open-filled", onPress: () => {
|
|
82
85
|
window.open(url, "_blank");
|
|
83
86
|
}, 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)
|
|
84
87
|
.with({ status: "Pending" }, () => (_jsx(LakeAlert, { anchored: true, title: t("fileTile.status.Pending"), variant: "info" })))
|