@burdenoff/microfe-movethewheels 2026.920.3 → 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 (77) hide show
  1. package/dist/components/CarbonFootprintPanel.js +1 -1
  2. package/dist/components/CustomerPicker.js +76 -65
  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 +3 -1
  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/pages/CreateOrderPage.js +207 -201
  31. package/dist/pages/CustomersPage.js +61 -54
  32. package/dist/pages/DeliveryCapturePage.js +131 -109
  33. package/dist/pages/DriversPage.js +100 -92
  34. package/dist/pages/InventoryPage.js +239 -236
  35. package/dist/pages/MultiModalShipmentPage.js +163 -130
  36. package/dist/pages/OrderDetailsPage.js +224 -208
  37. package/dist/pages/OrdersListPage.js +66 -60
  38. package/dist/pages/ProductDetailsPage.js +241 -200
  39. package/dist/pages/ProductsPage.js +59 -52
  40. package/dist/pages/RouteDetailsPage.js +343 -321
  41. package/dist/pages/RoutesPage.js +55 -48
  42. package/dist/pages/VehiclesPage.js +63 -56
  43. package/dist/pages/WarehousesPage.js +60 -53
  44. package/package.json +1 -1
  45. package/src/generated/wspace-types.ts +1188 -5
  46. package/src/movethewheels/components/CarbonFootprintPanel.tsx +0 -1
  47. package/src/movethewheels/components/CustomerPicker.tsx +14 -0
  48. package/src/movethewheels/components/DataTable.tsx +34 -18
  49. package/src/movethewheels/components/DocumentsCard.tsx +6 -1
  50. package/src/movethewheels/components/maps/leaflet-setup.ts +1 -8
  51. package/src/movethewheels/hooks/useAnalytics.ts +27 -0
  52. package/src/movethewheels/hooks/useCustomers.ts +64 -24
  53. package/src/movethewheels/hooks/useDebouncedValue.ts +12 -0
  54. package/src/movethewheels/hooks/useEntityDocuments.ts +43 -25
  55. package/src/movethewheels/hooks/useEpod.ts +14 -7
  56. package/src/movethewheels/hooks/useFleet.ts +58 -37
  57. package/src/movethewheels/hooks/useFleetIntelligence.ts +1 -4
  58. package/src/movethewheels/hooks/useInventory.ts +211 -90
  59. package/src/movethewheels/hooks/useMultiModalShipments.ts +15 -11
  60. package/src/movethewheels/hooks/useOrders.ts +13 -14
  61. package/src/movethewheels/hooks/useRoutes.ts +80 -23
  62. package/src/movethewheels/hooks/useTracking.ts +130 -98
  63. package/src/movethewheels/pages/CreateOrderPage.tsx +9 -1
  64. package/src/movethewheels/pages/CustomersPage.tsx +11 -1
  65. package/src/movethewheels/pages/DeliveryCapturePage.tsx +31 -1
  66. package/src/movethewheels/pages/DriversPage.tsx +24 -12
  67. package/src/movethewheels/pages/InventoryPage.tsx +57 -32
  68. package/src/movethewheels/pages/MultiModalShipmentPage.tsx +52 -3
  69. package/src/movethewheels/pages/OrderDetailsPage.tsx +17 -1
  70. package/src/movethewheels/pages/OrdersListPage.tsx +20 -3
  71. package/src/movethewheels/pages/ProductDetailsPage.tsx +52 -3
  72. package/src/movethewheels/pages/ProductsPage.tsx +11 -1
  73. package/src/movethewheels/pages/RouteDetailsPage.tsx +35 -5
  74. package/src/movethewheels/pages/RoutesPage.tsx +11 -1
  75. package/src/movethewheels/pages/VehiclesPage.tsx +19 -2
  76. package/src/movethewheels/pages/WarehousesPage.tsx +11 -1
  77. package/src/movethewheels/types/index.ts +7 -5
@@ -1,22 +1,23 @@
1
1
  import { CircleCheck as e } from "../node_modules/lucide-react/dist/esm/icons/circle-check.js";
2
2
  import { Clock as t } from "../node_modules/lucide-react/dist/esm/icons/clock.js";
3
3
  import { Download as n } from "../node_modules/lucide-react/dist/esm/icons/download.js";
4
- import { Filter as ee } from "../node_modules/lucide-react/dist/esm/icons/filter.js";
5
- import { Package as r } from "../node_modules/lucide-react/dist/esm/icons/package.js";
6
- import { Plus as i } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
7
- import { RefreshCw as a } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
8
- import { Truck as o } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
9
- import { UserCheck as s } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
10
- import { UserPlus as c } from "../node_modules/lucide-react/dist/esm/icons/user-plus.js";
11
- import { joinPath as l } from "../utils/navigation.js";
12
- import { useMoveTheWheels as u } from "../providers/MoveTheWheelsProvider.js";
13
- import { useOrderStats as d, useOrders as f } from "../hooks/useOrders.js";
14
- import { Badge as p, Button as m, Card as te, CardContent as ne, Select as re, SelectContent as h, SelectItem as g, SelectTrigger as _, SelectValue as v } from "../components/ui.js";
15
- import { PageLayout as y } from "../components/PageLayout.js";
16
- import { MetricCard as b, MetricGrid as x } from "../components/MetricCard.js";
17
- import { PriorityBadge as S, StatusBadge as C } from "../components/StatusBadge.js";
18
- import { DataTable as w } from "../components/DataTable.js";
19
- import { formatCurrency as ie, formatDate as T } from "../utils/formatters.js";
4
+ import { Filter as r } from "../node_modules/lucide-react/dist/esm/icons/filter.js";
5
+ import { Package as i } from "../node_modules/lucide-react/dist/esm/icons/package.js";
6
+ import { Plus as a } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
7
+ import { RefreshCw as o } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
8
+ import { Truck as s } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
9
+ import { UserCheck as c } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
10
+ import { UserPlus as l } from "../node_modules/lucide-react/dist/esm/icons/user-plus.js";
11
+ import { joinPath as ee } from "../utils/navigation.js";
12
+ import { useMoveTheWheels as te } from "../providers/MoveTheWheelsProvider.js";
13
+ import { useOrderStats as ne, useOrders as u } from "../hooks/useOrders.js";
14
+ import { Badge as re, Button as d, Card as f, CardContent as p, Select as m, SelectContent as h, SelectItem as g, SelectTrigger as _, SelectValue as v } from "../components/ui.js";
15
+ import { PageLayout as ie } from "../components/PageLayout.js";
16
+ import { MetricCard as y, MetricGrid as b } from "../components/MetricCard.js";
17
+ import { PriorityBadge as x, StatusBadge as S } from "../components/StatusBadge.js";
18
+ import { DataTable as C } from "../components/DataTable.js";
19
+ import { formatCurrency as ae, formatDate as w } from "../utils/formatters.js";
20
+ import { useDebouncedValue as T } from "../hooks/useDebouncedValue.js";
20
21
  import { useState as E } from "react";
21
22
  import { jsx as D, jsxs as O } from "react/jsx-runtime";
22
23
  import { useI18n as k } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
@@ -26,16 +27,17 @@ function M() {
26
27
  let { t: M } = k(), N = (e, t) => {
27
28
  let n = M(e);
28
29
  return n === e ? t : n;
29
- }, { basePath: P, navigate: F } = u(), [I, L] = E("all"), [R, z] = E(!1), [B, V] = E(0), [H, U] = E(25), W = I !== "all" || R, { orders: G, hasMore: K, isLoading: q, error: J, refetch: Y } = f({
30
+ }, { basePath: P, navigate: F } = te(), [I, L] = E("all"), [R, z] = E(!1), [B, V] = E(0), [H, U] = E(25), [W, G] = E(""), K = T(W), q = I !== "all" || R || W.length > 0, { orders: J, totalOrders: oe, hasMore: se, isLoading: ce, error: le, refetch: Y } = u({
30
31
  filters: {
31
32
  status: I === "all" ? void 0 : I,
32
- unassigned: R || void 0
33
+ unassigned: R || void 0,
34
+ search: K || void 0
33
35
  },
34
36
  limit: H,
35
37
  offset: B * H
36
- }), { stats: X } = d(), Z = X.total, Q = (e) => {
37
- F && F(l(P, e));
38
- }, $ = () => V(0), ae = [
38
+ }), { stats: X } = ne(), Z = X.total, Q = (e) => {
39
+ F && F(ee(P, e));
40
+ }, $ = () => V(0), ue = [
39
41
  {
40
42
  id: "orderNumber",
41
43
  header: N("movethewheels.orders.table.orderNumber", "Order #"),
@@ -68,7 +70,7 @@ function M() {
68
70
  accessorKey: "status",
69
71
  sortable: !0,
70
72
  className: "min-w-[130px] whitespace-nowrap",
71
- cell: (e) => /* @__PURE__ */ D(C, {
73
+ cell: (e) => /* @__PURE__ */ D(S, {
72
74
  status: e.status,
73
75
  type: "order"
74
76
  })
@@ -79,13 +81,13 @@ function M() {
79
81
  accessorKey: "priority",
80
82
  sortable: !0,
81
83
  className: "min-w-[90px] whitespace-nowrap",
82
- cell: (e) => /* @__PURE__ */ D(S, { priority: e.priority })
84
+ cell: (e) => /* @__PURE__ */ D(x, { priority: e.priority })
83
85
  },
84
86
  {
85
87
  id: "items",
86
88
  header: N("movethewheels.orders.table.items", "Items"),
87
89
  className: "min-w-[80px] whitespace-nowrap",
88
- cell: (e) => /* @__PURE__ */ O(p, {
90
+ cell: (e) => /* @__PURE__ */ O(re, {
89
91
  variant: "secondary",
90
92
  children: [
91
93
  e.items.length,
@@ -102,7 +104,7 @@ function M() {
102
104
  className: "min-w-[100px] whitespace-nowrap text-right",
103
105
  cell: (e) => /* @__PURE__ */ D("span", {
104
106
  className: "font-medium",
105
- children: ie(e.pricing.total)
107
+ children: ae(e.pricing.total)
106
108
  })
107
109
  },
108
110
  {
@@ -111,7 +113,7 @@ function M() {
111
113
  accessorKey: "scheduledDelivery",
112
114
  sortable: !0,
113
115
  className: "min-w-[110px] whitespace-nowrap",
114
- cell: (e) => e.scheduledDelivery ? T(e.scheduledDelivery) : "-"
116
+ cell: (e) => e.scheduledDelivery ? w(e.scheduledDelivery) : "-"
115
117
  },
116
118
  {
117
119
  id: "createdAt",
@@ -119,7 +121,7 @@ function M() {
119
121
  accessorKey: "createdAt",
120
122
  sortable: !0,
121
123
  className: "min-w-[100px] whitespace-nowrap",
122
- cell: (e) => T(e.createdAt, "relative")
124
+ cell: (e) => w(e.createdAt, "relative")
123
125
  },
124
126
  {
125
127
  id: "driver",
@@ -128,23 +130,23 @@ function M() {
128
130
  cell: (e) => e.driverId ? /* @__PURE__ */ O("span", {
129
131
  className: "inline-flex items-center gap-1 text-sm text-status-success-text",
130
132
  children: [
131
- /* @__PURE__ */ D(s, { size: 14 }),
133
+ /* @__PURE__ */ D(c, { size: 14 }),
132
134
  " ",
133
135
  N("movethewheels.orders.table.assigned", "Assigned")
134
136
  ]
135
- }) : /* @__PURE__ */ O(m, {
137
+ }) : /* @__PURE__ */ O(d, {
136
138
  variant: "outline",
137
139
  size: "sm",
138
140
  onClick: (t) => {
139
141
  t.stopPropagation(), Q(`orders/${e.id}`);
140
142
  },
141
- children: [/* @__PURE__ */ D(c, {
143
+ children: [/* @__PURE__ */ D(l, {
142
144
  size: 14,
143
145
  className: "mr-1"
144
146
  }), N("movethewheels.orders.table.assign", "Assign")]
145
147
  })
146
148
  }
147
- ], oe = [
149
+ ], de = [
148
150
  {
149
151
  value: "all",
150
152
  label: N("movethewheels.orders.filters.allStatuses", "All Statuses")
@@ -186,19 +188,19 @@ function M() {
186
188
  label: N("movethewheels.orders.status.failed", "Failed")
187
189
  }
188
190
  ];
189
- return /* @__PURE__ */ O(y, {
191
+ return /* @__PURE__ */ O(ie, {
190
192
  title: N("movethewheels.orders.title", "Orders"),
191
193
  subtitle: `${Z} ${N("movethewheels.orders.subtitle", "total orders")}`,
192
- icon: /* @__PURE__ */ D(r, { size: 24 }),
194
+ icon: /* @__PURE__ */ D(i, { size: 24 }),
193
195
  headerActions: /* @__PURE__ */ D(A, {
194
196
  primary: {
195
197
  label: N("movethewheels.orders.actions.newOrder", "New Order"),
196
- icon: /* @__PURE__ */ D(i, { size: 16 }),
198
+ icon: /* @__PURE__ */ D(a, { size: 16 }),
197
199
  onSelect: () => Q("orders/new")
198
200
  },
199
201
  actions: [{
200
202
  label: N("movethewheels.orders.actions.refresh", "Refresh"),
201
- icon: /* @__PURE__ */ D(a, { size: 16 }),
203
+ icon: /* @__PURE__ */ D(o, { size: 16 }),
202
204
  onSelect: () => Y()
203
205
  }, {
204
206
  label: N("movethewheels.orders.actions.export", "Export"),
@@ -208,36 +210,36 @@ function M() {
208
210
  }),
209
211
  children: [
210
212
  /* @__PURE__ */ D(j, {
211
- icon: /* @__PURE__ */ D(r, { size: 18 }),
213
+ icon: /* @__PURE__ */ D(i, { size: 18 }),
212
214
  children: N("movethewheels.orders.purpose", "Every delivery job lives here — their status, priority and value. Use this list to find an order, filter by status, and open one to assign a driver, track it, or update fulfilment.")
213
215
  }),
214
216
  /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
215
217
  className: "mb-3 text-sm font-medium text-text-secondary",
216
218
  children: N("movethewheels.orders.glance.title", "Pipeline at a glance")
217
- }), /* @__PURE__ */ O(x, {
219
+ }), /* @__PURE__ */ O(b, {
218
220
  columns: 4,
219
221
  children: [
220
- /* @__PURE__ */ D(b, {
222
+ /* @__PURE__ */ D(y, {
221
223
  label: N("movethewheels.orders.glance.total", "Total orders"),
222
224
  value: Z,
223
- icon: /* @__PURE__ */ D(r, { size: 20 }),
225
+ icon: /* @__PURE__ */ D(i, { size: 20 }),
224
226
  accent: "brand"
225
227
  }),
226
- /* @__PURE__ */ D(b, {
228
+ /* @__PURE__ */ D(y, {
227
229
  label: N("movethewheels.orders.glance.pending", "Pending"),
228
230
  value: X.byStatus.pending,
229
231
  icon: /* @__PURE__ */ D(t, { size: 20 }),
230
232
  accent: "warning",
231
233
  subtitle: N("movethewheels.orders.glance.pendingSub", "Awaiting fulfilment")
232
234
  }),
233
- /* @__PURE__ */ D(b, {
235
+ /* @__PURE__ */ D(y, {
234
236
  label: N("movethewheels.orders.glance.inTransit", "In transit"),
235
237
  value: X.byStatus.in_transit + X.byStatus.out_for_delivery,
236
- icon: /* @__PURE__ */ D(o, { size: 20 }),
238
+ icon: /* @__PURE__ */ D(s, { size: 20 }),
237
239
  accent: "blue",
238
240
  subtitle: N("movethewheels.orders.glance.inTransitSub", "On the road now")
239
241
  }),
240
- /* @__PURE__ */ D(b, {
242
+ /* @__PURE__ */ D(y, {
241
243
  label: N("movethewheels.orders.glance.delivered", "Delivered"),
242
244
  value: X.byStatus.delivered,
243
245
  icon: /* @__PURE__ */ D(e, { size: 20 }),
@@ -245,14 +247,14 @@ function M() {
245
247
  })
246
248
  ]
247
249
  })] }),
248
- /* @__PURE__ */ D(te, { children: /* @__PURE__ */ D(ne, {
250
+ /* @__PURE__ */ D(f, { children: /* @__PURE__ */ D(p, {
249
251
  className: "p-4",
250
252
  children: /* @__PURE__ */ O("div", {
251
253
  className: "flex flex-wrap items-center gap-4",
252
254
  children: [
253
255
  /* @__PURE__ */ O("div", {
254
256
  className: "flex items-center gap-2",
255
- children: [/* @__PURE__ */ D(ee, {
257
+ children: [/* @__PURE__ */ D(r, {
256
258
  size: 16,
257
259
  className: "text-text-secondary"
258
260
  }), /* @__PURE__ */ D("span", {
@@ -260,7 +262,7 @@ function M() {
260
262
  children: N("movethewheels.orders.filters.label", "Filters:")
261
263
  })]
262
264
  }),
263
- /* @__PURE__ */ O(re, {
265
+ /* @__PURE__ */ O(m, {
264
266
  value: I,
265
267
  onValueChange: (e) => {
266
268
  L(e), $();
@@ -268,42 +270,46 @@ function M() {
268
270
  children: [/* @__PURE__ */ D(_, {
269
271
  className: "w-[180px]",
270
272
  children: /* @__PURE__ */ D(v, { placeholder: N("movethewheels.orders.filters.status", "Status") })
271
- }), /* @__PURE__ */ D(h, { children: oe.map((e) => /* @__PURE__ */ D(g, {
273
+ }), /* @__PURE__ */ D(h, { children: de.map((e) => /* @__PURE__ */ D(g, {
272
274
  value: e.value,
273
275
  children: e.label
274
276
  }, e.value)) })]
275
277
  }),
276
- /* @__PURE__ */ O(m, {
278
+ /* @__PURE__ */ O(d, {
277
279
  variant: R ? "default" : "outline",
278
280
  size: "sm",
279
281
  onClick: () => {
280
282
  z((e) => !e), $();
281
283
  },
282
- children: [/* @__PURE__ */ D(c, {
284
+ children: [/* @__PURE__ */ D(l, {
283
285
  size: 14,
284
286
  className: "mr-1"
285
287
  }), N("movethewheels.orders.filters.unassigned", "Needs driver")]
286
288
  }),
287
- W && /* @__PURE__ */ D(m, {
289
+ q && /* @__PURE__ */ D(d, {
288
290
  variant: "ghost",
289
291
  size: "sm",
290
292
  onClick: () => {
291
- L("all"), z(!1), $();
293
+ L("all"), z(!1), G(""), $();
292
294
  },
293
295
  children: N("movethewheels.orders.filters.clear", "Clear filters")
294
296
  })
295
297
  ]
296
298
  })
297
299
  }) }),
298
- /* @__PURE__ */ D(w, {
299
- columns: ae,
300
- data: G,
301
- isLoading: q,
302
- error: J,
300
+ /* @__PURE__ */ D(C, {
301
+ columns: ue,
302
+ data: J,
303
+ isLoading: ce,
304
+ error: le,
303
305
  onRetry: Y,
304
306
  searchable: !0,
305
307
  searchPlaceholder: N("movethewheels.orders.searchPlaceholder", "Search orders..."),
306
308
  searchFields: ["orderNumber", "customerInfo"],
309
+ searchQuery: W,
310
+ onSearchQueryChange: (e) => {
311
+ G(e), V(0);
312
+ },
307
313
  onRowClick: (e) => Q(`orders/${e.id}`),
308
314
  getRowId: (e) => e.id,
309
315
  pageIndex: B,
@@ -312,15 +318,15 @@ function M() {
312
318
  onPageSizeChange: (e) => {
313
319
  U(e), V(0);
314
320
  },
315
- totalItems: W ? void 0 : Z,
316
- hasNextPage: K,
321
+ totalItems: oe,
322
+ hasNextPage: se,
317
323
  emptyMessage: N("movethewheels.orders.empty", "No orders found"),
318
324
  emptyIllustration: "empty-data",
319
325
  emptyTitle: N("movethewheels.orders.emptyTitle", "No orders yet"),
320
326
  emptyDescription: N("movethewheels.orders.emptyDescription", "Create your first order to start moving shipments through the pipeline."),
321
- emptyAction: /* @__PURE__ */ O(m, {
327
+ emptyAction: /* @__PURE__ */ O(d, {
322
328
  onClick: () => Q("orders/new"),
323
- children: [/* @__PURE__ */ D(i, {
329
+ children: [/* @__PURE__ */ D(a, {
324
330
  size: 16,
325
331
  className: "mr-1.5"
326
332
  }), N("movethewheels.orders.actions.newOrder", "New Order")]