@burdenoff/microfe-movethewheels 2026.924.2 → 2026.925.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.
@@ -1,106 +1,107 @@
1
1
  import { ArrowLeft as e } from "../node_modules/lucide-react/dist/esm/icons/arrow-left.js";
2
- import { CalendarClock as t } from "../node_modules/lucide-react/dist/esm/icons/calendar-clock.js";
3
- import { MapPin as n } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
4
- import { Package as r } from "../node_modules/lucide-react/dist/esm/icons/package.js";
5
- import { Plus as i } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
6
- import { Route as a } from "../node_modules/lucide-react/dist/esm/icons/route.js";
2
+ import { ArrowRight as t } from "../node_modules/lucide-react/dist/esm/icons/arrow-right.js";
3
+ import { CalendarClock as n } from "../node_modules/lucide-react/dist/esm/icons/calendar-clock.js";
4
+ import { MapPin as r } from "../node_modules/lucide-react/dist/esm/icons/map-pin.js";
5
+ import { Package as i } from "../node_modules/lucide-react/dist/esm/icons/package.js";
6
+ import { Plus as a } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
7
7
  import { Save as ee } from "../node_modules/lucide-react/dist/esm/icons/save.js";
8
8
  import { Users as te } from "../node_modules/lucide-react/dist/esm/icons/users.js";
9
9
  import { buildCustomerCreatePath as ne, joinPath as o } from "../utils/navigation.js";
10
10
  import { useMoveTheWheels as s } from "../providers/MoveTheWheelsProvider.js";
11
- import { useRoute as c, useRoutes as l } from "../hooks/useRoutes.js";
12
- import { useOrder as re, useOrders as ie } from "../hooks/useOrders.js";
13
- import { useProducts as ae } from "../hooks/useInventory.js";
14
- import { useCustomer as oe, useCustomers as se } from "../hooks/useCustomers.js";
15
- import { Button as u, Card as d, CardContent as f, CardHeader as p, CardTitle as m, Input as h, Label as g, Select as ce, SelectContent as le, SelectItem as _, SelectTrigger as v, SelectValue as ue, Textarea as de } from "../components/ui.js";
16
- import { EmptyState as fe, PageLayout as pe } from "../components/PageLayout.js";
17
- import { FormError as me } from "../components/FormError.js";
18
- import { EntityCombobox as he } from "../components/EntityCombobox.js";
19
- import { CustomerPicker as ge } from "../components/CustomerPicker.js";
20
- import { OrderItemRow as _e } from "../components/OrderItemRow.js";
21
- import { useEffect as y, useState as b } from "react";
22
- import { useParams as ve, useSearchParams as ye } from "react-router";
23
- import { Fragment as be, jsx as x, jsxs as S } from "react/jsx-runtime";
24
- import { EmphasisPanel as xe, NextSteps as Se, PagePurpose as Ce } from "@burdenoff/fe-libs/ui";
11
+ import { useRoute as re, useRoutes as ie } from "../hooks/useRoutes.js";
12
+ import { useOrder as ae, useOrders as oe } from "../hooks/useOrders.js";
13
+ import { useProducts as se } from "../hooks/useInventory.js";
14
+ import { useCustomer as ce, useCustomers as le } from "../hooks/useCustomers.js";
15
+ import { Badge as c, Button as l, Card as u, CardContent as d, CardDescription as f, CardHeader as p, CardTitle as m, Input as h, Label as g, Select as ue, SelectContent as de, SelectItem as _, SelectTrigger as fe, SelectValue as pe, Separator as me, Textarea as he } from "../components/ui.js";
16
+ import { EmptyState as ge, PageLayout as _e } from "../components/PageLayout.js";
17
+ import { FormError as ve } from "../components/FormError.js";
18
+ import { EntityCombobox as ye } from "../components/EntityCombobox.js";
19
+ import { CustomerPicker as v } from "../components/CustomerPicker.js";
20
+ import { OrderItemRow as y } from "../components/OrderItemRow.js";
21
+ import { useEffect as b, useState as x } from "react";
22
+ import { useParams as be, useSearchParams as xe } from "react-router";
23
+ import { Fragment as Se, jsx as S, jsxs as C } from "react/jsx-runtime";
24
+ import { EmphasisPanel as Ce, PagePurpose as we, Stepper as Te } from "@burdenoff/fe-libs/ui";
25
+ import { FormSection as w } from "@burdenoff/fe-libs/form";
25
26
  //#region src/movethewheels/pages/CreateOrderPage.tsx
26
- function C(e) {
27
+ function T(e) {
27
28
  if (!e || Number.isNaN(e.getTime())) return "";
28
29
  let t = (e) => String(e).padStart(2, "0");
29
30
  return `${e.getFullYear()}-${t(e.getMonth() + 1)}-${t(e.getDate())}T${t(e.getHours())}:${t(e.getMinutes())}`;
30
31
  }
31
- function w() {
32
- let { orderId: w } = ve(), [T] = ye(), E = T.get("customerId")?.trim() || void 0, { basePath: D, navigate: O } = s(), { order: k } = re(w), { createOrder: A, updateOrder: we } = ie(), [Te, Ee] = b(""), { customers: j, createCustomer: M, isLoading: N, error: P, refetch: De } = se({
32
+ function E() {
33
+ let { orderId: E } = be(), [D] = xe(), O = D.get("customerId")?.trim() || void 0, { basePath: k, navigate: A } = s(), { order: j } = ae(E), { createOrder: Ee, updateOrder: De } = oe(), [Oe, ke] = x(""), { customers: M, createCustomer: Ae, isLoading: N, error: P, refetch: je } = le({
33
34
  limit: 20,
34
- filters: { search: Te || void 0 }
35
- }), { customer: F } = oe(E ?? k?.customerId), [Oe, ke] = b(""), { routes: I, isLoading: L, error: R, hasMore: Ae, totalRoutes: je } = l({
35
+ filters: { search: Oe || void 0 }
36
+ }), { customer: F } = ce(O ?? j?.customerId), [Me, Ne] = x(""), { routes: I, isLoading: L, error: R, hasMore: Pe, totalRoutes: Fe } = ie({
36
37
  status: "planned",
37
- search: Oe || void 0,
38
+ search: Me || void 0,
38
39
  limit: 20
39
- }), [z, Me] = b(""), { products: Ne, isLoading: Pe } = ae({
40
+ }), [z, Ie] = x(""), { products: Le, isLoading: Re } = se({
40
41
  search: z || void 0,
41
42
  limit: 20
42
- }), B = !!w && !!k, [V, H] = b(null), [U, W] = b({
43
- customerId: E || k?.customerId || "",
44
- priority: k?.priority || "normal",
45
- routeId: k?.routeId || "",
43
+ }), B = !!E && !!j, [V, H] = x(null), [U, W] = x({
44
+ customerId: O || j?.customerId || "",
45
+ priority: j?.priority || "normal",
46
+ routeId: j?.routeId || "",
46
47
  pickupAddress: {
47
- street: k?.pickupAddress.street || "",
48
- city: k?.pickupAddress.city || "",
49
- state: k?.pickupAddress.state || "",
50
- postalCode: k?.pickupAddress.postalCode || "",
51
- country: k?.pickupAddress.country || "USA"
48
+ street: j?.pickupAddress.street || "",
49
+ city: j?.pickupAddress.city || "",
50
+ state: j?.pickupAddress.state || "",
51
+ postalCode: j?.pickupAddress.postalCode || "",
52
+ country: j?.pickupAddress.country || "USA"
52
53
  },
53
54
  deliveryAddress: {
54
- street: k?.deliveryAddress.street || "",
55
- city: k?.deliveryAddress.city || "",
56
- state: k?.deliveryAddress.state || "",
57
- postalCode: k?.deliveryAddress.postalCode || "",
58
- country: k?.deliveryAddress.country || "USA"
55
+ street: j?.deliveryAddress.street || "",
56
+ city: j?.deliveryAddress.city || "",
57
+ state: j?.deliveryAddress.state || "",
58
+ postalCode: j?.deliveryAddress.postalCode || "",
59
+ country: j?.deliveryAddress.country || "USA"
59
60
  },
60
- items: k?.items || [],
61
- scheduledDelivery: C(k?.scheduledDelivery),
62
- specialInstructions: k?.specialInstructions || ""
63
- }), { route: Fe, isLoading: Ie } = c(U.routeId || void 0), [G, K] = b(!1), [Le, q] = b(null);
64
- y(() => {
61
+ items: j?.items || [],
62
+ scheduledDelivery: T(j?.scheduledDelivery),
63
+ specialInstructions: j?.specialInstructions || ""
64
+ }), { route: ze, isLoading: Be } = re(U.routeId || void 0), [G, K] = x(!1), [Ve, q] = x(null);
65
+ b(() => {
65
66
  F && (H((e) => e?.id === F.id ? e : F), W((e) => e.customerId ? e : {
66
67
  ...e,
67
68
  customerId: F.id
68
69
  }));
69
- }, [F]), y(() => {
70
- k && W({
71
- customerId: k.customerId || "",
72
- priority: k.priority || "normal",
73
- routeId: k.routeId || "",
70
+ }, [F]), b(() => {
71
+ j && W({
72
+ customerId: j.customerId || "",
73
+ priority: j.priority || "normal",
74
+ routeId: j.routeId || "",
74
75
  pickupAddress: {
75
- street: k.pickupAddress.street || "",
76
- city: k.pickupAddress.city || "",
77
- state: k.pickupAddress.state || "",
78
- postalCode: k.pickupAddress.postalCode || "",
79
- country: k.pickupAddress.country || "USA"
76
+ street: j.pickupAddress.street || "",
77
+ city: j.pickupAddress.city || "",
78
+ state: j.pickupAddress.state || "",
79
+ postalCode: j.pickupAddress.postalCode || "",
80
+ country: j.pickupAddress.country || "USA"
80
81
  },
81
82
  deliveryAddress: {
82
- street: k.deliveryAddress.street || "",
83
- city: k.deliveryAddress.city || "",
84
- state: k.deliveryAddress.state || "",
85
- postalCode: k.deliveryAddress.postalCode || "",
86
- country: k.deliveryAddress.country || "USA"
83
+ street: j.deliveryAddress.street || "",
84
+ city: j.deliveryAddress.city || "",
85
+ state: j.deliveryAddress.state || "",
86
+ postalCode: j.deliveryAddress.postalCode || "",
87
+ country: j.deliveryAddress.country || "USA"
87
88
  },
88
- items: k.items || [],
89
- scheduledDelivery: C(k.scheduledDelivery),
90
- specialInstructions: k.specialInstructions || ""
89
+ items: j.items || [],
90
+ scheduledDelivery: T(j.scheduledDelivery),
91
+ specialInstructions: j.specialInstructions || ""
91
92
  });
92
- }, [k]);
93
+ }, [j]);
93
94
  let J = () => {
94
- if (O) {
95
- if (!B && E) {
96
- O(o(D, `customers/${E}`));
95
+ if (A) {
96
+ if (!B && O) {
97
+ A(o(k, `customers/${O}`));
97
98
  return;
98
99
  }
99
- O(o(D, "orders"));
100
+ A(o(k, "orders"));
100
101
  }
101
- }, Y = () => V ?? j.find((e) => e.id === U.customerId), Re = () => !U.customerId || !Y() ? P ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order." : U.pickupAddress.street.trim() ? U.deliveryAddress.street.trim() ? U.items.length === 0 ? "Add at least one item to the order." : U.scheduledDelivery && Number.isNaN(Date.parse(U.scheduledDelivery)) ? "Enter a valid scheduled delivery date and time." : null : "Enter a delivery street address." : "Enter a pickup street address.", X = async (e) => {
102
+ }, Y = () => V ?? M.find((e) => e.id === U.customerId), He = () => !U.customerId || !Y() ? P ? "Customers could not be loaded. Retry or create a customer before continuing." : "Select a customer for this order." : U.pickupAddress.street.trim() ? U.deliveryAddress.street.trim() ? U.items.length === 0 ? "Add at least one item to the order." : U.scheduledDelivery && Number.isNaN(Date.parse(U.scheduledDelivery)) ? "Enter a valid scheduled delivery date and time." : null : "Enter a delivery street address." : "Enter a pickup street address.", X = async (e) => {
102
103
  e.preventDefault(), q(null);
103
- let t = Re();
104
+ let t = He();
104
105
  if (t) {
105
106
  q(t);
106
107
  return;
@@ -128,7 +129,11 @@ function w() {
128
129
  routeId: U.routeId || void 0,
129
130
  specialInstructions: U.specialInstructions
130
131
  };
131
- B && w ? (await we(w, e), O && O(o(D, `orders/${w}`))) : (await A(e), J());
132
+ if (B && E) await De(E, e), A && A(o(k, `orders/${E}`));
133
+ else {
134
+ let t = await Ee(e);
135
+ A ? A(o(k, `orders/${t.id}`)) : J();
136
+ }
132
137
  } catch (e) {
133
138
  q(e instanceof Error ? e.message : B ? "Could not update the order. Please try again." : "Could not create the order. Please try again.");
134
139
  } finally {
@@ -147,7 +152,7 @@ function w() {
147
152
  [t]: n
148
153
  }
149
154
  }));
150
- }, ze = (e) => {
155
+ }, Ue = (e) => {
151
156
  if (!e) {
152
157
  Z("routeId", "");
153
158
  return;
@@ -186,12 +191,12 @@ function w() {
186
191
  sku: ""
187
192
  }]
188
193
  }));
189
- }, Be = (e) => {
194
+ }, We = (e) => {
190
195
  W((t) => ({
191
196
  ...t,
192
197
  items: t.items.filter((t, n) => n !== e)
193
198
  }));
194
- }, Ve = (e, t, n) => {
199
+ }, Ge = (e, t, n) => {
195
200
  W((r) => ({
196
201
  ...r,
197
202
  items: r.items.map((r, i) => i === e ? {
@@ -199,388 +204,560 @@ function w() {
199
204
  [t]: n
200
205
  } : r)
201
206
  }));
202
- };
203
- return /* @__PURE__ */ S(pe, {
207
+ }, Ke = () => {
208
+ A && A(o(k, ne(B && E ? `orders/${E}/edit` : "orders/new")));
209
+ }, qe = U.customerId ? !U.pickupAddress.street || !U.deliveryAddress.street ? 1 : U.items.length === 0 ? 2 : 3 : 0;
210
+ return /* @__PURE__ */ C(_e, {
204
211
  title: B ? "Edit Order" : "Create Order",
205
- subtitle: B ? `Editing ${k?.orderNumber}` : "Create a new delivery order",
206
- icon: /* @__PURE__ */ x(r, { size: 24 }),
207
- headerActions: /* @__PURE__ */ S("div", {
208
- className: "flex gap-2",
209
- children: [/* @__PURE__ */ S(u, {
212
+ subtitle: B ? `Editing ${j?.orderNumber}` : "Create a new delivery order",
213
+ icon: /* @__PURE__ */ S(i, { size: 24 }),
214
+ maxWidth: "2xl",
215
+ headerActions: /* @__PURE__ */ C("div", {
216
+ className: "flex w-full flex-col-reverse gap-2 sm:w-auto sm:flex-row",
217
+ children: [/* @__PURE__ */ C(l, {
218
+ type: "button",
210
219
  variant: "outline",
211
220
  onClick: J,
212
- children: [/* @__PURE__ */ x(e, { size: 16 }), "Cancel"]
213
- }), /* @__PURE__ */ S(u, {
214
- onClick: X,
221
+ disabled: G,
222
+ children: [/* @__PURE__ */ S(e, { size: 16 }), "Cancel"]
223
+ }), /* @__PURE__ */ C(l, {
224
+ type: "submit",
225
+ form: "order-form",
215
226
  disabled: G || N,
216
- children: [/* @__PURE__ */ x(ee, { size: 16 }), G ? "Saving..." : B ? "Save Changes" : "Create Order"]
227
+ children: [/* @__PURE__ */ S(ee, { size: 16 }), G ? "Saving..." : B ? "Save Changes" : "Create Order"]
217
228
  })]
218
229
  }),
219
230
  children: [
220
- /* @__PURE__ */ x(Ce, {
221
- icon: /* @__PURE__ */ x(r, { size: 18 }),
222
- children: B ? "Update this delivery before it goes out — change the customer, addresses, items or handling notes, then save." : "Book a new delivery in a few steps: choose who it’s for, set pickup and drop-off addresses, list what’s being shipped, and add any handling notes. Once created it joins the orders pipeline ready to assign and track."
231
+ /* @__PURE__ */ S(we, {
232
+ icon: /* @__PURE__ */ S(i, { size: 18 }),
233
+ children: B ? "Update the customer, delivery plan, shipment contents, or handling details before saving." : "Set the customer and delivery plan, add what is being shipped, then choose any timing or handling preferences."
223
234
  }),
224
- /* @__PURE__ */ x(Se, {
225
- storageKey: "movethewheels-create-order",
235
+ /* @__PURE__ */ S(Te, {
226
236
  steps: [
227
237
  {
228
- id: "customer",
229
- label: "Pick the customer first",
230
- description: "Their saved contact details auto-fill the order.",
231
- icon: /* @__PURE__ */ x(te, { size: 16 }),
232
- done: !!U.customerId,
233
- onClick: () => document.getElementById("customer")?.focus()
238
+ key: "customer",
239
+ label: "Customer & priority",
240
+ description: "Who is receiving this delivery?"
241
+ },
242
+ {
243
+ key: "locations",
244
+ label: "Route & addresses",
245
+ description: "Where should it be collected and delivered?"
234
246
  },
235
247
  {
236
- id: "addresses",
237
- label: "Set pickup & delivery addresses",
238
- description: "Where the shipment is collected and dropped off.",
239
- icon: /* @__PURE__ */ x(n, { size: 16 }),
240
- done: !!U.pickupAddress.street && !!U.deliveryAddress.street,
241
- onClick: () => document.getElementById("pickupStreet")?.focus()
248
+ key: "items",
249
+ label: "Shipment contents",
250
+ description: "What is being shipped?"
242
251
  },
243
252
  {
244
- id: "items",
245
- label: "Add the items to ship",
246
- description: "List each product with its quantity and value.",
247
- icon: /* @__PURE__ */ x(r, { size: 16 }),
248
- done: U.items.length > 0,
249
- onClick: $
253
+ key: "preferences",
254
+ label: "Timing & handling",
255
+ description: "Add optional delivery instructions."
250
256
  }
251
- ]
257
+ ],
258
+ active: qe,
259
+ onStepClick: (e) => {
260
+ let t = document.getElementById([
261
+ "customer",
262
+ "pickupStreet",
263
+ "items-section",
264
+ "scheduledDelivery"
265
+ ][e]);
266
+ if (t instanceof HTMLInputElement || t instanceof HTMLTextAreaElement) {
267
+ t.focus();
268
+ return;
269
+ }
270
+ t?.scrollIntoView({
271
+ behavior: "smooth",
272
+ block: "start"
273
+ });
274
+ },
275
+ allowSkipAhead: !0
252
276
  }),
253
- /* @__PURE__ */ S("form", {
277
+ /* @__PURE__ */ C("form", {
278
+ id: "order-form",
254
279
  onSubmit: X,
255
280
  className: "space-y-6",
256
281
  children: [
257
- /* @__PURE__ */ x(me, { message: Le }),
258
- /* @__PURE__ */ S(xe, { children: [/* @__PURE__ */ x("h2", {
259
- className: "text-base font-semibold text-text-primary mb-4",
260
- children: "Order Details"
261
- }), /* @__PURE__ */ x("div", {
262
- className: "space-y-4",
263
- children: /* @__PURE__ */ S("div", {
264
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
265
- children: [/* @__PURE__ */ x(ge, {
266
- customers: j,
267
- value: U.customerId,
268
- onValueChange: (e) => {
269
- e && (Z("customerId", e), H(j.find((t) => t.id === e) ?? (V?.id === e ? V : null)), q(null));
270
- },
271
- onCreated: (e) => {
272
- H(e), Z("customerId", e.id), q(null);
273
- },
274
- createCustomer: M,
275
- isLoading: N,
276
- error: P,
277
- onRetry: De,
278
- onOpenCustomers: () => {
279
- O && O(o(D, ne(B && w ? `orders/${w}/edit` : "orders/new")));
280
- },
281
- selectedCustomer: V,
282
- onSearchQueryChange: Ee
283
- }), /* @__PURE__ */ S("div", {
284
- className: "space-y-2",
285
- children: [/* @__PURE__ */ x(g, {
286
- htmlFor: "priority",
287
- children: "Priority"
288
- }), /* @__PURE__ */ S(ce, {
289
- value: U.priority,
290
- onValueChange: (e) => Z("priority", e),
291
- children: [/* @__PURE__ */ x(v, {
292
- id: "priority",
293
- children: /* @__PURE__ */ x(ue, {})
294
- }), /* @__PURE__ */ S(le, { children: [
295
- /* @__PURE__ */ x(_, {
296
- value: "low",
297
- children: "Low"
298
- }),
299
- /* @__PURE__ */ x(_, {
300
- value: "normal",
301
- children: "Normal"
282
+ /* @__PURE__ */ S(ve, { message: Ve }),
283
+ /* @__PURE__ */ S("section", {
284
+ "aria-labelledby": "order-details-title",
285
+ children: /* @__PURE__ */ C(Ce, {
286
+ className: "space-y-5",
287
+ children: [/* @__PURE__ */ C("div", {
288
+ className: "flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",
289
+ children: [/* @__PURE__ */ C("div", {
290
+ className: "flex items-start gap-3",
291
+ children: [/* @__PURE__ */ S("div", {
292
+ className: "rounded-xl bg-action-primary-bg/10 p-2 text-action-primary-bg",
293
+ children: /* @__PURE__ */ S(te, {
294
+ size: 18,
295
+ "aria-hidden": "true"
296
+ })
297
+ }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h2", {
298
+ id: "order-details-title",
299
+ className: "text-base font-semibold text-text-primary",
300
+ children: "Customer & priority"
301
+ }), /* @__PURE__ */ S("p", {
302
+ className: "mt-1 text-sm text-text-secondary",
303
+ children: "Choose who this delivery is for and how urgently it should be handled."
304
+ })] })]
305
+ }), /* @__PURE__ */ S(c, {
306
+ variant: "outline",
307
+ children: "Required"
308
+ })]
309
+ }), /* @__PURE__ */ C("div", {
310
+ className: "grid grid-cols-1 gap-4 md:grid-cols-2",
311
+ children: [/* @__PURE__ */ S(v, {
312
+ customers: M,
313
+ value: U.customerId,
314
+ onValueChange: (e) => {
315
+ e && (Z("customerId", e), H(M.find((t) => t.id === e) ?? (V?.id === e ? V : null)), q(null));
316
+ },
317
+ onCreated: (e) => {
318
+ H(e), Z("customerId", e.id), q(null);
319
+ },
320
+ createCustomer: Ae,
321
+ isLoading: N,
322
+ error: P,
323
+ onRetry: je,
324
+ onOpenCustomers: Ke,
325
+ selectedCustomer: V,
326
+ onSearchQueryChange: ke
327
+ }), /* @__PURE__ */ C("div", {
328
+ className: "space-y-2",
329
+ children: [
330
+ /* @__PURE__ */ S(g, {
331
+ htmlFor: "priority",
332
+ children: "Priority"
302
333
  }),
303
- /* @__PURE__ */ x(_, {
304
- value: "high",
305
- children: "High"
334
+ /* @__PURE__ */ C(ue, {
335
+ value: U.priority,
336
+ onValueChange: (e) => Z("priority", e),
337
+ children: [/* @__PURE__ */ S(fe, {
338
+ id: "priority",
339
+ children: /* @__PURE__ */ S(pe, {})
340
+ }), /* @__PURE__ */ C(de, { children: [
341
+ /* @__PURE__ */ S(_, {
342
+ value: "low",
343
+ children: "Low"
344
+ }),
345
+ /* @__PURE__ */ S(_, {
346
+ value: "normal",
347
+ children: "Normal"
348
+ }),
349
+ /* @__PURE__ */ S(_, {
350
+ value: "high",
351
+ children: "High"
352
+ }),
353
+ /* @__PURE__ */ S(_, {
354
+ value: "urgent",
355
+ children: "Urgent"
356
+ })
357
+ ] })]
306
358
  }),
307
- /* @__PURE__ */ x(_, {
308
- value: "urgent",
309
- children: "Urgent"
359
+ /* @__PURE__ */ S("p", {
360
+ className: "text-xs text-text-secondary",
361
+ children: "Normal is selected by default."
310
362
  })
311
- ] })]
363
+ ]
312
364
  })]
313
365
  })]
314
366
  })
315
- })] }),
316
- /* @__PURE__ */ S(d, { children: [/* @__PURE__ */ x(p, { children: /* @__PURE__ */ S(m, {
317
- className: "flex items-center gap-2",
318
- children: [/* @__PURE__ */ x(a, { size: 18 }), "Saved Route (Optional)"]
319
- }) }), /* @__PURE__ */ S(f, {
320
- className: "space-y-2",
321
- children: [/* @__PURE__ */ x(he, {
322
- id: "saved-route",
323
- value: U.routeId,
324
- onChange: ze,
325
- options: I,
326
- loading: L,
327
- getId: (e) => e.id,
328
- getLabel: (e) => `${e.name} · ${e.stops.length} stops`,
329
- renderOption: (e) => /* @__PURE__ */ S(be, { children: [
330
- e.name,
331
- " · ",
332
- e.stops.length,
333
- " stops"
334
- ] }),
335
- selectedOption: Fe,
336
- selectedLoading: Ie,
337
- placeholder: "Choose a saved route",
338
- searchPlaceholder: "Search saved routes",
339
- emptyText: "No saved routes found.",
340
- noneLabel: "No saved route",
341
- error: R ? "Saved routes are unavailable" : void 0,
342
- onSearchChange: ke,
343
- hasMore: Ae,
344
- totalCount: je
345
- }), /* @__PURE__ */ x("p", {
346
- className: "text-xs text-text-secondary",
347
- children: L ? "Loading planned routes…" : R ? "Saved routes are unavailable; enter pickup and delivery addresses manually." : "A saved route fills any blank address fields. You can always edit both addresses below."
348
- })]
349
- })] }),
367
+ }),
350
368
  /* @__PURE__ */ S("div", {
351
- className: "grid grid-cols-1 md:grid-cols-2 gap-6",
352
- children: [/* @__PURE__ */ S(d, { children: [/* @__PURE__ */ x(p, { children: /* @__PURE__ */ x(m, { children: "Pickup Address" }) }), /* @__PURE__ */ S(f, {
353
- className: "space-y-4",
369
+ id: "locations-section",
370
+ children: /* @__PURE__ */ C(w, {
371
+ title: /* @__PURE__ */ C("span", {
372
+ className: "flex items-center gap-2",
373
+ children: [/* @__PURE__ */ S(r, {
374
+ size: 18,
375
+ "aria-hidden": "true"
376
+ }), "Route & addresses"]
377
+ }),
378
+ description: "Choose an optional saved route, then review or enter the collection and destination details.",
354
379
  children: [
355
- /* @__PURE__ */ S("div", {
356
- className: "space-y-2",
357
- children: [/* @__PURE__ */ x(g, {
358
- htmlFor: "pickupStreet",
359
- children: "Street Address"
360
- }), /* @__PURE__ */ x(h, {
361
- id: "pickupStreet",
362
- value: U.pickupAddress.street,
363
- onChange: (e) => Q("pickupAddress", "street", e.target.value),
364
- placeholder: "123 Main St"
365
- })]
366
- }),
367
- /* @__PURE__ */ S("div", {
368
- className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
369
- children: [/* @__PURE__ */ S("div", {
370
- className: "space-y-2",
371
- children: [/* @__PURE__ */ x(g, {
372
- htmlFor: "pickupCity",
373
- children: "City"
374
- }), /* @__PURE__ */ x(h, {
375
- id: "pickupCity",
376
- value: U.pickupAddress.city,
377
- onChange: (e) => Q("pickupAddress", "city", e.target.value),
378
- placeholder: "San Francisco"
379
- })]
380
- }), /* @__PURE__ */ S("div", {
381
- className: "space-y-2",
382
- children: [/* @__PURE__ */ x(g, {
383
- htmlFor: "pickupState",
384
- children: "State"
385
- }), /* @__PURE__ */ x(h, {
386
- id: "pickupState",
387
- value: U.pickupAddress.state,
388
- onChange: (e) => Q("pickupAddress", "state", e.target.value),
389
- placeholder: "CA"
390
- })]
391
- })]
392
- }),
393
- /* @__PURE__ */ S("div", {
394
- className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
395
- children: [/* @__PURE__ */ S("div", {
396
- className: "space-y-2",
397
- children: [/* @__PURE__ */ x(g, {
398
- htmlFor: "pickupPostal",
399
- children: "Postal Code"
400
- }), /* @__PURE__ */ x(h, {
401
- id: "pickupPostal",
402
- value: U.pickupAddress.postalCode,
403
- onChange: (e) => Q("pickupAddress", "postalCode", e.target.value),
404
- placeholder: "94103"
405
- })]
406
- }), /* @__PURE__ */ S("div", {
407
- className: "space-y-2",
408
- children: [/* @__PURE__ */ x(g, {
409
- htmlFor: "pickupCountry",
410
- children: "Country"
411
- }), /* @__PURE__ */ x(h, {
412
- id: "pickupCountry",
413
- value: U.pickupAddress.country,
414
- onChange: (e) => Q("pickupAddress", "country", e.target.value),
415
- placeholder: "USA"
416
- })]
417
- })]
418
- })
419
- ]
420
- })] }), /* @__PURE__ */ S(d, { children: [/* @__PURE__ */ x(p, { children: /* @__PURE__ */ x(m, { children: "Delivery Address" }) }), /* @__PURE__ */ S(f, {
421
- className: "space-y-4",
422
- children: [
423
- /* @__PURE__ */ S("div", {
424
- className: "space-y-2",
425
- children: [/* @__PURE__ */ x(g, {
426
- htmlFor: "deliveryStreet",
427
- children: "Street Address"
428
- }), /* @__PURE__ */ x(h, {
429
- id: "deliveryStreet",
430
- value: U.deliveryAddress.street,
431
- onChange: (e) => Q("deliveryAddress", "street", e.target.value),
432
- placeholder: "456 Oak Ave"
433
- })]
434
- }),
435
- /* @__PURE__ */ S("div", {
436
- className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
437
- children: [/* @__PURE__ */ S("div", {
438
- className: "space-y-2",
439
- children: [/* @__PURE__ */ x(g, {
440
- htmlFor: "deliveryCity",
441
- children: "City"
442
- }), /* @__PURE__ */ x(h, {
443
- id: "deliveryCity",
444
- value: U.deliveryAddress.city,
445
- onChange: (e) => Q("deliveryAddress", "city", e.target.value),
446
- placeholder: "Los Angeles"
447
- })]
448
- }), /* @__PURE__ */ S("div", {
449
- className: "space-y-2",
450
- children: [/* @__PURE__ */ x(g, {
451
- htmlFor: "deliveryState",
452
- children: "State"
453
- }), /* @__PURE__ */ x(h, {
454
- id: "deliveryState",
455
- value: U.deliveryAddress.state,
456
- onChange: (e) => Q("deliveryAddress", "state", e.target.value),
457
- placeholder: "CA"
458
- })]
459
- })]
380
+ /* @__PURE__ */ C("div", {
381
+ className: "rounded-card border border-border-subtle bg-bg-sunken/40 p-4",
382
+ children: [
383
+ /* @__PURE__ */ C("div", {
384
+ className: "mb-3 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",
385
+ children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h3", {
386
+ className: "text-sm font-semibold text-text-primary",
387
+ children: "Use a saved route"
388
+ }), /* @__PURE__ */ S("p", {
389
+ className: "mt-1 text-xs text-text-secondary",
390
+ children: "Optional — fills only blank address fields; you can always edit them below."
391
+ })] }), /* @__PURE__ */ S(c, {
392
+ variant: "secondary",
393
+ children: "Optional"
394
+ })]
395
+ }),
396
+ /* @__PURE__ */ S(ye, {
397
+ id: "saved-route",
398
+ value: U.routeId,
399
+ onChange: Ue,
400
+ options: I,
401
+ loading: L,
402
+ getId: (e) => e.id,
403
+ getLabel: (e) => `${e.name} · ${e.stops.length} stops`,
404
+ renderOption: (e) => /* @__PURE__ */ C(Se, { children: [
405
+ e.name,
406
+ " · ",
407
+ e.stops.length,
408
+ " stops"
409
+ ] }),
410
+ selectedOption: ze,
411
+ selectedLoading: Be,
412
+ placeholder: "Choose a saved route",
413
+ searchPlaceholder: "Search saved routes",
414
+ emptyText: "No saved routes found.",
415
+ noneLabel: "No saved route",
416
+ error: R ? "Saved routes are unavailable" : void 0,
417
+ onSearchChange: Ne,
418
+ hasMore: Pe,
419
+ totalCount: Fe
420
+ }),
421
+ /* @__PURE__ */ S("p", {
422
+ className: "mt-2 text-xs text-text-secondary",
423
+ role: "status",
424
+ children: L ? "Loading planned routes…" : R ? "Saved routes are unavailable; enter pickup and delivery addresses manually." : "Manual values always remain authoritative when a route is selected."
425
+ })
426
+ ]
460
427
  }),
461
- /* @__PURE__ */ S("div", {
462
- className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
463
- children: [/* @__PURE__ */ S("div", {
464
- className: "space-y-2",
465
- children: [/* @__PURE__ */ x(g, {
466
- htmlFor: "deliveryPostal",
467
- children: "Postal Code"
468
- }), /* @__PURE__ */ x(h, {
469
- id: "deliveryPostal",
470
- value: U.deliveryAddress.postalCode,
471
- onChange: (e) => Q("deliveryAddress", "postalCode", e.target.value),
472
- placeholder: "90210"
473
- })]
474
- }), /* @__PURE__ */ S("div", {
475
- className: "space-y-2",
476
- children: [/* @__PURE__ */ x(g, {
477
- htmlFor: "deliveryCountry",
478
- children: "Country"
479
- }), /* @__PURE__ */ x(h, {
480
- id: "deliveryCountry",
481
- value: U.deliveryAddress.country,
482
- onChange: (e) => Q("deliveryAddress", "country", e.target.value),
483
- placeholder: "USA"
484
- })]
485
- })]
428
+ /* @__PURE__ */ S(me, {}),
429
+ /* @__PURE__ */ C("div", {
430
+ className: "grid grid-cols-1 gap-4 lg:grid-cols-[minmax(0,1fr)_auto_minmax(0,1fr)] lg:items-stretch",
431
+ children: [
432
+ /* @__PURE__ */ C(u, {
433
+ className: "border-border-seam shadow-none",
434
+ children: [/* @__PURE__ */ C(p, { children: [/* @__PURE__ */ C(m, {
435
+ className: "flex items-center gap-2 text-base",
436
+ children: [
437
+ /* @__PURE__ */ S(r, {
438
+ size: 17,
439
+ className: "text-text-secondary",
440
+ "aria-hidden": "true"
441
+ }),
442
+ "Pickup address ",
443
+ /* @__PURE__ */ S("span", {
444
+ className: "text-status-error-text",
445
+ children: "*"
446
+ })
447
+ ]
448
+ }), /* @__PURE__ */ S(f, { children: "Where the shipment is collected." })] }), /* @__PURE__ */ S(d, {
449
+ className: "space-y-4",
450
+ children: /* @__PURE__ */ C("fieldset", {
451
+ className: "space-y-4",
452
+ children: [
453
+ /* @__PURE__ */ S("legend", {
454
+ className: "sr-only",
455
+ children: "Pickup address details"
456
+ }),
457
+ /* @__PURE__ */ C("div", {
458
+ className: "space-y-2",
459
+ children: [/* @__PURE__ */ C(g, {
460
+ htmlFor: "pickupStreet",
461
+ children: ["Street address ", /* @__PURE__ */ S("span", {
462
+ className: "text-status-error-text",
463
+ children: "*"
464
+ })]
465
+ }), /* @__PURE__ */ S(h, {
466
+ id: "pickupStreet",
467
+ value: U.pickupAddress.street,
468
+ onChange: (e) => Q("pickupAddress", "street", e.target.value),
469
+ placeholder: "123 Main St",
470
+ "aria-required": "true"
471
+ })]
472
+ }),
473
+ /* @__PURE__ */ C("div", {
474
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
475
+ children: [/* @__PURE__ */ C("div", {
476
+ className: "space-y-2",
477
+ children: [/* @__PURE__ */ S(g, {
478
+ htmlFor: "pickupCity",
479
+ children: "City"
480
+ }), /* @__PURE__ */ S(h, {
481
+ id: "pickupCity",
482
+ value: U.pickupAddress.city,
483
+ onChange: (e) => Q("pickupAddress", "city", e.target.value),
484
+ placeholder: "San Francisco"
485
+ })]
486
+ }), /* @__PURE__ */ C("div", {
487
+ className: "space-y-2",
488
+ children: [/* @__PURE__ */ S(g, {
489
+ htmlFor: "pickupState",
490
+ children: "State"
491
+ }), /* @__PURE__ */ S(h, {
492
+ id: "pickupState",
493
+ value: U.pickupAddress.state,
494
+ onChange: (e) => Q("pickupAddress", "state", e.target.value),
495
+ placeholder: "CA"
496
+ })]
497
+ })]
498
+ }),
499
+ /* @__PURE__ */ C("div", {
500
+ className: "grid grid-cols-1 sm:grid-cols-2 gap-4",
501
+ children: [/* @__PURE__ */ C("div", {
502
+ className: "space-y-2",
503
+ children: [/* @__PURE__ */ S(g, {
504
+ htmlFor: "pickupPostal",
505
+ children: "Postal Code"
506
+ }), /* @__PURE__ */ S(h, {
507
+ id: "pickupPostal",
508
+ value: U.pickupAddress.postalCode,
509
+ onChange: (e) => Q("pickupAddress", "postalCode", e.target.value),
510
+ placeholder: "94103"
511
+ })]
512
+ }), /* @__PURE__ */ C("div", {
513
+ className: "space-y-2",
514
+ children: [/* @__PURE__ */ S(g, {
515
+ htmlFor: "pickupCountry",
516
+ children: "Country"
517
+ }), /* @__PURE__ */ S(h, {
518
+ id: "pickupCountry",
519
+ value: U.pickupAddress.country,
520
+ onChange: (e) => Q("pickupAddress", "country", e.target.value),
521
+ placeholder: "USA"
522
+ })]
523
+ })]
524
+ })
525
+ ]
526
+ })
527
+ })]
528
+ }),
529
+ /* @__PURE__ */ S("div", {
530
+ className: "hidden items-center justify-center lg:flex",
531
+ "aria-hidden": "true",
532
+ children: /* @__PURE__ */ S(t, {
533
+ size: 18,
534
+ className: "text-text-muted"
535
+ })
536
+ }),
537
+ /* @__PURE__ */ C(u, {
538
+ className: "border-border-seam shadow-none",
539
+ children: [/* @__PURE__ */ C(p, { children: [/* @__PURE__ */ C(m, {
540
+ className: "flex items-center gap-2 text-base",
541
+ children: [
542
+ /* @__PURE__ */ S(r, {
543
+ size: 17,
544
+ className: "text-text-secondary",
545
+ "aria-hidden": "true"
546
+ }),
547
+ "Delivery address ",
548
+ /* @__PURE__ */ S("span", {
549
+ className: "text-status-error-text",
550
+ children: "*"
551
+ })
552
+ ]
553
+ }), /* @__PURE__ */ S(f, { children: "Where the shipment is delivered." })] }), /* @__PURE__ */ S(d, {
554
+ className: "space-y-4",
555
+ children: /* @__PURE__ */ C("fieldset", {
556
+ className: "space-y-4",
557
+ children: [
558
+ /* @__PURE__ */ S("legend", {
559
+ className: "sr-only",
560
+ children: "Delivery address details"
561
+ }),
562
+ /* @__PURE__ */ C("div", {
563
+ className: "space-y-2",
564
+ children: [/* @__PURE__ */ C(g, {
565
+ htmlFor: "deliveryStreet",
566
+ children: ["Street address ", /* @__PURE__ */ S("span", {
567
+ className: "text-status-error-text",
568
+ children: "*"
569
+ })]
570
+ }), /* @__PURE__ */ S(h, {
571
+ id: "deliveryStreet",
572
+ value: U.deliveryAddress.street,
573
+ onChange: (e) => Q("deliveryAddress", "street", e.target.value),
574
+ placeholder: "456 Oak Ave",
575
+ "aria-required": "true"
576
+ })]
577
+ }),
578
+ /* @__PURE__ */ C("div", {
579
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
580
+ children: [/* @__PURE__ */ C("div", {
581
+ className: "space-y-2",
582
+ children: [/* @__PURE__ */ S(g, {
583
+ htmlFor: "deliveryCity",
584
+ children: "City"
585
+ }), /* @__PURE__ */ S(h, {
586
+ id: "deliveryCity",
587
+ value: U.deliveryAddress.city,
588
+ onChange: (e) => Q("deliveryAddress", "city", e.target.value),
589
+ placeholder: "Los Angeles"
590
+ })]
591
+ }), /* @__PURE__ */ C("div", {
592
+ className: "space-y-2",
593
+ children: [/* @__PURE__ */ S(g, {
594
+ htmlFor: "deliveryState",
595
+ children: "State"
596
+ }), /* @__PURE__ */ S(h, {
597
+ id: "deliveryState",
598
+ value: U.deliveryAddress.state,
599
+ onChange: (e) => Q("deliveryAddress", "state", e.target.value),
600
+ placeholder: "CA"
601
+ })]
602
+ })]
603
+ }),
604
+ /* @__PURE__ */ C("div", {
605
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2",
606
+ children: [/* @__PURE__ */ C("div", {
607
+ className: "space-y-2",
608
+ children: [/* @__PURE__ */ S(g, {
609
+ htmlFor: "deliveryPostal",
610
+ children: "Postal code"
611
+ }), /* @__PURE__ */ S(h, {
612
+ id: "deliveryPostal",
613
+ value: U.deliveryAddress.postalCode,
614
+ onChange: (e) => Q("deliveryAddress", "postalCode", e.target.value),
615
+ placeholder: "90210"
616
+ })]
617
+ }), /* @__PURE__ */ C("div", {
618
+ className: "space-y-2",
619
+ children: [/* @__PURE__ */ S(g, {
620
+ htmlFor: "deliveryCountry",
621
+ children: "Country"
622
+ }), /* @__PURE__ */ S(h, {
623
+ id: "deliveryCountry",
624
+ value: U.deliveryAddress.country,
625
+ onChange: (e) => Q("deliveryAddress", "country", e.target.value),
626
+ placeholder: "USA"
627
+ })]
628
+ })]
629
+ })
630
+ ]
631
+ })
632
+ })]
633
+ })
634
+ ]
486
635
  })
487
636
  ]
488
- })] })]
489
- }),
490
- /* @__PURE__ */ S(d, { children: [/* @__PURE__ */ S(p, {
491
- className: "flex flex-row items-center justify-between",
492
- children: [/* @__PURE__ */ x(m, { children: "Order Items" }), /* @__PURE__ */ S(u, {
493
- type: "button",
494
- variant: "outline",
495
- size: "sm",
496
- onClick: $,
497
- children: [/* @__PURE__ */ x(i, { size: 16 }), "Add Item"]
498
- })]
499
- }), /* @__PURE__ */ x(f, { children: U.items.length === 0 ? /* @__PURE__ */ x(fe, {
500
- illustration: "empty-files",
501
- title: "No items added yet",
502
- description: "Add the products this order will ship — each with a name, SKU, quantity and value.",
503
- action: /* @__PURE__ */ S(u, {
504
- type: "button",
505
- variant: "outline",
506
- onClick: $,
507
- children: [/* @__PURE__ */ x(i, {
508
- size: 16,
509
- className: "mr-1.5"
510
- }), "Add your first item"]
511
637
  })
512
- }) : /* @__PURE__ */ S("div", {
513
- className: "space-y-4",
514
- children: [/* @__PURE__ */ S("div", {
515
- className: "space-y-2",
516
- children: [
517
- /* @__PURE__ */ x(g, {
518
- htmlFor: "item-product-search",
519
- children: "Search product catalog"
520
- }),
521
- /* @__PURE__ */ x(h, {
522
- id: "item-product-search",
523
- value: z,
524
- onChange: (e) => Me(e.target.value),
525
- placeholder: "Search by name or SKU"
526
- }),
527
- /* @__PURE__ */ x("p", {
528
- className: "text-xs text-text-secondary",
529
- children: "Narrows the \"Catalog item\" picker below for every row. Picking a catalog item fills in name, SKU, weight, and value — you can still edit them, or skip the picker and enter details manually."
530
- })
531
- ]
532
- }), U.items.map((e, t) => /* @__PURE__ */ x(_e, {
533
- item: e,
534
- index: t,
535
- isFirst: t === 0,
536
- products: Ne,
537
- productsLoading: Pe,
538
- onUpdate: Ve,
539
- onRemove: Be
540
- }, e.id))]
541
- }) })] }),
542
- /* @__PURE__ */ S(d, { children: [/* @__PURE__ */ x(p, { children: /* @__PURE__ */ x(m, { children: "Scheduling & Handling" }) }), /* @__PURE__ */ x(f, { children: /* @__PURE__ */ S("div", {
543
- className: "grid grid-cols-1 md:grid-cols-3 gap-6",
544
- children: [/* @__PURE__ */ S("div", {
545
- className: "space-y-2",
546
- children: [
547
- /* @__PURE__ */ S(g, {
548
- htmlFor: "scheduledDelivery",
549
- className: "flex items-center gap-1.5",
550
- children: [/* @__PURE__ */ x(t, {
551
- size: 14,
552
- className: "text-text-secondary"
553
- }), "Scheduled Delivery"]
554
- }),
555
- /* @__PURE__ */ x(h, {
556
- id: "scheduledDelivery",
557
- type: "datetime-local",
558
- value: U.scheduledDelivery,
559
- onChange: (e) => Z("scheduledDelivery", e.target.value)
560
- }),
561
- /* @__PURE__ */ x("p", {
562
- className: "text-xs text-text-secondary",
563
- children: "The delivery window promised to the customer. Leave blank to dispatch as soon as a driver is free."
638
+ }),
639
+ /* @__PURE__ */ S("div", {
640
+ id: "items-section",
641
+ children: /* @__PURE__ */ S(w, {
642
+ title: /* @__PURE__ */ C("span", {
643
+ className: "flex items-center gap-2",
644
+ children: [
645
+ /* @__PURE__ */ S(i, {
646
+ size: 18,
647
+ "aria-hidden": "true"
648
+ }),
649
+ "Shipment contents ",
650
+ /* @__PURE__ */ S(c, {
651
+ variant: "secondary",
652
+ children: U.items.length
653
+ })
654
+ ]
655
+ }),
656
+ description: "Add each item being shipped. Use the catalog to prefill details or enter a one-off item manually.",
657
+ actions: /* @__PURE__ */ C(l, {
658
+ type: "button",
659
+ variant: "outline",
660
+ size: "sm",
661
+ onClick: $,
662
+ children: [/* @__PURE__ */ S(a, { size: 16 }), "Add item"]
663
+ }),
664
+ children: U.items.length === 0 ? /* @__PURE__ */ S(ge, {
665
+ illustration: "empty-files",
666
+ title: "No items added yet",
667
+ description: "Add the products this order will ship — each with a name, SKU, quantity and value.",
668
+ action: /* @__PURE__ */ C(l, {
669
+ type: "button",
670
+ variant: "outline",
671
+ onClick: $,
672
+ children: [/* @__PURE__ */ S(a, {
673
+ size: 16,
674
+ className: "mr-1.5"
675
+ }), "Add your first item"]
564
676
  })
565
- ]
566
- }), /* @__PURE__ */ S("div", {
567
- className: "md:col-span-2 space-y-2",
568
- children: [/* @__PURE__ */ x(g, {
569
- htmlFor: "specialInstructions",
570
- children: "Special Instructions"
571
- }), /* @__PURE__ */ x(de, {
572
- id: "specialInstructions",
573
- value: U.specialInstructions,
574
- onChange: (e) => Z("specialInstructions", e.target.value),
575
- placeholder: "Any special handling or delivery instructions...",
576
- rows: 4
677
+ }) : /* @__PURE__ */ C("div", {
678
+ className: "space-y-4",
679
+ children: [/* @__PURE__ */ C("div", {
680
+ className: "rounded-card border border-border-subtle bg-bg-sunken/40 p-4",
681
+ children: [
682
+ /* @__PURE__ */ S(g, {
683
+ htmlFor: "item-product-search",
684
+ children: "Search product catalog"
685
+ }),
686
+ /* @__PURE__ */ S(h, {
687
+ id: "item-product-search",
688
+ value: z,
689
+ onChange: (e) => Ie(e.target.value),
690
+ placeholder: "Search by name or SKU",
691
+ className: "mt-2"
692
+ }),
693
+ /* @__PURE__ */ S("p", {
694
+ className: "mt-2 text-xs text-text-secondary",
695
+ children: "This filters the catalog picker for every item below. You can still edit any autofilled value or enter item details manually."
696
+ })
697
+ ]
698
+ }), /* @__PURE__ */ S("ol", {
699
+ className: "space-y-4",
700
+ "aria-label": "Shipment items",
701
+ children: U.items.map((e, t) => /* @__PURE__ */ S("li", { children: /* @__PURE__ */ S(y, {
702
+ item: e,
703
+ index: t,
704
+ products: Le,
705
+ productsLoading: Re,
706
+ onUpdate: Ge,
707
+ onRemove: We
708
+ }) }, e.id))
709
+ })]
710
+ })
711
+ })
712
+ }),
713
+ /* @__PURE__ */ S(w, {
714
+ title: /* @__PURE__ */ C("span", {
715
+ className: "flex items-center gap-2",
716
+ children: [/* @__PURE__ */ S(n, {
717
+ size: 18,
718
+ "aria-hidden": "true"
719
+ }), "Timing & handling"]
720
+ }),
721
+ description: "Optional delivery timing and instructions for the carrier.",
722
+ children: /* @__PURE__ */ C("div", {
723
+ className: "grid grid-cols-1 gap-6 lg:grid-cols-3",
724
+ children: [/* @__PURE__ */ C("div", {
725
+ className: "space-y-2",
726
+ children: [
727
+ /* @__PURE__ */ S(g, {
728
+ htmlFor: "scheduledDelivery",
729
+ children: "Scheduled delivery"
730
+ }),
731
+ /* @__PURE__ */ S(h, {
732
+ id: "scheduledDelivery",
733
+ type: "datetime-local",
734
+ value: U.scheduledDelivery,
735
+ onChange: (e) => Z("scheduledDelivery", e.target.value)
736
+ }),
737
+ /* @__PURE__ */ S("p", {
738
+ className: "text-xs text-text-secondary",
739
+ children: "Leave blank to dispatch as soon as a driver is available."
740
+ })
741
+ ]
742
+ }), /* @__PURE__ */ C("div", {
743
+ className: "space-y-2 lg:col-span-2",
744
+ children: [/* @__PURE__ */ S(g, {
745
+ htmlFor: "specialInstructions",
746
+ children: "Special instructions"
747
+ }), /* @__PURE__ */ S(he, {
748
+ id: "specialInstructions",
749
+ value: U.specialInstructions,
750
+ onChange: (e) => Z("specialInstructions", e.target.value),
751
+ placeholder: "Any special handling or delivery instructions...",
752
+ rows: 4
753
+ })]
577
754
  })]
578
- })]
579
- }) })] })
755
+ })
756
+ })
580
757
  ]
581
758
  })
582
759
  ]
583
760
  });
584
761
  }
585
762
  //#endregion
586
- export { w as default };
763
+ export { E as default };