@wealthx/shadcn 1.5.41 → 1.5.43
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/.turbo/turbo-build.log +204 -199
- package/CHANGELOG.md +12 -0
- package/dist/{chunk-5FHBC6DY.mjs → chunk-33WZ5NCW.mjs} +1 -1
- package/dist/{chunk-C35JMOII.mjs → chunk-3G6JUYRE.mjs} +4 -4
- package/dist/{chunk-LBXIYS34.mjs → chunk-4PVCJ3JD.mjs} +1 -1
- package/dist/{chunk-EHQL64B7.mjs → chunk-4SUXTO2Z.mjs} +4 -4
- package/dist/{chunk-BAONSY54.mjs → chunk-5RYH7SOQ.mjs} +1 -1
- package/dist/{chunk-3C4DZTGA.mjs → chunk-5XD7A7YC.mjs} +1 -1
- package/dist/{chunk-5DAQU3B6.mjs → chunk-66JXT7NY.mjs} +1 -1
- package/dist/{chunk-NGKTJRFN.mjs → chunk-6DO4EGT2.mjs} +2 -2
- package/dist/{chunk-C7ZTZTEW.mjs → chunk-6XJWL2E5.mjs} +1 -1
- package/dist/{chunk-FQUT5XD6.mjs → chunk-A4UP4QFB.mjs} +1 -1
- package/dist/{chunk-USIRKDYQ.mjs → chunk-BFCX7ADE.mjs} +1 -1
- package/dist/{chunk-XGRSPFFC.mjs → chunk-CQHKU24Z.mjs} +1 -1
- package/dist/{chunk-HONTZFLO.mjs → chunk-DP4ER6TJ.mjs} +1 -1
- package/dist/{chunk-VLVEZHFE.mjs → chunk-EFSLAMHI.mjs} +4 -4
- package/dist/{chunk-FYZBGWYR.mjs → chunk-FVSOFXJQ.mjs} +1 -1
- package/dist/{chunk-JUMEIPII.mjs → chunk-G2MOZZPE.mjs} +8 -8
- package/dist/{chunk-D3HKFRQO.mjs → chunk-GQWKBESP.mjs} +8 -5
- package/dist/{chunk-MD66TGX7.mjs → chunk-GXDKWCMV.mjs} +1 -1
- package/dist/{chunk-77L3UPBW.mjs → chunk-H7NOUDU3.mjs} +5 -5
- package/dist/{chunk-4LLTZ45R.mjs → chunk-HOXTEU5K.mjs} +8 -7
- package/dist/{chunk-ZA37ZWZW.mjs → chunk-IXW77PMI.mjs} +7 -7
- package/dist/{chunk-XHZONBL4.mjs → chunk-JLEQU5BO.mjs} +1 -1
- package/dist/{chunk-6UKOJLXO.mjs → chunk-JSFWRD7K.mjs} +4 -4
- package/dist/{chunk-7PTRHNUV.mjs → chunk-JY3FUGNL.mjs} +1 -1
- package/dist/{chunk-3ZU5BH6X.mjs → chunk-KEOAPKJO.mjs} +3 -3
- package/dist/{chunk-4QTHK7ML.mjs → chunk-KWYFJQV6.mjs} +1 -1
- package/dist/{chunk-FGMDBJCF.mjs → chunk-LDPCSE7J.mjs} +4 -4
- package/dist/chunk-LFWNKXZU.mjs +109 -0
- package/dist/{chunk-IRZWYTGV.mjs → chunk-M32YSAWL.mjs} +8 -7
- package/dist/{chunk-LLAGF6BA.mjs → chunk-MUB2G36A.mjs} +1 -1
- package/dist/{chunk-DQNNP6I4.mjs → chunk-NIETQFJQ.mjs} +1 -1
- package/dist/{chunk-RUX3OLVZ.mjs → chunk-OTFG57ZF.mjs} +1 -1
- package/dist/{chunk-OKIWXOJL.mjs → chunk-OWTW5WAJ.mjs} +1 -1
- package/dist/{chunk-WWIWRNBK.mjs → chunk-P7NSCTAW.mjs} +1 -1
- package/dist/{chunk-BZWQU52U.mjs → chunk-QZREZL2F.mjs} +1 -1
- package/dist/{chunk-E432NK23.mjs → chunk-RBQ4BZUV.mjs} +6 -6
- package/dist/{chunk-I2EKKSEF.mjs → chunk-RKBLVNDC.mjs} +4 -7
- package/dist/{chunk-LHQACMZY.mjs → chunk-SPPQFW32.mjs} +106 -50
- package/dist/{chunk-OSSS56CB.mjs → chunk-SUXJWKRI.mjs} +4 -4
- package/dist/{chunk-SCGCGVDN.mjs → chunk-SZXIPE5J.mjs} +1 -1
- package/dist/{chunk-GIQGZFP6.mjs → chunk-THOHFAW2.mjs} +28 -12
- package/dist/{chunk-VVURVETY.mjs → chunk-TOQRA2TD.mjs} +1 -1
- package/dist/{chunk-GYWOD2YI.mjs → chunk-TZSDYQFH.mjs} +4 -4
- package/dist/{chunk-S7SBLNX4.mjs → chunk-UB3WG6I4.mjs} +1 -1
- package/dist/{chunk-PGJRZHN7.mjs → chunk-UVZ3JWFG.mjs} +1 -1
- package/dist/{chunk-UD5UF5OC.mjs → chunk-W7OPFKTZ.mjs} +4 -4
- package/dist/{chunk-YEWNFK5S.mjs → chunk-WLXP4OOF.mjs} +5 -5
- package/dist/{chunk-ORMC3TV3.mjs → chunk-XYXYTTNW.mjs} +1 -1
- package/dist/{chunk-CZOGJC76.mjs → chunk-YACFZWRR.mjs} +7 -7
- package/dist/{chunk-UTCW5YUX.mjs → chunk-YPATB6YQ.mjs} +9 -9
- package/dist/{chunk-BZGFW6L7.mjs → chunk-YWJAIPUA.mjs} +1 -1
- package/dist/{chunk-MHBQJVHE.mjs → chunk-Z65BGSHI.mjs} +5 -5
- package/dist/{chunk-PCULNQWA.mjs → chunk-ZGSFRUVI.mjs} +3 -3
- package/dist/{chunk-7NQKFPXE.mjs → chunk-ZRYG6ICN.mjs} +1 -1
- package/dist/{chunk-ZFKAYRFQ.mjs → chunk-ZUHFYW65.mjs} +1 -1
- package/dist/components/ui/about-you-form.mjs +2 -2
- package/dist/components/ui/account-list-carousel.mjs +2 -2
- package/dist/components/ui/add-column-modal.mjs +4 -4
- package/dist/components/ui/add-lead-modal.mjs +4 -4
- package/dist/components/ui/advisor-card.mjs +2 -2
- package/dist/components/ui/ai-assistant-drawer.mjs +2 -2
- package/dist/components/ui/ai-builder/index.mjs +4 -4
- package/dist/components/ui/ai-conversations/index.mjs +4 -4
- package/dist/components/ui/alert-dialog.mjs +3 -3
- package/dist/components/ui/applicant-expenses-section.mjs +1 -1
- package/dist/components/ui/appointment-action-dialogs.mjs +5 -5
- package/dist/components/ui/appointment-availability-settings.mjs +4 -4
- package/dist/components/ui/appointment-book-dialog.mjs +4 -4
- package/dist/components/ui/appointment-detail-sheet.mjs +6 -6
- package/dist/components/ui/appointment-upcoming-card.mjs +4 -4
- package/dist/components/ui/asset-accordion.mjs +7 -7
- package/dist/components/ui/assets-liabilities-side-card.js +19 -66
- package/dist/components/ui/assets-liabilities-side-card.mjs +22 -69
- package/dist/components/ui/backoffice-alert-history-chart.js +1 -1
- package/dist/components/ui/backoffice-alert-history-chart.mjs +5 -5
- package/dist/components/ui/backoffice-alert-matching-chart.js +1 -1
- package/dist/components/ui/backoffice-alert-matching-chart.mjs +5 -5
- package/dist/components/ui/backoffice-alerts-chart.js +1 -1
- package/dist/components/ui/backoffice-alerts-chart.mjs +5 -5
- package/dist/components/ui/backoffice-connections-chart.js +1 -1
- package/dist/components/ui/backoffice-connections-chart.mjs +5 -5
- package/dist/components/ui/backoffice-contact-history-chart.js +1 -1
- package/dist/components/ui/backoffice-contact-history-chart.mjs +5 -5
- package/dist/components/ui/backoffice-contact-matching-chart.js +1 -1
- package/dist/components/ui/backoffice-contact-matching-chart.mjs +5 -5
- package/dist/components/ui/backoffice-signup-steps.mjs +4 -4
- package/dist/components/ui/bank-statement-generate-dialog.mjs +4 -4
- package/dist/components/ui/bank-statement-pdf-viewer.mjs +4 -4
- package/dist/components/ui/borrowing-capacity-atoms.js +3 -6
- package/dist/components/ui/borrowing-capacity-atoms.mjs +2 -2
- package/dist/components/ui/borrowing-capacity-card.js +5 -5
- package/dist/components/ui/borrowing-capacity-card.mjs +6 -6
- package/dist/components/ui/borrowing-capacity-line-chart.js +5 -5
- package/dist/components/ui/borrowing-capacity-line-chart.mjs +5 -5
- package/dist/components/ui/calculator-section.mjs +4 -4
- package/dist/components/ui/cash-balance-line-chart.js +102 -46
- package/dist/components/ui/cash-balance-line-chart.mjs +5 -5
- package/dist/components/ui/cashflow-bar-chart.js +7 -4
- package/dist/components/ui/cashflow-bar-chart.mjs +5 -5
- package/dist/components/ui/category-edit-dialog.mjs +4 -4
- package/dist/components/ui/color-picker.mjs +2 -2
- package/dist/components/ui/contact-alert-dialog/index.mjs +4 -4
- package/dist/components/ui/create-contact-modal.mjs +4 -4
- package/dist/components/ui/csv-import-modal.mjs +4 -4
- package/dist/components/ui/dashboard-expense-categories.js +96 -63
- package/dist/components/ui/dashboard-expense-categories.mjs +101 -66
- package/dist/components/ui/dashboard-transactions-table.js +37 -44
- package/dist/components/ui/dashboard-transactions-table.mjs +45 -52
- package/dist/components/ui/data-table.mjs +2 -2
- package/dist/components/ui/date-picker.mjs +2 -2
- package/dist/components/ui/debt-accordion.mjs +7 -7
- package/dist/components/ui/delete-contact-component.mjs +4 -4
- package/dist/components/ui/dialog.mjs +3 -3
- package/dist/components/ui/document-checklist-template.mjs +2 -2
- package/dist/components/ui/expense-bar-chart.js +8 -7
- package/dist/components/ui/expense-bar-chart.mjs +5 -5
- package/dist/components/ui/expense-categories-bar.js +261 -0
- package/dist/components/ui/expense-categories-bar.mjs +12 -0
- package/dist/components/ui/expense-work-details.js +8 -7
- package/dist/components/ui/expense-work-details.mjs +7 -7
- package/dist/components/ui/file-preview-dialog.mjs +4 -4
- package/dist/components/ui/financial-cards.mjs +2 -2
- package/dist/components/ui/financial-drawers.mjs +2 -2
- package/dist/components/ui/financial-sections.mjs +3 -3
- package/dist/components/ui/frontend-signup-steps.mjs +2 -2
- package/dist/components/ui/income-bar-chart.js +8 -7
- package/dist/components/ui/income-bar-chart.mjs +5 -5
- package/dist/components/ui/income-sources-card.mjs +1 -1
- package/dist/components/ui/income-summary-component.mjs +1 -1
- package/dist/components/ui/income-work-details.js +8 -7
- package/dist/components/ui/income-work-details.mjs +6 -6
- package/dist/components/ui/incoming-outgoings-card.js +2 -2
- package/dist/components/ui/incoming-outgoings-card.mjs +3 -3
- package/dist/components/ui/interest-rate-section.mjs +1 -1
- package/dist/components/ui/kanban-column.mjs +5 -5
- package/dist/components/ui/loan-application-cards.mjs +3 -3
- package/dist/components/ui/loan-financials.mjs +3 -3
- package/dist/components/ui/money-input-with-slider.mjs +2 -2
- package/dist/components/ui/opportunity-card.mjs +4 -4
- package/dist/components/ui/opportunity-edit-modals.mjs +4 -4
- package/dist/components/ui/opportunity-summary-tab.mjs +8 -8
- package/dist/components/ui/pagination.mjs +2 -2
- package/dist/components/ui/pipeline-board.mjs +6 -6
- package/dist/components/ui/pipeline-chart.mjs +2 -2
- package/dist/components/ui/pipeline-dialogs.mjs +4 -4
- package/dist/components/ui/policy-ai/index.mjs +2 -2
- package/dist/components/ui/property-asset-card.mjs +4 -4
- package/dist/components/ui/property-cashflow-doughnut-chart.js +3 -3
- package/dist/components/ui/property-cashflow-doughnut-chart.mjs +5 -5
- package/dist/components/ui/property-debt-equity-doughnut-chart.js +3 -3
- package/dist/components/ui/property-debt-equity-doughnut-chart.mjs +5 -5
- package/dist/components/ui/property-list-carousel.mjs +2 -2
- package/dist/components/ui/property-mobile-estimate-line-chart.js +4 -4
- package/dist/components/ui/property-mobile-estimate-line-chart.mjs +5 -5
- package/dist/components/ui/property-report-dialog.mjs +5 -5
- package/dist/components/ui/resource-center/index.mjs +4 -4
- package/dist/components/ui/review-alerts-dialog.mjs +4 -4
- package/dist/components/ui/savings-goal-modal.mjs +7 -7
- package/dist/components/ui/scenario-drawer.mjs +4 -4
- package/dist/components/ui/scenario-list.js +4 -7
- package/dist/components/ui/scenario-list.mjs +5 -5
- package/dist/components/ui/share-details-dialog.mjs +4 -4
- package/dist/components/ui/sidebar-nav.mjs +4 -4
- package/dist/components/ui/signup-form-primitives.mjs +2 -2
- package/dist/components/ui/stage-timeline.mjs +1 -1
- package/dist/components/ui/support-agent/index.js +27 -11
- package/dist/components/ui/support-agent/index.mjs +3 -3
- package/dist/components/ui/top-three-product.mjs +1 -1
- package/dist/components/ui/transactions-expense-categories-doughnut-chart.js +3 -3
- package/dist/components/ui/transactions-expense-categories-doughnut-chart.mjs +5 -5
- package/dist/components/ui/transactions-income-expense-bar-chart.mjs +5 -5
- package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.js +4 -4
- package/dist/components/ui/transactions-liabilities-breakdown-doughnut-chart.mjs +5 -5
- package/dist/components/ui/transactions-summary-block.js +13 -0
- package/dist/components/ui/transactions-summary-block.mjs +13 -0
- package/dist/index.js +2119 -1946
- package/dist/index.mjs +139 -135
- package/dist/lib/format-currency.js +54 -0
- package/dist/lib/format-currency.mjs +9 -0
- package/dist/styles.css +1 -1
- package/package.json +6 -1
- package/src/component-descriptions/assets-liabilities-side-card.md +19 -0
- package/src/component-descriptions/pipeline-chart.md +17 -0
- package/src/components/index.tsx +6 -0
- package/src/components/ui/assets-liabilities-side-card.tsx +43 -83
- package/src/components/ui/borrowing-capacity-atoms.tsx +4 -7
- package/src/components/ui/borrowing-capacity-line-chart.tsx +4 -4
- package/src/components/ui/cash-balance-line-chart.tsx +123 -42
- package/src/components/ui/cashflow-bar-chart.tsx +7 -4
- package/src/components/ui/chart-shared.tsx +4 -4
- package/src/components/ui/dashboard-expense-categories.tsx +136 -60
- package/src/components/ui/dashboard-transactions-table.tsx +42 -28
- package/src/components/ui/expense-bar-chart.tsx +32 -19
- package/src/components/ui/expense-categories-bar.tsx +178 -0
- package/src/components/ui/income-bar-chart.tsx +32 -19
- package/src/components/ui/incoming-outgoings-card.tsx +2 -2
- package/src/components/ui/property-mobile-estimate-line-chart.tsx +4 -4
- package/src/components/ui/scenario-list.tsx +2 -2
- package/src/components/ui/support-agent/support-agent-panel.tsx +40 -11
- package/src/components/ui/transactions-liabilities-breakdown-doughnut-chart.tsx +7 -5
- package/src/components/ui/transactions-summary-block.tsx +39 -6
- package/src/styles/styles-css.ts +1 -1
- package/tsup.config.ts +2 -0
- package/dist/{chunk-CEYEK3TI.mjs → chunk-B4R62ID3.mjs} +3 -3
- package/dist/{chunk-7LN5OGC2.mjs → chunk-E3VAK4EB.mjs} +3 -3
- package/dist/{chunk-EY36WDCF.mjs → chunk-EEZFXE3P.mjs} +3 -3
- package/dist/{chunk-T5FRVEJQ.mjs → chunk-JTMN36BK.mjs} +3 -3
- /package/dist/{chunk-MN5NYQCL.mjs → chunk-XQDTFNVL.mjs} +0 -0
|
@@ -187,12 +187,22 @@ function formatCurrency(value, options) {
|
|
|
187
187
|
|
|
188
188
|
// src/components/ui/dashboard-expense-categories.tsx
|
|
189
189
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
190
|
-
|
|
190
|
+
var SECONDARY_ACTIVE_BG = "color-mix(in oklch, var(--brand-secondary) 8%, transparent)";
|
|
191
|
+
var SECONDARY_ACTIVE_HOVER_BG = "color-mix(in oklch, var(--brand-secondary) 12%, transparent)";
|
|
192
|
+
function ProgressBar({
|
|
193
|
+
pct,
|
|
194
|
+
className,
|
|
195
|
+
colorScheme = "primary"
|
|
196
|
+
}) {
|
|
191
197
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("div", { className: cn("h-1.5 w-full overflow-hidden bg-muted", className), children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
192
198
|
"div",
|
|
193
199
|
{
|
|
194
200
|
className: "h-full bg-primary transition-all",
|
|
195
|
-
style: {
|
|
201
|
+
style: __spreadValues({
|
|
202
|
+
width: `${Math.min(100, Math.max(0, pct))}%`
|
|
203
|
+
}, colorScheme === "secondary" && {
|
|
204
|
+
backgroundColor: "var(--brand-secondary)"
|
|
205
|
+
}),
|
|
196
206
|
"aria-hidden": "true"
|
|
197
207
|
}
|
|
198
208
|
) });
|
|
@@ -200,32 +210,49 @@ function ProgressBar({ pct, className }) {
|
|
|
200
210
|
function SubCategoryRow({
|
|
201
211
|
sub,
|
|
202
212
|
isSelected,
|
|
213
|
+
colorScheme = "primary",
|
|
203
214
|
onClick
|
|
204
215
|
}) {
|
|
216
|
+
const isSecondary = colorScheme === "secondary";
|
|
205
217
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
206
|
-
"
|
|
218
|
+
"div",
|
|
207
219
|
{
|
|
208
|
-
type: "button",
|
|
209
|
-
onClick,
|
|
210
220
|
className: cn(
|
|
211
|
-
"flex w-full flex-col gap-1 py-1.5 pl-8
|
|
212
|
-
isSelected
|
|
221
|
+
"flex w-full flex-col gap-1 py-1.5 pl-8",
|
|
222
|
+
isSelected && !isSecondary && "bg-primary/5"
|
|
213
223
|
),
|
|
224
|
+
style: isSelected && isSecondary ? { backgroundColor: SECONDARY_ACTIVE_BG } : void 0,
|
|
214
225
|
children: [
|
|
215
226
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center justify-between gap-2 text-xs", children: [
|
|
216
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
227
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
228
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
229
|
+
"span",
|
|
230
|
+
{
|
|
231
|
+
className: cn(
|
|
232
|
+
"truncate text-muted-foreground",
|
|
233
|
+
isSelected && "font-medium"
|
|
234
|
+
),
|
|
235
|
+
children: sub.name
|
|
236
|
+
}
|
|
237
|
+
),
|
|
238
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
239
|
+
"button",
|
|
240
|
+
{
|
|
241
|
+
type: "button",
|
|
242
|
+
onClick,
|
|
243
|
+
"aria-label": `Filter by ${sub.name}`,
|
|
244
|
+
"aria-pressed": isSelected,
|
|
245
|
+
className: cn(
|
|
246
|
+
"shrink-0 transition-colors",
|
|
247
|
+
isSelected ? isSecondary ? "text-[var(--brand-secondary)]" : "text-primary" : "text-muted-foreground/50 hover:text-muted-foreground"
|
|
248
|
+
),
|
|
249
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.ListFilter, { size: 12 })
|
|
250
|
+
}
|
|
251
|
+
)
|
|
252
|
+
] }),
|
|
226
253
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "shrink-0 font-medium text-foreground", children: formatCurrency(sub.amount) })
|
|
227
254
|
] }),
|
|
228
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ProgressBar, { pct: sub.pct })
|
|
255
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(ProgressBar, { pct: sub.pct, colorScheme })
|
|
229
256
|
]
|
|
230
257
|
}
|
|
231
258
|
);
|
|
@@ -233,68 +260,67 @@ function SubCategoryRow({
|
|
|
233
260
|
function CategoryRow({
|
|
234
261
|
item,
|
|
235
262
|
selectedCategoryId,
|
|
263
|
+
colorScheme = "primary",
|
|
236
264
|
onFilterClick
|
|
237
265
|
}) {
|
|
238
266
|
var _a, _b, _c, _d;
|
|
239
267
|
const [expanded, setExpanded] = (0, import_react.useState)(false);
|
|
268
|
+
const [hovered, setHovered] = (0, import_react.useState)(false);
|
|
240
269
|
const hasChildren = ((_b = (_a = item.subCategories) == null ? void 0 : _a.length) != null ? _b : 0) > 0;
|
|
241
270
|
const isSelected = selectedCategoryId === item.id;
|
|
242
|
-
const isChildSelected = hasChildren
|
|
271
|
+
const isChildSelected = hasChildren && ((_d = (_c = item.subCategories) == null ? void 0 : _c.some((s) => s.id === selectedCategoryId)) != null ? _d : false);
|
|
243
272
|
const isActive = isSelected || isChildSelected;
|
|
273
|
+
const isSecondary = colorScheme === "secondary";
|
|
274
|
+
const wrapperStyle = isSecondary && isActive ? {
|
|
275
|
+
backgroundColor: hovered ? SECONDARY_ACTIVE_HOVER_BG : SECONDARY_ACTIVE_BG
|
|
276
|
+
} : void 0;
|
|
244
277
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
245
278
|
"div",
|
|
246
279
|
{
|
|
247
280
|
className: cn(
|
|
248
281
|
"border-b border-border last:border-0 transition-colors",
|
|
249
|
-
isActive && "bg-primary/5"
|
|
282
|
+
isActive && !isSecondary && "bg-primary/5"
|
|
250
283
|
),
|
|
284
|
+
style: wrapperStyle,
|
|
251
285
|
children: [
|
|
252
286
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(
|
|
253
287
|
"button",
|
|
254
288
|
{
|
|
255
289
|
type: "button",
|
|
256
290
|
className: cn(
|
|
257
|
-
"flex w-full items-start gap-3 py-3 text-left
|
|
258
|
-
|
|
291
|
+
"flex w-full items-start gap-3 py-3 text-left transition-colors",
|
|
292
|
+
!isSecondary && "hover:bg-muted/40",
|
|
293
|
+
!isSecondary && isActive && "hover:bg-primary/10"
|
|
259
294
|
),
|
|
260
|
-
|
|
261
|
-
|
|
295
|
+
onMouseEnter: () => setHovered(true),
|
|
296
|
+
onMouseLeave: () => setHovered(false),
|
|
297
|
+
onClick: () => hasChildren && setExpanded((v) => !v),
|
|
298
|
+
"aria-expanded": hasChildren ? expanded : void 0,
|
|
262
299
|
children: [
|
|
263
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
264
|
-
|
|
265
|
-
{
|
|
266
|
-
className: "mt-0.5 shrink-0 text-muted-foreground",
|
|
267
|
-
onClick: (e) => {
|
|
268
|
-
if (!hasChildren) return;
|
|
269
|
-
e.stopPropagation();
|
|
270
|
-
setExpanded((v) => !v);
|
|
271
|
-
},
|
|
272
|
-
"aria-label": expanded ? "Collapse" : "Expand",
|
|
273
|
-
children: hasChildren ? expanded ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.ChevronDown, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.ChevronRight, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "inline-block size-3.5" })
|
|
274
|
-
}
|
|
275
|
-
),
|
|
276
|
-
item.icon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
277
|
-
"span",
|
|
278
|
-
{
|
|
279
|
-
className: cn(
|
|
280
|
-
"mt-0.5 shrink-0",
|
|
281
|
-
isActive ? "text-primary" : "text-muted-foreground"
|
|
282
|
-
),
|
|
283
|
-
children: item.icon
|
|
284
|
-
}
|
|
285
|
-
),
|
|
300
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "mt-0.5 shrink-0 text-muted-foreground", children: hasChildren ? expanded ? /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.ChevronDown, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.ChevronRight, { size: 14 }) : /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "inline-block size-3.5" }) }),
|
|
301
|
+
item.icon && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "mt-0.5 shrink-0 text-muted-foreground", children: item.icon }),
|
|
286
302
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
287
303
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-center justify-between gap-2", children: [
|
|
288
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.
|
|
289
|
-
"span",
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
304
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
305
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "truncate text-sm font-medium text-foreground", children: item.name }),
|
|
306
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
307
|
+
"button",
|
|
308
|
+
{
|
|
309
|
+
type: "button",
|
|
310
|
+
onClick: (e) => {
|
|
311
|
+
e.stopPropagation();
|
|
312
|
+
onFilterClick(isSelected ? null : item.id);
|
|
313
|
+
},
|
|
314
|
+
"aria-label": `Filter by ${item.name}`,
|
|
315
|
+
"aria-pressed": isSelected,
|
|
316
|
+
className: cn(
|
|
317
|
+
"shrink-0 transition-colors",
|
|
318
|
+
isActive ? isSecondary ? "text-[var(--brand-secondary)]" : "text-primary" : "text-muted-foreground/50 hover:text-muted-foreground"
|
|
319
|
+
),
|
|
320
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_lucide_react2.ListFilter, { size: 13 })
|
|
321
|
+
}
|
|
322
|
+
)
|
|
323
|
+
] }),
|
|
298
324
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
299
325
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("span", { className: "text-xs text-muted-foreground", children: [
|
|
300
326
|
item.pct.toFixed(0),
|
|
@@ -303,7 +329,14 @@ function CategoryRow({
|
|
|
303
329
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { className: "text-sm font-semibold text-foreground", children: formatCurrency(item.amount) })
|
|
304
330
|
] })
|
|
305
331
|
] }),
|
|
306
|
-
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
332
|
+
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
333
|
+
ProgressBar,
|
|
334
|
+
{
|
|
335
|
+
pct: item.pct,
|
|
336
|
+
className: "mt-1.5",
|
|
337
|
+
colorScheme
|
|
338
|
+
}
|
|
339
|
+
)
|
|
307
340
|
] })
|
|
308
341
|
]
|
|
309
342
|
}
|
|
@@ -313,6 +346,7 @@ function CategoryRow({
|
|
|
313
346
|
{
|
|
314
347
|
sub,
|
|
315
348
|
isSelected: selectedCategoryId === sub.id,
|
|
349
|
+
colorScheme,
|
|
316
350
|
onClick: () => onFilterClick(selectedCategoryId === sub.id ? null : sub.id)
|
|
317
351
|
},
|
|
318
352
|
sub.id
|
|
@@ -328,11 +362,9 @@ function DashboardExpenseCategories({
|
|
|
328
362
|
isLoading = false,
|
|
329
363
|
className,
|
|
330
364
|
selectedCategoryId,
|
|
331
|
-
onCategorySelect
|
|
365
|
+
onCategorySelect,
|
|
366
|
+
colorScheme = "primary"
|
|
332
367
|
}) {
|
|
333
|
-
const handleFilterClick = (id) => {
|
|
334
|
-
onCategorySelect == null ? void 0 : onCategorySelect(id);
|
|
335
|
-
};
|
|
336
368
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(Card, { className: cn("flex flex-col", className), children: [
|
|
337
369
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CardHeader, { className: "pb-2", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)("div", { className: "flex items-baseline justify-between gap-2", children: [
|
|
338
370
|
/* @__PURE__ */ (0, import_jsx_runtime3.jsx)(CardTitle, { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: title }),
|
|
@@ -343,7 +375,8 @@ function DashboardExpenseCategories({
|
|
|
343
375
|
{
|
|
344
376
|
item,
|
|
345
377
|
selectedCategoryId,
|
|
346
|
-
|
|
378
|
+
colorScheme,
|
|
379
|
+
onFilterClick: (id) => onCategorySelect == null ? void 0 : onCategorySelect(id)
|
|
347
380
|
},
|
|
348
381
|
item.id
|
|
349
382
|
)) }) })
|
|
@@ -9,22 +9,34 @@ import {
|
|
|
9
9
|
} from "../../chunk-JVMXMFBB.mjs";
|
|
10
10
|
import {
|
|
11
11
|
formatCurrency
|
|
12
|
-
} from "../../chunk-
|
|
12
|
+
} from "../../chunk-XQDTFNVL.mjs";
|
|
13
13
|
import {
|
|
14
14
|
cn
|
|
15
15
|
} from "../../chunk-AFML43VJ.mjs";
|
|
16
|
-
import
|
|
16
|
+
import {
|
|
17
|
+
__spreadValues
|
|
18
|
+
} from "../../chunk-WNQUEZJF.mjs";
|
|
17
19
|
|
|
18
20
|
// src/components/ui/dashboard-expense-categories.tsx
|
|
19
21
|
import { useState } from "react";
|
|
20
|
-
import { ChevronDown, ChevronRight } from "lucide-react";
|
|
22
|
+
import { ChevronDown, ChevronRight, ListFilter } from "lucide-react";
|
|
21
23
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
|
-
|
|
24
|
+
var SECONDARY_ACTIVE_BG = "color-mix(in oklch, var(--brand-secondary) 8%, transparent)";
|
|
25
|
+
var SECONDARY_ACTIVE_HOVER_BG = "color-mix(in oklch, var(--brand-secondary) 12%, transparent)";
|
|
26
|
+
function ProgressBar({
|
|
27
|
+
pct,
|
|
28
|
+
className,
|
|
29
|
+
colorScheme = "primary"
|
|
30
|
+
}) {
|
|
23
31
|
return /* @__PURE__ */ jsx("div", { className: cn("h-1.5 w-full overflow-hidden bg-muted", className), children: /* @__PURE__ */ jsx(
|
|
24
32
|
"div",
|
|
25
33
|
{
|
|
26
34
|
className: "h-full bg-primary transition-all",
|
|
27
|
-
style: {
|
|
35
|
+
style: __spreadValues({
|
|
36
|
+
width: `${Math.min(100, Math.max(0, pct))}%`
|
|
37
|
+
}, colorScheme === "secondary" && {
|
|
38
|
+
backgroundColor: "var(--brand-secondary)"
|
|
39
|
+
}),
|
|
28
40
|
"aria-hidden": "true"
|
|
29
41
|
}
|
|
30
42
|
) });
|
|
@@ -32,32 +44,49 @@ function ProgressBar({ pct, className }) {
|
|
|
32
44
|
function SubCategoryRow({
|
|
33
45
|
sub,
|
|
34
46
|
isSelected,
|
|
47
|
+
colorScheme = "primary",
|
|
35
48
|
onClick
|
|
36
49
|
}) {
|
|
50
|
+
const isSecondary = colorScheme === "secondary";
|
|
37
51
|
return /* @__PURE__ */ jsxs(
|
|
38
|
-
"
|
|
52
|
+
"div",
|
|
39
53
|
{
|
|
40
|
-
type: "button",
|
|
41
|
-
onClick,
|
|
42
54
|
className: cn(
|
|
43
|
-
"flex w-full flex-col gap-1 py-1.5 pl-8
|
|
44
|
-
isSelected
|
|
55
|
+
"flex w-full flex-col gap-1 py-1.5 pl-8",
|
|
56
|
+
isSelected && !isSecondary && "bg-primary/5"
|
|
45
57
|
),
|
|
58
|
+
style: isSelected && isSecondary ? { backgroundColor: SECONDARY_ACTIVE_BG } : void 0,
|
|
46
59
|
children: [
|
|
47
60
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 text-xs", children: [
|
|
48
|
-
/* @__PURE__ */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
61
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
62
|
+
/* @__PURE__ */ jsx(
|
|
63
|
+
"span",
|
|
64
|
+
{
|
|
65
|
+
className: cn(
|
|
66
|
+
"truncate text-muted-foreground",
|
|
67
|
+
isSelected && "font-medium"
|
|
68
|
+
),
|
|
69
|
+
children: sub.name
|
|
70
|
+
}
|
|
71
|
+
),
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
"button",
|
|
74
|
+
{
|
|
75
|
+
type: "button",
|
|
76
|
+
onClick,
|
|
77
|
+
"aria-label": `Filter by ${sub.name}`,
|
|
78
|
+
"aria-pressed": isSelected,
|
|
79
|
+
className: cn(
|
|
80
|
+
"shrink-0 transition-colors",
|
|
81
|
+
isSelected ? isSecondary ? "text-[var(--brand-secondary)]" : "text-primary" : "text-muted-foreground/50 hover:text-muted-foreground"
|
|
82
|
+
),
|
|
83
|
+
children: /* @__PURE__ */ jsx(ListFilter, { size: 12 })
|
|
84
|
+
}
|
|
85
|
+
)
|
|
86
|
+
] }),
|
|
58
87
|
/* @__PURE__ */ jsx("span", { className: "shrink-0 font-medium text-foreground", children: formatCurrency(sub.amount) })
|
|
59
88
|
] }),
|
|
60
|
-
/* @__PURE__ */ jsx(ProgressBar, { pct: sub.pct })
|
|
89
|
+
/* @__PURE__ */ jsx(ProgressBar, { pct: sub.pct, colorScheme })
|
|
61
90
|
]
|
|
62
91
|
}
|
|
63
92
|
);
|
|
@@ -65,68 +94,67 @@ function SubCategoryRow({
|
|
|
65
94
|
function CategoryRow({
|
|
66
95
|
item,
|
|
67
96
|
selectedCategoryId,
|
|
97
|
+
colorScheme = "primary",
|
|
68
98
|
onFilterClick
|
|
69
99
|
}) {
|
|
70
100
|
var _a, _b, _c, _d;
|
|
71
101
|
const [expanded, setExpanded] = useState(false);
|
|
102
|
+
const [hovered, setHovered] = useState(false);
|
|
72
103
|
const hasChildren = ((_b = (_a = item.subCategories) == null ? void 0 : _a.length) != null ? _b : 0) > 0;
|
|
73
104
|
const isSelected = selectedCategoryId === item.id;
|
|
74
|
-
const isChildSelected = hasChildren
|
|
105
|
+
const isChildSelected = hasChildren && ((_d = (_c = item.subCategories) == null ? void 0 : _c.some((s) => s.id === selectedCategoryId)) != null ? _d : false);
|
|
75
106
|
const isActive = isSelected || isChildSelected;
|
|
107
|
+
const isSecondary = colorScheme === "secondary";
|
|
108
|
+
const wrapperStyle = isSecondary && isActive ? {
|
|
109
|
+
backgroundColor: hovered ? SECONDARY_ACTIVE_HOVER_BG : SECONDARY_ACTIVE_BG
|
|
110
|
+
} : void 0;
|
|
76
111
|
return /* @__PURE__ */ jsxs(
|
|
77
112
|
"div",
|
|
78
113
|
{
|
|
79
114
|
className: cn(
|
|
80
115
|
"border-b border-border last:border-0 transition-colors",
|
|
81
|
-
isActive && "bg-primary/5"
|
|
116
|
+
isActive && !isSecondary && "bg-primary/5"
|
|
82
117
|
),
|
|
118
|
+
style: wrapperStyle,
|
|
83
119
|
children: [
|
|
84
120
|
/* @__PURE__ */ jsxs(
|
|
85
121
|
"button",
|
|
86
122
|
{
|
|
87
123
|
type: "button",
|
|
88
124
|
className: cn(
|
|
89
|
-
"flex w-full items-start gap-3 py-3 text-left
|
|
90
|
-
|
|
125
|
+
"flex w-full items-start gap-3 py-3 text-left transition-colors",
|
|
126
|
+
!isSecondary && "hover:bg-muted/40",
|
|
127
|
+
!isSecondary && isActive && "hover:bg-primary/10"
|
|
91
128
|
),
|
|
92
|
-
|
|
93
|
-
|
|
129
|
+
onMouseEnter: () => setHovered(true),
|
|
130
|
+
onMouseLeave: () => setHovered(false),
|
|
131
|
+
onClick: () => hasChildren && setExpanded((v) => !v),
|
|
132
|
+
"aria-expanded": hasChildren ? expanded : void 0,
|
|
94
133
|
children: [
|
|
95
|
-
/* @__PURE__ */ jsx(
|
|
96
|
-
|
|
97
|
-
{
|
|
98
|
-
className: "mt-0.5 shrink-0 text-muted-foreground",
|
|
99
|
-
onClick: (e) => {
|
|
100
|
-
if (!hasChildren) return;
|
|
101
|
-
e.stopPropagation();
|
|
102
|
-
setExpanded((v) => !v);
|
|
103
|
-
},
|
|
104
|
-
"aria-label": expanded ? "Collapse" : "Expand",
|
|
105
|
-
children: hasChildren ? expanded ? /* @__PURE__ */ jsx(ChevronDown, { size: 14 }) : /* @__PURE__ */ jsx(ChevronRight, { size: 14 }) : /* @__PURE__ */ jsx("span", { className: "inline-block size-3.5" })
|
|
106
|
-
}
|
|
107
|
-
),
|
|
108
|
-
item.icon && /* @__PURE__ */ jsx(
|
|
109
|
-
"span",
|
|
110
|
-
{
|
|
111
|
-
className: cn(
|
|
112
|
-
"mt-0.5 shrink-0",
|
|
113
|
-
isActive ? "text-primary" : "text-muted-foreground"
|
|
114
|
-
),
|
|
115
|
-
children: item.icon
|
|
116
|
-
}
|
|
117
|
-
),
|
|
134
|
+
/* @__PURE__ */ jsx("span", { className: "mt-0.5 shrink-0 text-muted-foreground", children: hasChildren ? expanded ? /* @__PURE__ */ jsx(ChevronDown, { size: 14 }) : /* @__PURE__ */ jsx(ChevronRight, { size: 14 }) : /* @__PURE__ */ jsx("span", { className: "inline-block size-3.5" }) }),
|
|
135
|
+
item.icon && /* @__PURE__ */ jsx("span", { className: "mt-0.5 shrink-0 text-muted-foreground", children: item.icon }),
|
|
118
136
|
/* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
119
137
|
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
-
"span",
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
138
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-center gap-1", children: [
|
|
139
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-sm font-medium text-foreground", children: item.name }),
|
|
140
|
+
/* @__PURE__ */ jsx(
|
|
141
|
+
"button",
|
|
142
|
+
{
|
|
143
|
+
type: "button",
|
|
144
|
+
onClick: (e) => {
|
|
145
|
+
e.stopPropagation();
|
|
146
|
+
onFilterClick(isSelected ? null : item.id);
|
|
147
|
+
},
|
|
148
|
+
"aria-label": `Filter by ${item.name}`,
|
|
149
|
+
"aria-pressed": isSelected,
|
|
150
|
+
className: cn(
|
|
151
|
+
"shrink-0 transition-colors",
|
|
152
|
+
isActive ? isSecondary ? "text-[var(--brand-secondary)]" : "text-primary" : "text-muted-foreground/50 hover:text-muted-foreground"
|
|
153
|
+
),
|
|
154
|
+
children: /* @__PURE__ */ jsx(ListFilter, { size: 13 })
|
|
155
|
+
}
|
|
156
|
+
)
|
|
157
|
+
] }),
|
|
130
158
|
/* @__PURE__ */ jsxs("div", { className: "flex shrink-0 items-center gap-2", children: [
|
|
131
159
|
/* @__PURE__ */ jsxs("span", { className: "text-xs text-muted-foreground", children: [
|
|
132
160
|
item.pct.toFixed(0),
|
|
@@ -135,7 +163,14 @@ function CategoryRow({
|
|
|
135
163
|
/* @__PURE__ */ jsx("span", { className: "text-sm font-semibold text-foreground", children: formatCurrency(item.amount) })
|
|
136
164
|
] })
|
|
137
165
|
] }),
|
|
138
|
-
/* @__PURE__ */ jsx(
|
|
166
|
+
/* @__PURE__ */ jsx(
|
|
167
|
+
ProgressBar,
|
|
168
|
+
{
|
|
169
|
+
pct: item.pct,
|
|
170
|
+
className: "mt-1.5",
|
|
171
|
+
colorScheme
|
|
172
|
+
}
|
|
173
|
+
)
|
|
139
174
|
] })
|
|
140
175
|
]
|
|
141
176
|
}
|
|
@@ -145,6 +180,7 @@ function CategoryRow({
|
|
|
145
180
|
{
|
|
146
181
|
sub,
|
|
147
182
|
isSelected: selectedCategoryId === sub.id,
|
|
183
|
+
colorScheme,
|
|
148
184
|
onClick: () => onFilterClick(selectedCategoryId === sub.id ? null : sub.id)
|
|
149
185
|
},
|
|
150
186
|
sub.id
|
|
@@ -160,11 +196,9 @@ function DashboardExpenseCategories({
|
|
|
160
196
|
isLoading = false,
|
|
161
197
|
className,
|
|
162
198
|
selectedCategoryId,
|
|
163
|
-
onCategorySelect
|
|
199
|
+
onCategorySelect,
|
|
200
|
+
colorScheme = "primary"
|
|
164
201
|
}) {
|
|
165
|
-
const handleFilterClick = (id) => {
|
|
166
|
-
onCategorySelect == null ? void 0 : onCategorySelect(id);
|
|
167
|
-
};
|
|
168
202
|
return /* @__PURE__ */ jsxs(Card, { className: cn("flex flex-col", className), children: [
|
|
169
203
|
/* @__PURE__ */ jsx(CardHeader, { className: "pb-2", children: /* @__PURE__ */ jsxs("div", { className: "flex items-baseline justify-between gap-2", children: [
|
|
170
204
|
/* @__PURE__ */ jsx(CardTitle, { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: title }),
|
|
@@ -175,7 +209,8 @@ function DashboardExpenseCategories({
|
|
|
175
209
|
{
|
|
176
210
|
item,
|
|
177
211
|
selectedCategoryId,
|
|
178
|
-
|
|
212
|
+
colorScheme,
|
|
213
|
+
onFilterClick: (id) => onCategorySelect == null ? void 0 : onCategorySelect(id)
|
|
179
214
|
},
|
|
180
215
|
item.id
|
|
181
216
|
)) }) })
|
|
@@ -959,7 +959,7 @@ function CategoryChip({
|
|
|
959
959
|
{
|
|
960
960
|
asChild: true,
|
|
961
961
|
variant: "secondary",
|
|
962
|
-
className: "cursor-pointer transition-colors hover:
|
|
962
|
+
className: "cursor-pointer transition-colors hover:bg-muted",
|
|
963
963
|
children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("button", { type: "button", onClick, children: [
|
|
964
964
|
label,
|
|
965
965
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_lucide_react7.Pencil, { className: "size-2.5 shrink-0 opacity-60" })
|
|
@@ -971,50 +971,40 @@ function CategoryChip({
|
|
|
971
971
|
}
|
|
972
972
|
function TransactionRow({
|
|
973
973
|
tx,
|
|
974
|
-
isDimmed,
|
|
975
974
|
canEdit,
|
|
976
975
|
onChipClick
|
|
977
976
|
}) {
|
|
978
977
|
var _a;
|
|
979
978
|
const isCredit = tx.amount >= 0;
|
|
980
979
|
const categoryLabel = (_a = tx.editedCategoryName) != null ? _a : tx.category;
|
|
981
|
-
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
982
|
-
"div",
|
|
983
|
-
|
|
984
|
-
className:
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
"
|
|
1004
|
-
{
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
children: [
|
|
1010
|
-
isCredit ? "+" : "",
|
|
1011
|
-
formatCurrency(tx.amount, { showSign: false })
|
|
1012
|
-
]
|
|
1013
|
-
}
|
|
1014
|
-
)
|
|
1015
|
-
]
|
|
1016
|
-
}
|
|
1017
|
-
);
|
|
980
|
+
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "flex items-start justify-between gap-4 border-b border-border py-3 last:border-0", children: [
|
|
981
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)("div", { className: "min-w-0 flex-1", children: [
|
|
982
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "text-xs text-muted-foreground", children: formatDateShort(tx.date) }),
|
|
983
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-0.5 truncate text-sm font-medium text-foreground", children: tx.description }),
|
|
984
|
+
tx.merchant && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "mt-0.5 truncate text-xs text-muted-foreground", children: tx.merchant }),
|
|
985
|
+
categoryLabel && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mt-1", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
986
|
+
CategoryChip,
|
|
987
|
+
{
|
|
988
|
+
label: categoryLabel,
|
|
989
|
+
canEdit,
|
|
990
|
+
onClick: onChipClick
|
|
991
|
+
}
|
|
992
|
+
) })
|
|
993
|
+
] }),
|
|
994
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
|
|
995
|
+
"span",
|
|
996
|
+
{
|
|
997
|
+
className: cn(
|
|
998
|
+
"shrink-0 text-sm font-semibold",
|
|
999
|
+
isCredit ? "text-success" : "text-foreground"
|
|
1000
|
+
),
|
|
1001
|
+
children: [
|
|
1002
|
+
isCredit ? "+" : "",
|
|
1003
|
+
formatCurrency(tx.amount, { showSign: false })
|
|
1004
|
+
]
|
|
1005
|
+
}
|
|
1006
|
+
)
|
|
1007
|
+
] });
|
|
1018
1008
|
}
|
|
1019
1009
|
function DashboardTransactionsTable({
|
|
1020
1010
|
transactions = [],
|
|
@@ -1026,7 +1016,9 @@ function DashboardTransactionsTable({
|
|
|
1026
1016
|
className,
|
|
1027
1017
|
selectedCategoryId,
|
|
1028
1018
|
categories,
|
|
1029
|
-
onCategoryChange
|
|
1019
|
+
onCategoryChange,
|
|
1020
|
+
showHeader = true,
|
|
1021
|
+
showTab = true
|
|
1030
1022
|
}) {
|
|
1031
1023
|
const isFiltering = selectedCategoryId != null;
|
|
1032
1024
|
const canEdit = !!(categories == null ? void 0 : categories.length);
|
|
@@ -1039,16 +1031,17 @@ function DashboardTransactionsTable({
|
|
|
1039
1031
|
};
|
|
1040
1032
|
return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
1041
1033
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(Card, { className: cn("flex flex-col", className), children: [
|
|
1042
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(CardHeader, { className: "pb-0", children: [
|
|
1034
|
+
showHeader && /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(CardHeader, { className: "pb-0", children: [
|
|
1043
1035
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(CardTitle, { className: "text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: title }),
|
|
1044
|
-
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mt-2 flex border-b border-border", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "border-b-2 border-foreground pb-1.5 text-xs font-semibold text-foreground", children: "Account Transaction" }) })
|
|
1036
|
+
showTab && /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "mt-2 flex border-b border-border", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("span", { className: "border-b-2 border-foreground pb-1.5 text-xs font-semibold text-foreground", children: "Account Transaction" }) })
|
|
1045
1037
|
] }),
|
|
1046
1038
|
/* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(CardContent, { className: "flex flex-1 flex-col px-4 pb-0 pt-0", children: [
|
|
1047
|
-
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-1 items-center justify-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Spinner, { size: "default" }) }) : transactions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "py-8 text-center text-sm text-muted-foreground", children: "No transactions found" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-col", children: transactions.
|
|
1039
|
+
isLoading ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-1 items-center justify-center py-8", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Spinner, { size: "default" }) }) : transactions.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("p", { className: "py-8 text-center text-sm text-muted-foreground", children: "No transactions found" }) : /* @__PURE__ */ (0, import_jsx_runtime12.jsx)("div", { className: "flex flex-col", children: transactions.filter(
|
|
1040
|
+
(tx) => !isFiltering || tx.categoryId === selectedCategoryId
|
|
1041
|
+
).map((tx) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
1048
1042
|
TransactionRow,
|
|
1049
1043
|
{
|
|
1050
1044
|
tx,
|
|
1051
|
-
isDimmed: isFiltering && tx.categoryId !== selectedCategoryId,
|
|
1052
1045
|
canEdit,
|
|
1053
1046
|
onChipClick: () => setEditingTx(tx)
|
|
1054
1047
|
},
|