@swan-io/shared-business 13.5.2 → 13.6.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.5.2",
3
+ "version": "13.6.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": "13.5.2"
28
+ "@swan-io/lake": "13.6.0"
29
29
  },
30
30
  "dependencies": {
31
31
  "@formatjs/intl": "^4.1.2",
@@ -50,6 +50,6 @@
50
50
  "@types/react-dom": "^19.2.3",
51
51
  "@types/react-native": "^0.72.8",
52
52
  "type-fest": "^5.4.3",
53
- "@swan-io/lake": "13.5.2"
53
+ "@swan-io/lake": "13.6.0"
54
54
  }
55
55
  }
@@ -105,7 +105,7 @@ const translateTransaction = (transaction, t) => {
105
105
  };
106
106
  export const AccountStatementV1 = ({ style, accountHolderName, accountHolderAddress, accountHolderType, iban, bic, openingDate, closingDate, openingBalance, transactions, feesDebit, feesCredit, totalsCredit, totalsDebit, closingBalance, language, }) => {
107
107
  const t = useTranslation(language);
108
- 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 }), _jsxs(Text, { style: styles.text, children: [accountHolderAddress.city, ",", " ", isNotNullish(accountHolderAddress.country) && accountHolderAddress.country] }), _jsx(Space, { height: 24 }), isNotEmpty(iban) && (_jsxs(Text, { style: styles.textBold, children: [t("accountStatement.iban"), " ", _jsx(Text, { style: styles.text, children: iban })] })), _jsx(Space, { height: 4 }), isNotEmpty(bic) && (_jsxs(Text, { style: styles.textBold, children: [t("accountStatement.bic"), _jsx(Text, { style: styles.text, children: bic })] }))] }), _jsxs(Box, { direction: "column", alignItems: "end", children: [_jsx(Text, { style: styles.pageTitle, children: t("accountStatement.titleDocument") }), _jsx(Text, { style: styles.pageSubTitle, children: accountHolderType === "Company"
108
+ 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 }), _jsxs(Text, { style: styles.text, children: [accountHolderAddress.city, ",", " ", isNotNullish(accountHolderAddress.country) && accountHolderAddress.country] }), _jsx(Space, { height: 24 }), isNotEmpty(iban) && (_jsxs(Text, { style: styles.textBold, children: [t("accountStatement.iban"), " ", _jsx(Text, { style: styles.text, children: iban })] })), _jsx(Space, { height: 4 }), isNotEmpty(bic) && (_jsxs(Text, { style: styles.textBold, children: [t("accountStatement.bic"), " ", _jsx(Text, { style: styles.text, children: bic })] }))] }), _jsxs(Box, { direction: "column", alignItems: "end", children: [_jsx(Text, { style: styles.pageTitle, children: t("accountStatement.titleDocument") }), _jsx(Text, { style: styles.pageSubTitle, children: accountHolderType === "Company"
109
109
  ? t("accountStatement.titleDocument.companyDescription")
110
110
  : t("accountStatement.titleDocument.individualDescription") }), _jsx(Space, { height: 24 }), _jsx(Text, { style: styles.textBold, children: t("accountStatement.contactSupport") }), _jsx(Text, { style: styles.text, children: "support.swan.io" })] })] }), _jsx(Space, { height: 48 }), _jsxs(Box, { direction: "row", justifyContent: "spaceBetween", alignItems: "center", children: [_jsx(Box, { direction: "column", children: _jsx(Text, { style: styles.dateTitle, 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: openingBalance.value })] })] }), _jsx(Space, { height: 24 }), _jsxs(_Fragment, { children: [_jsxs(Box, { direction: "row", style: styles.thead, children: [_jsx(Text, { style: [styles.titleColumn, { width: "13%" }], children: t("accountStatement.column.date") }), _jsx(Text, { style: [styles.titleColumn, { width: "17%" }], children: t("accountStatement.column.type") }), _jsx(Text, { style: [styles.titleColumn, { width: "40%" }], 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: "13%" }], children: transaction.date }), _jsx(Text, { style: [styles.textColumn, { width: "17%" }], children: translateTransaction(transaction.type, t) }), _jsx(Text, { style: [styles.textColumn, { width: "40%" }], 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))) })] }), _jsx(Space, { height: 12 }), _jsxs(Box, { direction: "column", children: [_jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: [styles.row, styles.textBold], children: t("accountStatement.column.fees") }), _jsx(Text, { style: [styles.row, styles.textBold], children: feesCredit.value }), _jsx(Text, { style: [styles.row, styles.textBold], children: feesDebit.value })] }), _jsxs(Box, { direction: "row", justifyContent: "end", children: [_jsx(Text, { style: [styles.row, styles.textBold], children: t("accountStatement.column.totals") }), _jsx(Text, { style: [styles.row, styles.textBold], children: totalsCredit.value }), _jsx(Text, { style: [styles.row, styles.textBold], children: totalsDebit.value })] })] }), _jsx(Space, { height: 12 }), _jsx(Box, { direction: "row", justifyContent: "end", children: _jsxs(Box, { direction: "row", alignItems: "center", style: styles.closingBalanceRow, justifyContent: "spaceBetween", children: [_jsx(Title, { style: styles.closingBalanceRowText, text: t("accountStatement.closingBalance") }), _jsx(Title, { text: closingBalance.value, style: styles.totalAmount, align: "right" })] }) })] }) }) }));
111
111
  };
@@ -23,8 +23,8 @@ type Props = {
23
23
  language: "en" | "es" | "de" | "fi" | "fr" | "it" | "nl" | "pt";
24
24
  placeholder: string;
25
25
  shouldDisplaySuggestions?: boolean;
26
- emptyResultText: string;
26
+ emptyResult: string;
27
27
  apiKey?: string;
28
28
  };
29
- export declare const PlacekitAddressSearchInput: ({ inputRef, id, country, disabled, error, value, types, onValueChange, onSuggestion, language, placeholder, shouldDisplaySuggestions, emptyResultText, apiKey, }: Props) => import("react/jsx-runtime").JSX.Element;
29
+ export declare const PlacekitAddressSearchInput: ({ inputRef, id, country, disabled, error, value, types, onValueChange, onSuggestion, language, placeholder, shouldDisplaySuggestions, emptyResult, apiKey, }: Props) => import("react/jsx-runtime").JSX.Element;
30
30
  export {};
@@ -4,7 +4,7 @@ import { AutocompleteSearchInput } from "@swan-io/lake/src/components/Autocomple
4
4
  import { useCallback } from "react";
5
5
  import { countriesWithMultipleCCA3, getCCA2forCCA3 } from "../constants/countries";
6
6
  import { usePlacekit } from "../hooks/usePlacekit";
7
- export const PlacekitAddressSearchInput = ({ inputRef, id, country, disabled, error, value, types = ["street"], onValueChange, onSuggestion, language, placeholder, shouldDisplaySuggestions = true, emptyResultText, apiKey, }) => {
7
+ export const PlacekitAddressSearchInput = ({ inputRef, id, country, disabled, error, value, types = ["street"], onValueChange, onSuggestion, language, placeholder, shouldDisplaySuggestions = true, emptyResult, apiKey, }) => {
8
8
  const placekit = usePlacekit({ apiKey });
9
9
  const loadSuggestions = useCallback((value) => {
10
10
  if (placekit != null) {
@@ -36,5 +36,5 @@ export const PlacekitAddressSearchInput = ({ inputRef, id, country, disabled, er
36
36
  countryCode: suggestion.value.countrycode,
37
37
  });
38
38
  }, [onSuggestion]);
39
- return (_jsx(AutocompleteSearchInput, { inputRef: inputRef, value: value, onValueChange: onValueChange, disabled: disabled, id: id, placeholder: placeholder, error: error, emptyResultText: emptyResultText, shouldDisplaySuggestions: shouldDisplaySuggestions, loadSuggestions: placekit != null ? loadSuggestions : undefined, onSuggestion: onSuggestionSelected }));
39
+ return (_jsx(AutocompleteSearchInput, { inputRef: inputRef, value: value, onValueChange: onValueChange, disabled: disabled, id: id, placeholder: placeholder, error: error, emptyResult: emptyResult, shouldDisplaySuggestions: shouldDisplaySuggestions, loadSuggestions: placekit != null ? loadSuggestions : undefined, onSuggestion: onSuggestionSelected }));
40
40
  };
@@ -30,5 +30,5 @@ export const PlacekitCityInput = ({ value, onValueChange, country, disabled, pla
30
30
  postalCode: suggestion.value.zipcode[0],
31
31
  });
32
32
  }, [onSuggestion]);
33
- return (_jsx(AutocompleteSearchInput, { value: value, onValueChange: onValueChange, disabled: disabled, id: id, placeholder: placeholder, error: error, emptyResultText: t("common.noResult"), loadSuggestions: placekit != null ? loadSuggestions : undefined, onSuggestion: onSuggestionSelected, onLoadError: onLoadError }));
33
+ return (_jsx(AutocompleteSearchInput, { value: value, onValueChange: onValueChange, disabled: disabled, id: id, placeholder: placeholder, error: error, emptyResult: t("common.noResult"), loadSuggestions: placekit != null ? loadSuggestions : undefined, onSuggestion: onSuggestionSelected, onLoadError: onLoadError }));
34
34
  };