@burdenoff/microfe-movethewheels 2026.1026.3 → 2026.1030.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 (29) hide show
  1. package/dist/MoveTheWheelsRoot.js +130 -122
  2. package/dist/MoveTheWheelsRoutes.js +55 -51
  3. package/dist/components/ProofOfDeliveryCard.js +1 -1
  4. package/dist/components/UpcomingDemandPanel.js +1 -1
  5. package/dist/components/marketplace/MarketplaceDialogs.js +524 -0
  6. package/dist/generated/wspace-types.d.ts +30737 -8505
  7. package/dist/hooks/useMarketplace.js +265 -0
  8. package/dist/movethewheels/components/marketplace/MarketplaceDialogs.d.ts +18 -0
  9. package/dist/movethewheels/hooks/useMarketplace.d.ts +121 -0
  10. package/dist/movethewheels/pages/MarketplacePage.d.ts +1 -0
  11. package/dist/node_modules/lucide-react/dist/esm/icons/badge-check.js +11 -0
  12. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +8 -0
  13. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +8 -0
  14. package/dist/node_modules/lucide-react/dist/esm/icons/pencil.js +11 -0
  15. package/dist/node_modules/lucide-react/dist/esm/icons/store.js +26 -0
  16. package/dist/pages/ContainersPage.js +3 -3
  17. package/dist/pages/MarketplacePage.js +503 -0
  18. package/dist/pages/TrackingPage.js +111 -56
  19. package/package.json +2 -1
  20. package/src/generated/wspace-types.ts +34017 -8803
  21. package/src/movethewheels/MoveTheWheelsRoot.tsx +8 -0
  22. package/src/movethewheels/MoveTheWheelsRoutes.tsx +4 -0
  23. package/src/movethewheels/components/ProofOfDeliveryCard.tsx +1 -1
  24. package/src/movethewheels/components/UpcomingDemandPanel.tsx +2 -2
  25. package/src/movethewheels/components/marketplace/MarketplaceDialogs.tsx +633 -0
  26. package/src/movethewheels/hooks/useMarketplace.ts +526 -0
  27. package/src/movethewheels/pages/ContainersPage.tsx +3 -3
  28. package/src/movethewheels/pages/MarketplacePage.tsx +571 -0
  29. package/src/movethewheels/pages/TrackingPage.tsx +54 -9
@@ -0,0 +1,503 @@
1
+ import { BadgeCheck as e } from "../node_modules/lucide-react/dist/esm/icons/badge-check.js";
2
+ import { ChevronDown as t } from "../node_modules/lucide-react/dist/esm/icons/chevron-down.js";
3
+ import { ChevronUp as n } from "../node_modules/lucide-react/dist/esm/icons/chevron-up.js";
4
+ import { Mail as r } from "../node_modules/lucide-react/dist/esm/icons/mail.js";
5
+ import { MapPin as i } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
6
+ import { Package as a } from "../node_modules/lucide-react/dist/esm/icons/package.js";
7
+ import { Pencil as o } from "../node_modules/lucide-react/dist/esm/icons/pencil.js";
8
+ import { Phone as s } from "../node_modules/lucide-react/dist/esm/icons/phone.js";
9
+ import { Plus as c } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
10
+ import { RefreshCw as l } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
11
+ import { Star as u } from "../node_modules/lucide-react/dist/esm/icons/star.js";
12
+ import { Store as d } from "../node_modules/lucide-react/dist/esm/icons/store.js";
13
+ import { Trash2 as f } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
14
+ import { Truck as p } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
15
+ import { Badge as m, Button as h, Card as g, CardContent as _, Input as v, Select as y, SelectContent as b, SelectItem as x, SelectTrigger as S, SelectValue as C, Skeleton as w } from "../components/ui.js";
16
+ import { PageLayout as ee } from "../components/PageLayout.js";
17
+ import { MetricCard as T, MetricGrid as te } from "../components/MetricCard.js";
18
+ import { FormError as E } from "../components/FormError.js";
19
+ import { Notice as ne, useNotice as re } from "../components/Notice.js";
20
+ import { formatCurrency as D } from "../utils/formatters.js";
21
+ import { useDebouncedValue as ie } from "../hooks/useDebouncedValue.js";
22
+ import { PROVIDER_TYPES as ae, humanizeEnum as O, useMarketplaceActions as oe, useMarketplaceStats as se, useProviderOfferings as k, useServiceProviders as ce, useShipmentOptions as A } from "../hooks/useMarketplace.js";
23
+ import { AssignShipmentDialog as le, OfferingDialog as ue, ProviderDialog as de } from "../components/marketplace/MarketplaceDialogs.js";
24
+ import { useState as j } from "react";
25
+ import { jsx as M, jsxs as N } from "react/jsx-runtime";
26
+ import { CTAOverflowMenu as fe, PagePurpose as pe } from "@burdenoff/fe-libs/ui";
27
+ //#region src/movethewheels/pages/MarketplacePage.tsx
28
+ var P = 12, F = "ALL";
29
+ function I(e) {
30
+ return e === "AVAILABLE" ? "default" : e === "LIMITED" ? "secondary" : "outline";
31
+ }
32
+ function L({ provider: e, refreshKey: t, onAdd: n, onEdit: r, onDelete: i }) {
33
+ let { offerings: a, isLoading: s, error: l } = k(e.id, t), { total: u } = A({
34
+ carrierId: e.id,
35
+ limit: 1
36
+ });
37
+ return /* @__PURE__ */ N("div", {
38
+ className: "mt-4 space-y-3 border-t border-border-subtle pt-4",
39
+ children: [
40
+ /* @__PURE__ */ N("div", {
41
+ className: "flex flex-wrap items-center justify-between gap-2",
42
+ children: [/* @__PURE__ */ M("p", {
43
+ className: "text-sm font-medium",
44
+ children: "Offerings"
45
+ }), /* @__PURE__ */ N("div", {
46
+ className: "flex items-center gap-3",
47
+ children: [/* @__PURE__ */ N("span", {
48
+ className: "text-xs text-text-secondary",
49
+ children: [
50
+ "Carrier on ",
51
+ u,
52
+ " shipment",
53
+ u === 1 ? "" : "s"
54
+ ]
55
+ }), /* @__PURE__ */ N(h, {
56
+ size: "sm",
57
+ variant: "outline",
58
+ onClick: n,
59
+ children: [/* @__PURE__ */ M(c, {
60
+ size: 14,
61
+ className: "mr-1"
62
+ }), "Add offering"]
63
+ })]
64
+ })]
65
+ }),
66
+ /* @__PURE__ */ M(E, { message: l?.message }),
67
+ s ? /* @__PURE__ */ M(w, { className: "h-12 w-full" }) : a.length === 0 ? /* @__PURE__ */ M("p", {
68
+ className: "text-sm text-text-secondary",
69
+ children: "No offerings yet. Add the lanes, services and indicative prices this provider offers."
70
+ }) : /* @__PURE__ */ M("ul", {
71
+ className: "space-y-2",
72
+ children: a.map((e) => /* @__PURE__ */ N("li", {
73
+ className: "flex flex-wrap items-start justify-between gap-3 rounded-lg bg-bg-sunken px-3 py-2",
74
+ children: [/* @__PURE__ */ N("div", {
75
+ className: "min-w-0",
76
+ children: [
77
+ /* @__PURE__ */ N("p", {
78
+ className: "text-sm font-medium",
79
+ children: [e.name, e.isActive ? null : /* @__PURE__ */ M("span", {
80
+ className: "ml-2 text-xs text-text-tertiary",
81
+ children: "(inactive)"
82
+ })]
83
+ }),
84
+ /* @__PURE__ */ N("p", {
85
+ className: "text-xs text-text-secondary",
86
+ children: [O(e.category), e.transitDays == null ? "" : ` · ${e.transitDays} day transit`]
87
+ }),
88
+ e.description ? /* @__PURE__ */ M("p", {
89
+ className: "mt-1 text-xs text-text-secondary",
90
+ children: e.description
91
+ }) : null
92
+ ]
93
+ }), /* @__PURE__ */ N("div", {
94
+ className: "flex items-center gap-2",
95
+ children: [
96
+ /* @__PURE__ */ M("span", {
97
+ className: "text-sm font-medium",
98
+ children: e.price == null ? "Price on request" : `${D(e.price, e.currency)}${e.pricingUnit ? ` / ${e.pricingUnit}` : ""}`
99
+ }),
100
+ /* @__PURE__ */ M(m, {
101
+ variant: I(e.availability),
102
+ children: O(e.availability)
103
+ }),
104
+ /* @__PURE__ */ M(h, {
105
+ size: "icon",
106
+ variant: "ghost",
107
+ "aria-label": `Edit ${e.name}`,
108
+ onClick: () => r(e),
109
+ children: /* @__PURE__ */ M(o, { size: 14 })
110
+ }),
111
+ /* @__PURE__ */ M(h, {
112
+ size: "icon",
113
+ variant: "ghost",
114
+ "aria-label": `Remove ${e.name}`,
115
+ onClick: () => i(e),
116
+ children: /* @__PURE__ */ M(f, { size: 14 })
117
+ })
118
+ ]
119
+ })]
120
+ }, e.id))
121
+ })
122
+ ]
123
+ });
124
+ }
125
+ function me({ provider: a, expanded: c, refreshKey: l, onToggle: d, onEdit: v, onDelete: y, onAssign: b, onAddOffering: x, onEditOffering: S, onDeleteOffering: C }) {
126
+ return /* @__PURE__ */ M(g, {
127
+ "data-testid": "mtw-provider-card",
128
+ children: /* @__PURE__ */ N(_, {
129
+ className: "p-5",
130
+ children: [
131
+ /* @__PURE__ */ N("div", {
132
+ className: "flex flex-wrap items-start justify-between gap-3",
133
+ children: [/* @__PURE__ */ N("div", {
134
+ className: "min-w-0 space-y-1",
135
+ children: [
136
+ /* @__PURE__ */ N("div", {
137
+ className: "flex flex-wrap items-center gap-2",
138
+ children: [
139
+ /* @__PURE__ */ M("h3", {
140
+ className: "text-base font-semibold",
141
+ children: a.name
142
+ }),
143
+ a.isVerified ? /* @__PURE__ */ N(m, {
144
+ variant: "default",
145
+ className: "gap-1",
146
+ children: [/* @__PURE__ */ M(e, { size: 12 }), "Verified"]
147
+ }) : /* @__PURE__ */ M(m, {
148
+ variant: "outline",
149
+ children: "Unverified"
150
+ }),
151
+ a.isActive ? null : /* @__PURE__ */ M(m, {
152
+ variant: "secondary",
153
+ children: "Inactive"
154
+ })
155
+ ]
156
+ }),
157
+ /* @__PURE__ */ N("p", {
158
+ className: "text-sm text-text-secondary",
159
+ children: [O(a.type), a.rating == null ? null : /* @__PURE__ */ N("span", {
160
+ className: "ml-2 inline-flex items-center gap-1",
161
+ children: [/* @__PURE__ */ M(u, {
162
+ size: 13,
163
+ className: "fill-current text-status-warning-text"
164
+ }), a.rating.toFixed(1)]
165
+ })]
166
+ }),
167
+ a.description ? /* @__PURE__ */ M("p", {
168
+ className: "text-sm text-text-secondary",
169
+ children: a.description
170
+ }) : null
171
+ ]
172
+ }), /* @__PURE__ */ N("div", {
173
+ className: "flex flex-wrap items-center gap-2",
174
+ children: [
175
+ /* @__PURE__ */ N(h, {
176
+ size: "sm",
177
+ onClick: b,
178
+ children: [/* @__PURE__ */ M(p, {
179
+ size: 14,
180
+ className: "mr-1"
181
+ }), "Assign to shipment"]
182
+ }),
183
+ /* @__PURE__ */ M(h, {
184
+ size: "icon",
185
+ variant: "ghost",
186
+ "aria-label": `Edit ${a.name}`,
187
+ onClick: v,
188
+ children: /* @__PURE__ */ M(o, { size: 16 })
189
+ }),
190
+ /* @__PURE__ */ M(h, {
191
+ size: "icon",
192
+ variant: "ghost",
193
+ "aria-label": `Remove ${a.name}`,
194
+ onClick: y,
195
+ children: /* @__PURE__ */ M(f, { size: 16 })
196
+ })
197
+ ]
198
+ })]
199
+ }),
200
+ /* @__PURE__ */ N("div", {
201
+ className: "mt-3 flex flex-wrap gap-x-5 gap-y-1 text-xs text-text-secondary",
202
+ children: [
203
+ a.serviceAreas.length > 0 ? /* @__PURE__ */ N("span", {
204
+ className: "inline-flex items-center gap-1",
205
+ children: [/* @__PURE__ */ M(i, { size: 12 }), a.serviceAreas.join(", ")]
206
+ }) : null,
207
+ a.contact.email ? /* @__PURE__ */ N("span", {
208
+ className: "inline-flex items-center gap-1",
209
+ children: [/* @__PURE__ */ M(r, { size: 12 }), a.contact.email]
210
+ }) : null,
211
+ a.contact.phone ? /* @__PURE__ */ N("span", {
212
+ className: "inline-flex items-center gap-1",
213
+ children: [/* @__PURE__ */ M(s, { size: 12 }), a.contact.phone]
214
+ }) : null
215
+ ]
216
+ }),
217
+ a.services.length > 0 ? /* @__PURE__ */ M("div", {
218
+ className: "mt-3 flex flex-wrap gap-1.5",
219
+ children: a.services.map((e) => /* @__PURE__ */ M(m, {
220
+ variant: "secondary",
221
+ children: e
222
+ }, e))
223
+ }) : null,
224
+ /* @__PURE__ */ N("button", {
225
+ type: "button",
226
+ className: "mt-3 inline-flex items-center gap-1 text-sm font-medium text-action-primary-text",
227
+ onClick: d,
228
+ "aria-expanded": c,
229
+ children: [
230
+ M(c ? n : t, { size: 14 }),
231
+ a.offeringsCount,
232
+ " offering",
233
+ a.offeringsCount === 1 ? "" : "s"
234
+ ]
235
+ }),
236
+ c ? /* @__PURE__ */ M(L, {
237
+ provider: a,
238
+ refreshKey: l,
239
+ onAdd: x,
240
+ onEdit: S,
241
+ onDelete: C
242
+ }) : null
243
+ ]
244
+ })
245
+ });
246
+ }
247
+ function R() {
248
+ let t = oe(), { message: n, notify: r } = re(), [i, o] = j(null), [s, f] = j(""), p = ie(s), [m, D] = j(F), [k, A] = j(!1), [I, L] = j(0), [R, he] = j(0), [ge, z] = j(null), [B, V] = j({
249
+ open: !1,
250
+ provider: null
251
+ }), [H, U] = j({
252
+ open: !1,
253
+ provider: null,
254
+ offering: null
255
+ }), [W, G] = j({
256
+ open: !1,
257
+ provider: null
258
+ }), { providers: K, total: q, isLoading: _e, error: J, refetch: ve } = ce({
259
+ filters: {
260
+ search: p,
261
+ type: m === F ? void 0 : m,
262
+ isVerified: k ? !0 : void 0
263
+ },
264
+ limit: P,
265
+ offset: I * P
266
+ }), Y = se(R), X = Math.max(1, Math.ceil(q / P)), Z = () => {
267
+ he((e) => e + 1), ve();
268
+ }, Q = (e) => {
269
+ o(null), r(e), Z();
270
+ }, ye = async (e) => {
271
+ if (window.confirm(`Remove ${e.name} and its offerings from the marketplace? Shipments it already carries keep it as their carrier.`)) try {
272
+ await t.deleteProvider(e.id), Q(`Removed ${e.name}.`);
273
+ } catch (e) {
274
+ o(e instanceof Error ? e.message : "Could not remove the provider.");
275
+ }
276
+ }, be = async (e) => {
277
+ if (window.confirm(`Remove the offering "${e.name}"?`)) try {
278
+ await t.deleteOffering(e.id), Q(`Removed ${e.name}.`);
279
+ } catch (e) {
280
+ o(e instanceof Error ? e.message : "Could not remove the offering.");
281
+ }
282
+ }, $ = !!p.trim() || m !== F || k;
283
+ return /* @__PURE__ */ N(ee, {
284
+ title: "Marketplace",
285
+ subtitle: Y ? `${Y.providers} service providers` : "Service providers",
286
+ icon: /* @__PURE__ */ M(d, { size: 24 }),
287
+ headerActions: /* @__PURE__ */ M(fe, {
288
+ primary: {
289
+ label: "Add provider",
290
+ icon: /* @__PURE__ */ M(c, { size: 16 }),
291
+ onSelect: () => V({
292
+ open: !0,
293
+ provider: null
294
+ })
295
+ },
296
+ actions: [{
297
+ label: "Refresh",
298
+ icon: /* @__PURE__ */ M(l, { size: 16 }),
299
+ onSelect: Z
300
+ }]
301
+ }),
302
+ children: [
303
+ /* @__PURE__ */ M(pe, {
304
+ icon: /* @__PURE__ */ M(d, { size: 18 }),
305
+ children: "Your directory of vetted carriers, 3PLs, warehouses and specialists. When you are short of capacity, find a provider here and make it a shipment's carrier instead of buying assets."
306
+ }),
307
+ /* @__PURE__ */ M(ne, { message: n }),
308
+ /* @__PURE__ */ M(E, { message: i }),
309
+ /* @__PURE__ */ N(te, {
310
+ columns: 4,
311
+ children: [
312
+ /* @__PURE__ */ M(T, {
313
+ label: "Providers",
314
+ value: Y?.providers ?? "—",
315
+ icon: /* @__PURE__ */ M(d, { size: 20 }),
316
+ accent: "brand"
317
+ }),
318
+ /* @__PURE__ */ M(T, {
319
+ label: "Verified",
320
+ value: Y?.verifiedProviders ?? "—",
321
+ icon: /* @__PURE__ */ M(e, { size: 20 }),
322
+ accent: "success"
323
+ }),
324
+ /* @__PURE__ */ M(T, {
325
+ label: "Offerings",
326
+ value: Y?.offerings ?? "—",
327
+ icon: /* @__PURE__ */ M(a, { size: 20 }),
328
+ accent: "blue"
329
+ }),
330
+ /* @__PURE__ */ M(T, {
331
+ label: "Avg. rating",
332
+ value: Y?.avgRating == null ? "—" : Y.avgRating.toFixed(1),
333
+ icon: /* @__PURE__ */ M(u, { size: 20 }),
334
+ accent: "warning"
335
+ })
336
+ ]
337
+ }),
338
+ /* @__PURE__ */ N("div", {
339
+ className: "flex flex-col gap-3 sm:flex-row sm:items-center",
340
+ children: [
341
+ /* @__PURE__ */ M(v, {
342
+ "aria-label": "Search providers",
343
+ placeholder: "Search by name, service or area…",
344
+ value: s,
345
+ onChange: (e) => {
346
+ f(e.target.value), L(0);
347
+ },
348
+ className: "sm:max-w-sm"
349
+ }),
350
+ /* @__PURE__ */ N(y, {
351
+ value: m,
352
+ onValueChange: (e) => {
353
+ D(e), L(0);
354
+ },
355
+ children: [/* @__PURE__ */ M(S, {
356
+ "aria-label": "Provider type",
357
+ className: "sm:w-56",
358
+ children: /* @__PURE__ */ M(C, {})
359
+ }), /* @__PURE__ */ N(b, { children: [/* @__PURE__ */ M(x, {
360
+ value: F,
361
+ children: "All provider types"
362
+ }), ae.map((e) => /* @__PURE__ */ M(x, {
363
+ value: e,
364
+ children: O(e)
365
+ }, e))] })]
366
+ }),
367
+ /* @__PURE__ */ N(h, {
368
+ variant: k ? "default" : "outline",
369
+ onClick: () => {
370
+ A((e) => !e), L(0);
371
+ },
372
+ "aria-pressed": k,
373
+ children: [/* @__PURE__ */ M(e, {
374
+ size: 16,
375
+ className: "mr-1.5"
376
+ }), "Verified only"]
377
+ })
378
+ ]
379
+ }),
380
+ /* @__PURE__ */ M(E, { message: J?.message }),
381
+ _e && K.length === 0 ? /* @__PURE__ */ N("div", {
382
+ className: "grid gap-4",
383
+ children: [/* @__PURE__ */ M(w, { className: "h-32 w-full" }), /* @__PURE__ */ M(w, { className: "h-32 w-full" })]
384
+ }) : K.length === 0 && !J ? /* @__PURE__ */ M(g, { children: /* @__PURE__ */ N(_, {
385
+ className: "flex flex-col items-center gap-3 p-10 text-center",
386
+ children: [
387
+ /* @__PURE__ */ M(d, {
388
+ size: 32,
389
+ className: "text-text-tertiary"
390
+ }),
391
+ /* @__PURE__ */ M("p", {
392
+ className: "font-medium",
393
+ children: $ ? "No providers match these filters" : "No providers yet"
394
+ }),
395
+ /* @__PURE__ */ M("p", {
396
+ className: "max-w-md text-sm text-text-secondary",
397
+ children: $ ? "Try a different search or clear the filters." : "Add the carriers, 3PLs and warehouses you work with so your team can find capacity in one place."
398
+ }),
399
+ $ ? null : /* @__PURE__ */ N(h, {
400
+ onClick: () => V({
401
+ open: !0,
402
+ provider: null
403
+ }),
404
+ children: [/* @__PURE__ */ M(c, {
405
+ size: 16,
406
+ className: "mr-1.5"
407
+ }), "Add provider"]
408
+ })
409
+ ]
410
+ }) }) : /* @__PURE__ */ M("div", {
411
+ className: "grid gap-4",
412
+ children: K.map((e) => /* @__PURE__ */ M(me, {
413
+ provider: e,
414
+ expanded: ge === e.id,
415
+ refreshKey: R,
416
+ onToggle: () => z((t) => t === e.id ? null : e.id),
417
+ onEdit: () => V({
418
+ open: !0,
419
+ provider: e
420
+ }),
421
+ onDelete: () => void ye(e),
422
+ onAssign: () => G({
423
+ open: !0,
424
+ provider: e
425
+ }),
426
+ onAddOffering: () => U({
427
+ open: !0,
428
+ provider: e,
429
+ offering: null
430
+ }),
431
+ onEditOffering: (t) => U({
432
+ open: !0,
433
+ provider: e,
434
+ offering: t
435
+ }),
436
+ onDeleteOffering: (e) => void be(e)
437
+ }, e.id))
438
+ }),
439
+ q > P ? /* @__PURE__ */ N("div", {
440
+ className: "flex items-center justify-between text-sm",
441
+ children: [/* @__PURE__ */ N("span", {
442
+ className: "text-text-secondary",
443
+ children: [
444
+ "Page ",
445
+ I + 1,
446
+ " of ",
447
+ X,
448
+ " · ",
449
+ q,
450
+ " providers"
451
+ ]
452
+ }), /* @__PURE__ */ N("div", {
453
+ className: "flex gap-2",
454
+ children: [/* @__PURE__ */ M(h, {
455
+ variant: "outline",
456
+ size: "sm",
457
+ disabled: I === 0,
458
+ onClick: () => L((e) => e - 1),
459
+ children: "Previous"
460
+ }), /* @__PURE__ */ M(h, {
461
+ variant: "outline",
462
+ size: "sm",
463
+ disabled: I + 1 >= X,
464
+ onClick: () => L((e) => e + 1),
465
+ children: "Next"
466
+ })]
467
+ })]
468
+ }) : null,
469
+ /* @__PURE__ */ M(de, {
470
+ open: B.open,
471
+ provider: B.provider,
472
+ onOpenChange: (e) => V((t) => ({
473
+ ...t,
474
+ open: e
475
+ })),
476
+ onDone: Q
477
+ }),
478
+ /* @__PURE__ */ M(ue, {
479
+ open: H.open,
480
+ provider: H.provider,
481
+ offering: H.offering,
482
+ onOpenChange: (e) => U((t) => ({
483
+ ...t,
484
+ open: e
485
+ })),
486
+ onDone: (e) => {
487
+ H.provider && z(H.provider.id), Q(e);
488
+ }
489
+ }),
490
+ /* @__PURE__ */ M(le, {
491
+ open: W.open,
492
+ provider: W.provider,
493
+ onOpenChange: (e) => G((t) => ({
494
+ ...t,
495
+ open: e
496
+ })),
497
+ onDone: Q
498
+ })
499
+ ]
500
+ });
501
+ }
502
+ //#endregion
503
+ export { R as default };
@@ -121,69 +121,124 @@ function N() {
121
121
  title: P("movethewheels.tracking.empty.title", "Enter a tracking number"),
122
122
  description: P("movethewheels.tracking.empty.description", "Use your tracking number or order ID to see the current status of your shipment")
123
123
  }),
124
- W && /* @__PURE__ */ k("div", {
124
+ W && !U && /* @__PURE__ */ O(d, {
125
+ "data-testid": "tracking-empty-state",
126
+ children: /* @__PURE__ */ O(f, {
127
+ className: "p-6 sm:p-8",
128
+ children: /* @__PURE__ */ k("div", {
129
+ className: "flex flex-col gap-6 sm:flex-row sm:items-start",
130
+ children: [/* @__PURE__ */ O("div", {
131
+ className: "flex h-12 w-12 shrink-0 items-center justify-center rounded-full bg-bg-sunken text-text-secondary",
132
+ children: /* @__PURE__ */ O(n, { size: 24 })
133
+ }), /* @__PURE__ */ k("div", {
134
+ className: "min-w-0 flex-1",
135
+ children: [
136
+ /* @__PURE__ */ O("h2", {
137
+ className: "text-lg font-semibold text-text-primary",
138
+ children: P("movethewheels.tracking.emptyState.title", "No tracking updates yet")
139
+ }),
140
+ /* @__PURE__ */ O("p", {
141
+ className: "mt-1 text-sm text-text-secondary",
142
+ children: P("movethewheels.tracking.emptyState.description", "This order was found, but tracking updates will appear after the first shipment event.")
143
+ }),
144
+ /* @__PURE__ */ k("div", {
145
+ className: "mt-6 grid grid-cols-2 gap-4 sm:grid-cols-4",
146
+ children: [
147
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
148
+ className: "text-sm text-text-secondary",
149
+ children: P("movethewheels.tracking.emptyState.order", "Order")
150
+ }), /* @__PURE__ */ O("p", {
151
+ className: "font-medium",
152
+ children: W.orderNumber
153
+ })] }),
154
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
155
+ className: "text-sm text-text-secondary",
156
+ children: P("movethewheels.tracking.emptyState.status", "Status")
157
+ }), /* @__PURE__ */ O(y, {
158
+ status: W.status,
159
+ type: "order"
160
+ })] }),
161
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
162
+ className: "text-sm text-text-secondary",
163
+ children: P("movethewheels.tracking.details.trackingNumber", "Tracking Number")
164
+ }), /* @__PURE__ */ O("p", {
165
+ className: "font-mono font-medium",
166
+ children: W.trackingNumber || "—"
167
+ })] }),
168
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
169
+ className: "text-sm text-text-secondary",
170
+ children: P("movethewheels.tracking.details.items", "Items")
171
+ }), /* @__PURE__ */ k("p", {
172
+ className: "font-medium",
173
+ children: [
174
+ W.items.length,
175
+ " ",
176
+ P("movethewheels.tracking.details.itemsSuffix", "items")
177
+ ]
178
+ })] })
179
+ ]
180
+ })
181
+ ]
182
+ })]
183
+ })
184
+ })
185
+ }),
186
+ W && U && /* @__PURE__ */ k("div", {
125
187
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
126
188
  children: [/* @__PURE__ */ k("div", {
127
189
  className: "lg:col-span-2 space-y-6",
128
190
  children: [
129
- /* @__PURE__ */ k(j, { children: [
130
- /* @__PURE__ */ k("div", {
131
- className: "flex items-center justify-between mb-4",
132
- children: [/* @__PURE__ */ k("h2", {
133
- className: "flex items-center gap-2 text-base font-semibold text-text-primary",
191
+ /* @__PURE__ */ k(j, { children: [/* @__PURE__ */ k("div", {
192
+ className: "flex items-center justify-between mb-4",
193
+ children: [/* @__PURE__ */ k("h2", {
194
+ className: "flex items-center gap-2 text-base font-semibold text-text-primary",
195
+ children: [
196
+ /* @__PURE__ */ O(i, { size: 20 }),
197
+ P("movethewheels.tracking.orderLabel", "Order"),
198
+ " ",
199
+ W.orderNumber
200
+ ]
201
+ }), /* @__PURE__ */ O(y, {
202
+ status: W.status,
203
+ type: "order"
204
+ })]
205
+ }), /* @__PURE__ */ k("div", {
206
+ className: "grid grid-cols-2 md:grid-cols-4 gap-4",
207
+ children: [
208
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
209
+ className: "text-sm text-text-secondary",
210
+ children: P("movethewheels.tracking.details.trackingNumber", "Tracking Number")
211
+ }), /* @__PURE__ */ O("p", {
212
+ className: "font-mono font-medium",
213
+ children: W.trackingNumber || "—"
214
+ })] }),
215
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
216
+ className: "text-sm text-text-secondary",
217
+ children: P("movethewheels.tracking.details.estimatedDelivery", "Estimated Delivery")
218
+ }), /* @__PURE__ */ O("p", {
219
+ className: "font-medium",
220
+ children: U?.estimatedArrival ? x(U.estimatedArrival, "full") : W.scheduledDelivery ? x(W.scheduledDelivery, "full") : P("movethewheels.tracking.details.tbd", "TBD")
221
+ })] }),
222
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
223
+ className: "text-sm text-text-secondary",
224
+ children: P("movethewheels.tracking.details.items", "Items")
225
+ }), /* @__PURE__ */ k("p", {
226
+ className: "font-medium",
134
227
  children: [
135
- /* @__PURE__ */ O(i, { size: 20 }),
136
- P("movethewheels.tracking.orderLabel", "Order"),
228
+ W.items.length,
137
229
  " ",
138
- W.orderNumber
230
+ P("movethewheels.tracking.details.itemsSuffix", "items")
139
231
  ]
140
- }), /* @__PURE__ */ O(y, {
141
- status: W.status,
142
- type: "order"
143
- })]
144
- }),
145
- /* @__PURE__ */ k("div", {
146
- className: "grid grid-cols-2 md:grid-cols-4 gap-4",
147
- children: [
148
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
149
- className: "text-sm text-text-secondary",
150
- children: P("movethewheels.tracking.details.trackingNumber", "Tracking Number")
151
- }), /* @__PURE__ */ O("p", {
152
- className: "font-mono font-medium",
153
- children: W.trackingNumber || "—"
154
- })] }),
155
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
156
- className: "text-sm text-text-secondary",
157
- children: P("movethewheels.tracking.details.estimatedDelivery", "Estimated Delivery")
158
- }), /* @__PURE__ */ O("p", {
159
- className: "font-medium",
160
- children: U?.estimatedArrival ? x(U.estimatedArrival, "full") : W.scheduledDelivery ? x(W.scheduledDelivery, "full") : P("movethewheels.tracking.details.tbd", "TBD")
161
- })] }),
162
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
163
- className: "text-sm text-text-secondary",
164
- children: P("movethewheels.tracking.details.items", "Items")
165
- }), /* @__PURE__ */ k("p", {
166
- className: "font-medium",
167
- children: [
168
- W.items.length,
169
- " ",
170
- P("movethewheels.tracking.details.itemsSuffix", "items")
171
- ]
172
- })] }),
173
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
174
- className: "text-sm text-text-secondary",
175
- children: P("movethewheels.tracking.details.lastUpdated", "Last Updated")
176
- }), /* @__PURE__ */ O("p", {
177
- className: "font-medium",
178
- children: U?.lastUpdated ? x(U.lastUpdated, "relative") : P("movethewheels.tracking.details.noUpdates", "No tracking updates yet")
179
- })] })
180
- ]
181
- }),
182
- !U && /* @__PURE__ */ O("p", {
183
- className: "mt-4 rounded-card border border-border-subtle bg-bg-sunken p-3 text-sm text-text-secondary",
184
- children: P("movethewheels.tracking.details.noUpdatesDescription", "The delivery was found, but no tracking updates have been recorded yet.")
185
- })
186
- ] }),
232
+ })] }),
233
+ /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
234
+ className: "text-sm text-text-secondary",
235
+ children: P("movethewheels.tracking.details.lastUpdated", "Last Updated")
236
+ }), /* @__PURE__ */ O("p", {
237
+ className: "font-medium",
238
+ children: U?.lastUpdated ? x(U.lastUpdated, "relative") : P("movethewheels.tracking.details.noUpdates", "No tracking updates yet")
239
+ })] })
240
+ ]
241
+ })] }),
187
242
  /* @__PURE__ */ k(d, { children: [/* @__PURE__ */ O(p, { children: /* @__PURE__ */ k(m, {
188
243
  className: "flex items-center gap-2",
189
244
  children: [/* @__PURE__ */ O(r, { size: 18 }), P("movethewheels.tracking.routeMap.title", "Route map")]