@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,124 +1,210 @@
1
1
  import { Trash2 as e } from "../node_modules/lucide-react/dist/esm/icons/trash-2.js";
2
2
  import { useProduct as t, useProductStockLevels as n } from "../hooks/useInventory.js";
3
- import { Button as r, Input as i, Label as a, Separator as o } from "./ui.js";
4
- import { EntityCombobox as s } from "./EntityCombobox.js";
5
- import { Fragment as c, jsx as l, jsxs as u } from "react/jsx-runtime";
3
+ import { Button as r, Input as i, Label as a } from "./ui.js";
4
+ import { EntityCombobox as o } from "./EntityCombobox.js";
5
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
6
6
  //#region src/movethewheels/components/OrderItemRow.tsx
7
- function d(e, t) {
7
+ function u(e, t) {
8
8
  return e <= 0 ? "No stock recorded for this item." : t.length === 1 ? `${e.toLocaleString()} available at ${t[0].warehouseName}` : `${e.toLocaleString()} available across ${t.length} warehouses`;
9
9
  }
10
- function f({ item: f, index: p, isFirst: m, products: h, productsLoading: g, onUpdate: _, onRemove: v }) {
11
- let { product: y, isLoading: b } = t(f.productId || void 0), { levels: x, totalAvailable: S, isLoading: C } = n(f.productId || void 0);
12
- return /* @__PURE__ */ u("div", { children: [
13
- !m && /* @__PURE__ */ l(o, { className: "my-4" }),
14
- /* @__PURE__ */ u("div", {
15
- className: "mb-3 space-y-2",
10
+ function d({ item: d, index: f, products: p, productsLoading: m, onUpdate: h, onRemove: g }) {
11
+ let { product: _, isLoading: v } = t(d.productId || void 0), { levels: y, totalAvailable: b, isLoading: x } = n(d.productId || void 0), S = d.dimensions ?? {
12
+ length: 0,
13
+ width: 0,
14
+ height: 0,
15
+ unit: "cm"
16
+ }, C = (e) => {
17
+ if (!e) {
18
+ h(f, "productId", "");
19
+ return;
20
+ }
21
+ let t = p.find((t) => t.id === e);
22
+ t && (h(f, "productId", t.id), h(f, "name", t.name), h(f, "sku", t.sku), h(f, "weight", t.weight), h(f, "value", t.value), h(f, "dimensions", t.dimensions));
23
+ }, w = (e, t) => {
24
+ h(f, "dimensions", {
25
+ ...S,
26
+ [e]: Number.parseFloat(t) || 0
27
+ });
28
+ };
29
+ return /* @__PURE__ */ l("div", {
30
+ className: "rounded-card border border-border-subtle bg-bg-surface p-4 shadow-elevation-1 sm:p-5",
31
+ "aria-labelledby": `order-item-${d.id}-title`,
32
+ children: [/* @__PURE__ */ l("div", {
33
+ className: "mb-4 flex items-start justify-between gap-4",
34
+ children: [/* @__PURE__ */ l("div", { children: [/* @__PURE__ */ l("h3", {
35
+ id: `order-item-${d.id}-title`,
36
+ className: "text-sm font-semibold text-text-primary",
37
+ children: ["Item ", f + 1]
38
+ }), /* @__PURE__ */ c("p", {
39
+ className: "mt-1 text-xs text-text-secondary",
40
+ children: "Select a catalog item to prefill details, or enter a one-off shipment manually."
41
+ })] }), /* @__PURE__ */ c(r, {
42
+ type: "button",
43
+ variant: "ghost",
44
+ size: "icon",
45
+ className: "shrink-0 text-status-error-text",
46
+ onClick: () => g(f),
47
+ "aria-label": `Remove item ${f + 1}`,
48
+ title: `Remove item ${f + 1}`,
49
+ children: /* @__PURE__ */ c(e, {
50
+ size: 16,
51
+ "aria-hidden": "true"
52
+ })
53
+ })]
54
+ }), /* @__PURE__ */ l("div", {
55
+ className: "space-y-4",
16
56
  children: [
17
- /* @__PURE__ */ l(a, {
18
- htmlFor: `item-product-${f.id}`,
19
- children: "Catalog item (optional)"
57
+ /* @__PURE__ */ l("div", {
58
+ className: "rounded-card border border-border-subtle bg-bg-sunken/40 p-3 sm:p-4",
59
+ children: [
60
+ /* @__PURE__ */ c(a, {
61
+ htmlFor: `item-product-${d.id}`,
62
+ children: "Catalog item (optional)"
63
+ }),
64
+ /* @__PURE__ */ c(o, {
65
+ id: `item-product-${d.id}`,
66
+ value: d.productId,
67
+ onChange: C,
68
+ options: p,
69
+ loading: m,
70
+ getId: (e) => e.id,
71
+ getLabel: (e) => `${e.name} (${e.sku})`,
72
+ renderOption: (e) => /* @__PURE__ */ l(s, { children: [
73
+ e.name,
74
+ " ",
75
+ /* @__PURE__ */ l("span", {
76
+ className: "text-text-tertiary",
77
+ children: [
78
+ "(",
79
+ e.sku,
80
+ ")"
81
+ ]
82
+ })
83
+ ] }),
84
+ selectedOption: _,
85
+ selectedLoading: v,
86
+ placeholder: "Pick from your product catalog",
87
+ emptyText: "No products found.",
88
+ noneLabel: "Enter details manually"
89
+ }),
90
+ d.productId && !x && /* @__PURE__ */ c("p", {
91
+ className: "mt-2 text-xs text-text-secondary",
92
+ role: "status",
93
+ children: u(b, y)
94
+ })
95
+ ]
20
96
  }),
21
- /* @__PURE__ */ l(s, {
22
- id: `item-product-${f.id}`,
23
- value: f.productId,
24
- onChange: (e) => {
25
- if (!e) {
26
- _(p, "productId", "");
27
- return;
28
- }
29
- let t = h.find((t) => t.id === e);
30
- t && (_(p, "productId", t.id), _(p, "name", t.name), _(p, "sku", t.sku), _(p, "weight", t.weight), _(p, "value", t.value), _(p, "dimensions", t.dimensions));
31
- },
32
- options: h,
33
- loading: g,
34
- getId: (e) => e.id,
35
- getLabel: (e) => `${e.name} (${e.sku})`,
36
- renderOption: (e) => /* @__PURE__ */ u(c, { children: [
37
- e.name,
38
- " ",
39
- /* @__PURE__ */ u("span", {
40
- className: "text-text-tertiary",
97
+ /* @__PURE__ */ l("div", {
98
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-12",
99
+ children: [
100
+ /* @__PURE__ */ l("div", {
101
+ className: "space-y-2 lg:col-span-4",
102
+ children: [/* @__PURE__ */ c(a, {
103
+ htmlFor: `item-name-${d.id}`,
104
+ children: "Item name"
105
+ }), /* @__PURE__ */ c(i, {
106
+ id: `item-name-${d.id}`,
107
+ value: d.name,
108
+ onChange: (e) => h(f, "name", e.target.value),
109
+ placeholder: "Product name"
110
+ })]
111
+ }),
112
+ /* @__PURE__ */ l("div", {
113
+ className: "space-y-2 lg:col-span-3",
114
+ children: [/* @__PURE__ */ c(a, {
115
+ htmlFor: `item-sku-${d.id}`,
116
+ children: "SKU"
117
+ }), /* @__PURE__ */ c(i, {
118
+ id: `item-sku-${d.id}`,
119
+ value: d.sku,
120
+ onChange: (e) => h(f, "sku", e.target.value),
121
+ placeholder: "SKU-001"
122
+ })]
123
+ }),
124
+ /* @__PURE__ */ l("div", {
125
+ className: "space-y-2 lg:col-span-2",
126
+ children: [/* @__PURE__ */ c(a, {
127
+ htmlFor: `item-quantity-${d.id}`,
128
+ children: "Quantity"
129
+ }), /* @__PURE__ */ c(i, {
130
+ id: `item-quantity-${d.id}`,
131
+ type: "number",
132
+ min: "1",
133
+ value: d.quantity,
134
+ onChange: (e) => h(f, "quantity", parseInt(e.target.value, 10) || 1)
135
+ })]
136
+ }),
137
+ /* @__PURE__ */ l("div", {
138
+ className: "space-y-2 lg:col-span-2",
139
+ children: [/* @__PURE__ */ c(a, {
140
+ htmlFor: `item-weight-${d.id}`,
141
+ children: "Weight (kg)"
142
+ }), /* @__PURE__ */ c(i, {
143
+ id: `item-weight-${d.id}`,
144
+ type: "number",
145
+ min: "0",
146
+ step: "0.1",
147
+ value: d.weight,
148
+ onChange: (e) => h(f, "weight", parseFloat(e.target.value) || 0)
149
+ })]
150
+ }),
151
+ /* @__PURE__ */ l("div", {
152
+ className: "space-y-2 lg:col-span-1",
153
+ children: [/* @__PURE__ */ c(a, {
154
+ htmlFor: `item-value-${d.id}`,
155
+ children: "Value ($)"
156
+ }), /* @__PURE__ */ c(i, {
157
+ id: `item-value-${d.id}`,
158
+ type: "number",
159
+ min: "0",
160
+ step: "0.01",
161
+ value: d.value,
162
+ onChange: (e) => h(f, "value", parseFloat(e.target.value) || 0)
163
+ })]
164
+ })
165
+ ]
166
+ }),
167
+ /* @__PURE__ */ l("fieldset", {
168
+ className: "rounded-card border border-border-subtle bg-bg-sunken/40 p-3 sm:p-4",
169
+ children: [
170
+ /* @__PURE__ */ l("legend", {
171
+ className: "px-1 text-xs font-medium text-text-secondary",
41
172
  children: [
42
- "(",
43
- e.sku,
173
+ "Dimensions (",
174
+ S.unit,
44
175
  ")"
45
176
  ]
177
+ }),
178
+ /* @__PURE__ */ c("div", {
179
+ className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
180
+ children: [
181
+ "length",
182
+ "width",
183
+ "height"
184
+ ].map((e) => /* @__PURE__ */ l("div", {
185
+ className: "space-y-2",
186
+ children: [/* @__PURE__ */ c(a, {
187
+ htmlFor: `item-${e}-${d.id}`,
188
+ children: e.charAt(0).toUpperCase() + e.slice(1)
189
+ }), /* @__PURE__ */ c(i, {
190
+ id: `item-${e}-${d.id}`,
191
+ type: "number",
192
+ min: "0",
193
+ step: "0.1",
194
+ value: S[e],
195
+ onChange: (t) => w(e, t.target.value)
196
+ })]
197
+ }, e))
198
+ }),
199
+ /* @__PURE__ */ c("p", {
200
+ className: "mt-2 text-xs text-text-secondary",
201
+ children: "Catalog selections prefill these measurements, and you can adjust them for this order."
46
202
  })
47
- ] }),
48
- selectedOption: y,
49
- selectedLoading: b,
50
- placeholder: "Pick from your product catalog",
51
- emptyText: "No products found.",
52
- noneLabel: "Enter details manually"
53
- }),
54
- f.productId && !C && /* @__PURE__ */ l("p", {
55
- className: "text-xs text-text-secondary",
56
- children: d(S, x)
57
- })
58
- ]
59
- }),
60
- /* @__PURE__ */ u("div", {
61
- className: "grid grid-cols-1 gap-4 md:grid-cols-7",
62
- children: [
63
- /* @__PURE__ */ u("div", {
64
- className: "space-y-2 md:col-span-2",
65
- children: [/* @__PURE__ */ l(a, { children: "Item Name" }), /* @__PURE__ */ l(i, {
66
- value: f.name,
67
- onChange: (e) => _(p, "name", e.target.value),
68
- placeholder: "Product name"
69
- })]
70
- }),
71
- /* @__PURE__ */ u("div", {
72
- className: "space-y-2",
73
- children: [/* @__PURE__ */ l(a, { children: "SKU" }), /* @__PURE__ */ l(i, {
74
- value: f.sku,
75
- onChange: (e) => _(p, "sku", e.target.value),
76
- placeholder: "SKU-001"
77
- })]
78
- }),
79
- /* @__PURE__ */ u("div", {
80
- className: "space-y-2",
81
- children: [/* @__PURE__ */ l(a, { children: "Quantity" }), /* @__PURE__ */ l(i, {
82
- type: "number",
83
- min: "1",
84
- value: f.quantity,
85
- onChange: (e) => _(p, "quantity", parseInt(e.target.value) || 1)
86
- })]
87
- }),
88
- /* @__PURE__ */ u("div", {
89
- className: "space-y-2",
90
- children: [/* @__PURE__ */ l(a, { children: "Weight (kg)" }), /* @__PURE__ */ l(i, {
91
- type: "number",
92
- min: "0",
93
- step: "0.1",
94
- value: f.weight,
95
- onChange: (e) => _(p, "weight", parseFloat(e.target.value) || 0)
96
- })]
97
- }),
98
- /* @__PURE__ */ u("div", {
99
- className: "space-y-2",
100
- children: [/* @__PURE__ */ l(a, { children: "Value ($)" }), /* @__PURE__ */ l(i, {
101
- type: "number",
102
- min: "0",
103
- step: "0.01",
104
- value: f.value,
105
- onChange: (e) => _(p, "value", parseFloat(e.target.value) || 0)
106
- })]
107
- }),
108
- /* @__PURE__ */ l("div", {
109
- className: "flex items-end",
110
- children: /* @__PURE__ */ l(r, {
111
- type: "button",
112
- variant: "ghost",
113
- size: "icon",
114
- className: "text-status-error-text",
115
- onClick: () => v(p),
116
- children: /* @__PURE__ */ l(e, { size: 16 })
117
- })
203
+ ]
118
204
  })
119
205
  ]
120
- })
121
- ] });
206
+ })]
207
+ });
122
208
  }
123
209
  //#endregion
124
- export { f as OrderItemRow };
210
+ export { d as OrderItemRow };
@@ -26,6 +26,7 @@ var e = {
26
26
  in_transit: r,
27
27
  out_for_delivery: t,
28
28
  delivered: e,
29
+ returned: t,
29
30
  cancelled: n,
30
31
  failed: n
31
32
  }, o = {
@@ -873,10 +873,15 @@ export type GetMovethewheelsDashboardQuery = {
873
873
  __typename?: 'MtwDeliveryJobStats';
874
874
  total: number;
875
875
  pending: number;
876
+ confirmed: number;
877
+ assigned: number;
878
+ pickedUp: number;
876
879
  inTransit: number;
880
+ outForDelivery: number;
877
881
  delivered: number;
878
882
  cancelled: number;
879
883
  failed: number;
884
+ returned: number;
880
885
  };
881
886
  fleetStats: {
882
887
  __typename?: 'MtwFleetStats';
@@ -1386,6 +1391,7 @@ export type GetShipmentQuery = {
1386
1391
  };
1387
1392
  export type GetDeliveryJobTrackingQueryVariables = Types.Exact<{
1388
1393
  deliveryJobId: Types.Scalars['ID']['input'];
1394
+ pagination?: Types.InputMaybe<Types.PaginationInput>;
1389
1395
  }>;
1390
1396
  export type GetDeliveryJobTrackingQuery = {
1391
1397
  __typename?: 'Query';
@@ -2943,6 +2949,7 @@ export declare const GetDeliveryJobTrackingDocument: Apollo.DocumentNode;
2943
2949
  * const { data, loading, error } = useGetDeliveryJobTrackingQuery({
2944
2950
  * variables: {
2945
2951
  * deliveryJobId: // value for 'deliveryJobId'
2952
+ * pagination: // value for 'pagination'
2946
2953
  * },
2947
2954
  * });
2948
2955
  */
@@ -16,7 +16,7 @@ var s = "\n id\n deliveryJobNumber\n customerId\n status\n priority\n pick
16
16
  ${s}
17
17
  }
18
18
  }
19
- `, u = "\n query GetDeliveryJobStatsBundle {\n deliveryJobStats {\n total\n pending\n inTransit\n delivered\n cancelled\n failed\n }\n financeMetrics {\n revenue {\n totalRevenue\n averageOrderValue\n }\n }\n }\n", d = `
19
+ `, u = "\n query GetDeliveryJobStatsBundle {\n deliveryJobStats {\n total\n pending\n confirmed\n assigned\n inTransit\n outForDelivery\n delivered\n cancelled\n failed\n returned\n }\n financeMetrics {\n revenue {\n totalRevenue\n averageOrderValue\n }\n }\n }\n", d = `
20
20
  mutation CreateDeliveryJob($input: CreateDeliveryJobInput!) {
21
21
  createDeliveryJob(input: $input) {
22
22
  ${s}
@@ -44,6 +44,7 @@ function h(e) {
44
44
  case "IN_TRANSIT": return "in_transit";
45
45
  case "OUT_FOR_DELIVERY": return "out_for_delivery";
46
46
  case "DELIVERED": return "delivered";
47
+ case "RETURNED": return "returned";
47
48
  case "CANCELLED": return "cancelled";
48
49
  default: return "failed";
49
50
  }
@@ -66,6 +67,7 @@ function _(e) {
66
67
  case "in_transit": return "IN_TRANSIT";
67
68
  case "out_for_delivery": return "OUT_FOR_DELIVERY";
68
69
  case "delivered": return "DELIVERED";
70
+ case "returned": return "RETURNED";
69
71
  case "cancelled": return "CANCELLED";
70
72
  default: return "FAILED";
71
73
  }
@@ -301,6 +303,7 @@ function C() {
301
303
  in_transit: 0,
302
304
  out_for_delivery: 0,
303
305
  delivered: 0,
306
+ returned: 0,
304
307
  cancelled: 0,
305
308
  failed: 0
306
309
  },
@@ -329,12 +332,13 @@ function C() {
329
332
  total: e.deliveryJobStats.total,
330
333
  byStatus: {
331
334
  pending: e.deliveryJobStats.pending,
332
- confirmed: 0,
333
- assigned: 0,
335
+ confirmed: e.deliveryJobStats.confirmed,
336
+ assigned: e.deliveryJobStats.assigned,
334
337
  picked_up: 0,
335
338
  in_transit: e.deliveryJobStats.inTransit,
336
- out_for_delivery: 0,
339
+ out_for_delivery: e.deliveryJobStats.outForDelivery,
337
340
  delivered: e.deliveryJobStats.delivered,
341
+ returned: e.deliveryJobStats.returned,
338
342
  cancelled: e.deliveryJobStats.cancelled,
339
343
  failed: e.deliveryJobStats.failed
340
344
  },