@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
@@ -3,92 +3,91 @@ import { Download as t } from "../node_modules/lucide-react/dist/esm/icons/downl
3
3
  import { Plus as n } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
4
4
  import { RefreshCw as r } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
5
5
  import { Star as i } from "../node_modules/lucide-react/dist/esm/icons/star.js";
6
- import { UserCheck as a } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
7
- import { Users as o } from "../node_modules/lucide-react/dist/esm/icons/users.js";
8
- import { joinPath as s } from "../utils/navigation.js";
9
- import { useMoveTheWheels as c } from "../providers/MoveTheWheelsProvider.js";
10
- import { useCustomerStats as l, useCustomers as u } from "../hooks/useCustomers.js";
11
- import { Avatar as d, AvatarFallback as f, Badge as p, Button as m } from "../components/ui.js";
12
- import { PageLayout as h } from "../components/PageLayout.js";
13
- import { MetricCard as g, MetricGrid as _ } from "../components/MetricCard.js";
14
- import { TypeBadge as v } from "../components/StatusBadge.js";
15
- import { DataTable as y } from "../components/DataTable.js";
16
- import { formatDate as b } from "../utils/formatters.js";
17
- import { useDebouncedValue as x } from "../hooks/useDebouncedValue.js";
18
- import { useState as S } from "react";
19
- import { jsx as C, jsxs as w } from "react/jsx-runtime";
20
- import { CTAOverflowMenu as T, PagePurpose as E } from "@burdenoff/fe-libs/ui";
6
+ import { Users as a } from "../node_modules/lucide-react/dist/esm/icons/users.js";
7
+ import { joinPath as o } from "../utils/navigation.js";
8
+ import { useMoveTheWheels as s } from "../providers/MoveTheWheelsProvider.js";
9
+ import { useCustomerStats as c, useCustomers as l } from "../hooks/useCustomers.js";
10
+ import { Avatar as u, AvatarFallback as d, Button as f } from "../components/ui.js";
11
+ import { PageLayout as p } from "../components/PageLayout.js";
12
+ import { MetricCard as m, MetricGrid as h } from "../components/MetricCard.js";
13
+ import { TypeBadge as g } from "../components/StatusBadge.js";
14
+ import { DataTable as _ } from "../components/DataTable.js";
15
+ import { formatDate as v } from "../utils/formatters.js";
16
+ import { useDebouncedValue as y } from "../hooks/useDebouncedValue.js";
17
+ import { useState as b } from "react";
18
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
19
+ import { CTAOverflowMenu as C, PagePurpose as w } from "@burdenoff/fe-libs/ui";
21
20
  //#region src/movethewheels/pages/CustomersPage.tsx
22
- function D() {
23
- let { basePath: D, navigate: O } = c(), [k, A] = S(0), [j, M] = S(25), [N, P] = S(""), F = x(N), { customers: I, totalCustomers: L, hasMore: R, isLoading: z, error: B, refetch: V } = u({
24
- limit: j,
25
- offset: k * j,
26
- filters: { search: F }
27
- }), { stats: H } = l(), U = (e) => O?.(s(D, e));
28
- return /* @__PURE__ */ w(h, {
21
+ function T() {
22
+ let { basePath: T, navigate: E } = s(), [D, O] = b(0), [k, A] = b(25), [j, M] = b(""), N = y(j), { customers: P, totalCustomers: F, hasMore: I, isLoading: L, error: R, refetch: z } = l({
23
+ limit: k,
24
+ offset: D * k,
25
+ filters: { search: N }
26
+ }), { stats: B } = c(), V = (e) => E?.(o(T, e));
27
+ return /* @__PURE__ */ S(p, {
29
28
  title: "Customers",
30
- subtitle: `${H.total} customers`,
31
- icon: /* @__PURE__ */ C(o, { size: 24 }),
32
- headerActions: /* @__PURE__ */ C(T, {
29
+ subtitle: `${B.total} customers`,
30
+ icon: /* @__PURE__ */ x(a, { size: 24 }),
31
+ headerActions: /* @__PURE__ */ x(C, {
33
32
  primary: {
34
33
  label: "Add Customer",
35
- icon: /* @__PURE__ */ C(n, { size: 16 }),
36
- onSelect: () => U("customers/new")
34
+ icon: /* @__PURE__ */ x(n, { size: 16 }),
35
+ onSelect: () => V("customers/new")
37
36
  },
38
37
  actions: [{
39
38
  label: "Refresh",
40
- icon: /* @__PURE__ */ C(r, { size: 16 }),
41
- onSelect: () => V()
39
+ icon: /* @__PURE__ */ x(r, { size: 16 }),
40
+ onSelect: () => z()
42
41
  }, {
43
42
  label: "Export",
44
- icon: /* @__PURE__ */ C(t, { size: 16 }),
45
- onSelect: () => U("import-export")
43
+ icon: /* @__PURE__ */ x(t, { size: 16 }),
44
+ onSelect: () => V("import-export")
46
45
  }]
47
46
  }),
48
47
  children: [
49
- /* @__PURE__ */ C(E, {
50
- icon: /* @__PURE__ */ C(o, { size: 18 }),
48
+ /* @__PURE__ */ x(w, {
49
+ icon: /* @__PURE__ */ x(a, { size: 18 }),
51
50
  children: "The businesses and individuals you deliver for. Keep contact details, locations and satisfaction ratings here, and open a customer to see their order history before booking the next shipment."
52
51
  }),
53
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
52
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
54
53
  className: "mb-3 text-sm font-medium text-text-secondary",
55
54
  children: "Customer base at a glance"
56
- }), /* @__PURE__ */ w(_, {
55
+ }), /* @__PURE__ */ S(h, {
57
56
  columns: 3,
58
57
  children: [
59
- /* @__PURE__ */ C(g, {
58
+ /* @__PURE__ */ x(m, {
60
59
  label: "Total customers",
61
- value: H.total,
62
- icon: /* @__PURE__ */ C(o, { size: 20 }),
60
+ value: B.total,
61
+ icon: /* @__PURE__ */ x(a, { size: 20 }),
63
62
  accent: "brand"
64
63
  }),
65
- /* @__PURE__ */ C(g, {
66
- label: "Active",
67
- value: H.active,
68
- icon: /* @__PURE__ */ C(a, { size: 20 }),
64
+ /* @__PURE__ */ x(m, {
65
+ label: "Avg. rating",
66
+ value: B.avgRating > 0 ? B.avgRating.toFixed(1) : "—",
67
+ icon: /* @__PURE__ */ x(i, { size: 20 }),
69
68
  accent: "success",
70
- subtitle: "Currently transacting"
69
+ subtitle: "Across all customers"
71
70
  }),
72
- /* @__PURE__ */ C(g, {
71
+ /* @__PURE__ */ x(m, {
73
72
  label: "Business accounts",
74
- value: H.b2b,
75
- icon: /* @__PURE__ */ C(e, { size: 20 }),
73
+ value: B.b2b,
74
+ icon: /* @__PURE__ */ x(e, { size: 20 }),
76
75
  accent: "blue",
77
76
  subtitle: "B2B relationships"
78
77
  })
79
78
  ]
80
79
  })] }),
81
- /* @__PURE__ */ C(y, {
80
+ /* @__PURE__ */ x(_, {
82
81
  columns: [
83
82
  {
84
83
  id: "customer",
85
84
  header: "Customer",
86
- cell: (e) => /* @__PURE__ */ w("div", {
85
+ cell: (e) => /* @__PURE__ */ S("div", {
87
86
  className: "flex items-center gap-3",
88
- children: [/* @__PURE__ */ C(d, { children: /* @__PURE__ */ C(f, { children: e.name.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
87
+ children: [/* @__PURE__ */ x(u, { children: /* @__PURE__ */ x(d, { children: e.name.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
89
88
  className: "font-medium",
90
89
  children: e.name
91
- }), /* @__PURE__ */ C("p", {
90
+ }), /* @__PURE__ */ x("p", {
92
91
  className: "text-sm text-text-secondary",
93
92
  children: e.email
94
93
  })] })]
@@ -98,7 +97,7 @@ function D() {
98
97
  id: "type",
99
98
  header: "Type",
100
99
  accessorKey: "type",
101
- cell: (e) => /* @__PURE__ */ C(v, { type: e.type })
100
+ cell: (e) => /* @__PURE__ */ x(g, { type: e.type })
102
101
  },
103
102
  {
104
103
  id: "company",
@@ -119,20 +118,12 @@ function D() {
119
118
  {
120
119
  id: "rating",
121
120
  header: "Rating",
122
- cell: (e) => /* @__PURE__ */ w("div", {
121
+ cell: (e) => /* @__PURE__ */ S("div", {
123
122
  className: "flex items-center gap-1",
124
- children: [/* @__PURE__ */ C(i, {
123
+ children: [/* @__PURE__ */ x(i, {
125
124
  size: 14,
126
125
  className: "text-status-warning-text fill-current"
127
- }), /* @__PURE__ */ C("span", { children: e.rating.toFixed(1) })]
128
- })
129
- },
130
- {
131
- id: "status",
132
- header: "Status",
133
- cell: (e) => /* @__PURE__ */ C(p, {
134
- variant: e.isActive ? "default" : "secondary",
135
- children: e.isActive ? "Active" : "Inactive"
126
+ }), /* @__PURE__ */ x("span", { children: e.rating.toFixed(1) })]
136
127
  })
137
128
  },
138
129
  {
@@ -140,13 +131,13 @@ function D() {
140
131
  header: "Created",
141
132
  accessorKey: "createdAt",
142
133
  sortable: !0,
143
- cell: (e) => b(e.createdAt, "short")
134
+ cell: (e) => v(e.createdAt, "short")
144
135
  }
145
136
  ],
146
- data: I,
147
- isLoading: z,
148
- error: B,
149
- onRetry: V,
137
+ data: P,
138
+ isLoading: L,
139
+ error: R,
140
+ onRetry: z,
150
141
  searchable: !0,
151
142
  searchPlaceholder: "Search customers...",
152
143
  searchFields: [
@@ -154,26 +145,26 @@ function D() {
154
145
  "email",
155
146
  "company"
156
147
  ],
157
- searchQuery: N,
148
+ searchQuery: j,
158
149
  onSearchQueryChange: (e) => {
159
- P(e), A(0);
150
+ M(e), O(0);
160
151
  },
161
- onRowClick: (e) => U(`customers/${e.id}`),
152
+ onRowClick: (e) => V(`customers/${e.id}`),
162
153
  getRowId: (e) => e.id,
163
- pageIndex: k,
164
- pageSize: j,
165
- onPageChange: A,
154
+ pageIndex: D,
155
+ pageSize: k,
156
+ onPageChange: O,
166
157
  onPageSizeChange: (e) => {
167
- M(e), A(0);
158
+ A(e), O(0);
168
159
  },
169
- totalItems: L,
170
- hasNextPage: R,
160
+ totalItems: F,
161
+ hasNextPage: I,
171
162
  emptyIllustration: "empty-people",
172
163
  emptyTitle: "No customers yet",
173
164
  emptyDescription: "Add your first customer to start booking deliveries for them.",
174
- emptyAction: /* @__PURE__ */ w(m, {
175
- onClick: () => U("customers/new"),
176
- children: [/* @__PURE__ */ C(n, {
165
+ emptyAction: /* @__PURE__ */ S(f, {
166
+ onClick: () => V("customers/new"),
167
+ children: [/* @__PURE__ */ x(n, {
177
168
  size: 16,
178
169
  className: "mr-1.5"
179
170
  }), "Add Customer"]
@@ -183,4 +174,4 @@ function D() {
183
174
  });
184
175
  }
185
176
  //#endregion
186
- export { D as default };
177
+ export { T as default };
@@ -190,9 +190,7 @@ function A() {
190
190
  e.make,
191
191
  " ",
192
192
  e.model,
193
- " (",
194
- e.year,
195
- ")"
193
+ e.year ? ` (${e.year})` : ""
196
194
  ]
197
195
  })] })]
198
196
  }), /* @__PURE__ */ w("div", {
@@ -71,7 +71,7 @@ function M() {
71
71
  allocated: e.reservedQuantity,
72
72
  available: e.availableQuantity,
73
73
  reorderLevel: e.reorderLevel,
74
- stockState: e.quantity === 0 ? "out_of_stock" : e.availableQuantity <= e.reorderLevel ? "low" : "in_stock"
74
+ stockState: e.quantity === 0 ? "out_of_stock" : e.reorderLevel !== void 0 && e.availableQuantity <= e.reorderLevel ? "low" : "in_stock"
75
75
  })), [H, $]), ve = [
76
76
  {
77
77
  id: "product",
@@ -131,7 +131,7 @@ function M() {
131
131
  header: N("movethewheels.inventory.stock.reorderPoint", "Reorder point"),
132
132
  accessorKey: "reorderLevel",
133
133
  sortable: !0,
134
- cell: (e) => e.reorderLevel > 0 ? e.reorderLevel.toLocaleString() : "—"
134
+ cell: (e) => e.reorderLevel === void 0 ? "—" : e.reorderLevel.toLocaleString()
135
135
  },
136
136
  {
137
137
  id: "state",
@@ -419,8 +419,8 @@ function M() {
419
419
  })] }), /* @__PURE__ */ w("div", {
420
420
  className: "text-right",
421
421
  children: [/* @__PURE__ */ C(d, {
422
- variant: e.isActive ? "default" : "secondary",
423
- children: e.isActive ? N("movethewheels.inventory.warehouses.active", "Active") : N("movethewheels.inventory.warehouses.inactive", "Inactive")
422
+ variant: e.status.toUpperCase() === "ACTIVE" ? "default" : "secondary",
423
+ children: e.status.toUpperCase() === "ACTIVE" ? N("movethewheels.inventory.warehouses.active", "Active") : N("movethewheels.inventory.warehouses.inactive", "Inactive")
424
424
  }), /* @__PURE__ */ w("div", {
425
425
  className: "mt-2",
426
426
  children: [/* @__PURE__ */ C("p", {