@layerfi/components 0.1.64 → 0.1.65

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/esm/index.js CHANGED
@@ -4881,7 +4881,8 @@ import classNames23 from "classnames";
4881
4881
  var ActionableList = ({
4882
4882
  options,
4883
4883
  onClick,
4884
- selectedId
4884
+ selectedId,
4885
+ showDescriptions = false
4885
4886
  }) => {
4886
4887
  return /* @__PURE__ */ React68.createElement("ul", { className: "Layer__actionable-list" }, options.map((x, idx) => /* @__PURE__ */ React68.createElement(
4887
4888
  "li",
@@ -4900,7 +4901,7 @@ var ActionableList = ({
4900
4901
  { className: "Layer__actionable-list__content" },
4901
4902
  /* @__PURE__ */ React68.createElement(Text, { size: "sm" /* sm */ }, x.label),
4902
4903
  /*TODO: Replace 'See all categories' with something more generic*/
4903
- x.description && x.label !== "See all categories" && /* @__PURE__ */ React68.createElement(
4904
+ showDescriptions && x.description && x.label !== "See all categories" && /* @__PURE__ */ React68.createElement(
4904
4905
  Text,
4905
4906
  {
4906
4907
  className: "Layer__actionable-list__content-description",
@@ -5156,7 +5157,7 @@ var Option2 = (props) => {
5156
5157
  className: `Layer__select__option-menu-content ${props.className}`
5157
5158
  },
5158
5159
  /* @__PURE__ */ React71.createElement("div", { className: "Layer__select__option-menu--name" }, props.isSelected ? /* @__PURE__ */ React71.createElement("span", { className: "Layer__select__option-menu-content-check" }, /* @__PURE__ */ React71.createElement(Check_default, { size: 16 })) : /* @__PURE__ */ React71.createElement("span", { className: "Layer__select__option-menu-content-check" }, /* @__PURE__ */ React71.createElement("div", { style: { width: 16, height: 16 } })), /* @__PURE__ */ React71.createElement("div", null, props.data.payload.display_name)),
5159
- props.data.payload.description && /* @__PURE__ */ React71.createElement("div", { className: "Layer__select__option-menu--tooltip" }, /* @__PURE__ */ React71.createElement(Tooltip, null, /* @__PURE__ */ React71.createElement(TooltipTrigger, null, /* @__PURE__ */ React71.createElement(InfoIcon_default, null)), /* @__PURE__ */ React71.createElement(TooltipContent, { className: "Layer__actionable-list__tooltip-content" }, /* @__PURE__ */ React71.createElement(
5160
+ props.showTooltips && props.data.payload.description && /* @__PURE__ */ React71.createElement("div", { className: "Layer__select__option-menu--tooltip" }, /* @__PURE__ */ React71.createElement(Tooltip, null, /* @__PURE__ */ React71.createElement(TooltipTrigger, null, /* @__PURE__ */ React71.createElement(InfoIcon_default, null)), /* @__PURE__ */ React71.createElement(TooltipContent, { className: "Layer__actionable-list__tooltip-content" }, /* @__PURE__ */ React71.createElement(
5160
5161
  Text,
5161
5162
  {
5162
5163
  className: "Layer__actionable-list__content-description",
@@ -5205,6 +5206,7 @@ var CategorySelect = ({
5205
5206
  onChange,
5206
5207
  disabled,
5207
5208
  className,
5209
+ showTooltips,
5208
5210
  excludeMatches = false,
5209
5211
  asDrawer = false
5210
5212
  }) => {
@@ -5268,7 +5270,11 @@ var CategorySelect = ({
5268
5270
  styles: {
5269
5271
  menuPortal: (base) => ({ ...base, zIndex: 9999 })
5270
5272
  },
5271
- components: { DropdownIndicator, GroupHeading, Option: Option2 },
5273
+ components: {
5274
+ DropdownIndicator,
5275
+ GroupHeading,
5276
+ Option: (optionProps) => /* @__PURE__ */ React71.createElement(Option2, { ...optionProps, showTooltips })
5277
+ },
5272
5278
  isDisabled: disabled,
5273
5279
  isOptionDisabled: (option) => option.disabled ?? false,
5274
5280
  isOptionSelected: (option) => selected?.payload.display_name == option.payload.display_name
@@ -6117,7 +6123,8 @@ var ExpandedBankTransactionRow = forwardRef5(
6117
6123
  containerWidth,
6118
6124
  showDescriptions,
6119
6125
  mode,
6120
- showReceiptUploads
6126
+ showReceiptUploads,
6127
+ showTooltips
6121
6128
  }, ref) => {
6122
6129
  const {
6123
6130
  categorize: categorizeBankTransaction2,
@@ -6471,7 +6478,8 @@ var ExpandedBankTransactionRow = forwardRef5(
6471
6478
  onChange: (value) => changeCategory(index, value),
6472
6479
  className: "Layer__category-menu--full",
6473
6480
  disabled: bankTransaction.processing || !categorizationEnabled(mode),
6474
- excludeMatches: true
6481
+ excludeMatches: true,
6482
+ showTooltips
6475
6483
  }
6476
6484
  ),
6477
6485
  index > 0 && /* @__PURE__ */ React87.createElement(
@@ -6640,6 +6648,7 @@ var BankTransactionRow = ({
6640
6648
  initialLoad,
6641
6649
  showDescriptions,
6642
6650
  showReceiptUploads,
6651
+ showTooltips,
6643
6652
  stringOverrides
6644
6653
  }) => {
6645
6654
  const expandedRowRef = useRef9(null);
@@ -6795,7 +6804,8 @@ var BankTransactionRow = ({
6795
6804
  setSelectedCategory(category);
6796
6805
  setShowRetry(false);
6797
6806
  },
6798
- disabled: bankTransaction.processing
6807
+ disabled: bankTransaction.processing,
6808
+ showTooltips
6799
6809
  }
6800
6810
  ) : null,
6801
6811
  categorized && !open ? /* @__PURE__ */ React89.createElement(Text, { as: "span", className: `${className}__category-text` }, bankTransaction.categorization_status === "SPLIT" /* SPLIT */ && /* @__PURE__ */ React89.createElement(React89.Fragment, null, /* @__PURE__ */ React89.createElement(
@@ -6887,7 +6897,8 @@ var BankTransactionRow = ({
6887
6897
  close: () => setOpen(false),
6888
6898
  containerWidth,
6889
6899
  showDescriptions,
6890
- showReceiptUploads
6900
+ showReceiptUploads,
6901
+ showTooltips
6891
6902
  }
6892
6903
  ))));
6893
6904
  };
@@ -6940,6 +6951,7 @@ var BankTransactionListItem = ({
6940
6951
  mode,
6941
6952
  showDescriptions,
6942
6953
  showReceiptUploads,
6954
+ showTooltips,
6943
6955
  containerWidth,
6944
6956
  removeTransaction,
6945
6957
  stringOverrides
@@ -7036,7 +7048,8 @@ var BankTransactionListItem = ({
7036
7048
  submitBtnText: categorized ? stringOverrides?.updateButtonText || "Update" : stringOverrides?.approveButtonText || "Approve",
7037
7049
  containerWidth,
7038
7050
  showDescriptions,
7039
- showReceiptUploads
7051
+ showReceiptUploads,
7052
+ showTooltips
7040
7053
  }
7041
7054
  )), /* @__PURE__ */ React91.createElement("span", { className: `${className}__base-row` }, !categorized ? /* @__PURE__ */ React91.createElement(
7042
7055
  CategorySelect,
@@ -7048,7 +7061,8 @@ var BankTransactionListItem = ({
7048
7061
  setShowRetry(false);
7049
7062
  setSelectedCategory(category);
7050
7063
  },
7051
- disabled: bankTransaction.processing
7064
+ disabled: bankTransaction.processing,
7065
+ showTooltips
7052
7066
  }
7053
7067
  ) : null, categorized ? /* @__PURE__ */ React91.createElement(Assignment, { bankTransaction }) : null, !categorized && !showRetry ? /* @__PURE__ */ React91.createElement(
7054
7068
  SubmitButton,
@@ -7088,6 +7102,7 @@ var BankTransactionList = ({
7088
7102
  containerWidth,
7089
7103
  showDescriptions = false,
7090
7104
  showReceiptUploads = false,
7105
+ showTooltips,
7091
7106
  stringOverrides
7092
7107
  }) => {
7093
7108
  return /* @__PURE__ */ React92.createElement("ul", { className: "Layer__bank-transactions__list" }, bankTransactions?.map(
@@ -7104,6 +7119,7 @@ var BankTransactionList = ({
7104
7119
  containerWidth,
7105
7120
  showDescriptions,
7106
7121
  showReceiptUploads,
7122
+ showTooltips,
7107
7123
  stringOverrides
7108
7124
  }
7109
7125
  )
@@ -7121,7 +7137,10 @@ import React98 from "react";
7121
7137
 
7122
7138
  // src/components/BankTransactionMobileList/BusinessForm.tsx
7123
7139
  import React93, { useContext as useContext10, useEffect as useEffect14, useMemo as useMemo4, useState as useState17 } from "react";
7124
- var BusinessForm = ({ bankTransaction }) => {
7140
+ var BusinessForm = ({
7141
+ bankTransaction,
7142
+ showTooltips
7143
+ }) => {
7125
7144
  const { setContent, close } = useContext10(DrawerContext);
7126
7145
  const { categorize: categorizeBankTransaction2, isLoading } = useBankTransactionsContext();
7127
7146
  const [selectedCategory, setSelectedCategory] = useState17(
@@ -7204,7 +7223,8 @@ var BusinessForm = ({ bankTransaction }) => {
7204
7223
  {
7205
7224
  options,
7206
7225
  onClick: onCategorySelect,
7207
- selectedId: selectedCategory?.id
7226
+ selectedId: selectedCategory?.id,
7227
+ showDescriptions: showTooltips
7208
7228
  }
7209
7229
  ), options.length === 0 ? /* @__PURE__ */ React93.createElement(
7210
7230
  Button,
@@ -7341,7 +7361,8 @@ var MatchForm2 = ({
7341
7361
  import React96, { useEffect as useEffect17, useState as useState20 } from "react";
7342
7362
  import classNames38 from "classnames";
7343
7363
  var SplitForm = ({
7344
- bankTransaction
7364
+ bankTransaction,
7365
+ showTooltips
7345
7366
  }) => {
7346
7367
  const {
7347
7368
  categorize: categorizeBankTransaction2,
@@ -7492,7 +7513,8 @@ var SplitForm = ({
7492
7513
  className: "Layer__category-menu--full",
7493
7514
  disabled: bankTransaction.processing,
7494
7515
  excludeMatches: true,
7495
- asDrawer: true
7516
+ asDrawer: true,
7517
+ showTooltips
7496
7518
  }
7497
7519
  )),
7498
7520
  /* @__PURE__ */ React96.createElement(
@@ -7544,28 +7566,48 @@ var SplitForm = ({
7544
7566
 
7545
7567
  // src/components/BankTransactionMobileList/SplitAndMatchForm.tsx
7546
7568
  var SplitAndMatchForm = ({
7547
- bankTransaction
7569
+ bankTransaction,
7570
+ showTooltips
7548
7571
  }) => {
7549
7572
  const anyMatch = hasMatch(bankTransaction);
7550
7573
  const [formType, setFormType] = useState21(
7551
7574
  bankTransaction.category ? "categorize" /* categorize */ : anyMatch ? "match" /* match */ : "categorize" /* categorize */
7552
7575
  );
7553
- return /* @__PURE__ */ React97.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__split-and-match-form" }, formType === "categorize" /* categorize */ && /* @__PURE__ */ React97.createElement(SplitForm, { bankTransaction }), formType === "match" /* match */ && /* @__PURE__ */ React97.createElement(MatchForm2, { bankTransaction }), anyMatch && formType === "match" /* match */ ? /* @__PURE__ */ React97.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__switch-form-btns" }, /* @__PURE__ */ React97.createElement(TextButton, { onClick: () => setFormType("categorize" /* categorize */) }, "or split transaction")) : null, anyMatch && formType === "categorize" /* categorize */ ? /* @__PURE__ */ React97.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__switch-form-btns" }, /* @__PURE__ */ React97.createElement(TextButton, { onClick: () => setFormType("match" /* match */) }, "or find match")) : null);
7576
+ return /* @__PURE__ */ React97.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__split-and-match-form" }, formType === "categorize" /* categorize */ && /* @__PURE__ */ React97.createElement(
7577
+ SplitForm,
7578
+ {
7579
+ bankTransaction,
7580
+ showTooltips
7581
+ }
7582
+ ), formType === "match" /* match */ && /* @__PURE__ */ React97.createElement(MatchForm2, { bankTransaction }), anyMatch && formType === "match" /* match */ ? /* @__PURE__ */ React97.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__switch-form-btns" }, /* @__PURE__ */ React97.createElement(TextButton, { onClick: () => setFormType("categorize" /* categorize */) }, "or split transaction")) : null, anyMatch && formType === "categorize" /* categorize */ ? /* @__PURE__ */ React97.createElement("div", { className: "Layer__bank-transaction-mobile-list-item__switch-form-btns" }, /* @__PURE__ */ React97.createElement(TextButton, { onClick: () => setFormType("match" /* match */) }, "or find match")) : null);
7554
7583
  };
7555
7584
 
7556
7585
  // src/components/BankTransactionMobileList/BankTransactionMobileForms.tsx
7557
7586
  var BankTransactionMobileForms = ({
7558
7587
  purpose,
7559
- bankTransaction
7588
+ bankTransaction,
7589
+ showTooltips
7560
7590
  }) => {
7561
7591
  const getContent = () => {
7562
7592
  switch (purpose) {
7563
7593
  case "business":
7564
- return /* @__PURE__ */ React98.createElement(BusinessForm, { bankTransaction });
7594
+ return /* @__PURE__ */ React98.createElement(
7595
+ BusinessForm,
7596
+ {
7597
+ bankTransaction,
7598
+ showTooltips
7599
+ }
7600
+ );
7565
7601
  case "personal":
7566
7602
  return /* @__PURE__ */ React98.createElement(PersonalForm, { bankTransaction });
7567
7603
  case "more":
7568
- return /* @__PURE__ */ React98.createElement(SplitAndMatchForm, { bankTransaction });
7604
+ return /* @__PURE__ */ React98.createElement(
7605
+ SplitAndMatchForm,
7606
+ {
7607
+ bankTransaction,
7608
+ showTooltips
7609
+ }
7610
+ );
7569
7611
  default:
7570
7612
  return null;
7571
7613
  }
@@ -7610,6 +7652,7 @@ var BankTransactionMobileListItem = ({
7610
7652
  editable,
7611
7653
  mode,
7612
7654
  initialLoad,
7655
+ showTooltips,
7613
7656
  isFirstItem = false
7614
7657
  }) => {
7615
7658
  const {
@@ -7761,7 +7804,8 @@ var BankTransactionMobileListItem = ({
7761
7804
  BankTransactionMobileForms,
7762
7805
  {
7763
7806
  purpose,
7764
- bankTransaction
7807
+ bankTransaction,
7808
+ showTooltips
7765
7809
  }
7766
7810
  )
7767
7811
  )
@@ -7774,6 +7818,7 @@ var BankTransactionMobileList = ({
7774
7818
  removeTransaction,
7775
7819
  editable,
7776
7820
  initialLoad,
7821
+ showTooltips,
7777
7822
  mode
7778
7823
  }) => {
7779
7824
  const transactionToOpenContextData = useTransactionToOpen();
@@ -7785,6 +7830,7 @@ var BankTransactionMobileList = ({
7785
7830
  mode,
7786
7831
  key: bankTransaction.id,
7787
7832
  bankTransaction,
7833
+ showTooltips,
7788
7834
  editable,
7789
7835
  removeTransaction,
7790
7836
  initialLoad,
@@ -7854,7 +7900,8 @@ var SkeletonTableLoader = ({
7854
7900
 
7855
7901
  // src/components/BankTransactionsLoader/BankTransactionsLoader.tsx
7856
7902
  var BankTransactionsLoader = ({
7857
- isLoading = true
7903
+ isLoading = true,
7904
+ showTooltips
7858
7905
  }) => {
7859
7906
  const inactiveBankTransactionsActions = /* @__PURE__ */ React103.createElement("div", { className: "Layer__bank-transaction-row__actions-container Layer__bank-transaction-row__actions-disabled" }, /* @__PURE__ */ React103.createElement(
7860
7907
  CategorySelect,
@@ -7864,7 +7911,8 @@ var BankTransactionsLoader = ({
7864
7911
  value: void 0,
7865
7912
  onChange: () => {
7866
7913
  },
7867
- disabled: true
7914
+ disabled: true,
7915
+ showTooltips
7868
7916
  }
7869
7917
  ), /* @__PURE__ */ React103.createElement(
7870
7918
  SubmitButton,
@@ -7947,6 +7995,7 @@ var BankTransactionsTable = ({
7947
7995
  removeTransaction,
7948
7996
  showDescriptions = false,
7949
7997
  showReceiptUploads = false,
7998
+ showTooltips,
7950
7999
  stringOverrides,
7951
8000
  isSyncing = false,
7952
8001
  page,
@@ -7960,7 +8009,7 @@ var BankTransactionsTable = ({
7960
8009
  className: "Layer__table Layer__bank-transactions__table with-cell-separators"
7961
8010
  },
7962
8011
  /* @__PURE__ */ React105.createElement("thead", null, /* @__PURE__ */ React105.createElement("tr", null, /* @__PURE__ */ React105.createElement("th", { className: "Layer__table-header Layer__bank-transactions__date-col" }, stringOverrides?.transactionsTable?.dateColumnHeaderText || "Date"), /* @__PURE__ */ React105.createElement("th", { className: "Layer__table-header Layer__bank-transactions__tx-col" }, stringOverrides?.transactionsTable?.transactionColumnHeaderText || "Transaction"), /* @__PURE__ */ React105.createElement("th", { className: "Layer__table-header Layer__bank-transactions__account-col" }, stringOverrides?.transactionsTable?.accountColumnHeaderText || "Account"), /* @__PURE__ */ React105.createElement("th", { className: "Layer__table-header Layer__table-cell--amount Layer__table-cell__amount-col" }, stringOverrides?.transactionsTable?.amountColumnHeaderText || "Amount"), categorizeView && editable ? /* @__PURE__ */ React105.createElement("th", { className: "Layer__table-header Layer__table-header--primary Layer__table-cell__category-col" }, stringOverrides?.transactionsTable?.categorizeColumnHeaderText || "Categorize") : /* @__PURE__ */ React105.createElement("th", { className: "Layer__table-header Layer__table-cell__category-col" }, stringOverrides?.transactionsTable?.categoryColumnHeaderText || "Category"))),
7963
- isLoading && page && page === 1 ? /* @__PURE__ */ React105.createElement(BankTransactionsLoader, { isLoading: true }) : null,
8012
+ isLoading && page && page === 1 ? /* @__PURE__ */ React105.createElement(BankTransactionsLoader, { isLoading: true, showTooltips }) : null,
7964
8013
  /* @__PURE__ */ React105.createElement("tbody", null, !isLoading && bankTransactions?.map(
7965
8014
  (bankTransaction, index) => /* @__PURE__ */ React105.createElement(
7966
8015
  BankTransactionRow,
@@ -7976,6 +8025,7 @@ var BankTransactionsTable = ({
7976
8025
  containerWidth,
7977
8026
  showDescriptions,
7978
8027
  showReceiptUploads,
8028
+ showTooltips,
7979
8029
  stringOverrides: stringOverrides?.bankTransactionCTAs
7980
8030
  }
7981
8031
  )
@@ -8819,6 +8869,7 @@ var BankTransactionsContent = ({
8819
8869
  mode = "self-serve",
8820
8870
  showDescriptions = false,
8821
8871
  showReceiptUploads = false,
8872
+ showTooltips = false,
8822
8873
  monthlyView = false,
8823
8874
  categorizeView: categorizeViewProp,
8824
8875
  mobileComponent,
@@ -8976,6 +9027,7 @@ var BankTransactionsContent = ({
8976
9027
  removeTransaction,
8977
9028
  showDescriptions,
8978
9029
  showReceiptUploads,
9030
+ showTooltips,
8979
9031
  page: currentPage,
8980
9032
  stringOverrides,
8981
9033
  lastPage: isLastPage,
@@ -8990,7 +9042,8 @@ var BankTransactionsContent = ({
8990
9042
  editable,
8991
9043
  removeTransaction,
8992
9044
  containerWidth,
8993
- stringOverrides: stringOverrides?.bankTransactionCTAs
9045
+ stringOverrides: stringOverrides?.bankTransactionCTAs,
9046
+ showTooltips
8994
9047
  }
8995
9048
  ) : null,
8996
9049
  !isLoading && listView && mobileComponent === "mobileList" ? /* @__PURE__ */ React115.createElement(
@@ -9000,7 +9053,8 @@ var BankTransactionsContent = ({
9000
9053
  editable,
9001
9054
  mode,
9002
9055
  removeTransaction,
9003
- initialLoad
9056
+ initialLoad,
9057
+ showTooltips
9004
9058
  }
9005
9059
  ) : null,
9006
9060
  listView && isLoading ? /* @__PURE__ */ React115.createElement("div", { className: "Layer__bank-transactions__list-loader" }, /* @__PURE__ */ React115.createElement(Loader2, null)) : null,
@@ -16781,6 +16835,7 @@ var BankTransactionsWithLinkedAccounts = ({
16781
16835
  mode = "self-serve",
16782
16836
  showDescriptions,
16783
16837
  showReceiptUploads,
16838
+ showTooltips = false,
16784
16839
  mobileComponent,
16785
16840
  stringOverrides
16786
16841
  }) => {
@@ -16806,6 +16861,7 @@ var BankTransactionsWithLinkedAccounts = ({
16806
16861
  asWidget: true,
16807
16862
  showDescriptions,
16808
16863
  showReceiptUploads,
16864
+ showTooltips,
16809
16865
  mobileComponent,
16810
16866
  mode,
16811
16867
  stringOverrides: stringOverrides?.bankTransactions