@layerfi/components 0.1.132-alpha.3 → 0.1.132-alpha.5
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/cjs/index.cjs +182 -148
- package/dist/esm/index.mjs +182 -148
- package/dist/index.css +55 -80
- package/dist/index.d.ts +2 -1
- package/package.json +1 -1
package/dist/esm/index.mjs
CHANGED
|
@@ -250,7 +250,7 @@ var getIntlLocale = (locale) => {
|
|
|
250
250
|
};
|
|
251
251
|
var package_default = {
|
|
252
252
|
name: "@layerfi/components",
|
|
253
|
-
version: "0.1.132-alpha.
|
|
253
|
+
version: "0.1.132-alpha.5",
|
|
254
254
|
description: "Layer React Components",
|
|
255
255
|
main: "dist/cjs/index.cjs",
|
|
256
256
|
module: "dist/esm/index.mjs",
|
|
@@ -4696,6 +4696,9 @@ var getLeafCategories$1 = (categories) => {
|
|
|
4696
4696
|
return getLeafCategories$1(category.subCategories);
|
|
4697
4697
|
});
|
|
4698
4698
|
};
|
|
4699
|
+
var flattenCategories$2 = (categories) => {
|
|
4700
|
+
return categories.flatMap((category) => [category, ...category.subCategories ? flattenCategories$2(category.subCategories) : []]);
|
|
4701
|
+
};
|
|
4699
4702
|
//#endregion
|
|
4700
4703
|
//#region src/schemas/customer.ts
|
|
4701
4704
|
var CustomerStatusSchema = Schema.Literal("ACTIVE", "ARCHIVED");
|
|
@@ -5408,6 +5411,7 @@ var CategorizationRuleSchema = Schema$1.Struct({
|
|
|
5408
5411
|
suggestion2: pipe$1(Schema$1.propertySignature(Schema$1.NullishOr(AccountIdentifierSchema)), Schema$1.fromKey("suggestion_2")),
|
|
5409
5412
|
suggestion3: pipe$1(Schema$1.propertySignature(Schema$1.NullishOr(AccountIdentifierSchema)), Schema$1.fromKey("suggestion_3")),
|
|
5410
5413
|
counterpartyFilter: pipe$1(Schema$1.propertySignature(Schema$1.NullishOr(BankTransactionCounterpartySchema)), Schema$1.fromKey("counterparty_filter")),
|
|
5414
|
+
readableTransactionDescriptionFilter: pipe$1(Schema$1.propertySignature(Schema$1.NullishOr(Schema$1.String)), Schema$1.fromKey("readable_transaction_description_filter")),
|
|
5411
5415
|
bankDirectionFilter: pipe$1(Schema$1.propertySignature(Schema$1.NullishOr(BankDirectionFilterSchema)), Schema$1.fromKey("bank_direction_filter")),
|
|
5412
5416
|
createdAt: pipe$1(Schema$1.propertySignature(Schema$1.Date), Schema$1.fromKey("created_at")),
|
|
5413
5417
|
updatedAt: pipe$1(Schema$1.propertySignature(Schema$1.Date), Schema$1.fromKey("updated_at")),
|
|
@@ -20249,10 +20253,13 @@ var getCategorizationRuleDirectionLabel = (bankDirectionFilter, t) => {
|
|
|
20249
20253
|
const entry = DIRECTION_CONFIG.find((c) => c.value === bankDirectionFilter);
|
|
20250
20254
|
return entry ? t(entry.i18nKey, entry.defaultValue) : t("categorizationRules:label.any_direction", "Any direction");
|
|
20251
20255
|
};
|
|
20256
|
+
var getCategorizationRuleCounterpartyLabel = (rule) => {
|
|
20257
|
+
var _ref, _rule$counterpartyFil, _rule$counterpartyFil2;
|
|
20258
|
+
return (_ref = (_rule$counterpartyFil = (_rule$counterpartyFil2 = rule.counterpartyFilter) === null || _rule$counterpartyFil2 === void 0 ? void 0 : _rule$counterpartyFil2.name) !== null && _rule$counterpartyFil !== void 0 ? _rule$counterpartyFil : rule.readableTransactionDescriptionFilter) !== null && _ref !== void 0 ? _ref : void 0;
|
|
20259
|
+
};
|
|
20252
20260
|
//#endregion
|
|
20253
20261
|
//#region src/components/CategorizationRules/CategorizationRulesMobileList/CategorizationRulesMobileList.tsx
|
|
20254
20262
|
var CategorizationRuleMobileListItem = ({ rule, options, onDeletePress }) => {
|
|
20255
|
-
var _rule$counterpartyFil;
|
|
20256
20263
|
const { t } = useTranslation();
|
|
20257
20264
|
return /* @__PURE__ */ jsxs(HStack, {
|
|
20258
20265
|
justify: "space-between",
|
|
@@ -20266,7 +20273,7 @@ var CategorizationRuleMobileListItem = ({ rule, options, onDeletePress }) => {
|
|
|
20266
20273
|
/* @__PURE__ */ jsx(Span, {
|
|
20267
20274
|
weight: "bold",
|
|
20268
20275
|
ellipsis: true,
|
|
20269
|
-
children: (
|
|
20276
|
+
children: getCategorizationRuleCounterpartyLabel(rule)
|
|
20270
20277
|
}),
|
|
20271
20278
|
/* @__PURE__ */ jsxs(HStack, {
|
|
20272
20279
|
gap: "3xs",
|
|
@@ -20611,13 +20618,10 @@ var CategorizationRulesTable = ({ data, isLoading, isError, paginationProps, opt
|
|
|
20611
20618
|
{
|
|
20612
20619
|
id: CategorizationRuleColumns.Counterparty,
|
|
20613
20620
|
header: t("common:label.counterparty", "Counterparty"),
|
|
20614
|
-
cell: (row) => {
|
|
20615
|
-
|
|
20616
|
-
|
|
20617
|
-
|
|
20618
|
-
children: (_row$original$counter = row.original.counterpartyFilter) === null || _row$original$counter === void 0 ? void 0 : _row$original$counter.name
|
|
20619
|
-
});
|
|
20620
|
-
}
|
|
20621
|
+
cell: (row) => /* @__PURE__ */ jsx(Span, {
|
|
20622
|
+
ellipsis: true,
|
|
20623
|
+
children: getCategorizationRuleCounterpartyLabel(row.original)
|
|
20624
|
+
})
|
|
20621
20625
|
},
|
|
20622
20626
|
{
|
|
20623
20627
|
id: CategorizationRuleColumns.Direction,
|
|
@@ -20708,7 +20712,7 @@ var CategorizationRulesHeader = ({ onGoBack }) => {
|
|
|
20708
20712
|
};
|
|
20709
20713
|
var resolveVariant$1 = ({ width }) => width < BREAKPOINTS.TABLET ? "Mobile" : "Desktop";
|
|
20710
20714
|
var ResponsiveCategorizationRulesView = () => {
|
|
20711
|
-
var
|
|
20715
|
+
var _ref;
|
|
20712
20716
|
const { t } = useTranslation();
|
|
20713
20717
|
const [selectedRule, setSelectedRule] = useState(null);
|
|
20714
20718
|
const [showDeletionConfirmationModal, setShowDeletionConfirmationModal] = useState(false);
|
|
@@ -20718,7 +20722,7 @@ var ResponsiveCategorizationRulesView = () => {
|
|
|
20718
20722
|
const { data: categories, isLoading: categoriesAreLoading } = useCategories({ mode: CategoriesListMode.All });
|
|
20719
20723
|
const options = useMemo(() => {
|
|
20720
20724
|
if (!categories) return [];
|
|
20721
|
-
return
|
|
20725
|
+
return flattenCategories$2(categories);
|
|
20722
20726
|
}, [categories]);
|
|
20723
20727
|
const { data, hasMore, isLoading: rulesAreLoading, isError, size, setSize } = useListCategorizationRules({});
|
|
20724
20728
|
const categorizationRules = useMemo(() => data === null || data === void 0 ? void 0 : data.flatMap(({ data }) => data), [data]);
|
|
@@ -20764,66 +20768,69 @@ var ResponsiveCategorizationRulesView = () => {
|
|
|
20764
20768
|
]);
|
|
20765
20769
|
const isLoading = data === void 0 || rulesAreLoading || categoriesAreLoading;
|
|
20766
20770
|
const { toBankTransactionsTable } = useBankTransactionsNavigation();
|
|
20771
|
+
const DesktopView = useMemo(() => /* @__PURE__ */ jsx(BaseDetailView, {
|
|
20772
|
+
slots: {
|
|
20773
|
+
Header: CategorizationRulesHeader,
|
|
20774
|
+
BackIcon: BackArrow
|
|
20775
|
+
},
|
|
20776
|
+
name: "CategorizationRulesDrawer",
|
|
20777
|
+
onGoBack: toBankTransactionsTable,
|
|
20778
|
+
children: /* @__PURE__ */ jsx(CategorizationRulesTable, {
|
|
20779
|
+
data: categorizationRules,
|
|
20780
|
+
isLoading,
|
|
20781
|
+
isError,
|
|
20782
|
+
paginationProps,
|
|
20783
|
+
options,
|
|
20784
|
+
onDeleteRule,
|
|
20785
|
+
slots: {
|
|
20786
|
+
EmptyState: CategorizationRulesEmptyState,
|
|
20787
|
+
ErrorState: CategorizationRulesErrorState
|
|
20788
|
+
}
|
|
20789
|
+
})
|
|
20790
|
+
}), [
|
|
20791
|
+
toBankTransactionsTable,
|
|
20792
|
+
categorizationRules,
|
|
20793
|
+
isLoading,
|
|
20794
|
+
isError,
|
|
20795
|
+
paginationProps,
|
|
20796
|
+
options,
|
|
20797
|
+
onDeleteRule
|
|
20798
|
+
]);
|
|
20799
|
+
const MobileView = useMemo(() => /* @__PURE__ */ jsxs(VStack, {
|
|
20800
|
+
gap: "md",
|
|
20801
|
+
children: [/* @__PURE__ */ jsx(CategorizationRulesHeader, { onGoBack: toBankTransactionsTable }), /* @__PURE__ */ jsx(CategorizationRulesMobileList, {
|
|
20802
|
+
data: categorizationRules,
|
|
20803
|
+
isLoading,
|
|
20804
|
+
isError,
|
|
20805
|
+
paginationProps,
|
|
20806
|
+
options,
|
|
20807
|
+
onDeleteRule,
|
|
20808
|
+
slots: {
|
|
20809
|
+
EmptyState: CategorizationRulesEmptyState,
|
|
20810
|
+
ErrorState: CategorizationRulesErrorState
|
|
20811
|
+
}
|
|
20812
|
+
})]
|
|
20813
|
+
}), [
|
|
20814
|
+
toBankTransactionsTable,
|
|
20815
|
+
categorizationRules,
|
|
20816
|
+
isLoading,
|
|
20817
|
+
isError,
|
|
20818
|
+
paginationProps,
|
|
20819
|
+
options,
|
|
20820
|
+
onDeleteRule
|
|
20821
|
+
]);
|
|
20822
|
+
const selectedRuleCounterpartyLabel = (_ref = selectedRule && getCategorizationRuleCounterpartyLabel(selectedRule)) !== null && _ref !== void 0 ? _ref : t("bankTransactions:label.selected_counterparty", "this counterparty");
|
|
20767
20823
|
return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ResponsiveComponent, {
|
|
20768
20824
|
resolveVariant: resolveVariant$1,
|
|
20769
20825
|
slots: {
|
|
20770
|
-
Desktop:
|
|
20771
|
-
|
|
20772
|
-
Header: CategorizationRulesHeader,
|
|
20773
|
-
BackIcon: BackArrow
|
|
20774
|
-
},
|
|
20775
|
-
name: "CategorizationRulesDrawer",
|
|
20776
|
-
onGoBack: toBankTransactionsTable,
|
|
20777
|
-
children: /* @__PURE__ */ jsx(CategorizationRulesTable, {
|
|
20778
|
-
data: categorizationRules,
|
|
20779
|
-
isLoading,
|
|
20780
|
-
isError,
|
|
20781
|
-
paginationProps,
|
|
20782
|
-
options,
|
|
20783
|
-
onDeleteRule,
|
|
20784
|
-
slots: {
|
|
20785
|
-
EmptyState: CategorizationRulesEmptyState,
|
|
20786
|
-
ErrorState: CategorizationRulesErrorState
|
|
20787
|
-
}
|
|
20788
|
-
})
|
|
20789
|
-
}), [
|
|
20790
|
-
toBankTransactionsTable,
|
|
20791
|
-
categorizationRules,
|
|
20792
|
-
isLoading,
|
|
20793
|
-
isError,
|
|
20794
|
-
paginationProps,
|
|
20795
|
-
options,
|
|
20796
|
-
onDeleteRule
|
|
20797
|
-
]),
|
|
20798
|
-
Mobile: useMemo(() => /* @__PURE__ */ jsxs(VStack, {
|
|
20799
|
-
gap: "md",
|
|
20800
|
-
children: [/* @__PURE__ */ jsx(CategorizationRulesHeader, { onGoBack: toBankTransactionsTable }), /* @__PURE__ */ jsx(CategorizationRulesMobileList, {
|
|
20801
|
-
data: categorizationRules,
|
|
20802
|
-
isLoading,
|
|
20803
|
-
isError,
|
|
20804
|
-
paginationProps,
|
|
20805
|
-
options,
|
|
20806
|
-
onDeleteRule,
|
|
20807
|
-
slots: {
|
|
20808
|
-
EmptyState: CategorizationRulesEmptyState,
|
|
20809
|
-
ErrorState: CategorizationRulesErrorState
|
|
20810
|
-
}
|
|
20811
|
-
})]
|
|
20812
|
-
}), [
|
|
20813
|
-
toBankTransactionsTable,
|
|
20814
|
-
categorizationRules,
|
|
20815
|
-
isLoading,
|
|
20816
|
-
isError,
|
|
20817
|
-
paginationProps,
|
|
20818
|
-
options,
|
|
20819
|
-
onDeleteRule
|
|
20820
|
-
])
|
|
20826
|
+
Desktop: DesktopView,
|
|
20827
|
+
Mobile: MobileView
|
|
20821
20828
|
}
|
|
20822
20829
|
}), /* @__PURE__ */ jsx(BaseConfirmationModal, {
|
|
20823
20830
|
isOpen: showDeletionConfirmationModal,
|
|
20824
20831
|
onOpenChange: setShowDeletionConfirmationModal,
|
|
20825
20832
|
title: t("categorizationRules:prompt.delete_categorization_rule", "Delete categorization rule?"),
|
|
20826
|
-
description: t("categorizationRules:label.transaction_no_longer_automatically_categorized", "Transactions will no longer automatically be categorized by this rule. Any transactions previously categorized to {{counterparty}} will not be affected.", { counterparty:
|
|
20833
|
+
description: t("categorizationRules:label.transaction_no_longer_automatically_categorized", "Transactions will no longer automatically be categorized by this rule. Any transactions previously categorized to {{counterparty}} will not be affected.", { counterparty: selectedRuleCounterpartyLabel }),
|
|
20827
20834
|
onConfirm: archiveCategorizationRule,
|
|
20828
20835
|
confirmLabel: t("common:action.delete_label", "Delete"),
|
|
20829
20836
|
cancelLabel: t("common:action.cancel_label", "Cancel"),
|
|
@@ -24054,13 +24061,13 @@ var ProfitAndLossChartSelectionIndicator = ({ viewBox, selected }) => {
|
|
|
24054
24061
|
const boxWidth = width + 2 * margin;
|
|
24055
24062
|
const borderRadius = 6;
|
|
24056
24063
|
return /* @__PURE__ */ jsx("rect", {
|
|
24057
|
-
className: "
|
|
24064
|
+
className: "Layer__ProfitAndLossChart__SelectionIndicator",
|
|
24058
24065
|
rx: borderRadius,
|
|
24059
24066
|
ry: borderRadius,
|
|
24060
24067
|
x: x - margin,
|
|
24061
|
-
y:
|
|
24068
|
+
y: 24,
|
|
24062
24069
|
width: boxWidth,
|
|
24063
|
-
height: "calc(100% -
|
|
24070
|
+
height: "calc(100% - 38px)"
|
|
24064
24071
|
});
|
|
24065
24072
|
};
|
|
24066
24073
|
//#endregion
|
|
@@ -24370,7 +24377,8 @@ var transformPnLData = ({ data, compactView, formatMonthName }) => {
|
|
|
24370
24377
|
var CHART_MARGINS = {
|
|
24371
24378
|
left: 12,
|
|
24372
24379
|
right: 12,
|
|
24373
|
-
bottom: 12
|
|
24380
|
+
bottom: 12,
|
|
24381
|
+
top: 24
|
|
24374
24382
|
};
|
|
24375
24383
|
var ProfitAndLossChart = ({ tagFilter, hideLegend = false }) => {
|
|
24376
24384
|
var _getColor$hex, _getColor, _getColor$hex2, _getColor2, _getColor$hex3, _getColor3;
|
|
@@ -24444,9 +24452,9 @@ var ProfitAndLossChart = ({ tagFilter, hideLegend = false }) => {
|
|
|
24444
24452
|
activationDate
|
|
24445
24453
|
]);
|
|
24446
24454
|
return /* @__PURE__ */ jsxs("div", {
|
|
24447
|
-
className: "
|
|
24455
|
+
className: "Layer__ProfitAndLossChart",
|
|
24448
24456
|
children: [/* @__PURE__ */ jsx(ResponsiveContainer, {
|
|
24449
|
-
className: "
|
|
24457
|
+
className: "Layer__ProfitAndLossChart__Container",
|
|
24450
24458
|
width: "100%",
|
|
24451
24459
|
height: "100%",
|
|
24452
24460
|
onResize: useCallback((width) => {
|
|
@@ -24458,7 +24466,7 @@ var ProfitAndLossChart = ({ tagFilter, hideLegend = false }) => {
|
|
|
24458
24466
|
margin: CHART_MARGINS,
|
|
24459
24467
|
data: dataOrPlaceholderData,
|
|
24460
24468
|
onClick,
|
|
24461
|
-
className: "Layer__profit-and-loss-chart",
|
|
24469
|
+
className: "Layer__profit-and-loss-chart Layer__ProfitAndLossChart__Chart",
|
|
24462
24470
|
children: [
|
|
24463
24471
|
/* @__PURE__ */ jsx(ProfitAndLossChartPatternDefs, {}),
|
|
24464
24472
|
/* @__PURE__ */ jsx(ReferenceLine, {
|
|
@@ -24549,7 +24557,6 @@ var DetailedChart = ({ data, isLoading, interactionProps, stylingProps, slots })
|
|
|
24549
24557
|
x: x + width / 2,
|
|
24550
24558
|
textAnchor: "middle",
|
|
24551
24559
|
verticalAnchor: "middle",
|
|
24552
|
-
breakAll: true,
|
|
24553
24560
|
maxLines: 2,
|
|
24554
24561
|
width: Math.max(width - 40, 0),
|
|
24555
24562
|
className: "Layer__DetailedChart__centerLabelTitle",
|
|
@@ -26606,7 +26613,7 @@ var SyncingBadge = () => {
|
|
|
26606
26613
|
};
|
|
26607
26614
|
//#endregion
|
|
26608
26615
|
//#region src/components/ProfitAndLossHeader/ProfitAndLossHeader.tsx
|
|
26609
|
-
var ProfitAndLossHeader = ({ text, className, headingClassName, withDatePicker, withDownloadButton, withStatus = true, stringOverrides, dateSelectionMode = "full" }) => {
|
|
26616
|
+
var ProfitAndLossHeader = ({ text, className, headingClassName, withDatePicker, withDownloadButton, withStatus = true, stringOverrides, dateSelectionMode = "full", trailingContent }) => {
|
|
26610
26617
|
const { t } = useTranslation();
|
|
26611
26618
|
const { data: linkedAccounts } = useLinkedAccounts();
|
|
26612
26619
|
const { activePeriod } = useActiveBookkeepingPeriod();
|
|
@@ -26634,10 +26641,15 @@ var ProfitAndLossHeader = ({ text, className, headingClassName, withDatePicker,
|
|
|
26634
26641
|
]
|
|
26635
26642
|
}), /* @__PURE__ */ jsxs(HStack, {
|
|
26636
26643
|
gap: "xs",
|
|
26637
|
-
|
|
26638
|
-
|
|
26639
|
-
|
|
26640
|
-
|
|
26644
|
+
align: "center",
|
|
26645
|
+
children: [
|
|
26646
|
+
trailingContent,
|
|
26647
|
+
withDatePicker && /* @__PURE__ */ jsx(CombinedDateRangeSelection, {
|
|
26648
|
+
mode: dateSelectionMode,
|
|
26649
|
+
showLabels: false
|
|
26650
|
+
}),
|
|
26651
|
+
withDownloadButton && /* @__PURE__ */ jsx(ProfitAndLossDownloadButton, { stringOverrides: stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.downloadButton })
|
|
26652
|
+
]
|
|
26641
26653
|
})]
|
|
26642
26654
|
});
|
|
26643
26655
|
};
|
|
@@ -40747,8 +40759,8 @@ var ProfitAndLossOverviewDetailedCharts = ({ variant, detailedChartsStringOverri
|
|
|
40747
40759
|
label: (detailedChartsStringOverrides === null || detailedChartsStringOverrides === void 0 || (_detailedChartsString2 = detailedChartsStringOverrides.detailedChartStringOverrides) === null || _detailedChartsString2 === void 0 ? void 0 : _detailedChartsString2.expenseToggleLabel) || t("common:label.expenses", "Expenses")
|
|
40748
40760
|
}];
|
|
40749
40761
|
}, [detailedChartsStringOverrides, t]);
|
|
40750
|
-
const chartsWrapperClassName = variant === "accounting" ? "
|
|
40751
|
-
const chartContainerName = variant === "accounting" ? "
|
|
40762
|
+
const chartsWrapperClassName = variant === "accounting" ? "Layer__AccountingOverview__ProfitAndLossCharts" : "Layer__BookkeepingOverview__ProfitAndLossCharts";
|
|
40763
|
+
const chartContainerName = variant === "accounting" ? "AccountingOverview__ProfitAndLossChart" : "BookkeepingOverview__ProfitAndLossChart";
|
|
40752
40764
|
return /* @__PURE__ */ jsxs(VStack, {
|
|
40753
40765
|
className: chartsWrapperClassName,
|
|
40754
40766
|
gap: "md",
|
|
@@ -40789,6 +40801,49 @@ var ProfitAndLossOverviewDetailedCharts = ({ variant, detailedChartsStringOverri
|
|
|
40789
40801
|
});
|
|
40790
40802
|
};
|
|
40791
40803
|
//#endregion
|
|
40804
|
+
//#region src/components/ProfitAndLossSummaryCard/PnlLegend.tsx
|
|
40805
|
+
var Swatch$1 = ({ className }) => /* @__PURE__ */ jsx("span", {
|
|
40806
|
+
className: `Layer__PnlLegend__Swatch ${className}`,
|
|
40807
|
+
"aria-hidden": true
|
|
40808
|
+
});
|
|
40809
|
+
var PnlLegend = ({ direction = "row" }) => {
|
|
40810
|
+
const { t } = useTranslation();
|
|
40811
|
+
return /* @__PURE__ */ jsxs(Stack, {
|
|
40812
|
+
className: "Layer__PnlLegend",
|
|
40813
|
+
direction,
|
|
40814
|
+
align: "start",
|
|
40815
|
+
gap: direction === "row" ? "md" : "2xs",
|
|
40816
|
+
pis: direction === "column" ? "md" : void 0,
|
|
40817
|
+
pbe: direction === "column" ? "md" : void 0,
|
|
40818
|
+
children: [
|
|
40819
|
+
/* @__PURE__ */ jsxs(HStack, {
|
|
40820
|
+
gap: "2xs",
|
|
40821
|
+
align: "center",
|
|
40822
|
+
children: [/* @__PURE__ */ jsx(Swatch$1, { className: "Layer__PnlLegend__Swatch--income" }), /* @__PURE__ */ jsx(Span, {
|
|
40823
|
+
size: "sm",
|
|
40824
|
+
children: t("common:label.revenue", "Revenue")
|
|
40825
|
+
})]
|
|
40826
|
+
}),
|
|
40827
|
+
/* @__PURE__ */ jsxs(HStack, {
|
|
40828
|
+
gap: "2xs",
|
|
40829
|
+
align: "center",
|
|
40830
|
+
children: [/* @__PURE__ */ jsx(Swatch$1, { className: "Layer__PnlLegend__Swatch--expenses" }), /* @__PURE__ */ jsx(Span, {
|
|
40831
|
+
size: "sm",
|
|
40832
|
+
children: t("common:label.expenses", "Expenses")
|
|
40833
|
+
})]
|
|
40834
|
+
}),
|
|
40835
|
+
/* @__PURE__ */ jsxs(HStack, {
|
|
40836
|
+
gap: "2xs",
|
|
40837
|
+
align: "center",
|
|
40838
|
+
children: [/* @__PURE__ */ jsx(Swatch$1, { className: "Layer__PnlLegend__Swatch--uncategorized" }), /* @__PURE__ */ jsx(Span, {
|
|
40839
|
+
size: "sm",
|
|
40840
|
+
children: t("common:label.uncategorized", "Uncategorized")
|
|
40841
|
+
})]
|
|
40842
|
+
})
|
|
40843
|
+
]
|
|
40844
|
+
});
|
|
40845
|
+
};
|
|
40846
|
+
//#endregion
|
|
40792
40847
|
//#region src/views/AccountingOverview/AccountingOverview.tsx
|
|
40793
40848
|
var AccountingOverview = ({ title, showTitle = true, enableOnboarding = false, onboardingStepOverride = void 0, onTransactionsToReviewClick, middleBanner, chartColorsList, stringOverrides, tagFilter = void 0, slotProps }) => {
|
|
40794
40849
|
var _slotProps$profitAndL, _stringOverrides$prof, _stringOverrides$prof2;
|
|
@@ -40803,6 +40858,7 @@ var AccountingOverview = ({ title, showTitle = true, enableOnboarding = false, o
|
|
|
40803
40858
|
} : void 0,
|
|
40804
40859
|
children: /* @__PURE__ */ jsxs(View, {
|
|
40805
40860
|
title: (stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.title) || title || t("overview:label.accounting_overview", "Accounting overview"),
|
|
40861
|
+
viewClassName: "Layer__AccountingOverview",
|
|
40806
40862
|
showHeader: showTitle,
|
|
40807
40863
|
header: /* @__PURE__ */ jsx(Header$2, { children: /* @__PURE__ */ jsx(HeaderRow, { children: /* @__PURE__ */ jsx(HeaderCol, { children: /* @__PURE__ */ jsx(GlobalMonthPicker, { truncateMonth: sizeClass === "mobile" }) }) }) }),
|
|
40808
40864
|
children: [
|
|
@@ -40818,11 +40874,19 @@ var AccountingOverview = ({ title, showTitle = true, enableOnboarding = false, o
|
|
|
40818
40874
|
}),
|
|
40819
40875
|
/* @__PURE__ */ jsxs(Container, {
|
|
40820
40876
|
name: "accounting-overview-profit-and-loss",
|
|
40877
|
+
className: "Layer__AccountingOverview__ProfitAndLossContainer",
|
|
40821
40878
|
asWidget: true,
|
|
40822
|
-
children: [/* @__PURE__ */ jsx(ProfitAndLoss.Header, {
|
|
40823
|
-
|
|
40824
|
-
|
|
40825
|
-
|
|
40879
|
+
children: [/* @__PURE__ */ jsx(ProfitAndLoss.Header, {
|
|
40880
|
+
text: (stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.header) || t("common:label.profit_loss", "Profit & Loss"),
|
|
40881
|
+
className: "Layer__AccountingOverview__ProfitAndLossHeader",
|
|
40882
|
+
trailingContent: /* @__PURE__ */ jsx(PnlLegend, { direction: "row" })
|
|
40883
|
+
}), /* @__PURE__ */ jsx(ProfitAndLoss.Chart, {
|
|
40884
|
+
tagFilter: tagFilter ? {
|
|
40885
|
+
key: tagFilter.tagKey,
|
|
40886
|
+
values: tagFilter.tagValues
|
|
40887
|
+
} : void 0,
|
|
40888
|
+
hideLegend: true
|
|
40889
|
+
})]
|
|
40826
40890
|
}),
|
|
40827
40891
|
middleBanner && /* @__PURE__ */ jsx(Container, {
|
|
40828
40892
|
name: "accounting-overview-middle-banner",
|
|
@@ -41325,7 +41389,7 @@ var BookkeepingOverview = ({ title, showTitle = true, onClickReconnectAccounts,
|
|
|
41325
41389
|
return /* @__PURE__ */ jsxs(ProfitAndLoss, {
|
|
41326
41390
|
asContainer: false,
|
|
41327
41391
|
children: [/* @__PURE__ */ jsxs(View, {
|
|
41328
|
-
viewClassName: "Layer__bookkeeping-overview--view",
|
|
41392
|
+
viewClassName: "Layer__bookkeeping-overview--view Layer__BookkeepingOverview",
|
|
41329
41393
|
title: (stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.title) || title || t("overview:label.bookkeeping_overview", "Bookkeeping overview"),
|
|
41330
41394
|
header: /* @__PURE__ */ jsx(Header$2, { children: /* @__PURE__ */ jsx(HeaderRow, { children: /* @__PURE__ */ jsx(HeaderCol, { children: /* @__PURE__ */ jsx(GlobalMonthPicker, { truncateMonth: sizeClass === "mobile" }) }) }) }),
|
|
41331
41395
|
withSidebar: width > 1100,
|
|
@@ -41362,6 +41426,7 @@ var BookkeepingOverview = ({ title, showTitle = true, onClickReconnectAccounts,
|
|
|
41362
41426
|
onClick: () => upperElementInFocus.current = false,
|
|
41363
41427
|
children: /* @__PURE__ */ jsxs(Container, {
|
|
41364
41428
|
name: "bookkeeping-overview-profit-and-loss",
|
|
41429
|
+
className: "Layer__BookkeepingOverview__ProfitAndLossContainer",
|
|
41365
41430
|
asWidget: true,
|
|
41366
41431
|
style: {
|
|
41367
41432
|
position: "relative",
|
|
@@ -41370,7 +41435,8 @@ var BookkeepingOverview = ({ title, showTitle = true, onClickReconnectAccounts,
|
|
|
41370
41435
|
children: [
|
|
41371
41436
|
/* @__PURE__ */ jsx(ProfitAndLoss.Header, {
|
|
41372
41437
|
text: (stringOverrides === null || stringOverrides === void 0 || (_stringOverrides$prof = stringOverrides.profitAndLoss) === null || _stringOverrides$prof === void 0 ? void 0 : _stringOverrides$prof.header) || t("common:label.profit_loss", "Profit & Loss"),
|
|
41373
|
-
withStatus: true
|
|
41438
|
+
withStatus: true,
|
|
41439
|
+
trailingContent: /* @__PURE__ */ jsx(PnlLegend, { direction: "row" })
|
|
41374
41440
|
}),
|
|
41375
41441
|
/* @__PURE__ */ jsx(VStack, {
|
|
41376
41442
|
pb: "md",
|
|
@@ -41381,7 +41447,7 @@ var BookkeepingOverview = ({ title, showTitle = true, onClickReconnectAccounts,
|
|
|
41381
41447
|
variants: profitAndLossSummariesVariants
|
|
41382
41448
|
})
|
|
41383
41449
|
}),
|
|
41384
|
-
/* @__PURE__ */ jsx(ProfitAndLoss.Chart, {})
|
|
41450
|
+
/* @__PURE__ */ jsx(ProfitAndLoss.Chart, { hideLegend: true })
|
|
41385
41451
|
]
|
|
41386
41452
|
})
|
|
41387
41453
|
}),
|
|
@@ -43493,11 +43559,13 @@ var SummaryCard = ({ slots, children, className }) => {
|
|
|
43493
43559
|
});
|
|
43494
43560
|
};
|
|
43495
43561
|
//#endregion
|
|
43496
|
-
//#region src/hooks/utils/i18n/
|
|
43497
|
-
var
|
|
43562
|
+
//#region src/hooks/utils/i18n/useGlobalDateFormatter.ts
|
|
43563
|
+
var useGlobalDateFormatter = () => {
|
|
43498
43564
|
const { formatDate } = useIntlFormatter();
|
|
43499
|
-
const { date } = useGlobalDate(
|
|
43500
|
-
return
|
|
43565
|
+
const { date } = useGlobalDate();
|
|
43566
|
+
return useCallback((format) => {
|
|
43567
|
+
return formatDate(date, format);
|
|
43568
|
+
}, [date, formatDate]);
|
|
43501
43569
|
};
|
|
43502
43570
|
//#endregion
|
|
43503
43571
|
//#region src/components/ui/SummaryCard/ExpandSummaryCardButton.tsx
|
|
@@ -43512,9 +43580,9 @@ function ExpandSummaryCardButton({ callback, ariaLabel }) {
|
|
|
43512
43580
|
}
|
|
43513
43581
|
//#endregion
|
|
43514
43582
|
//#region src/components/ui/SummaryCard/useSummaryCardSlots.tsx
|
|
43515
|
-
var useSummaryCardSlots = ({ defaultTitle, legend, interactionProps, stringOverrides }) => {
|
|
43583
|
+
var useSummaryCardSlots = ({ defaultTitle, legend, interactionProps, subtitleDateFormat = DateFormat.MonthYear, stringOverrides }) => {
|
|
43516
43584
|
const { t } = useTranslation();
|
|
43517
|
-
const
|
|
43585
|
+
const formatGlobalDate = useGlobalDateFormatter();
|
|
43518
43586
|
const { onClickExpand } = interactionProps !== null && interactionProps !== void 0 ? interactionProps : {};
|
|
43519
43587
|
return useMemo(() => {
|
|
43520
43588
|
var _stringOverrides$titl;
|
|
@@ -43524,14 +43592,15 @@ var useSummaryCardSlots = ({ defaultTitle, legend, interactionProps, stringOverr
|
|
|
43524
43592
|
}) : void 0;
|
|
43525
43593
|
return {
|
|
43526
43594
|
title: (_stringOverrides$titl = stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.title) !== null && _stringOverrides$titl !== void 0 ? _stringOverrides$titl : defaultTitle,
|
|
43527
|
-
subtitle,
|
|
43595
|
+
subtitle: formatGlobalDate(subtitleDateFormat),
|
|
43528
43596
|
legend,
|
|
43529
43597
|
primaryAction
|
|
43530
43598
|
};
|
|
43531
43599
|
}, [
|
|
43532
43600
|
stringOverrides === null || stringOverrides === void 0 ? void 0 : stringOverrides.title,
|
|
43533
43601
|
defaultTitle,
|
|
43534
|
-
|
|
43602
|
+
subtitleDateFormat,
|
|
43603
|
+
formatGlobalDate,
|
|
43535
43604
|
legend,
|
|
43536
43605
|
onClickExpand,
|
|
43537
43606
|
t
|
|
@@ -43646,55 +43715,13 @@ var MileageTrackingSummary = ({ stringOverrides, interactionProps } = {}) => {
|
|
|
43646
43715
|
slots: useSummaryCardSlots({
|
|
43647
43716
|
defaultTitle: t("mileageTracking:label.mileage_tracking", "Mileage Tracking"),
|
|
43648
43717
|
interactionProps,
|
|
43649
|
-
stringOverrides
|
|
43718
|
+
stringOverrides,
|
|
43719
|
+
subtitleDateFormat: DateFormat.Year
|
|
43650
43720
|
}),
|
|
43651
43721
|
children: /* @__PURE__ */ jsx(Content$1, {})
|
|
43652
43722
|
});
|
|
43653
43723
|
};
|
|
43654
43724
|
//#endregion
|
|
43655
|
-
//#region src/components/ProfitAndLossSummaryCard/PnlLegend.tsx
|
|
43656
|
-
var Swatch$1 = ({ className }) => /* @__PURE__ */ jsx("span", {
|
|
43657
|
-
className: `Layer__PnlLegend__Swatch ${className}`,
|
|
43658
|
-
"aria-hidden": true
|
|
43659
|
-
});
|
|
43660
|
-
var PnlLegend = ({ direction = "row" }) => {
|
|
43661
|
-
const { t } = useTranslation();
|
|
43662
|
-
return /* @__PURE__ */ jsxs(Stack, {
|
|
43663
|
-
className: "Layer__PnlLegend",
|
|
43664
|
-
direction,
|
|
43665
|
-
align: "start",
|
|
43666
|
-
gap: direction === "row" ? "md" : "2xs",
|
|
43667
|
-
pis: direction === "column" ? "md" : void 0,
|
|
43668
|
-
pbe: direction === "column" ? "md" : void 0,
|
|
43669
|
-
children: [
|
|
43670
|
-
/* @__PURE__ */ jsxs(HStack, {
|
|
43671
|
-
gap: "2xs",
|
|
43672
|
-
align: "center",
|
|
43673
|
-
children: [/* @__PURE__ */ jsx(Swatch$1, { className: "Layer__PnlLegend__Swatch--income" }), /* @__PURE__ */ jsx(Span, {
|
|
43674
|
-
size: "sm",
|
|
43675
|
-
children: t("common:label.revenue", "Revenue")
|
|
43676
|
-
})]
|
|
43677
|
-
}),
|
|
43678
|
-
/* @__PURE__ */ jsxs(HStack, {
|
|
43679
|
-
gap: "2xs",
|
|
43680
|
-
align: "center",
|
|
43681
|
-
children: [/* @__PURE__ */ jsx(Swatch$1, { className: "Layer__PnlLegend__Swatch--expenses" }), /* @__PURE__ */ jsx(Span, {
|
|
43682
|
-
size: "sm",
|
|
43683
|
-
children: t("common:label.expenses", "Expenses")
|
|
43684
|
-
})]
|
|
43685
|
-
}),
|
|
43686
|
-
/* @__PURE__ */ jsxs(HStack, {
|
|
43687
|
-
gap: "2xs",
|
|
43688
|
-
align: "center",
|
|
43689
|
-
children: [/* @__PURE__ */ jsx(Swatch$1, { className: "Layer__PnlLegend__Swatch--uncategorized" }), /* @__PURE__ */ jsx(Span, {
|
|
43690
|
-
size: "sm",
|
|
43691
|
-
children: t("common:label.uncategorized", "Uncategorized")
|
|
43692
|
-
})]
|
|
43693
|
-
})
|
|
43694
|
-
]
|
|
43695
|
-
});
|
|
43696
|
-
};
|
|
43697
|
-
//#endregion
|
|
43698
43725
|
//#region src/components/ProfitAndLossSummaryCard/ProfitAndLossSummaryCard.tsx
|
|
43699
43726
|
var ProfitAndLossSummaryCard = ({ interactionProps, stringOverrides, className }) => {
|
|
43700
43727
|
const { t } = useTranslation();
|
|
@@ -43876,33 +43903,39 @@ var getOnboardingBannerState = ({ isLoading, hasLinkedAccounts, hasSavedTaxProfi
|
|
|
43876
43903
|
var NoBankAccountsLinkedBanner = () => {
|
|
43877
43904
|
const { addConnection } = useContext(LinkedAccountsContext);
|
|
43878
43905
|
const { isMobile } = useSizeClass();
|
|
43906
|
+
const { t } = useTranslation();
|
|
43879
43907
|
const handleLinkBankAccounts = useCallback(() => {
|
|
43880
43908
|
addConnection("PLAID");
|
|
43881
43909
|
}, [addConnection]);
|
|
43910
|
+
const Icon = isMobile ? null : /* @__PURE__ */ jsx(Info, { size: 16 });
|
|
43911
|
+
const title = t("linkedAccounts:label.link_your_bank_accounts", "Link your bank accounts");
|
|
43882
43912
|
return /* @__PURE__ */ jsx(Banner, {
|
|
43883
|
-
title
|
|
43884
|
-
description: "Linking your bank accounts allows us to load your bank transactions and automatically categorize them.",
|
|
43913
|
+
title,
|
|
43914
|
+
description: t("linkedAccounts:label.link_your_bank_accounts_description", "Linking your bank accounts allows us to load your bank transactions and automatically categorize them."),
|
|
43885
43915
|
slots: {
|
|
43886
|
-
Icon
|
|
43916
|
+
Icon,
|
|
43887
43917
|
Button: /* @__PURE__ */ jsx(Button$1, {
|
|
43888
43918
|
onPress: handleLinkBankAccounts,
|
|
43889
43919
|
variant: "outlined-light",
|
|
43890
|
-
children:
|
|
43920
|
+
children: title
|
|
43891
43921
|
})
|
|
43892
43922
|
}
|
|
43893
43923
|
});
|
|
43894
43924
|
};
|
|
43895
43925
|
var NoTaxProfileBanner = ({ onSetupTaxProfile }) => {
|
|
43896
43926
|
const { isMobile } = useSizeClass();
|
|
43927
|
+
const { t } = useTranslation();
|
|
43928
|
+
const Icon = isMobile ? null : /* @__PURE__ */ jsx(Info, { size: 16 });
|
|
43929
|
+
const title = t("linkedAccounts:label.setup_your_tax_profile", "Set up your tax profile");
|
|
43897
43930
|
return /* @__PURE__ */ jsx(Banner, {
|
|
43898
|
-
title
|
|
43899
|
-
description: "Configuring your tax profile allows us to provide you with tax estimates and avoid any surprises come tax time.",
|
|
43931
|
+
title,
|
|
43932
|
+
description: t("linkedAccounts:label.setup_your_tax_profile_description", "Configuring your tax profile allows us to provide you with tax estimates and avoid any surprises come tax time."),
|
|
43900
43933
|
slots: {
|
|
43901
|
-
Icon
|
|
43934
|
+
Icon,
|
|
43902
43935
|
Button: onSetupTaxProfile ? /* @__PURE__ */ jsx(Button$1, {
|
|
43903
43936
|
onPress: onSetupTaxProfile,
|
|
43904
43937
|
variant: "outlined-light",
|
|
43905
|
-
children:
|
|
43938
|
+
children: title
|
|
43906
43939
|
}) : null
|
|
43907
43940
|
}
|
|
43908
43941
|
});
|
|
@@ -44520,7 +44553,8 @@ var TaxEstimatesSummaryCard = ({ mode = TaxEstimatesSummaryCardMode.PieChart, in
|
|
|
44520
44553
|
const slots = useSummaryCardSlots({
|
|
44521
44554
|
defaultTitle,
|
|
44522
44555
|
interactionProps,
|
|
44523
|
-
stringOverrides
|
|
44556
|
+
stringOverrides,
|
|
44557
|
+
subtitleDateFormat: DateFormat.Year
|
|
44524
44558
|
});
|
|
44525
44559
|
return /* @__PURE__ */ jsx(SummaryCard, {
|
|
44526
44560
|
className: classNames("Layer__TaxEstimatesSummaryCard", isSummaryCardLayout && "Layer__TaxEstimatesSummaryCard--summaryCard"),
|
|
@@ -44992,11 +45026,11 @@ var taxDetailsRowFields = {
|
|
|
44992
45026
|
var TaxDetailsRowSchema = Schema.Struct(_objectSpread2(_objectSpread2({}, taxDetailsRowFields), {}, { breakdown: Schema.optional(Schema.Array(Schema.suspend(() => TaxDetailsRowSchema))) }));
|
|
44993
45027
|
var TaxDetailsMetaSchema = Schema.Struct({
|
|
44994
45028
|
year: Schema.Number,
|
|
45029
|
+
state: TransformedTaxSummaryStateSchema,
|
|
44995
45030
|
filingStatus: pipe(Schema.propertySignature(Schema.String), Schema.fromKey("filing_status"))
|
|
44996
45031
|
});
|
|
44997
45032
|
var TaxDetailsSchema = Schema.Struct({
|
|
44998
45033
|
type: Schema.String,
|
|
44999
|
-
state: TransformedTaxSummaryStateSchema,
|
|
45000
45034
|
meta: TaxDetailsMetaSchema,
|
|
45001
45035
|
rows: Schema.Array(TaxDetailsRowSchema)
|
|
45002
45036
|
});
|