@burdenoff/microfe-movethewheels 2026.726.1 → 2026.728.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.
- package/dist/MoveTheWheelsRoutes.js +7 -3
- package/dist/components/ProofOfDeliveryCard.js +155 -0
- package/dist/components/SignaturePad.js +82 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useEpod.js +208 -0
- package/dist/index.js +22 -21
- package/dist/movethewheels/components/ProofOfDeliveryCard.d.ts +5 -0
- package/dist/movethewheels/components/SignaturePad.d.ts +11 -0
- package/dist/movethewheels/hooks/index.d.ts +1 -0
- package/dist/movethewheels/hooks/useEpod.d.ts +59 -0
- package/dist/movethewheels/pages/DeliveryCapturePage.d.ts +1 -0
- package/dist/movethewheels/types/index.d.ts +18 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/loader-circle.js +8 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/pen-line.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/type.js +24 -0
- package/dist/pages/DeliveryCapturePage.js +245 -0
- package/dist/pages/OrderDetailsPage.js +14 -12
- package/dist/pages/TrackingPage.js +156 -154
- package/dist/utils/formatters.js +13 -2
- package/package.json +1 -1
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +4 -0
- package/src/movethewheels/components/ProofOfDeliveryCard.tsx +149 -0
- package/src/movethewheels/components/SignaturePad.tsx +157 -0
- package/src/movethewheels/hooks/index.ts +12 -0
- package/src/movethewheels/hooks/useEpod.ts +410 -0
- package/src/movethewheels/pages/DeliveryCapturePage.tsx +297 -0
- package/src/movethewheels/pages/OrderDetailsPage.tsx +4 -0
- package/src/movethewheels/pages/TrackingPage.tsx +4 -0
- package/src/movethewheels/types/index.ts +21 -0
|
@@ -15,38 +15,39 @@ import "../components/maps/index.js";
|
|
|
15
15
|
import { StatusBadge as y } from "../components/StatusBadge.js";
|
|
16
16
|
import { formatAddress as b, formatDate as x } from "../utils/formatters.js";
|
|
17
17
|
import { firstRealLatLng as S } from "../utils/mapMarkers.js";
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
18
|
+
import { ProofOfDeliveryCard as C } from "../components/ProofOfDeliveryCard.js";
|
|
19
|
+
import { useMemo as w, useState as T } from "react";
|
|
20
|
+
import { useSearchParams as E } from "react-router-dom";
|
|
21
|
+
import { jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
22
|
+
import { EmphasisPanel as k, PagePurpose as A } from "@burdenoff/fe-libs/ui";
|
|
23
|
+
import { useI18n as j } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
23
24
|
//#region src/movethewheels/pages/TrackingPage.tsx
|
|
24
|
-
function
|
|
25
|
-
let { t:
|
|
26
|
-
let n =
|
|
25
|
+
function M() {
|
|
26
|
+
let { t: M } = j(), N = (e, t) => {
|
|
27
|
+
let n = M(e);
|
|
27
28
|
return n === e ? t : n;
|
|
28
|
-
}, { basePath:
|
|
29
|
-
e.preventDefault(),
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
if (!
|
|
34
|
-
let e = S(
|
|
29
|
+
}, { basePath: P, navigate: F } = c(), [I] = E(), L = I.get("order") || "", [R, z] = T(L), [B, V] = T(L), { tracking: H, order: U, isLoading: W, error: G } = l(B || void 0), K = (e) => {
|
|
30
|
+
e.preventDefault(), V(R);
|
|
31
|
+
}, q = (e) => {
|
|
32
|
+
F && F(s(P, e));
|
|
33
|
+
}, J = w(() => {
|
|
34
|
+
if (!U) return null;
|
|
35
|
+
let e = S(U.pickupAddress), t = S(U.deliveryAddress), n = e ? {
|
|
35
36
|
...e,
|
|
36
|
-
label: `Pickup · ${
|
|
37
|
+
label: `Pickup · ${U.pickupAddress.city || "Origin"}`
|
|
37
38
|
} : null, r = t ? {
|
|
38
39
|
...t,
|
|
39
|
-
label: `Delivery · ${
|
|
40
|
-
} : null, i =
|
|
40
|
+
label: `Delivery · ${U.deliveryAddress.city || "Destination"}`
|
|
41
|
+
} : null, i = U.timeline.map((e) => {
|
|
41
42
|
let t = e.location ? S(e.location) : null;
|
|
42
43
|
return t ? {
|
|
43
44
|
lat: t.lat,
|
|
44
45
|
lng: t.lng,
|
|
45
46
|
timestamp: new Date(e.timestamp).toISOString()
|
|
46
47
|
} : null;
|
|
47
|
-
}).filter((e) => e !== null), a =
|
|
48
|
+
}).filter((e) => e !== null), a = H ? S(H.currentLocation) : null, o = a ? {
|
|
48
49
|
...a,
|
|
49
|
-
label:
|
|
50
|
+
label: H?.currentLocation.address || "Current position"
|
|
50
51
|
} : null;
|
|
51
52
|
return {
|
|
52
53
|
origin: n,
|
|
@@ -55,157 +56,157 @@ function j() {
|
|
|
55
56
|
current: o,
|
|
56
57
|
hasAny: !!(n || r || o || i.length > 0)
|
|
57
58
|
};
|
|
58
|
-
}, [
|
|
59
|
-
return /* @__PURE__ */
|
|
60
|
-
title:
|
|
61
|
-
subtitle:
|
|
62
|
-
icon: /* @__PURE__ */
|
|
63
|
-
headerActions: /* @__PURE__ */
|
|
59
|
+
}, [U, H]);
|
|
60
|
+
return /* @__PURE__ */ O(_, {
|
|
61
|
+
title: N("movethewheels.tracking.title", "Track Shipment"),
|
|
62
|
+
subtitle: N("movethewheels.tracking.subtitle", "Enter a tracking number or order ID to track your shipment"),
|
|
63
|
+
icon: /* @__PURE__ */ D(r, { size: 24 }),
|
|
64
|
+
headerActions: /* @__PURE__ */ O(u, {
|
|
64
65
|
variant: "outline",
|
|
65
|
-
onClick: () =>
|
|
66
|
-
children: [/* @__PURE__ */
|
|
66
|
+
onClick: () => q("tracking/live"),
|
|
67
|
+
children: [/* @__PURE__ */ D(r, { size: 16 }), N("movethewheels.tracking.actions.liveMapView", "Live Map View")]
|
|
67
68
|
}),
|
|
68
69
|
children: [
|
|
69
|
-
/* @__PURE__ */
|
|
70
|
-
icon: /* @__PURE__ */
|
|
71
|
-
children:
|
|
70
|
+
/* @__PURE__ */ D(A, {
|
|
71
|
+
icon: /* @__PURE__ */ D(r, { size: 18 }),
|
|
72
|
+
children: N("movethewheels.tracking.purpose", "Look up any single shipment by its tracking number or order ID to see exactly where it is, its progress through pickup and delivery, the current location and any alerts — the same view you can share with a customer.")
|
|
72
73
|
}),
|
|
73
|
-
/* @__PURE__ */
|
|
74
|
+
/* @__PURE__ */ D(d, { children: /* @__PURE__ */ D(f, {
|
|
74
75
|
className: "p-6",
|
|
75
|
-
children: /* @__PURE__ */
|
|
76
|
-
onSubmit:
|
|
76
|
+
children: /* @__PURE__ */ O("form", {
|
|
77
|
+
onSubmit: K,
|
|
77
78
|
className: "flex gap-4",
|
|
78
|
-
children: [/* @__PURE__ */
|
|
79
|
+
children: [/* @__PURE__ */ O("div", {
|
|
79
80
|
className: "flex-1 relative",
|
|
80
|
-
children: [/* @__PURE__ */
|
|
81
|
-
value:
|
|
82
|
-
onChange: (e) =>
|
|
83
|
-
placeholder:
|
|
81
|
+
children: [/* @__PURE__ */ D(a, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-5 h-5 text-text-secondary" }), /* @__PURE__ */ D(h, {
|
|
82
|
+
value: R,
|
|
83
|
+
onChange: (e) => z(e.target.value),
|
|
84
|
+
placeholder: N("movethewheels.tracking.search.placeholder", "Enter tracking number or order ID (e.g., order-1 or TRK123456789)"),
|
|
84
85
|
className: "pl-10 h-12 text-lg"
|
|
85
86
|
})]
|
|
86
|
-
}), /* @__PURE__ */
|
|
87
|
+
}), /* @__PURE__ */ D(u, {
|
|
87
88
|
type: "submit",
|
|
88
89
|
size: "lg",
|
|
89
|
-
disabled: !
|
|
90
|
-
children:
|
|
90
|
+
disabled: !R || W,
|
|
91
|
+
children: W ? N("movethewheels.tracking.search.searching", "Searching...") : N("movethewheels.tracking.search.track", "Track")
|
|
91
92
|
})]
|
|
92
93
|
})
|
|
93
94
|
}) }),
|
|
94
|
-
|
|
95
|
+
G && /* @__PURE__ */ D(d, {
|
|
95
96
|
className: "border-status-error-border",
|
|
96
|
-
children: /* @__PURE__ */
|
|
97
|
+
children: /* @__PURE__ */ D(f, {
|
|
97
98
|
className: "p-6",
|
|
98
|
-
children: /* @__PURE__ */
|
|
99
|
+
children: /* @__PURE__ */ O("div", {
|
|
99
100
|
className: "flex items-center gap-4",
|
|
100
|
-
children: [/* @__PURE__ */
|
|
101
|
+
children: [/* @__PURE__ */ D(e, { className: "w-8 h-8 text-status-error-text" }), /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
101
102
|
className: "font-medium text-status-error-text",
|
|
102
|
-
children:
|
|
103
|
-
}), /* @__PURE__ */
|
|
103
|
+
children: N("movethewheels.tracking.error.title", "Unable to find shipment")
|
|
104
|
+
}), /* @__PURE__ */ D("p", {
|
|
104
105
|
className: "text-sm text-text-secondary",
|
|
105
|
-
children:
|
|
106
|
+
children: N("movethewheels.tracking.error.description", "Please check the tracking number and try again")
|
|
106
107
|
})] })]
|
|
107
108
|
})
|
|
108
109
|
})
|
|
109
110
|
}),
|
|
110
|
-
!
|
|
111
|
+
!B && !G && /* @__PURE__ */ D(g, {
|
|
111
112
|
illustration: "onboarding",
|
|
112
|
-
title:
|
|
113
|
-
description:
|
|
113
|
+
title: N("movethewheels.tracking.empty.title", "Enter a tracking number"),
|
|
114
|
+
description: N("movethewheels.tracking.empty.description", "Use your tracking number or order ID to see the current status of your shipment")
|
|
114
115
|
}),
|
|
115
|
-
|
|
116
|
+
U && H && /* @__PURE__ */ O("div", {
|
|
116
117
|
className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
|
|
117
|
-
children: [/* @__PURE__ */
|
|
118
|
+
children: [/* @__PURE__ */ O("div", {
|
|
118
119
|
className: "lg:col-span-2 space-y-6",
|
|
119
120
|
children: [
|
|
120
|
-
/* @__PURE__ */
|
|
121
|
+
/* @__PURE__ */ O(k, { children: [/* @__PURE__ */ O("div", {
|
|
121
122
|
className: "flex items-center justify-between mb-4",
|
|
122
|
-
children: [/* @__PURE__ */
|
|
123
|
+
children: [/* @__PURE__ */ O("h2", {
|
|
123
124
|
className: "flex items-center gap-2 text-base font-semibold text-text-primary",
|
|
124
125
|
children: [
|
|
125
|
-
/* @__PURE__ */
|
|
126
|
-
|
|
126
|
+
/* @__PURE__ */ D(i, { size: 20 }),
|
|
127
|
+
N("movethewheels.tracking.orderLabel", "Order"),
|
|
127
128
|
" ",
|
|
128
|
-
|
|
129
|
+
U.orderNumber
|
|
129
130
|
]
|
|
130
|
-
}), /* @__PURE__ */
|
|
131
|
-
status:
|
|
131
|
+
}), /* @__PURE__ */ D(y, {
|
|
132
|
+
status: U.status,
|
|
132
133
|
type: "order"
|
|
133
134
|
})]
|
|
134
|
-
}), /* @__PURE__ */
|
|
135
|
+
}), /* @__PURE__ */ O("div", {
|
|
135
136
|
className: "grid grid-cols-2 md:grid-cols-4 gap-4",
|
|
136
137
|
children: [
|
|
137
|
-
/* @__PURE__ */
|
|
138
|
+
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
138
139
|
className: "text-sm text-text-secondary",
|
|
139
|
-
children:
|
|
140
|
-
}), /* @__PURE__ */
|
|
140
|
+
children: N("movethewheels.tracking.details.trackingNumber", "Tracking Number")
|
|
141
|
+
}), /* @__PURE__ */ D("p", {
|
|
141
142
|
className: "font-mono font-medium",
|
|
142
|
-
children:
|
|
143
|
+
children: U.trackingNumber
|
|
143
144
|
})] }),
|
|
144
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
145
146
|
className: "text-sm text-text-secondary",
|
|
146
|
-
children:
|
|
147
|
-
}), /* @__PURE__ */
|
|
147
|
+
children: N("movethewheels.tracking.details.estimatedDelivery", "Estimated Delivery")
|
|
148
|
+
}), /* @__PURE__ */ D("p", {
|
|
148
149
|
className: "font-medium",
|
|
149
|
-
children:
|
|
150
|
+
children: H.estimatedArrival ? x(H.estimatedArrival, "full") : U.scheduledDelivery ? x(U.scheduledDelivery, "full") : N("movethewheels.tracking.details.tbd", "TBD")
|
|
150
151
|
})] }),
|
|
151
|
-
/* @__PURE__ */
|
|
152
|
+
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
152
153
|
className: "text-sm text-text-secondary",
|
|
153
|
-
children:
|
|
154
|
-
}), /* @__PURE__ */
|
|
154
|
+
children: N("movethewheels.tracking.details.items", "Items")
|
|
155
|
+
}), /* @__PURE__ */ O("p", {
|
|
155
156
|
className: "font-medium",
|
|
156
157
|
children: [
|
|
157
|
-
|
|
158
|
+
U.items.length,
|
|
158
159
|
" ",
|
|
159
|
-
|
|
160
|
+
N("movethewheels.tracking.details.itemsSuffix", "items")
|
|
160
161
|
]
|
|
161
162
|
})] }),
|
|
162
|
-
/* @__PURE__ */
|
|
163
|
+
/* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
163
164
|
className: "text-sm text-text-secondary",
|
|
164
|
-
children:
|
|
165
|
-
}), /* @__PURE__ */
|
|
165
|
+
children: N("movethewheels.tracking.details.lastUpdated", "Last Updated")
|
|
166
|
+
}), /* @__PURE__ */ D("p", {
|
|
166
167
|
className: "font-medium",
|
|
167
|
-
children: x(
|
|
168
|
+
children: x(H.lastUpdated, "relative")
|
|
168
169
|
})] })
|
|
169
170
|
]
|
|
170
171
|
})] }),
|
|
171
|
-
/* @__PURE__ */
|
|
172
|
+
/* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(p, { children: /* @__PURE__ */ O(m, {
|
|
172
173
|
className: "flex items-center gap-2",
|
|
173
|
-
children: [/* @__PURE__ */
|
|
174
|
-
}) }), /* @__PURE__ */
|
|
174
|
+
children: [/* @__PURE__ */ D(r, { size: 18 }), N("movethewheels.tracking.routeMap.title", "Route map")]
|
|
175
|
+
}) }), /* @__PURE__ */ D(f, { children: /* @__PURE__ */ D(v, {
|
|
175
176
|
className: "overflow-hidden rounded-lg border border-border-seam",
|
|
176
177
|
height: 320,
|
|
177
|
-
origin:
|
|
178
|
-
destination:
|
|
179
|
-
trail:
|
|
180
|
-
current:
|
|
181
|
-
emptyMessage:
|
|
178
|
+
origin: J?.origin ?? null,
|
|
179
|
+
destination: J?.destination ?? null,
|
|
180
|
+
trail: J?.trail ?? [],
|
|
181
|
+
current: J?.current ?? null,
|
|
182
|
+
emptyMessage: N("movethewheels.tracking.routeMap.empty", "No location coordinates recorded for this shipment yet")
|
|
182
183
|
}) })] }),
|
|
183
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(p, { children: /* @__PURE__ */ O(m, {
|
|
184
185
|
className: "flex items-center gap-2",
|
|
185
|
-
children: [/* @__PURE__ */
|
|
186
|
-
}) }), /* @__PURE__ */
|
|
186
|
+
children: [/* @__PURE__ */ D(n, { size: 18 }), N("movethewheels.tracking.progress.title", "Shipment Progress")]
|
|
187
|
+
}) }), /* @__PURE__ */ O(f, { children: [/* @__PURE__ */ D("div", {
|
|
187
188
|
className: "relative",
|
|
188
|
-
children: /* @__PURE__ */
|
|
189
|
+
children: /* @__PURE__ */ D("div", {
|
|
189
190
|
className: "flex justify-between mb-4",
|
|
190
191
|
children: [
|
|
191
192
|
{
|
|
192
193
|
status: "confirmed",
|
|
193
|
-
label:
|
|
194
|
+
label: N("movethewheels.tracking.progress.confirmed", "Confirmed"),
|
|
194
195
|
icon: t
|
|
195
196
|
},
|
|
196
197
|
{
|
|
197
198
|
status: "picked_up",
|
|
198
|
-
label:
|
|
199
|
+
label: N("movethewheels.tracking.progress.pickedUp", "Picked Up"),
|
|
199
200
|
icon: i
|
|
200
201
|
},
|
|
201
202
|
{
|
|
202
203
|
status: "in_transit",
|
|
203
|
-
label:
|
|
204
|
+
label: N("movethewheels.tracking.progress.inTransit", "In Transit"),
|
|
204
205
|
icon: o
|
|
205
206
|
},
|
|
206
207
|
{
|
|
207
208
|
status: "delivered",
|
|
208
|
-
label:
|
|
209
|
+
label: N("movethewheels.tracking.progress.delivered", "Delivered"),
|
|
209
210
|
icon: r
|
|
210
211
|
}
|
|
211
212
|
].map((e, t) => {
|
|
@@ -217,19 +218,19 @@ function j() {
|
|
|
217
218
|
"in_transit",
|
|
218
219
|
"out_for_delivery",
|
|
219
220
|
"delivered"
|
|
220
|
-
], r = n.indexOf(
|
|
221
|
-
return /* @__PURE__ */
|
|
221
|
+
], r = n.indexOf(U.status), i = n.indexOf(e.status) <= r, a = e.status === U.status || U.status === "out_for_delivery" && e.status === "in_transit";
|
|
222
|
+
return /* @__PURE__ */ O("div", {
|
|
222
223
|
className: "flex flex-col items-center flex-1",
|
|
223
224
|
children: [
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
+
/* @__PURE__ */ D("div", {
|
|
225
226
|
className: `w-10 h-10 rounded-full flex items-center justify-center ${i ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary"} ${a ? "ring-4 ring-primary/20" : ""}`,
|
|
226
|
-
children: /* @__PURE__ */
|
|
227
|
+
children: /* @__PURE__ */ D(e.icon, { size: 20 })
|
|
227
228
|
}),
|
|
228
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ D("p", {
|
|
229
230
|
className: `text-xs mt-2 text-center ${i ? "font-medium" : "text-text-secondary"}`,
|
|
230
231
|
children: e.label
|
|
231
232
|
}),
|
|
232
|
-
t < 3 && /* @__PURE__ */
|
|
233
|
+
t < 3 && /* @__PURE__ */ D("div", {
|
|
233
234
|
className: `absolute top-5 h-0.5 ${i ? "bg-action-primary-bg" : "bg-bg-sunken"}`,
|
|
234
235
|
style: {
|
|
235
236
|
left: `calc(${(t + .5) * 25}% + 20px)`,
|
|
@@ -240,34 +241,34 @@ function j() {
|
|
|
240
241
|
}, e.status);
|
|
241
242
|
})
|
|
242
243
|
})
|
|
243
|
-
}), /* @__PURE__ */
|
|
244
|
+
}), /* @__PURE__ */ D("div", {
|
|
244
245
|
className: "mt-8 space-y-4",
|
|
245
|
-
children:
|
|
246
|
+
children: U.timeline.slice().reverse().map((e, t) => /* @__PURE__ */ O("div", {
|
|
246
247
|
className: "flex gap-4",
|
|
247
|
-
children: [/* @__PURE__ */
|
|
248
|
+
children: [/* @__PURE__ */ O("div", {
|
|
248
249
|
className: "relative",
|
|
249
|
-
children: [/* @__PURE__ */
|
|
250
|
-
}), /* @__PURE__ */
|
|
250
|
+
children: [/* @__PURE__ */ D("div", { className: `w-3 h-3 rounded-full ${t === 0 ? "bg-action-primary-bg" : "bg-bg-sunken"}` }), t < U.timeline.length - 1 && /* @__PURE__ */ D("div", { className: "absolute top-3 left-1.5 w-px h-8 -ml-px bg-border" })]
|
|
251
|
+
}), /* @__PURE__ */ O("div", {
|
|
251
252
|
className: "flex-1 pb-4",
|
|
252
253
|
children: [
|
|
253
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ O("div", {
|
|
254
255
|
className: "flex items-center gap-2",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ D(y, {
|
|
256
257
|
status: e.status,
|
|
257
258
|
type: "order",
|
|
258
259
|
size: "sm"
|
|
259
|
-
}), /* @__PURE__ */
|
|
260
|
+
}), /* @__PURE__ */ D("span", {
|
|
260
261
|
className: "text-sm text-text-secondary",
|
|
261
262
|
children: x(e.timestamp, "full")
|
|
262
263
|
})]
|
|
263
264
|
}),
|
|
264
|
-
e.notes && /* @__PURE__ */
|
|
265
|
+
e.notes && /* @__PURE__ */ D("p", {
|
|
265
266
|
className: "text-sm mt-1",
|
|
266
267
|
children: e.notes
|
|
267
268
|
}),
|
|
268
|
-
e.location && /* @__PURE__ */
|
|
269
|
+
e.location && /* @__PURE__ */ O("p", {
|
|
269
270
|
className: "text-xs text-text-secondary mt-1",
|
|
270
|
-
children: [/* @__PURE__ */
|
|
271
|
+
children: [/* @__PURE__ */ D(r, {
|
|
271
272
|
size: 12,
|
|
272
273
|
className: "inline mr-1"
|
|
273
274
|
}), b(e.location)]
|
|
@@ -276,97 +277,98 @@ function j() {
|
|
|
276
277
|
})]
|
|
277
278
|
}, t))
|
|
278
279
|
})] })] }),
|
|
279
|
-
|
|
280
|
+
H.alerts && H.alerts.length > 0 && /* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(p, { children: /* @__PURE__ */ O(m, {
|
|
280
281
|
className: "flex items-center gap-2",
|
|
281
|
-
children: [/* @__PURE__ */
|
|
282
|
-
}) }), /* @__PURE__ */
|
|
282
|
+
children: [/* @__PURE__ */ D(e, { size: 18 }), N("movethewheels.tracking.alerts.title", "Alerts")]
|
|
283
|
+
}) }), /* @__PURE__ */ D(f, { children: /* @__PURE__ */ D("div", {
|
|
283
284
|
className: "space-y-3",
|
|
284
|
-
children:
|
|
285
|
+
children: H.alerts.map((t) => /* @__PURE__ */ O("div", {
|
|
285
286
|
className: `flex items-start gap-3 p-3 rounded-lg ${t.severity === "critical" ? "bg-status-error-bg-subtle" : (t.severity, "bg-status-warning-bg-subtle")}`,
|
|
286
|
-
children: [/* @__PURE__ */
|
|
287
|
+
children: [/* @__PURE__ */ D(e, {
|
|
287
288
|
size: 16,
|
|
288
289
|
className: t.severity === "critical" ? "text-status-error-text" : (t.severity, "text-status-warning-text")
|
|
289
|
-
}), /* @__PURE__ */
|
|
290
|
+
}), /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
|
|
290
291
|
className: "text-sm font-medium",
|
|
291
292
|
children: t.message
|
|
292
|
-
}), /* @__PURE__ */
|
|
293
|
+
}), /* @__PURE__ */ O("p", {
|
|
293
294
|
className: "text-xs text-text-secondary",
|
|
294
|
-
children: [x(t.timestamp, "relative"), t.resolvedAt && ` - ${
|
|
295
|
+
children: [x(t.timestamp, "relative"), t.resolvedAt && ` - ${N("movethewheels.tracking.alerts.resolved", "Resolved")}`]
|
|
295
296
|
})] })]
|
|
296
297
|
}, t.id))
|
|
297
298
|
}) })] })
|
|
298
299
|
]
|
|
299
|
-
}), /* @__PURE__ */
|
|
300
|
+
}), /* @__PURE__ */ O("div", {
|
|
300
301
|
className: "space-y-6",
|
|
301
302
|
children: [
|
|
302
|
-
/* @__PURE__ */
|
|
303
|
+
/* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(p, { children: /* @__PURE__ */ O(m, {
|
|
303
304
|
className: "flex items-center gap-2",
|
|
304
|
-
children: [/* @__PURE__ */
|
|
305
|
-
}) }), /* @__PURE__ */
|
|
306
|
-
|
|
305
|
+
children: [/* @__PURE__ */ D(r, { size: 18 }), N("movethewheels.tracking.location.title", "Current Location")]
|
|
306
|
+
}) }), /* @__PURE__ */ O(f, { children: [
|
|
307
|
+
J?.current ? /* @__PURE__ */ D(v, {
|
|
307
308
|
className: "mb-4 overflow-hidden rounded-lg border border-border-seam",
|
|
308
309
|
height: 180,
|
|
309
|
-
current:
|
|
310
|
-
destination:
|
|
311
|
-
trail:
|
|
312
|
-
}) : /* @__PURE__ */
|
|
310
|
+
current: J.current,
|
|
311
|
+
destination: J.destination ?? null,
|
|
312
|
+
trail: J.trail
|
|
313
|
+
}) : /* @__PURE__ */ O("div", {
|
|
313
314
|
className: "mb-4 rounded-lg bg-bg-sunken p-4 text-center text-text-secondary",
|
|
314
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ D(r, {
|
|
315
316
|
size: 28,
|
|
316
317
|
className: "mx-auto mb-2 opacity-60"
|
|
317
|
-
}), /* @__PURE__ */
|
|
318
|
+
}), /* @__PURE__ */ D("p", {
|
|
318
319
|
className: "text-sm",
|
|
319
|
-
children:
|
|
320
|
+
children: N("movethewheels.tracking.location.noFix", "No live position fix yet")
|
|
320
321
|
})]
|
|
321
322
|
}),
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ D("p", {
|
|
323
324
|
className: "text-sm",
|
|
324
|
-
children:
|
|
325
|
+
children: H.currentLocation.address || N("movethewheels.tracking.location.updating", "Location updating...")
|
|
325
326
|
}),
|
|
326
|
-
/* @__PURE__ */
|
|
327
|
+
/* @__PURE__ */ O("p", {
|
|
327
328
|
className: "text-xs text-text-secondary mt-1",
|
|
328
329
|
children: [
|
|
329
|
-
|
|
330
|
+
N("movethewheels.tracking.location.updated", "Updated"),
|
|
330
331
|
" ",
|
|
331
|
-
x(
|
|
332
|
+
x(H.currentLocation.timestamp || /* @__PURE__ */ new Date(), "relative")
|
|
332
333
|
]
|
|
333
334
|
})
|
|
334
335
|
] })] }),
|
|
335
|
-
/* @__PURE__ */
|
|
336
|
+
/* @__PURE__ */ O(d, { children: [/* @__PURE__ */ D(p, { children: /* @__PURE__ */ D(m, { children: N("movethewheels.tracking.deliveryAddress.title", "Delivery Address") }) }), /* @__PURE__ */ O(f, { children: [/* @__PURE__ */ D("p", {
|
|
336
337
|
className: "text-sm",
|
|
337
|
-
children:
|
|
338
|
-
}), /* @__PURE__ */
|
|
338
|
+
children: U.customerInfo.name
|
|
339
|
+
}), /* @__PURE__ */ D("p", {
|
|
339
340
|
className: "text-sm text-text-secondary mt-2",
|
|
340
|
-
children: b(
|
|
341
|
+
children: b(U.deliveryAddress)
|
|
341
342
|
})] })] }),
|
|
342
|
-
/* @__PURE__ */
|
|
343
|
+
/* @__PURE__ */ D(C, { deliveryJobId: U.id }),
|
|
344
|
+
/* @__PURE__ */ D(d, { children: /* @__PURE__ */ O(f, {
|
|
343
345
|
className: "p-4 space-y-2",
|
|
344
|
-
children: [/* @__PURE__ */
|
|
346
|
+
children: [/* @__PURE__ */ D(u, {
|
|
345
347
|
variant: "outline",
|
|
346
348
|
className: "w-full",
|
|
347
|
-
onClick: () =>
|
|
348
|
-
children:
|
|
349
|
-
}), /* @__PURE__ */
|
|
349
|
+
onClick: () => q(`orders/${U.id}`),
|
|
350
|
+
children: N("movethewheels.tracking.actions.viewOrderDetails", "View Order Details")
|
|
351
|
+
}), /* @__PURE__ */ D(u, {
|
|
350
352
|
variant: "outline",
|
|
351
353
|
className: "w-full",
|
|
352
|
-
children:
|
|
354
|
+
children: N("movethewheels.tracking.actions.contactDriver", "Contact Driver")
|
|
353
355
|
})]
|
|
354
356
|
}) })
|
|
355
357
|
]
|
|
356
358
|
})]
|
|
357
359
|
}),
|
|
358
|
-
|
|
360
|
+
B && !U && !W && !G && /* @__PURE__ */ D(g, {
|
|
359
361
|
illustration: "empty-search",
|
|
360
|
-
title:
|
|
361
|
-
description: `${
|
|
362
|
-
action: /* @__PURE__ */
|
|
362
|
+
title: N("movethewheels.tracking.notFound.title", "Shipment not found"),
|
|
363
|
+
description: `${N("movethewheels.tracking.notFound.descriptionPrefix", "No shipment found with tracking number")} "${B}"`,
|
|
364
|
+
action: /* @__PURE__ */ D(u, {
|
|
363
365
|
variant: "outline",
|
|
364
|
-
onClick: () =>
|
|
365
|
-
children:
|
|
366
|
+
onClick: () => z(""),
|
|
367
|
+
children: N("movethewheels.tracking.notFound.tryAnother", "Try another number")
|
|
366
368
|
})
|
|
367
369
|
})
|
|
368
370
|
]
|
|
369
371
|
});
|
|
370
372
|
}
|
|
371
373
|
//#endregion
|
|
372
|
-
export {
|
|
374
|
+
export { M as default };
|
package/dist/utils/formatters.js
CHANGED
|
@@ -18,7 +18,7 @@ function t(e, t = "USD") {
|
|
|
18
18
|
}
|
|
19
19
|
function n(e, t = "short") {
|
|
20
20
|
let n = typeof e == "string" ? new Date(e) : e;
|
|
21
|
-
return t === "relative" ?
|
|
21
|
+
return t === "relative" ? i(n) : t === "time" ? new Intl.DateTimeFormat("en-US", {
|
|
22
22
|
hour: "numeric",
|
|
23
23
|
minute: "2-digit",
|
|
24
24
|
hour12: !0
|
|
@@ -37,6 +37,17 @@ function n(e, t = "short") {
|
|
|
37
37
|
}).format(n);
|
|
38
38
|
}
|
|
39
39
|
function r(e) {
|
|
40
|
+
let t = typeof e == "string" ? new Date(e) : e;
|
|
41
|
+
return new Intl.DateTimeFormat("en-US", {
|
|
42
|
+
year: "numeric",
|
|
43
|
+
month: "short",
|
|
44
|
+
day: "numeric",
|
|
45
|
+
hour: "numeric",
|
|
46
|
+
minute: "2-digit",
|
|
47
|
+
hour12: !0
|
|
48
|
+
}).format(t);
|
|
49
|
+
}
|
|
50
|
+
function i(e) {
|
|
40
51
|
let t = typeof e == "string" ? new Date(e) : e, r = Math.floor(((/* @__PURE__ */ new Date()).getTime() - t.getTime()) / 1e3);
|
|
41
52
|
if (r < 60) return "Just now";
|
|
42
53
|
let i = Math.floor(r / 60);
|
|
@@ -47,4 +58,4 @@ function r(e) {
|
|
|
47
58
|
return o < 7 ? `${o} ${o === 1 ? "day" : "days"} ago` : n(t);
|
|
48
59
|
}
|
|
49
60
|
//#endregion
|
|
50
|
-
export { e as formatAddress, t as formatCurrency, n as formatDate };
|
|
61
|
+
export { e as formatAddress, t as formatCurrency, n as formatDate, r as formatDateTime };
|
package/package.json
CHANGED
|
@@ -72,6 +72,7 @@ const ImportExportPage = lazy(() => import('./pages/ImportExportPage'));
|
|
|
72
72
|
const ReportsPage = lazy(() => import('./pages/ReportsPage'));
|
|
73
73
|
const SettingsPage = lazy(() => import('./pages/SettingsPage'));
|
|
74
74
|
const AIAssistantPage = lazy(() => import('./pages/AIAssistantPage'));
|
|
75
|
+
const DeliveryCapturePage = lazy(() => import('./pages/DeliveryCapturePage'));
|
|
75
76
|
|
|
76
77
|
export function MoveTheWheelsRoutes() {
|
|
77
78
|
return (
|
|
@@ -90,6 +91,9 @@ export function MoveTheWheelsRoutes() {
|
|
|
90
91
|
<Route path="tracking" element={<TrackingPage />} />
|
|
91
92
|
<Route path="tracking/live" element={<LiveTrackingPage />} />
|
|
92
93
|
|
|
94
|
+
{/* Driver ePOD capture (BOFF-4399) */}
|
|
95
|
+
<Route path="deliveries/mine" element={<DeliveryCapturePage />} />
|
|
96
|
+
|
|
93
97
|
{/* Fleet */}
|
|
94
98
|
<Route path="fleet" element={<FleetPage />} />
|
|
95
99
|
<Route path="fleet/vehicles" element={<VehiclesPage />} />
|