@swan-io/shared-business 18.0.4 → 18.1.0

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": "18.0.4",
3
+ "version": "18.1.0",
4
4
  "engines": {
5
5
  "node": ">22.12.0"
6
6
  },
@@ -28,7 +28,7 @@
28
28
  "react": ">=19.0.0",
29
29
  "react-dom": ">=19.0.0",
30
30
  "react-native-web": ">=0.21.2",
31
- "@swan-io/lake": "18.0.4"
31
+ "@swan-io/lake": "18.1.0"
32
32
  },
33
33
  "dependencies": {
34
34
  "@formatjs/intl": "^4.1.16",
@@ -53,6 +53,6 @@
53
53
  "react-dom": "^19.2.7",
54
54
  "react-native-web": "^0.21.2",
55
55
  "type-fest": "^5.8.0",
56
- "@swan-io/lake": "18.0.4"
56
+ "@swan-io/lake": "18.1.0"
57
57
  }
58
58
  }
@@ -1,7 +1,8 @@
1
1
  import { type SupportedLanguage } from "../utils/i18n";
2
2
  type AccountStatementHeaderProps = {
3
3
  partnerLogoUrl?: string;
4
+ partnerLogoAlt?: string;
4
5
  language?: SupportedLanguage;
5
6
  };
6
- export declare const AccountStatementHeader: ({ partnerLogoUrl, language, }: AccountStatementHeaderProps) => import("react").JSX.Element;
7
+ export declare const AccountStatementHeader: ({ partnerLogoUrl, partnerLogoAlt, language, }: AccountStatementHeaderProps) => import("react").JSX.Element;
7
8
  export {};
@@ -57,7 +57,7 @@ const logoStyle = {
57
57
  objectFit: "contain",
58
58
  objectPosition: "left",
59
59
  };
60
- export const AccountStatementHeader = ({ partnerLogoUrl, language, }) => {
60
+ export const AccountStatementHeader = ({ partnerLogoUrl, partnerLogoAlt, language, }) => {
61
61
  const t = useTranslation(language);
62
- return (_jsxs("div", { style: styles.container, children: [_jsx("div", { style: styles.logo, children: isNotNullishOrEmpty(partnerLogoUrl) ? (_jsxs(_Fragment, { children: [_jsx("img", { src: partnerLogoUrl, style: logoStyle }), _jsxs("div", { style: styles.partnership, children: [_jsx("div", { style: styles.partnershipText, children: t("accountStatement.partnership") }), _jsx(SwanLogo, { color: colors.gray[900], style: styles.swanLogo })] })] })) : (_jsx(SwanLogo, { style: styles.defaultLogo })) }), _jsxs("div", { style: styles.pageNumber, children: [t("accountStatement.page"), " ", _jsx("span", { className: "pageNumber" }), "/", _jsx("span", { className: "totalPages" })] })] }));
62
+ return (_jsxs("div", { style: styles.container, children: [_jsx("div", { style: styles.logo, children: isNotNullishOrEmpty(partnerLogoUrl) ? (_jsxs(_Fragment, { children: [_jsx("img", { src: partnerLogoUrl, alt: partnerLogoAlt, style: logoStyle }), _jsxs("div", { style: styles.partnership, children: [_jsx("div", { style: styles.partnershipText, children: t("accountStatement.partnership") }), _jsx(SwanLogo, { color: colors.gray[900], style: styles.swanLogo })] })] })) : (_jsx(SwanLogo, { style: styles.defaultLogo })) }), _jsxs("div", { style: styles.pageNumber, children: [t("accountStatement.page"), " ", _jsx("span", { className: "pageNumber" }), "/", _jsx("span", { className: "totalPages" })] })] }));
63
63
  };
@@ -26,6 +26,7 @@ type Transaction = {
26
26
  type CreditStatementV1Props = {
27
27
  version: "v1";
28
28
  partnerLogoUrl?: string;
29
+ partnerLogoAlt?: string;
29
30
  style?: StyleProp<ViewStyle>;
30
31
  accountHolderType: "Individual" | "Company";
31
32
  accountHolderName: string;
@@ -41,7 +42,7 @@ type CreditStatementV1Props = {
41
42
  repaymentDate: string;
42
43
  closingBalance: Amount;
43
44
  };
44
- export declare const CreditStatementV1: ({ partnerLogoUrl, accountHolderType, accountHolderName, accountHolderAddress, iban, bic, openingDate, closingDate, transactions, issueDate, issuerName, siret, repaymentDate, closingBalance, }: CreditStatementV1Props) => import("react").JSX.Element;
45
+ export declare const CreditStatementV1: ({ partnerLogoUrl, partnerLogoAlt, accountHolderType, accountHolderName, accountHolderAddress, iban, bic, openingDate, closingDate, transactions, issueDate, issuerName, siret, repaymentDate, closingBalance, }: CreditStatementV1Props) => import("react").JSX.Element;
45
46
  export type CreditStatementProps = CreditStatementV1Props;
46
47
  export declare const CreditStatement: (props: CreditStatementProps) => import("react").JSX.Element;
47
48
  export {};
@@ -96,8 +96,8 @@ const logoStyle = {
96
96
  objectPosition: "left",
97
97
  };
98
98
  const formatMaskedPan = (value) => `••${value.slice(-4)}`;
99
- export const CreditStatementV1 = ({ partnerLogoUrl, accountHolderType, accountHolderName, accountHolderAddress, iban, bic, openingDate, closingDate, transactions, issueDate, issuerName, siret, repaymentDate, closingBalance, }) => {
100
- return (_jsxs(Box, { style: styles.container, direction: "column", justifyContent: "spaceBetween", children: [_jsxs(Box, { direction: "row", justifyContent: "spaceBetween", alignItems: "start", children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [isNotNullishOrEmpty(partnerLogoUrl) ? (_jsx("img", { src: partnerLogoUrl, style: logoStyle })) : (_jsx(SwanLogo, { style: styles.defaultLogo })), _jsx(Separator, { horizontal: true, space: 8 }), _jsx(LakeText, { style: styles.mediumText, children: t("accountStatement.partnership") }), _jsx(Space, { width: 4 }), _jsx(SwanLogo, { color: colors.gray[900], style: styles.swanLogo })] }), _jsxs(Box, { children: [_jsx(LakeText, { style: styles.pageTitle, children: t("creditStatement.titleDocument") }), _jsx(LakeText, { style: styles.text, color: colors.gray[700], children: accountHolderType === "Company"
99
+ export const CreditStatementV1 = ({ partnerLogoUrl, partnerLogoAlt, accountHolderType, accountHolderName, accountHolderAddress, iban, bic, openingDate, closingDate, transactions, issueDate, issuerName, siret, repaymentDate, closingBalance, }) => {
100
+ return (_jsxs(Box, { style: styles.container, direction: "column", justifyContent: "spaceBetween", children: [_jsxs(Box, { direction: "row", justifyContent: "spaceBetween", alignItems: "start", children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [isNotNullishOrEmpty(partnerLogoUrl) ? (_jsx("img", { src: partnerLogoUrl, alt: partnerLogoAlt, style: logoStyle })) : (_jsx(SwanLogo, { style: styles.defaultLogo })), _jsx(Separator, { horizontal: true, space: 8 }), _jsx(LakeText, { style: styles.mediumText, children: t("accountStatement.partnership") }), _jsx(Space, { width: 4 }), _jsx(SwanLogo, { color: colors.gray[900], style: styles.swanLogo })] }), _jsxs(Box, { children: [_jsx(LakeText, { style: styles.pageTitle, children: t("creditStatement.titleDocument") }), _jsx(LakeText, { style: styles.text, color: colors.gray[700], children: accountHolderType === "Company"
101
101
  ? t("accountStatement.titleDocument.companyDescription")
102
102
  : t("accountStatement.titleDocument.individualDescription") }), _jsx(LakeText, { align: "right", style: styles.smallText, children: t("creditStatement.issueDate", {
103
103
  issueDate: dayjs(issueDate).format(locale.dateFormat),
@@ -14,6 +14,7 @@ type RIBv1Props = {
14
14
  iban: string;
15
15
  partnerColor: string;
16
16
  partnerLogoUrl?: string;
17
+ partnerLogoAlt?: string;
17
18
  } & ({
18
19
  accountCountry: "FRA";
19
20
  agency: string;
@@ -67,7 +67,7 @@ const logoStyle = {
67
67
  objectFit: "contain",
68
68
  objectPosition: "left",
69
69
  };
70
- const RIBv1 = ({ accountHolderAddress, bank, bankAddress, bic, iban, partnerColor, partnerLogoUrl, ...props }) => (_jsx(WithPartnerAccentColor, { color: partnerColor, children: _jsxs(View, { style: styles.container, children: [_jsxs(View, { style: styles.half, children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [isNotNullishOrEmpty(partnerLogoUrl) ? (_jsx("img", { src: partnerLogoUrl, style: { ...logoStyle, height: LOGO_MAX_HEIGHT, maxWidth: LOGO_MAX_WIDTH } })) : (_jsx(SwanLogo, { style: styles.defaultLogo })), _jsx(Space, { width: 24 }), _jsx(LakeHeading, { align: "right", color: colors.gray[900], level: 2, style: commonStyles.fill, variant: "h3", children: t("rib.bankDetails") })] }), _jsx(Space, { height: 24 }), _jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(Item, { kind: "main", color: "partner", label: t("rib.iban"), value: iban }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "main", color: "partner", label: t("rib.bic"), value: bic })] }), _jsx(Space, { height: 8 }), _jsx(Box, { direction: "row", alignItems: "center", children: match(props)
70
+ const RIBv1 = ({ accountHolderAddress, bank, bankAddress, bic, iban, partnerColor, partnerLogoUrl, partnerLogoAlt, ...props }) => (_jsx(WithPartnerAccentColor, { color: partnerColor, children: _jsxs(View, { style: styles.container, children: [_jsxs(View, { style: styles.half, children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [isNotNullishOrEmpty(partnerLogoUrl) ? (_jsx("img", { src: partnerLogoUrl, alt: partnerLogoAlt, style: { ...logoStyle, height: LOGO_MAX_HEIGHT, maxWidth: LOGO_MAX_WIDTH } })) : (_jsx(SwanLogo, { style: styles.defaultLogo })), _jsx(Space, { width: 24 }), _jsx(LakeHeading, { align: "right", color: colors.gray[900], level: 2, style: commonStyles.fill, variant: "h3", children: t("rib.bankDetails") })] }), _jsx(Space, { height: 24 }), _jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(Item, { kind: "main", color: "partner", label: t("rib.iban"), value: iban }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "main", color: "partner", label: t("rib.bic"), value: bic })] }), _jsx(Space, { height: 8 }), _jsx(Box, { direction: "row", alignItems: "center", children: match(props)
71
71
  .with({ accountCountry: "FRA" }, ({ agency, bankKey, bankNumber }) => (_jsxs(_Fragment, { children: [_jsx(Item, { kind: "small", label: t("rib.bank"), value: bank }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.agency"), value: agency }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.number"), value: bankNumber }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.key"), value: bankKey })] })))
72
72
  .with({ accountCountry: "DEU" }, ({ accountNumber }) => (_jsxs(_Fragment, { children: [_jsx(Item, { kind: "small", label: t("rib.bank"), value: bank }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.accountNumber"), value: accountNumber })] })))
73
73
  .with({ accountCountry: "ESP" }, ({ agency, bankNumber, nationalCode }) => (_jsxs(_Fragment, { children: [_jsx(Item, { kind: "small", label: t("rib.bank"), value: bank }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.agency"), value: agency }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.nationalCode"), value: nationalCode }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.number"), value: bankNumber })] })))
@@ -7,6 +7,7 @@ type TransactionType = "SepaCreditTransferIn" | "SepaCreditTransferOut" | "SepaI
7
7
  type TransactionStatementV1Props = {
8
8
  version: "v1";
9
9
  partnerLogoUrl?: string;
10
+ partnerLogoAlt?: string;
10
11
  generationDate: string;
11
12
  executionDate: string;
12
13
  type: TransactionType;
@@ -28,7 +29,7 @@ type TransactionStatementV1Props = {
28
29
  creditorBankIdentifier?: string;
29
30
  style?: StyleProp<ViewStyle>;
30
31
  };
31
- export declare const TransactionStatementV1: ({ partnerLogoUrl, generationDate, executionDate, type, amount, instructedAmount, amountCredited, targetTransferAmount, exchangeRate, fees, label, reference, debtorName, debtorAccountNumber, debtorBankName, debtorBankIdentifier, creditorName, creditorAccountNumber, creditorBankName, creditorBankIdentifier, style, }: TransactionStatementV1Props) => import("react").JSX.Element;
32
+ export declare const TransactionStatementV1: ({ partnerLogoUrl, partnerLogoAlt, generationDate, executionDate, type, amount, instructedAmount, amountCredited, targetTransferAmount, exchangeRate, fees, label, reference, debtorName, debtorAccountNumber, debtorBankName, debtorBankIdentifier, creditorName, creditorAccountNumber, creditorBankName, creditorBankIdentifier, style, }: TransactionStatementV1Props) => import("react").JSX.Element;
32
33
  export type TransactionStatementProps = TransactionStatementV1Props;
33
34
  export declare const TransactionStatement: (props: TransactionStatementProps) => import("react").JSX.Element;
34
35
  export {};
@@ -70,8 +70,8 @@ const logoStyle = {
70
70
  objectFit: "contain",
71
71
  objectPosition: "left",
72
72
  };
73
- export const TransactionStatementV1 = ({ partnerLogoUrl, generationDate, executionDate, type, amount, instructedAmount, amountCredited, targetTransferAmount, exchangeRate, fees, label, reference, debtorName, debtorAccountNumber, debtorBankName, debtorBankIdentifier, creditorName, creditorAccountNumber, creditorBankName, creditorBankIdentifier, style, }) => {
74
- return (_jsxs(View, { style: [styles.container, style], children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [isNotNullishOrEmpty(partnerLogoUrl) ? (_jsx("img", { src: partnerLogoUrl, style: logoStyle })) : (_jsx(SwanLogo, { style: styles.defaultLogo })), _jsx(Separator, { horizontal: true, space: 8 }), _jsx(Text, { style: styles.partnershipText, children: t("transactionStatement.partnership") }), _jsx(Space, { width: 4 }), _jsx(SwanLogo, { color: colors.gray[900], style: styles.swanLogo })] }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.pageTitle, children: t("transactionStatement.title.document") }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.sectionTitle, children: t("transactionStatement.title.transactionInformation") }), _jsx(Space, { height: 8 }), _jsxs(Stack, { space: 8, children: [_jsx(Line, { name: t("transactionStatement.information.executionDate"), value: executionDate }), _jsx(Line, { name: t("transactionStatement.information.type"), value: match(type)
73
+ export const TransactionStatementV1 = ({ partnerLogoUrl, partnerLogoAlt, generationDate, executionDate, type, amount, instructedAmount, amountCredited, targetTransferAmount, exchangeRate, fees, label, reference, debtorName, debtorAccountNumber, debtorBankName, debtorBankIdentifier, creditorName, creditorAccountNumber, creditorBankName, creditorBankIdentifier, style, }) => {
74
+ return (_jsxs(View, { style: [styles.container, style], children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [isNotNullishOrEmpty(partnerLogoUrl) ? (_jsx("img", { src: partnerLogoUrl, alt: partnerLogoAlt, style: logoStyle })) : (_jsx(SwanLogo, { style: styles.defaultLogo })), _jsx(Separator, { horizontal: true, space: 8 }), _jsx(Text, { style: styles.partnershipText, children: t("transactionStatement.partnership") }), _jsx(Space, { width: 4 }), _jsx(SwanLogo, { color: colors.gray[900], style: styles.swanLogo })] }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.pageTitle, children: t("transactionStatement.title.document") }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.sectionTitle, children: t("transactionStatement.title.transactionInformation") }), _jsx(Space, { height: 8 }), _jsxs(Stack, { space: 8, children: [_jsx(Line, { name: t("transactionStatement.information.executionDate"), value: executionDate }), _jsx(Line, { name: t("transactionStatement.information.type"), value: match(type)
75
75
  .with("SepaCreditTransferIn", () => t("transactionStatement.type.SepaCreditTransferIn"))
76
76
  .with("SepaCreditTransferOut", () => t("transactionStatement.type.SepaCreditTransferOut"))
77
77
  .with("SepaInstantCreditTransferIn", () => t("transactionStatement.type.SepaInstantCreditTransferIn"))