@swan-io/shared-business 13.2.5 → 13.4.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": "13.2.5",
3
+ "version": "13.4.0",
4
4
  "engines": {
5
5
  "node": "^22.12.0"
6
6
  },
@@ -12,10 +12,6 @@
12
12
  "src/**/*.d.ts",
13
13
  "README.md"
14
14
  ],
15
- "publishConfig": {
16
- "access": "public",
17
- "registry": "https://registry.npmjs.org"
18
- },
19
15
  "browserslist": [
20
16
  ">0.2%",
21
17
  "not op_mini all",
@@ -25,7 +21,7 @@
25
21
  ],
26
22
  "license": "MIT",
27
23
  "peerDependencies": {
28
- "@swan-io/lake": "13.2.5"
24
+ "@swan-io/lake": "13.4.0"
29
25
  },
30
26
  "dependencies": {
31
27
  "@formatjs/intl": "^3.1.6",
@@ -50,6 +46,6 @@
50
46
  "@types/react-dom": "^19.1.7",
51
47
  "@types/react-native": "^0.72.8",
52
48
  "type-fest": "^4.41.0",
53
- "@swan-io/lake": "13.2.5"
49
+ "@swan-io/lake": "13.4.0"
54
50
  }
55
51
  }
@@ -20,9 +20,7 @@ export type Transaction = {
20
20
  };
21
21
  type AccountStatementV1Props = {
22
22
  version: "v1";
23
- partnerLogoUrl?: string;
24
23
  style?: StyleProp<ViewStyle>;
25
- accountHolderType: "Individual" | "Company";
26
24
  accountHolderName: string;
27
25
  accountHolderAddress: AddressInfo;
28
26
  iban: string;
@@ -36,8 +34,10 @@ type AccountStatementV1Props = {
36
34
  closingBalance: Amount;
37
35
  feesDebit: Amount;
38
36
  feesCredit: Amount;
37
+ hideHeader?: boolean;
38
+ hideFooter?: boolean;
39
39
  };
40
- export declare const AccountStatementV1: ({ partnerLogoUrl, style, accountHolderType, accountHolderName, accountHolderAddress, iban, bic, openingDate, closingDate, openingBalance, transactions, feesDebit, feesCredit, totalsCredit, totalsDebit, closingBalance, }: AccountStatementV1Props) => import("react/jsx-runtime").JSX.Element;
40
+ export declare const AccountStatementV1: ({ style, accountHolderName, accountHolderAddress, iban, bic, openingDate, closingDate, openingBalance, transactions, feesDebit, feesCredit, totalsCredit, totalsDebit, closingBalance, }: AccountStatementV1Props) => import("react/jsx-runtime").JSX.Element;
41
41
  export type AccountStatementProps = AccountStatementV1Props;
42
42
  export declare const AccountStatement: (props: AccountStatementProps) => import("react/jsx-runtime").JSX.Element;
43
43
  export {};
@@ -1,37 +1,18 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { Box } from "@swan-io/lake/src/components/Box";
3
- import { Separator } from "@swan-io/lake/src/components/Separator";
4
3
  import { Space } from "@swan-io/lake/src/components/Space";
5
- import { SwanLogo } from "@swan-io/lake/src/components/SwanLogo";
6
- import { colors, fonts, primaryFontStyle, spacings } from "@swan-io/lake/src/constants/design";
7
- import { isNotNullish, isNotNullishOrEmpty } from "@swan-io/lake/src/utils/nullish";
4
+ import { colors, spacings } from "@swan-io/lake/src/constants/design";
5
+ import { isNotNullish } from "@swan-io/lake/src/utils/nullish";
8
6
  import { StyleSheet, Text } from "react-native";
9
7
  import { match } from "ts-pattern";
10
8
  import { getCountryName } from "../constants/countries";
11
9
  import { formatCurrencyIso, t } from "../utils/i18n";
12
- const LOGO_MAX_HEIGHT = 24;
13
- const LOGO_MAX_WIDTH = 150;
14
- const getTextStyle = (type, fontSize) => ({
15
- ...(type === "mono" ? { fontFamily: fonts.iban } : primaryFontStyle),
16
- color: colors.gray[900],
17
- fontSize,
18
- lineHeight: fontSize * 1.25,
19
- fontWeight: "400",
20
- });
10
+ import { getTextStyle } from "../utils/style";
21
11
  const styles = StyleSheet.create({
22
12
  container: {
23
13
  width: 793,
24
14
  padding: 40,
25
15
  },
26
- partnershipText: {
27
- ...getTextStyle("sans", 14),
28
- color: colors.gray[500],
29
- },
30
- pageTitle: {
31
- ...getTextStyle("sans", 20),
32
- color: colors.swan[500],
33
- fontWeight: "600",
34
- },
35
16
  sectionTitle: {
36
17
  ...getTextStyle("sans", 14),
37
18
  color: colors.swan[500],
@@ -69,21 +50,6 @@ const styles = StyleSheet.create({
69
50
  backgroundColor: colors.gray[50],
70
51
  width: "50%",
71
52
  },
72
- footer: {
73
- ...getTextStyle("sans", 10),
74
- color: colors.gray[500],
75
- fontWeight: "300",
76
- },
77
- defaultLogo: {
78
- height: LOGO_MAX_HEIGHT,
79
- width: (45 / 10) * LOGO_MAX_HEIGHT,
80
- },
81
- swanLogo: {
82
- height: 8,
83
- width: (45 / 10) * 8,
84
- position: "relative",
85
- top: 0.5,
86
- },
87
53
  });
88
54
  const Title = ({ text, align = "left", style, }) => (_jsx(Text, { style: [
89
55
  styles.titleColumn,
@@ -101,16 +67,8 @@ const translateTransaction = (transaction) => {
101
67
  .with("InternationalCreditTransfer", "SepaCreditTransfer", () => t("accountStatement.creditTransfer"))
102
68
  .otherwise(() => transaction);
103
69
  };
104
- const logoStyle = {
105
- height: LOGO_MAX_HEIGHT,
106
- maxWidth: LOGO_MAX_WIDTH,
107
- objectFit: "contain",
108
- objectPosition: "left",
109
- };
110
- export const AccountStatementV1 = ({ partnerLogoUrl, style, accountHolderType, accountHolderName, accountHolderAddress, iban, bic, openingDate, closingDate, openingBalance, transactions, feesDebit, feesCredit, totalsCredit, totalsDebit, closingBalance, }) => {
111
- return (_jsx(Box, { style: [styles.container, style], direction: "column", justifyContent: "spaceBetween", children: _jsxs(Box, { children: [_jsx(Box, { direction: "row", justifyContent: "spaceBetween", 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("accountStatement.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("accountStatement.titleDocument") }), _jsx(Space, { height: 8 }), _jsx(Text, { style: styles.text, children: accountHolderType === "Company"
112
- ? t("accountStatement.titleDocument.companyDescription")
113
- : t("accountStatement.titleDocument.individualDescription") }), _jsx(Space, { height: 24 }), _jsxs(Box, { direction: "row", justifyContent: "spaceBetween", children: [_jsxs(Box, { direction: "column", children: [_jsx(Text, { style: styles.sectionTitle, children: accountHolderName.toUpperCase() }), _jsx(Text, { style: styles.text, children: accountHolderAddress.street }), _jsx(Text, { style: styles.text, children: accountHolderAddress.city }), isNotNullish(accountHolderAddress.country) && (_jsx(Text, { style: styles.text, children: getCountryName(accountHolderAddress.country) }))] }), _jsxs(Box, { direction: "column", alignItems: "end", children: [_jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.contactSupport") }), _jsx(Text, { style: styles.text, children: "support.swan.io" })] })] }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.iban") }), _jsx(Text, { style: styles.text, children: iban }), _jsx(Space, { height: 12 }), _jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.bic") }), _jsx(Text, { style: styles.text, children: bic }), _jsx(Space, { height: 48 }), _jsxs(Box, { direction: "row", justifyContent: "spaceBetween", children: [_jsx(Box, { direction: "column", children: _jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.date", { openingDate, closingDate }) }) }), _jsxs(Box, { direction: "column", children: [_jsx(Text, { style: styles.openingBalanceText, children: t("accountStatement.openingBalance") }), _jsx(Text, { style: styles.totalAmount, children: formatCurrencyIso(Number(openingBalance.value), openingBalance.currency) })] })] }), _jsx(Space, { height: 24 }), _jsxs(_Fragment, { children: [_jsxs(Box, { direction: "row", style: { backgroundColor: colors.gray[50] }, children: [_jsx(Text, { style: [styles.titleColumn, { width: "15%" }], children: t("accountStatement.column.date") }), _jsx(Text, { style: [styles.titleColumn, { width: "22%" }], children: t("accountStatement.column.type") }), _jsx(Text, { style: [styles.titleColumn, { width: "33%" }], children: t("accountStatement.column.description") }), _jsx(Text, { style: [styles.titleColumn, { width: "15%", textAlign: "right" }], children: t("accountStatement.column.credit") }), _jsx(Text, { style: [styles.titleColumn, { width: "15%", textAlign: "right" }], children: t("accountStatement.column.debit") })] }), _jsx(Box, { direction: "column", children: transactions.map(transaction => (_jsxs(Box, { direction: "row", children: [_jsx(Text, { style: [styles.textColumn, { width: "15%" }], children: transaction.date }), _jsx(Text, { style: [styles.textColumn, { width: "22%" }], children: translateTransaction(transaction.type) }), _jsx(Text, { style: [styles.textColumn, { width: "33%" }], children: transaction.label }), _jsx(Text, { style: [styles.textColumn, { width: "15%", textAlign: "right" }], children: transaction.credit ? transaction.credit.value : "" }), _jsx(Text, { style: [styles.textColumn, { width: "15%", textAlign: "right" }], children: transaction.debit ? transaction.debit.value : "" })] }, transaction.id))) })] }), _jsxs(Box, { direction: "column", children: [_jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: styles.row, children: t("accountStatement.column.fees") }), _jsx(Text, { style: styles.row, children: feesCredit.value }), _jsx(Text, { style: styles.row, children: feesDebit.value })] }), _jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: styles.row, children: t("accountStatement.column.totals") }), _jsx(Text, { style: styles.row, children: totalsCredit.value }), _jsx(Text, { style: styles.row, children: totalsDebit.value })] })] }), _jsx(Box, { direction: "row", justifyContent: "end", children: _jsxs(Box, { direction: "row", alignItems: "center", style: styles.closingBalanceRow, justifyContent: "spaceBetween", children: [_jsx(Title, { text: t("accountStatement.closingBalance") }), _jsx(Title, { text: formatCurrencyIso(Number(closingBalance.value), closingBalance.currency), style: styles.totalAmount, align: "right" })] }) })] }) }));
70
+ export const AccountStatementV1 = ({ style, accountHolderName, accountHolderAddress, iban, bic, openingDate, closingDate, openingBalance, transactions, feesDebit, feesCredit, totalsCredit, totalsDebit, closingBalance, }) => {
71
+ return (_jsx(Box, { style: style, children: _jsx(Box, { style: styles.container, direction: "column", justifyContent: "spaceBetween", children: _jsxs(Box, { children: [_jsxs(Box, { direction: "row", justifyContent: "spaceBetween", children: [_jsxs(Box, { direction: "column", children: [_jsx(Text, { style: styles.sectionTitle, children: accountHolderName.toUpperCase() }), _jsx(Text, { style: styles.text, children: accountHolderAddress.street }), _jsx(Text, { style: styles.text, children: accountHolderAddress.city }), isNotNullish(accountHolderAddress.country) && (_jsx(Text, { style: styles.text, children: getCountryName(accountHolderAddress.country) }))] }), _jsxs(Box, { direction: "column", alignItems: "end", children: [_jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.contactSupport") }), _jsx(Text, { style: styles.text, children: "support.swan.io" })] })] }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.iban") }), _jsx(Text, { style: styles.text, children: iban }), _jsx(Space, { height: 12 }), _jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.bic") }), _jsx(Text, { style: styles.text, children: bic }), _jsx(Space, { height: 48 }), _jsxs(Box, { direction: "row", justifyContent: "spaceBetween", children: [_jsx(Box, { direction: "column", children: _jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.date", { openingDate, closingDate }) }) }), _jsxs(Box, { direction: "column", children: [_jsx(Text, { style: styles.openingBalanceText, children: t("accountStatement.openingBalance") }), _jsx(Text, { style: styles.totalAmount, children: formatCurrencyIso(Number(openingBalance.value), openingBalance.currency) })] })] }), _jsx(Space, { height: 24 }), _jsxs(_Fragment, { children: [_jsxs(Box, { direction: "row", style: { backgroundColor: colors.gray[50] }, children: [_jsx(Text, { style: [styles.titleColumn, { width: "15%" }], children: t("accountStatement.column.date") }), _jsx(Text, { style: [styles.titleColumn, { width: "22%" }], children: t("accountStatement.column.type") }), _jsx(Text, { style: [styles.titleColumn, { width: "33%" }], children: t("accountStatement.column.description") }), _jsx(Text, { style: [styles.titleColumn, { width: "15%", textAlign: "right" }], children: t("accountStatement.column.credit") }), _jsx(Text, { style: [styles.titleColumn, { width: "15%", textAlign: "right" }], children: t("accountStatement.column.debit") })] }), _jsx(Box, { direction: "column", children: transactions.map(transaction => (_jsxs(Box, { direction: "row", children: [_jsx(Text, { style: [styles.textColumn, { width: "15%" }], children: transaction.date }), _jsx(Text, { style: [styles.textColumn, { width: "22%" }], children: translateTransaction(transaction.type) }), _jsx(Text, { style: [styles.textColumn, { width: "33%" }], children: transaction.label }), _jsx(Text, { style: [styles.textColumn, { width: "15%", textAlign: "right" }], children: transaction.credit ? transaction.credit.value : "" }), _jsx(Text, { style: [styles.textColumn, { width: "15%", textAlign: "right" }], children: transaction.debit ? transaction.debit.value : "" })] }, transaction.id))) })] }), _jsxs(Box, { direction: "column", children: [_jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: styles.row, children: t("accountStatement.column.fees") }), _jsx(Text, { style: styles.row, children: feesCredit.value }), _jsx(Text, { style: styles.row, children: feesDebit.value })] }), _jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: styles.row, children: t("accountStatement.column.totals") }), _jsx(Text, { style: styles.row, children: totalsCredit.value }), _jsx(Text, { style: styles.row, children: totalsDebit.value })] })] }), _jsx(Box, { direction: "row", justifyContent: "end", children: _jsxs(Box, { direction: "row", alignItems: "center", style: styles.closingBalanceRow, justifyContent: "spaceBetween", children: [_jsx(Title, { text: t("accountStatement.closingBalance") }), _jsx(Title, { text: formatCurrencyIso(Number(closingBalance.value), closingBalance.currency), style: styles.totalAmount, align: "right" })] }) })] }) }) }));
114
72
  };
115
73
  export const AccountStatement = (props) => match(props)
116
74
  .with({ version: "v1" }, props => _jsx(AccountStatementV1, { ...props }))
@@ -0,0 +1,4 @@
1
+ import { type SupportedLanguage } from "../utils/i18n";
2
+ export declare const AccountStatementFooter: ({ language }: {
3
+ language?: SupportedLanguage;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,55 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useTranslation } from "../utils/i18n";
3
+ // Used to generate inline styles without css variables for PDF generation
4
+ const styles = {
5
+ container: {
6
+ width: 793,
7
+ padding: "0 40px 40px 40px",
8
+ fontFamily: "Inter, -apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",
9
+ boxSizing: "border-box",
10
+ letterSpacing: "-0.011em",
11
+ color: "#737276",
12
+ fontSize: "10px",
13
+ lineHeight: "12.5px",
14
+ fontWeight: "300",
15
+ },
16
+ wrapper: {
17
+ display: "flex",
18
+ justifyContent: "space-between",
19
+ alignItems: "flex-start",
20
+ width: "100%",
21
+ borderTop: "1px solid #e8e7e8",
22
+ paddingTop: "24px",
23
+ marginTop: "24px",
24
+ },
25
+ footer: {
26
+ flex: 1,
27
+ textAlign: "justify",
28
+ paddingRight: "24px",
29
+ },
30
+ support: {
31
+ textAlign: "right",
32
+ },
33
+ supportText: {
34
+ fontSize: "12px",
35
+ lineHeight: "16px",
36
+ fontWeight: "600",
37
+ color: "#26232F",
38
+ },
39
+ supportLink: {
40
+ fontSize: "12px",
41
+ lineHeight: "16px",
42
+ fontWeight: "400",
43
+ color: "#454348",
44
+ textDecoration: "none",
45
+ },
46
+ pageNumber: {
47
+ fontSize: "10px",
48
+ color: "#16141A",
49
+ marginTop: "20px",
50
+ },
51
+ };
52
+ export const AccountStatementFooter = ({ language }) => {
53
+ const t = useTranslation(language);
54
+ return (_jsx("div", { style: styles.container, children: _jsxs("div", { style: styles.wrapper, children: [_jsx("div", { style: styles.footer, children: t("common.statement.footer") }), _jsxs("div", { style: styles.support, children: [_jsx("div", { style: styles.supportText, children: t("accountStatement.contactSupport") }), _jsx("div", { style: styles.supportLink, children: "support.swan.io" }), _jsxs("div", { style: styles.pageNumber, children: [t("accountStatement.page"), " ", _jsx("span", { className: "pageNumber" }), " /", " ", _jsx("span", { className: "totalPages" })] })] })] }) }));
55
+ };
@@ -0,0 +1,8 @@
1
+ import { type SupportedLanguage } from "../utils/i18n";
2
+ type AccountStatementHeaderProps = {
3
+ partnerLogoUrl?: string;
4
+ accountHolderType: "Individual" | "Company";
5
+ language?: SupportedLanguage;
6
+ };
7
+ export declare const AccountStatementHeader: ({ partnerLogoUrl, accountHolderType, language, }: AccountStatementHeaderProps) => import("react/jsx-runtime").JSX.Element;
8
+ export {};
@@ -0,0 +1,73 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { SwanLogo } from "@swan-io/lake/src/components/SwanLogo";
3
+ import { colors } from "@swan-io/lake/src/constants/design";
4
+ import { isNotNullishOrEmpty } from "@swan-io/lake/src/utils/nullish";
5
+ import { useTranslation } from "../utils/i18n";
6
+ const LOGO_MAX_HEIGHT = 24;
7
+ const LOGO_MAX_WIDTH = 150;
8
+ // Used to generate inline styles without css variables for PDF generation
9
+ const styles = {
10
+ container: {
11
+ width: 793,
12
+ padding: "40px 40px 0 40px",
13
+ fontFamily: "Inter, -apple-system, system-ui, BlinkMacSystemFont, Segoe UI, Helvetica, Arial, sans-serif",
14
+ boxSizing: "border-box",
15
+ color: "#737276",
16
+ fontSize: "10px",
17
+ lineHeight: "12.5px",
18
+ fontWeight: "300",
19
+ display: "flex",
20
+ justifyContent: "space-between",
21
+ alignItems: "center",
22
+ },
23
+ partnership: {
24
+ borderLeft: "1px solid #e8e7e8",
25
+ padding: "7px 8px",
26
+ marginLeft: "8px",
27
+ },
28
+ partnershipText: {
29
+ fontSize: "12px",
30
+ lineHeight: "24px",
31
+ marginBottom: "4px",
32
+ },
33
+ pageTitle: {
34
+ fontSize: "20px",
35
+ lineHeight: "24px",
36
+ fontWeight: "600",
37
+ color: "#26232F",
38
+ marginBottom: "4px",
39
+ textAlign: "right",
40
+ },
41
+ text: {
42
+ fontSize: "12px",
43
+ lineHeight: "16px",
44
+ color: "#454348",
45
+ textAlign: "right",
46
+ },
47
+ logo: {
48
+ display: "flex",
49
+ alignItems: "center",
50
+ },
51
+ defaultLogo: {
52
+ height: LOGO_MAX_HEIGHT,
53
+ width: (45 / 10) * LOGO_MAX_HEIGHT,
54
+ },
55
+ swanLogo: {
56
+ height: 8,
57
+ width: (45 / 10) * 8,
58
+ position: "relative",
59
+ top: 0.5,
60
+ },
61
+ };
62
+ const logoStyle = {
63
+ height: LOGO_MAX_HEIGHT,
64
+ maxWidth: LOGO_MAX_WIDTH,
65
+ objectFit: "contain",
66
+ objectPosition: "left",
67
+ };
68
+ export const AccountStatementHeader = ({ partnerLogoUrl, accountHolderType, language, }) => {
69
+ const t = useTranslation(language);
70
+ return (_jsxs("div", { style: styles.container, children: [_jsxs("div", { style: styles.logo, children: [isNotNullishOrEmpty(partnerLogoUrl) ? (_jsx("img", { src: partnerLogoUrl, style: logoStyle })) : (_jsx(SwanLogo, { style: styles.defaultLogo })), _jsxs("div", { style: styles.partnership, children: [_jsx("div", { style: styles.partnershipText, children: t("accountStatement.partnership") }), _jsx(SwanLogo, { color: colors.gray[900], style: styles.swanLogo })] })] }), _jsxs("div", { children: [_jsx("div", { style: styles.pageTitle, children: t("accountStatement.titleDocument") }), _jsx("div", { style: styles.text, children: accountHolderType === "Company"
71
+ ? t("accountStatement.titleDocument.companyDescription")
72
+ : t("accountStatement.titleDocument.individualDescription") })] })] }));
73
+ };
@@ -37,7 +37,7 @@ type RIBv1Props = {
37
37
  bankNumber: string;
38
38
  } | {
39
39
  accountCountry: "BEL";
40
- agency: string;
40
+ bankKey: string;
41
41
  bankNumber: string;
42
42
  });
43
43
  export type RIBProps = RIBv1Props;
@@ -6,20 +6,14 @@ import { Space } from "@swan-io/lake/src/components/Space";
6
6
  import { SwanLogo } from "@swan-io/lake/src/components/SwanLogo";
7
7
  import { WithPartnerAccentColor } from "@swan-io/lake/src/components/WithPartnerAccentColor";
8
8
  import { commonStyles } from "@swan-io/lake/src/constants/commonStyles";
9
- import { colors, fonts, invariantColors, primaryFontStyle, radii, spacings, } from "@swan-io/lake/src/constants/design";
9
+ import { colors, invariantColors, radii, spacings } from "@swan-io/lake/src/constants/design";
10
10
  import { isNotNullishOrEmpty } from "@swan-io/lake/src/utils/nullish";
11
11
  import { StyleSheet, Text, View } from "react-native";
12
12
  import { match } from "ts-pattern";
13
13
  import { t } from "../utils/i18n";
14
+ import { getTextStyle } from "../utils/style";
14
15
  const LOGO_MAX_HEIGHT = 24;
15
16
  const LOGO_MAX_WIDTH = 150;
16
- const getTextStyle = (type, fontSize) => ({
17
- ...(type === "mono" ? { fontFamily: fonts.iban } : primaryFontStyle),
18
- color: colors.gray[900],
19
- fontSize,
20
- lineHeight: fontSize * 1.25,
21
- fontWeight: "400",
22
- });
23
17
  const styles = StyleSheet.create({
24
18
  container: {
25
19
  borderRadius: radii[8],
@@ -79,7 +73,7 @@ const RIBv1 = ({ accountHolderAddress, bank, bankAddress, bic, iban, partnerColo
79
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 })] })))
80
74
  .with({ accountCountry: "NLD" }, ({ 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.number"), value: bankNumber }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.key"), value: bankKey })] })))
81
75
  .with({ accountCountry: "ITA" }, ({ agency, 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 })] })))
82
- .with({ accountCountry: "BEL" }, ({ agency, 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 })] })))
76
+ .with({ accountCountry: "BEL" }, ({ 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.key"), value: bankKey }), _jsx(Space, { width: 24 }), _jsx(Item, { kind: "small", label: t("rib.number"), value: bankNumber })] })))
83
77
  .exhaustive() })] }), _jsx(Separator, {}), _jsxs(View, { style: styles.half, children: [_jsxs(Box, { direction: "row", alignItems: "center", children: [_jsx(Item, { kind: "address", color: "partner", label: t("rib.address"), value: [
84
78
  bankAddress.name,
85
79
  bankAddress.address,
@@ -5,21 +5,15 @@ import { Separator } from "@swan-io/lake/src/components/Separator";
5
5
  import { Space } from "@swan-io/lake/src/components/Space";
6
6
  import { Stack } from "@swan-io/lake/src/components/Stack";
7
7
  import { SwanLogo } from "@swan-io/lake/src/components/SwanLogo";
8
- import { colors, fonts, primaryFontStyle } from "@swan-io/lake/src/constants/design";
8
+ import { colors } from "@swan-io/lake/src/constants/design";
9
9
  import { isNotNullish, isNotNullishOrEmpty } from "@swan-io/lake/src/utils/nullish";
10
10
  import IBAN from "iban";
11
11
  import { StyleSheet, Text, View } from "react-native";
12
12
  import { match } from "ts-pattern";
13
13
  import { formatCurrencyIso, t } from "../utils/i18n";
14
+ import { getTextStyle } from "../utils/style";
14
15
  const LOGO_MAX_HEIGHT = 24;
15
16
  const LOGO_MAX_WIDTH = 150;
16
- const getTextStyle = (type, fontSize) => ({
17
- ...(type === "mono" ? { fontFamily: fonts.iban } : primaryFontStyle),
18
- color: colors.gray[900],
19
- fontSize,
20
- lineHeight: fontSize * 1.25,
21
- fontWeight: "400",
22
- });
23
17
  const styles = StyleSheet.create({
24
18
  container: {
25
19
  height: 1050,
@@ -92,7 +86,7 @@ export const TransactionStatementV1 = ({ partnerLogoUrl, generationDate, executi
92
86
  ? IBAN.printFormat(creditorAccountNumber)
93
87
  : 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 }), match(type)
94
88
  .with("SepaCreditTransferOut", "InternationalCreditTransferOut", () => (_jsx(Text, { style: styles.generationInfos, children: t("transactionStatement.generationInfos") })))
95
- .otherwise(() => null), _jsx(Separator, { space: 24 }), _jsx(Text, { style: styles.footer, children: t("transactionStatement.footer") })] }));
89
+ .otherwise(() => null), _jsx(Separator, { space: 24 }), _jsx(Text, { style: styles.footer, children: t("common.statement.footer") })] }));
96
90
  };
97
91
  export const TransactionStatement = (props) => match(props)
98
92
  .with({ version: "v1" }, props => _jsx(TransactionStatementV1, { ...props }))
@@ -17,6 +17,7 @@
17
17
  "accountStatement.fees": "Gebühren",
18
18
  "accountStatement.iban": "IBAN",
19
19
  "accountStatement.openingBalance": "Eröffnungssaldo",
20
+ "accountStatement.page": "Seite",
20
21
  "accountStatement.partnership": "In Partnerschaft mit",
21
22
  "accountStatement.titleDocument": "Kontoauszug",
22
23
  "accountStatement.titleDocument.companyDescription": "Geschäftskonto - in Euro",
@@ -65,6 +66,7 @@
65
66
  "common.showLess": "Weniger anzeigen",
66
67
  "common.showMore": "Mehr anzeigen",
67
68
  "common.skipToContent": "Zum Inhalt springen",
69
+ "common.statement.footer": "SWAN ist eine vereinfachte Aktiengesellschaft (SAS), eingetragen im Handelsregister von Bobigny unter der Nummer 853 827 103, mit einem Kapital von 16.999,66 Euro, USt-IdNr. FR90853827103 und Firmensitz in 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANKREICH.\nAls E-Geld-Institut, das Zahlungsdienstleistungen gemäß französischem Recht anbietet und von der ACPR genehmigt wurde, ist SWAN unter der Nummer 17328 bei dieser registriert.",
68
70
  "copyButton.copiedTooltip": "In die Zwischenablage kopiert",
69
71
  "copyButton.copyTooltip": "Zum Kopieren anklicken",
70
72
  "creditStatement.additionalDetails": "Der Kontoauszug vom <bold>{openingDate}</bold> bis <bold>{closingDate}</bold> enthält alle Gebühren und erhaltenen Zahlungen bis zum {closingDate}. Ihre nächste automatische Lastschrift erfolgt ab {repaymentDate}.\n\nIm Falle einer abgelehnten Bankabbuchung aufgrund unzureichender Guthaben können wir diese Abbuchung mindestens <bold>3 bis 4 Tage</bold> nach der Benachrichtigung durch Ihre Bank erneut einreichen.",
@@ -384,7 +386,6 @@
384
386
  "transactionStatement.debtor.bankIdentifier": "Bankleitzahl des Schuldners",
385
387
  "transactionStatement.debtor.bankName": "Name der Bank des Schuldners",
386
388
  "transactionStatement.debtor.name": "Name des Schuldners",
387
- "transactionStatement.footer": "SWAN ist eine vereinfachte Aktiengesellschaft (SAS), eingetragen im Handelsregister von Bobigny unter der Nummer 853 827 103, mit einem Kapital von 16.999,66 Euro, USt-IdNr. FR90853827103 und Firmensitz in 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANKREICH.\nAls E-Geld-Institut, das Zahlungsdienstleistungen gemäß französischem Recht anbietet und von der ACPR genehmigt wurde, ist SWAN unter der Nummer 17328 bei dieser registriert.",
388
389
  "transactionStatement.generationDate": "Generiert am: {date}",
389
390
  "transactionStatement.generationInfos": "Dieses Dokument bestätigt Ihren Transaktionsantrag. Es stellt keinen Nachweis der Transaktionsausführung dar. Ihre Transaktion wird nach Bestehen eines obligatorischen Verifizierungsprozesses ausgeführt.",
390
391
  "transactionStatement.information.amount": "Betrag",
@@ -21,6 +21,7 @@
21
21
  "accountStatement.titleDocument": "Account statement",
22
22
  "accountStatement.titleDocument.companyDescription": "Business account - in euros",
23
23
  "accountStatement.titleDocument.individualDescription": "Personal account - in euros",
24
+ "accountStatement.page": "Page",
24
25
  "addressFormPart.addressLabel": "Type your address",
25
26
  "addressFormPart.cityLabel": "City",
26
27
  "addressFormPart.placeholder": "Start typing…",
@@ -384,7 +385,7 @@
384
385
  "transactionStatement.debtor.bankIdentifier": "Debtor's bank identifier",
385
386
  "transactionStatement.debtor.bankName": "Debtor’s bank name",
386
387
  "transactionStatement.debtor.name": "Debtor’s name",
387
- "transactionStatement.footer": "SWAN is a simplified joint-stock company (SAS) registered with the Bobigny Trade and Companies Register under number 853 827 103, with a capital of 16,999.66 Euros, VAT number FR90853827103 and whose registered office is located at 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANCE.\nIn its capacity as an Electronic Money institution offering payment services under French law approved by the ACPR, SWAN is registered with the latter under number 17328.",
388
+ "common.statement.footer": "SWAN is a simplified joint-stock company (SAS) registered with the Bobigny Trade and Companies Register under number 853 827 103, with a capital of 16,999.66 Euros, VAT number FR90853827103 and whose registered office is located at 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANCE.\nIn its capacity as an Electronic Money institution offering payment services under French law approved by the ACPR, SWAN is registered with the latter under number 17328.",
388
389
  "transactionStatement.generationDate": "Generated on: {date}",
389
390
  "transactionStatement.generationInfos": "This document is confirmation of your transaction request. It doesn't constitute proof of transaction execution. Your transaction will be executed after passing a mandatory verification process.",
390
391
  "transactionStatement.information.amount": "Amount",
@@ -17,6 +17,7 @@
17
17
  "accountStatement.fees": "Tasas",
18
18
  "accountStatement.iban": "IBAN",
19
19
  "accountStatement.openingBalance": "Saldo inicial",
20
+ "accountStatement.page": "Página",
20
21
  "accountStatement.partnership": "En colaboración con",
21
22
  "accountStatement.titleDocument": "Extracto de cuenta",
22
23
  "accountStatement.titleDocument.companyDescription": "Cuenta de empresa - en euros",
@@ -65,6 +66,7 @@
65
66
  "common.showLess": "Mostrar menos",
66
67
  "common.showMore": "Mostrar más",
67
68
  "common.skipToContent": "Saltar al contenido",
69
+ "common.statement.footer": "SWAN es una sociedad anónima simplificada (SAS) registrada en el Registro Mercantil de Bobigny con el número 853 827 103, con un capital de 16.999,66 euros, número de IVA FR90853827103 y con domicilio social en 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANCIA.\nEn su calidad de institución de dinero electrónico que ofrece servicios de pago conforme a la ley francesa aprobada por la ACPR, SWAN está registrada bajo el número 17328.",
68
70
  "copyButton.copiedTooltip": "Copiado al portapapeles",
69
71
  "copyButton.copyTooltip": "Haz clic para copiar",
70
72
  "creditStatement.additionalDetails": "El extracto del <bold>{openingDate}</bold> al <bold>{closingDate}</bold> incluye todas las tasas y pagos recibidos hasta el {closingDate}. Tu próximo pago domiciliado se realizará a partir del {repaymentDate}.\n\nSi el pago se rechaza por fondos insuficientes, podemos intentar procesarlo de nuevo <bold>3 a 4 días</bold> después de que tu banco te haya notificado el rechazo.",
@@ -384,7 +386,6 @@
384
386
  "transactionStatement.debtor.bankIdentifier": "Identificador bancario del deudor",
385
387
  "transactionStatement.debtor.bankName": "Nombre del banco del deudor",
386
388
  "transactionStatement.debtor.name": "Nombre del deudor",
387
- "transactionStatement.footer": "SWAN es una sociedad anónima simplificada (SAS) registrada en el Registro Mercantil de Bobigny con el número 853 827 103, con un capital de 16.999,66 euros, número de IVA FR90853827103 y con domicilio social en 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANCIA.\nEn su calidad de institución de dinero electrónico que ofrece servicios de pago conforme a la ley francesa aprobada por la ACPR, SWAN está registrada bajo el número 17328.",
388
389
  "transactionStatement.generationDate": "Generado el: {date}",
389
390
  "transactionStatement.generationInfos": "Este documento es la confirmación de tu solicitud de transacción. No constituye una prueba de la ejecución de la transacción. La transacción se ejecutará tras pasar un proceso de verificación obligatorio.",
390
391
  "transactionStatement.information.amount": "Importe",
@@ -17,6 +17,7 @@
17
17
  "accountStatement.fees": "Maksut",
18
18
  "accountStatement.iban": "IBAN",
19
19
  "accountStatement.openingBalance": "Avaussaldo",
20
+ "accountStatement.page": "Sivu",
20
21
  "accountStatement.partnership": "Kumppanina",
21
22
  "accountStatement.titleDocument": "Tiliote",
22
23
  "accountStatement.titleDocument.companyDescription": "Yritystili - euroina",
@@ -65,6 +66,7 @@
65
66
  "common.showLess": "Näytä vähemmän",
66
67
  "common.showMore": "Näytä enemmän",
67
68
  "common.skipToContent": "Ohita ja siirry sisältöön",
69
+ "common.statement.footer": "SWAN on ranskalainen osakeyhtiö (SAS), joka on rekisteröity Bobigny:n kaupparekisteriin numerolla 853 827 103, pääomanaan 16 999,66 euroa, ALV-numero FR90853827103 ja kotipaikkanaan 91 rue du Faubourg Saint-Honoré, 75008 Paris, RANSKA.\nSWAN toimii elektronisen rahan liikkeellelaskijana, tarjoten maksupalveluita Ranskan lain mukaisesti, ja on hyväksytty ACPR:n toimesta rekisteröitynä numerolla 17328.",
68
70
  "copyButton.copiedTooltip": "Kopioitu leikepöydälle",
69
71
  "copyButton.copyTooltip": "Kopioi napsauttamalla",
70
72
  "creditStatement.additionalDetails": "<bold>{openingDate}</bold>{openingDate}<bold>{closingDate}</bold> -tilinpäätös sisältää kaikki kulut ja maksut, jotka on vastaanotettu {closingDate} asti. Seuraava automaattinen veloitus tapahtuu {repaymentDate} alkaen.\n\nJos pankkisiirto hylätään varojen puutteen vuoksi, voimme esittää tämän siirron uudelleen vähintään <bold>3–4 päivää</bold> sen jälkeen, kun pankkisi on ilmoittanut hylkäämisestä.",
@@ -384,7 +386,6 @@
384
386
  "transactionStatement.debtor.bankIdentifier": "Velallisen pankkitunnus",
385
387
  "transactionStatement.debtor.bankName": "Velallisen pankin nimi",
386
388
  "transactionStatement.debtor.name": "Velallisen nimi",
387
- "transactionStatement.footer": "SWAN on ranskalainen osakeyhtiö (SAS), joka on rekisteröity Bobigny:n kaupparekisteriin numerolla 853 827 103, pääomanaan 16 999,66 euroa, ALV-numero FR90853827103 ja kotipaikkanaan 91 rue du Faubourg Saint-Honoré, 75008 Paris, RANSKA.\nSWAN toimii elektronisen rahan liikkeellelaskijana, tarjoten maksupalveluita Ranskan lain mukaisesti, ja on hyväksytty ACPR:n toimesta rekisteröitynä numerolla 17328.",
388
389
  "transactionStatement.generationDate": "Luotu: {date}",
389
390
  "transactionStatement.generationInfos": "Tämä asiakirja on vahvistus maksupyynnöstänne. Se ei ole kuitti tehdystä maksusuorituksesta. Maksusuoritus toteutetaan pakollisen vahvistusprosessin jälkeen.",
390
391
  "transactionStatement.information.amount": "Summa",
@@ -17,6 +17,7 @@
17
17
  "accountStatement.fees": "Frais",
18
18
  "accountStatement.iban": "IBAN",
19
19
  "accountStatement.openingBalance": "Solde d'ouverture",
20
+ "accountStatement.page": "Page",
20
21
  "accountStatement.partnership": "En partenariat avec",
21
22
  "accountStatement.titleDocument": "Relevé de compte",
22
23
  "accountStatement.titleDocument.companyDescription": "Compte professionnel - en euros",
@@ -65,6 +66,7 @@
65
66
  "common.showLess": "Afficher moins",
66
67
  "common.showMore": "Afficher plus",
67
68
  "common.skipToContent": "Aller au contenu",
69
+ "common.statement.footer": "SWAN est une société par actions simplifiée (SAS) immatriculée au Registre du Commerce et des Sociétés de Bobigny sous le numéro 853 827 103, avec un capital de 16 999,66 euros, numéro de TVA FR90853827103 et dont le siège social est situé au 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANCE.\nEn tant qu'établissement de monnaie électronique offrant des services de paiement en vertu du droit français approuvé par l'ACPR, SWAN est inscrite auprès de ce dernier sous le numéro 17328.",
68
70
  "copyButton.copiedTooltip": "Copié dans le presse-papier",
69
71
  "copyButton.copyTooltip": "Cliquez pour copier",
70
72
  "creditStatement.additionalDetails": "Le relevé du <bold>{openingDate}</bold> au <bold>{closingDate}</bold> inclut tous les frais et paiements reçus jusqu'au {closingDate}. Votre prochain prélèvement automatique débutera à partir du {repaymentDate}.\n\nEn cas de rejet de prélèvement bancaire pour insuffisance de fonds, nous pouvons représenter ce prélèvement au moins <bold>3 à 4 jours</bold> après le rejet notifié par votre banque.",
@@ -384,7 +386,6 @@
384
386
  "transactionStatement.debtor.bankIdentifier": "Identifiant bancaire du débiteur",
385
387
  "transactionStatement.debtor.bankName": "Nom de la banque du débiteur",
386
388
  "transactionStatement.debtor.name": "Nom du débiteur",
387
- "transactionStatement.footer": "SWAN est une société par actions simplifiée (SAS) immatriculée au Registre du Commerce et des Sociétés de Bobigny sous le numéro 853 827 103, avec un capital de 16 999,66 euros, numéro de TVA FR90853827103 et dont le siège social est situé au 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANCE.\nEn tant qu'établissement de monnaie électronique offrant des services de paiement en vertu du droit français approuvé par l'ACPR, SWAN est inscrite auprès de ce dernier sous le numéro 17328.",
388
389
  "transactionStatement.generationDate": "Généré le : {date}",
389
390
  "transactionStatement.generationInfos": "Ce document atteste de votre demande de transaction. En aucun cas il ne constitue une preuve de son exécution. Votre transaction sera exécutée après un processus de vérification obligatoire.",
390
391
  "transactionStatement.information.amount": "Montant",
@@ -17,6 +17,7 @@
17
17
  "accountStatement.fees": "Commissioni",
18
18
  "accountStatement.iban": "IBAN",
19
19
  "accountStatement.openingBalance": "Saldo iniziale",
20
+ "accountStatement.page": "Pagina",
20
21
  "accountStatement.partnership": "In collaborazione con",
21
22
  "accountStatement.titleDocument": "Estratto conto",
22
23
  "accountStatement.titleDocument.companyDescription": "Conto aziendale - in euro",
@@ -65,6 +66,7 @@
65
66
  "common.showLess": "Mostra di meno",
66
67
  "common.showMore": "Mostra di più",
67
68
  "common.skipToContent": "Salta al contenuto",
69
+ "common.statement.footer": "SWAN è una società per azioni semplificata (SAS) registrata presso il Registro delle imprese di Bobigny con il numero 853 827 103, con un capitale di 16.999,66 euro, partita IVA FR90853827103 e sede legale in 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANCIA.\nIn qualità di istituto di moneta elettronica che offre servizi di pagamento ai sensi della legge francese approvata dall'ACPR, SWAN è registrata presso quest'ultima con il numero 17328.",
68
70
  "copyButton.copiedTooltip": "Copiato negli appunti",
69
71
  "copyButton.copyTooltip": "Clicca per copiare",
70
72
  "creditStatement.additionalDetails": "Il rendiconto dal <bold>{openingDate}</bold> al <bold>{closingDate}</bold> include tutte le commissioni e i pagamenti ricevuti fino al {closingDate}. Il prossimo addebito automatico verrà effettuato a partire dal {repaymentDate}.\n\nIn caso di mancato addebito bancario per insufficienza di fondi, potremmo ripresentare l’addebito entro <bold>3 o 4 giorni</bold> dal rifiuto comunicato dalla tua banca.",
@@ -384,7 +386,6 @@
384
386
  "transactionStatement.debtor.bankIdentifier": "Identificativo bancario del debitore",
385
387
  "transactionStatement.debtor.bankName": "Nome della banca del debitore",
386
388
  "transactionStatement.debtor.name": "Nome del debitore",
387
- "transactionStatement.footer": "SWAN è una società per azioni semplificata (SAS) registrata presso il Registro delle imprese di Bobigny con il numero 853 827 103, con un capitale di 16.999,66 euro, partita IVA FR90853827103 e sede legale in 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANCIA.\nIn qualità di istituto di moneta elettronica che offre servizi di pagamento ai sensi della legge francese approvata dall'ACPR, SWAN è registrata presso quest'ultima con il numero 17328.",
388
389
  "transactionStatement.generationDate": "Generato il: {date}",
389
390
  "transactionStatement.generationInfos": "Questo documento è la conferma della tua richiesta di transazione. Non costituisce prova dell'esecuzione della transazione. La tua transazione verrà eseguita dopo aver superato un obbligatorio processo di verifica.",
390
391
  "transactionStatement.information.amount": "Importo",
@@ -17,6 +17,7 @@
17
17
  "accountStatement.fees": "Kosten",
18
18
  "accountStatement.iban": "IBAN",
19
19
  "accountStatement.openingBalance": "Beginsaldo",
20
+ "accountStatement.page": "Pagina",
20
21
  "accountStatement.partnership": "In samenwerking met",
21
22
  "accountStatement.titleDocument": "Rekeningoverzicht",
22
23
  "accountStatement.titleDocument.companyDescription": "Zakelijke rekening - in euro's",
@@ -65,6 +66,7 @@
65
66
  "common.showLess": "Toon minder",
66
67
  "common.showMore": "Toon meer",
67
68
  "common.skipToContent": "Doorgaan naar artikel",
69
+ "common.statement.footer": "SWAN is een vereenvoudigde naamloze vennootschap (SAS) geregistreerd bij de Kamer van Koophandel van Bobigny onder nummer 853 827 103, met een kapitaal van 16.999,66 euro, btw-nummer FR90853827103 en met maatschappelijke zetel gevestigd aan 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANKRIJK.\nIn zijn hoedanigheid van een elektronisch geldinstelling die betalingsdiensten aanbiedt onder Frans recht goedgekeurd door de ACPR, is SWAN geregistreerd bij laatstgenoemde onder nummer 17328.",
68
70
  "copyButton.copiedTooltip": "Gekopieerd naar klembord",
69
71
  "copyButton.copyTooltip": "Klik om te kopiëren",
70
72
  "creditStatement.additionalDetails": "De afrekening van bold>{openingDate}</bold> tot <bold>{closingDate}</bold> bevat alle kosten en betalingen die we tot {closingDate} hebben ontvangen. De volgende automatische afschrijving gebeurt vanaf {repaymentDate}.\n\n\nAls een automatische incasso wordt geweigerd omdat er niet genoeg geld op je rekening staat, kunnen we deze incasso minstens <bold>3 tot 4 dagen</bold> na de weigering door je bank opnieuw proberen.",
@@ -384,7 +386,6 @@
384
386
  "transactionStatement.debtor.bankIdentifier": "Bank-ID van de debiteur",
385
387
  "transactionStatement.debtor.bankName": "Banknaam van de debiteur",
386
388
  "transactionStatement.debtor.name": "Naam van de debiteur",
387
- "transactionStatement.footer": "SWAN is een vereenvoudigde naamloze vennootschap (SAS) geregistreerd bij de Kamer van Koophandel van Bobigny onder nummer 853 827 103, met een kapitaal van 16.999,66 euro, btw-nummer FR90853827103 en met maatschappelijke zetel gevestigd aan 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANKRIJK.\nIn zijn hoedanigheid van een elektronisch geldinstelling die betalingsdiensten aanbiedt onder Frans recht goedgekeurd door de ACPR, is SWAN geregistreerd bij laatstgenoemde onder nummer 17328.",
388
389
  "transactionStatement.generationDate": "Gegenereerd op: {date}",
389
390
  "transactionStatement.generationInfos": "Dit document bevestigt je transactieverzoek. Het vormt geen bewijs van transactie-uitvoering. Je transactie zal worden uitgevoerd na het doorlopen van een verplicht verificatieproces.",
390
391
  "transactionStatement.information.amount": "Bedrag",
@@ -17,6 +17,7 @@
17
17
  "accountStatement.fees": "Taxas",
18
18
  "accountStatement.iban": "IBAN",
19
19
  "accountStatement.openingBalance": "Saldo inicial",
20
+ "accountStatement.page": "Página",
20
21
  "accountStatement.partnership": "Em parceria com",
21
22
  "accountStatement.titleDocument": "Extrato de conta",
22
23
  "accountStatement.titleDocument.companyDescription": "Conta empresarial - em euros",
@@ -65,6 +66,7 @@
65
66
  "common.showLess": "Mostrar menos",
66
67
  "common.showMore": "Mostrar mais",
67
68
  "common.skipToContent": "Saltar para o conteúdo",
69
+ "common.statement.footer": "A SWAN é uma sociedade anônima simplificada (SAS) registrada no Registro de Comércio e Empresas de Bobigny sob o número 853 827 103, com capital de 16.999,66 euros, número de IVA FR90853827103 e cuja sede está localizada em 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANÇA.\nNa qualidade de instituição de dinheiro eletrônico que oferece serviços de pagamento ao abrigo da lei francesa aprovada pela ACPR, a SWAN está registrada junto deste sob o número 17328.",
68
70
  "copyButton.copiedTooltip": "Copiado para a área de transferência",
69
71
  "copyButton.copyTooltip": "Clique para copiar",
70
72
  "creditStatement.additionalDetails": "O extrato de <bold>{openingDate}</bold> a <bold>{closingDate}</bold> inclui todas as taxas e pagamentos recebidos até {closingDate}. Seu próximo débito automático ocorrerá a partir de {repaymentDate}.\n\nNo caso de uma retirada bancária rejeitada devido a fundos insuficientes, podemos representar esta retirada pelo menos <bold>3 a 4 dias</bold> após a rejeição notificada pelo seu banco.",
@@ -384,7 +386,6 @@
384
386
  "transactionStatement.debtor.bankIdentifier": "Identificador bancário do devedor",
385
387
  "transactionStatement.debtor.bankName": "Nome do banco do devedor",
386
388
  "transactionStatement.debtor.name": "Nome do devedor",
387
- "transactionStatement.footer": "A SWAN é uma sociedade anônima simplificada (SAS) registrada no Registro de Comércio e Empresas de Bobigny sob o número 853 827 103, com capital de 16.999,66 euros, número de IVA FR90853827103 e cuja sede está localizada em 91 rue du Faubourg Saint-Honoré, 75008 Paris, FRANÇA.\nNa qualidade de instituição de dinheiro eletrônico que oferece serviços de pagamento ao abrigo da lei francesa aprovada pela ACPR, a SWAN está registrada junto deste sob o número 17328.",
388
389
  "transactionStatement.generationDate": "Gerado em:{date}",
389
390
  "transactionStatement.generationInfos": "Este documento é a confirmação do seu pedido de transação. Não constitui prova da execução da transação. A sua transação será executada ao completar o processo de verificação obrigatório.",
390
391
  "transactionStatement.information.amount": "Valor",
@@ -45,12 +45,12 @@ describe("validateBooleanRequired", () => {
45
45
  describe("validateIndividualTaxNumber", () => {
46
46
  describe("BEL (Belgium)", () => {
47
47
  const validator = validateIndividualTaxNumber("BEL");
48
- test("accepts valid 10-digit tax numbers", () => {
49
- expect(validator("1234567890")).toBeUndefined();
48
+ test("accepts valid 11-digit tax numbers", () => {
49
+ expect(validator("12345678901")).toBeUndefined();
50
50
  });
51
51
  test("rejects invalid formats", () => {
52
52
  expect(validator("123456789")).toBeDefined(); // 9 digits
53
- expect(validator("12345678901")).toBeDefined(); // 11 digits
53
+ expect(validator("123456789012")).toBeDefined(); // 12 digits
54
54
  expect(validator("123456789A")).toBeDefined(); // contains letter
55
55
  });
56
56
  test("allows undefined or empty values", () => {
@@ -3,7 +3,7 @@ import { ReactElement, ReactNode } from "react";
3
3
  import translationEN from "../locales/en.json";
4
4
  export type DateFormat = "DD/MM/YYYY" | "MM/DD/YYYY";
5
5
  declare const supportedLanguages: readonly ["en", "es", "de", "fr", "it", "nl", "pt", "fi"];
6
- type SupportedLanguage = (typeof supportedLanguages)[number];
6
+ export type SupportedLanguage = (typeof supportedLanguages)[number];
7
7
  type TranslationParams = Record<string, string | number>;
8
8
  export type TranslationKey = keyof typeof translationEN;
9
9
  type Locale = {
@@ -17,6 +17,7 @@ type Locale = {
17
17
  };
18
18
  export declare const locale: Locale;
19
19
  export declare const t: (key: TranslationKey, params?: TranslationParams) => string;
20
+ export declare const useTranslation: (language?: SupportedLanguage) => (key: TranslationKey, params?: TranslationParams) => string;
20
21
  export declare const formatCurrencyIso: (value: number, currency: string) => string;
21
22
  export declare const formatCurrencySymbol: (value: number, currency: string) => string;
22
23
  export declare const formatNestedMessage: (key: TranslationKey, params: Record<string, string | number | ReactElement | ((children: ReactNode) => ReactNode)>) => (string | ReactElement<unknown, string | import("react").JSXElementConstructor<any>>)[];
package/src/utils/i18n.js CHANGED
@@ -1,4 +1,5 @@
1
1
  import { createIntl, createIntlCache } from "@formatjs/intl";
2
+ import { isNullish } from "@swan-io/lake/src/utils/nullish";
2
3
  import { getRifmProps } from "@swan-io/lake/src/utils/rifm";
3
4
  import { BadStatusError } from "@swan-io/request";
4
5
  import dayjs from "dayjs";
@@ -113,7 +114,25 @@ const intl = createIntl({
113
114
  locale: locale.language,
114
115
  messages: locale.translations,
115
116
  }, createIntlCache());
117
+ // Hook to get the default intl or a specific language intl instance
118
+ const useIntl = (language) => {
119
+ if (isNullish(language)) {
120
+ return intl;
121
+ }
122
+ const localeData = locales[language]();
123
+ return createIntl({
124
+ defaultLocale: LANGUAGE_FALLBACK,
125
+ fallbackOnEmptyString: false,
126
+ locale: localeData.language,
127
+ messages: localeData.translations,
128
+ }, createIntlCache());
129
+ };
116
130
  export const t = (key, params) => intl.formatMessage({ id: key, defaultMessage: translationEN[key] }, params).toString();
131
+ // Return translation helper for a specific language
132
+ export const useTranslation = (language) => {
133
+ const intlInstance = useIntl(language);
134
+ return (key, params) => intlInstance.formatMessage({ id: key, defaultMessage: translationEN[key] }, params).toString();
135
+ };
117
136
  export const formatCurrencyIso = (value, currency) => `${intl.formatNumber(value, { style: "decimal", minimumFractionDigits: 2 })} ${currency}`;
118
137
  export const formatCurrencySymbol = (value, currency) => intl.formatNumber(value, {
119
138
  style: "currency",
@@ -0,0 +1,2 @@
1
+ import { TextStyle } from "react-native";
2
+ export declare const getTextStyle: (type: "sans" | "mono", fontSize: number) => TextStyle;
@@ -0,0 +1,8 @@
1
+ import { colors, fonts, primaryFontStyle } from "@swan-io/lake/src/constants/design";
2
+ export const getTextStyle = (type, fontSize) => ({
3
+ ...(type === "mono" ? { fontFamily: fonts.iban } : primaryFontStyle),
4
+ color: colors.gray[900],
5
+ fontSize,
6
+ lineHeight: fontSize * 1.25,
7
+ fontWeight: "400",
8
+ });
@@ -5,9 +5,9 @@ import { match } from "ts-pattern";
5
5
  import { formatExtractedDate } from "./date";
6
6
  import { t } from "./i18n";
7
7
  const EMAIL_REGEX = /^[A-Z0-9_+.-]*[A-Z0-9_+-]@([A-Z0-9][A-Z0-9-]*\.)+[A-Z]{2,}$/i;
8
- const VAT_NUMBER_REGEX = /^((AT)?U[0-9]{8}|(BE)?0[0-9]{9}|(BG)?[0-9]{9,10}|(CY)?[0-9]{8}L|(CZ)?[0-9]{8,10}|(DE)?[0-9]{9}|(DK)?[0-9]{8}|(EE)?[0-9]{9}|(EL|GR)?[0-9]{9}|(ES)?[0-9A-Z][0-9]{7}[0-9A-Z]|(FI)?[0-9]{8}|(FR)?[0-9A-Z]{2}[0-9]{9}|(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})|(HU)?[0-9]{8}|(IE)?[0-9]S[0-9]{5}L|(IT)?[0-9]{11}|(LT)?([0-9]{9}|[0-9]{12})|(LU)?[0-9]{8}|(LV)?[0-9]{11}|(MT)?[0-9]{8}|(NL)?[0-9]{9}B[0-9]{2}|(PL)?[0-9]{10}|(PT)?[0-9]{9}|(RO)?[0-9]{2,10}|(SE)?[0-9]{12}|(SI)?[0-9]{8}|(SK)?[0-9]{10})$/;
8
+ const VAT_NUMBER_REGEX = /^((AT)?U[0-9]{8}|(BE)?[01][0-9]{9}|(BG)?[0-9]{9,10}|(CY)?[0-9]{8}L|(CZ)?[0-9]{8,10}|(DE)?[0-9]{9}|(DK)?[0-9]{8}|(EE)?[0-9]{9}|(EL|GR)?[0-9]{9}|(ES)?[0-9A-Z][0-9]{7}[0-9A-Z]|(FI)?[0-9]{8}|(FR)?[0-9A-Z]{2}[0-9]{9}|(GB)?([0-9]{9}([0-9]{3})?|[A-Z]{2}[0-9]{3})|(HU)?[0-9]{8}|(IE)?[0-9]S[0-9]{5}L|(IT)?[0-9]{11}|(LT)?([0-9]{9}|[0-9]{12})|(LU)?[0-9]{8}|(LV)?[0-9]{11}|(MT)?[0-9]{8}|(NL)?[0-9]{9}B[0-9]{2}|(PL)?[0-9]{10}|(PT)?[0-9]{9}|(RO)?[0-9]{2,10}|(SE)?[0-9]{12}|(SI)?[0-9]{8}|(SK)?[0-9]{10})$/;
9
9
  // (AT)?U[0-9]{8} | # Austria
10
- // (BE)?0[0-9]{9} | # Belgium
10
+ // (BE)?[01][0-9]{9} | # Belgium
11
11
  // (BG)?[0-9]{9,10} | # Bulgaria
12
12
  // (CY)?[0-9]{8}L | # Cyprus
13
13
  // (CZ)?[0-9]{8,10} | # Czech Republic
@@ -36,8 +36,8 @@ const VAT_NUMBER_REGEX = /^((AT)?U[0-9]{8}|(BE)?0[0-9]{9}|(BG)?[0-9]{9,10}|(CY)?
36
36
  const TAX_NUMBER_REGEX = {
37
37
  individual: {
38
38
  BEL: {
39
- pattern: /^\d{10}$/,
40
- message: t("common.form.help.nbDigits", { nbDigits: "10" }),
39
+ pattern: /^\d{11}$/,
40
+ message: t("common.form.help.nbDigits", { nbDigits: "11" }),
41
41
  },
42
42
  DEU: {
43
43
  pattern: /^\d{11}$/,