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