@layerfi/components 0.1.18 → 0.1.20

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.
@@ -0,0 +1,9 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <module type="JAVA_MODULE" version="4">
3
+ <component name="NewModuleRootManager" inherit-compiler-output="true">
4
+ <exclude-output />
5
+ <content url="file://$MODULE_DIR$" />
6
+ <orderEntry type="inheritedJdk" />
7
+ <orderEntry type="sourceFolder" forTests="false" />
8
+ </component>
9
+ </module>
package/.idea/misc.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectRootManager" version="2" languageLevel="JDK_19" default="true" project-jdk-name="corretto-19" project-jdk-type="JavaSDK">
4
+ <output url="file://$PROJECT_DIR$/out" />
5
+ </component>
6
+ </project>
@@ -0,0 +1,8 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="ProjectModuleManager">
4
+ <modules>
5
+ <module fileurl="file://$PROJECT_DIR$/.idea/layer-react.iml" filepath="$PROJECT_DIR$/.idea/layer-react.iml" />
6
+ </modules>
7
+ </component>
8
+ </project>
package/.idea/vcs.xml ADDED
@@ -0,0 +1,6 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <project version="4">
3
+ <component name="VcsDirectoryMappings">
4
+ <mapping directory="" vcs="Git" />
5
+ </component>
6
+ </project>
package/dist/esm/index.js CHANGED
@@ -362,6 +362,7 @@ var LayerContext = createContext({
362
362
  apiUrl: "",
363
363
  theme: void 0,
364
364
  colors: {},
365
+ usePlaidSandbox: true,
365
366
  setTheme: () => void 0,
366
367
  getColor: (_shade) => void 0,
367
368
  setLightColor: () => void 0,
@@ -4472,11 +4473,11 @@ var LINKED_ACCOUNTS_MOCK_DATA = [
4472
4473
  import useSWR4 from "swr";
4473
4474
  var DEBUG = true;
4474
4475
  var USE_MOCK_RESPONSE_DATA = false;
4475
- var USE_PLAID_SANDBOX = true;
4476
4476
  var useLinkedAccounts = () => {
4477
- const { auth, businessId, apiUrl } = useLayerContext();
4477
+ const { auth, businessId, apiUrl, usePlaidSandbox } = useLayerContext();
4478
4478
  const [linkToken, setLinkToken] = useState12(null);
4479
4479
  const [loadingStatus, setLoadingStatus] = useState12("initial");
4480
+ const USE_PLAID_SANDBOX = usePlaidSandbox ?? true;
4480
4481
  const {
4481
4482
  data: responseData,
4482
4483
  isLoading,
@@ -6923,7 +6924,7 @@ var SkeletonLoader = ({
6923
6924
  import React82 from "react";
6924
6925
  import { PieChart as PieChart2, Pie as Pie2, Cell as Cell3 } from "recharts";
6925
6926
  var MiniChart = ({ data }) => {
6926
- return /* @__PURE__ */ React82.createElement(PieChart2, { width: 48, height: 48, className: "mini-chart" }, /* @__PURE__ */ React82.createElement(
6927
+ return /* @__PURE__ */ React82.createElement(PieChart2, { width: 52, height: 52, className: "mini-chart" }, /* @__PURE__ */ React82.createElement(
6927
6928
  Pie2,
6928
6929
  {
6929
6930
  data,
@@ -6933,7 +6934,7 @@ var MiniChart = ({ data }) => {
6933
6934
  cy: "50%",
6934
6935
  innerRadius: 10,
6935
6936
  outerRadius: 16,
6936
- paddingAngle: 0.2,
6937
+ paddingAngle: 0.4,
6937
6938
  fill: "#8884d8",
6938
6939
  width: 24,
6939
6940
  height: 24,
@@ -8579,7 +8580,7 @@ var ChartOfAccountsTable = ({
8579
8580
  !expandAll || expandAll === "collapsed" ? "expanded" : "collapsed"
8580
8581
  )
8581
8582
  },
8582
- !expandAll || expandAll === "collapsed" ? "Expand all rows" : "Collpase all rows"
8583
+ !expandAll || expandAll === "collapsed" ? "Expand all rows" : "Collapse all rows"
8583
8584
  )) : null,
8584
8585
  /* @__PURE__ */ React96.createElement("div", { className: "Layer__header__actions-col" }, /* @__PURE__ */ React96.createElement(
8585
8586
  Button,
@@ -9105,7 +9106,8 @@ var LayerProvider = ({
9105
9106
  children,
9106
9107
  businessAccessToken,
9107
9108
  environment = "production",
9108
- theme
9109
+ theme,
9110
+ usePlaidSandbox
9109
9111
  }) => {
9110
9112
  const defaultSWRConfig = {
9111
9113
  revalidateInterval: 0,
@@ -9127,6 +9129,7 @@ var LayerProvider = ({
9127
9129
  apiUrl,
9128
9130
  theme,
9129
9131
  colors,
9132
+ usePlaidSandbox,
9130
9133
  onboardingStep: void 0
9131
9134
  });
9132
9135
  const { data: auth } = appId !== void 0 && appSecret !== void 0 ? useSWR8(
@@ -10423,7 +10426,7 @@ var OnboardingContent = ({
10423
10426
  };
10424
10427
 
10425
10428
  // src/views/AccountingOverview/AccountingOverview.tsx
10426
- import React127 from "react";
10429
+ import React127, { useState as useState36 } from "react";
10427
10430
 
10428
10431
  // src/components/TransactionToReviewCard/TransactionToReviewCard.tsx
10429
10432
  import React124, { useEffect as useEffect22, useMemo as useMemo15, useState as useState35 } from "react";
@@ -10571,11 +10574,13 @@ var View3 = ({ title, children, headerControls }) => {
10571
10574
  };
10572
10575
 
10573
10576
  // src/views/AccountingOverview/AccountingOverview.tsx
10577
+ import classNames43 from "classnames";
10574
10578
  var AccountingOverview = ({
10575
10579
  title = "Accounting overview",
10576
10580
  enableOnboarding = false,
10577
10581
  onTransactionsToReviewClick
10578
10582
  }) => {
10583
+ const [pnlToggle, setPnlToggle] = useState36("revenue");
10579
10584
  return /* @__PURE__ */ React127.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React127.createElement(View3, { title, headerControls: /* @__PURE__ */ React127.createElement(ProfitAndLoss.DatePicker, null) }, enableOnboarding && /* @__PURE__ */ React127.createElement(Onboarding, null), /* @__PURE__ */ React127.createElement("div", { className: "Layer__accounting-overview__summaries-row" }, /* @__PURE__ */ React127.createElement(ProfitAndLoss.Summaries, { actionable: false }), /* @__PURE__ */ React127.createElement(TransactionToReviewCard, { onClick: onTransactionsToReviewClick })), /* @__PURE__ */ React127.createElement(
10580
10585
  Container,
10581
10586
  {
@@ -10585,7 +10590,42 @@ var AccountingOverview = ({
10585
10590
  },
10586
10591
  /* @__PURE__ */ React127.createElement(Header, null, /* @__PURE__ */ React127.createElement(Heading, { size: "secondary" /* secondary */ }, "Profit & Loss")),
10587
10592
  /* @__PURE__ */ React127.createElement(ProfitAndLoss.Chart, null)
10588
- ), /* @__PURE__ */ React127.createElement("div", { className: "accounting-overview-profit-and-loss-charts" }, /* @__PURE__ */ React127.createElement(Container, { name: "accounting-overview-profit-and-loss-chart" }, /* @__PURE__ */ React127.createElement(ProfitAndLoss.DetailedCharts, { scope: "revenue", hideClose: true })), /* @__PURE__ */ React127.createElement(Container, { name: "accounting-overview-profit-and-loss-chart" }, /* @__PURE__ */ React127.createElement(ProfitAndLoss.DetailedCharts, { scope: "expenses", hideClose: true })))));
10593
+ ), /* @__PURE__ */ React127.createElement("div", { className: "accounting-overview-profit-and-loss-charts" }, /* @__PURE__ */ React127.createElement(
10594
+ Toggle,
10595
+ {
10596
+ name: "pnl-detailed-charts",
10597
+ options: [
10598
+ {
10599
+ value: "revenue",
10600
+ label: "Revenue"
10601
+ },
10602
+ {
10603
+ value: "expenses",
10604
+ label: "Expenses"
10605
+ }
10606
+ ],
10607
+ selected: pnlToggle,
10608
+ onChange: (e) => setPnlToggle(e.target.value)
10609
+ }
10610
+ ), /* @__PURE__ */ React127.createElement(
10611
+ Container,
10612
+ {
10613
+ name: classNames43(
10614
+ "accounting-overview-profit-and-loss-chart",
10615
+ pnlToggle !== "revenue" && "accounting-overview-profit-and-loss-chart--hidden"
10616
+ )
10617
+ },
10618
+ /* @__PURE__ */ React127.createElement(ProfitAndLoss.DetailedCharts, { scope: "revenue", hideClose: true })
10619
+ ), /* @__PURE__ */ React127.createElement(
10620
+ Container,
10621
+ {
10622
+ name: classNames43(
10623
+ "accounting-overview-profit-and-loss-chart",
10624
+ pnlToggle !== "expenses" && "accounting-overview-profit-and-loss-chart--hidden"
10625
+ )
10626
+ },
10627
+ /* @__PURE__ */ React127.createElement(ProfitAndLoss.DetailedCharts, { scope: "expenses", hideClose: true })
10628
+ ))));
10589
10629
  };
10590
10630
 
10591
10631
  // src/views/BankTransactionsWithLinkedAccounts/BankTransactionsWithLinkedAccounts.tsx
@@ -10642,11 +10682,11 @@ var ReportsPanel = ({ containerRef }) => {
10642
10682
  };
10643
10683
 
10644
10684
  // src/views/GeneralLedger/GeneralLedger.tsx
10645
- import React130, { useState as useState36 } from "react";
10685
+ import React130, { useState as useState37 } from "react";
10646
10686
  var GeneralLedgerView = ({
10647
10687
  title = "General Ledger"
10648
10688
  }) => {
10649
- const [activeTab, setActiveTab] = useState36("chartOfAccounts");
10689
+ const [activeTab, setActiveTab] = useState37("chartOfAccounts");
10650
10690
  return /* @__PURE__ */ React130.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ React130.createElement(View3, { title }, /* @__PURE__ */ React130.createElement(
10651
10691
  Toggle,
10652
10692
  {