@burdenoff/microfe-movethewheels 2026.830.5 → 2026.920.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/AssignmentSuggestions.js +135 -0
- package/dist/components/FleetAlertsPanel.js +114 -0
- package/dist/components/ShippingQuoteResults.js +142 -0
- package/dist/components/VehicleServiceCard.js +176 -0
- package/dist/hooks/useFleet.js +4 -3
- package/dist/hooks/useFleetIntelligence.js +91 -0
- package/dist/hooks/useShippingCarriers.js +29 -0
- package/dist/movethewheels/components/AssignmentSuggestions.d.ts +17 -0
- package/dist/movethewheels/components/FleetAlertsPanel.d.ts +14 -0
- package/dist/movethewheels/components/ShippingQuoteResults.d.ts +8 -0
- package/dist/movethewheels/components/VehicleServiceCard.d.ts +10 -0
- package/dist/movethewheels/hooks/useFleetIntelligence.d.ts +64 -0
- package/dist/movethewheels/hooks/useShippingCarriers.d.ts +43 -0
- package/dist/movethewheels/pages/ShippingRatesPage.d.ts +9 -0
- package/dist/movethewheels/types/index.d.ts +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/scale.js +26 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/sparkles.js +26 -0
- package/dist/pages/FleetPage.js +156 -146
- package/dist/pages/RouteDetailsPage.js +202 -184
- package/dist/pages/ShippingRatesPage.js +177 -0
- package/dist/pages/VehicleDetailsPage.js +149 -131
- package/dist/utils/graphqlClient.js +14 -5
- package/package.json +1 -1
- package/src/movethewheels/MoveTheWheelsRoutes.tsx +2 -0
- package/src/movethewheels/components/AssignmentSuggestions.tsx +234 -0
- package/src/movethewheels/components/FleetAlertsPanel.tsx +148 -0
- package/src/movethewheels/components/ShippingQuoteResults.tsx +199 -0
- package/src/movethewheels/components/VehicleServiceCard.tsx +220 -0
- package/src/movethewheels/hooks/useFleet.ts +12 -2
- package/src/movethewheels/hooks/useFleetIntelligence.ts +226 -0
- package/src/movethewheels/hooks/useShippingCarriers.ts +110 -0
- package/src/movethewheels/pages/FleetPage.tsx +21 -0
- package/src/movethewheels/pages/RouteDetailsPage.tsx +33 -1
- package/src/movethewheels/pages/ShippingRatesPage.tsx +216 -0
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +27 -0
- package/src/movethewheels/types/index.ts +2 -0
- package/src/movethewheels/utils/graphqlClient.ts +20 -1
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
import { Scale as e } from "../node_modules/lucide-react/dist/esm/icons/scale.js";
|
|
2
|
+
import { useTr as t } from "../shared/hooks/useTr.js";
|
|
3
|
+
import "../hooks/index.js";
|
|
4
|
+
import { Button as n, Card as r, CardContent as i, CardHeader as a, CardTitle as o, Input as s, Label as c, Switch as l } from "../components/ui.js";
|
|
5
|
+
import { PageLayout as u } from "../components/PageLayout.js";
|
|
6
|
+
import { FormError as d } from "../components/FormError.js";
|
|
7
|
+
import { ShippingQuoteResults as f } from "../components/ShippingQuoteResults.js";
|
|
8
|
+
import { useShippingQuotes as p } from "../hooks/useShippingCarriers.js";
|
|
9
|
+
import { useState as m } from "react";
|
|
10
|
+
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
11
|
+
//#region src/movethewheels/pages/ShippingRatesPage.tsx
|
|
12
|
+
var _ = /^[1-9]\d{5}$/, v = (e) => {
|
|
13
|
+
let t = Number(e);
|
|
14
|
+
return e.trim() !== "" && Number.isFinite(t) ? t : void 0;
|
|
15
|
+
};
|
|
16
|
+
function y() {
|
|
17
|
+
let y = t(), b = p(), [x, S] = m(""), [C, w] = m(""), [T, E] = m(""), [D, O] = m(""), [k, A] = m(""), [j, M] = m(""), [N, P] = m(!1), [F, I] = m(!1), [L, R] = m(null), [z, B] = m(null), V = async (e) => {
|
|
18
|
+
e.preventDefault(), R(null);
|
|
19
|
+
let t = v(T);
|
|
20
|
+
if (!_.test(x) || !_.test(C)) {
|
|
21
|
+
R(y("movethewheels.shipping.form.postcodeError", "Enter valid 6-digit pickup and delivery postcodes"));
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (t === void 0 || t <= 0) {
|
|
25
|
+
R(y("movethewheels.shipping.form.weightError", "Enter the package weight in kg"));
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
let n = [
|
|
29
|
+
v(D),
|
|
30
|
+
v(k),
|
|
31
|
+
v(j)
|
|
32
|
+
], r = n.filter((e) => e !== void 0).length;
|
|
33
|
+
if (r !== 0 && r !== 3) {
|
|
34
|
+
R(y("movethewheels.shipping.form.dimensionsError", "Enter length, width and height together, or leave all three empty"));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
let i = {
|
|
38
|
+
pickupPostcode: x,
|
|
39
|
+
deliveryPostcode: C,
|
|
40
|
+
weightKg: t,
|
|
41
|
+
cod: N,
|
|
42
|
+
...r === 3 ? {
|
|
43
|
+
lengthCm: n[0],
|
|
44
|
+
widthCm: n[1],
|
|
45
|
+
heightCm: n[2]
|
|
46
|
+
} : {}
|
|
47
|
+
};
|
|
48
|
+
I(!0);
|
|
49
|
+
try {
|
|
50
|
+
B(await b(i));
|
|
51
|
+
} catch (e) {
|
|
52
|
+
B(null), R(e instanceof Error ? e.message : y("movethewheels.shipping.form.failed", "Could not fetch rates"));
|
|
53
|
+
} finally {
|
|
54
|
+
I(!1);
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
return /* @__PURE__ */ h(u, {
|
|
58
|
+
title: y("movethewheels.shipping.title", "Compare Rates"),
|
|
59
|
+
subtitle: y("movethewheels.shipping.subtitle", "Enter a pickup and a delivery pincode to see every courier available for that route, with price and delivery time."),
|
|
60
|
+
icon: /* @__PURE__ */ h(e, { size: 24 }),
|
|
61
|
+
children: /* @__PURE__ */ g("div", {
|
|
62
|
+
className: "space-y-6",
|
|
63
|
+
children: [/* @__PURE__ */ g(r, { children: [/* @__PURE__ */ h(a, { children: /* @__PURE__ */ h(o, { children: y("movethewheels.shipping.form.title", "Shipment details") }) }), /* @__PURE__ */ h(i, { children: /* @__PURE__ */ g("form", {
|
|
64
|
+
onSubmit: (e) => void V(e),
|
|
65
|
+
className: "space-y-4",
|
|
66
|
+
children: [
|
|
67
|
+
/* @__PURE__ */ g("div", {
|
|
68
|
+
className: "grid gap-3 sm:grid-cols-3",
|
|
69
|
+
children: [
|
|
70
|
+
/* @__PURE__ */ g("div", {
|
|
71
|
+
className: "space-y-1",
|
|
72
|
+
children: [/* @__PURE__ */ h(c, {
|
|
73
|
+
htmlFor: "rate-pickup",
|
|
74
|
+
children: y("movethewheels.shipping.form.pickup", "Pickup postcode")
|
|
75
|
+
}), /* @__PURE__ */ h(s, {
|
|
76
|
+
id: "rate-pickup",
|
|
77
|
+
inputMode: "numeric",
|
|
78
|
+
maxLength: 6,
|
|
79
|
+
value: x,
|
|
80
|
+
onChange: (e) => S(e.target.value.trim())
|
|
81
|
+
})]
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ g("div", {
|
|
84
|
+
className: "space-y-1",
|
|
85
|
+
children: [/* @__PURE__ */ h(c, {
|
|
86
|
+
htmlFor: "rate-delivery",
|
|
87
|
+
children: y("movethewheels.shipping.form.delivery", "Delivery postcode")
|
|
88
|
+
}), /* @__PURE__ */ h(s, {
|
|
89
|
+
id: "rate-delivery",
|
|
90
|
+
inputMode: "numeric",
|
|
91
|
+
maxLength: 6,
|
|
92
|
+
value: C,
|
|
93
|
+
onChange: (e) => w(e.target.value.trim())
|
|
94
|
+
})]
|
|
95
|
+
}),
|
|
96
|
+
/* @__PURE__ */ g("div", {
|
|
97
|
+
className: "space-y-1",
|
|
98
|
+
children: [/* @__PURE__ */ h(c, {
|
|
99
|
+
htmlFor: "rate-weight",
|
|
100
|
+
children: y("movethewheels.shipping.form.weight", "Weight (kg)")
|
|
101
|
+
}), /* @__PURE__ */ h(s, {
|
|
102
|
+
id: "rate-weight",
|
|
103
|
+
inputMode: "decimal",
|
|
104
|
+
value: T,
|
|
105
|
+
onChange: (e) => E(e.target.value)
|
|
106
|
+
})]
|
|
107
|
+
})
|
|
108
|
+
]
|
|
109
|
+
}),
|
|
110
|
+
/* @__PURE__ */ g("div", {
|
|
111
|
+
className: "grid gap-3 sm:grid-cols-3",
|
|
112
|
+
children: [
|
|
113
|
+
/* @__PURE__ */ g("div", {
|
|
114
|
+
className: "space-y-1",
|
|
115
|
+
children: [/* @__PURE__ */ h(c, {
|
|
116
|
+
htmlFor: "rate-length",
|
|
117
|
+
children: y("movethewheels.shipping.form.length", "Length (cm, optional)")
|
|
118
|
+
}), /* @__PURE__ */ h(s, {
|
|
119
|
+
id: "rate-length",
|
|
120
|
+
inputMode: "decimal",
|
|
121
|
+
value: D,
|
|
122
|
+
onChange: (e) => O(e.target.value)
|
|
123
|
+
})]
|
|
124
|
+
}),
|
|
125
|
+
/* @__PURE__ */ g("div", {
|
|
126
|
+
className: "space-y-1",
|
|
127
|
+
children: [/* @__PURE__ */ h(c, {
|
|
128
|
+
htmlFor: "rate-width",
|
|
129
|
+
children: y("movethewheels.shipping.form.width", "Width (cm, optional)")
|
|
130
|
+
}), /* @__PURE__ */ h(s, {
|
|
131
|
+
id: "rate-width",
|
|
132
|
+
inputMode: "decimal",
|
|
133
|
+
value: k,
|
|
134
|
+
onChange: (e) => A(e.target.value)
|
|
135
|
+
})]
|
|
136
|
+
}),
|
|
137
|
+
/* @__PURE__ */ g("div", {
|
|
138
|
+
className: "space-y-1",
|
|
139
|
+
children: [/* @__PURE__ */ h(c, {
|
|
140
|
+
htmlFor: "rate-height",
|
|
141
|
+
children: y("movethewheels.shipping.form.height", "Height (cm, optional)")
|
|
142
|
+
}), /* @__PURE__ */ h(s, {
|
|
143
|
+
id: "rate-height",
|
|
144
|
+
inputMode: "decimal",
|
|
145
|
+
value: j,
|
|
146
|
+
onChange: (e) => M(e.target.value)
|
|
147
|
+
})]
|
|
148
|
+
})
|
|
149
|
+
]
|
|
150
|
+
}),
|
|
151
|
+
/* @__PURE__ */ g("div", {
|
|
152
|
+
className: "flex items-center gap-2",
|
|
153
|
+
children: [/* @__PURE__ */ h(l, {
|
|
154
|
+
id: "rate-cod",
|
|
155
|
+
checked: N,
|
|
156
|
+
onCheckedChange: P
|
|
157
|
+
}), /* @__PURE__ */ h(c, {
|
|
158
|
+
htmlFor: "rate-cod",
|
|
159
|
+
children: y("movethewheels.shipping.form.cod", "Cash on delivery")
|
|
160
|
+
})]
|
|
161
|
+
}),
|
|
162
|
+
/* @__PURE__ */ h(d, { message: L }),
|
|
163
|
+
/* @__PURE__ */ h(n, {
|
|
164
|
+
type: "submit",
|
|
165
|
+
disabled: F,
|
|
166
|
+
children: F ? y("movethewheels.shipping.form.comparing", "Comparing…") : y("movethewheels.shipping.form.compare", "Compare rates")
|
|
167
|
+
})
|
|
168
|
+
]
|
|
169
|
+
}) })] }), z && /* @__PURE__ */ h(f, {
|
|
170
|
+
result: z,
|
|
171
|
+
t: y
|
|
172
|
+
})]
|
|
173
|
+
})
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
//#endregion
|
|
177
|
+
export { y as default };
|