@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.
- package/.idea/layer-react.iml +9 -0
- package/.idea/misc.xml +6 -0
- package/.idea/modules.xml +8 -0
- package/.idea/vcs.xml +6 -0
- package/dist/esm/index.js +50 -10
- package/dist/esm/index.js.map +3 -3
- package/dist/index.d.ts +3 -1
- package/dist/index.js +47 -7
- package/dist/index.js.map +3 -3
- package/dist/styles/index.css +53 -2
- package/dist/styles/index.css.map +2 -2
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2759,8 +2759,9 @@ declare module '@layerfi/components/providers/LayerProvider/LayerProvider' {
|
|
|
2759
2759
|
businessAccessToken?: string;
|
|
2760
2760
|
environment?: keyof typeof LayerEnvironment;
|
|
2761
2761
|
theme?: LayerThemeConfig;
|
|
2762
|
+
usePlaidSandbox?: boolean;
|
|
2762
2763
|
};
|
|
2763
|
-
export const LayerProvider: ({ appId, appSecret, businessId, children, businessAccessToken, environment, theme, }: PropsWithChildren<Props>) => React.JSX.Element;
|
|
2764
|
+
export const LayerProvider: ({ appId, appSecret, businessId, children, businessAccessToken, environment, theme, usePlaidSandbox, }: PropsWithChildren<Props>) => React.JSX.Element;
|
|
2764
2765
|
export {};
|
|
2765
2766
|
|
|
2766
2767
|
}
|
|
@@ -3071,6 +3072,7 @@ declare module '@layerfi/components/types/layer_context' {
|
|
|
3071
3072
|
apiUrl: string;
|
|
3072
3073
|
theme?: LayerThemeConfig;
|
|
3073
3074
|
colors: ColorsPalette;
|
|
3075
|
+
usePlaidSandbox?: boolean;
|
|
3074
3076
|
onboardingStep?: OnboardingStep;
|
|
3075
3077
|
};
|
|
3076
3078
|
export type LayerContextHelpers = {
|
package/dist/index.js
CHANGED
|
@@ -412,6 +412,7 @@ var LayerContext = (0, import_react.createContext)({
|
|
|
412
412
|
apiUrl: "",
|
|
413
413
|
theme: void 0,
|
|
414
414
|
colors: {},
|
|
415
|
+
usePlaidSandbox: true,
|
|
415
416
|
setTheme: () => void 0,
|
|
416
417
|
getColor: (_shade) => void 0,
|
|
417
418
|
setLightColor: () => void 0,
|
|
@@ -4492,11 +4493,11 @@ var LINKED_ACCOUNTS_MOCK_DATA = [
|
|
|
4492
4493
|
var import_swr4 = __toESM(require("swr"));
|
|
4493
4494
|
var DEBUG = true;
|
|
4494
4495
|
var USE_MOCK_RESPONSE_DATA = false;
|
|
4495
|
-
var USE_PLAID_SANDBOX = true;
|
|
4496
4496
|
var useLinkedAccounts = () => {
|
|
4497
|
-
const { auth, businessId, apiUrl } = useLayerContext();
|
|
4497
|
+
const { auth, businessId, apiUrl, usePlaidSandbox } = useLayerContext();
|
|
4498
4498
|
const [linkToken, setLinkToken] = (0, import_react49.useState)(null);
|
|
4499
4499
|
const [loadingStatus, setLoadingStatus] = (0, import_react49.useState)("initial");
|
|
4500
|
+
const USE_PLAID_SANDBOX = usePlaidSandbox ?? true;
|
|
4500
4501
|
const {
|
|
4501
4502
|
data: responseData,
|
|
4502
4503
|
isLoading,
|
|
@@ -6925,7 +6926,7 @@ var SkeletonLoader = ({
|
|
|
6925
6926
|
var import_react68 = __toESM(require("react"));
|
|
6926
6927
|
var import_recharts3 = require("recharts");
|
|
6927
6928
|
var MiniChart = ({ data }) => {
|
|
6928
|
-
return /* @__PURE__ */ import_react68.default.createElement(import_recharts3.PieChart, { width:
|
|
6929
|
+
return /* @__PURE__ */ import_react68.default.createElement(import_recharts3.PieChart, { width: 52, height: 52, className: "mini-chart" }, /* @__PURE__ */ import_react68.default.createElement(
|
|
6929
6930
|
import_recharts3.Pie,
|
|
6930
6931
|
{
|
|
6931
6932
|
data,
|
|
@@ -6935,7 +6936,7 @@ var MiniChart = ({ data }) => {
|
|
|
6935
6936
|
cy: "50%",
|
|
6936
6937
|
innerRadius: 10,
|
|
6937
6938
|
outerRadius: 16,
|
|
6938
|
-
paddingAngle: 0.
|
|
6939
|
+
paddingAngle: 0.4,
|
|
6939
6940
|
fill: "#8884d8",
|
|
6940
6941
|
width: 24,
|
|
6941
6942
|
height: 24,
|
|
@@ -8581,7 +8582,7 @@ var ChartOfAccountsTable = ({
|
|
|
8581
8582
|
!expandAll || expandAll === "collapsed" ? "expanded" : "collapsed"
|
|
8582
8583
|
)
|
|
8583
8584
|
},
|
|
8584
|
-
!expandAll || expandAll === "collapsed" ? "Expand all rows" : "
|
|
8585
|
+
!expandAll || expandAll === "collapsed" ? "Expand all rows" : "Collapse all rows"
|
|
8585
8586
|
)) : null,
|
|
8586
8587
|
/* @__PURE__ */ import_react84.default.createElement("div", { className: "Layer__header__actions-col" }, /* @__PURE__ */ import_react84.default.createElement(
|
|
8587
8588
|
Button,
|
|
@@ -9099,7 +9100,8 @@ var LayerProvider = ({
|
|
|
9099
9100
|
children,
|
|
9100
9101
|
businessAccessToken,
|
|
9101
9102
|
environment = "production",
|
|
9102
|
-
theme
|
|
9103
|
+
theme,
|
|
9104
|
+
usePlaidSandbox
|
|
9103
9105
|
}) => {
|
|
9104
9106
|
const defaultSWRConfig = {
|
|
9105
9107
|
revalidateInterval: 0,
|
|
@@ -9121,6 +9123,7 @@ var LayerProvider = ({
|
|
|
9121
9123
|
apiUrl,
|
|
9122
9124
|
theme,
|
|
9123
9125
|
colors,
|
|
9126
|
+
usePlaidSandbox,
|
|
9124
9127
|
onboardingStep: void 0
|
|
9125
9128
|
});
|
|
9126
9129
|
const { data: auth } = appId !== void 0 && appSecret !== void 0 ? (0, import_swr8.default)(
|
|
@@ -10565,11 +10568,13 @@ var View3 = ({ title, children, headerControls }) => {
|
|
|
10565
10568
|
};
|
|
10566
10569
|
|
|
10567
10570
|
// src/views/AccountingOverview/AccountingOverview.tsx
|
|
10571
|
+
var import_classnames44 = __toESM(require("classnames"));
|
|
10568
10572
|
var AccountingOverview = ({
|
|
10569
10573
|
title = "Accounting overview",
|
|
10570
10574
|
enableOnboarding = false,
|
|
10571
10575
|
onTransactionsToReviewClick
|
|
10572
10576
|
}) => {
|
|
10577
|
+
const [pnlToggle, setPnlToggle] = (0, import_react112.useState)("revenue");
|
|
10573
10578
|
return /* @__PURE__ */ import_react112.default.createElement(ProfitAndLoss, { asContainer: false }, /* @__PURE__ */ import_react112.default.createElement(View3, { title, headerControls: /* @__PURE__ */ import_react112.default.createElement(ProfitAndLoss.DatePicker, null) }, enableOnboarding && /* @__PURE__ */ import_react112.default.createElement(Onboarding, null), /* @__PURE__ */ import_react112.default.createElement("div", { className: "Layer__accounting-overview__summaries-row" }, /* @__PURE__ */ import_react112.default.createElement(ProfitAndLoss.Summaries, { actionable: false }), /* @__PURE__ */ import_react112.default.createElement(TransactionToReviewCard, { onClick: onTransactionsToReviewClick })), /* @__PURE__ */ import_react112.default.createElement(
|
|
10574
10579
|
Container,
|
|
10575
10580
|
{
|
|
@@ -10579,7 +10584,42 @@ var AccountingOverview = ({
|
|
|
10579
10584
|
},
|
|
10580
10585
|
/* @__PURE__ */ import_react112.default.createElement(Header, null, /* @__PURE__ */ import_react112.default.createElement(Heading, { size: "secondary" /* secondary */ }, "Profit & Loss")),
|
|
10581
10586
|
/* @__PURE__ */ import_react112.default.createElement(ProfitAndLoss.Chart, null)
|
|
10582
|
-
), /* @__PURE__ */ import_react112.default.createElement("div", { className: "accounting-overview-profit-and-loss-charts" }, /* @__PURE__ */ import_react112.default.createElement(
|
|
10587
|
+
), /* @__PURE__ */ import_react112.default.createElement("div", { className: "accounting-overview-profit-and-loss-charts" }, /* @__PURE__ */ import_react112.default.createElement(
|
|
10588
|
+
Toggle,
|
|
10589
|
+
{
|
|
10590
|
+
name: "pnl-detailed-charts",
|
|
10591
|
+
options: [
|
|
10592
|
+
{
|
|
10593
|
+
value: "revenue",
|
|
10594
|
+
label: "Revenue"
|
|
10595
|
+
},
|
|
10596
|
+
{
|
|
10597
|
+
value: "expenses",
|
|
10598
|
+
label: "Expenses"
|
|
10599
|
+
}
|
|
10600
|
+
],
|
|
10601
|
+
selected: pnlToggle,
|
|
10602
|
+
onChange: (e) => setPnlToggle(e.target.value)
|
|
10603
|
+
}
|
|
10604
|
+
), /* @__PURE__ */ import_react112.default.createElement(
|
|
10605
|
+
Container,
|
|
10606
|
+
{
|
|
10607
|
+
name: (0, import_classnames44.default)(
|
|
10608
|
+
"accounting-overview-profit-and-loss-chart",
|
|
10609
|
+
pnlToggle !== "revenue" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
10610
|
+
)
|
|
10611
|
+
},
|
|
10612
|
+
/* @__PURE__ */ import_react112.default.createElement(ProfitAndLoss.DetailedCharts, { scope: "revenue", hideClose: true })
|
|
10613
|
+
), /* @__PURE__ */ import_react112.default.createElement(
|
|
10614
|
+
Container,
|
|
10615
|
+
{
|
|
10616
|
+
name: (0, import_classnames44.default)(
|
|
10617
|
+
"accounting-overview-profit-and-loss-chart",
|
|
10618
|
+
pnlToggle !== "expenses" && "accounting-overview-profit-and-loss-chart--hidden"
|
|
10619
|
+
)
|
|
10620
|
+
},
|
|
10621
|
+
/* @__PURE__ */ import_react112.default.createElement(ProfitAndLoss.DetailedCharts, { scope: "expenses", hideClose: true })
|
|
10622
|
+
))));
|
|
10583
10623
|
};
|
|
10584
10624
|
|
|
10585
10625
|
// src/views/BankTransactionsWithLinkedAccounts/BankTransactionsWithLinkedAccounts.tsx
|