@burdenoff/microfe-movethewheels 2026.822.1 → 2026.828.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 (71) hide show
  1. package/dist/generated/wspace-operations.d.ts +168 -912
  2. package/dist/generated/wspace-types.d.ts +78432 -35831
  3. package/dist/hooks/useFleet.js +142 -74
  4. package/dist/hooks/useImportExport.js +22 -51
  5. package/dist/hooks/useInventory.js +163 -70
  6. package/dist/hooks/useOrders.js +2 -2
  7. package/dist/hooks/useReports.js +63 -73
  8. package/dist/hooks/useSettings.js +52 -44
  9. package/dist/hooks/useTracking.js +5 -5
  10. package/dist/index.js +33 -33
  11. package/dist/movethewheels/hooks/index.d.ts +2 -2
  12. package/dist/movethewheels/hooks/useFleet.d.ts +32 -1
  13. package/dist/movethewheels/hooks/useImportExport.d.ts +10 -0
  14. package/dist/movethewheels/hooks/useInventory.d.ts +67 -12
  15. package/dist/movethewheels/hooks/useOrders.d.ts +25 -2
  16. package/dist/movethewheels/pages/MarketplacePage.d.ts +7 -4
  17. package/dist/movethewheels/types/index.d.ts +2 -0
  18. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down-right.js +11 -0
  19. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left-right.js +22 -0
  20. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up-right.js +11 -0
  21. package/dist/node_modules/lucide-react/dist/esm/icons/calendar-clock.js +32 -0
  22. package/dist/node_modules/lucide-react/dist/esm/icons/history.js +18 -0
  23. package/dist/node_modules/lucide-react/dist/esm/icons/lock.js +16 -0
  24. package/dist/node_modules/lucide-react/dist/esm/icons/user-round.js +13 -0
  25. package/dist/pages/CreateOrderPage.js +246 -195
  26. package/dist/pages/DeliveryCapturePage.js +91 -78
  27. package/dist/pages/DriversPage.js +202 -108
  28. package/dist/pages/InventoryPage.js +356 -131
  29. package/dist/pages/MarketplacePage.js +11 -432
  30. package/dist/pages/ProductDetailsPage.js +212 -156
  31. package/dist/pages/ReportsPage.js +120 -109
  32. package/dist/pages/VehicleDetailsPage.js +257 -193
  33. package/dist/utils/formatters.js +4 -1
  34. package/package.json +2 -2
  35. package/src/generated/wspace-operations.ts +134 -929
  36. package/src/generated/wspace-types.ts +91730 -40059
  37. package/src/movethewheels/hooks/index.ts +9 -0
  38. package/src/movethewheels/hooks/useFleet.ts +133 -3
  39. package/src/movethewheels/hooks/useImportExport.ts +36 -72
  40. package/src/movethewheels/hooks/useInventory.ts +311 -53
  41. package/src/movethewheels/hooks/useOrders.ts +31 -7
  42. package/src/movethewheels/hooks/useReports.ts +73 -87
  43. package/src/movethewheels/hooks/useSettings.ts +50 -53
  44. package/src/movethewheels/hooks/useTracking.ts +14 -14
  45. package/src/movethewheels/pages/CreateOrderPage.tsx +67 -10
  46. package/src/movethewheels/pages/DeliveryCapturePage.tsx +8 -0
  47. package/src/movethewheels/pages/DriversPage.tsx +181 -31
  48. package/src/movethewheels/pages/InventoryPage.tsx +299 -19
  49. package/src/movethewheels/pages/MarketplacePage.tsx +16 -539
  50. package/src/movethewheels/pages/ProductDetailsPage.tsx +68 -3
  51. package/src/movethewheels/pages/ReportsPage.tsx +23 -0
  52. package/src/movethewheels/pages/VehicleDetailsPage.tsx +86 -27
  53. package/src/movethewheels/types/index.ts +2 -0
  54. package/src/operations/wspace/movethewheels/fragments/core.graphql +23 -53
  55. package/src/operations/wspace/movethewheels/fragments/core.withdrawn.graphql +59 -0
  56. package/src/operations/wspace/movethewheels/mutations/entities.graphql +5 -5
  57. package/src/operations/wspace/movethewheels/mutations/marketplace-reports.graphql +18 -78
  58. package/src/operations/wspace/movethewheels/mutations/marketplace-reports.withdrawn.graphql +93 -0
  59. package/src/operations/wspace/movethewheels/mutations/orders.graphql +7 -7
  60. package/src/operations/wspace/movethewheels/queries/dashboard.graphql +3 -3
  61. package/src/operations/wspace/movethewheels/queries/entities.graphql +3 -3
  62. package/src/operations/wspace/movethewheels/queries/logistics.graphql +3 -3
  63. package/src/operations/wspace/movethewheels/queries/marketplace-reports.withdrawn.graphql +58 -0
  64. package/src/operations/wspace/movethewheels/queries/orders.graphql +3 -3
  65. package/dist/generated/global-operations.d.ts +0 -1
  66. package/dist/generated/global-types.d.ts +0 -23526
  67. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-down.js +0 -8
  68. package/dist/node_modules/lucide-react/dist/esm/icons/chevron-up.js +0 -8
  69. package/src/generated/global-operations.ts +0 -2
  70. package/src/generated/global-types.ts +0 -27259
  71. package/src/operations/wspace/movethewheels/queries/marketplace-reports.graphql +0 -40
@@ -5,52 +5,53 @@ import { Package as r } from "../node_modules/lucide-react/dist/esm/icons/packag
5
5
  import { Save as i } from "../node_modules/lucide-react/dist/esm/icons/save.js";
6
6
  import { SquarePen as a } from "../node_modules/lucide-react/dist/esm/icons/square-pen.js";
7
7
  import { Tag as o } from "../node_modules/lucide-react/dist/esm/icons/tag.js";
8
- import { joinPath as s } from "../utils/navigation.js";
9
- import { useMoveTheWheels as c } from "../providers/MoveTheWheelsProvider.js";
10
- import { useInventory as l, useProduct as u } from "../hooks/useInventory.js";
11
- import { Badge as d, Button as f, Card as p, CardContent as m, CardHeader as h, CardTitle as g, Input as _, Label as v } from "../components/ui.js";
12
- import { ErrorState as y, LoadingState as b, PageLayout as x } from "../components/PageLayout.js";
13
- import { FormError as S } from "../components/FormError.js";
14
- import { formatCurrency as C } from "../utils/formatters.js";
15
- import { useEffect as w, useState as T } from "react";
16
- import { useLocation as E, useParams as D } from "react-router";
17
- import { jsx as O, jsxs as k } from "react/jsx-runtime";
18
- import { EmphasisPanel as A, NextSteps as j, PagePurpose as M } from "@burdenoff/fe-libs/ui";
8
+ import { Warehouse as s } from "../node_modules/lucide-react/dist/esm/icons/warehouse.js";
9
+ import { joinPath as c } from "../utils/navigation.js";
10
+ import { useMoveTheWheels as l } from "../providers/MoveTheWheelsProvider.js";
11
+ import { useInventory as u, useProduct as d, useProductStockLevels as f } from "../hooks/useInventory.js";
12
+ import { Badge as p, Button as m, Card as h, CardContent as g, CardHeader as _, CardTitle as v, Input as y, Label as b } from "../components/ui.js";
13
+ import { ErrorState as x, LoadingState as S, PageLayout as C } from "../components/PageLayout.js";
14
+ import { FormError as w } from "../components/FormError.js";
15
+ import { formatCurrency as T } from "../utils/formatters.js";
16
+ import { useEffect as E, useState as D } from "react";
17
+ import { useLocation as O, useParams as k } from "react-router";
18
+ import { Fragment as A, jsx as j, jsxs as M } from "react/jsx-runtime";
19
+ import { EmphasisPanel as N, NextSteps as P, PagePurpose as F } from "@burdenoff/fe-libs/ui";
19
20
  //#region src/movethewheels/pages/ProductDetailsPage.tsx
20
- function N({ editId: t }) {
21
- let { basePath: n, navigate: a } = c(), { createProduct: o, updateProduct: d } = l(), { product: p } = u(t), m = !!t, [h, g] = T({
21
+ function I({ editId: t }) {
22
+ let { basePath: n, navigate: a } = l(), { createProduct: o, updateProduct: s } = u(), { product: f } = d(t), p = !!t, [h, g] = D({
22
23
  name: "",
23
24
  sku: "",
24
25
  category: "",
25
26
  brand: "",
26
27
  weight: ""
27
- }), [y, b] = T(!1), [C, E] = T(null);
28
- w(() => {
29
- t && p && g({
30
- name: p.name ?? "",
31
- sku: p.sku ?? "",
32
- category: p.category ?? "",
33
- brand: p.brand ?? "",
34
- weight: p.weight == null ? "" : String(p.weight)
28
+ }), [_, v] = D(!1), [x, S] = D(null);
29
+ E(() => {
30
+ t && f && g({
31
+ name: f.name ?? "",
32
+ sku: f.sku ?? "",
33
+ category: f.category ?? "",
34
+ brand: f.brand ?? "",
35
+ weight: f.weight == null ? "" : String(f.weight)
35
36
  });
36
- }, [t, p]);
37
- let D = () => a?.(s(n, "inventory/products")), j = async (e) => {
37
+ }, [t, f]);
38
+ let T = () => a?.(c(n, "inventory/products")), O = async (e) => {
38
39
  if (e.preventDefault(), !h.name.trim() || !h.sku.trim()) {
39
- E("Product name and SKU are required.");
40
+ S("Product name and SKU are required.");
40
41
  return;
41
42
  }
42
- b(!0), E(null);
43
+ v(!0), S(null);
43
44
  try {
44
45
  let e = h.weight.trim() ? Number(h.weight) : void 0;
45
- if (m && t) {
46
- let r = await d(t, {
46
+ if (p && t) {
47
+ let r = await s(t, {
47
48
  name: h.name.trim(),
48
49
  sku: h.sku.trim(),
49
50
  category: h.category.trim() || void 0,
50
51
  brand: h.brand.trim() || void 0,
51
52
  weight: e !== void 0 && !Number.isNaN(e) ? e : void 0
52
53
  });
53
- a?.(s(n, `inventory/products/${r.id}`));
54
+ a?.(c(n, `inventory/products/${r.id}`));
54
55
  } else {
55
56
  let t = await o({
56
57
  name: h.name.trim(),
@@ -59,55 +60,55 @@ function N({ editId: t }) {
59
60
  brand: h.brand.trim() || void 0,
60
61
  weight: e !== void 0 && !Number.isNaN(e) ? e : void 0
61
62
  });
62
- a?.(s(n, `inventory/products/${t.id}`));
63
+ a?.(c(n, `inventory/products/${t.id}`));
63
64
  }
64
65
  } catch (e) {
65
- console.error("Failed to create product:", e), E(e instanceof Error ? e.message : "Failed to create product. Please try again."), b(!1);
66
+ console.error("Failed to create product:", e), S(e instanceof Error ? e.message : "Failed to create product. Please try again."), v(!1);
66
67
  }
67
68
  };
68
- return /* @__PURE__ */ k(x, {
69
- title: m ? "Edit Product" : "Add Product",
69
+ return /* @__PURE__ */ M(C, {
70
+ title: p ? "Edit Product" : "Add Product",
70
71
  subtitle: "Add an item to your catalog",
71
- icon: /* @__PURE__ */ O(r, { size: 24 }),
72
- headerActions: /* @__PURE__ */ k("div", {
72
+ icon: /* @__PURE__ */ j(r, { size: 24 }),
73
+ headerActions: /* @__PURE__ */ M("div", {
73
74
  className: "flex gap-2",
74
- children: [/* @__PURE__ */ k(f, {
75
+ children: [/* @__PURE__ */ M(m, {
75
76
  variant: "outline",
76
- onClick: D,
77
- disabled: y,
78
- children: [/* @__PURE__ */ O(e, { size: 16 }), " Cancel"]
79
- }), /* @__PURE__ */ k(f, {
80
- onClick: j,
81
- disabled: y,
77
+ onClick: T,
78
+ disabled: _,
79
+ children: [/* @__PURE__ */ j(e, { size: 16 }), " Cancel"]
80
+ }), /* @__PURE__ */ M(m, {
81
+ onClick: O,
82
+ disabled: _,
82
83
  children: [
83
- /* @__PURE__ */ O(i, { size: 16 }),
84
+ /* @__PURE__ */ j(i, { size: 16 }),
84
85
  " ",
85
- m ? y ? "Saving..." : "Save Changes" : y ? "Saving..." : "Add Product"
86
+ p ? _ ? "Saving..." : "Save Changes" : _ ? "Saving..." : "Add Product"
86
87
  ]
87
88
  })]
88
89
  }),
89
- children: [/* @__PURE__ */ O(M, {
90
- icon: /* @__PURE__ */ O(r, { size: 18 }),
90
+ children: [/* @__PURE__ */ j(F, {
91
+ icon: /* @__PURE__ */ j(r, { size: 18 }),
91
92
  children: "Add a product so it can be added to orders and stocked in warehouses. A name and SKU are all it takes to start — category, brand and weight help with picking, pricing and routing."
92
- }), /* @__PURE__ */ k("form", {
93
- onSubmit: j,
93
+ }), /* @__PURE__ */ M("form", {
94
+ onSubmit: O,
94
95
  className: "max-w-2xl space-y-6",
95
- children: [/* @__PURE__ */ O(S, { message: C }), /* @__PURE__ */ k(A, { children: [/* @__PURE__ */ O("h2", {
96
+ children: [/* @__PURE__ */ j(w, { message: x }), /* @__PURE__ */ M(N, { children: [/* @__PURE__ */ j("h2", {
96
97
  className: "text-base font-semibold text-text-primary mb-4",
97
98
  children: "Product Details"
98
- }), /* @__PURE__ */ k("div", {
99
+ }), /* @__PURE__ */ M("div", {
99
100
  className: "space-y-4",
100
- children: [/* @__PURE__ */ k("div", {
101
+ children: [/* @__PURE__ */ M("div", {
101
102
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
102
- children: [/* @__PURE__ */ k("div", {
103
+ children: [/* @__PURE__ */ M("div", {
103
104
  className: "space-y-2",
104
- children: [/* @__PURE__ */ k(v, {
105
+ children: [/* @__PURE__ */ M(b, {
105
106
  htmlFor: "name",
106
- children: ["Name ", /* @__PURE__ */ O("span", {
107
+ children: ["Name ", /* @__PURE__ */ j("span", {
107
108
  className: "text-status-error-text",
108
109
  children: "*"
109
110
  })]
110
- }), /* @__PURE__ */ O(_, {
111
+ }), /* @__PURE__ */ j(y, {
111
112
  id: "name",
112
113
  value: h.name,
113
114
  onChange: (e) => g((t) => ({
@@ -117,15 +118,15 @@ function N({ editId: t }) {
117
118
  placeholder: "Wireless Headphones",
118
119
  required: !0
119
120
  })]
120
- }), /* @__PURE__ */ k("div", {
121
+ }), /* @__PURE__ */ M("div", {
121
122
  className: "space-y-2",
122
- children: [/* @__PURE__ */ k(v, {
123
+ children: [/* @__PURE__ */ M(b, {
123
124
  htmlFor: "sku",
124
- children: ["SKU ", /* @__PURE__ */ O("span", {
125
+ children: ["SKU ", /* @__PURE__ */ j("span", {
125
126
  className: "text-status-error-text",
126
127
  children: "*"
127
128
  })]
128
- }), /* @__PURE__ */ O(_, {
129
+ }), /* @__PURE__ */ j(y, {
129
130
  id: "sku",
130
131
  value: h.sku,
131
132
  onChange: (e) => g((t) => ({
@@ -136,15 +137,15 @@ function N({ editId: t }) {
136
137
  required: !0
137
138
  })]
138
139
  })]
139
- }), /* @__PURE__ */ k("div", {
140
+ }), /* @__PURE__ */ M("div", {
140
141
  className: "grid grid-cols-1 md:grid-cols-3 gap-4",
141
142
  children: [
142
- /* @__PURE__ */ k("div", {
143
+ /* @__PURE__ */ M("div", {
143
144
  className: "space-y-2",
144
- children: [/* @__PURE__ */ O(v, {
145
+ children: [/* @__PURE__ */ j(b, {
145
146
  htmlFor: "category",
146
147
  children: "Category"
147
- }), /* @__PURE__ */ O(_, {
148
+ }), /* @__PURE__ */ j(y, {
148
149
  id: "category",
149
150
  value: h.category,
150
151
  onChange: (e) => g((t) => ({
@@ -154,12 +155,12 @@ function N({ editId: t }) {
154
155
  placeholder: "Electronics"
155
156
  })]
156
157
  }),
157
- /* @__PURE__ */ k("div", {
158
+ /* @__PURE__ */ M("div", {
158
159
  className: "space-y-2",
159
- children: [/* @__PURE__ */ O(v, {
160
+ children: [/* @__PURE__ */ j(b, {
160
161
  htmlFor: "brand",
161
162
  children: "Brand"
162
- }), /* @__PURE__ */ O(_, {
163
+ }), /* @__PURE__ */ j(y, {
163
164
  id: "brand",
164
165
  value: h.brand,
165
166
  onChange: (e) => g((t) => ({
@@ -169,12 +170,12 @@ function N({ editId: t }) {
169
170
  placeholder: "Acme"
170
171
  })]
171
172
  }),
172
- /* @__PURE__ */ k("div", {
173
+ /* @__PURE__ */ M("div", {
173
174
  className: "space-y-2",
174
- children: [/* @__PURE__ */ O(v, {
175
+ children: [/* @__PURE__ */ j(b, {
175
176
  htmlFor: "weight",
176
177
  children: "Weight (kg)"
177
- }), /* @__PURE__ */ O(_, {
178
+ }), /* @__PURE__ */ j(y, {
178
179
  id: "weight",
179
180
  type: "number",
180
181
  min: "0",
@@ -193,175 +194,230 @@ function N({ editId: t }) {
193
194
  })]
194
195
  });
195
196
  }
196
- function P() {
197
- let { productId: i } = D(), { basePath: l, navigate: _ } = c(), { product: v, isLoading: S, error: w, refetch: T } = u(i), P = E().pathname.endsWith("/edit"), F = () => _?.(s(l, "inventory/products")), I = (e) => _?.(s(l, e));
198
- return i ? P ? /* @__PURE__ */ O(N, { editId: i }) : S ? /* @__PURE__ */ O(b, { message: "Loading product details..." }) : w || !v ? /* @__PURE__ */ O(y, {
197
+ function L() {
198
+ let { productId: i } = k(), { basePath: u, navigate: y } = l(), { product: b, isLoading: w, error: E, refetch: D } = d(i), L = O().pathname.endsWith("/edit"), { levels: R, isLoading: z, error: B } = f(L ? void 0 : i), V = R.reduce((e, t) => e + t.available, 0), H = () => y?.(c(u, "inventory/products")), U = (e) => y?.(c(u, e));
199
+ return i ? L ? /* @__PURE__ */ j(I, { editId: i }) : w ? /* @__PURE__ */ j(S, { message: "Loading product details..." }) : E || !b ? /* @__PURE__ */ j(x, {
199
200
  title: "Product not found",
200
- onRetry: T
201
- }) : /* @__PURE__ */ k(x, {
202
- title: v.name,
203
- subtitle: `SKU: ${v.sku}`,
204
- icon: /* @__PURE__ */ O(r, { size: 24 }),
205
- headerActions: /* @__PURE__ */ k("div", {
201
+ onRetry: D
202
+ }) : /* @__PURE__ */ M(C, {
203
+ title: b.name,
204
+ subtitle: `SKU: ${b.sku}`,
205
+ icon: /* @__PURE__ */ j(r, { size: 24 }),
206
+ headerActions: /* @__PURE__ */ M("div", {
206
207
  className: "flex gap-2",
207
- children: [/* @__PURE__ */ k(f, {
208
+ children: [/* @__PURE__ */ M(m, {
208
209
  variant: "outline",
209
- onClick: F,
210
- children: [/* @__PURE__ */ O(e, { size: 16 }), " Back"]
211
- }), /* @__PURE__ */ k(f, {
212
- onClick: () => _?.(s(l, `inventory/products/${i}/edit`)),
213
- children: [/* @__PURE__ */ O(a, { size: 16 }), " Edit"]
210
+ onClick: H,
211
+ children: [/* @__PURE__ */ j(e, { size: 16 }), " Back"]
212
+ }), /* @__PURE__ */ M(m, {
213
+ onClick: () => y?.(c(u, `inventory/products/${i}/edit`)),
214
+ children: [/* @__PURE__ */ j(a, { size: 16 }), " Edit"]
214
215
  })]
215
216
  }),
216
- headerContent: /* @__PURE__ */ k("div", {
217
+ headerContent: /* @__PURE__ */ M("div", {
217
218
  className: "flex gap-2",
218
219
  children: [
219
- /* @__PURE__ */ O(d, {
220
+ /* @__PURE__ */ j(p, {
220
221
  variant: "outline",
221
- children: v.category
222
+ children: b.category
222
223
  }),
223
- v.brand && /* @__PURE__ */ O(d, {
224
+ b.brand && /* @__PURE__ */ j(p, {
224
225
  variant: "secondary",
225
- children: v.brand
226
+ children: b.brand
226
227
  }),
227
- v.fragile && /* @__PURE__ */ O(d, {
228
+ b.fragile && /* @__PURE__ */ j(p, {
228
229
  variant: "destructive",
229
230
  children: "Fragile"
230
231
  }),
231
- v.hazardous && /* @__PURE__ */ O(d, {
232
+ b.hazardous && /* @__PURE__ */ j(p, {
232
233
  variant: "destructive",
233
234
  children: "Hazardous"
234
235
  }),
235
- v.temperatureControlled && /* @__PURE__ */ O(d, {
236
+ b.temperatureControlled && /* @__PURE__ */ j(p, {
236
237
  variant: "secondary",
237
238
  children: "Temp Controlled"
238
239
  })
239
240
  ]
240
241
  }),
241
242
  children: [
242
- /* @__PURE__ */ O(M, {
243
- icon: /* @__PURE__ */ O(r, { size: 18 }),
243
+ /* @__PURE__ */ j(F, {
244
+ icon: /* @__PURE__ */ j(r, { size: 18 }),
244
245
  children: "The catalog record for this item — its dimensions, weight, value and handling flags. These drive how it's packed, priced and routed, so keep them accurate before adding the product to an order or stocking it in a warehouse."
245
246
  }),
246
- /* @__PURE__ */ O(j, {
247
+ /* @__PURE__ */ j(P, {
247
248
  storageKey: "movethewheels-product-details",
248
249
  steps: [{
249
250
  id: "order",
250
251
  label: "Add this product to an order",
251
252
  description: "Include it on a new delivery.",
252
- icon: /* @__PURE__ */ O(r, { size: 16 }),
253
- onClick: () => I("orders/new")
253
+ icon: /* @__PURE__ */ j(r, { size: 16 }),
254
+ onClick: () => U("orders/new")
254
255
  }, {
255
256
  id: "edit",
256
257
  label: "Edit product details",
257
258
  description: "Update dimensions, value or handling flags.",
258
- icon: /* @__PURE__ */ O(o, { size: 16 }),
259
- onClick: () => {}
259
+ icon: /* @__PURE__ */ j(o, { size: 16 }),
260
+ onClick: () => U(`inventory/products/${i}/edit`)
260
261
  }]
261
262
  }),
262
- /* @__PURE__ */ k("div", {
263
+ /* @__PURE__ */ M("div", {
263
264
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
264
- children: [/* @__PURE__ */ k("div", {
265
+ children: [/* @__PURE__ */ M("div", {
265
266
  className: "lg:col-span-2 space-y-6",
266
267
  children: [
267
- /* @__PURE__ */ k(p, { children: [/* @__PURE__ */ O(h, { children: /* @__PURE__ */ O(g, { children: "Description" }) }), /* @__PURE__ */ O(m, { children: /* @__PURE__ */ O("p", { children: v.description }) })] }),
268
- /* @__PURE__ */ k(p, { children: [/* @__PURE__ */ O(h, { children: /* @__PURE__ */ k(g, {
268
+ /* @__PURE__ */ M(h, { children: [/* @__PURE__ */ j(_, { children: /* @__PURE__ */ j(v, { children: "Description" }) }), /* @__PURE__ */ j(g, { children: /* @__PURE__ */ j("p", { children: b.description }) })] }),
269
+ /* @__PURE__ */ M(h, { children: [/* @__PURE__ */ j(_, { children: /* @__PURE__ */ M(v, {
269
270
  className: "flex items-center gap-2",
270
- children: [/* @__PURE__ */ O(t, { size: 18 }), " Dimensions & Weight"]
271
- }) }), /* @__PURE__ */ O(m, { children: /* @__PURE__ */ k("div", {
271
+ children: [/* @__PURE__ */ j(t, { size: 18 }), " Dimensions & Weight"]
272
+ }) }), /* @__PURE__ */ j(g, { children: /* @__PURE__ */ M("div", {
272
273
  className: "grid grid-cols-2 md:grid-cols-4 gap-4",
273
274
  children: [
274
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
275
+ /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
275
276
  className: "text-sm text-text-secondary",
276
277
  children: "Length"
277
- }), /* @__PURE__ */ k("p", {
278
+ }), /* @__PURE__ */ M("p", {
278
279
  className: "text-2xl font-bold",
279
- children: [v.dimensions.length, /* @__PURE__ */ k("span", {
280
+ children: [b.dimensions.length, /* @__PURE__ */ M("span", {
280
281
  className: "text-sm font-normal",
281
- children: [" ", v.dimensions.unit]
282
+ children: [" ", b.dimensions.unit]
282
283
  })]
283
284
  })] }),
284
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
285
+ /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
285
286
  className: "text-sm text-text-secondary",
286
287
  children: "Width"
287
- }), /* @__PURE__ */ k("p", {
288
+ }), /* @__PURE__ */ M("p", {
288
289
  className: "text-2xl font-bold",
289
- children: [v.dimensions.width, /* @__PURE__ */ k("span", {
290
+ children: [b.dimensions.width, /* @__PURE__ */ M("span", {
290
291
  className: "text-sm font-normal",
291
- children: [" ", v.dimensions.unit]
292
+ children: [" ", b.dimensions.unit]
292
293
  })]
293
294
  })] }),
294
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
295
+ /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
295
296
  className: "text-sm text-text-secondary",
296
297
  children: "Height"
297
- }), /* @__PURE__ */ k("p", {
298
+ }), /* @__PURE__ */ M("p", {
298
299
  className: "text-2xl font-bold",
299
- children: [v.dimensions.height, /* @__PURE__ */ k("span", {
300
+ children: [b.dimensions.height, /* @__PURE__ */ M("span", {
300
301
  className: "text-sm font-normal",
301
- children: [" ", v.dimensions.unit]
302
+ children: [" ", b.dimensions.unit]
302
303
  })]
303
304
  })] }),
304
- /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
305
+ /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
305
306
  className: "text-sm text-text-secondary",
306
307
  children: "Weight"
307
- }), /* @__PURE__ */ k("p", {
308
+ }), /* @__PURE__ */ M("p", {
308
309
  className: "text-2xl font-bold",
309
- children: [v.weight, /* @__PURE__ */ O("span", {
310
+ children: [b.weight, /* @__PURE__ */ j("span", {
310
311
  className: "text-sm font-normal",
311
312
  children: " kg"
312
313
  })]
313
314
  })] })
314
315
  ]
315
316
  }) })] }),
316
- v.attributes.length > 0 && /* @__PURE__ */ k(p, { children: [/* @__PURE__ */ O(h, { children: /* @__PURE__ */ k(g, {
317
+ b.attributes.length > 0 && /* @__PURE__ */ M(h, { children: [/* @__PURE__ */ j(_, { children: /* @__PURE__ */ M(v, {
317
318
  className: "flex items-center gap-2",
318
- children: [/* @__PURE__ */ O(o, { size: 18 }), " Attributes"]
319
- }) }), /* @__PURE__ */ O(m, { children: /* @__PURE__ */ O("div", {
319
+ children: [/* @__PURE__ */ j(o, { size: 18 }), " Attributes"]
320
+ }) }), /* @__PURE__ */ j(g, { children: /* @__PURE__ */ j("div", {
320
321
  className: "grid grid-cols-2 md:grid-cols-3 gap-4",
321
- children: v.attributes.map((e, t) => /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
322
+ children: b.attributes.map((e, t) => /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
322
323
  className: "text-sm text-text-secondary",
323
324
  children: e.name
324
- }), /* @__PURE__ */ O("p", {
325
+ }), /* @__PURE__ */ j("p", {
325
326
  className: "font-medium",
326
327
  children: e.value
327
328
  })] }, t))
328
329
  }) })] })
329
330
  ]
330
- }), /* @__PURE__ */ k("div", {
331
+ }), /* @__PURE__ */ M("div", {
331
332
  className: "space-y-6",
332
- children: [/* @__PURE__ */ k(A, { children: [
333
- /* @__PURE__ */ k("h2", {
334
- className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-3",
335
- children: [/* @__PURE__ */ O(n, { size: 18 }), " Pricing"]
336
- }),
337
- /* @__PURE__ */ O("p", {
338
- className: "text-3xl font-bold",
339
- children: C(v.value)
340
- }),
341
- /* @__PURE__ */ O("p", {
342
- className: "text-sm text-text-secondary",
343
- children: "Unit price"
344
- })
345
- ] }), /* @__PURE__ */ k(p, { children: [/* @__PURE__ */ O(h, { children: /* @__PURE__ */ O(g, { children: "Identifiers" }) }), /* @__PURE__ */ k(m, {
346
- className: "space-y-3",
347
- children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
348
- className: "text-sm text-text-secondary",
349
- children: "SKU"
350
- }), /* @__PURE__ */ O("p", {
351
- className: "font-mono",
352
- children: v.sku
353
- })] }), v.barcode && /* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
354
- className: "text-sm text-text-secondary",
355
- children: "Barcode"
356
- }), /* @__PURE__ */ O("p", {
357
- className: "font-mono",
358
- children: v.barcode
359
- })] })]
360
- })] })]
333
+ children: [
334
+ /* @__PURE__ */ M(N, { children: [
335
+ /* @__PURE__ */ M("h2", {
336
+ className: "flex items-center gap-2 text-base font-semibold text-text-primary mb-3",
337
+ children: [/* @__PURE__ */ j(n, { size: 18 }), " Pricing"]
338
+ }),
339
+ /* @__PURE__ */ j("p", {
340
+ className: "text-3xl font-bold",
341
+ children: T(b.value)
342
+ }),
343
+ /* @__PURE__ */ j("p", {
344
+ className: "text-sm text-text-secondary",
345
+ children: "Unit price"
346
+ })
347
+ ] }),
348
+ /* @__PURE__ */ M(h, { children: [/* @__PURE__ */ j(_, { children: /* @__PURE__ */ M(v, {
349
+ className: "flex items-center gap-2",
350
+ children: [/* @__PURE__ */ j(s, { size: 18 }), " Stock Levels"]
351
+ }) }), /* @__PURE__ */ j(g, {
352
+ className: "space-y-3",
353
+ children: B ? /* @__PURE__ */ j("p", {
354
+ className: "text-sm text-status-error-text",
355
+ children: B.message
356
+ }) : z ? /* @__PURE__ */ j("p", {
357
+ className: "text-sm text-text-secondary",
358
+ children: "Loading stock levels…"
359
+ }) : R.length === 0 ? /* @__PURE__ */ M("div", {
360
+ className: "space-y-3",
361
+ children: [/* @__PURE__ */ j("p", {
362
+ className: "text-sm text-text-secondary",
363
+ children: "This item isn't stocked in any warehouse yet, so nothing can be promised on an order."
364
+ }), /* @__PURE__ */ j(m, {
365
+ variant: "outline",
366
+ size: "sm",
367
+ onClick: () => U("inventory/warehouses"),
368
+ children: "View warehouses"
369
+ })]
370
+ }) : /* @__PURE__ */ M(A, { children: [R.map((e) => /* @__PURE__ */ M("div", {
371
+ className: "flex items-baseline justify-between gap-3",
372
+ children: [/* @__PURE__ */ M("div", {
373
+ className: "min-w-0",
374
+ children: [/* @__PURE__ */ j("p", {
375
+ className: "truncate text-sm font-medium",
376
+ children: e.warehouseName
377
+ }), /* @__PURE__ */ M("p", {
378
+ className: "text-xs text-text-secondary",
379
+ children: [
380
+ e.allocated.toLocaleString(),
381
+ " allocated",
382
+ e.reorderPoint === void 0 ? "" : ` · reorder at ${e.reorderPoint.toLocaleString()}`
383
+ ]
384
+ })]
385
+ }), /* @__PURE__ */ j("span", {
386
+ className: e.reorderPoint !== void 0 && e.available <= e.reorderPoint ? "font-semibold text-status-warning-text" : "font-semibold",
387
+ children: e.available.toLocaleString()
388
+ })]
389
+ }, e.inventoryItemId)), /* @__PURE__ */ M("div", {
390
+ className: "flex items-baseline justify-between gap-3 border-t border-border-seam pt-3",
391
+ children: [/* @__PURE__ */ j("p", {
392
+ className: "text-sm text-text-secondary",
393
+ children: "Available across the network"
394
+ }), /* @__PURE__ */ j("span", {
395
+ className: "font-bold",
396
+ children: V.toLocaleString()
397
+ })]
398
+ })] })
399
+ })] }),
400
+ /* @__PURE__ */ M(h, { children: [/* @__PURE__ */ j(_, { children: /* @__PURE__ */ j(v, { children: "Identifiers" }) }), /* @__PURE__ */ M(g, {
401
+ className: "space-y-3",
402
+ children: [/* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
403
+ className: "text-sm text-text-secondary",
404
+ children: "SKU"
405
+ }), /* @__PURE__ */ j("p", {
406
+ className: "font-mono",
407
+ children: b.sku
408
+ })] }), b.barcode && /* @__PURE__ */ M("div", { children: [/* @__PURE__ */ j("p", {
409
+ className: "text-sm text-text-secondary",
410
+ children: "Barcode"
411
+ }), /* @__PURE__ */ j("p", {
412
+ className: "font-mono",
413
+ children: b.barcode
414
+ })] })]
415
+ })] })
416
+ ]
361
417
  })]
362
418
  })
363
419
  ]
364
- }) : /* @__PURE__ */ O(N, {});
420
+ }) : /* @__PURE__ */ j(I, {});
365
421
  }
366
422
  //#endregion
367
- export { P as default };
423
+ export { L as default };