@burdenoff/microfe-movethewheels 2026.805.1 → 2026.827.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.
Files changed (67) hide show
  1. package/dist/components/CarbonFootprintPanel.js +108 -0
  2. package/dist/components/index.js +1 -0
  3. package/dist/generated/wspace-operations.d.ts +168 -912
  4. package/dist/generated/wspace-types.d.ts +78432 -35831
  5. package/dist/hooks/useAnalytics.js +45 -4
  6. package/dist/hooks/useFleet.js +142 -74
  7. package/dist/hooks/useInventory.js +163 -70
  8. package/dist/hooks/useOrders.js +2 -2
  9. package/dist/hooks/useTracking.js +5 -5
  10. package/dist/index.js +33 -32
  11. package/dist/movethewheels/components/CarbonFootprintPanel.d.ts +7 -0
  12. package/dist/movethewheels/components/index.d.ts +1 -0
  13. package/dist/movethewheels/hooks/index.d.ts +3 -3
  14. package/dist/movethewheels/hooks/useAnalytics.d.ts +22 -0
  15. package/dist/movethewheels/hooks/useFleet.d.ts +32 -1
  16. package/dist/movethewheels/hooks/useInventory.d.ts +67 -12
  17. package/dist/movethewheels/hooks/useOrders.d.ts +25 -2
  18. package/dist/movethewheels/types/index.d.ts +2 -0
  19. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down-right.js +11 -0
  20. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left-right.js +22 -0
  21. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up-right.js +11 -0
  22. package/dist/node_modules/lucide-react/dist/esm/icons/calendar-clock.js +32 -0
  23. package/dist/node_modules/lucide-react/dist/esm/icons/history.js +18 -0
  24. package/dist/node_modules/lucide-react/dist/esm/icons/leaf.js +11 -0
  25. package/dist/node_modules/lucide-react/dist/esm/icons/lock.js +16 -0
  26. package/dist/node_modules/lucide-react/dist/esm/icons/user-round.js +13 -0
  27. package/dist/pages/AnalyticsPage.js +81 -79
  28. package/dist/pages/CreateOrderPage.js +246 -195
  29. package/dist/pages/DeliveryCapturePage.js +91 -78
  30. package/dist/pages/DriversPage.js +202 -108
  31. package/dist/pages/InventoryPage.js +356 -131
  32. package/dist/pages/ProductDetailsPage.js +212 -156
  33. package/dist/pages/VehicleDetailsPage.js +257 -193
  34. package/dist/utils/formatters.js +4 -1
  35. package/package.json +1 -1
  36. package/src/generated/wspace-operations.ts +134 -929
  37. package/src/generated/wspace-types.ts +91730 -40059
  38. package/src/movethewheels/components/CarbonFootprintPanel.tsx +133 -0
  39. package/src/movethewheels/components/UpcomingDemandPanel.tsx +20 -11
  40. package/src/movethewheels/components/index.ts +3 -0
  41. package/src/movethewheels/hooks/index.ts +11 -0
  42. package/src/movethewheels/hooks/useAnalytics.ts +86 -0
  43. package/src/movethewheels/hooks/useDemandForecast.ts +10 -4
  44. package/src/movethewheels/hooks/useFleet.ts +133 -3
  45. package/src/movethewheels/hooks/useInventory.ts +311 -53
  46. package/src/movethewheels/hooks/useOrders.ts +31 -7
  47. package/src/movethewheels/hooks/useTracking.ts +14 -14
  48. package/src/movethewheels/pages/AnalyticsPage.tsx +5 -5
  49. package/src/movethewheels/pages/CreateOrderPage.tsx +67 -10
  50. package/src/movethewheels/pages/DeliveryCapturePage.tsx +8 -0
  51. package/src/movethewheels/pages/DriversPage.tsx +181 -31
  52. package/src/movethewheels/pages/InventoryPage.tsx +299 -19
  53. package/src/movethewheels/pages/ProductDetailsPage.tsx +68 -3
  54. package/src/movethewheels/pages/VehicleDetailsPage.tsx +86 -27
  55. package/src/movethewheels/types/index.ts +2 -0
  56. package/src/operations/wspace/movethewheels/fragments/core.graphql +23 -53
  57. package/src/operations/wspace/movethewheels/fragments/core.withdrawn.graphql +59 -0
  58. package/src/operations/wspace/movethewheels/mutations/entities.graphql +5 -5
  59. package/src/operations/wspace/movethewheels/mutations/marketplace-reports.graphql +18 -78
  60. package/src/operations/wspace/movethewheels/mutations/marketplace-reports.withdrawn.graphql +93 -0
  61. package/src/operations/wspace/movethewheels/mutations/orders.graphql +7 -7
  62. package/src/operations/wspace/movethewheels/queries/dashboard.graphql +3 -3
  63. package/src/operations/wspace/movethewheels/queries/entities.graphql +3 -3
  64. package/src/operations/wspace/movethewheels/queries/logistics.graphql +3 -3
  65. package/src/operations/wspace/movethewheels/queries/marketplace-reports.withdrawn.graphql +58 -0
  66. package/src/operations/wspace/movethewheels/queries/orders.graphql +3 -3
  67. package/src/operations/wspace/movethewheels/queries/marketplace-reports.graphql +0 -40
@@ -6,17 +6,19 @@ import { PenLine as i } from "../node_modules/lucide-react/dist/esm/icons/pen-li
6
6
  import { Truck as a } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
7
7
  import { Type as o } from "../node_modules/lucide-react/dist/esm/icons/type.js";
8
8
  import { Upload as s } from "../node_modules/lucide-react/dist/esm/icons/upload.js";
9
- import { useCaptureEpod as c, useEpodPhotoUpload as l, useMyPendingEpodDeliveryJobs as u } from "../hooks/useEpod.js";
10
- import { Button as d, Card as f, CardContent as p, CardHeader as m, CardTitle as h, Input as g, Label as _, Textarea as v } from "../components/ui.js";
11
- import { PageLayout as y } from "../components/PageLayout.js";
12
- import { FormError as b } from "../components/FormError.js";
13
- import { Notice as x, useNotice as S } from "../components/Notice.js";
14
- import { formatAddress as C, formatDate as w } from "../utils/formatters.js";
15
- import { SignaturePad as T } from "../components/SignaturePad.js";
16
- import { useRef as E, useState as D } from "react";
17
- import { Fragment as O, jsx as k, jsxs as A } from "react/jsx-runtime";
9
+ import { mapOrderPriority as c, mapOrderStatus as l } from "../hooks/useOrders.js";
10
+ import { useCaptureEpod as u, useEpodPhotoUpload as d, useMyPendingEpodDeliveryJobs as f } from "../hooks/useEpod.js";
11
+ import { Button as p, Card as m, CardContent as h, CardHeader as g, CardTitle as _, Input as v, Label as y, Textarea as b } from "../components/ui.js";
12
+ import { PageLayout as x } from "../components/PageLayout.js";
13
+ import { PriorityBadge as S, StatusBadge as C } from "../components/StatusBadge.js";
14
+ import { FormError as w } from "../components/FormError.js";
15
+ import { Notice as T, useNotice as E } from "../components/Notice.js";
16
+ import { formatAddress as D, formatDate as O } from "../utils/formatters.js";
17
+ import { SignaturePad as k } from "../components/SignaturePad.js";
18
+ import { useRef as A, useState as j } from "react";
19
+ import { Fragment as M, jsx as N, jsxs as P } from "react/jsx-runtime";
18
20
  //#region src/movethewheels/pages/DeliveryCapturePage.tsx
19
- function j() {
21
+ function F() {
20
22
  return new Promise((e) => {
21
23
  if (!navigator.geolocation) {
22
24
  e(null);
@@ -29,24 +31,24 @@ function j() {
29
31
  });
30
32
  });
31
33
  }
32
- function M({ job: r, onCaptured: u, onCancel: y }) {
33
- let { captureEpod: x, isSubmitting: S, error: w } = c(), { upload: M, isUploading: N, error: P } = l(), F = E(null), [I, L] = D(""), [R, z] = D("drawn"), [B, V] = D(""), [H, U] = D(null), [W, G] = D(""), [K, q] = D(null), J = async () => {
34
+ function I({ job: r, onCaptured: c, onCancel: l }) {
35
+ let { captureEpod: f, isSubmitting: x, error: S } = u(), { upload: C, isUploading: T, error: E } = d(), O = A(null), [I, L] = j(""), [R, z] = j("drawn"), [B, V] = j(""), [H, U] = j(null), [W, G] = j(""), [K, q] = j(null), J = async () => {
34
36
  q(null);
35
37
  let e = I.trim();
36
38
  if (!e) {
37
39
  q("Recipient name is required.");
38
40
  return;
39
41
  }
40
- let t = R === "typed" ? B.trim() : F.current?.toDataUrl() ?? null;
42
+ let t = R === "typed" ? B.trim() : O.current?.toDataUrl() ?? null;
41
43
  if (!t) {
42
44
  q(R === "typed" ? "Type the recipient full name as their signature." : "A signature is required.");
43
45
  return;
44
46
  }
45
47
  try {
46
48
  let n;
47
- H && (n = [(await M(H)).fileId]);
48
- let i = await j();
49
- await x({
49
+ H && (n = [(await C(H)).fileId]);
50
+ let i = await F();
51
+ await f({
50
52
  deliveryJobId: r.id,
51
53
  recipientName: e,
52
54
  signatureType: R,
@@ -56,95 +58,95 @@ function M({ job: r, onCaptured: u, onCancel: y }) {
56
58
  longitude: i?.coords.longitude,
57
59
  locationAccuracy: i?.coords.accuracy,
58
60
  notes: W.trim() || void 0
59
- }), u();
61
+ }), c();
60
62
  } catch {}
61
- }, Y = S || N;
62
- return /* @__PURE__ */ A(f, { children: [/* @__PURE__ */ k(m, { children: /* @__PURE__ */ A(h, {
63
+ }, Y = x || T;
64
+ return /* @__PURE__ */ P(m, { children: [/* @__PURE__ */ N(g, { children: /* @__PURE__ */ P(_, {
63
65
  className: "flex items-center gap-2",
64
66
  children: [
65
- /* @__PURE__ */ k(a, { size: 18 }),
67
+ /* @__PURE__ */ N(a, { size: 18 }),
66
68
  " Capture delivery for ",
67
69
  r.deliveryJobNumber
68
70
  ]
69
- }) }), /* @__PURE__ */ A(p, {
71
+ }) }), /* @__PURE__ */ P(h, {
70
72
  className: "space-y-4",
71
73
  children: [
72
- /* @__PURE__ */ A("div", {
74
+ /* @__PURE__ */ P("div", {
73
75
  className: "text-sm text-text-secondary space-y-1",
74
- children: [r.customerName && /* @__PURE__ */ A("p", { children: ["Recipient on file: ", r.customerName] }), r.deliveryAddress && /* @__PURE__ */ k("p", { children: C(r.deliveryAddress) })]
76
+ children: [r.customerName && /* @__PURE__ */ P("p", { children: ["Recipient on file: ", r.customerName] }), r.deliveryAddress && /* @__PURE__ */ N("p", { children: D(r.deliveryAddress) })]
75
77
  }),
76
- /* @__PURE__ */ A("div", {
78
+ /* @__PURE__ */ P("div", {
77
79
  className: "space-y-1.5",
78
- children: [/* @__PURE__ */ k(_, {
80
+ children: [/* @__PURE__ */ N(y, {
79
81
  htmlFor: "epod-recipient-name",
80
82
  children: "Recipient name"
81
- }), /* @__PURE__ */ k(g, {
83
+ }), /* @__PURE__ */ N(v, {
82
84
  id: "epod-recipient-name",
83
85
  value: I,
84
86
  onChange: (e) => L(e.target.value),
85
87
  placeholder: "Who received the delivery?"
86
88
  })]
87
89
  }),
88
- /* @__PURE__ */ A("div", {
90
+ /* @__PURE__ */ P("div", {
89
91
  className: "space-y-1.5",
90
92
  children: [
91
- /* @__PURE__ */ k(_, { children: "Signature" }),
92
- /* @__PURE__ */ A("div", {
93
+ /* @__PURE__ */ N(y, { children: "Signature" }),
94
+ /* @__PURE__ */ P("div", {
93
95
  className: "flex gap-2",
94
- children: [/* @__PURE__ */ A(d, {
96
+ children: [/* @__PURE__ */ P(p, {
95
97
  type: "button",
96
98
  variant: R === "drawn" ? "default" : "outline",
97
99
  size: "sm",
98
100
  onClick: () => z("drawn"),
99
- children: [/* @__PURE__ */ k(i, { size: 14 }), " Draw"]
100
- }), /* @__PURE__ */ A(d, {
101
+ children: [/* @__PURE__ */ N(i, { size: 14 }), " Draw"]
102
+ }), /* @__PURE__ */ P(p, {
101
103
  type: "button",
102
104
  variant: R === "typed" ? "default" : "outline",
103
105
  size: "sm",
104
106
  onClick: () => z("typed"),
105
- children: [/* @__PURE__ */ k(o, { size: 14 }), " Type name instead"]
107
+ children: [/* @__PURE__ */ N(o, { size: 14 }), " Type name instead"]
106
108
  })]
107
109
  }),
108
- R === "drawn" ? /* @__PURE__ */ k(T, { ref: F }) : /* @__PURE__ */ k(g, {
110
+ R === "drawn" ? /* @__PURE__ */ N(k, { ref: O }) : /* @__PURE__ */ N(v, {
109
111
  value: B,
110
112
  onChange: (e) => V(e.target.value),
111
113
  placeholder: "Type full name as signature"
112
114
  })
113
115
  ]
114
116
  }),
115
- /* @__PURE__ */ A("div", {
117
+ /* @__PURE__ */ P("div", {
116
118
  className: "space-y-1.5",
117
119
  children: [
118
- /* @__PURE__ */ k(_, {
120
+ /* @__PURE__ */ N(y, {
119
121
  htmlFor: "epod-photo",
120
122
  children: "Delivery photo (optional)"
121
123
  }),
122
- /* @__PURE__ */ A("div", {
124
+ /* @__PURE__ */ P("div", {
123
125
  className: "flex items-center gap-2",
124
- children: [/* @__PURE__ */ k("input", {
126
+ children: [/* @__PURE__ */ N("input", {
125
127
  id: "epod-photo",
126
128
  type: "file",
127
129
  accept: "image/*",
128
130
  capture: "environment",
129
131
  onChange: (e) => U(e.target.files?.[0] ?? null),
130
132
  className: "text-sm"
131
- }), H && /* @__PURE__ */ k(s, {
133
+ }), H && /* @__PURE__ */ N(s, {
132
134
  size: 14,
133
135
  className: "text-text-secondary"
134
136
  })]
135
137
  }),
136
- H && /* @__PURE__ */ k("p", {
138
+ H && /* @__PURE__ */ N("p", {
137
139
  className: "text-xs text-text-secondary",
138
140
  children: H.name
139
141
  })
140
142
  ]
141
143
  }),
142
- /* @__PURE__ */ A("div", {
144
+ /* @__PURE__ */ P("div", {
143
145
  className: "space-y-1.5",
144
- children: [/* @__PURE__ */ k(_, {
146
+ children: [/* @__PURE__ */ N(y, {
145
147
  htmlFor: "epod-notes",
146
148
  children: "Notes (optional)"
147
- }), /* @__PURE__ */ k(v, {
149
+ }), /* @__PURE__ */ N(b, {
148
150
  id: "epod-notes",
149
151
  value: W,
150
152
  onChange: (e) => G(e.target.value),
@@ -152,88 +154,99 @@ function M({ job: r, onCaptured: u, onCancel: y }) {
152
154
  rows: 2
153
155
  })]
154
156
  }),
155
- /* @__PURE__ */ A("p", {
157
+ /* @__PURE__ */ P("p", {
156
158
  className: "flex items-center gap-1.5 text-xs text-text-secondary",
157
- children: [/* @__PURE__ */ k(n, { size: 12 }), " Device GPS is captured automatically when permitted by the browser."]
159
+ children: [/* @__PURE__ */ N(n, { size: 12 }), " Device GPS is captured automatically when permitted by the browser."]
158
160
  }),
159
- K && /* @__PURE__ */ k(b, { message: K }),
160
- w && /* @__PURE__ */ k(b, { message: w.message }),
161
- P && /* @__PURE__ */ k(b, { message: P.message }),
162
- /* @__PURE__ */ A("div", {
161
+ K && /* @__PURE__ */ N(w, { message: K }),
162
+ S && /* @__PURE__ */ N(w, { message: S.message }),
163
+ E && /* @__PURE__ */ N(w, { message: E.message }),
164
+ /* @__PURE__ */ P("div", {
163
165
  className: "flex gap-2 justify-end",
164
- children: [/* @__PURE__ */ k(d, {
166
+ children: [/* @__PURE__ */ N(p, {
165
167
  type: "button",
166
168
  variant: "outline",
167
- onClick: y,
169
+ onClick: l,
168
170
  disabled: Y,
169
171
  children: "Cancel"
170
- }), /* @__PURE__ */ k(d, {
172
+ }), /* @__PURE__ */ N(p, {
171
173
  type: "button",
172
174
  onClick: () => void J(),
173
175
  disabled: Y,
174
- children: Y ? /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(t, {
176
+ children: Y ? /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(t, {
175
177
  size: 14,
176
178
  className: "animate-spin"
177
- }), " Submitting…"] }) : /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(e, { size: 14 }), " Confirm delivery"] })
179
+ }), " Submitting…"] }) : /* @__PURE__ */ P(M, { children: [/* @__PURE__ */ N(e, { size: 14 }), " Confirm delivery"] })
178
180
  })]
179
181
  })
180
182
  ]
181
183
  })] });
182
184
  }
183
- function N() {
184
- let { jobs: t, isLoading: n, error: i, refetch: o } = u(), [s, c] = D(null), { message: l, notify: m } = S();
185
- return /* @__PURE__ */ k(y, {
185
+ function L() {
186
+ let { jobs: t, isLoading: n, error: i, refetch: o } = f(), [s, u] = j(null), { message: d, notify: g } = E();
187
+ return /* @__PURE__ */ N(x, {
186
188
  title: "My Deliveries",
187
189
  subtitle: "Capture proof of delivery for your assigned stops",
188
- icon: /* @__PURE__ */ k(a, { size: 24 }),
189
- children: /* @__PURE__ */ A("div", {
190
+ icon: /* @__PURE__ */ N(a, { size: 24 }),
191
+ children: /* @__PURE__ */ P("div", {
190
192
  className: "space-y-4",
191
- children: [/* @__PURE__ */ k(x, { message: l }), s ? /* @__PURE__ */ k(M, {
193
+ children: [/* @__PURE__ */ N(T, { message: d }), s ? /* @__PURE__ */ N(I, {
192
194
  job: s,
193
195
  onCaptured: () => {
194
- m("Proof of delivery captured — delivery marked complete."), c(null), o();
196
+ g("Proof of delivery captured — delivery marked complete."), u(null), o();
195
197
  },
196
- onCancel: () => c(null)
197
- }) : n ? /* @__PURE__ */ k("p", {
198
+ onCancel: () => u(null)
199
+ }) : n ? /* @__PURE__ */ N("p", {
198
200
  className: "text-text-secondary text-center py-8",
199
201
  children: "Loading your deliveries…"
200
- }) : i ? /* @__PURE__ */ k(b, { message: i.message }) : t.length > 0 ? /* @__PURE__ */ k("div", {
202
+ }) : i ? /* @__PURE__ */ N(w, { message: i.message }) : t.length > 0 ? /* @__PURE__ */ N("div", {
201
203
  className: "space-y-3",
202
- children: t.map((e) => /* @__PURE__ */ k(f, { children: /* @__PURE__ */ A(p, {
204
+ children: t.map((e) => /* @__PURE__ */ N(m, { children: /* @__PURE__ */ P(h, {
203
205
  className: "flex items-center justify-between gap-3 py-4",
204
- children: [/* @__PURE__ */ A("div", {
206
+ children: [/* @__PURE__ */ P("div", {
205
207
  className: "min-w-0",
206
208
  children: [
207
- /* @__PURE__ */ A("p", {
209
+ /* @__PURE__ */ P("p", {
208
210
  className: "font-medium flex items-center gap-2",
209
211
  children: [
210
- /* @__PURE__ */ k(r, { size: 16 }),
212
+ /* @__PURE__ */ N(r, { size: 16 }),
211
213
  " ",
212
214
  e.deliveryJobNumber
213
215
  ]
214
216
  }),
215
- e.deliveryAddress && /* @__PURE__ */ k("p", {
217
+ /* @__PURE__ */ P("div", {
218
+ className: "flex flex-wrap items-center gap-1.5 py-1",
219
+ children: [/* @__PURE__ */ N(C, {
220
+ status: l(e.status),
221
+ type: "order",
222
+ size: "sm"
223
+ }), /* @__PURE__ */ N(S, {
224
+ priority: c(e.priority),
225
+ size: "sm"
226
+ })]
227
+ }),
228
+ e.deliveryAddress && /* @__PURE__ */ N("p", {
216
229
  className: "text-sm text-text-secondary truncate",
217
- children: C(e.deliveryAddress)
230
+ children: D(e.deliveryAddress)
218
231
  }),
219
- e.scheduledDelivery && /* @__PURE__ */ A("p", {
232
+ e.scheduledDelivery && /* @__PURE__ */ P("p", {
220
233
  className: "text-xs text-text-secondary",
221
- children: ["Scheduled ", w(e.scheduledDelivery, "short")]
234
+ children: ["Scheduled ", O(e.scheduledDelivery, "short")]
222
235
  })
223
236
  ]
224
- }), /* @__PURE__ */ k(d, {
237
+ }), /* @__PURE__ */ N(p, {
225
238
  type: "button",
226
239
  size: "sm",
227
- onClick: () => c(e),
240
+ onClick: () => u(e),
228
241
  children: "Capture"
229
242
  })]
230
243
  }) }, e.id))
231
- }) : /* @__PURE__ */ A("div", {
244
+ }) : /* @__PURE__ */ P("div", {
232
245
  className: "text-center py-12",
233
- children: [/* @__PURE__ */ k(e, {
246
+ children: [/* @__PURE__ */ N(e, {
234
247
  size: 40,
235
248
  className: "mx-auto mb-3 text-text-secondary opacity-50"
236
- }), /* @__PURE__ */ k("p", {
249
+ }), /* @__PURE__ */ N("p", {
237
250
  className: "text-text-secondary",
238
251
  children: "No deliveries awaiting proof of delivery."
239
252
  })]
@@ -242,4 +255,4 @@ function N() {
242
255
  });
243
256
  }
244
257
  //#endregion
245
- export { N as default };
258
+ export { L as default };