@swan-io/shared-business 12.2.15 → 12.3.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": "12.2.15",
3
+ "version": "12.3.0",
4
4
  "engines": {
5
5
  "node": "^22.12.0"
6
6
  },
@@ -25,7 +25,7 @@
25
25
  ],
26
26
  "license": "MIT",
27
27
  "peerDependencies": {
28
- "@swan-io/lake": "12.2.15"
28
+ "@swan-io/lake": "12.3.0"
29
29
  },
30
30
  "dependencies": {
31
31
  "@formatjs/intl": "^3.1.6",
@@ -51,6 +51,6 @@
51
51
  "@types/react-native": "^0.72.8",
52
52
  "jsdom": "^26.1.0",
53
53
  "vitest": "^3.2.0",
54
- "@swan-io/lake": "12.2.15"
54
+ "@swan-io/lake": "12.3.0"
55
55
  }
56
56
  }
@@ -3,7 +3,7 @@ import { Box } from "@swan-io/lake/src/components/Box";
3
3
  import { Separator } from "@swan-io/lake/src/components/Separator";
4
4
  import { Space } from "@swan-io/lake/src/components/Space";
5
5
  import { SwanLogo } from "@swan-io/lake/src/components/SwanLogo";
6
- import { colors, fonts, interFontStyle, spacings } from "@swan-io/lake/src/constants/design";
6
+ import { colors, fonts, primaryFontStyle, spacings } from "@swan-io/lake/src/constants/design";
7
7
  import { isNotNullish, isNotNullishOrEmpty } from "@swan-io/lake/src/utils/nullish";
8
8
  import { StyleSheet, Text } from "react-native";
9
9
  import { match } from "ts-pattern";
@@ -12,7 +12,7 @@ import { formatCurrencyIso, t } from "../utils/i18n";
12
12
  const LOGO_MAX_HEIGHT = 24;
13
13
  const LOGO_MAX_WIDTH = 150;
14
14
  const getTextStyle = (type, fontSize) => ({
15
- ...(type === "mono" ? { fontFamily: fonts.iban } : interFontStyle),
15
+ ...(type === "mono" ? { fontFamily: fonts.iban } : primaryFontStyle),
16
16
  color: colors.gray[900],
17
17
  fontSize,
18
18
  lineHeight: fontSize * 1.25,
@@ -0,0 +1,46 @@
1
+ import { StyleProp, ViewStyle } from "react-native";
2
+ import { CountryCCA3 } from "../constants/countries";
3
+ export type TransactionType = "SepaCreditTransferIn" | "SepaCreditTransferOut" | "SepaInstantCreditTransferIn" | "SepaInstantCreditTransferOut" | "InternalCreditTransferIn" | "InternalCreditTransferOut" | "InternationalCreditTransferIn" | "InternationalCreditTransferOut" | "InternalCreditTransferOutReturn" | "InternalCreditTransferOutRecall" | "InternalCreditTransferInReturn" | "InternalCreditTransferInRecall" | "SepaCreditTransferOutReturn" | "SepaInstantCreditTransferOutRecall" | "SepaInstantCreditTransferInRecall" | "SepaCreditTransferOutRecall" | "SepaCreditTransferInReturn" | "SepaCreditTransferInRecall" | "FeesOut" | "FeesIn" | "SepaDirectDebitIn" | "SepaDirectDebitInReturn" | "SepaDirectDebitInReversal" | "SepaDirectDebitOut" | "SepaDirectDebitOutReturn" | "SepaDirectDebitOutReversal" | "CardOutAuthorization" | "CardOutDebit" | "CardOutDebitReversal" | "CardOutCredit" | "CardOutCreditReversal" | "InternalDirectDebitIn" | "InternalDirectDebitInReturn" | "InternalDirectDebitOut" | "InternalDirectDebitOutReturn" | "CheckIn" | "CheckInReturn" | "InternationalCreditTransferInReturn" | "InternationalCreditTransferOutReturn" | "CardInCredit" | "CardInChargeback" | "CardInChargebackReversal";
4
+ type AddressInfo = {
5
+ addressLine1: string;
6
+ addressLine2?: string;
7
+ city: string;
8
+ postalCode: string;
9
+ state?: string;
10
+ country: CountryCCA3;
11
+ };
12
+ type Amount = {
13
+ value: string;
14
+ currency: string;
15
+ };
16
+ type Transaction = {
17
+ transactionId: string;
18
+ transactionLabel: string;
19
+ transactionDate: string;
20
+ transactionType: TransactionType;
21
+ transactionSide: "Credit" | "Debit";
22
+ transactionAmount: Amount;
23
+ };
24
+ type CreditStatementV1Props = {
25
+ version: "v1";
26
+ partnerLogoUrl?: string;
27
+ style?: StyleProp<ViewStyle>;
28
+ accountHolderType: "Individual" | "Company";
29
+ accountHolderName: string;
30
+ accountHolderAddress: AddressInfo;
31
+ iban: string;
32
+ bic: string;
33
+ openingDate: string;
34
+ closingDate: string;
35
+ openingBalance: Amount;
36
+ transactions: Transaction[];
37
+ totalsCredit: Amount;
38
+ totalsDebit: Amount;
39
+ closingBalance: Amount;
40
+ feesDebit: Amount;
41
+ feesCredit: Amount;
42
+ };
43
+ export declare const CreditStatementV1: ({ partnerLogoUrl, accountHolderType, accountHolderName, accountHolderAddress, iban, bic, openingDate, closingDate, openingBalance, transactions, feesDebit, feesCredit, totalsCredit, totalsDebit, closingBalance, }: CreditStatementV1Props) => import("react/jsx-runtime").JSX.Element;
44
+ export type CreditStatementProps = CreditStatementV1Props;
45
+ export declare const CreditStatement: (props: CreditStatementProps) => import("react/jsx-runtime").JSX.Element;
46
+ export {};
@@ -0,0 +1,135 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Box } from "@swan-io/lake/src/components/Box";
3
+ import { Separator } from "@swan-io/lake/src/components/Separator";
4
+ import { Space } from "@swan-io/lake/src/components/Space";
5
+ import { SwanLogo } from "@swan-io/lake/src/components/SwanLogo";
6
+ import { colors, fonts, interFontStyle, invariantColors, spacings, } from "@swan-io/lake/src/constants/design";
7
+ import { isNotNullish, isNotNullishOrEmpty } from "@swan-io/lake/src/utils/nullish";
8
+ import { StyleSheet, Text } from "react-native";
9
+ import { match } from "ts-pattern";
10
+ import { getCountryName } from "../constants/countries";
11
+ import { formatCurrencySymbol, 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 } : interFontStyle),
16
+ color: colors.gray[900],
17
+ fontSize,
18
+ lineHeight: fontSize * 1.25,
19
+ fontWeight: "400",
20
+ });
21
+ const styles = StyleSheet.create({
22
+ container: {
23
+ width: 793,
24
+ padding: 56,
25
+ backgroundColor: invariantColors.white,
26
+ },
27
+ partnershipText: {
28
+ ...getTextStyle("sans", 14),
29
+ color: colors.gray[500],
30
+ },
31
+ pageTitle: {
32
+ ...getTextStyle("sans", 20),
33
+ color: colors.swan[500],
34
+ fontWeight: "600",
35
+ },
36
+ sectionTitle: {
37
+ ...getTextStyle("sans", 14),
38
+ color: colors.swan[500],
39
+ fontWeight: "500",
40
+ lineHeight: 24,
41
+ },
42
+ totalAmount: {
43
+ ...getTextStyle("sans", 20),
44
+ lineHeight: 28,
45
+ fontWeight: "600",
46
+ },
47
+ titleColumn: {
48
+ ...getTextStyle("sans", 15),
49
+ fontWeight: "500",
50
+ paddingVertical: spacings[4],
51
+ minWidth: spacings[96],
52
+ lineHeight: 24,
53
+ },
54
+ openingBalanceText: {
55
+ ...getTextStyle("sans", 14),
56
+ textAlign: "right",
57
+ },
58
+ textColumn: {
59
+ ...getTextStyle("sans", 14),
60
+ color: "colors.gray[700]",
61
+ // lineHeight: 20,
62
+ paddingVertical: spacings[4],
63
+ },
64
+ text: {
65
+ ...getTextStyle("sans", 14),
66
+ color: colors.gray[700],
67
+ lineHeight: 24,
68
+ },
69
+ row: {
70
+ textAlign: "right",
71
+ paddingVertical: spacings[4],
72
+ fontWeight: "600",
73
+ width: "20%",
74
+ },
75
+ closingBalanceRow: {
76
+ ...getTextStyle("sans", 14),
77
+ backgroundColor: colors.gray[50],
78
+ width: "50%",
79
+ },
80
+ footer: {
81
+ ...getTextStyle("sans", 10),
82
+ color: colors.gray[500],
83
+ fontWeight: "300",
84
+ },
85
+ defaultLogo: {
86
+ height: LOGO_MAX_HEIGHT,
87
+ width: (45 / 10) * LOGO_MAX_HEIGHT,
88
+ },
89
+ swanLogo: {
90
+ height: 8,
91
+ width: (45 / 10) * 8,
92
+ position: "relative",
93
+ top: 0.5,
94
+ },
95
+ });
96
+ const Title = ({ text, align = "left", style, }) => (_jsx(Text, { style: [
97
+ styles.titleColumn,
98
+ style,
99
+ {
100
+ textAlign: align,
101
+ },
102
+ ], children: text }));
103
+ const translateTransaction = (transaction) => {
104
+ return match(transaction)
105
+ .with("CardInChargeback", "CardInChargebackReversal", "CardInCredit", "CardOutAuthorization", "CardOutCredit", "CardOutCreditReversal", "CardOutDebit", "CardOutDebitReversal", () => t("accountStatement.card"))
106
+ .with("CheckIn", "CheckInReturn", () => t("accountStatement.check"))
107
+ .with("FeesIn", "FeesOut", () => t("accountStatement.fees"))
108
+ .with("SepaCreditTransferIn", "SepaCreditTransferOut", "SepaInstantCreditTransferIn", "SepaInstantCreditTransferOut", "InternalCreditTransferIn", "InternalCreditTransferOut", "InternationalCreditTransferIn", "InternationalCreditTransferOut", "InternalCreditTransferOutReturn", "InternalCreditTransferOutRecall", "InternalCreditTransferInReturn", "InternalCreditTransferInRecall", "SepaCreditTransferOutReturn", "SepaInstantCreditTransferOutRecall", "SepaInstantCreditTransferInRecall", "SepaCreditTransferOutRecall", "SepaCreditTransferInReturn", "SepaCreditTransferInRecall", "InternationalCreditTransferInReturn", "InternationalCreditTransferOutReturn", () => t("accountStatement.creditTransfer"))
109
+ .with("SepaDirectDebitIn", "SepaDirectDebitInReturn", "SepaDirectDebitInReversal", "SepaDirectDebitOut", "SepaDirectDebitOutReturn", "SepaDirectDebitOutReversal", "InternalDirectDebitIn", "InternalDirectDebitInReturn", "InternalDirectDebitOut", "InternalDirectDebitOutReturn", () => t("accountStatement.directDebit"))
110
+ .exhaustive();
111
+ };
112
+ const logoStyle = {
113
+ height: LOGO_MAX_HEIGHT,
114
+ maxWidth: LOGO_MAX_WIDTH,
115
+ objectFit: "contain",
116
+ objectPosition: "left",
117
+ };
118
+ export const CreditStatementV1 = ({ partnerLogoUrl, accountHolderType, accountHolderName, accountHolderAddress, iban, bic, openingDate, closingDate, openingBalance, transactions, feesDebit, feesCredit, totalsCredit, totalsDebit, closingBalance, }) => {
119
+ return (_jsxs(Box, { style: styles.container, 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("creditStatement.titleDocument") }), _jsx(Text, { style: styles.text, children: accountHolderType === "Company"
120
+ ? t("accountStatement.titleDocument.companyDescription")
121
+ : t("accountStatement.titleDocument.individualDescription") }), _jsx(Space, { height: 12 }), _jsxs(Box, { direction: "column", children: [_jsx(Text, { style: styles.sectionTitle, children: accountHolderName }), _jsx(Text, { style: styles.text, children: accountHolderAddress.addressLine1 }), isNotNullish(accountHolderAddress.addressLine2) && (_jsx(Text, { children: accountHolderAddress.addressLine2 })), _jsx(Text, { style: styles.text, children: `${accountHolderAddress.postalCode} ${accountHolderAddress.city}, ${getCountryName(accountHolderAddress.country)}` })] }), _jsx(Space, { height: 12 }), _jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.iban") }), _jsx(Text, { style: styles.text, children: iban }), _jsx(Space, { height: 4 }), _jsx(Text, { style: styles.sectionTitle, children: t("accountStatement.bic") }), _jsx(Text, { style: styles.text, children: bic }), _jsx(Space, { height: 24 }), _jsxs(Box, { direction: "row", justifyContent: "spaceBetween", children: [_jsx(Box, { direction: "column", justifyContent: "end", 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: formatCurrencySymbol(Number(openingBalance.value), openingBalance.currency) })] })] }), _jsx(Space, { height: 24 }), _jsxs(_Fragment, { children: [_jsxs(Box, { direction: "row", 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("creditStatement.column.credit") }), _jsx(Text, { style: [styles.titleColumn, { width: "15%", textAlign: "right" }], children: t("creditStatement.column.debit") })] }), _jsx(Box, { direction: "column", children: transactions.map(({ transactionAmount, transactionDate, transactionLabel, transactionSide, transactionType, transactionId, }) => (_jsxs(Box, { direction: "row", children: [_jsx(Text, { style: [styles.textColumn, { width: "15%" }], children: transactionDate }), _jsx(Text, { style: [styles.textColumn, { width: "22%" }], children: translateTransaction(transactionType) }), _jsx(Text, { style: [styles.textColumn, { width: "33%" }], children: transactionLabel }), _jsx(Text, { style: [
122
+ styles.textColumn,
123
+ { width: "15%", textAlign: "right", fontWeight: "600" },
124
+ ], children: transactionSide === "Credit" ? transactionAmount.value : "" }), _jsx(Text, { style: [
125
+ styles.textColumn,
126
+ { width: "15%", textAlign: "right", fontWeight: "600" },
127
+ ], children: transactionSide === "Debit" ? transactionAmount.value : "" })] }, transactionId))) })] }), _jsx(Space, { height: 24 }), _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, { width: "15%" }], children: feesCredit.value }), _jsx(Text, { style: [styles.row, { width: "15%" }], children: feesDebit.value })] }), _jsx(Space, { height: 12 }), _jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: styles.row, children: t("accountStatement.column.totals") }), _jsx(Text, { style: [styles.row, { width: "15%" }], children: totalsCredit.value }), _jsx(Text, { style: [styles.row, { width: "15%" }], children: totalsDebit.value })] })] }), _jsx(Space, { height: 12 }), _jsx(Box, { direction: "row", justifyContent: "end", children: _jsxs(Box, { direction: "row", justifyContent: "spaceBetween", alignItems: "center", style: { width: "50%" }, children: [_jsx(Title, { align: "right", text: t("accountStatement.closingBalance"), style: { width: "40%" } }), _jsx(Title, { text: formatCurrencySymbol(Number(closingBalance.value), closingBalance.currency), style: {
128
+ width: "60%",
129
+ ...getTextStyle("sans", 20),
130
+ fontWeight: "600",
131
+ }, align: "right" })] }) })] }), _jsxs(Box, { children: [_jsx(Separator, { space: 24 }), _jsx(Text, { style: styles.footer, children: t("transactionStatement.footer") })] })] }));
132
+ };
133
+ export const CreditStatement = (props) => match(props)
134
+ .with({ version: "v1" }, props => _jsx(CreditStatementV1, { ...props }))
135
+ .exhaustive();
@@ -6,7 +6,7 @@ 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, interFontStyle, invariantColors, radii, spacings, } from "@swan-io/lake/src/constants/design";
9
+ import { colors, fonts, invariantColors, primaryFontStyle, 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";
@@ -14,7 +14,7 @@ import { t } from "../utils/i18n";
14
14
  const LOGO_MAX_HEIGHT = 24;
15
15
  const LOGO_MAX_WIDTH = 150;
16
16
  const getTextStyle = (type, fontSize) => ({
17
- ...(type === "mono" ? { fontFamily: fonts.iban } : interFontStyle),
17
+ ...(type === "mono" ? { fontFamily: fonts.iban } : primaryFontStyle),
18
18
  color: colors.gray[900],
19
19
  fontSize,
20
20
  lineHeight: fontSize * 1.25,
@@ -5,7 +5,7 @@ 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, interFontStyle } from "@swan-io/lake/src/constants/design";
8
+ import { colors, fonts, primaryFontStyle } 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";
@@ -14,7 +14,7 @@ import { formatCurrencyIso, t } from "../utils/i18n";
14
14
  const LOGO_MAX_HEIGHT = 24;
15
15
  const LOGO_MAX_WIDTH = 150;
16
16
  const getTextStyle = (type, fontSize) => ({
17
- ...(type === "mono" ? { fontFamily: fonts.iban } : interFontStyle),
17
+ ...(type === "mono" ? { fontFamily: fonts.iban } : primaryFontStyle),
18
18
  color: colors.gray[900],
19
19
  fontSize,
20
20
  lineHeight: fontSize * 1.25,
@@ -67,6 +67,9 @@
67
67
  "common.skipToContent": "Zum Inhalt springen",
68
68
  "copyButton.copiedTooltip": "In die Zwischenablage kopiert",
69
69
  "copyButton.copyTooltip": "Zum Kopieren anklicken",
70
+ "creditStatement.column.credit": "Gutschrift",
71
+ "creditStatement.column.debit": "Lastschrift",
72
+ "creditStatement.titleDocument": "Rückzahlungsaufstellung",
70
73
  "datePicker.day": "Tag",
71
74
  "datePicker.day.friday": "Freitag",
72
75
  "datePicker.day.monday": "Montag",
@@ -21,6 +21,9 @@
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
+ "creditStatement.titleDocument": "Repayment statement",
25
+ "creditStatement.column.credit": "Credit",
26
+ "creditStatement.column.debit": "Debit",
24
27
  "addressFormPart.addressLabel": "Type your address",
25
28
  "addressFormPart.cityLabel": "City",
26
29
  "addressFormPart.placeholder": "Start typing…",
@@ -67,6 +67,9 @@
67
67
  "common.skipToContent": "Saltar al contenido",
68
68
  "copyButton.copiedTooltip": "Copiado al portapapeles",
69
69
  "copyButton.copyTooltip": "Haz clic para copiar",
70
+ "creditStatement.column.credit": "Crédito",
71
+ "creditStatement.column.debit": "Débito",
72
+ "creditStatement.titleDocument": "Estado de reembolso",
70
73
  "datePicker.day": "Día",
71
74
  "datePicker.day.friday": "Viernes",
72
75
  "datePicker.day.monday": "Lunes",
@@ -67,6 +67,9 @@
67
67
  "common.skipToContent": "Ohita ja siirry sisältöön",
68
68
  "copyButton.copiedTooltip": "Kopioitu leikepöydälle",
69
69
  "copyButton.copyTooltip": "Kopioi napsauttamalla",
70
+ "creditStatement.column.credit": "Hyvitys",
71
+ "creditStatement.column.debit": "Velka",
72
+ "creditStatement.titleDocument": "Takaisinmaksuilmoitus",
70
73
  "datePicker.day": "Päivä",
71
74
  "datePicker.day.friday": "Perjantai",
72
75
  "datePicker.day.monday": "Maanantai",
@@ -67,6 +67,9 @@
67
67
  "common.skipToContent": "Aller au contenu",
68
68
  "copyButton.copiedTooltip": "Copié dans le presse-papier",
69
69
  "copyButton.copyTooltip": "Cliquez pour copier",
70
+ "creditStatement.column.credit": "Crédit",
71
+ "creditStatement.column.debit": "Débit",
72
+ "creditStatement.titleDocument": "Relevé de remboursement",
70
73
  "datePicker.day": "Jour",
71
74
  "datePicker.day.friday": "Vendredi",
72
75
  "datePicker.day.monday": "Lundi",
@@ -67,6 +67,9 @@
67
67
  "common.skipToContent": "Salta al contenuto",
68
68
  "copyButton.copiedTooltip": "Copiato negli appunti",
69
69
  "copyButton.copyTooltip": "Clicca per copiare",
70
+ "creditStatement.column.credit": "Credito",
71
+ "creditStatement.column.debit": "Addebito",
72
+ "creditStatement.titleDocument": "Riepilogo dei rimborsi",
70
73
  "datePicker.day": "Giorno",
71
74
  "datePicker.day.friday": "Venerdì",
72
75
  "datePicker.day.monday": "Lunedì",
@@ -67,6 +67,9 @@
67
67
  "common.skipToContent": "Doorgaan naar artikel",
68
68
  "copyButton.copiedTooltip": "Gekopieerd naar klembord",
69
69
  "copyButton.copyTooltip": "Klik om te kopiëren",
70
+ "creditStatement.column.credit": "Credit",
71
+ "creditStatement.column.debit": "Debit",
72
+ "creditStatement.titleDocument": "Terugbetalingsverklaring",
70
73
  "datePicker.day": "Dag",
71
74
  "datePicker.day.friday": "Vrijdag",
72
75
  "datePicker.day.monday": "Maandag",
@@ -67,6 +67,9 @@
67
67
  "common.skipToContent": "Saltar para o conteúdo",
68
68
  "copyButton.copiedTooltip": "Copiado para a área de transferência",
69
69
  "copyButton.copyTooltip": "Clique para copiar",
70
+ "creditStatement.column.credit": "Crédito",
71
+ "creditStatement.column.debit": "Débito",
72
+ "creditStatement.titleDocument": "Declaração de reembolso",
70
73
  "datePicker.day": "Dia",
71
74
  "datePicker.day.friday": "Sexta-feira",
72
75
  "datePicker.day.monday": "Segunda-feira",
@@ -18,6 +18,7 @@ type Locale = {
18
18
  export declare const locale: Locale;
19
19
  export declare const t: (key: TranslationKey, params?: TranslationParams) => string;
20
20
  export declare const formatCurrencyIso: (value: number, currency: string) => string;
21
+ export declare const formatCurrencySymbol: (value: number, currency: string) => string;
21
22
  export declare const formatNestedMessage: (key: TranslationKey, params: Record<string, string | number | ReactElement | ((children: ReactNode) => ReactNode)>) => (string | ReactElement<unknown, string | import("react").JSXElementConstructor<any>>)[];
22
23
  export declare const rifmDateProps: RifmProps;
23
24
  export declare const isTranslationKey: (value: unknown) => value is TranslationKey;
package/src/utils/i18n.js CHANGED
@@ -115,6 +115,11 @@ const intl = createIntl({
115
115
  }, createIntlCache());
116
116
  export const t = (key, params) => intl.formatMessage({ id: key, defaultMessage: translationEN[key] }, params).toString();
117
117
  export const formatCurrencyIso = (value, currency) => `${intl.formatNumber(value, { style: "decimal", minimumFractionDigits: 2 })} ${currency}`;
118
+ export const formatCurrencySymbol = (value, currency) => intl.formatNumber(value, {
119
+ style: "currency",
120
+ currency,
121
+ maximumFractionDigits: 2,
122
+ });
118
123
  export const formatNestedMessage = (key, params) => {
119
124
  const result = intl.formatMessage({ id: key, defaultMessage: translationEN[key] },
120
125
  // @ts-expect-error