@burdenoff/microfe-healthybowl 2026.1005.2 → 2026.1007.2

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.
Files changed (101) hide show
  1. package/dist/healthybowl/components/BedLayoutGrid.js +128 -115
  2. package/dist/healthybowl/components/BedLayoutGrid.js.map +1 -1
  3. package/dist/healthybowl/components/CropPicker.js +37 -0
  4. package/dist/healthybowl/components/CropPicker.js.map +1 -0
  5. package/dist/healthybowl/components/DataTable.js +125 -108
  6. package/dist/healthybowl/components/DataTable.js.map +1 -1
  7. package/dist/healthybowl/components/FilterBar.js +9 -6
  8. package/dist/healthybowl/components/FilterBar.js.map +1 -1
  9. package/dist/healthybowl/components/PlantCatalogPicker.js +32 -0
  10. package/dist/healthybowl/components/PlantCatalogPicker.js.map +1 -0
  11. package/dist/healthybowl/components/WorkspaceRecordPicker.js +164 -0
  12. package/dist/healthybowl/components/WorkspaceRecordPicker.js.map +1 -0
  13. package/dist/healthybowl/components/index.js +3 -1
  14. package/dist/healthybowl/hooks/useCropPage.js +71 -0
  15. package/dist/healthybowl/hooks/useCropPage.js.map +1 -0
  16. package/dist/healthybowl/hooks/usePlantCatalog.js +133 -44
  17. package/dist/healthybowl/hooks/usePlantCatalog.js.map +1 -1
  18. package/dist/healthybowl/hooks/usePlantingEstimate.js +6 -6
  19. package/dist/healthybowl/hooks/usePlantingEstimate.js.map +1 -1
  20. package/dist/healthybowl/hooks/useWorkspaceRead.js +46 -0
  21. package/dist/healthybowl/hooks/useWorkspaceRead.js.map +1 -0
  22. package/dist/healthybowl/pages/HomePage.js +143 -142
  23. package/dist/healthybowl/pages/HomePage.js.map +1 -1
  24. package/dist/healthybowl/pages/analytics/ReportsPage.js +8 -8
  25. package/dist/healthybowl/pages/catalog/PlantCatalogPage.js +266 -192
  26. package/dist/healthybowl/pages/catalog/PlantCatalogPage.js.map +1 -1
  27. package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js +58 -0
  28. package/dist/healthybowl/pages/catalog/WorkspaceBrowseFilters.js.map +1 -0
  29. package/dist/healthybowl/pages/catalog/browsePagination.js +24 -0
  30. package/dist/healthybowl/pages/catalog/browsePagination.js.map +1 -0
  31. package/dist/healthybowl/pages/compliance/ComplianceDocumentsPage.js +6 -6
  32. package/dist/healthybowl/pages/crops/CropDetailsPage.js +340 -348
  33. package/dist/healthybowl/pages/crops/CropDetailsPage.js.map +1 -1
  34. package/dist/healthybowl/pages/crops/CropPlanningPage.js +468 -434
  35. package/dist/healthybowl/pages/crops/CropPlanningPage.js.map +1 -1
  36. package/dist/healthybowl/pages/crops/CropsPage.js +633 -542
  37. package/dist/healthybowl/pages/crops/CropsPage.js.map +1 -1
  38. package/dist/healthybowl/pages/crops/FieldDetailsPage.js +875 -800
  39. package/dist/healthybowl/pages/crops/FieldDetailsPage.js.map +1 -1
  40. package/dist/healthybowl/pages/crops/PlanningDetailsPage.js +459 -448
  41. package/dist/healthybowl/pages/crops/PlanningDetailsPage.js.map +1 -1
  42. package/dist/healthybowl/pages/crops/SuccessionCropLabel.js +21 -0
  43. package/dist/healthybowl/pages/crops/SuccessionCropLabel.js.map +1 -0
  44. package/dist/healthybowl/pages/crops/planningEdit.js +30 -0
  45. package/dist/healthybowl/pages/crops/planningEdit.js.map +1 -0
  46. package/dist/healthybowl/pages/fields/FieldMapPage.js +989 -941
  47. package/dist/healthybowl/pages/fields/FieldMapPage.js.map +1 -1
  48. package/dist/healthybowl/pages/financial/GeneralLedgerPage.js +6 -6
  49. package/dist/healthybowl/pages/financial/InvoiceManagementPage.js +7 -7
  50. package/dist/healthybowl/pages/financial/InvoiceManagementPage.js.map +1 -1
  51. package/dist/healthybowl/pages/financial/TransactionsPage.js +541 -541
  52. package/dist/healthybowl/pages/financial/TransactionsPage.js.map +1 -1
  53. package/dist/healthybowl/pages/government-schemes/ApplicationTrackingPage.js +10 -10
  54. package/dist/healthybowl/pages/government-schemes/CommunicationPage.js +207 -207
  55. package/dist/healthybowl/pages/government-schemes/CommunicationPage.js.map +1 -1
  56. package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js +38 -38
  57. package/dist/healthybowl/pages/government-schemes/SchemeAdminPage.js.map +1 -1
  58. package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js +15 -15
  59. package/dist/healthybowl/pages/government-schemes/TrainingProgramsPage.js.map +1 -1
  60. package/dist/healthybowl/pages/livestock/AnimalRegistryPage.js +4 -4
  61. package/dist/healthybowl/pages/livestock/BreedingManagementPage.js +4 -4
  62. package/dist/healthybowl/pages/livestock/FeedManagementPage.js +4 -4
  63. package/dist/healthybowl/pages/livestock/HealthRecordsPage.js +16 -16
  64. package/dist/healthybowl/pages/livestock/HealthRecordsPage.js.map +1 -1
  65. package/dist/healthybowl/pages/livestock/ProductionTrackingPage.js +4 -4
  66. package/dist/healthybowl/pages/livestock/VaccinationSchedulePage.js +4 -4
  67. package/dist/healthybowl/pages/market/MarketPricesPage.js +305 -305
  68. package/dist/healthybowl/pages/market/MarketPricesPage.js.map +1 -1
  69. package/dist/healthybowl/pages/network/CohortsPage.js +107 -107
  70. package/dist/healthybowl/pages/network/CohortsPage.js.map +1 -1
  71. package/dist/healthybowl/pages/network/CommunityPage.js +247 -247
  72. package/dist/healthybowl/pages/network/CommunityPage.js.map +1 -1
  73. package/dist/healthybowl/pages/network/EventsPage.js +16 -16
  74. package/dist/healthybowl/pages/network/EventsPage.js.map +1 -1
  75. package/dist/healthybowl/pages/network/ExpertsPage.js +470 -470
  76. package/dist/healthybowl/pages/network/ExpertsPage.js.map +1 -1
  77. package/dist/healthybowl/pages/network/MentorsPage.js +6 -6
  78. package/dist/healthybowl/pages/pest-management/PestIssuesPage.js +8 -8
  79. package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js +7 -7
  80. package/dist/healthybowl/pages/pest-management/TreatmentLibraryPage.js.map +1 -1
  81. package/dist/healthybowl/pages/production/ProductionBatchesPage.js +7 -7
  82. package/dist/healthybowl/pages/production/RecipeManagementPage.js +5 -5
  83. package/dist/healthybowl/pages/production/ValueAddedProductsPage.js +7 -7
  84. package/dist/healthybowl/pages/soil/SoilTestsPage.js +6 -6
  85. package/dist/healthybowl/pages/soil/SoilTestsPage.js.map +1 -1
  86. package/dist/healthybowl/pages/suppliers/SuppliersPage.js +10 -10
  87. package/dist/healthybowl/pages/sustainability/CarbonCreditLedgerPage.js +6 -6
  88. package/dist/healthybowl/pages/terrace/PlantingFormModal.js +151 -131
  89. package/dist/healthybowl/pages/terrace/PlantingFormModal.js.map +1 -1
  90. package/dist/healthybowl/pages/traceability/BatchTrackingPage.js +6 -6
  91. package/dist/healthybowl/utils/cropComparison.js +1 -1
  92. package/dist/healthybowl/utils/cropComparison.js.map +1 -1
  93. package/dist/healthybowl/utils/cropPicker.js +35 -0
  94. package/dist/healthybowl/utils/cropPicker.js.map +1 -0
  95. package/dist/healthybowl/utils/plantingCapacity.js +2 -2
  96. package/dist/healthybowl/utils/plantingCapacity.js.map +1 -1
  97. package/dist/healthybowl/utils/quotaLabels.js +8 -0
  98. package/dist/healthybowl/utils/quotaLabels.js.map +1 -0
  99. package/dist/healthybowl/utils/seedRate.js +1 -8
  100. package/dist/healthybowl/utils/seedRate.js.map +1 -1
  101. package/package.json +1 -1
@@ -1,21 +1,24 @@
1
- import { PageLayout as e } from "../../components/PageLayout.js";
2
- import { DataTable as t } from "../../components/DataTable.js";
3
- import { ErrorState as n } from "../../components/ErrorState.js";
4
- import { FilterBar as r } from "../../components/FilterBar.js";
5
- import { ToastContainer as i } from "../../components/Toast.js";
6
- import { useConfirm as a } from "../../components/ConfirmDialog.js";
7
- import { PageLoader as o } from "../../components/PageLoader.js";
8
- import { Modal as s } from "../../components/Modal.js";
9
- import { useToast as c } from "../../hooks/useToast.js";
1
+ import { useHealthyBowl as e } from "../../context/HealthyBowlContext.js";
2
+ import { PageLayout as t } from "../../components/PageLayout.js";
3
+ import { DataTable as n } from "../../components/DataTable.js";
4
+ import { groupPickerRecords as r } from "../../utils/cropPicker.js";
5
+ import { usePlantCatalog as i, usePlantCatalogPage as a } from "../../hooks/usePlantCatalog.js";
6
+ import { ErrorState as o } from "../../components/ErrorState.js";
7
+ import { ToastContainer as s } from "../../components/Toast.js";
8
+ import { useConfirm as c } from "../../components/ConfirmDialog.js";
9
+ import { PageLoader as ee } from "../../components/PageLoader.js";
10
+ import { Modal as te } from "../../components/Modal.js";
11
+ import { useToast as ne } from "../../hooks/useToast.js";
10
12
  import "../../components/index.js";
11
- import { usePlantCatalog as l } from "../../hooks/usePlantCatalog.js";
12
- import { useMemo as u, useState as d } from "react";
13
- import { useI18n as f } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
14
- import { Pencil as p, Plus as m, Sprout as h, Trash2 as g } from "lucide-react";
15
- import { Fragment as _, jsx as v, jsxs as y } from "react/jsx-runtime";
16
- import { Button as b } from "@burdenoff/fe-libs/ui";
13
+ import { WorkspaceBrowseFilters as re } from "./WorkspaceBrowseFilters.js";
14
+ import { useClampBrowseOffset as ie } from "./browsePagination.js";
15
+ import { useMemo as l, useState as u } from "react";
16
+ import { useI18n as d } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
17
+ import { Pencil as f, Plus as p, Sprout as m, Trash2 as h } from "lucide-react";
18
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
19
+ import { Button as y } from "@burdenoff/fe-libs/ui";
17
20
  //#region src/healthybowl/pages/catalog/PlantCatalogPage.tsx
18
- var x = {
21
+ var b = {
19
22
  name: "",
20
23
  category: "",
21
24
  variety: "",
@@ -27,24 +30,41 @@ var x = {
27
30
  seedsPerCell: "",
28
31
  organicSuitable: !1,
29
32
  notes: ""
30
- }, S = (e) => {
33
+ }, x = (e) => {
31
34
  let t = e.trim();
32
35
  if (!t) return;
33
36
  let n = Number.parseInt(t, 10);
34
37
  return Number.isFinite(n) ? n : void 0;
35
- }, C = (e) => {
38
+ }, S = (e) => {
36
39
  let t = e.trim();
37
40
  if (!t) return;
38
41
  let n = Number.parseFloat(t);
39
42
  if (Number.isFinite(n)) return Math.min(1, Math.max(0, n / 100));
40
- }, w = (e) => e == null ? "" : String(Math.round(e * 100)), T = (e) => e == null ? "—" : String(e), E = () => {
41
- let { t: E } = f(), D = a(), { entries: O, loading: k, error: A, refetch: j, createEntry: M, updateEntry: N, deleteEntry: P } = l(), [F, I] = d(""), [L, R] = d(!1), [z, B] = d(null), [V, H] = d(!1), [U, W] = d(x), { toasts: G, toast: K, dismiss: q } = c(), J = (e, t) => W((n) => ({
43
+ }, C = (e) => e == null ? "" : String(Math.round(e * 100)), w = (e) => e == null ? "—" : String(e), T = () => {
44
+ let { workspaceId: n } = e();
45
+ return n ? /* @__PURE__ */ _(E, {}, n) : /* @__PURE__ */ _(t, {
46
+ title: "Master Plant List",
47
+ children: /* @__PURE__ */ _("p", {
48
+ className: "text-sm text-text-secondary",
49
+ children: "Choose a workspace to browse its plant catalog."
50
+ })
51
+ });
52
+ }, E = () => {
53
+ let { t: e } = d(), T = c(), { createEntry: E, updateEntry: ae, deleteEntry: oe } = i({ skip: !0 }), [D, se] = u(""), [O, k] = u(""), [A, j] = u(!1), [M, N] = u(0), P = a({
54
+ search: D || void 0,
55
+ category: A ? void 0 : O || void 0,
56
+ uncategorized: A || void 0,
57
+ offset: M,
58
+ limit: 50
59
+ }), { items: F, loading: I, error: L, refetch: R } = P;
60
+ ie(P, N);
61
+ let [z, B] = u(!1), [V, H] = u(null), [U, W] = u(!1), [G, K] = u(b), { toasts: ce, toast: q, dismiss: le } = ne(), J = (e, t) => K((n) => ({
42
62
  ...n,
43
63
  [e]: t
44
64
  })), Y = () => {
45
- W(x), B(null), R(!0);
46
- }, X = (e) => {
47
- W({
65
+ K(b), H(null), B(!0);
66
+ }, ue = (e) => {
67
+ K({
48
68
  name: e.name ?? "",
49
69
  category: e.category ?? "",
50
70
  variety: e.variety ?? "",
@@ -52,124 +72,127 @@ var x = {
52
72
  rowSpacingCm: e.rowSpacingCm == null ? "" : String(e.rowSpacingCm),
53
73
  daysToMaturity: e.daysToMaturity == null ? "" : String(e.daysToMaturity),
54
74
  seedsPerGram: e.seedsPerGram == null ? "" : String(e.seedsPerGram),
55
- germinationRatePct: w(e.germinationRate),
75
+ germinationRatePct: C(e.germinationRate),
56
76
  seedsPerCell: e.seedsPerCell == null ? "" : String(e.seedsPerCell),
57
77
  organicSuitable: e.organicSuitable ?? !1,
58
78
  notes: e.notes ?? ""
59
- }), B(e.id), R(!0);
60
- }, Z = () => {
61
- W(x), B(null), R(!1);
62
- }, Q = async () => {
63
- if (!U.name.trim()) {
64
- K({
65
- title: E("healthybowl.catalog.toast.nameRequired.title", "Name required"),
66
- description: E("healthybowl.catalog.toast.nameRequired.description", "Please enter a plant name."),
79
+ }), H(e.id), B(!0);
80
+ }, X = () => {
81
+ K(b), H(null), B(!1);
82
+ }, de = async () => {
83
+ if (!G.name.trim()) {
84
+ q({
85
+ title: e("healthybowl.catalog.toast.nameRequired.title", "Name required"),
86
+ description: e("healthybowl.catalog.toast.nameRequired.description", "Please enter a plant name."),
67
87
  variant: "warning"
68
88
  });
69
89
  return;
70
90
  }
71
- let e = {
72
- name: U.name.trim(),
73
- category: U.category.trim() || void 0,
74
- variety: U.variety.trim() || void 0,
75
- plantSpacingCm: S(U.plantSpacingCm),
76
- rowSpacingCm: S(U.rowSpacingCm),
77
- daysToMaturity: S(U.daysToMaturity),
78
- seedsPerGram: S(U.seedsPerGram),
79
- germinationRate: C(U.germinationRatePct),
80
- seedsPerCell: S(U.seedsPerCell),
81
- organicSuitable: U.organicSuitable,
82
- notes: U.notes.trim() || void 0
91
+ let t = {
92
+ name: G.name.trim(),
93
+ category: G.category.trim() || void 0,
94
+ variety: G.variety.trim() || void 0,
95
+ plantSpacingCm: x(G.plantSpacingCm),
96
+ rowSpacingCm: x(G.rowSpacingCm),
97
+ daysToMaturity: x(G.daysToMaturity),
98
+ seedsPerGram: x(G.seedsPerGram),
99
+ germinationRate: S(G.germinationRatePct),
100
+ seedsPerCell: x(G.seedsPerCell),
101
+ organicSuitable: G.organicSuitable,
102
+ notes: G.notes.trim() || void 0
83
103
  };
84
- H(!0);
104
+ W(!0);
85
105
  try {
86
- z ? (await N(z, e), K({
87
- title: E("healthybowl.catalog.toast.updated.title", "Entry updated"),
88
- description: E("healthybowl.catalog.toast.updated.description", "\"{{name}}\" has been updated.", { name: e.name }),
106
+ V ? (await ae(V, t), q({
107
+ title: e("healthybowl.catalog.toast.updated.title", "Entry updated"),
108
+ description: e("healthybowl.catalog.toast.updated.description", "\"{{name}}\" has been updated.", { name: t.name }),
89
109
  variant: "success"
90
- })) : (await M(e), K({
91
- title: E("healthybowl.catalog.toast.added.title", "Entry added"),
92
- description: E("healthybowl.catalog.toast.added.description", "\"{{name}}\" has been added to the catalog.", { name: e.name }),
110
+ })) : (await E(t), q({
111
+ title: e("healthybowl.catalog.toast.added.title", "Entry added"),
112
+ description: e("healthybowl.catalog.toast.added.description", "\"{{name}}\" has been added to the catalog.", { name: t.name }),
93
113
  variant: "success"
94
- })), Z();
95
- } catch (e) {
96
- K({
97
- title: z ? E("healthybowl.catalog.toast.updateError.title", "Could not update entry") : E("healthybowl.catalog.toast.addError.title", "Could not add entry"),
98
- description: e instanceof Error ? e.message : E("healthybowl.catalog.toast.genericError.description", "Something went wrong. Please try again."),
114
+ })), X(), await R();
115
+ } catch (t) {
116
+ q({
117
+ title: V ? e("healthybowl.catalog.toast.updateError.title", "Could not update entry") : e("healthybowl.catalog.toast.addError.title", "Could not add entry"),
118
+ description: t instanceof Error ? t.message : e("healthybowl.catalog.toast.genericError.description", "Something went wrong. Please try again."),
99
119
  variant: "error"
100
120
  });
101
121
  } finally {
102
- H(!1);
122
+ W(!1);
103
123
  }
104
- }, $ = async (e) => {
105
- if (await D({ message: E("healthybowl.catalog.confirm.delete", "Delete \"{{name}}\"? This cannot be undone.", { name: e.name }) })) try {
106
- await P(e.id), K({
107
- title: E("healthybowl.catalog.toast.deleted.title", "Entry deleted"),
108
- description: E("healthybowl.catalog.toast.deleted.description", "\"{{name}}\" has been removed.", { name: e.name }),
124
+ }, fe = async (t) => {
125
+ if (await T({ message: e("healthybowl.catalog.confirm.delete", "Delete \"{{name}}\"? This cannot be undone.", { name: t.name }) })) try {
126
+ await oe(t.id), await R(), q({
127
+ title: e("healthybowl.catalog.toast.deleted.title", "Entry deleted"),
128
+ description: e("healthybowl.catalog.toast.deleted.description", "\"{{name}}\" has been removed.", { name: t.name }),
109
129
  variant: "success"
110
130
  });
111
- } catch (e) {
112
- K({
113
- title: E("healthybowl.catalog.toast.deleteError.title", "Could not delete entry"),
114
- description: e instanceof Error ? e.message : E("healthybowl.catalog.toast.genericError.description", "Something went wrong. Please try again."),
131
+ } catch (t) {
132
+ q({
133
+ title: e("healthybowl.catalog.toast.deleteError.title", "Could not delete entry"),
134
+ description: t instanceof Error ? t.message : e("healthybowl.catalog.toast.genericError.description", "Something went wrong. Please try again."),
115
135
  variant: "error"
116
136
  });
117
137
  }
118
- }, ee = u(() => {
119
- let e = F.toLowerCase();
120
- return O.filter((t) => t.name.toLowerCase().includes(e) || (t.category ?? "").toLowerCase().includes(e) || (t.variety ?? "").toLowerCase().includes(e));
121
- }, [O, F]), te = [
138
+ }, Z = l(() => r(F), [F]), pe = Z.flatMap((e) => e.category === null ? [] : [e.category]), me = !!(D || O || A), he = (e) => {
139
+ se(e), N(0);
140
+ }, Q = (e) => {
141
+ k(e), N(0);
142
+ }, $ = (e) => {
143
+ j(e), N(0);
144
+ }, ge = [
122
145
  {
123
146
  key: "name",
124
- header: E("healthybowl.catalog.columns.name", "Name"),
125
- render: (e) => /* @__PURE__ */ v("span", {
147
+ header: e("healthybowl.catalog.columns.name", "Name"),
148
+ render: (e) => /* @__PURE__ */ _("span", {
126
149
  className: "font-medium text-text-primary",
127
150
  children: e.name
128
151
  })
129
152
  },
130
153
  {
131
154
  key: "category",
132
- header: E("healthybowl.catalog.columns.category", "Category"),
133
- render: (e) => /* @__PURE__ */ v("span", {
155
+ header: e("healthybowl.catalog.columns.category", "Category"),
156
+ render: (e) => /* @__PURE__ */ _("span", {
134
157
  className: "text-text-secondary",
135
158
  children: e.category || "—"
136
159
  })
137
160
  },
138
161
  {
139
162
  key: "variety",
140
- header: E("healthybowl.catalog.columns.variety", "Variety"),
141
- render: (e) => /* @__PURE__ */ v("span", {
163
+ header: e("healthybowl.catalog.columns.variety", "Variety"),
164
+ render: (e) => /* @__PURE__ */ _("span", {
142
165
  className: "text-text-secondary",
143
166
  children: e.variety || "—"
144
167
  })
145
168
  },
146
169
  {
147
170
  key: "plantSpacingCm",
148
- header: E("healthybowl.catalog.columns.plantSpacing", "Plant spacing (cm)"),
149
- render: (e) => T(e.plantSpacingCm)
171
+ header: e("healthybowl.catalog.columns.plantSpacing", "Plant spacing (cm)"),
172
+ render: (e) => w(e.plantSpacingCm)
150
173
  },
151
174
  {
152
175
  key: "rowSpacingCm",
153
- header: E("healthybowl.catalog.columns.rowSpacing", "Row spacing (cm)"),
154
- render: (e) => T(e.rowSpacingCm)
176
+ header: e("healthybowl.catalog.columns.rowSpacing", "Row spacing (cm)"),
177
+ render: (e) => w(e.rowSpacingCm)
155
178
  },
156
179
  {
157
180
  key: "daysToMaturity",
158
- header: E("healthybowl.catalog.columns.daysToMaturity", "Days to maturity"),
159
- render: (e) => T(e.daysToMaturity)
181
+ header: e("healthybowl.catalog.columns.daysToMaturity", "Days to maturity"),
182
+ render: (e) => w(e.daysToMaturity)
160
183
  },
161
184
  {
162
185
  key: "seedsPerGram",
163
- header: E("healthybowl.catalog.columns.seedsPerGram", "Seeds / g"),
164
- render: (e) => T(e.seedsPerGram)
186
+ header: e("healthybowl.catalog.columns.seedsPerGram", "Seeds / g"),
187
+ render: (e) => w(e.seedsPerGram)
165
188
  },
166
189
  {
167
190
  key: "organicSuitable",
168
- header: E("healthybowl.catalog.columns.organic", "Organic"),
169
- render: (e) => e.organicSuitable ? /* @__PURE__ */ v("span", {
191
+ header: e("healthybowl.catalog.columns.organic", "Organic"),
192
+ render: (t) => t.organicSuitable ? /* @__PURE__ */ _("span", {
170
193
  className: "rounded-full bg-status-success-bg/10 px-2 py-0.5 text-xs font-medium text-status-success-text",
171
- children: E("healthybowl.catalog.organic.yes", "Yes")
172
- }) : /* @__PURE__ */ v("span", {
194
+ children: e("healthybowl.catalog.organic.yes", "Yes")
195
+ }) : /* @__PURE__ */ _("span", {
173
196
  className: "text-text-secondary",
174
197
  children: "—"
175
198
  })
@@ -179,261 +202,312 @@ var x = {
179
202
  header: "",
180
203
  sortable: !1,
181
204
  className: "text-end",
182
- render: (e) => /* @__PURE__ */ y("div", {
205
+ render: (t) => /* @__PURE__ */ v("div", {
183
206
  className: "flex items-center justify-end gap-2",
184
- children: [/* @__PURE__ */ v(b, {
207
+ children: [/* @__PURE__ */ _(y, {
185
208
  variant: "outline",
186
209
  size: "icon-sm",
187
- onClick: (t) => {
188
- t.stopPropagation(), X(e);
210
+ onClick: (e) => {
211
+ e.stopPropagation(), ue(t);
189
212
  },
190
- "aria-label": E("healthybowl.common.edit", "Edit"),
191
- children: /* @__PURE__ */ v(p, { className: "h-4 w-4" })
192
- }), /* @__PURE__ */ v(b, {
213
+ "aria-label": e("healthybowl.common.edit", "Edit"),
214
+ children: /* @__PURE__ */ _(f, { className: "h-4 w-4" })
215
+ }), /* @__PURE__ */ _(y, {
193
216
  variant: "ghost",
194
217
  size: "icon-sm",
195
- onClick: (t) => {
196
- t.stopPropagation(), $(e);
218
+ onClick: (e) => {
219
+ e.stopPropagation(), fe(t);
197
220
  },
198
- "aria-label": E("healthybowl.common.delete", "Delete"),
221
+ "aria-label": e("healthybowl.common.delete", "Delete"),
199
222
  className: "text-status-error-text hover:bg-status-error-bg/10 hover:text-status-error-text",
200
- children: /* @__PURE__ */ v(g, { className: "h-4 w-4" })
223
+ children: /* @__PURE__ */ _(h, { className: "h-4 w-4" })
201
224
  })]
202
225
  })
203
226
  }
204
227
  ];
205
- return /* @__PURE__ */ y(e, {
206
- title: E("healthybowl.catalog.title", "Master Plant List"),
207
- description: E("healthybowl.catalog.description", "Your reference catalog of plant varieties and spacing defaults"),
228
+ return /* @__PURE__ */ v(t, {
229
+ title: e("healthybowl.catalog.title", "Master Plant List"),
230
+ description: e("healthybowl.catalog.description", "Your reference catalog of plant varieties and spacing defaults"),
208
231
  purpose: "A single, editable catalog of the varieties you grow — with the spacing and maturity you rely on. Set them once here and they feed straight into planting-capacity planning, so every new bed starts from your own proven numbers.",
209
- actions: /* @__PURE__ */ y(b, {
232
+ actions: /* @__PURE__ */ v(y, {
210
233
  onClick: Y,
211
234
  children: [
212
- /* @__PURE__ */ v(m, { className: "h-4 w-4" }),
235
+ /* @__PURE__ */ _(p, { className: "h-4 w-4" }),
213
236
  " ",
214
- E("healthybowl.catalog.actions.add", "Add Entry")
237
+ e("healthybowl.catalog.actions.add", "Add Entry")
215
238
  ]
216
239
  }),
217
240
  children: [
218
- /* @__PURE__ */ v(r, {
219
- searchValue: F,
220
- onSearchChange: I,
221
- searchPlaceholder: E("healthybowl.catalog.search.placeholder", "Search by name, category or variety...")
241
+ /* @__PURE__ */ _(re, {
242
+ id: "plant-catalog-browse",
243
+ search: D,
244
+ category: O,
245
+ uncategorized: A,
246
+ onSearchChange: he,
247
+ onCategoryChange: Q,
248
+ onUncategorizedChange: $,
249
+ categorySuggestions: pe,
250
+ searchLabel: "Search the workspace plant catalog",
251
+ searchPlaceholder: e("healthybowl.catalog.search.placeholder", "Search by name, category or variety...")
222
252
  }),
223
- k && O.length === 0 ? /* @__PURE__ */ v(o, {}) : A && O.length === 0 ? /* @__PURE__ */ v(n, { onRetry: () => void j() }) : O.length === 0 ? /* @__PURE__ */ y("div", {
253
+ I ? /* @__PURE__ */ _(ee, {}) : L ? /* @__PURE__ */ _(o, { onRetry: () => void R().catch(() => void 0) }) : P.total === 0 && !me ? /* @__PURE__ */ v("div", {
224
254
  className: "flex flex-col items-center justify-center gap-3 rounded-xl border border-border-seam bg-gloss-card p-12 text-center",
225
255
  children: [
226
- /* @__PURE__ */ v("div", {
256
+ /* @__PURE__ */ _("div", {
227
257
  className: "flex h-12 w-12 items-center justify-center rounded-full bg-bg-sunken",
228
- children: /* @__PURE__ */ v(h, { className: "h-6 w-6 text-text-secondary" })
258
+ children: /* @__PURE__ */ _(m, { className: "h-6 w-6 text-text-secondary" })
229
259
  }),
230
- /* @__PURE__ */ v("p", {
260
+ /* @__PURE__ */ _("p", {
231
261
  className: "text-sm font-medium text-text-primary",
232
- children: E("healthybowl.catalog.emptyState.title", "No plants in your catalog yet")
262
+ children: e("healthybowl.catalog.emptyState.title", "No plants in your catalog yet")
233
263
  }),
234
- /* @__PURE__ */ v("p", {
264
+ /* @__PURE__ */ _("p", {
235
265
  className: "max-w-sm text-sm text-text-secondary",
236
- children: E("healthybowl.catalog.emptyState.description", "Add the varieties you grow to reuse their spacing and maturity across the app.")
266
+ children: e("healthybowl.catalog.emptyState.description", "Add the varieties you grow to reuse their spacing and maturity across the app.")
237
267
  }),
238
- /* @__PURE__ */ y(b, {
268
+ /* @__PURE__ */ v(y, {
239
269
  onClick: Y,
240
270
  className: "mt-1",
241
271
  children: [
242
- /* @__PURE__ */ v(m, { className: "h-4 w-4" }),
272
+ /* @__PURE__ */ _(p, { className: "h-4 w-4" }),
243
273
  " ",
244
- E("healthybowl.catalog.actions.add", "Add Entry")
274
+ e("healthybowl.catalog.actions.add", "Add Entry")
245
275
  ]
246
276
  })
247
277
  ]
248
- }) : /* @__PURE__ */ v(t, {
249
- columns: te,
250
- data: ee,
251
- keyField: "id",
252
- emptyMessage: E("healthybowl.catalog.noMatches", "No entries match your search.")
278
+ }) : /* @__PURE__ */ v("div", {
279
+ className: "space-y-3",
280
+ children: [
281
+ /* @__PURE__ */ v("p", {
282
+ role: "status",
283
+ className: "text-sm text-text-secondary",
284
+ children: [
285
+ P.total,
286
+ " matching workspace entries · ",
287
+ F.length,
288
+ " on this page"
289
+ ]
290
+ }),
291
+ Z.length > 0 && /* @__PURE__ */ v("div", {
292
+ className: "space-y-2",
293
+ children: [/* @__PURE__ */ _("h2", {
294
+ className: "text-xs font-medium text-text-secondary",
295
+ children: "Categories on this page"
296
+ }), /* @__PURE__ */ _("div", {
297
+ className: "flex flex-wrap gap-2",
298
+ children: Z.map((e) => /* @__PURE__ */ v(y, {
299
+ variant: "outline",
300
+ size: "sm",
301
+ onClick: () => {
302
+ Q(e.category ?? ""), $(e.category === null);
303
+ },
304
+ children: [
305
+ e.label,
306
+ " · ",
307
+ e.items.length,
308
+ " on this page"
309
+ ]
310
+ }, e.category === null ? "missing-category" : `category:${e.category}`))
311
+ })]
312
+ }),
313
+ /* @__PURE__ */ _(n, {
314
+ columns: ge,
315
+ data: Z.flatMap((e) => e.items),
316
+ keyField: "id",
317
+ emptyMessage: e("healthybowl.catalog.noMatches", "No entries match your search or category."),
318
+ pagination: {
319
+ total: P.total,
320
+ limit: P.limit,
321
+ offset: P.offset,
322
+ onOffsetChange: N,
323
+ loading: I
324
+ }
325
+ })
326
+ ]
253
327
  }),
254
- /* @__PURE__ */ v(s, {
255
- open: L,
256
- onClose: Z,
257
- title: z ? E("healthybowl.catalog.modal.editTitle", "Edit Plant Entry") : E("healthybowl.catalog.modal.title", "Add Plant Entry"),
258
- description: E("healthybowl.catalog.modal.description", "Record a variety with its spacing and maturity defaults."),
328
+ /* @__PURE__ */ _(te, {
329
+ open: z,
330
+ onClose: X,
331
+ title: V ? e("healthybowl.catalog.modal.editTitle", "Edit Plant Entry") : e("healthybowl.catalog.modal.title", "Add Plant Entry"),
332
+ description: e("healthybowl.catalog.modal.description", "Record a variety with its spacing and maturity defaults."),
259
333
  size: "md",
260
- footer: /* @__PURE__ */ y(_, { children: [/* @__PURE__ */ v(b, {
334
+ footer: /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _(y, {
261
335
  variant: "outline",
262
- onClick: Z,
263
- children: E("healthybowl.common.cancel", "Cancel")
264
- }), /* @__PURE__ */ v(b, {
265
- onClick: Q,
266
- disabled: V,
267
- children: V ? E("healthybowl.catalog.actions.saving", "Saving...") : z ? E("healthybowl.common.saveChanges", "Save Changes") : E("healthybowl.catalog.actions.add", "Add Entry")
336
+ onClick: X,
337
+ children: e("healthybowl.common.cancel", "Cancel")
338
+ }), /* @__PURE__ */ _(y, {
339
+ onClick: de,
340
+ disabled: U,
341
+ children: U ? e("healthybowl.catalog.actions.saving", "Saving...") : V ? e("healthybowl.common.saveChanges", "Save Changes") : e("healthybowl.catalog.actions.add", "Add Entry")
268
342
  })] }),
269
- children: /* @__PURE__ */ y("div", {
343
+ children: /* @__PURE__ */ v("div", {
270
344
  className: "space-y-4",
271
345
  children: [
272
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
346
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
273
347
  htmlFor: "pc-name",
274
348
  className: "mb-1 block text-sm font-medium text-text-primary",
275
- children: E("healthybowl.catalog.form.name.label", "Name *")
276
- }), /* @__PURE__ */ v("input", {
349
+ children: e("healthybowl.catalog.form.name.label", "Name *")
350
+ }), /* @__PURE__ */ _("input", {
277
351
  id: "pc-name",
278
352
  type: "text",
279
- value: U.name,
353
+ value: G.name,
280
354
  onChange: (e) => J("name", e.target.value),
281
- placeholder: E("healthybowl.catalog.form.name.placeholder", "e.g., Tomato"),
355
+ placeholder: e("healthybowl.catalog.form.name.placeholder", "e.g., Tomato"),
282
356
  className: "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)]"
283
357
  })] }),
284
- /* @__PURE__ */ y("div", {
358
+ /* @__PURE__ */ v("div", {
285
359
  className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
286
- children: [/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
360
+ children: [/* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
287
361
  htmlFor: "pc-category",
288
362
  className: "mb-1 block text-sm font-medium text-text-primary",
289
- children: E("healthybowl.catalog.form.category.label", "Category")
290
- }), /* @__PURE__ */ v("input", {
363
+ children: e("healthybowl.catalog.form.category.label", "Category")
364
+ }), /* @__PURE__ */ _("input", {
291
365
  id: "pc-category",
292
366
  type: "text",
293
- value: U.category,
367
+ value: G.category,
294
368
  onChange: (e) => J("category", e.target.value),
295
- placeholder: E("healthybowl.catalog.form.category.placeholder", "e.g., Vegetable"),
369
+ placeholder: e("healthybowl.catalog.form.category.placeholder", "e.g., Vegetable"),
296
370
  className: "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)]"
297
- })] }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
371
+ })] }), /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
298
372
  htmlFor: "pc-variety",
299
373
  className: "mb-1 block text-sm font-medium text-text-primary",
300
- children: E("healthybowl.catalog.form.variety.label", "Variety")
301
- }), /* @__PURE__ */ v("input", {
374
+ children: e("healthybowl.catalog.form.variety.label", "Variety")
375
+ }), /* @__PURE__ */ _("input", {
302
376
  id: "pc-variety",
303
377
  type: "text",
304
- value: U.variety,
378
+ value: G.variety,
305
379
  onChange: (e) => J("variety", e.target.value),
306
- placeholder: E("healthybowl.catalog.form.variety.placeholder", "e.g., Roma"),
380
+ placeholder: e("healthybowl.catalog.form.variety.placeholder", "e.g., Roma"),
307
381
  className: "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)]"
308
382
  })] })]
309
383
  }),
310
- /* @__PURE__ */ y("div", {
384
+ /* @__PURE__ */ v("div", {
311
385
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
312
386
  children: [
313
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
387
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
314
388
  htmlFor: "pc-plant-spacing",
315
389
  className: "mb-1 block text-sm font-medium text-text-primary",
316
- children: E("healthybowl.catalog.form.plantSpacing.label", "Plant spacing (cm)")
317
- }), /* @__PURE__ */ v("input", {
390
+ children: e("healthybowl.catalog.form.plantSpacing.label", "Plant spacing (cm)")
391
+ }), /* @__PURE__ */ _("input", {
318
392
  id: "pc-plant-spacing",
319
393
  type: "number",
320
394
  min: "0",
321
395
  step: "1",
322
- value: U.plantSpacingCm,
396
+ value: G.plantSpacingCm,
323
397
  onChange: (e) => J("plantSpacingCm", e.target.value),
324
398
  placeholder: "45",
325
399
  className: "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)]"
326
400
  })] }),
327
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
401
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
328
402
  htmlFor: "pc-row-spacing",
329
403
  className: "mb-1 block text-sm font-medium text-text-primary",
330
- children: E("healthybowl.catalog.form.rowSpacing.label", "Row spacing (cm)")
331
- }), /* @__PURE__ */ v("input", {
404
+ children: e("healthybowl.catalog.form.rowSpacing.label", "Row spacing (cm)")
405
+ }), /* @__PURE__ */ _("input", {
332
406
  id: "pc-row-spacing",
333
407
  type: "number",
334
408
  min: "0",
335
409
  step: "1",
336
- value: U.rowSpacingCm,
410
+ value: G.rowSpacingCm,
337
411
  onChange: (e) => J("rowSpacingCm", e.target.value),
338
412
  placeholder: "90",
339
413
  className: "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)]"
340
414
  })] }),
341
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
415
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
342
416
  htmlFor: "pc-maturity",
343
417
  className: "mb-1 block text-sm font-medium text-text-primary",
344
- children: E("healthybowl.catalog.form.daysToMaturity.label", "Days to maturity")
345
- }), /* @__PURE__ */ v("input", {
418
+ children: e("healthybowl.catalog.form.daysToMaturity.label", "Days to maturity")
419
+ }), /* @__PURE__ */ _("input", {
346
420
  id: "pc-maturity",
347
421
  type: "number",
348
422
  min: "0",
349
423
  step: "1",
350
- value: U.daysToMaturity,
424
+ value: G.daysToMaturity,
351
425
  onChange: (e) => J("daysToMaturity", e.target.value),
352
426
  placeholder: "75",
353
427
  className: "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)]"
354
428
  })] })
355
429
  ]
356
430
  }),
357
- /* @__PURE__ */ y("div", {
431
+ /* @__PURE__ */ v("div", {
358
432
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
359
433
  children: [
360
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
434
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
361
435
  htmlFor: "pc-seeds-per-gram",
362
436
  className: "mb-1 block text-sm font-medium text-text-primary",
363
- children: E("healthybowl.catalog.form.seedsPerGram.label", "Seeds per gram")
364
- }), /* @__PURE__ */ v("input", {
437
+ children: e("healthybowl.catalog.form.seedsPerGram.label", "Seeds per gram")
438
+ }), /* @__PURE__ */ _("input", {
365
439
  id: "pc-seeds-per-gram",
366
440
  type: "number",
367
441
  min: "0",
368
442
  step: "1",
369
- value: U.seedsPerGram,
443
+ value: G.seedsPerGram,
370
444
  onChange: (e) => J("seedsPerGram", e.target.value),
371
445
  placeholder: "300",
372
446
  className: "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)]"
373
447
  })] }),
374
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
448
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
375
449
  htmlFor: "pc-germination",
376
450
  className: "mb-1 block text-sm font-medium text-text-primary",
377
- children: E("healthybowl.catalog.form.germinationRate.label", "Germination rate (%)")
378
- }), /* @__PURE__ */ v("input", {
451
+ children: e("healthybowl.catalog.form.germinationRate.label", "Germination rate (%)")
452
+ }), /* @__PURE__ */ _("input", {
379
453
  id: "pc-germination",
380
454
  type: "number",
381
455
  min: "0",
382
456
  max: "100",
383
457
  step: "1",
384
- value: U.germinationRatePct,
458
+ value: G.germinationRatePct,
385
459
  onChange: (e) => J("germinationRatePct", e.target.value),
386
460
  placeholder: "85",
387
461
  className: "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)]"
388
462
  })] }),
389
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
463
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
390
464
  htmlFor: "pc-seeds-per-cell",
391
465
  className: "mb-1 block text-sm font-medium text-text-primary",
392
- children: E("healthybowl.catalog.form.seedsPerCell.label", "Seeds per cell")
393
- }), /* @__PURE__ */ v("input", {
466
+ children: e("healthybowl.catalog.form.seedsPerCell.label", "Seeds per cell")
467
+ }), /* @__PURE__ */ _("input", {
394
468
  id: "pc-seeds-per-cell",
395
469
  type: "number",
396
470
  min: "0",
397
471
  step: "1",
398
- value: U.seedsPerCell,
472
+ value: G.seedsPerCell,
399
473
  onChange: (e) => J("seedsPerCell", e.target.value),
400
474
  placeholder: "2",
401
475
  className: "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)]"
402
476
  })] })
403
477
  ]
404
478
  }),
405
- /* @__PURE__ */ y("label", {
479
+ /* @__PURE__ */ v("label", {
406
480
  className: "flex cursor-pointer items-center gap-2 text-sm font-medium text-text-primary",
407
- children: [/* @__PURE__ */ v("input", {
481
+ children: [/* @__PURE__ */ _("input", {
408
482
  type: "checkbox",
409
- checked: U.organicSuitable,
483
+ checked: G.organicSuitable,
410
484
  onChange: (e) => J("organicSuitable", e.target.checked),
411
485
  className: "h-4 w-4 rounded border-border-subtle text-primary focus:ring-[var(--color-focus-ring)]"
412
- }), E("healthybowl.catalog.form.organicSuitable.label", "Suitable for organic production")]
486
+ }), e("healthybowl.catalog.form.organicSuitable.label", "Suitable for organic production")]
413
487
  }),
414
- /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
488
+ /* @__PURE__ */ v("div", { children: [/* @__PURE__ */ _("label", {
415
489
  htmlFor: "pc-notes",
416
490
  className: "mb-1 block text-sm font-medium text-text-primary",
417
- children: E("healthybowl.catalog.form.notes.label", "Notes")
418
- }), /* @__PURE__ */ v("textarea", {
491
+ children: e("healthybowl.catalog.form.notes.label", "Notes")
492
+ }), /* @__PURE__ */ _("textarea", {
419
493
  id: "pc-notes",
420
494
  rows: 3,
421
- value: U.notes,
495
+ value: G.notes,
422
496
  onChange: (e) => J("notes", e.target.value),
423
- placeholder: E("healthybowl.catalog.form.notes.placeholder", "Optional growing notes, seed source, etc."),
497
+ placeholder: e("healthybowl.catalog.form.notes.placeholder", "Optional growing notes, seed source, etc."),
424
498
  className: "w-full rounded-md border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
425
499
  })] })
426
500
  ]
427
501
  })
428
502
  }),
429
- /* @__PURE__ */ v(i, {
430
- toasts: G,
431
- onDismiss: q
503
+ /* @__PURE__ */ _(s, {
504
+ toasts: ce,
505
+ onDismiss: le
432
506
  })
433
507
  ]
434
508
  });
435
509
  };
436
510
  //#endregion
437
- export { E as PlantCatalogPage };
511
+ export { T as PlantCatalogPage };
438
512
 
439
513
  //# sourceMappingURL=PlantCatalogPage.js.map