@layerfi/components 0.1.63 → 0.1.64

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/dist/index.d.ts CHANGED
@@ -1047,7 +1047,10 @@ declare module '@layerfi/components/components/BankTransactionMobileList/Transac
1047
1047
 
1048
1048
  }
1049
1049
  declare module '@layerfi/components/components/BankTransactionMobileList/constants' {
1050
- export const PersonalCategories: string[];
1050
+ export enum PersonalCategories {
1051
+ INCOME = "PERSONAL_INFLOWS",
1052
+ EXPENSES = "PERSONAL_EXPENSES"
1053
+ }
1051
1054
 
1052
1055
  }
1053
1056
  declare module '@layerfi/components/components/BankTransactionMobileList/index' {
package/dist/index.js CHANGED
@@ -4966,9 +4966,6 @@ var ActionableList = ({
4966
4966
  )));
4967
4967
  };
4968
4968
 
4969
- // src/components/BankTransactionMobileList/constants.ts
4970
- var PersonalCategories = ["PERSONAL_INCOME", "PERSONAL_EXPENSES"];
4971
-
4972
4969
  // src/components/BankTransactionMobileList/utils.ts
4973
4970
  var mapCategoryToOption = (category) => ({
4974
4971
  label: category.display_name,
@@ -5015,7 +5012,7 @@ var getAssignedValue = (bankTransaction) => {
5015
5012
  if (bankTransaction.categorization_status === "MATCHED" /* MATCHED */ || bankTransaction?.categorization_status === "SPLIT" /* SPLIT */) {
5016
5013
  return;
5017
5014
  }
5018
- if (bankTransaction.category && !PersonalCategories.includes(bankTransaction.category.display_name)) {
5015
+ if (bankTransaction.category && bankTransaction.category.type != "Exclusion") {
5019
5016
  return mapCategoryToOption(bankTransaction.category);
5020
5017
  }
5021
5018
  if (hasSuggestions(bankTransaction.categorization_flow)) {
@@ -5031,7 +5028,9 @@ var BusinessCategories = ({
5031
5028
  selectedId
5032
5029
  }) => {
5033
5030
  const { categories } = useLayerContext();
5034
- const categoryOptions = flattenCategories(categories);
5031
+ const categoryOptions = flattenCategories(
5032
+ categories.filter((category) => category.type != "ExclusionNested")
5033
+ );
5035
5034
  const [optionsToShow, setOptionsToShow] = (0, import_react56.useState)(categoryOptions);
5036
5035
  const [selectedGroup, setSelectedGroup] = (0, import_react56.useState)();
5037
5036
  const onCategorySelect = (v) => {
@@ -7253,12 +7252,21 @@ var BusinessForm = ({ bankTransaction }) => {
7253
7252
 
7254
7253
  // src/components/BankTransactionMobileList/PersonalForm.tsx
7255
7254
  var import_react78 = __toESM(require("react"));
7255
+
7256
+ // src/components/BankTransactionMobileList/constants.ts
7257
+ var PersonalCategories = /* @__PURE__ */ ((PersonalCategories2) => {
7258
+ PersonalCategories2["INCOME"] = "PERSONAL_INFLOWS";
7259
+ PersonalCategories2["EXPENSES"] = "PERSONAL_EXPENSES";
7260
+ return PersonalCategories2;
7261
+ })(PersonalCategories || {});
7262
+
7263
+ // src/components/BankTransactionMobileList/PersonalForm.tsx
7256
7264
  var isAlreadyAssigned = (bankTransaction) => {
7257
7265
  if (bankTransaction.categorization_status === "MATCHED" /* MATCHED */ || bankTransaction?.categorization_status === "SPLIT" /* SPLIT */) {
7258
7266
  return false;
7259
7267
  }
7260
7268
  return Boolean(
7261
- bankTransaction.category && PersonalCategories.includes(bankTransaction.category.display_name)
7269
+ bankTransaction.category && Object.values(PersonalCategories).includes(bankTransaction.category.display_name)
7262
7270
  );
7263
7271
  };
7264
7272
  var PersonalForm = ({ bankTransaction }) => {
@@ -7275,8 +7283,8 @@ var PersonalForm = ({ bankTransaction }) => {
7275
7283
  {
7276
7284
  type: "Category",
7277
7285
  category: {
7278
- type: "StableName",
7279
- stable_name: isCredit(bankTransaction) ? "PERSONAL_INCOME" : "PERSONAL_EXPENSES"
7286
+ type: "Exclusion",
7287
+ exclusion_type: isCredit(bankTransaction) ? "PERSONAL_INFLOWS" /* INCOME */ : "PERSONAL_EXPENSES" /* EXPENSES */
7280
7288
  }
7281
7289
  },
7282
7290
  true
@@ -7644,7 +7652,7 @@ var BankTransactionMobileListItem = ({
7644
7652
  const itemRef = (0, import_react84.useRef)(null);
7645
7653
  const [removeAnim, setRemoveAnim] = (0, import_react84.useState)(false);
7646
7654
  const [purpose, setPurpose] = (0, import_react84.useState)(
7647
- bankTransaction.category ? bankTransaction.categorization_status === "SPLIT" /* SPLIT */ ? "more" /* more */ : "business" /* business */ : hasMatch(bankTransaction) ? "more" /* more */ : "business" /* business */
7655
+ bankTransaction.category ? bankTransaction.category.type === "Exclusion" ? "personal" /* personal */ : bankTransaction.categorization_status === "SPLIT" /* SPLIT */ ? "more" /* more */ : "business" /* business */ : hasMatch(bankTransaction) ? "more" /* more */ : "business" /* business */
7648
7656
  );
7649
7657
  const [open, setOpen] = (0, import_react84.useState)(isFirstItem);
7650
7658
  const [showComponent, setShowComponent] = (0, import_react84.useState)(!initialLoad);