@burdenoff/microfe-movethewheels 2026.920.2 → 2026.921.1

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 (82) hide show
  1. package/dist/components/CarbonFootprintPanel.js +1 -1
  2. package/dist/components/CustomerPicker.js +271 -0
  3. package/dist/components/DataTable.js +140 -139
  4. package/dist/components/DocumentsCard.js +14 -8
  5. package/dist/generated/wspace-types.d.ts +1043 -5
  6. package/dist/hooks/useAnalytics.js +21 -1
  7. package/dist/hooks/useCustomers.js +94 -78
  8. package/dist/hooks/useDebouncedValue.js +11 -0
  9. package/dist/hooks/useEntityDocuments.js +28 -18
  10. package/dist/hooks/useEpod.js +24 -17
  11. package/dist/hooks/useFleet.js +146 -125
  12. package/dist/hooks/useInventory.js +255 -186
  13. package/dist/hooks/useMultiModalShipments.js +35 -27
  14. package/dist/hooks/useOrders.js +73 -73
  15. package/dist/hooks/useRoutes.js +97 -75
  16. package/dist/hooks/useTracking.js +100 -88
  17. package/dist/movethewheels/components/CustomerPicker.d.ts +19 -0
  18. package/dist/movethewheels/components/DataTable.d.ts +5 -1
  19. package/dist/movethewheels/hooks/useCustomers.d.ts +0 -1
  20. package/dist/movethewheels/hooks/useDebouncedValue.d.ts +1 -0
  21. package/dist/movethewheels/hooks/useEntityDocuments.d.ts +2 -0
  22. package/dist/movethewheels/hooks/useEpod.d.ts +6 -1
  23. package/dist/movethewheels/hooks/useFleet.d.ts +49 -5
  24. package/dist/movethewheels/hooks/useInventory.d.ts +24 -17
  25. package/dist/movethewheels/hooks/useMultiModalShipments.d.ts +6 -1
  26. package/dist/movethewheels/hooks/useOrders.d.ts +33 -5
  27. package/dist/movethewheels/hooks/useRoutes.d.ts +2 -1
  28. package/dist/movethewheels/hooks/useTracking.d.ts +12 -11
  29. package/dist/movethewheels/types/index.d.ts +7 -5
  30. package/dist/movethewheels/utils/navigation.d.ts +14 -0
  31. package/dist/pages/CreateOrderPage.js +228 -217
  32. package/dist/pages/CustomerDetailsPage.js +220 -220
  33. package/dist/pages/CustomersPage.js +61 -54
  34. package/dist/pages/DeliveryCapturePage.js +131 -109
  35. package/dist/pages/DriversPage.js +100 -92
  36. package/dist/pages/InventoryPage.js +239 -236
  37. package/dist/pages/MultiModalShipmentPage.js +163 -130
  38. package/dist/pages/OrderDetailsPage.js +224 -208
  39. package/dist/pages/OrdersListPage.js +66 -60
  40. package/dist/pages/ProductDetailsPage.js +241 -200
  41. package/dist/pages/ProductsPage.js +59 -52
  42. package/dist/pages/RouteDetailsPage.js +343 -321
  43. package/dist/pages/RoutesPage.js +55 -48
  44. package/dist/pages/VehiclesPage.js +63 -56
  45. package/dist/pages/WarehousesPage.js +60 -53
  46. package/dist/utils/navigation.js +22 -1
  47. package/package.json +1 -1
  48. package/src/generated/wspace-types.ts +1188 -5
  49. package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
  50. package/src/movethewheels/components/CustomerPicker.tsx +321 -0
  51. package/src/movethewheels/components/DataTable.tsx +34 -18
  52. package/src/movethewheels/components/DocumentsCard.tsx +6 -1
  53. package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
  54. package/src/movethewheels/hooks/useAnalytics.ts +27 -0
  55. package/src/movethewheels/hooks/useCustomers.ts +64 -24
  56. package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
  57. package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
  58. package/src/movethewheels/hooks/useEpod.ts +14 -7
  59. package/src/movethewheels/hooks/useFleet.ts +58 -37
  60. package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
  61. package/src/movethewheels/hooks/useInventory.ts +211 -90
  62. package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
  63. package/src/movethewheels/hooks/useOrders.ts +13 -14
  64. package/src/movethewheels/hooks/useRoutes.ts +80 -23
  65. package/src/movethewheels/hooks/useTracking.ts +130 -98
  66. package/src/movethewheels/pages/CreateOrderPage.tsx +92 -31
  67. package/src/movethewheels/pages/CustomerDetailsPage.tsx +15 -6
  68. package/src/movethewheels/pages/CustomersPage.tsx +11 -1
  69. package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
  70. package/src/movethewheels/pages/DriversPage.tsx +24 -12
  71. package/src/movethewheels/pages/InventoryPage.tsx +57 -32
  72. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
  73. package/src/movethewheels/pages/OrderDetailsPage.tsx +17 -1
  74. package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
  75. package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
  76. package/src/movethewheels/pages/ProductsPage.tsx +11 -1
  77. package/src/movethewheels/pages/RouteDetailsPage.tsx +35 -5
  78. package/src/movethewheels/pages/RoutesPage.tsx +11 -1
  79. package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
  80. package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
  81. package/src/movethewheels/types/index.ts +7 -5
  82. package/src/movethewheels/utils/navigation.ts +32 -0
@@ -4,27 +4,28 @@ import { ArrowUpRight as n } from "../node_modules/lucide-react/dist/esm/icons/a
4
4
  import { Boxes as r } from "../node_modules/lucide-react/dist/esm/icons/boxes.js";
5
5
  import { ChevronRight as i } from "../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
6
6
  import { CircleCheck as a } from "../node_modules/lucide-react/dist/esm/icons/circle-check.js";
7
- import { History as o } from "../node_modules/lucide-react/dist/esm/icons/history.js";
8
- import { Lock as s } from "../node_modules/lucide-react/dist/esm/icons/lock.js";
9
- import { Package as c } from "../node_modules/lucide-react/dist/esm/icons/package.js";
10
- import { Plus as l } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
11
- import { TriangleAlert as u } from "../node_modules/lucide-react/dist/esm/icons/triangle-alert.js";
12
- import { Warehouse as d } from "../node_modules/lucide-react/dist/esm/icons/warehouse.js";
13
- import { joinPath as f } from "../utils/navigation.js";
14
- import { useMoveTheWheels as p } from "../providers/MoveTheWheelsProvider.js";
15
- import { useInventory as ee, useInventoryStats as m, useInventoryTransactions as h } from "../hooks/useInventory.js";
16
- import { Badge as g, Button as _, Card as v, CardContent as y, CardHeader as b, CardTitle as x, Progress as S } from "../components/ui.js";
17
- import { PageLayout as C, PageSection as w } from "../components/PageLayout.js";
18
- import { MetricCard as T, MetricCardSkeleton as E, MetricGrid as D } from "../components/MetricCard.js";
19
- import { StatusBadge as te } from "../components/StatusBadge.js";
20
- import { DataTable as ne } from "../components/DataTable.js";
21
- import { formatCurrency as re, formatDate as ie } from "../utils/formatters.js";
22
- import { useMemo as ae } from "react";
23
- import { jsx as O, jsxs as k } from "react/jsx-runtime";
24
- import { useI18n as A } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
25
- import { CTAOverflowMenu as j, EmphasisPanel as M, PagePurpose as N } from "@burdenoff/fe-libs/ui";
7
+ import { History as ee } from "../node_modules/lucide-react/dist/esm/icons/history.js";
8
+ import { Lock as te } from "../node_modules/lucide-react/dist/esm/icons/lock.js";
9
+ import { Package as o } from "../node_modules/lucide-react/dist/esm/icons/package.js";
10
+ import { Plus as s } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
11
+ import { TriangleAlert as c } from "../node_modules/lucide-react/dist/esm/icons/triangle-alert.js";
12
+ import { Warehouse as ne } from "../node_modules/lucide-react/dist/esm/icons/warehouse.js";
13
+ import { joinPath as re } from "../utils/navigation.js";
14
+ import { useMoveTheWheels as ie } from "../providers/MoveTheWheelsProvider.js";
15
+ import { useInventory as l, useInventoryStats as u, useInventoryTransactions as ae } from "../hooks/useInventory.js";
16
+ import { Badge as d, Button as f, Card as p, CardContent as m, CardHeader as oe, CardTitle as h, Progress as g } from "../components/ui.js";
17
+ import { PageLayout as _, PageSection as v } from "../components/PageLayout.js";
18
+ import { MetricCard as y, MetricCardSkeleton as b, MetricGrid as x } from "../components/MetricCard.js";
19
+ import { StatusBadge as se } from "../components/StatusBadge.js";
20
+ import { DataTable as ce } from "../components/DataTable.js";
21
+ import { formatCurrency as le, formatDate as ue } from "../utils/formatters.js";
22
+ import { useDebouncedValue as de } from "../hooks/useDebouncedValue.js";
23
+ import { useMemo as fe, useState as S } from "react";
24
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
25
+ import { useI18n as T } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
26
+ import { CTAOverflowMenu as E, EmphasisPanel as D, PagePurpose as O } from "@burdenoff/fe-libs/ui";
26
27
  //#region src/movethewheels/pages/InventoryPage.tsx
27
- var P = {
28
+ var k = {
28
29
  out_of_stock: {
29
30
  bg: "bg-status-error-bg-subtle",
30
31
  text: "text-status-error-text"
@@ -37,336 +38,338 @@ var P = {
37
38
  bg: "bg-status-success-bg-subtle",
38
39
  text: "text-status-success-text"
39
40
  }
40
- }, F = {
41
+ }, A = {
41
42
  RECEIPT: "in",
42
43
  RETURN: "in",
43
44
  ISSUE: "out",
44
45
  TRANSFER: "neutral",
45
46
  ADJUSTMENT: "neutral"
46
- }, I = {
47
+ }, j = {
47
48
  RECEIPT: "Inbound",
48
49
  RETURN: "Return",
49
50
  ISSUE: "Outbound",
50
51
  TRANSFER: "Transfer",
51
52
  ADJUSTMENT: "Adjustment"
52
53
  };
53
- function L() {
54
- let { t: L } = A(), R = (e, t) => {
55
- let n = L(e);
54
+ function M() {
55
+ let { t: M } = T(), N = (e, t) => {
56
+ let n = M(e);
56
57
  return n === e ? t : n;
57
- }, { basePath: z, navigate: B } = p(), { inventory: V, products: H, warehouses: U, isLoading: W, error: G, refetch: K } = ee(), { stats: q } = m(), { transactions: J, isLoading: oe, error: Y } = h({ limit: 8 }), X = (e) => B?.(f(z, e)), Z = (e, t) => {
58
+ }, { basePath: P, navigate: F } = ie(), [I, L] = S(""), [R, z] = S(0), [B, V] = S(10), { inventory: H, lowStockItems: U, products: W, warehouses: pe, totalItems: me, hasMore: he, isLoading: G, error: K, refetch: q } = l({
59
+ search: de(I),
60
+ limit: B,
61
+ offset: R * B
62
+ }), { stats: J } = u(), { transactions: Y, isLoading: ge, error: X } = ae({ limit: 8 }), Z = (e) => F?.(re(P, e)), Q = (e, t) => {
58
63
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), t());
59
- }, Q = V.filter((e) => e.availableQuantity <= e.reorderLevel), $ = R("movethewheels.inventory.lowStock.unknownProduct", "Unknown Product"), se = ae(() => {
60
- let e = new Map(H.map((e) => [e.id, e])), t = new Map(U.map((e) => [e.id, e]));
61
- return V.map((n) => {
62
- let r = e.get(n.productId);
63
- return {
64
- id: n.id,
65
- productId: n.productId,
66
- productName: r?.name ?? $,
67
- sku: r?.sku ?? "—",
68
- warehouseName: t.get(n.warehouseId)?.name ?? "—",
69
- onHand: n.quantity,
70
- allocated: n.reservedQuantity,
71
- available: n.availableQuantity,
72
- reorderLevel: n.reorderLevel,
73
- stockState: n.quantity === 0 ? "out_of_stock" : n.availableQuantity <= n.reorderLevel ? "low" : "in_stock"
74
- };
75
- });
76
- }, [
77
- V,
78
- H,
79
- U,
80
- $
81
- ]), ce = [
64
+ }, $ = N("movethewheels.inventory.lowStock.unknownProduct", "Unknown Product"), _e = fe(() => H.map((e) => ({
65
+ id: e.id,
66
+ productId: e.productId,
67
+ productName: e.productName ?? $,
68
+ sku: e.productSku ?? "—",
69
+ warehouseName: e.warehouseName ?? "—",
70
+ onHand: e.quantity,
71
+ allocated: e.reservedQuantity,
72
+ available: e.availableQuantity,
73
+ reorderLevel: e.reorderLevel,
74
+ stockState: e.quantity === 0 ? "out_of_stock" : e.availableQuantity <= e.reorderLevel ? "low" : "in_stock"
75
+ })), [H, $]), ve = [
82
76
  {
83
77
  id: "product",
84
- header: R("movethewheels.inventory.stock.product", "Product"),
78
+ header: N("movethewheels.inventory.stock.product", "Product"),
85
79
  accessorKey: "productName",
86
80
  sortable: !0,
87
- cell: (e) => /* @__PURE__ */ O("span", {
81
+ cell: (e) => /* @__PURE__ */ C("span", {
88
82
  className: "font-medium",
89
83
  children: e.productName
90
84
  })
91
85
  },
92
86
  {
93
87
  id: "sku",
94
- header: R("movethewheels.inventory.stock.sku", "SKU"),
88
+ header: N("movethewheels.inventory.stock.sku", "SKU"),
95
89
  accessorKey: "sku",
96
90
  sortable: !0,
97
- cell: (e) => /* @__PURE__ */ O("span", {
91
+ cell: (e) => /* @__PURE__ */ C("span", {
98
92
  className: "text-sm text-text-secondary",
99
93
  children: e.sku
100
94
  })
101
95
  },
102
96
  {
103
97
  id: "warehouse",
104
- header: R("movethewheels.inventory.stock.warehouse", "Warehouse"),
98
+ header: N("movethewheels.inventory.stock.warehouse", "Warehouse"),
105
99
  accessorKey: "warehouseName",
106
100
  sortable: !0
107
101
  },
108
102
  {
109
103
  id: "onHand",
110
- header: R("movethewheels.inventory.stock.onHand", "On hand"),
104
+ header: N("movethewheels.inventory.stock.onHand", "On hand"),
111
105
  accessorKey: "onHand",
112
106
  sortable: !0,
113
- cell: (e) => /* @__PURE__ */ O("span", {
107
+ cell: (e) => /* @__PURE__ */ C("span", {
114
108
  className: "font-medium",
115
109
  children: e.onHand.toLocaleString()
116
110
  })
117
111
  },
118
112
  {
119
113
  id: "allocated",
120
- header: R("movethewheels.inventory.stock.allocated", "Allocated"),
114
+ header: N("movethewheels.inventory.stock.allocated", "Allocated"),
121
115
  accessorKey: "allocated",
122
116
  sortable: !0,
123
117
  cell: (e) => e.allocated.toLocaleString()
124
118
  },
125
119
  {
126
120
  id: "available",
127
- header: R("movethewheels.inventory.stock.available", "Available"),
121
+ header: N("movethewheels.inventory.stock.available", "Available"),
128
122
  accessorKey: "available",
129
123
  sortable: !0,
130
- cell: (e) => /* @__PURE__ */ O("span", {
124
+ cell: (e) => /* @__PURE__ */ C("span", {
131
125
  className: "font-medium",
132
126
  children: e.available.toLocaleString()
133
127
  })
134
128
  },
135
129
  {
136
130
  id: "reorderPoint",
137
- header: R("movethewheels.inventory.stock.reorderPoint", "Reorder point"),
131
+ header: N("movethewheels.inventory.stock.reorderPoint", "Reorder point"),
138
132
  accessorKey: "reorderLevel",
139
133
  sortable: !0,
140
134
  cell: (e) => e.reorderLevel > 0 ? e.reorderLevel.toLocaleString() : "—"
141
135
  },
142
136
  {
143
137
  id: "state",
144
- header: R("movethewheels.inventory.stock.status", "Status"),
145
- cell: (e) => /* @__PURE__ */ O(te, {
146
- status: e.stockState === "out_of_stock" ? R("movethewheels.inventory.stock.outOfStock", "Out of stock") : e.stockState === "low" ? R("movethewheels.inventory.stock.low", "Low") : R("movethewheels.inventory.stock.inStock", "In stock"),
147
- customColors: P[e.stockState],
138
+ header: N("movethewheels.inventory.stock.status", "Status"),
139
+ cell: (e) => /* @__PURE__ */ C(se, {
140
+ status: e.stockState === "out_of_stock" ? N("movethewheels.inventory.stock.outOfStock", "Out of stock") : e.stockState === "low" ? N("movethewheels.inventory.stock.low", "Low") : N("movethewheels.inventory.stock.inStock", "In stock"),
141
+ customColors: k[e.stockState],
148
142
  size: "sm"
149
143
  })
150
144
  }
151
145
  ];
152
- return /* @__PURE__ */ k(C, {
153
- title: R("movethewheels.inventory.title", "Inventory"),
154
- subtitle: R("movethewheels.inventory.subtitle", "Manage your products and warehouses"),
155
- icon: /* @__PURE__ */ O(c, { size: 24 }),
156
- headerActions: /* @__PURE__ */ O(j, {
146
+ return /* @__PURE__ */ w(_, {
147
+ title: N("movethewheels.inventory.title", "Inventory"),
148
+ subtitle: N("movethewheels.inventory.subtitle", "Manage your products and warehouses"),
149
+ icon: /* @__PURE__ */ C(o, { size: 24 }),
150
+ headerActions: /* @__PURE__ */ C(E, {
157
151
  primary: {
158
- label: R("movethewheels.inventory.actions.addProduct", "Add Product"),
159
- icon: /* @__PURE__ */ O(l, { size: 16 }),
160
- onSelect: () => X("inventory/products/new")
152
+ label: N("movethewheels.inventory.actions.addProduct", "Add Product"),
153
+ icon: /* @__PURE__ */ C(s, { size: 16 }),
154
+ onSelect: () => Z("inventory/products/new")
161
155
  },
162
156
  actions: [{
163
- label: R("movethewheels.inventory.actions.products", "Products"),
164
- onSelect: () => X("inventory/products")
157
+ label: N("movethewheels.inventory.actions.products", "Products"),
158
+ onSelect: () => Z("inventory/products")
165
159
  }, {
166
- label: R("movethewheels.inventory.actions.warehouses", "Warehouses"),
167
- onSelect: () => X("inventory/warehouses")
160
+ label: N("movethewheels.inventory.actions.warehouses", "Warehouses"),
161
+ onSelect: () => Z("inventory/warehouses")
168
162
  }]
169
163
  }),
170
164
  children: [
171
- /* @__PURE__ */ O(N, {
172
- icon: /* @__PURE__ */ O(c, { size: 18 }),
173
- children: R("movethewheels.inventory.purpose", "A real-time view of what you have and where. Track on-hand, allocated and free-to-promise quantities across warehouses, follow every stock movement, catch low-stock items before they run out, and drill into products or warehouses to manage what you can promise on an order.")
165
+ /* @__PURE__ */ C(O, {
166
+ icon: /* @__PURE__ */ C(o, { size: 18 }),
167
+ children: N("movethewheels.inventory.purpose", "A real-time view of what you have and where. Track on-hand, allocated and free-to-promise quantities across warehouses, follow every stock movement, catch low-stock items before they run out, and drill into products or warehouses to manage what you can promise on an order.")
174
168
  }),
175
- G && !W ? /* @__PURE__ */ O(v, {
169
+ K && !G ? /* @__PURE__ */ C(p, {
176
170
  className: "border-status-error-border",
177
- children: /* @__PURE__ */ k(y, {
171
+ children: /* @__PURE__ */ w(m, {
178
172
  className: "p-6 text-center space-y-3",
179
173
  children: [
180
- /* @__PURE__ */ O("p", {
174
+ /* @__PURE__ */ C("p", {
181
175
  className: "text-status-error-text font-medium",
182
- children: R("movethewheels.inventory.error.title", "Couldn't load inventory")
176
+ children: N("movethewheels.inventory.error.title", "Couldn't load inventory")
183
177
  }),
184
- /* @__PURE__ */ O("p", {
178
+ /* @__PURE__ */ C("p", {
185
179
  className: "text-sm text-text-secondary",
186
- children: G.message
180
+ children: K.message
187
181
  }),
188
- /* @__PURE__ */ O(_, {
182
+ /* @__PURE__ */ C(f, {
189
183
  variant: "outline",
190
- onClick: K,
191
- children: R("movethewheels.inventory.error.retry", "Retry")
184
+ onClick: q,
185
+ children: N("movethewheels.inventory.error.retry", "Retry")
192
186
  })
193
187
  ]
194
188
  })
195
- }) : W ? /* @__PURE__ */ O(D, {
189
+ }) : G ? /* @__PURE__ */ C(x, {
196
190
  columns: 6,
197
- children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ O(E, {}, t))
198
- }) : /* @__PURE__ */ k(D, {
191
+ children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ C(b, {}, t))
192
+ }) : /* @__PURE__ */ w(x, {
199
193
  columns: 6,
200
194
  children: [
201
- /* @__PURE__ */ O(T, {
202
- label: R("movethewheels.inventory.metrics.totalOnHand", "Total on-hand"),
203
- value: q.totalOnHand.toLocaleString(),
204
- icon: /* @__PURE__ */ O(r, { size: 20 }),
195
+ /* @__PURE__ */ C(y, {
196
+ label: N("movethewheels.inventory.metrics.totalOnHand", "Total on-hand"),
197
+ value: J.totalOnHand.toLocaleString(),
198
+ icon: /* @__PURE__ */ C(r, { size: 20 }),
205
199
  accent: "brand",
206
- subtitle: R("movethewheels.inventory.metrics.onHandHint", "Units in the network")
200
+ subtitle: N("movethewheels.inventory.metrics.onHandHint", "Units in the network")
207
201
  }),
208
- /* @__PURE__ */ O(T, {
209
- label: R("movethewheels.inventory.metrics.available", "Available"),
210
- value: q.totalAvailable.toLocaleString(),
211
- icon: /* @__PURE__ */ O(a, { size: 20 }),
202
+ /* @__PURE__ */ C(y, {
203
+ label: N("movethewheels.inventory.metrics.available", "Available"),
204
+ value: J.totalAvailable.toLocaleString(),
205
+ icon: /* @__PURE__ */ C(a, { size: 20 }),
212
206
  accent: "success",
213
- subtitle: R("movethewheels.inventory.metrics.availableHint", "Free to promise")
207
+ subtitle: N("movethewheels.inventory.metrics.availableHint", "Free to promise")
214
208
  }),
215
- /* @__PURE__ */ O(T, {
216
- label: R("movethewheels.inventory.metrics.allocated", "Allocated"),
217
- value: q.totalAllocated.toLocaleString(),
218
- icon: /* @__PURE__ */ O(s, { size: 20 }),
209
+ /* @__PURE__ */ C(y, {
210
+ label: N("movethewheels.inventory.metrics.allocated", "Allocated"),
211
+ value: J.totalAllocated.toLocaleString(),
212
+ icon: /* @__PURE__ */ C(te, { size: 20 }),
219
213
  accent: "blue",
220
- subtitle: R("movethewheels.inventory.metrics.allocatedHint", "Committed to orders")
214
+ subtitle: N("movethewheels.inventory.metrics.allocatedHint", "Committed to orders")
221
215
  }),
222
- /* @__PURE__ */ O(T, {
223
- label: R("movethewheels.inventory.metrics.lowStock", "Low-stock items"),
224
- value: q.lowStockCount.toLocaleString(),
225
- icon: /* @__PURE__ */ O(u, { size: 20 }),
216
+ /* @__PURE__ */ C(y, {
217
+ label: N("movethewheels.inventory.metrics.lowStock", "Low-stock items"),
218
+ value: J.lowStockCount.toLocaleString(),
219
+ icon: /* @__PURE__ */ C(c, { size: 20 }),
226
220
  accent: "warning",
227
- subtitle: R("movethewheels.inventory.metrics.lowStockHint", "At or under reorder point")
221
+ subtitle: N("movethewheels.inventory.metrics.lowStockHint", "At or under reorder point")
228
222
  }),
229
- /* @__PURE__ */ O(T, {
230
- label: R("movethewheels.inventory.metrics.totalProducts", "Catalog items"),
231
- value: q.totalProducts.toLocaleString(),
232
- icon: /* @__PURE__ */ O(c, { size: 20 }),
223
+ /* @__PURE__ */ C(y, {
224
+ label: N("movethewheels.inventory.metrics.totalProducts", "Catalog items"),
225
+ value: J.totalProducts.toLocaleString(),
226
+ icon: /* @__PURE__ */ C(o, { size: 20 }),
233
227
  accent: "neutral",
234
- onClick: () => X("inventory/products")
228
+ onClick: () => Z("inventory/products")
235
229
  }),
236
- /* @__PURE__ */ O(T, {
237
- label: R("movethewheels.inventory.metrics.warehouses", "Warehouses"),
238
- value: q.totalWarehouses.toLocaleString(),
239
- icon: /* @__PURE__ */ O(d, { size: 20 }),
230
+ /* @__PURE__ */ C(y, {
231
+ label: N("movethewheels.inventory.metrics.warehouses", "Warehouses"),
232
+ value: J.totalWarehouses.toLocaleString(),
233
+ icon: /* @__PURE__ */ C(ne, { size: 20 }),
240
234
  accent: "neutral",
241
- onClick: () => X("inventory/warehouses")
235
+ onClick: () => Z("inventory/warehouses")
242
236
  })
243
237
  ]
244
238
  }),
245
- Q.length > 0 && /* @__PURE__ */ k(M, {
239
+ U.length > 0 && /* @__PURE__ */ w(D, {
246
240
  className: "space-y-4",
247
- children: [/* @__PURE__ */ k("h2", {
241
+ children: [/* @__PURE__ */ w("h2", {
248
242
  className: "flex items-center gap-2 text-base font-semibold text-status-warning-text",
249
243
  children: [
250
- /* @__PURE__ */ O(u, { size: 18 }),
251
- R("movethewheels.inventory.lowStock.title", "Low Stock Alert"),
244
+ /* @__PURE__ */ C(c, { size: 18 }),
245
+ N("movethewheels.inventory.lowStock.title", "Low Stock Alert"),
252
246
  " (",
253
- Q.length,
247
+ J.lowStockCount,
254
248
  " ",
255
- R("movethewheels.inventory.lowStock.items", "items"),
249
+ N("movethewheels.inventory.lowStock.items", "items"),
256
250
  ")"
257
251
  ]
258
- }), /* @__PURE__ */ O("div", { children: /* @__PURE__ */ O("div", {
252
+ }), /* @__PURE__ */ C("div", { children: /* @__PURE__ */ C("div", {
259
253
  className: "space-y-3",
260
- children: Q.slice(0, 5).map((e) => {
261
- let t = H.find((t) => t.id === e.productId);
262
- return /* @__PURE__ */ k("div", {
263
- className: "flex items-center justify-between p-3 bg-status-warning-bg/10 rounded-lg",
264
- children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
265
- className: "font-medium",
266
- children: t?.name || R("movethewheels.inventory.lowStock.unknownProduct", "Unknown Product")
267
- }), /* @__PURE__ */ k("p", {
254
+ children: U.map((e) => /* @__PURE__ */ w("div", {
255
+ className: "flex items-center justify-between p-3 bg-status-warning-bg/10 rounded-lg",
256
+ children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
257
+ className: "font-medium",
258
+ children: e.productName ?? N("movethewheels.inventory.lowStock.unknownProduct", "Unknown Product")
259
+ }), /* @__PURE__ */ w("p", {
260
+ className: "text-sm text-text-secondary",
261
+ children: [
262
+ N("movethewheels.inventory.lowStock.sku", "SKU:"),
263
+ " ",
264
+ e.productSku ?? "—"
265
+ ]
266
+ })] }), /* @__PURE__ */ w("div", {
267
+ className: "text-right",
268
+ children: [/* @__PURE__ */ w("p", {
269
+ className: "font-medium text-status-warning-text",
270
+ children: [
271
+ e.availableQuantity,
272
+ " ",
273
+ N("movethewheels.inventory.lowStock.left", "left")
274
+ ]
275
+ }), /* @__PURE__ */ w("p", {
268
276
  className: "text-sm text-text-secondary",
269
277
  children: [
270
- R("movethewheels.inventory.lowStock.sku", "SKU:"),
278
+ N("movethewheels.inventory.lowStock.reorderAt", "Reorder at:"),
271
279
  " ",
272
- t?.sku
280
+ e.reorderLevel
273
281
  ]
274
- })] }), /* @__PURE__ */ k("div", {
275
- className: "text-right",
276
- children: [/* @__PURE__ */ k("p", {
277
- className: "font-medium text-status-warning-text",
278
- children: [
279
- e.availableQuantity,
280
- " ",
281
- R("movethewheels.inventory.lowStock.left", "left")
282
- ]
283
- }), /* @__PURE__ */ k("p", {
284
- className: "text-sm text-text-secondary",
285
- children: [
286
- R("movethewheels.inventory.lowStock.reorderAt", "Reorder at:"),
287
- " ",
288
- e.reorderLevel
289
- ]
290
- })]
291
282
  })]
292
- }, e.id);
293
- })
283
+ })]
284
+ }, e.id))
294
285
  }) })]
295
286
  }),
296
- /* @__PURE__ */ k("div", {
287
+ /* @__PURE__ */ w("div", {
297
288
  className: "grid grid-cols-1 xl:grid-cols-3 gap-6",
298
- children: [/* @__PURE__ */ O("div", {
289
+ children: [/* @__PURE__ */ C("div", {
299
290
  className: "xl:col-span-2",
300
- children: /* @__PURE__ */ O(w, {
301
- title: R("movethewheels.inventory.stock.title", "Stock position"),
302
- children: /* @__PURE__ */ O(ne, {
303
- columns: ce,
304
- data: se,
305
- isLoading: W,
306
- error: G,
307
- onRetry: K,
291
+ children: /* @__PURE__ */ C(v, {
292
+ title: N("movethewheels.inventory.stock.title", "Stock position"),
293
+ children: /* @__PURE__ */ C(ce, {
294
+ columns: ve,
295
+ data: _e,
296
+ isLoading: G,
297
+ error: K,
298
+ onRetry: q,
308
299
  searchable: !0,
309
- searchPlaceholder: R("movethewheels.inventory.stock.search", "Search product, SKU or warehouse..."),
300
+ searchPlaceholder: N("movethewheels.inventory.stock.search", "Search product, SKU or warehouse..."),
310
301
  searchFields: [
311
302
  "productName",
312
303
  "sku",
313
304
  "warehouseName"
314
305
  ],
315
- onRowClick: (e) => X(`inventory/products/${e.productId}`),
306
+ searchQuery: I,
307
+ onSearchQueryChange: (e) => {
308
+ L(e), z(0);
309
+ },
310
+ pageIndex: R,
311
+ pageSize: B,
312
+ onPageChange: z,
313
+ onPageSizeChange: (e) => {
314
+ V(e), z(0);
315
+ },
316
+ totalItems: me,
317
+ hasNextPage: he,
318
+ onRowClick: (e) => Z(`inventory/products/${e.productId}`),
316
319
  getRowId: (e) => e.id,
317
320
  emptyIllustration: "empty-data",
318
- emptyTitle: R("movethewheels.inventory.stock.emptyTitle", "No stock recorded yet"),
319
- emptyDescription: R("movethewheels.inventory.stock.emptyDescription", "Stock lines appear here once a product is received into a warehouse.")
321
+ emptyTitle: N("movethewheels.inventory.stock.emptyTitle", "No stock recorded yet"),
322
+ emptyDescription: N("movethewheels.inventory.stock.emptyDescription", "Stock lines appear here once a product is received into a warehouse.")
320
323
  })
321
324
  })
322
- }), /* @__PURE__ */ k(v, {
325
+ }), /* @__PURE__ */ w(p, {
323
326
  className: "h-fit",
324
- children: [/* @__PURE__ */ O(b, { children: /* @__PURE__ */ k(x, {
327
+ children: [/* @__PURE__ */ C(oe, { children: /* @__PURE__ */ w(h, {
325
328
  className: "flex items-center gap-2",
326
- children: [/* @__PURE__ */ O(o, { size: 18 }), R("movethewheels.inventory.transactions.title", "Recent transactions")]
327
- }) }), /* @__PURE__ */ O(y, {
329
+ children: [/* @__PURE__ */ C(ee, { size: 18 }), N("movethewheels.inventory.transactions.title", "Recent transactions")]
330
+ }) }), /* @__PURE__ */ C(m, {
328
331
  className: "p-0",
329
- children: Y ? /* @__PURE__ */ O("p", {
332
+ children: X ? /* @__PURE__ */ C("p", {
330
333
  className: "p-6 text-sm text-status-error-text",
331
- children: Y.message
332
- }) : oe ? /* @__PURE__ */ O("p", {
334
+ children: X.message
335
+ }) : ge ? /* @__PURE__ */ C("p", {
333
336
  className: "p-6 text-sm text-text-secondary",
334
- children: R("movethewheels.inventory.transactions.loading", "Loading movements…")
335
- }) : J.length === 0 ? /* @__PURE__ */ O("p", {
337
+ children: N("movethewheels.inventory.transactions.loading", "Loading movements…")
338
+ }) : Y.length === 0 ? /* @__PURE__ */ C("p", {
336
339
  className: "p-6 text-sm text-text-secondary",
337
- children: R("movethewheels.inventory.transactions.empty", "No stock movements recorded yet. Receipts, issues and adjustments show up here as they happen.")
338
- }) : /* @__PURE__ */ O("ul", {
340
+ children: N("movethewheels.inventory.transactions.empty", "No stock movements recorded yet. Receipts, issues and adjustments show up here as they happen.")
341
+ }) : /* @__PURE__ */ C("ul", {
339
342
  className: "divide-y",
340
- children: J.map((r) => {
341
- let i = F[r.type], a = H.find((e) => e.id === r.productId)?.name ?? r.transactionNumber;
342
- return /* @__PURE__ */ k("li", {
343
+ children: Y.map((r) => {
344
+ let i = A[r.type], a = W.find((e) => e.id === r.productId)?.name ?? r.transactionNumber;
345
+ return /* @__PURE__ */ w("li", {
343
346
  className: "flex items-start justify-between gap-3 p-4",
344
- children: [/* @__PURE__ */ k("div", {
347
+ children: [/* @__PURE__ */ w("div", {
345
348
  className: "min-w-0",
346
349
  children: [
347
- /* @__PURE__ */ k("p", {
350
+ /* @__PURE__ */ w("p", {
348
351
  className: "flex items-center gap-1.5 font-medium",
349
- children: [i === "in" ? /* @__PURE__ */ O(e, {
352
+ children: [i === "in" ? /* @__PURE__ */ C(e, {
350
353
  size: 14,
351
354
  className: "text-status-success-text"
352
- }) : i === "out" ? /* @__PURE__ */ O(n, {
355
+ }) : i === "out" ? /* @__PURE__ */ C(n, {
353
356
  size: 14,
354
357
  className: "text-status-warning-text"
355
- }) : /* @__PURE__ */ O(t, {
358
+ }) : /* @__PURE__ */ C(t, {
356
359
  size: 14,
357
360
  className: "text-text-secondary"
358
- }), I[r.type]]
361
+ }), j[r.type]]
359
362
  }),
360
- /* @__PURE__ */ O("p", {
363
+ /* @__PURE__ */ C("p", {
361
364
  className: "truncate text-sm text-text-secondary",
362
365
  children: a
363
366
  }),
364
- /* @__PURE__ */ O("p", {
367
+ /* @__PURE__ */ C("p", {
365
368
  className: "text-xs text-text-secondary",
366
- children: ie(r.createdAt, "short")
369
+ children: ue(r.createdAt, "short")
367
370
  })
368
371
  ]
369
- }), /* @__PURE__ */ k("span", {
372
+ }), /* @__PURE__ */ w("span", {
370
373
  className: i === "in" ? "font-medium text-status-success-text" : i === "out" ? "font-medium text-status-warning-text" : "font-medium text-text-primary",
371
374
  children: [i === "in" ? "+" : i === "out" ? "−" : "", Math.abs(r.quantity).toLocaleString()]
372
375
  })]
@@ -376,54 +379,54 @@ function L() {
376
379
  })]
377
380
  })]
378
381
  }),
379
- /* @__PURE__ */ k("div", {
382
+ /* @__PURE__ */ w("div", {
380
383
  className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
381
- children: [/* @__PURE__ */ O(w, {
382
- title: R("movethewheels.inventory.warehouses.title", "Warehouses"),
383
- actions: /* @__PURE__ */ k(_, {
384
+ children: [/* @__PURE__ */ C(v, {
385
+ title: N("movethewheels.inventory.warehouses.title", "Warehouses"),
386
+ actions: /* @__PURE__ */ w(f, {
384
387
  variant: "ghost",
385
388
  size: "sm",
386
- onClick: () => X("inventory/warehouses"),
389
+ onClick: () => Z("inventory/warehouses"),
387
390
  children: [
388
- R("movethewheels.inventory.common.viewAll", "View all"),
391
+ N("movethewheels.inventory.common.viewAll", "View all"),
389
392
  " ",
390
- /* @__PURE__ */ O(i, { size: 16 })
393
+ /* @__PURE__ */ C(i, { size: 16 })
391
394
  ]
392
395
  }),
393
- children: /* @__PURE__ */ O(v, { children: /* @__PURE__ */ O(y, {
396
+ children: /* @__PURE__ */ C(p, { children: /* @__PURE__ */ C(m, {
394
397
  className: "p-0",
395
- children: /* @__PURE__ */ O("div", {
398
+ children: /* @__PURE__ */ C("div", {
396
399
  className: "divide-y",
397
- children: U.map((e) => /* @__PURE__ */ O("div", {
400
+ children: pe.map((e) => /* @__PURE__ */ C("div", {
398
401
  role: "button",
399
402
  tabIndex: 0,
400
403
  "aria-label": `View warehouse ${e.name}`,
401
404
  className: "p-4 hover:bg-bg-sunken/50 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
402
- onClick: () => X(`inventory/warehouses/${e.id}`),
403
- onKeyDown: (t) => Z(t, () => X(`inventory/warehouses/${e.id}`)),
404
- children: /* @__PURE__ */ k("div", {
405
+ onClick: () => Z(`inventory/warehouses/${e.id}`),
406
+ onKeyDown: (t) => Q(t, () => Z(`inventory/warehouses/${e.id}`)),
407
+ children: /* @__PURE__ */ w("div", {
405
408
  className: "flex items-center justify-between",
406
- children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
409
+ children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
407
410
  className: "font-medium",
408
411
  children: e.name
409
- }), /* @__PURE__ */ k("p", {
412
+ }), /* @__PURE__ */ w("p", {
410
413
  className: "text-sm text-text-secondary",
411
414
  children: [
412
415
  e.address.city,
413
416
  ", ",
414
417
  e.address.state
415
418
  ]
416
- })] }), /* @__PURE__ */ k("div", {
419
+ })] }), /* @__PURE__ */ w("div", {
417
420
  className: "text-right",
418
- children: [/* @__PURE__ */ O(g, {
421
+ children: [/* @__PURE__ */ C(d, {
419
422
  variant: e.isActive ? "default" : "secondary",
420
- children: e.isActive ? R("movethewheels.inventory.warehouses.active", "Active") : R("movethewheels.inventory.warehouses.inactive", "Inactive")
421
- }), /* @__PURE__ */ k("div", {
423
+ children: e.isActive ? N("movethewheels.inventory.warehouses.active", "Active") : N("movethewheels.inventory.warehouses.inactive", "Inactive")
424
+ }), /* @__PURE__ */ w("div", {
422
425
  className: "mt-2",
423
- children: [/* @__PURE__ */ O("p", {
426
+ children: [/* @__PURE__ */ C("p", {
424
427
  className: "text-xs text-text-secondary",
425
- children: R("movethewheels.inventory.warehouses.utilization", "Utilization")
426
- }), /* @__PURE__ */ O(S, {
428
+ children: N("movethewheels.inventory.warehouses.utilization", "Utilization")
429
+ }), /* @__PURE__ */ C(g, {
427
430
  value: e.capacity.usedSpace / e.capacity.totalSpace * 100,
428
431
  className: "w-24 h-2"
429
432
  })]
@@ -433,43 +436,43 @@ function L() {
433
436
  }, e.id))
434
437
  })
435
438
  }) })
436
- }), /* @__PURE__ */ O(w, {
437
- title: R("movethewheels.inventory.products.title", "Recent Products"),
438
- actions: /* @__PURE__ */ k(_, {
439
+ }), /* @__PURE__ */ C(v, {
440
+ title: N("movethewheels.inventory.products.title", "Recent Products"),
441
+ actions: /* @__PURE__ */ w(f, {
439
442
  variant: "ghost",
440
443
  size: "sm",
441
- onClick: () => X("inventory/products"),
444
+ onClick: () => Z("inventory/products"),
442
445
  children: [
443
- R("movethewheels.inventory.common.viewAll", "View all"),
446
+ N("movethewheels.inventory.common.viewAll", "View all"),
444
447
  " ",
445
- /* @__PURE__ */ O(i, { size: 16 })
448
+ /* @__PURE__ */ C(i, { size: 16 })
446
449
  ]
447
450
  }),
448
- children: /* @__PURE__ */ O(v, { children: /* @__PURE__ */ O(y, {
451
+ children: /* @__PURE__ */ C(p, { children: /* @__PURE__ */ C(m, {
449
452
  className: "p-0",
450
- children: /* @__PURE__ */ O("div", {
453
+ children: /* @__PURE__ */ C("div", {
451
454
  className: "divide-y",
452
- children: H.slice(0, 5).map((e) => /* @__PURE__ */ O("div", {
455
+ children: W.slice(0, 5).map((e) => /* @__PURE__ */ C("div", {
453
456
  role: "button",
454
457
  tabIndex: 0,
455
458
  "aria-label": `View product ${e.name}`,
456
459
  className: "p-4 hover:bg-bg-sunken/50 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
457
- onClick: () => X(`inventory/products/${e.id}`),
458
- onKeyDown: (t) => Z(t, () => X(`inventory/products/${e.id}`)),
459
- children: /* @__PURE__ */ k("div", {
460
+ onClick: () => Z(`inventory/products/${e.id}`),
461
+ onKeyDown: (t) => Q(t, () => Z(`inventory/products/${e.id}`)),
462
+ children: /* @__PURE__ */ w("div", {
460
463
  className: "flex items-center justify-between",
461
- children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
464
+ children: [/* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
462
465
  className: "font-medium",
463
466
  children: e.name
464
- }), /* @__PURE__ */ O("p", {
467
+ }), /* @__PURE__ */ C("p", {
465
468
  className: "text-sm text-text-secondary",
466
469
  children: e.sku
467
- })] }), /* @__PURE__ */ k("div", {
470
+ })] }), /* @__PURE__ */ w("div", {
468
471
  className: "text-right",
469
- children: [/* @__PURE__ */ O("p", {
472
+ children: [/* @__PURE__ */ C("p", {
470
473
  className: "font-medium",
471
- children: re(e.value)
472
- }), /* @__PURE__ */ O(g, {
474
+ children: le(e.value)
475
+ }), /* @__PURE__ */ C(d, {
473
476
  variant: "outline",
474
477
  children: e.category
475
478
  })]
@@ -484,4 +487,4 @@ function L() {
484
487
  });
485
488
  }
486
489
  //#endregion
487
- export { L as default };
490
+ export { M as default };