@layerfi/components 0.1.95-alpha.1 → 0.1.96-alpha

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.
@@ -5601,7 +5601,7 @@ var import_react16 = require("react");
5601
5601
  var import_react14 = require("react");
5602
5602
 
5603
5603
  // package.json
5604
- var version = "0.1.95-alpha.1";
5604
+ var version = "0.1.96-alpha";
5605
5605
 
5606
5606
  // src/models/APIError.ts
5607
5607
  var APIError = class _APIError extends Error {
@@ -14044,10 +14044,8 @@ var import_react56 = require("react");
14044
14044
  var import_react54 = require("react");
14045
14045
  var ReceiptsContext = (0, import_react54.createContext)({
14046
14046
  receiptUrls: [],
14047
- uploadReceipt: () => {
14048
- },
14049
- archiveDocument: () => {
14050
- }
14047
+ uploadReceipt: () => Promise.resolve(),
14048
+ archiveDocument: () => Promise.resolve()
14051
14049
  });
14052
14050
  var useReceiptsContext = () => (0, import_react54.useContext)(ReceiptsContext);
14053
14051
 
@@ -14069,7 +14067,7 @@ var useReceipts = ({
14069
14067
  const [receiptUrls, setReceiptUrls] = (0, import_react55.useState)([]);
14070
14068
  (0, import_react55.useEffect)(() => {
14071
14069
  if (isActive && receiptUrls.length === 0 && hasReceipts(bankTransaction)) {
14072
- fetchDocuments();
14070
+ void fetchDocuments();
14073
14071
  }
14074
14072
  }, [isActive]);
14075
14073
  const fetchDocuments = () => __async(void 0, null, function* () {
@@ -14162,7 +14160,7 @@ var useReceipts = ({
14162
14160
  documentId: document2.id
14163
14161
  }
14164
14162
  });
14165
- fetchDocuments();
14163
+ void fetchDocuments();
14166
14164
  }
14167
14165
  } catch (_err) {
14168
14166
  setReceiptUrls(
@@ -14378,7 +14376,7 @@ var BankTransactionReceipts = (0, import_react56.forwardRef)(
14378
14376
  }));
14379
14377
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsxs)("div", { className: `${classNamePrefix}__file-upload`, children: [
14380
14378
  receiptUrls && receiptUrls.length > 0 && label ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(Text, { size: "sm" /* sm */, className: "Layer__file-upload__label", children: label }) : null,
14381
- !hideUploadButtons && (!receiptUrls || receiptUrls.length === 0) ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(FileInput, { onUpload: (files) => uploadReceipt(files[0]), text: "Upload receipt" }) : null,
14379
+ !hideUploadButtons && (!receiptUrls || receiptUrls.length === 0) ? /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(FileInput, { onUpload: (files) => void uploadReceipt(files[0]), text: "Upload receipt" }) : null,
14382
14380
  receiptUrls.map((url, index) => {
14383
14381
  var _a;
14384
14382
  return /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(
@@ -14395,7 +14393,7 @@ var BankTransactionReceipts = (0, import_react56.forwardRef)(
14395
14393
  onOpen: url.url && url.type && url.type.startsWith("image/") ? openReceiptInNewTab(url.url, index) : void 0,
14396
14394
  enableDownload: true,
14397
14395
  error: url.error,
14398
- onDelete: () => url.id && archiveDocument(url)
14396
+ onDelete: () => url.id && void archiveDocument(url)
14399
14397
  },
14400
14398
  index
14401
14399
  );
@@ -14404,7 +14402,7 @@ var BankTransactionReceipts = (0, import_react56.forwardRef)(
14404
14402
  FileInput,
14405
14403
  {
14406
14404
  secondary: true,
14407
- onUpload: (files) => uploadReceipt(files[0]),
14405
+ onUpload: (files) => void uploadReceipt(files[0]),
14408
14406
  text: "Add next receipt"
14409
14407
  }
14410
14408
  ) : null
@@ -18215,7 +18213,7 @@ function BankTransactionsTableEmptyStates({
18215
18213
  return null;
18216
18214
  }
18217
18215
  if (!hasVisibleTransactions && !isFiltered) {
18218
- /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
18216
+ return /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(
18219
18217
  DataState,
18220
18218
  {
18221
18219
  status: "allDone" /* allDone */,
@@ -18495,7 +18493,7 @@ var useQuickbooks = () => {
18495
18493
  const syncStatusIntervalRef = (0, import_react81.useRef)(null);
18496
18494
  (0, import_react81.useEffect)(() => {
18497
18495
  if (isSyncingFromQuickbooks && syncStatusIntervalRef.current === null) {
18498
- const interval = window.setInterval(() => fetchIsSyncingFromQuickbooks(), 2e3);
18496
+ const interval = window.setInterval(() => void fetchIsSyncingFromQuickbooks(), 2e3);
18499
18497
  syncStatusIntervalRef.current = interval;
18500
18498
  return () => clearInterval(interval);
18501
18499
  } else if (!isSyncingFromQuickbooks && syncStatusIntervalRef.current) {
@@ -27572,7 +27570,7 @@ function TasksList({ pageSize = 8, mobile }) {
27572
27570
  goToNextPageIfAllComplete: next,
27573
27571
  defaultOpen: index === indexFirstIncomplete
27574
27572
  },
27575
- index
27573
+ task.id
27576
27574
  )),
27577
27575
  sortedTasks.length > pageSize && /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(
27578
27576
  Pagination,
@@ -30004,7 +30002,6 @@ var AccountingOverview = ({
30004
30002
  chartColorsList,
30005
30003
  stringOverrides,
30006
30004
  tagFilter = void 0,
30007
- showTransactionsToReview = true,
30008
30005
  slotProps
30009
30006
  }) => {
30010
30007
  var _a, _b, _c, _d, _e;
@@ -30309,7 +30306,6 @@ var ProjectProfitabilityView = ({
30309
30306
  tagFilter: tagFilter ? tagFilter : void 0,
30310
30307
  onTransactionsToReviewClick: () => setActiveTab("transactions"),
30311
30308
  enableOnboarding: false,
30312
- showTransactionsToReview: false,
30313
30309
  showTitle: false
30314
30310
  }
30315
30311
  ),
@@ -5570,7 +5570,7 @@ import { useState as useState8 } from "react";
5570
5570
  import { useReducer, useEffect as useEffect4 } from "react";
5571
5571
 
5572
5572
  // package.json
5573
- var version = "0.1.95-alpha.1";
5573
+ var version = "0.1.96-alpha";
5574
5574
 
5575
5575
  // src/models/APIError.ts
5576
5576
  var APIError = class _APIError extends Error {
@@ -14075,10 +14075,8 @@ import { forwardRef as forwardRef11, useImperativeHandle } from "react";
14075
14075
  import { createContext as createContext10, useContext as useContext17 } from "react";
14076
14076
  var ReceiptsContext = createContext10({
14077
14077
  receiptUrls: [],
14078
- uploadReceipt: () => {
14079
- },
14080
- archiveDocument: () => {
14081
- }
14078
+ uploadReceipt: () => Promise.resolve(),
14079
+ archiveDocument: () => Promise.resolve()
14082
14080
  });
14083
14081
  var useReceiptsContext = () => useContext17(ReceiptsContext);
14084
14082
 
@@ -14100,7 +14098,7 @@ var useReceipts = ({
14100
14098
  const [receiptUrls, setReceiptUrls] = useState20([]);
14101
14099
  useEffect10(() => {
14102
14100
  if (isActive && receiptUrls.length === 0 && hasReceipts(bankTransaction)) {
14103
- fetchDocuments();
14101
+ void fetchDocuments();
14104
14102
  }
14105
14103
  }, [isActive]);
14106
14104
  const fetchDocuments = () => __async(void 0, null, function* () {
@@ -14193,7 +14191,7 @@ var useReceipts = ({
14193
14191
  documentId: document2.id
14194
14192
  }
14195
14193
  });
14196
- fetchDocuments();
14194
+ void fetchDocuments();
14197
14195
  }
14198
14196
  } catch (_err) {
14199
14197
  setReceiptUrls(
@@ -14409,7 +14407,7 @@ var BankTransactionReceipts = forwardRef11(
14409
14407
  }));
14410
14408
  return /* @__PURE__ */ jsxs66("div", { className: `${classNamePrefix}__file-upload`, children: [
14411
14409
  receiptUrls && receiptUrls.length > 0 && label ? /* @__PURE__ */ jsx108(Text, { size: "sm" /* sm */, className: "Layer__file-upload__label", children: label }) : null,
14412
- !hideUploadButtons && (!receiptUrls || receiptUrls.length === 0) ? /* @__PURE__ */ jsx108(FileInput, { onUpload: (files) => uploadReceipt(files[0]), text: "Upload receipt" }) : null,
14410
+ !hideUploadButtons && (!receiptUrls || receiptUrls.length === 0) ? /* @__PURE__ */ jsx108(FileInput, { onUpload: (files) => void uploadReceipt(files[0]), text: "Upload receipt" }) : null,
14413
14411
  receiptUrls.map((url, index) => {
14414
14412
  var _a;
14415
14413
  return /* @__PURE__ */ jsx108(
@@ -14426,7 +14424,7 @@ var BankTransactionReceipts = forwardRef11(
14426
14424
  onOpen: url.url && url.type && url.type.startsWith("image/") ? openReceiptInNewTab(url.url, index) : void 0,
14427
14425
  enableDownload: true,
14428
14426
  error: url.error,
14429
- onDelete: () => url.id && archiveDocument(url)
14427
+ onDelete: () => url.id && void archiveDocument(url)
14430
14428
  },
14431
14429
  index
14432
14430
  );
@@ -14435,7 +14433,7 @@ var BankTransactionReceipts = forwardRef11(
14435
14433
  FileInput,
14436
14434
  {
14437
14435
  secondary: true,
14438
- onUpload: (files) => uploadReceipt(files[0]),
14436
+ onUpload: (files) => void uploadReceipt(files[0]),
14439
14437
  text: "Add next receipt"
14440
14438
  }
14441
14439
  ) : null
@@ -18253,7 +18251,7 @@ function BankTransactionsTableEmptyStates({
18253
18251
  return null;
18254
18252
  }
18255
18253
  if (!hasVisibleTransactions && !isFiltered) {
18256
- /* @__PURE__ */ jsx151(
18254
+ return /* @__PURE__ */ jsx151(
18257
18255
  DataState,
18258
18256
  {
18259
18257
  status: "allDone" /* allDone */,
@@ -18533,7 +18531,7 @@ var useQuickbooks = () => {
18533
18531
  const syncStatusIntervalRef = useRef20(null);
18534
18532
  useEffect24(() => {
18535
18533
  if (isSyncingFromQuickbooks && syncStatusIntervalRef.current === null) {
18536
- const interval = window.setInterval(() => fetchIsSyncingFromQuickbooks(), 2e3);
18534
+ const interval = window.setInterval(() => void fetchIsSyncingFromQuickbooks(), 2e3);
18537
18535
  syncStatusIntervalRef.current = interval;
18538
18536
  return () => clearInterval(interval);
18539
18537
  } else if (!isSyncingFromQuickbooks && syncStatusIntervalRef.current) {
@@ -27645,7 +27643,7 @@ function TasksList({ pageSize = 8, mobile }) {
27645
27643
  goToNextPageIfAllComplete: next,
27646
27644
  defaultOpen: index === indexFirstIncomplete
27647
27645
  },
27648
- index
27646
+ task.id
27649
27647
  )),
27650
27648
  sortedTasks.length > pageSize && /* @__PURE__ */ jsx235(
27651
27649
  Pagination,
@@ -30084,7 +30082,6 @@ var AccountingOverview = ({
30084
30082
  chartColorsList,
30085
30083
  stringOverrides,
30086
30084
  tagFilter = void 0,
30087
- showTransactionsToReview = true,
30088
30085
  slotProps
30089
30086
  }) => {
30090
30087
  var _a, _b, _c, _d, _e;
@@ -30389,7 +30386,6 @@ var ProjectProfitabilityView = ({
30389
30386
  tagFilter: tagFilter ? tagFilter : void 0,
30390
30387
  onTransactionsToReviewClick: () => setActiveTab("transactions"),
30391
30388
  enableOnboarding: false,
30392
- showTransactionsToReview: false,
30393
30389
  showTitle: false
30394
30390
  }
30395
30391
  ),
package/dist/index.d.ts CHANGED
@@ -5152,17 +5152,17 @@ declare module '@layerfi/components/contexts/ProfitAndLossComparisonContext/inde
5152
5152
 
5153
5153
  }
5154
5154
  declare module '@layerfi/components/contexts/ReceiptsContext/ReceiptsContext' {
5155
- import { useReceipts } from '@layerfi/components/hooks/useReceipts/index';
5155
+ import { useReceipts } from '@layerfi/components/hooks/useReceipts/useReceipts';
5156
5156
  export type ReceiptsContextType = ReturnType<typeof useReceipts>;
5157
5157
  export const ReceiptsContext: import("react").Context<{
5158
5158
  receiptUrls: import("@layerfi/components/components/BankTransactionReceipts/BankTransactionReceipts").DocumentWithStatus[];
5159
- uploadReceipt: (file: File) => void;
5160
- archiveDocument: (document: import("@layerfi/components/components/BankTransactionReceipts/BankTransactionReceipts").DocumentWithStatus) => void;
5159
+ uploadReceipt: (file: File) => import("@layerfi/components/types/utility/promises").Awaitable<void>;
5160
+ archiveDocument: (document: import("@layerfi/components/components/BankTransactionReceipts/BankTransactionReceipts").DocumentWithStatus) => import("../../types/utility/promises").Awaitable<void>;
5161
5161
  }>;
5162
5162
  export const useReceiptsContext: () => {
5163
5163
  receiptUrls: import("@layerfi/components/components/BankTransactionReceipts/BankTransactionReceipts").DocumentWithStatus[];
5164
- uploadReceipt: (file: File) => void;
5165
- archiveDocument: (document: import("@layerfi/components/components/BankTransactionReceipts/BankTransactionReceipts").DocumentWithStatus) => void;
5164
+ uploadReceipt: (file: File) => import("@layerfi/components/types/utility/promises").Awaitable<void>;
5165
+ archiveDocument: (document: import("@layerfi/components/components/BankTransactionReceipts/BankTransactionReceipts").DocumentWithStatus) => import("../../types/utility/promises").Awaitable<void>;
5166
5166
  };
5167
5167
 
5168
5168
  }
@@ -6113,22 +6113,19 @@ declare module '@layerfi/components/hooks/useQuickbooks/useQuickbooks' {
6113
6113
  export const useQuickbooks: UseQuickbooks;
6114
6114
  export {};
6115
6115
 
6116
- }
6117
- declare module '@layerfi/components/hooks/useReceipts/index' {
6118
- export { useReceipts } from '@layerfi/components/hooks/useReceipts/useReceipts';
6119
-
6120
6116
  }
6121
6117
  declare module '@layerfi/components/hooks/useReceipts/useReceipts' {
6122
6118
  import { DocumentWithStatus } from '@layerfi/components/components/BankTransactionReceipts/BankTransactionReceipts';
6123
6119
  import { BankTransaction } from '@layerfi/components/types';
6120
+ import { Awaitable } from '@layerfi/components/types/utility/promises';
6124
6121
  export interface UseReceiptsProps {
6125
6122
  bankTransaction: BankTransaction;
6126
6123
  isActive?: boolean;
6127
6124
  }
6128
6125
  type UseReceipts = (props: UseReceiptsProps) => {
6129
6126
  receiptUrls: DocumentWithStatus[];
6130
- uploadReceipt: (file: File) => void;
6131
- archiveDocument: (document: DocumentWithStatus) => void;
6127
+ uploadReceipt: (file: File) => Awaitable<void>;
6128
+ archiveDocument: (document: DocumentWithStatus) => Awaitable<void>;
6132
6129
  };
6133
6130
  export const useReceipts: UseReceipts;
6134
6131
  export {};
@@ -8500,7 +8497,6 @@ declare module '@layerfi/components/views/AccountingOverview/AccountingOverview'
8500
8497
  chartColorsList?: string[];
8501
8498
  stringOverrides?: AccountingOverviewStringOverrides;
8502
8499
  tagFilter?: TagOption;
8503
- showTransactionsToReview?: boolean;
8504
8500
  slotProps?: {
8505
8501
  profitAndLoss?: {
8506
8502
  summaries?: {
@@ -8509,7 +8505,7 @@ declare module '@layerfi/components/views/AccountingOverview/AccountingOverview'
8509
8505
  };
8510
8506
  };
8511
8507
  }
8512
- export const AccountingOverview: ({ title, showTitle, enableOnboarding, onboardingStepOverride, onTransactionsToReviewClick, middleBanner, chartColorsList, stringOverrides, tagFilter, showTransactionsToReview, slotProps, }: AccountingOverviewProps) => import("react/jsx-runtime").JSX.Element;
8508
+ export const AccountingOverview: ({ title, showTitle, enableOnboarding, onboardingStepOverride, onTransactionsToReviewClick, middleBanner, chartColorsList, stringOverrides, tagFilter, slotProps, }: AccountingOverviewProps) => import("react/jsx-runtime").JSX.Element;
8513
8509
  export {};
8514
8510
 
8515
8511
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerfi/components",
3
- "version": "0.1.95-alpha.1",
3
+ "version": "0.1.96-alpha",
4
4
  "description": "Layer React Components",
5
5
  "main": "dist/cjs/index.cjs",
6
6
  "module": "dist/esm/index.mjs",