@swan-io/shared-business 8.15.2 → 8.15.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-io/shared-business",
3
- "version": "8.15.2",
3
+ "version": "8.15.4",
4
4
  "engines": {
5
5
  "node": ">=20.9.0",
6
6
  "yarn": "^1.22.0"
@@ -9,7 +9,7 @@ import { Pressable } from "@swan-io/lake/src/components/Pressable";
9
9
  import { Space } from "@swan-io/lake/src/components/Space";
10
10
  import { Tag } from "@swan-io/lake/src/components/Tag";
11
11
  import { commonStyles } from "@swan-io/lake/src/constants/commonStyles";
12
- import { backgroundColor, colors, gray75, shadows, spacings, } from "@swan-io/lake/src/constants/design";
12
+ import { backgroundColor, colors, gray75, spacings } from "@swan-io/lake/src/constants/design";
13
13
  import { setClipboardText } from "@swan-io/lake/src/utils/clipboard";
14
14
  import { getIconNameFromFilename } from "@swan-io/lake/src/utils/file";
15
15
  import { isNotNullish, isNotNullishOrEmpty } from "@swan-io/lake/src/utils/nullish";
@@ -22,7 +22,7 @@ const styles = StyleSheet.create({
22
22
  base: {
23
23
  backgroundColor: backgroundColor.accented,
24
24
  borderRadius: 8,
25
- boxShadow: shadows.tile,
25
+ borderWidth: 1,
26
26
  overflow: "hidden",
27
27
  },
28
28
  content: {
@@ -58,7 +58,17 @@ export const FileTile = ({ file: { id, statusInfo, name, url }, showId = false,
58
58
  }
59
59
  }, [onRemove]);
60
60
  const [visibleState, setVisibleState] = useState("copy");
61
- return (_jsxs(Box, { style: styles.base, 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)
61
+ return (_jsxs(Box, { style: [
62
+ styles.base,
63
+ {
64
+ borderColor: match(statusInfo.status)
65
+ .with("Uploaded", "Uploading", () => colors.gray[100])
66
+ .with("Pending", () => colors.shakespear[100])
67
+ .with("Validated", () => colors.positive[100])
68
+ .with("Refused", () => colors.negative[100])
69
+ .exhaustive(),
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)
62
72
  .with({ status: P.union("Uploaded", "Pending") }, () => "shakespear")
63
73
  .with({ status: "Validated" }, () => "positive")
64
74
  .with({ status: "Refused" }, () => "negative")
@@ -64,6 +64,8 @@ const styles = StyleSheet.create({
64
64
  swanLogo: {
65
65
  height: 8,
66
66
  width: (45 / 10) * 8,
67
+ position: "relative",
68
+ top: 0.5,
67
69
  },
68
70
  });
69
71
  const Line = ({ name, value }) => (_jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(Text, { style: styles.lineName, children: name }), _jsx(Fill, { minWidth: 8 }), _jsx(Text, { style: styles.lineValue, children: value })] }));
@@ -83,7 +85,7 @@ export const TransactionStatementV1 = ({ partnerLogoUrl, generationDate, executi
83
85
  .with("InternalCreditTransferOut", () => t("transactionStatement.type.InternalCreditTransferOut"))
84
86
  .with("InternationalCreditTransferIn", () => t("transactionStatement.type.InternationalCreditTransferIn"))
85
87
  .with("InternationalCreditTransferOut", () => t("transactionStatement.type.InternationalCreditTransferOut"))
86
- .exhaustive() }), isNotNullish(instructedAmount) && (_jsx(Line, { name: t("transactionStatement.information.instructedAmount"), value: formatCurrencyIso(Number(instructedAmount.value), instructedAmount.currency) })), isNotNullish(amountCredited) && (_jsx(Line, { name: t("transactionStatement.information.amountCredited"), value: formatCurrencyIso(Number(amountCredited.value), amountCredited.currency) })), isNotNullish(amount) && (_jsx(Line, { name: t("transactionStatement.information.amount"), value: formatCurrencyIso(Number(amount.value), amount.currency) })), isNotNullish(targetTransferAmount) && (_jsx(Line, { name: t("transactionStatement.information.targetTransferAmount"), value: formatCurrencyIso(Number(targetTransferAmount.value), targetTransferAmount.currency) })), isNotNullish(exchangeRate) && (_jsx(Line, { name: t("transactionStatement.information.exchangeRate"), value: `${formatCurrencyIso(Number(exchangeRate[0].value), exchangeRate[0].currency)} = ${formatCurrencyIso(Number(exchangeRate[1].value), exchangeRate[1].currency)}` })), isNotNullish(fees) && (_jsx(Line, { name: t("transactionStatement.information.fees"), value: formatCurrencyIso(Number(fees.value), fees.currency) })), _jsx(Line, { name: "Label", value: label }), isNotNullish(reference) && _jsx(Line, { name: "Reference", value: reference })] }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.sectionTitle, children: t("transactionStatement.title.debtor") }), _jsx(Space, { height: 8 }), _jsxs(Stack, { space: 8, children: [_jsx(Line, { name: t("transactionStatement.debtor.name"), value: debtorName }), _jsx(Line, { name: t("transactionStatement.debtor.accountNumber"), value: debtorAccountNumber }), isNotNullishOrEmpty(debtorBankName) && (_jsx(Line, { name: t("transactionStatement.debtor.bankName"), value: debtorBankName })), isNotNullishOrEmpty(debtorBankIdentifier) && (_jsx(Line, { name: t("transactionStatement.debtor.bankIdentifier"), value: debtorBankIdentifier }))] }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.sectionTitle, children: t("transactionStatement.title.creditor") }), _jsx(Space, { height: 8 }), _jsxs(Stack, { space: 8, children: [_jsx(Line, { name: t("transactionStatement.creditor.name"), value: creditorName }), _jsx(Line, { name: t("transactionStatement.creditor.accountNumber"), value: creditorAccountNumber }), isNotNullishOrEmpty(creditorBankName) && (_jsx(Line, { name: t("transactionStatement.creditor.bankName"), value: creditorBankName })), isNotNullishOrEmpty(creditorBankIdentifier) && (_jsx(Line, { name: t("transactionStatement.creditor.bankIdentifier"), value: creditorBankIdentifier }))] }), _jsx(Fill, { minHeight: 8 }), _jsx(Text, { style: styles.generationInfos, children: t("transactionStatement.generationDate", { date: generationDate }) }), _jsx(Space, { height: 8 }), _jsx(Text, { style: styles.generationInfos, children: t("transactionStatement.generationInfos") }), _jsx(Separator, { space: 24 }), _jsx(Text, { style: styles.footer, children: t("transactionStatement.footer") })] }));
88
+ .exhaustive() }), isNotNullish(instructedAmount) && (_jsx(Line, { name: t("transactionStatement.information.instructedAmount"), value: formatCurrencyIso(Number(instructedAmount.value), instructedAmount.currency) })), isNotNullish(amountCredited) && (_jsx(Line, { name: t("transactionStatement.information.amountCredited"), value: formatCurrencyIso(Number(amountCredited.value), amountCredited.currency) })), isNotNullish(amount) && (_jsx(Line, { name: t("transactionStatement.information.amount"), value: formatCurrencyIso(Number(amount.value), amount.currency) })), isNotNullish(targetTransferAmount) && (_jsx(Line, { name: t("transactionStatement.information.targetTransferAmount"), value: formatCurrencyIso(Number(targetTransferAmount.value), targetTransferAmount.currency) })), isNotNullish(exchangeRate) && (_jsx(Line, { name: t("transactionStatement.information.exchangeRate"), value: `${formatCurrencyIso(Number(exchangeRate[0].value), exchangeRate[0].currency)} = ${formatCurrencyIso(Number(exchangeRate[1].value), exchangeRate[1].currency)}` })), isNotNullish(fees) && (_jsx(Line, { name: t("transactionStatement.information.fees"), value: formatCurrencyIso(Number(fees.value), fees.currency) })), _jsx(Line, { name: t("transactionStatement.information.label"), value: label }), isNotNullish(reference) && (_jsx(Line, { name: t("transactionStatement.information.reference"), value: reference }))] }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.sectionTitle, children: t("transactionStatement.title.debtor") }), _jsx(Space, { height: 8 }), _jsxs(Stack, { space: 8, children: [_jsx(Line, { name: t("transactionStatement.debtor.name"), value: debtorName }), _jsx(Line, { name: t("transactionStatement.debtor.accountNumber"), value: debtorAccountNumber }), isNotNullishOrEmpty(debtorBankName) && (_jsx(Line, { name: t("transactionStatement.debtor.bankName"), value: debtorBankName })), isNotNullishOrEmpty(debtorBankIdentifier) && (_jsx(Line, { name: t("transactionStatement.debtor.bankIdentifier"), value: debtorBankIdentifier }))] }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.sectionTitle, children: t("transactionStatement.title.creditor") }), _jsx(Space, { height: 8 }), _jsxs(Stack, { space: 8, children: [_jsx(Line, { name: t("transactionStatement.creditor.name"), value: creditorName }), _jsx(Line, { name: t("transactionStatement.creditor.accountNumber"), value: creditorAccountNumber }), isNotNullishOrEmpty(creditorBankName) && (_jsx(Line, { name: t("transactionStatement.creditor.bankName"), value: creditorBankName })), isNotNullishOrEmpty(creditorBankIdentifier) && (_jsx(Line, { name: t("transactionStatement.creditor.bankIdentifier"), value: creditorBankIdentifier }))] }), _jsx(Fill, { minHeight: 8 }), _jsx(Text, { style: styles.generationInfos, children: t("transactionStatement.generationDate", { date: generationDate }) }), _jsx(Space, { height: 8 }), _jsx(Text, { style: styles.generationInfos, children: t("transactionStatement.generationInfos") }), _jsx(Separator, { space: 24 }), _jsx(Text, { style: styles.footer, children: t("transactionStatement.footer") })] }));
87
89
  };
88
90
  export const TransactionStatement = (props) => match(props)
89
91
  .with({ version: "v1" }, props => _jsx(TransactionStatementV1, { ...props }))