@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.
- package/dist/components/StatusBadge.js +30 -30
- package/dist/constants/index.js +12 -5
- package/dist/hooks/useCustomers.js +0 -3
- package/dist/hooks/useFleet.js +144 -131
- package/dist/hooks/useInventory.js +144 -145
- package/dist/hooks/useRoutes.js +5 -14
- package/dist/movethewheels/constants/index.d.ts +1 -0
- package/dist/movethewheels/hooks/useFleet.d.ts +13 -1
- package/dist/movethewheels/hooks/useInventory.d.ts +10 -0
- package/dist/movethewheels/types/index.d.ts +13 -70
- package/dist/pages/CustomerDetailsPage.js +666 -344
- package/dist/pages/CustomersPage.js +71 -80
- package/dist/pages/FleetPage.js +1 -3
- package/dist/pages/InventoryPage.js +4 -4
- package/dist/pages/RouteDetailsPage.js +273 -248
- package/dist/pages/RoutesPage.js +130 -67
- package/dist/pages/VehicleDetailsPage.js +506 -391
- package/dist/pages/VehiclesPage.js +119 -70
- package/dist/pages/WarehouseDetailsPage.js +410 -370
- package/dist/pages/WarehousesPage.js +131 -82
- package/package.json +1 -1
- package/src/movethewheels/components/StatusBadge.tsx +8 -3
- package/src/movethewheels/constants/index.ts +9 -0
- package/src/movethewheels/hooks/useCustomers.ts +0 -3
- package/src/movethewheels/hooks/useFleet.ts +74 -19
- package/src/movethewheels/hooks/useInventory.ts +76 -32
- package/src/movethewheels/hooks/useRoutes.ts +17 -12
- package/src/movethewheels/pages/CustomerDetailsPage.tsx +376 -109
- package/src/movethewheels/pages/CustomersPage.tsx +6 -15
- package/src/movethewheels/pages/FleetPage.tsx +2 -1
- package/src/movethewheels/pages/InventoryPage.tsx +14 -5
- package/src/movethewheels/pages/RouteDetailsPage.tsx +74 -34
- package/src/movethewheels/pages/RoutesPage.tsx +66 -2
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +151 -11
- package/src/movethewheels/pages/VehiclesPage.tsx +68 -3
- package/src/movethewheels/pages/WarehouseDetailsPage.tsx +213 -135
- package/src/movethewheels/pages/WarehousesPage.tsx +77 -16
- 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 {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
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
|
|
23
|
-
let { basePath:
|
|
24
|
-
limit:
|
|
25
|
-
offset:
|
|
26
|
-
filters: { search:
|
|
27
|
-
}), { stats:
|
|
28
|
-
return /* @__PURE__ */
|
|
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: `${
|
|
31
|
-
icon: /* @__PURE__ */
|
|
32
|
-
headerActions: /* @__PURE__ */ C
|
|
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__ */
|
|
36
|
-
onSelect: () =>
|
|
34
|
+
icon: /* @__PURE__ */ x(n, { size: 16 }),
|
|
35
|
+
onSelect: () => V("customers/new")
|
|
37
36
|
},
|
|
38
37
|
actions: [{
|
|
39
38
|
label: "Refresh",
|
|
40
|
-
icon: /* @__PURE__ */
|
|
41
|
-
onSelect: () =>
|
|
39
|
+
icon: /* @__PURE__ */ x(r, { size: 16 }),
|
|
40
|
+
onSelect: () => z()
|
|
42
41
|
}, {
|
|
43
42
|
label: "Export",
|
|
44
|
-
icon: /* @__PURE__ */
|
|
45
|
-
onSelect: () =>
|
|
43
|
+
icon: /* @__PURE__ */ x(t, { size: 16 }),
|
|
44
|
+
onSelect: () => V("import-export")
|
|
46
45
|
}]
|
|
47
46
|
}),
|
|
48
47
|
children: [
|
|
49
|
-
/* @__PURE__ */
|
|
50
|
-
icon: /* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
55
|
+
}), /* @__PURE__ */ S(h, {
|
|
57
56
|
columns: 3,
|
|
58
57
|
children: [
|
|
59
|
-
/* @__PURE__ */
|
|
58
|
+
/* @__PURE__ */ x(m, {
|
|
60
59
|
label: "Total customers",
|
|
61
|
-
value:
|
|
62
|
-
icon: /* @__PURE__ */
|
|
60
|
+
value: B.total,
|
|
61
|
+
icon: /* @__PURE__ */ x(a, { size: 20 }),
|
|
63
62
|
accent: "brand"
|
|
64
63
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
66
|
-
label: "
|
|
67
|
-
value:
|
|
68
|
-
icon: /* @__PURE__ */
|
|
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: "
|
|
69
|
+
subtitle: "Across all customers"
|
|
71
70
|
}),
|
|
72
|
-
/* @__PURE__ */
|
|
71
|
+
/* @__PURE__ */ x(m, {
|
|
73
72
|
label: "Business accounts",
|
|
74
|
-
value:
|
|
75
|
-
icon: /* @__PURE__ */
|
|
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__ */
|
|
80
|
+
/* @__PURE__ */ x(_, {
|
|
82
81
|
columns: [
|
|
83
82
|
{
|
|
84
83
|
id: "customer",
|
|
85
84
|
header: "Customer",
|
|
86
|
-
cell: (e) => /* @__PURE__ */
|
|
85
|
+
cell: (e) => /* @__PURE__ */ S("div", {
|
|
87
86
|
className: "flex items-center gap-3",
|
|
88
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
121
|
+
cell: (e) => /* @__PURE__ */ S("div", {
|
|
123
122
|
className: "flex items-center gap-1",
|
|
124
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ x(i, {
|
|
125
124
|
size: 14,
|
|
126
125
|
className: "text-status-warning-text fill-current"
|
|
127
|
-
}), /* @__PURE__ */
|
|
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) =>
|
|
134
|
+
cell: (e) => v(e.createdAt, "short")
|
|
144
135
|
}
|
|
145
136
|
],
|
|
146
|
-
data:
|
|
147
|
-
isLoading:
|
|
148
|
-
error:
|
|
149
|
-
onRetry:
|
|
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:
|
|
148
|
+
searchQuery: j,
|
|
158
149
|
onSearchQueryChange: (e) => {
|
|
159
|
-
|
|
150
|
+
M(e), O(0);
|
|
160
151
|
},
|
|
161
|
-
onRowClick: (e) =>
|
|
152
|
+
onRowClick: (e) => V(`customers/${e.id}`),
|
|
162
153
|
getRowId: (e) => e.id,
|
|
163
|
-
pageIndex:
|
|
164
|
-
pageSize:
|
|
165
|
-
onPageChange:
|
|
154
|
+
pageIndex: D,
|
|
155
|
+
pageSize: k,
|
|
156
|
+
onPageChange: O,
|
|
166
157
|
onPageSizeChange: (e) => {
|
|
167
|
-
|
|
158
|
+
A(e), O(0);
|
|
168
159
|
},
|
|
169
|
-
totalItems:
|
|
170
|
-
hasNextPage:
|
|
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__ */
|
|
175
|
-
onClick: () =>
|
|
176
|
-
children: [/* @__PURE__ */
|
|
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 {
|
|
177
|
+
export { T as default };
|
package/dist/pages/FleetPage.js
CHANGED
|
@@ -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
|
|
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.
|
|
423
|
-
children: e.
|
|
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", {
|