@burdenoff/microfe-movethewheels 2026.925.2 → 2026.925.3

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 (38) hide show
  1. package/dist/components/StatusBadge.js +30 -30
  2. package/dist/constants/index.js +12 -5
  3. package/dist/hooks/useCustomers.js +0 -3
  4. package/dist/hooks/useFleet.js +144 -131
  5. package/dist/hooks/useInventory.js +144 -145
  6. package/dist/hooks/useRoutes.js +5 -14
  7. package/dist/movethewheels/constants/index.d.ts +1 -0
  8. package/dist/movethewheels/hooks/useFleet.d.ts +13 -1
  9. package/dist/movethewheels/hooks/useInventory.d.ts +10 -0
  10. package/dist/movethewheels/types/index.d.ts +13 -70
  11. package/dist/pages/CustomerDetailsPage.js +666 -344
  12. package/dist/pages/CustomersPage.js +71 -80
  13. package/dist/pages/FleetPage.js +1 -3
  14. package/dist/pages/InventoryPage.js +4 -4
  15. package/dist/pages/RouteDetailsPage.js +273 -248
  16. package/dist/pages/RoutesPage.js +130 -67
  17. package/dist/pages/VehicleDetailsPage.js +506 -391
  18. package/dist/pages/VehiclesPage.js +119 -70
  19. package/dist/pages/WarehouseDetailsPage.js +410 -370
  20. package/dist/pages/WarehousesPage.js +131 -82
  21. package/package.json +1 -1
  22. package/src/movethewheels/components/StatusBadge.tsx +8 -3
  23. package/src/movethewheels/constants/index.ts +9 -0
  24. package/src/movethewheels/hooks/useCustomers.ts +0 -3
  25. package/src/movethewheels/hooks/useFleet.ts +74 -19
  26. package/src/movethewheels/hooks/useInventory.ts +76 -32
  27. package/src/movethewheels/hooks/useRoutes.ts +17 -12
  28. package/src/movethewheels/pages/CustomerDetailsPage.tsx +376 -109
  29. package/src/movethewheels/pages/CustomersPage.tsx +6 -15
  30. package/src/movethewheels/pages/FleetPage.tsx +2 -1
  31. package/src/movethewheels/pages/InventoryPage.tsx +14 -5
  32. package/src/movethewheels/pages/RouteDetailsPage.tsx +74 -34
  33. package/src/movethewheels/pages/RoutesPage.tsx +66 -2
  34. package/src/movethewheels/pages/VehicleDetailsPage.tsx +151 -11
  35. package/src/movethewheels/pages/VehiclesPage.tsx +68 -3
  36. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +213 -135
  37. package/src/movethewheels/pages/WarehousesPage.tsx +77 -16
  38. package/src/movethewheels/types/index.ts +14 -70
@@ -1,97 +1,146 @@
1
1
  import { CircleCheck as e } from "../node_modules/lucide-react/dist/esm/icons/circle-check.js";
2
2
  import { Download as t } from "../node_modules/lucide-react/dist/esm/icons/download.js";
3
- import { Plus as n } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
4
- import { RefreshCw as r } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
3
+ import { Filter as n } from "../node_modules/lucide-react/dist/esm/icons/filter.js";
4
+ import { Plus as r } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
5
+ import { RefreshCw as ee } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
5
6
  import { Route as i } from "../node_modules/lucide-react/dist/esm/icons/route.js";
6
7
  import { Truck as a } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
7
8
  import { Wrench as o } from "../node_modules/lucide-react/dist/esm/icons/wrench.js";
8
9
  import { joinPath as s } from "../utils/navigation.js";
9
10
  import { useMoveTheWheels as c } from "../providers/MoveTheWheelsProvider.js";
10
11
  import { useFleetStats as l, useVehicles as u } from "../hooks/useFleet.js";
11
- import { Progress as d } from "../components/ui.js";
12
- import { PageLayout as f } from "../components/PageLayout.js";
13
- import { MetricCard as p, MetricGrid as m } from "../components/MetricCard.js";
14
- import { StatusBadge as h, VehicleTypeBadge as g } from "../components/StatusBadge.js";
15
- import { DataTable as _ } from "../components/DataTable.js";
16
- import { useDebouncedValue as v } from "../hooks/useDebouncedValue.js";
17
- import { useState as y } from "react";
18
- import { jsx as b, jsxs as x } from "react/jsx-runtime";
19
- import { CTAOverflowMenu as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
12
+ import { Button as d, Card as f, CardContent as p, Progress as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y } from "../components/ui.js";
13
+ import { PageLayout as b } from "../components/PageLayout.js";
14
+ import { MetricCard as x, MetricGrid as S } from "../components/MetricCard.js";
15
+ import { VEHICLE_STATUS_LABELS as C } from "../constants/index.js";
16
+ import { StatusBadge as w, VehicleTypeBadge as T } from "../components/StatusBadge.js";
17
+ import { DataTable as E } from "../components/DataTable.js";
18
+ import { useDebouncedValue as D } from "../hooks/useDebouncedValue.js";
19
+ import { useState as O } from "react";
20
+ import { jsx as k, jsxs as A } from "react/jsx-runtime";
21
+ import { CTAOverflowMenu as j, PagePurpose as M } from "@burdenoff/fe-libs/ui";
20
22
  //#region src/movethewheels/pages/VehiclesPage.tsx
21
- function w() {
22
- let { basePath: w, navigate: T } = c(), [E, D] = y(0), [O, k] = y(25), [A, j] = y(""), M = v(A), { vehicles: N, totalVehicles: P, hasMore: F, isLoading: I, error: L, refetch: R } = u({
23
- limit: O,
24
- offset: E * O,
25
- search: M || void 0
26
- }), { stats: z } = l(), B = z.totalVehicles, V = (e) => {
27
- T && T(s(w, e));
23
+ var N = [{
24
+ value: "all",
25
+ label: "All statuses"
26
+ }, ...Object.entries(C).map(([e, t]) => ({
27
+ value: e,
28
+ label: t
29
+ }))];
30
+ function P() {
31
+ let { basePath: C, navigate: P } = c(), [F, I] = O(0), [L, R] = O(25), [z, B] = O(""), [V, H] = O("all"), U = D(z), { vehicles: W, totalVehicles: G, hasMore: K, isLoading: q, error: J, refetch: Y } = u({
32
+ limit: L,
33
+ offset: F * L,
34
+ search: U || void 0,
35
+ status: V === "all" ? void 0 : V
36
+ }), X = V !== "all" || z.length > 0, { stats: Z } = l(), Q = Z.totalVehicles, $ = (e) => {
37
+ P && P(s(C, e));
28
38
  };
29
- return /* @__PURE__ */ x(f, {
39
+ return /* @__PURE__ */ A(b, {
30
40
  title: "Vehicles",
31
- subtitle: `${B} vehicles in fleet`,
32
- icon: /* @__PURE__ */ b(a, { size: 24 }),
33
- headerActions: /* @__PURE__ */ b(S, {
41
+ subtitle: `${Q} vehicles in fleet`,
42
+ icon: /* @__PURE__ */ k(a, { size: 24 }),
43
+ headerActions: /* @__PURE__ */ k(j, {
34
44
  primary: {
35
45
  label: "Add Vehicle",
36
- icon: /* @__PURE__ */ b(n, { size: 16 }),
37
- onSelect: () => V("fleet/vehicles/new")
46
+ icon: /* @__PURE__ */ k(r, { size: 16 }),
47
+ onSelect: () => $("fleet/vehicles/new")
38
48
  },
39
49
  actions: [{
40
50
  label: "Refresh",
41
- icon: /* @__PURE__ */ b(r, { size: 16 }),
42
- onSelect: () => R()
51
+ icon: /* @__PURE__ */ k(ee, { size: 16 }),
52
+ onSelect: () => Y()
43
53
  }, {
44
54
  label: "Export",
45
- icon: /* @__PURE__ */ b(t, { size: 16 }),
46
- onSelect: () => V("import-export")
55
+ icon: /* @__PURE__ */ k(t, { size: 16 }),
56
+ onSelect: () => $("import-export")
47
57
  }]
48
58
  }),
49
59
  children: [
50
- /* @__PURE__ */ b(C, {
51
- icon: /* @__PURE__ */ b(a, { size: 18 }),
60
+ /* @__PURE__ */ k(M, {
61
+ icon: /* @__PURE__ */ k(a, { size: 18 }),
52
62
  children: "Every truck, van and bike in your fleet. Monitor capacity, fuel level, mileage and maintenance status here so you always know which vehicles are road-ready before dispatching an order."
53
63
  }),
54
- /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
64
+ /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ k("p", {
55
65
  className: "mb-3 text-sm font-medium text-text-secondary",
56
66
  children: "Fleet at a glance"
57
- }), /* @__PURE__ */ x(m, {
67
+ }), /* @__PURE__ */ A(S, {
58
68
  columns: 4,
59
69
  children: [
60
- /* @__PURE__ */ b(p, {
70
+ /* @__PURE__ */ k(x, {
61
71
  label: "Total vehicles",
62
- value: B,
63
- icon: /* @__PURE__ */ b(a, { size: 20 }),
72
+ value: Q,
73
+ icon: /* @__PURE__ */ k(a, { size: 20 }),
64
74
  accent: "brand"
65
75
  }),
66
- /* @__PURE__ */ b(p, {
76
+ /* @__PURE__ */ k(x, {
67
77
  label: "Available now",
68
- value: z.vehiclesByStatus.available,
69
- icon: /* @__PURE__ */ b(e, { size: 20 }),
78
+ value: Z.vehiclesByStatus.available,
79
+ icon: /* @__PURE__ */ k(e, { size: 20 }),
70
80
  accent: "success",
71
81
  subtitle: "Ready to dispatch"
72
82
  }),
73
- /* @__PURE__ */ b(p, {
83
+ /* @__PURE__ */ k(x, {
74
84
  label: "On assignment",
75
- value: z.vehiclesByStatus.assigned,
76
- icon: /* @__PURE__ */ b(i, { size: 20 }),
85
+ value: Z.vehiclesByStatus.assigned,
86
+ icon: /* @__PURE__ */ k(i, { size: 20 }),
77
87
  accent: "blue"
78
88
  }),
79
- /* @__PURE__ */ b(p, {
89
+ /* @__PURE__ */ k(x, {
80
90
  label: "In maintenance",
81
- value: z.vehiclesByStatus.maintenance,
82
- icon: /* @__PURE__ */ b(o, { size: 20 }),
91
+ value: Z.vehiclesByStatus.maintenance,
92
+ icon: /* @__PURE__ */ k(o, { size: 20 }),
83
93
  accent: "warning"
84
94
  })
85
95
  ]
86
96
  })] }),
87
- /* @__PURE__ */ b(_, {
97
+ /* @__PURE__ */ k(f, { children: /* @__PURE__ */ k(p, {
98
+ className: "p-4",
99
+ children: /* @__PURE__ */ A("div", {
100
+ className: "flex flex-wrap items-center gap-4",
101
+ children: [
102
+ /* @__PURE__ */ A("div", {
103
+ className: "flex items-center gap-2",
104
+ children: [/* @__PURE__ */ k(n, {
105
+ size: 16,
106
+ className: "text-text-secondary"
107
+ }), /* @__PURE__ */ k("span", {
108
+ className: "text-sm font-medium",
109
+ children: "Filters:"
110
+ })]
111
+ }),
112
+ /* @__PURE__ */ A(h, {
113
+ value: V,
114
+ onValueChange: (e) => {
115
+ H(e), I(0);
116
+ },
117
+ children: [/* @__PURE__ */ k(v, {
118
+ className: "w-[180px]",
119
+ children: /* @__PURE__ */ k(y, { placeholder: "Status" })
120
+ }), /* @__PURE__ */ k(g, { children: N.map((e) => /* @__PURE__ */ k(_, {
121
+ value: e.value,
122
+ children: e.label
123
+ }, e.value)) })]
124
+ }),
125
+ X && /* @__PURE__ */ k(d, {
126
+ variant: "ghost",
127
+ size: "sm",
128
+ onClick: () => {
129
+ H("all"), B(""), I(0);
130
+ },
131
+ children: "Clear filters"
132
+ })
133
+ ]
134
+ })
135
+ }) }),
136
+ /* @__PURE__ */ k(E, {
88
137
  columns: [
89
138
  {
90
139
  id: "vehicleNumber",
91
140
  header: "Vehicle #",
92
141
  accessorKey: "vehicleNumber",
93
142
  sortable: !0,
94
- cell: (e) => /* @__PURE__ */ b("span", {
143
+ cell: (e) => /* @__PURE__ */ k("span", {
95
144
  className: "font-medium",
96
145
  children: e.vehicleNumber
97
146
  })
@@ -100,21 +149,21 @@ function w() {
100
149
  id: "type",
101
150
  header: "Type",
102
151
  accessorKey: "type",
103
- cell: (e) => /* @__PURE__ */ b(g, { type: e.type })
152
+ cell: (e) => /* @__PURE__ */ k(T, { type: e.type })
104
153
  },
105
154
  {
106
155
  id: "details",
107
156
  header: "Vehicle",
108
- cell: (e) => /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("p", {
157
+ cell: (e) => /* @__PURE__ */ A("div", { children: [/* @__PURE__ */ A("p", {
109
158
  className: "font-medium",
110
159
  children: [
111
160
  e.make,
112
161
  " ",
113
162
  e.model
114
163
  ]
115
- }), /* @__PURE__ */ b("p", {
164
+ }), /* @__PURE__ */ k("p", {
116
165
  className: "text-sm text-text-secondary",
117
- children: e.year
166
+ children: e.year ?? "—"
118
167
  })] })
119
168
  },
120
169
  {
@@ -122,7 +171,7 @@ function w() {
122
171
  header: "Status",
123
172
  accessorKey: "status",
124
173
  sortable: !0,
125
- cell: (e) => /* @__PURE__ */ b(h, {
174
+ cell: (e) => /* @__PURE__ */ k(w, {
126
175
  status: e.status,
127
176
  type: "vehicle"
128
177
  })
@@ -130,9 +179,9 @@ function w() {
130
179
  {
131
180
  id: "capacity",
132
181
  header: "Capacity",
133
- cell: (e) => /* @__PURE__ */ x("div", {
182
+ cell: (e) => /* @__PURE__ */ A("div", {
134
183
  className: "text-sm",
135
- children: [/* @__PURE__ */ x("p", { children: [e.capacity.weight, " kg"] }), /* @__PURE__ */ x("p", {
184
+ children: [/* @__PURE__ */ A("p", { children: [e.capacity.weight, " kg"] }), /* @__PURE__ */ A("p", {
136
185
  className: "text-text-secondary",
137
186
  children: [e.capacity.volume, " m³"]
138
187
  })]
@@ -141,12 +190,12 @@ function w() {
141
190
  {
142
191
  id: "fuel",
143
192
  header: "Fuel Level",
144
- cell: (e) => e.fuelLevel === void 0 ? "-" : /* @__PURE__ */ x("div", {
193
+ cell: (e) => e.fuelLevel === void 0 ? "-" : /* @__PURE__ */ A("div", {
145
194
  className: "flex items-center gap-2",
146
- children: [/* @__PURE__ */ b(d, {
195
+ children: [/* @__PURE__ */ k(m, {
147
196
  value: e.fuelLevel,
148
197
  className: "w-16 h-2"
149
- }), /* @__PURE__ */ x("span", {
198
+ }), /* @__PURE__ */ A("span", {
150
199
  className: "text-sm",
151
200
  children: [e.fuelLevel, "%"]
152
201
  })]
@@ -160,10 +209,10 @@ function w() {
160
209
  cell: (e) => e.mileage ? `${e.mileage.toLocaleString()} mi` : "-"
161
210
  }
162
211
  ],
163
- data: N,
164
- isLoading: I,
165
- error: L,
166
- onRetry: R,
212
+ data: W,
213
+ isLoading: q,
214
+ error: J,
215
+ onRetry: Y,
167
216
  searchable: !0,
168
217
  searchPlaceholder: "Search vehicles...",
169
218
  searchFields: [
@@ -171,20 +220,20 @@ function w() {
171
220
  "make",
172
221
  "model"
173
222
  ],
174
- searchQuery: A,
223
+ searchQuery: z,
175
224
  onSearchQueryChange: (e) => {
176
- j(e), D(0);
225
+ B(e), I(0);
177
226
  },
178
- onRowClick: (e) => V(`fleet/vehicles/${e.id}`),
227
+ onRowClick: (e) => $(`fleet/vehicles/${e.id}`),
179
228
  getRowId: (e) => e.id,
180
- pageIndex: E,
181
- pageSize: O,
182
- onPageChange: D,
229
+ pageIndex: F,
230
+ pageSize: L,
231
+ onPageChange: I,
183
232
  onPageSizeChange: (e) => {
184
- k(e), D(0);
233
+ R(e), I(0);
185
234
  },
186
- totalItems: P,
187
- hasNextPage: F,
235
+ totalItems: G,
236
+ hasNextPage: K,
188
237
  emptyIllustration: "empty-data",
189
238
  emptyTitle: "No vehicles yet",
190
239
  emptyDescription: "Add vehicles to your fleet to start assigning them to deliveries."
@@ -193,4 +242,4 @@ function w() {
193
242
  });
194
243
  }
195
244
  //#endregion
196
- export { w as default };
245
+ export { P as default };