@burdenoff/microfe-healthybowl 2026.625.4 → 2026.625.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/healthybowl/pages/financial/BudgetManagementPage.js +200 -189
- package/dist/healthybowl/pages/financial/BudgetManagementPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/FinancialDashboardPage.js +137 -126
- package/dist/healthybowl/pages/financial/FinancialDashboardPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/FinancialReportsPage.js +82 -75
- package/dist/healthybowl/pages/financial/FinancialReportsPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/FinancierAccessPage.js +44 -43
- package/dist/healthybowl/pages/financial/FinancierAccessPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js +201 -190
- package/dist/healthybowl/pages/financial/InvoiceManagementPage.js.map +1 -1
- package/dist/healthybowl/pages/financial/TransactionsPage.js +321 -303
- package/dist/healthybowl/pages/financial/TransactionsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/CohortsPage.js +95 -95
- package/dist/healthybowl/pages/network/CohortsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/CommunityPage.js +261 -252
- package/dist/healthybowl/pages/network/CommunityPage.js.map +1 -1
- package/dist/healthybowl/pages/network/EventsPage.js +304 -281
- package/dist/healthybowl/pages/network/EventsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/ExpertsPage.js +416 -405
- package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/MentorsPage.js +519 -508
- package/dist/healthybowl/pages/network/MentorsPage.js.map +1 -1
- package/dist/healthybowl/pages/network/NetworkOverviewPage.js +129 -120
- package/dist/healthybowl/pages/network/NetworkOverviewPage.js.map +1 -1
- package/dist/healthybowl/pages/production/ProductionPlanningPage.js +56 -54
- package/dist/healthybowl/pages/production/ProductionPlanningPage.js.map +1 -1
- package/dist/healthybowl/pages/production/ProductionSchedulePage.js +52 -46
- package/dist/healthybowl/pages/production/ProductionSchedulePage.js.map +1 -1
- package/dist/healthybowl/pages/production/RecipeManagementPage.js +242 -229
- package/dist/healthybowl/pages/production/RecipeManagementPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -5,17 +5,18 @@ import { StatusBadge as ee } from "../../components/StatusBadge.js";
|
|
|
5
5
|
import { ErrorState as i } from "../../components/ErrorState.js";
|
|
6
6
|
import { ToastContainer as te } from "../../components/Toast.js";
|
|
7
7
|
import { useConfirm as a } from "../../components/ConfirmDialog.js";
|
|
8
|
-
import { PageLoader as
|
|
9
|
-
import { Modal as
|
|
8
|
+
import { PageLoader as o } from "../../components/PageLoader.js";
|
|
9
|
+
import { Modal as s } from "../../components/Modal.js";
|
|
10
10
|
import "../../components/index.js";
|
|
11
|
-
import { useHealthyBowlData as
|
|
12
|
-
import { useToast as
|
|
13
|
-
import { useMemo as
|
|
14
|
-
import { useI18n as
|
|
15
|
-
import { AlertTriangle as
|
|
16
|
-
import { Fragment as
|
|
11
|
+
import { useHealthyBowlData as ne } from "../../hooks/useHealthyBowlData.js";
|
|
12
|
+
import { useToast as re } from "../../hooks/useToast.js";
|
|
13
|
+
import { useMemo as c, useState as l } from "react";
|
|
14
|
+
import { useI18n as ie } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
15
|
+
import { AlertTriangle as ae, DollarSign as oe, Edit as se, PieChart as ce, Plus as le, Trash2 as ue, TrendingDown as u, Wallet as d } from "lucide-react";
|
|
16
|
+
import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
|
|
17
|
+
import { Button as h, Select as g, SelectContent as _, SelectItem as v, SelectTrigger as y, SelectValue as b } from "@burdenoff/fe-libs/ui";
|
|
17
18
|
//#region src/healthybowl/pages/financial/BudgetManagementPage.tsx
|
|
18
|
-
var
|
|
19
|
+
var de = (e) => e === "on_track" ? "success" : e === "warning" ? "warning" : "error", x = (e) => e > 100 ? "bg-status-error-bg" : e > 75 ? "bg-warning" : "bg-success", fe = [
|
|
19
20
|
"crop_sales",
|
|
20
21
|
"livestock_sales",
|
|
21
22
|
"marketplace",
|
|
@@ -27,118 +28,118 @@ var se = (e) => e === "on_track" ? "success" : e === "warning" ? "warning" : "er
|
|
|
27
28
|
"certification",
|
|
28
29
|
"equipment",
|
|
29
30
|
"other"
|
|
30
|
-
],
|
|
31
|
+
], S = [
|
|
31
32
|
"Q1 2025",
|
|
32
33
|
"Q2 2025",
|
|
33
34
|
"Q3 2025",
|
|
34
35
|
"Q4 2025"
|
|
35
|
-
],
|
|
36
|
+
], C = {
|
|
36
37
|
name: "",
|
|
37
38
|
category: "seeds",
|
|
38
39
|
allocated: "",
|
|
39
40
|
period: "Q1 2025"
|
|
40
|
-
},
|
|
41
|
-
let { t:
|
|
42
|
-
all:
|
|
43
|
-
on_track:
|
|
44
|
-
warning:
|
|
45
|
-
over_budget:
|
|
46
|
-
}), [
|
|
47
|
-
crop_sales:
|
|
48
|
-
livestock_sales:
|
|
49
|
-
marketplace:
|
|
50
|
-
seeds:
|
|
51
|
-
fertilizers:
|
|
52
|
-
labor:
|
|
53
|
-
irrigation:
|
|
54
|
-
pest_control:
|
|
55
|
-
certification:
|
|
56
|
-
equipment:
|
|
57
|
-
other:
|
|
58
|
-
}), [
|
|
59
|
-
let t =
|
|
41
|
+
}, w = () => {
|
|
42
|
+
let { t: w } = ie(), { budgets: T, createBudget: pe, updateBudget: me, deleteBudget: E, loadings: D, errors: O, refetch: k } = ne(), { toasts: A, toast: j, dismiss: M } = re(), N = a(), P = c(() => ({
|
|
43
|
+
all: w("healthybowl.common.all", "All"),
|
|
44
|
+
on_track: w("healthybowl.financial.budgetManagement.status.onTrack", "On track"),
|
|
45
|
+
warning: w("healthybowl.financial.budgetManagement.status.warning", "Warning"),
|
|
46
|
+
over_budget: w("healthybowl.financial.budgetManagement.status.overBudget", "Over budget")
|
|
47
|
+
}), [w]), F = (e) => e === "on_track" || e === "warning" || e === "over_budget" ? P[e] : w("healthybowl.financial.budgetManagement.status.unknown", "Unknown"), I = c(() => ({
|
|
48
|
+
crop_sales: w("healthybowl.financial.budgetManagement.categories.cropSales", "Crop sales"),
|
|
49
|
+
livestock_sales: w("healthybowl.financial.budgetManagement.categories.livestockSales", "Livestock sales"),
|
|
50
|
+
marketplace: w("healthybowl.financial.budgetManagement.categories.marketplace", "Marketplace"),
|
|
51
|
+
seeds: w("healthybowl.financial.budgetManagement.categories.seeds", "Seeds"),
|
|
52
|
+
fertilizers: w("healthybowl.financial.budgetManagement.categories.fertilizers", "Fertilizers"),
|
|
53
|
+
labor: w("healthybowl.financial.budgetManagement.categories.labor", "Labor"),
|
|
54
|
+
irrigation: w("healthybowl.financial.budgetManagement.categories.irrigation", "Irrigation"),
|
|
55
|
+
pest_control: w("healthybowl.financial.budgetManagement.categories.pestControl", "Pest control"),
|
|
56
|
+
certification: w("healthybowl.financial.budgetManagement.categories.certification", "Certification"),
|
|
57
|
+
equipment: w("healthybowl.financial.budgetManagement.categories.equipment", "Equipment"),
|
|
58
|
+
other: w("healthybowl.financial.budgetManagement.categories.other", "Other")
|
|
59
|
+
}), [w]), L = (e) => e in I ? I[e] : e.replace(/_/g, " "), [R, z] = l("all"), [B, he] = l("all"), [ge, V] = l(!1), [H, U] = l(null), [_e, W] = l(null), [G, K] = l(C), q = c(() => T.filter((e) => {
|
|
60
|
+
let t = R === "all" || e.status === R, n = B === "all" || e.period === B;
|
|
60
61
|
return t && n;
|
|
61
62
|
}), [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
]), J =
|
|
63
|
+
T,
|
|
64
|
+
R,
|
|
65
|
+
B
|
|
66
|
+
]), J = T.reduce((e, t) => e + t.allocated, 0), Y = T.reduce((e, t) => e + t.spent, 0), ve = T.reduce((e, t) => e + t.remaining, 0), ye = T.filter((e) => e.status === "over_budget").length, X = J > 0 ? Math.round(Y / J * 100) : 0, be = async () => {
|
|
66
67
|
if (!G.name || !G.allocated) {
|
|
67
|
-
|
|
68
|
-
title:
|
|
69
|
-
description:
|
|
68
|
+
j({
|
|
69
|
+
title: w("healthybowl.financial.budgetManagement.toast.validationError.title", "Validation Error"),
|
|
70
|
+
description: w("healthybowl.financial.budgetManagement.toast.validationError.description", "Please fill in name and allocated amount"),
|
|
70
71
|
variant: "error"
|
|
71
72
|
});
|
|
72
73
|
return;
|
|
73
74
|
}
|
|
74
75
|
let e = Number(G.allocated);
|
|
75
76
|
if (H) try {
|
|
76
|
-
await
|
|
77
|
+
await me({
|
|
77
78
|
id: H,
|
|
78
79
|
name: G.name,
|
|
79
80
|
category: G.category,
|
|
80
81
|
period: G.period,
|
|
81
82
|
allocated: e
|
|
82
|
-
}),
|
|
83
|
-
title:
|
|
84
|
-
description:
|
|
83
|
+
}), j({
|
|
84
|
+
title: w("healthybowl.financial.budgetManagement.toast.updated.title", "Budget Updated"),
|
|
85
|
+
description: w("healthybowl.financial.budgetManagement.toast.budgetSummary", "{{name}} - {{amount}}", {
|
|
85
86
|
name: G.name,
|
|
86
87
|
amount: t(e)
|
|
87
88
|
}),
|
|
88
89
|
variant: "success"
|
|
89
90
|
});
|
|
90
91
|
} catch (e) {
|
|
91
|
-
|
|
92
|
-
title:
|
|
93
|
-
description: e instanceof Error ? e.message :
|
|
92
|
+
j({
|
|
93
|
+
title: w("healthybowl.common.error", "Error"),
|
|
94
|
+
description: e instanceof Error ? e.message : w("healthybowl.financial.budgetManagement.toast.updateFailed", "Failed to update budget"),
|
|
94
95
|
variant: "error"
|
|
95
96
|
});
|
|
96
97
|
return;
|
|
97
98
|
}
|
|
98
99
|
else try {
|
|
99
|
-
await
|
|
100
|
+
await pe({
|
|
100
101
|
name: G.name,
|
|
101
102
|
category: G.category,
|
|
102
103
|
period: G.period,
|
|
103
104
|
allocated: e
|
|
104
|
-
}),
|
|
105
|
-
title:
|
|
106
|
-
description:
|
|
105
|
+
}), j({
|
|
106
|
+
title: w("healthybowl.financial.budgetManagement.toast.created.title", "Budget Created"),
|
|
107
|
+
description: w("healthybowl.financial.budgetManagement.toast.budgetSummary", "{{name}} - {{amount}}", {
|
|
107
108
|
name: G.name,
|
|
108
109
|
amount: t(e)
|
|
109
110
|
}),
|
|
110
111
|
variant: "success"
|
|
111
112
|
});
|
|
112
113
|
} catch (e) {
|
|
113
|
-
|
|
114
|
-
title:
|
|
115
|
-
description: e instanceof Error ? e.message :
|
|
114
|
+
j({
|
|
115
|
+
title: w("healthybowl.common.error", "Error"),
|
|
116
|
+
description: e instanceof Error ? e.message : w("healthybowl.financial.budgetManagement.toast.createFailed", "Failed to create budget"),
|
|
116
117
|
variant: "error"
|
|
117
118
|
});
|
|
118
119
|
return;
|
|
119
120
|
}
|
|
120
|
-
V(!1), U(null), K(
|
|
121
|
-
},
|
|
122
|
-
let t =
|
|
121
|
+
V(!1), U(null), K(C);
|
|
122
|
+
}, xe = (e) => {
|
|
123
|
+
let t = T.find((t) => t.id === e);
|
|
123
124
|
t && (K({
|
|
124
125
|
name: t.name,
|
|
125
126
|
category: t.category,
|
|
126
127
|
allocated: String(t.allocated),
|
|
127
128
|
period: t.period
|
|
128
129
|
}), U(e), V(!0));
|
|
129
|
-
},
|
|
130
|
-
if (await
|
|
130
|
+
}, Se = async (e, t) => {
|
|
131
|
+
if (await N({ message: w("healthybowl.financial.budgetManagement.deleteConfirm", "Delete the budget \"{{name}}\"? This cannot be undone.", { name: t }) })) {
|
|
131
132
|
W(e);
|
|
132
133
|
try {
|
|
133
|
-
await
|
|
134
|
-
title:
|
|
134
|
+
await E(e), j({
|
|
135
|
+
title: w("healthybowl.financial.budgetManagement.toast.deleted.title", "Budget Deleted"),
|
|
135
136
|
description: t,
|
|
136
137
|
variant: "success"
|
|
137
138
|
});
|
|
138
139
|
} catch (e) {
|
|
139
|
-
|
|
140
|
-
title:
|
|
141
|
-
description: e instanceof Error ? e.message :
|
|
140
|
+
j({
|
|
141
|
+
title: w("healthybowl.common.error", "Error"),
|
|
142
|
+
description: e instanceof Error ? e.message : w("healthybowl.financial.budgetManagement.toast.deleteFailed", "Failed to delete budget"),
|
|
142
143
|
variant: "error"
|
|
143
144
|
});
|
|
144
145
|
} finally {
|
|
@@ -146,191 +147,198 @@ var se = (e) => e === "on_track" ? "success" : e === "warning" ? "warning" : "er
|
|
|
146
147
|
}
|
|
147
148
|
}
|
|
148
149
|
}, Z = () => {
|
|
149
|
-
V(!1), U(null), K(
|
|
150
|
+
V(!1), U(null), K(C);
|
|
150
151
|
}, Q = (e, t) => {
|
|
151
152
|
K((n) => ({
|
|
152
153
|
...n,
|
|
153
154
|
[e]: t
|
|
154
155
|
}));
|
|
155
156
|
}, $ = "h-9 w-full rounded-md border border-border-subtle bg-bg-surface px-3 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]";
|
|
156
|
-
return /* @__PURE__ */
|
|
157
|
-
title:
|
|
158
|
-
description:
|
|
159
|
-
actions: /* @__PURE__ */
|
|
157
|
+
return /* @__PURE__ */ m(n, {
|
|
158
|
+
title: w("healthybowl.financial.budgetManagement.title", "Budget Management"),
|
|
159
|
+
description: w("healthybowl.financial.budgetManagement.subtitle", "Track allocated budgets and spending"),
|
|
160
|
+
actions: /* @__PURE__ */ m(h, {
|
|
160
161
|
onClick: () => {
|
|
161
|
-
K(
|
|
162
|
+
K(C), U(null), V(!0);
|
|
162
163
|
},
|
|
163
|
-
|
|
164
|
-
children: [/* @__PURE__ */ _(f, { className: "h-3.5 w-3.5" }), S("healthybowl.financial.budgetManagement.actions.create", "Create Budget")]
|
|
164
|
+
children: [/* @__PURE__ */ p(le, { className: "h-3.5 w-3.5" }), w("healthybowl.financial.budgetManagement.actions.create", "Create Budget")]
|
|
165
165
|
}),
|
|
166
166
|
children: [
|
|
167
|
-
/* @__PURE__ */
|
|
167
|
+
/* @__PURE__ */ m("div", {
|
|
168
168
|
className: "grid grid-cols-2 gap-4 lg:grid-cols-4",
|
|
169
169
|
children: [
|
|
170
|
-
/* @__PURE__ */
|
|
171
|
-
label:
|
|
170
|
+
/* @__PURE__ */ p(r, {
|
|
171
|
+
label: w("healthybowl.financial.budgetManagement.stats.totalBudget", "Total Budget"),
|
|
172
172
|
value: J,
|
|
173
173
|
prefix: "$",
|
|
174
|
-
icon: /* @__PURE__ */
|
|
174
|
+
icon: /* @__PURE__ */ p(d, { className: "h-4 w-4" })
|
|
175
175
|
}),
|
|
176
|
-
/* @__PURE__ */
|
|
177
|
-
label:
|
|
176
|
+
/* @__PURE__ */ p(r, {
|
|
177
|
+
label: w("healthybowl.financial.budgetManagement.stats.totalSpent", "Total Spent"),
|
|
178
178
|
value: Y,
|
|
179
179
|
prefix: "$",
|
|
180
|
-
icon: /* @__PURE__ */
|
|
180
|
+
icon: /* @__PURE__ */ p(oe, { className: "h-4 w-4" })
|
|
181
181
|
}),
|
|
182
|
-
/* @__PURE__ */
|
|
183
|
-
label:
|
|
184
|
-
value:
|
|
182
|
+
/* @__PURE__ */ p(r, {
|
|
183
|
+
label: w("healthybowl.financial.budgetManagement.stats.remaining", "Remaining"),
|
|
184
|
+
value: ve,
|
|
185
185
|
prefix: "$",
|
|
186
|
-
icon: /* @__PURE__ */
|
|
186
|
+
icon: /* @__PURE__ */ p(u, { className: "h-4 w-4" })
|
|
187
187
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
189
|
-
label:
|
|
190
|
-
value:
|
|
191
|
-
icon: /* @__PURE__ */
|
|
188
|
+
/* @__PURE__ */ p(r, {
|
|
189
|
+
label: w("healthybowl.financial.budgetManagement.stats.overBudget", "Over Budget"),
|
|
190
|
+
value: w("healthybowl.financial.budgetManagement.stats.categoriesCount", "{{count}} categories", { count: ye }),
|
|
191
|
+
icon: /* @__PURE__ */ p(ae, { className: "h-4 w-4" })
|
|
192
192
|
})
|
|
193
193
|
]
|
|
194
194
|
}),
|
|
195
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ m("div", {
|
|
196
196
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
|
|
197
197
|
children: [
|
|
198
|
-
/* @__PURE__ */
|
|
198
|
+
/* @__PURE__ */ m("div", {
|
|
199
199
|
className: "flex items-center justify-between",
|
|
200
|
-
children: [/* @__PURE__ */
|
|
200
|
+
children: [/* @__PURE__ */ m("div", {
|
|
201
201
|
className: "flex items-center gap-2",
|
|
202
|
-
children: [/* @__PURE__ */
|
|
202
|
+
children: [/* @__PURE__ */ p(ce, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ p("h3", {
|
|
203
203
|
className: "text-sm font-semibold text-text-primary",
|
|
204
|
-
children:
|
|
204
|
+
children: w("healthybowl.financial.budgetManagement.utilization.title", "Budget Utilization Overview")
|
|
205
205
|
})]
|
|
206
|
-
}), /* @__PURE__ */
|
|
206
|
+
}), /* @__PURE__ */ m("span", {
|
|
207
207
|
className: "text-sm font-medium text-text-primary",
|
|
208
208
|
children: [X, "%"]
|
|
209
209
|
})]
|
|
210
210
|
}),
|
|
211
|
-
/* @__PURE__ */
|
|
211
|
+
/* @__PURE__ */ p("div", {
|
|
212
212
|
className: "mt-3 h-4 w-full rounded-full bg-bg-sunken",
|
|
213
|
-
children: /* @__PURE__ */
|
|
214
|
-
className: e("h-full rounded-full transition-all",
|
|
213
|
+
children: /* @__PURE__ */ p("div", {
|
|
214
|
+
className: e("h-full rounded-full transition-all", x(X)),
|
|
215
215
|
style: { width: `${Math.min(100, X)}%` }
|
|
216
216
|
})
|
|
217
217
|
}),
|
|
218
|
-
/* @__PURE__ */
|
|
218
|
+
/* @__PURE__ */ m("div", {
|
|
219
219
|
className: "mt-2 flex items-center justify-between text-xs text-text-secondary",
|
|
220
|
-
children: [/* @__PURE__ */
|
|
220
|
+
children: [/* @__PURE__ */ p("span", { children: w("healthybowl.financial.budgetManagement.utilization.spent", "Spent: {{amount}}", { amount: t(Y) }) }), /* @__PURE__ */ p("span", { children: w("healthybowl.financial.budgetManagement.utilization.allocated", "Allocated: {{amount}}", { amount: t(J) }) })]
|
|
221
221
|
})
|
|
222
222
|
]
|
|
223
223
|
}),
|
|
224
|
-
/* @__PURE__ */
|
|
224
|
+
/* @__PURE__ */ m("div", {
|
|
225
225
|
className: "flex flex-wrap items-center gap-3",
|
|
226
|
-
children: [/* @__PURE__ */
|
|
226
|
+
children: [/* @__PURE__ */ p("div", {
|
|
227
227
|
className: "flex gap-1.5",
|
|
228
228
|
children: [
|
|
229
229
|
"all",
|
|
230
230
|
"on_track",
|
|
231
231
|
"warning",
|
|
232
232
|
"over_budget"
|
|
233
|
-
].map((t) => /* @__PURE__ */
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
233
|
+
].map((t) => /* @__PURE__ */ p("button", {
|
|
234
|
+
type: "button",
|
|
235
|
+
onClick: () => z(t),
|
|
236
|
+
className: e("rounded-md px-3 py-1.5 text-xs font-medium capitalize transition-colors", R === t ? "bg-foreground text-background" : "border border-border-subtle text-text-secondary hover:text-text-primary"),
|
|
237
|
+
children: P[t]
|
|
237
238
|
}, t))
|
|
238
|
-
}), /* @__PURE__ */
|
|
239
|
-
value:
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
239
|
+
}), /* @__PURE__ */ m(g, {
|
|
240
|
+
value: B,
|
|
241
|
+
onValueChange: he,
|
|
242
|
+
children: [/* @__PURE__ */ p(y, {
|
|
243
|
+
className: "h-8 w-auto",
|
|
244
|
+
children: /* @__PURE__ */ p(b, { placeholder: w("healthybowl.financial.budgetManagement.filters.allPeriods", "All Periods") })
|
|
245
|
+
}), /* @__PURE__ */ m(_, { children: [/* @__PURE__ */ p(v, {
|
|
243
246
|
value: "all",
|
|
244
|
-
children:
|
|
245
|
-
}),
|
|
247
|
+
children: w("healthybowl.financial.budgetManagement.filters.allPeriods", "All Periods")
|
|
248
|
+
}), S.map((e) => /* @__PURE__ */ p(v, {
|
|
246
249
|
value: e,
|
|
247
250
|
children: e
|
|
248
|
-
}, e))]
|
|
251
|
+
}, e))] })]
|
|
249
252
|
})]
|
|
250
253
|
}),
|
|
251
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ p("div", {
|
|
252
255
|
className: "grid gap-4 sm:grid-cols-2 lg:grid-cols-3",
|
|
253
256
|
children: q.map((n) => {
|
|
254
257
|
let r = Math.round(n.spent / n.allocated * 100), i = Math.min(100, r);
|
|
255
|
-
return /* @__PURE__ */
|
|
258
|
+
return /* @__PURE__ */ m("div", {
|
|
256
259
|
className: "rounded-lg border border-border-subtle bg-bg-surface p-5",
|
|
257
260
|
children: [
|
|
258
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ m("div", {
|
|
259
262
|
className: "flex items-start justify-between",
|
|
260
|
-
children: [/* @__PURE__ */
|
|
263
|
+
children: [/* @__PURE__ */ m("div", {
|
|
261
264
|
className: "flex items-center gap-2",
|
|
262
|
-
children: [/* @__PURE__ */
|
|
265
|
+
children: [/* @__PURE__ */ p(d, { className: "h-4 w-4 text-text-secondary" }), /* @__PURE__ */ p("h3", {
|
|
263
266
|
className: "text-sm font-semibold text-text-primary",
|
|
264
267
|
children: n.name
|
|
265
268
|
})]
|
|
266
|
-
}), /* @__PURE__ */
|
|
269
|
+
}), /* @__PURE__ */ m("div", {
|
|
267
270
|
className: "flex items-center gap-1.5",
|
|
268
271
|
children: [
|
|
269
|
-
/* @__PURE__ */
|
|
270
|
-
label:
|
|
271
|
-
variant:
|
|
272
|
+
/* @__PURE__ */ p(ee, {
|
|
273
|
+
label: F(n.status ?? "unknown"),
|
|
274
|
+
variant: de(n.status ?? "unknown")
|
|
272
275
|
}),
|
|
273
|
-
/* @__PURE__ */
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
/* @__PURE__ */ p(h, {
|
|
277
|
+
variant: "ghost",
|
|
278
|
+
size: "icon-sm",
|
|
279
|
+
onClick: () => xe(n.id),
|
|
280
|
+
title: w("healthybowl.financial.budgetManagement.actions.edit", "Edit Budget"),
|
|
281
|
+
"aria-label": w("healthybowl.financial.budgetManagement.actions.edit", "Edit Budget"),
|
|
282
|
+
children: /* @__PURE__ */ p(se, { className: "h-3.5 w-3.5" })
|
|
278
283
|
}),
|
|
279
|
-
/* @__PURE__ */
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
284
|
+
/* @__PURE__ */ p(h, {
|
|
285
|
+
variant: "ghost",
|
|
286
|
+
size: "icon-sm",
|
|
287
|
+
onClick: () => Se(n.id, n.name),
|
|
288
|
+
disabled: _e === n.id,
|
|
289
|
+
className: "text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text",
|
|
290
|
+
title: w("healthybowl.financial.budgetManagement.actions.delete", "Delete Budget"),
|
|
291
|
+
"aria-label": w("healthybowl.financial.budgetManagement.actions.delete", "Delete Budget"),
|
|
292
|
+
children: /* @__PURE__ */ p(ue, { className: "h-3.5 w-3.5" })
|
|
285
293
|
})
|
|
286
294
|
]
|
|
287
295
|
})]
|
|
288
296
|
}),
|
|
289
|
-
/* @__PURE__ */
|
|
297
|
+
/* @__PURE__ */ m("p", {
|
|
290
298
|
className: "mt-1 text-xs text-text-secondary",
|
|
291
299
|
children: [
|
|
292
|
-
|
|
300
|
+
L(n.category ?? ""),
|
|
293
301
|
" · ",
|
|
294
302
|
n.period
|
|
295
303
|
]
|
|
296
304
|
}),
|
|
297
|
-
/* @__PURE__ */
|
|
305
|
+
/* @__PURE__ */ m("div", {
|
|
298
306
|
className: "mt-4 space-y-1",
|
|
299
|
-
children: [/* @__PURE__ */
|
|
307
|
+
children: [/* @__PURE__ */ m("div", {
|
|
300
308
|
className: "flex justify-between text-xs text-text-secondary",
|
|
301
|
-
children: [/* @__PURE__ */
|
|
309
|
+
children: [/* @__PURE__ */ p("span", { children: w("healthybowl.financial.budgetManagement.card.spent", "Spent") }), /* @__PURE__ */ m("span", {
|
|
302
310
|
className: e(r > 100 ? "font-semibold text-status-error-text" : ""),
|
|
303
311
|
children: [r, "%"]
|
|
304
312
|
})]
|
|
305
|
-
}), /* @__PURE__ */
|
|
313
|
+
}), /* @__PURE__ */ p("div", {
|
|
306
314
|
className: "h-2.5 w-full rounded-full bg-bg-sunken",
|
|
307
|
-
children: /* @__PURE__ */
|
|
308
|
-
className: e("h-full rounded-full transition-all",
|
|
315
|
+
children: /* @__PURE__ */ p("div", {
|
|
316
|
+
className: e("h-full rounded-full transition-all", x(r)),
|
|
309
317
|
style: { width: `${i}%` }
|
|
310
318
|
})
|
|
311
319
|
})]
|
|
312
320
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
321
|
+
/* @__PURE__ */ m("div", {
|
|
314
322
|
className: "mt-4 grid grid-cols-3 gap-2 text-center",
|
|
315
323
|
children: [
|
|
316
|
-
/* @__PURE__ */
|
|
324
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
317
325
|
className: "text-xs text-text-secondary",
|
|
318
|
-
children:
|
|
319
|
-
}), /* @__PURE__ */
|
|
326
|
+
children: w("healthybowl.financial.budgetManagement.card.allocated", "Allocated")
|
|
327
|
+
}), /* @__PURE__ */ p("p", {
|
|
320
328
|
className: "text-sm font-medium text-text-primary",
|
|
321
329
|
children: t(n.allocated)
|
|
322
330
|
})] }),
|
|
323
|
-
/* @__PURE__ */
|
|
331
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
324
332
|
className: "text-xs text-text-secondary",
|
|
325
|
-
children:
|
|
326
|
-
}), /* @__PURE__ */
|
|
333
|
+
children: w("healthybowl.financial.budgetManagement.card.spent", "Spent")
|
|
334
|
+
}), /* @__PURE__ */ p("p", {
|
|
327
335
|
className: "text-sm font-medium text-text-primary",
|
|
328
336
|
children: t(n.spent)
|
|
329
337
|
})] }),
|
|
330
|
-
/* @__PURE__ */
|
|
338
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("p", {
|
|
331
339
|
className: "text-xs text-text-secondary",
|
|
332
|
-
children:
|
|
333
|
-
}), /* @__PURE__ */
|
|
340
|
+
children: w("healthybowl.financial.budgetManagement.card.remaining", "Remaining")
|
|
341
|
+
}), /* @__PURE__ */ p("p", {
|
|
334
342
|
className: e("text-sm font-medium", n.remaining < 0 ? "text-status-error-text" : "text-text-primary"),
|
|
335
343
|
children: t(n.remaining)
|
|
336
344
|
})] })
|
|
@@ -340,67 +348,70 @@ var se = (e) => e === "on_track" ? "success" : e === "warning" ? "warning" : "er
|
|
|
340
348
|
}, n.id);
|
|
341
349
|
})
|
|
342
350
|
}),
|
|
343
|
-
q.length === 0 && (
|
|
351
|
+
q.length === 0 && (D.financial ? /* @__PURE__ */ p(o, {}) : O.financial ? /* @__PURE__ */ p(i, { onRetry: k }) : /* @__PURE__ */ p("div", {
|
|
344
352
|
className: "py-12 text-center text-sm text-text-secondary",
|
|
345
|
-
children:
|
|
353
|
+
children: w("healthybowl.financial.budgetManagement.emptyState.message", "No budgets matching the selected filters.")
|
|
346
354
|
})),
|
|
347
|
-
/* @__PURE__ */
|
|
348
|
-
open:
|
|
355
|
+
/* @__PURE__ */ p(s, {
|
|
356
|
+
open: ge,
|
|
349
357
|
onClose: Z,
|
|
350
|
-
title: H ?
|
|
351
|
-
description: H ?
|
|
352
|
-
footer: /* @__PURE__ */
|
|
358
|
+
title: H ? w("healthybowl.financial.budgetManagement.modal.editTitle", "Edit Budget") : w("healthybowl.financial.budgetManagement.modal.createTitle", "Create Budget"),
|
|
359
|
+
description: H ? w("healthybowl.financial.budgetManagement.modal.editDescription", "Update budget details") : w("healthybowl.financial.budgetManagement.modal.createDescription", "Set up a new budget category"),
|
|
360
|
+
footer: /* @__PURE__ */ m(f, { children: [/* @__PURE__ */ p(h, {
|
|
361
|
+
variant: "outline",
|
|
353
362
|
onClick: Z,
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
className: "rounded-md bg-foreground px-4 py-2 text-sm font-medium text-background transition-opacity hover:opacity-90",
|
|
359
|
-
children: H ? S("healthybowl.financial.budgetManagement.modal.update", "Update") : S("healthybowl.financial.budgetManagement.modal.create", "Create")
|
|
363
|
+
children: w("healthybowl.common.cancel", "Cancel")
|
|
364
|
+
}), /* @__PURE__ */ p(h, {
|
|
365
|
+
onClick: be,
|
|
366
|
+
children: H ? w("healthybowl.financial.budgetManagement.modal.update", "Update") : w("healthybowl.financial.budgetManagement.modal.create", "Create")
|
|
360
367
|
})] }),
|
|
361
|
-
children: /* @__PURE__ */
|
|
368
|
+
children: /* @__PURE__ */ m("div", {
|
|
362
369
|
className: "grid gap-4",
|
|
363
370
|
children: [
|
|
364
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
365
372
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
366
|
-
children:
|
|
367
|
-
}), /* @__PURE__ */
|
|
373
|
+
children: w("healthybowl.financial.budgetManagement.form.name.label", "Budget Name *")
|
|
374
|
+
}), /* @__PURE__ */ p("input", {
|
|
368
375
|
type: "text",
|
|
369
376
|
value: G.name,
|
|
370
377
|
onChange: (e) => Q("name", e.target.value),
|
|
371
|
-
placeholder:
|
|
378
|
+
placeholder: w("healthybowl.financial.budgetManagement.form.name.placeholder", "e.g., Seed & Planting"),
|
|
372
379
|
className: $
|
|
373
380
|
})] }),
|
|
374
|
-
/* @__PURE__ */
|
|
381
|
+
/* @__PURE__ */ m("div", {
|
|
375
382
|
className: "grid gap-4 sm:grid-cols-2",
|
|
376
|
-
children: [/* @__PURE__ */
|
|
383
|
+
children: [/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
377
384
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
378
|
-
children:
|
|
379
|
-
}), /* @__PURE__ */
|
|
385
|
+
children: w("healthybowl.financial.budgetManagement.form.category.label", "Category *")
|
|
386
|
+
}), /* @__PURE__ */ m(g, {
|
|
380
387
|
value: G.category,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
388
|
+
onValueChange: (e) => Q("category", e),
|
|
389
|
+
children: [/* @__PURE__ */ p(y, {
|
|
390
|
+
className: "w-full",
|
|
391
|
+
children: /* @__PURE__ */ p(b, {})
|
|
392
|
+
}), /* @__PURE__ */ p(_, { children: fe.map((e) => /* @__PURE__ */ p(v, {
|
|
384
393
|
value: e,
|
|
385
|
-
children:
|
|
386
|
-
}, e))
|
|
387
|
-
})] }), /* @__PURE__ */
|
|
394
|
+
children: I[e]
|
|
395
|
+
}, e)) })]
|
|
396
|
+
})] }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
388
397
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
389
|
-
children:
|
|
390
|
-
}), /* @__PURE__ */
|
|
398
|
+
children: w("healthybowl.financial.budgetManagement.form.period.label", "Period *")
|
|
399
|
+
}), /* @__PURE__ */ m(g, {
|
|
391
400
|
value: G.period,
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
401
|
+
onValueChange: (e) => Q("period", e),
|
|
402
|
+
children: [/* @__PURE__ */ p(y, {
|
|
403
|
+
className: "w-full",
|
|
404
|
+
children: /* @__PURE__ */ p(b, {})
|
|
405
|
+
}), /* @__PURE__ */ p(_, { children: S.map((e) => /* @__PURE__ */ p(v, {
|
|
395
406
|
value: e,
|
|
396
407
|
children: e
|
|
397
|
-
}, e))
|
|
408
|
+
}, e)) })]
|
|
398
409
|
})] })]
|
|
399
410
|
}),
|
|
400
|
-
/* @__PURE__ */
|
|
411
|
+
/* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p("label", {
|
|
401
412
|
className: "mb-1 block text-sm font-medium text-text-primary",
|
|
402
|
-
children:
|
|
403
|
-
}), /* @__PURE__ */
|
|
413
|
+
children: w("healthybowl.financial.budgetManagement.form.allocated.label", "Allocated Amount *")
|
|
414
|
+
}), /* @__PURE__ */ p("input", {
|
|
404
415
|
type: "number",
|
|
405
416
|
value: G.allocated,
|
|
406
417
|
onChange: (e) => Q("allocated", e.target.value),
|
|
@@ -412,14 +423,14 @@ var se = (e) => e === "on_track" ? "success" : e === "warning" ? "warning" : "er
|
|
|
412
423
|
]
|
|
413
424
|
})
|
|
414
425
|
}),
|
|
415
|
-
/* @__PURE__ */
|
|
416
|
-
toasts:
|
|
417
|
-
onDismiss:
|
|
426
|
+
/* @__PURE__ */ p(te, {
|
|
427
|
+
toasts: A,
|
|
428
|
+
onDismiss: M
|
|
418
429
|
})
|
|
419
430
|
]
|
|
420
431
|
});
|
|
421
432
|
};
|
|
422
433
|
//#endregion
|
|
423
|
-
export {
|
|
434
|
+
export { w as BudgetManagementPage };
|
|
424
435
|
|
|
425
436
|
//# sourceMappingURL=BudgetManagementPage.js.map
|