@burdenoff/microfe-movethewheels 2026.1107.5 → 2026.1107.7

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.
@@ -0,0 +1,21 @@
1
+ import { Dialog as e, DialogContent as t, DialogDescription as n, DialogHeader as r, DialogTitle as i } from "./ui.js";
2
+ import { ShipmentDecisionPanel as a } from "./ShipmentDecisionPanel.js";
3
+ import { jsx as o, jsxs as s } from "react/jsx-runtime";
4
+ //#region src/movethewheels/components/CarrierRecommendationDialog.tsx
5
+ function c({ shipment: c, onOpenChange: l, onApplied: u, t: d }) {
6
+ return /* @__PURE__ */ o(e, {
7
+ open: c !== null,
8
+ onOpenChange: l,
9
+ children: /* @__PURE__ */ s(t, {
10
+ className: "max-h-[90vh] max-w-xl overflow-y-auto",
11
+ children: [/* @__PURE__ */ s(r, { children: [/* @__PURE__ */ s(i, { children: [d("movethewheels.carrierDecision.title", "Carrier recommendation"), c ? ` · ${c.number ?? c.id}` : ""] }), /* @__PURE__ */ o(n, { children: d("movethewheels.carrierDecision.description", "Carriers ranked for this shipment’s lane from your own delivery history: on-time record on the lane and overall, and recorded lane cost. Nothing changes until you accept one.") })] }), c && /* @__PURE__ */ o(a, {
12
+ shipmentId: c.id,
13
+ kind: "CARRIER_RECOMMENDATION",
14
+ onApplied: u,
15
+ t: d
16
+ })]
17
+ })
18
+ });
19
+ }
20
+ //#endregion
21
+ export { c as CarrierRecommendationDialog };
@@ -1,14 +1,15 @@
1
- import { Check as e } from "../node_modules/lucide-react/dist/esm/icons/check.js";
2
- import { Route as t } from "../node_modules/lucide-react/dist/esm/icons/route.js";
3
- import { Sparkles as n } from "../node_modules/lucide-react/dist/esm/icons/sparkles.js";
4
- import { Truck as r } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
5
- import { User as i } from "../node_modules/lucide-react/dist/esm/icons/user.js";
6
- import { X as a } from "../node_modules/lucide-react/dist/esm/icons/x.js";
7
- import { formatDateTime as o } from "../utils/formatters.js";
8
- import { Badge as s, Button as c, Card as l, CardContent as u } from "./ui.js";
9
- import { jsx as d, jsxs as f } from "react/jsx-runtime";
1
+ import { Building2 as e } from "../node_modules/lucide-react/dist/esm/icons/building-2.js";
2
+ import { Check as t } from "../node_modules/lucide-react/dist/esm/icons/check.js";
3
+ import { Route as n } from "../node_modules/lucide-react/dist/esm/icons/route.js";
4
+ import { Sparkles as r } from "../node_modules/lucide-react/dist/esm/icons/sparkles.js";
5
+ import { Truck as i } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
6
+ import { User as a } from "../node_modules/lucide-react/dist/esm/icons/user.js";
7
+ import { X as o } from "../node_modules/lucide-react/dist/esm/icons/x.js";
8
+ import { formatDateTime as s } from "../utils/formatters.js";
9
+ import { Badge as c, Button as l, Card as u, CardContent as d } from "./ui.js";
10
+ import { jsx as f, jsxs as p } from "react/jsx-runtime";
10
11
  //#region src/movethewheels/components/DispatchDecisionCard.tsx
11
- var p = {
12
+ var m = {
12
13
  EARLIEST_DUE: ["movethewheels.dispatch.reason.earliestDue", "Earliest due"],
13
14
  MAINTENANCE_OK: ["movethewheels.dispatch.reason.maintenanceOk", "No service due"],
14
15
  MAINTENANCE_DUE_SOON: ["movethewheels.dispatch.reason.maintenanceDueSoon", "Service due soon"],
@@ -22,182 +23,195 @@ var p = {
22
23
  LINKED_PAIR: ["movethewheels.dispatch.reason.linkedPair", "Linked vehicle and driver"],
23
24
  DISTANCE_MEASURED: ["movethewheels.dispatch.reason.distanceMeasured", "Distance measured"],
24
25
  DISTANCE_UNKNOWN: ["movethewheels.dispatch.reason.distanceUnknown", "No coordinates"]
25
- }, m = new Set([
26
+ }, h = new Set([
26
27
  "MAINTENANCE_DUE_SOON",
27
28
  "MAINTENANCE_OVERDUE",
28
29
  "CAPACITY_UNKNOWN",
29
30
  "LICENSE_EXPIRING",
30
31
  "DISTANCE_UNKNOWN"
31
32
  ]);
32
- function h(e, t) {
33
- let n = p[e];
33
+ function g(e, t) {
34
+ let n = m[e];
34
35
  return n ? t(n[0], n[1]) : e;
35
36
  }
36
- function g(e) {
37
+ function _(e) {
37
38
  return e >= .75 ? "text-status-success-text" : e >= .5 ? "text-status-warning-text" : "text-status-error-text";
38
39
  }
39
- function _({ assignment: e, onOpenRoute: n, t: r }) {
40
- return e.decision === "ACCEPTED" ? /* @__PURE__ */ f("div", {
40
+ function v({ assignment: e, onOpenRoute: t, t: r }) {
41
+ return e.decision === "ACCEPTED" ? /* @__PURE__ */ p("div", {
41
42
  className: "flex flex-wrap items-center gap-2",
42
- children: [/* @__PURE__ */ d(s, {
43
+ children: [/* @__PURE__ */ f(c, {
43
44
  variant: "default",
44
45
  children: r("movethewheels.dispatch.decision.accepted", "Accepted")
45
- }), e.routeId && /* @__PURE__ */ f(c, {
46
+ }), e.routeId && /* @__PURE__ */ p(l, {
46
47
  size: "sm",
47
48
  variant: "outline",
48
- onClick: () => n(e.routeId),
49
- children: [/* @__PURE__ */ d(t, {
49
+ onClick: () => t(e.routeId),
50
+ children: [/* @__PURE__ */ f(n, {
50
51
  size: 14,
51
52
  "aria-hidden": "true"
52
53
  }), r("movethewheels.dispatch.openRoute", "Open route")]
53
54
  })]
54
- }) : e.decision === "STALE" ? /* @__PURE__ */ f("div", {
55
+ }) : e.decision === "STALE" ? /* @__PURE__ */ p("div", {
55
56
  className: "space-y-1",
56
- children: [/* @__PURE__ */ d(s, {
57
+ children: [/* @__PURE__ */ f(c, {
57
58
  variant: "outline",
58
59
  children: r("movethewheels.dispatch.decision.stale", "Not applied")
59
- }), e.decisionReason && /* @__PURE__ */ d("p", {
60
+ }), e.decisionReason && /* @__PURE__ */ f("p", {
60
61
  className: "text-xs text-status-warning-text",
61
62
  children: e.decisionReason
62
63
  })]
63
- }) : e.decision === "REJECTED" ? /* @__PURE__ */ d(s, {
64
+ }) : e.decision === "REJECTED" ? /* @__PURE__ */ f(c, {
64
65
  variant: "secondary",
65
66
  children: r("movethewheels.dispatch.decision.rejected", "Rejected")
66
- }) : /* @__PURE__ */ d(s, {
67
+ }) : /* @__PURE__ */ f(c, {
67
68
  variant: "outline",
68
69
  children: r("movethewheels.dispatch.decision.pending", "Not decided")
69
70
  });
70
71
  }
71
- function v({ assignment: t, open: p, choice: v, disabled: y, onChoose: b, onOpenRoute: x, t: S }) {
72
- let C = Math.round(t.confidence * 100), w = t.shipmentNumber ?? t.shipmentId, T = "border-border-default";
73
- return p && v === "accept" ? T = "border-status-success-border" : p && v === "reject" && (T = "border-status-error-border"), /* @__PURE__ */ d(l, {
74
- className: T,
75
- "data-assignment-id": t.id,
72
+ function y({ assignment: n, open: m, choice: y, disabled: b, onChoose: x, onOpenRoute: S, onRecommendCarrier: C, t: w }) {
73
+ let T = Math.round(n.confidence * 100), E = n.shipmentNumber ?? n.shipmentId, D = "border-border-default";
74
+ return m && y === "accept" ? D = "border-status-success-border" : m && y === "reject" && (D = "border-status-error-border"), /* @__PURE__ */ f(u, {
75
+ className: D,
76
+ "data-assignment-id": n.id,
76
77
  "data-testid": "dispatch-decision-card",
77
- children: /* @__PURE__ */ f(u, {
78
+ children: /* @__PURE__ */ p(d, {
78
79
  className: "space-y-3 p-4",
79
80
  children: [
80
- /* @__PURE__ */ f("div", {
81
+ /* @__PURE__ */ p("div", {
81
82
  className: "flex flex-wrap items-start justify-between gap-3",
82
- children: [/* @__PURE__ */ f("div", {
83
+ children: [/* @__PURE__ */ p("div", {
83
84
  className: "min-w-0 space-y-1",
84
- children: [/* @__PURE__ */ f("p", {
85
+ children: [/* @__PURE__ */ p("p", {
85
86
  className: "text-sm font-semibold break-words text-text-primary",
86
87
  children: [
87
- S("movethewheels.dispatch.shipment", "Shipment"),
88
+ w("movethewheels.dispatch.shipment", "Shipment"),
88
89
  " ",
89
- w
90
+ E
90
91
  ]
91
- }), t.estimatedDelivery && /* @__PURE__ */ f("p", {
92
+ }), n.estimatedDelivery && /* @__PURE__ */ p("p", {
92
93
  className: "text-xs text-text-secondary",
93
94
  children: [
94
- S("movethewheels.dispatch.due", "Due"),
95
+ w("movethewheels.dispatch.due", "Due"),
95
96
  " ",
96
- o(t.estimatedDelivery)
97
+ s(n.estimatedDelivery)
97
98
  ]
98
99
  })]
99
- }), /* @__PURE__ */ f("div", {
100
+ }), /* @__PURE__ */ p("div", {
100
101
  className: "text-right",
101
- children: [/* @__PURE__ */ f("p", {
102
- className: `text-lg font-bold tabular-nums ${g(t.confidence)}`,
103
- children: [C, "%"]
104
- }), /* @__PURE__ */ d("p", {
102
+ children: [/* @__PURE__ */ p("p", {
103
+ className: `text-lg font-bold tabular-nums ${_(n.confidence)}`,
104
+ children: [T, "%"]
105
+ }), /* @__PURE__ */ f("p", {
105
106
  className: "text-xs text-text-secondary",
106
- children: S("movethewheels.dispatch.confidence", "Planner confidence")
107
+ children: w("movethewheels.dispatch.confidence", "Planner confidence")
107
108
  })]
108
109
  })]
109
110
  }),
110
- /* @__PURE__ */ f("div", {
111
+ /* @__PURE__ */ p("div", {
111
112
  className: "grid gap-2 text-sm sm:grid-cols-2",
112
- children: [/* @__PURE__ */ f("p", {
113
+ children: [/* @__PURE__ */ p("p", {
113
114
  className: "flex items-center gap-2 break-words",
114
- children: [/* @__PURE__ */ d(r, {
115
+ children: [/* @__PURE__ */ f(i, {
115
116
  size: 16,
116
117
  className: "shrink-0 text-text-secondary",
117
118
  "aria-hidden": "true"
118
- }), /* @__PURE__ */ f("span", { children: [t.vehicleNumber ?? t.vehicleId, t.vehicleType && /* @__PURE__ */ f("span", {
119
+ }), /* @__PURE__ */ p("span", { children: [n.vehicleNumber ?? n.vehicleId, n.vehicleType && /* @__PURE__ */ p("span", {
119
120
  className: "text-text-secondary",
120
- children: [" · ", t.vehicleType]
121
+ children: [" · ", n.vehicleType]
121
122
  })] })]
122
- }), /* @__PURE__ */ f("p", {
123
+ }), /* @__PURE__ */ p("p", {
123
124
  className: "flex items-center gap-2 break-words",
124
- children: [/* @__PURE__ */ d(i, {
125
+ children: [/* @__PURE__ */ f(a, {
125
126
  size: 16,
126
127
  className: "shrink-0 text-text-secondary",
127
128
  "aria-hidden": "true"
128
- }), /* @__PURE__ */ d("span", { children: t.driverName ?? t.driverId })]
129
+ }), /* @__PURE__ */ f("span", { children: n.driverName ?? n.driverId })]
129
130
  })]
130
131
  }),
131
- /* @__PURE__ */ d("ul", {
132
+ /* @__PURE__ */ f("ul", {
132
133
  className: "flex flex-wrap gap-1.5",
133
- "aria-label": S("movethewheels.dispatch.reasons", "Reasons"),
134
- children: t.reasons.map((e) => /* @__PURE__ */ d("li", { children: /* @__PURE__ */ d(s, {
135
- variant: m.has(e) ? "outline" : "secondary",
136
- children: h(e, S)
134
+ "aria-label": w("movethewheels.dispatch.reasons", "Reasons"),
135
+ children: n.reasons.map((e) => /* @__PURE__ */ f("li", { children: /* @__PURE__ */ f(c, {
136
+ variant: h.has(e) ? "outline" : "secondary",
137
+ children: g(e, w)
137
138
  }) }, e))
138
139
  }),
139
- /* @__PURE__ */ d("p", {
140
+ /* @__PURE__ */ f("p", {
140
141
  className: "text-sm text-text-secondary",
141
- children: t.rationale
142
+ children: n.rationale
142
143
  }),
143
- t.aiRationale && /* @__PURE__ */ f("p", {
144
+ n.aiRationale && /* @__PURE__ */ p("p", {
144
145
  className: "flex items-start gap-2 rounded-md bg-surface-secondary p-2 text-sm text-text-primary",
145
- children: [/* @__PURE__ */ d(n, {
146
+ children: [/* @__PURE__ */ f(r, {
146
147
  size: 14,
147
148
  className: "mt-0.5 shrink-0",
148
149
  "aria-hidden": "true"
149
- }), /* @__PURE__ */ f("span", { children: [/* @__PURE__ */ f("span", {
150
+ }), /* @__PURE__ */ p("span", { children: [/* @__PURE__ */ p("span", {
150
151
  className: "sr-only",
151
152
  children: [
152
- S("movethewheels.dispatch.aiWritten", "AI-written"),
153
+ w("movethewheels.dispatch.aiWritten", "AI-written"),
153
154
  ":",
154
155
  " "
155
156
  ]
156
- }), t.aiRationale] })]
157
+ }), n.aiRationale] })]
157
158
  }),
158
- t.estimatedDistanceKm !== null && /* @__PURE__ */ f("p", {
159
+ n.estimatedDistanceKm !== null && /* @__PURE__ */ p("p", {
159
160
  className: "text-xs text-text-secondary",
160
161
  children: [
161
- S("movethewheels.dispatch.distance", "Straight-line distance"),
162
+ w("movethewheels.dispatch.distance", "Straight-line distance"),
162
163
  " ",
163
- t.estimatedDistanceKm,
164
+ n.estimatedDistanceKm,
164
165
  " km",
165
- t.estimatedDurationMinutes !== null && ` · ~${Math.round(t.estimatedDurationMinutes)} min`
166
+ n.estimatedDurationMinutes !== null && ` · ~${Math.round(n.estimatedDurationMinutes)} min`
166
167
  ]
167
168
  }),
168
- p ? /* @__PURE__ */ f("div", {
169
+ m ? /* @__PURE__ */ p("div", {
169
170
  className: "flex flex-wrap gap-2",
170
171
  role: "group",
171
- "aria-label": S("movethewheels.dispatch.decide", "Decide this assignment"),
172
- children: [/* @__PURE__ */ f(c, {
173
- size: "sm",
174
- variant: v === "accept" ? "default" : "outline",
175
- "aria-pressed": v === "accept",
176
- disabled: y,
177
- onClick: () => b(v === "accept" ? null : "accept"),
178
- children: [/* @__PURE__ */ d(e, {
179
- size: 14,
180
- "aria-hidden": "true"
181
- }), S("movethewheels.dispatch.accept", "Accept")]
182
- }), /* @__PURE__ */ f(c, {
183
- size: "sm",
184
- variant: v === "reject" ? "destructive" : "outline",
185
- "aria-pressed": v === "reject",
186
- disabled: y,
187
- onClick: () => b(v === "reject" ? null : "reject"),
188
- children: [/* @__PURE__ */ d(a, {
189
- size: 14,
190
- "aria-hidden": "true"
191
- }), S("movethewheels.dispatch.reject", "Reject")]
192
- })]
193
- }) : /* @__PURE__ */ d(_, {
194
- assignment: t,
195
- onOpenRoute: x,
196
- t: S
172
+ "aria-label": w("movethewheels.dispatch.decide", "Decide this assignment"),
173
+ children: [
174
+ /* @__PURE__ */ p(l, {
175
+ size: "sm",
176
+ variant: y === "accept" ? "default" : "outline",
177
+ "aria-pressed": y === "accept",
178
+ disabled: b,
179
+ onClick: () => x(y === "accept" ? null : "accept"),
180
+ children: [/* @__PURE__ */ f(t, {
181
+ size: 14,
182
+ "aria-hidden": "true"
183
+ }), w("movethewheels.dispatch.accept", "Accept")]
184
+ }),
185
+ /* @__PURE__ */ p(l, {
186
+ size: "sm",
187
+ variant: y === "reject" ? "destructive" : "outline",
188
+ "aria-pressed": y === "reject",
189
+ disabled: b,
190
+ onClick: () => x(y === "reject" ? null : "reject"),
191
+ children: [/* @__PURE__ */ f(o, {
192
+ size: 14,
193
+ "aria-hidden": "true"
194
+ }), w("movethewheels.dispatch.reject", "Reject")]
195
+ }),
196
+ C && /* @__PURE__ */ p(l, {
197
+ size: "sm",
198
+ variant: "ghost",
199
+ disabled: b,
200
+ onClick: () => C(n.shipmentId, n.shipmentNumber),
201
+ children: [/* @__PURE__ */ f(e, {
202
+ size: 14,
203
+ "aria-hidden": "true"
204
+ }), w("movethewheels.carrierDecision.useCarrier", "Use a carrier instead")]
205
+ })
206
+ ]
207
+ }) : /* @__PURE__ */ f(v, {
208
+ assignment: n,
209
+ onOpenRoute: S,
210
+ t: w
197
211
  })
198
212
  ]
199
213
  })
200
214
  });
201
215
  }
202
216
  //#endregion
203
- export { v as DispatchDecisionCard };
217
+ export { y as DispatchDecisionCard, _ as confidenceTone };