@layerfi/components 0.1.62 → 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) => {
@@ -5195,15 +5194,15 @@ var Option2 = (props) => {
5195
5194
  ...props,
5196
5195
  className: `Layer__select__option-menu-content ${props.className}`
5197
5196
  },
5198
- /* @__PURE__ */ import_react58.default.createElement("div", { className: "Layer__select__option-menu--name" }, /* @__PURE__ */ import_react58.default.createElement("div", null, props.data.payload.display_name), props.data.payload.description && /* @__PURE__ */ import_react58.default.createElement(Tooltip, null, /* @__PURE__ */ import_react58.default.createElement(TooltipTrigger, null, /* @__PURE__ */ import_react58.default.createElement(InfoIcon_default, null)), /* @__PURE__ */ import_react58.default.createElement(TooltipContent, { className: "Layer__actionable-list__tooltip-content" }, /* @__PURE__ */ import_react58.default.createElement(
5197
+ /* @__PURE__ */ import_react58.default.createElement("div", { className: "Layer__select__option-menu--name" }, props.isSelected ? /* @__PURE__ */ import_react58.default.createElement("span", { className: "Layer__select__option-menu-content-check" }, /* @__PURE__ */ import_react58.default.createElement(Check_default, { size: 16 })) : /* @__PURE__ */ import_react58.default.createElement("span", { className: "Layer__select__option-menu-content-check" }, /* @__PURE__ */ import_react58.default.createElement("div", { style: { width: 16, height: 16 } })), /* @__PURE__ */ import_react58.default.createElement("div", null, props.data.payload.display_name)),
5198
+ props.data.payload.description && /* @__PURE__ */ import_react58.default.createElement("div", { className: "Layer__select__option-menu--tooltip" }, /* @__PURE__ */ import_react58.default.createElement(Tooltip, null, /* @__PURE__ */ import_react58.default.createElement(TooltipTrigger, null, /* @__PURE__ */ import_react58.default.createElement(InfoIcon_default, null)), /* @__PURE__ */ import_react58.default.createElement(TooltipContent, { className: "Layer__actionable-list__tooltip-content" }, /* @__PURE__ */ import_react58.default.createElement(
5199
5199
  Text,
5200
5200
  {
5201
5201
  className: "Layer__actionable-list__content-description",
5202
5202
  size: "sm" /* sm */
5203
5203
  },
5204
5204
  props.data.payload.description
5205
- )))),
5206
- props.isSelected ? /* @__PURE__ */ import_react58.default.createElement("span", { className: "Layer__select__option-menu-content-check" }, /* @__PURE__ */ import_react58.default.createElement(Check_default, { size: 16 })) : null
5205
+ ))))
5207
5206
  );
5208
5207
  };
5209
5208
  var allCategoriesDivider = [
@@ -5310,7 +5309,8 @@ var CategorySelect = ({
5310
5309
  },
5311
5310
  components: { DropdownIndicator, GroupHeading, Option: Option2 },
5312
5311
  isDisabled: disabled,
5313
- isOptionDisabled: (option) => option.disabled ?? false
5312
+ isOptionDisabled: (option) => option.disabled ?? false,
5313
+ isOptionSelected: (option) => selected?.payload.display_name == option.payload.display_name
5314
5314
  }
5315
5315
  );
5316
5316
  };
@@ -7252,12 +7252,21 @@ var BusinessForm = ({ bankTransaction }) => {
7252
7252
 
7253
7253
  // src/components/BankTransactionMobileList/PersonalForm.tsx
7254
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
7255
7264
  var isAlreadyAssigned = (bankTransaction) => {
7256
7265
  if (bankTransaction.categorization_status === "MATCHED" /* MATCHED */ || bankTransaction?.categorization_status === "SPLIT" /* SPLIT */) {
7257
7266
  return false;
7258
7267
  }
7259
7268
  return Boolean(
7260
- bankTransaction.category && PersonalCategories.includes(bankTransaction.category.display_name)
7269
+ bankTransaction.category && Object.values(PersonalCategories).includes(bankTransaction.category.display_name)
7261
7270
  );
7262
7271
  };
7263
7272
  var PersonalForm = ({ bankTransaction }) => {
@@ -7274,8 +7283,8 @@ var PersonalForm = ({ bankTransaction }) => {
7274
7283
  {
7275
7284
  type: "Category",
7276
7285
  category: {
7277
- type: "StableName",
7278
- stable_name: isCredit(bankTransaction) ? "PERSONAL_INCOME" : "PERSONAL_EXPENSES"
7286
+ type: "Exclusion",
7287
+ exclusion_type: isCredit(bankTransaction) ? "PERSONAL_INFLOWS" /* INCOME */ : "PERSONAL_EXPENSES" /* EXPENSES */
7279
7288
  }
7280
7289
  },
7281
7290
  true
@@ -7643,7 +7652,7 @@ var BankTransactionMobileListItem = ({
7643
7652
  const itemRef = (0, import_react84.useRef)(null);
7644
7653
  const [removeAnim, setRemoveAnim] = (0, import_react84.useState)(false);
7645
7654
  const [purpose, setPurpose] = (0, import_react84.useState)(
7646
- 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 */
7647
7656
  );
7648
7657
  const [open, setOpen] = (0, import_react84.useState)(isFirstItem);
7649
7658
  const [showComponent, setShowComponent] = (0, import_react84.useState)(!initialLoad);