@burdenoff/microfe-movethewheels 2026.805.1 → 2026.827.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 (67) hide show
  1. package/dist/components/CarbonFootprintPanel.js +108 -0
  2. package/dist/components/index.js +1 -0
  3. package/dist/generated/wspace-operations.d.ts +168 -912
  4. package/dist/generated/wspace-types.d.ts +78432 -35831
  5. package/dist/hooks/useAnalytics.js +45 -4
  6. package/dist/hooks/useFleet.js +142 -74
  7. package/dist/hooks/useInventory.js +163 -70
  8. package/dist/hooks/useOrders.js +2 -2
  9. package/dist/hooks/useTracking.js +5 -5
  10. package/dist/index.js +33 -32
  11. package/dist/movethewheels/components/CarbonFootprintPanel.d.ts +7 -0
  12. package/dist/movethewheels/components/index.d.ts +1 -0
  13. package/dist/movethewheels/hooks/index.d.ts +3 -3
  14. package/dist/movethewheels/hooks/useAnalytics.d.ts +22 -0
  15. package/dist/movethewheels/hooks/useFleet.d.ts +32 -1
  16. package/dist/movethewheels/hooks/useInventory.d.ts +67 -12
  17. package/dist/movethewheels/hooks/useOrders.d.ts +25 -2
  18. package/dist/movethewheels/types/index.d.ts +2 -0
  19. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down-right.js +11 -0
  20. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left-right.js +22 -0
  21. package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up-right.js +11 -0
  22. package/dist/node_modules/lucide-react/dist/esm/icons/calendar-clock.js +32 -0
  23. package/dist/node_modules/lucide-react/dist/esm/icons/history.js +18 -0
  24. package/dist/node_modules/lucide-react/dist/esm/icons/leaf.js +11 -0
  25. package/dist/node_modules/lucide-react/dist/esm/icons/lock.js +16 -0
  26. package/dist/node_modules/lucide-react/dist/esm/icons/user-round.js +13 -0
  27. package/dist/pages/AnalyticsPage.js +81 -79
  28. package/dist/pages/CreateOrderPage.js +246 -195
  29. package/dist/pages/DeliveryCapturePage.js +91 -78
  30. package/dist/pages/DriversPage.js +202 -108
  31. package/dist/pages/InventoryPage.js +356 -131
  32. package/dist/pages/ProductDetailsPage.js +212 -156
  33. package/dist/pages/VehicleDetailsPage.js +257 -193
  34. package/dist/utils/formatters.js +4 -1
  35. package/package.json +1 -1
  36. package/src/generated/wspace-operations.ts +134 -929
  37. package/src/generated/wspace-types.ts +91730 -40059
  38. package/src/movethewheels/components/CarbonFootprintPanel.tsx +133 -0
  39. package/src/movethewheels/components/UpcomingDemandPanel.tsx +20 -11
  40. package/src/movethewheels/components/index.ts +3 -0
  41. package/src/movethewheels/hooks/index.ts +11 -0
  42. package/src/movethewheels/hooks/useAnalytics.ts +86 -0
  43. package/src/movethewheels/hooks/useDemandForecast.ts +10 -4
  44. package/src/movethewheels/hooks/useFleet.ts +133 -3
  45. package/src/movethewheels/hooks/useInventory.ts +311 -53
  46. package/src/movethewheels/hooks/useOrders.ts +31 -7
  47. package/src/movethewheels/hooks/useTracking.ts +14 -14
  48. package/src/movethewheels/pages/AnalyticsPage.tsx +5 -5
  49. package/src/movethewheels/pages/CreateOrderPage.tsx +67 -10
  50. package/src/movethewheels/pages/DeliveryCapturePage.tsx +8 -0
  51. package/src/movethewheels/pages/DriversPage.tsx +181 -31
  52. package/src/movethewheels/pages/InventoryPage.tsx +299 -19
  53. package/src/movethewheels/pages/ProductDetailsPage.tsx +68 -3
  54. package/src/movethewheels/pages/VehicleDetailsPage.tsx +86 -27
  55. package/src/movethewheels/types/index.ts +2 -0
  56. package/src/operations/wspace/movethewheels/fragments/core.graphql +23 -53
  57. package/src/operations/wspace/movethewheels/fragments/core.withdrawn.graphql +59 -0
  58. package/src/operations/wspace/movethewheels/mutations/entities.graphql +5 -5
  59. package/src/operations/wspace/movethewheels/mutations/marketplace-reports.graphql +18 -78
  60. package/src/operations/wspace/movethewheels/mutations/marketplace-reports.withdrawn.graphql +93 -0
  61. package/src/operations/wspace/movethewheels/mutations/orders.graphql +7 -7
  62. package/src/operations/wspace/movethewheels/queries/dashboard.graphql +3 -3
  63. package/src/operations/wspace/movethewheels/queries/entities.graphql +3 -3
  64. package/src/operations/wspace/movethewheels/queries/logistics.graphql +3 -3
  65. package/src/operations/wspace/movethewheels/queries/marketplace-reports.withdrawn.graphql +58 -0
  66. package/src/operations/wspace/movethewheels/queries/orders.graphql +3 -3
  67. package/src/operations/wspace/movethewheels/queries/marketplace-reports.graphql +0 -40
@@ -1,147 +1,289 @@
1
- import { Boxes as e } from "../node_modules/lucide-react/dist/esm/icons/boxes.js";
2
- import { ChevronRight as t } from "../node_modules/lucide-react/dist/esm/icons/chevron-right.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 { Plus as i } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
6
- import { TriangleAlert as a } from "../node_modules/lucide-react/dist/esm/icons/triangle-alert.js";
7
- import { Warehouse as o } from "../node_modules/lucide-react/dist/esm/icons/warehouse.js";
8
- import { joinPath as s } from "../utils/navigation.js";
9
- import { useMoveTheWheels as c } from "../providers/MoveTheWheelsProvider.js";
10
- import { useInventory as l, useInventoryStats as u } from "../hooks/useInventory.js";
11
- import { Badge as d, Button as f, Card as p, CardContent as m, Progress as h } from "../components/ui.js";
12
- import { PageLayout as g, PageSection as _ } from "../components/PageLayout.js";
13
- import { MetricCard as v, MetricCardSkeleton as y, MetricGrid as b } from "../components/MetricCard.js";
14
- import { formatCurrency as x } from "../utils/formatters.js";
15
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
16
- import { CTAOverflowMenu as w, EmphasisPanel as T, PagePurpose as E } from "@burdenoff/fe-libs/ui";
17
- import { useI18n as D } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
1
+ import { ArrowDownRight as e } from "../node_modules/lucide-react/dist/esm/icons/arrow-down-right.js";
2
+ import { ArrowLeftRight as t } from "../node_modules/lucide-react/dist/esm/icons/arrow-left-right.js";
3
+ import { ArrowUpRight as n } from "../node_modules/lucide-react/dist/esm/icons/arrow-up-right.js";
4
+ import { Boxes as r } from "../node_modules/lucide-react/dist/esm/icons/boxes.js";
5
+ import { ChevronRight as i } from "../node_modules/lucide-react/dist/esm/icons/chevron-right.js";
6
+ import { CircleCheck as a } from "../node_modules/lucide-react/dist/esm/icons/circle-check.js";
7
+ import { History as o } from "../node_modules/lucide-react/dist/esm/icons/history.js";
8
+ import { Lock as s } from "../node_modules/lucide-react/dist/esm/icons/lock.js";
9
+ import { Package as c } from "../node_modules/lucide-react/dist/esm/icons/package.js";
10
+ import { Plus as l } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
11
+ import { TriangleAlert as u } from "../node_modules/lucide-react/dist/esm/icons/triangle-alert.js";
12
+ import { Warehouse as d } from "../node_modules/lucide-react/dist/esm/icons/warehouse.js";
13
+ import { joinPath as f } from "../utils/navigation.js";
14
+ import { useMoveTheWheels as p } from "../providers/MoveTheWheelsProvider.js";
15
+ import { useInventory as ee, useInventoryStats as m, useInventoryTransactions as h } from "../hooks/useInventory.js";
16
+ import { Badge as g, Button as _, Card as v, CardContent as y, CardHeader as b, CardTitle as x, Progress as S } from "../components/ui.js";
17
+ import { PageLayout as C, PageSection as w } from "../components/PageLayout.js";
18
+ import { MetricCard as T, MetricCardSkeleton as E, MetricGrid as D } from "../components/MetricCard.js";
19
+ import { StatusBadge as te } from "../components/StatusBadge.js";
20
+ import { DataTable as ne } from "../components/DataTable.js";
21
+ import { formatCurrency as re, formatDate as ie } from "../utils/formatters.js";
22
+ import { useMemo as ae } from "react";
23
+ import { jsx as O, jsxs as k } from "react/jsx-runtime";
24
+ import { CTAOverflowMenu as A, EmphasisPanel as j, PagePurpose as M } from "@burdenoff/fe-libs/ui";
25
+ import { useI18n as N } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
18
26
  //#region src/movethewheels/pages/InventoryPage.tsx
19
- function O() {
20
- let { t: O } = D(), k = (e, t) => {
21
- let n = O(e);
27
+ var P = {
28
+ out_of_stock: {
29
+ bg: "bg-status-error-bg-subtle",
30
+ text: "text-status-error-text"
31
+ },
32
+ low: {
33
+ bg: "bg-status-warning-bg-subtle",
34
+ text: "text-status-warning-text"
35
+ },
36
+ in_stock: {
37
+ bg: "bg-status-success-bg-subtle",
38
+ text: "text-status-success-text"
39
+ }
40
+ }, F = {
41
+ RECEIPT: "in",
42
+ RETURN: "in",
43
+ ISSUE: "out",
44
+ TRANSFER: "neutral",
45
+ ADJUSTMENT: "neutral"
46
+ }, I = {
47
+ RECEIPT: "Inbound",
48
+ RETURN: "Return",
49
+ ISSUE: "Outbound",
50
+ TRANSFER: "Transfer",
51
+ ADJUSTMENT: "Adjustment"
52
+ };
53
+ function L() {
54
+ let { t: L } = N(), R = (e, t) => {
55
+ let n = L(e);
22
56
  return n === e ? t : n;
23
- }, { basePath: A, navigate: j } = c(), { inventory: M, products: N, warehouses: P, isLoading: F, error: I, refetch: L } = l(), { stats: R } = u(), z = (e) => j?.(s(A, e)), B = (e, t) => {
57
+ }, { basePath: z, navigate: B } = p(), { inventory: V, products: H, warehouses: U, isLoading: W, error: G, refetch: K } = ee(), { stats: q } = m(), { transactions: J, isLoading: oe, error: Y } = h({ limit: 8 }), X = (e) => B?.(f(z, e)), Z = (e, t) => {
24
58
  (e.key === "Enter" || e.key === " ") && (e.preventDefault(), t());
25
- }, V = M.filter((e) => e.availableQuantity <= e.reorderLevel);
26
- return /* @__PURE__ */ C(g, {
27
- title: k("movethewheels.inventory.title", "Inventory"),
28
- subtitle: k("movethewheels.inventory.subtitle", "Manage your products and warehouses"),
29
- icon: /* @__PURE__ */ S(r, { size: 24 }),
30
- headerActions: /* @__PURE__ */ S(w, {
59
+ }, Q = V.filter((e) => e.availableQuantity <= e.reorderLevel), $ = R("movethewheels.inventory.lowStock.unknownProduct", "Unknown Product"), se = ae(() => {
60
+ let e = new Map(H.map((e) => [e.id, e])), t = new Map(U.map((e) => [e.id, e]));
61
+ return V.map((n) => {
62
+ let r = e.get(n.productId);
63
+ return {
64
+ id: n.id,
65
+ productId: n.productId,
66
+ productName: r?.name ?? $,
67
+ sku: r?.sku ?? "—",
68
+ warehouseName: t.get(n.warehouseId)?.name ?? "—",
69
+ onHand: n.quantity,
70
+ allocated: n.reservedQuantity,
71
+ available: n.availableQuantity,
72
+ reorderLevel: n.reorderLevel,
73
+ stockState: n.quantity === 0 ? "out_of_stock" : n.availableQuantity <= n.reorderLevel ? "low" : "in_stock"
74
+ };
75
+ });
76
+ }, [
77
+ V,
78
+ H,
79
+ U,
80
+ $
81
+ ]), ce = [
82
+ {
83
+ id: "product",
84
+ header: R("movethewheels.inventory.stock.product", "Product"),
85
+ accessorKey: "productName",
86
+ sortable: !0,
87
+ cell: (e) => /* @__PURE__ */ O("span", {
88
+ className: "font-medium",
89
+ children: e.productName
90
+ })
91
+ },
92
+ {
93
+ id: "sku",
94
+ header: R("movethewheels.inventory.stock.sku", "SKU"),
95
+ accessorKey: "sku",
96
+ sortable: !0,
97
+ cell: (e) => /* @__PURE__ */ O("span", {
98
+ className: "text-sm text-text-secondary",
99
+ children: e.sku
100
+ })
101
+ },
102
+ {
103
+ id: "warehouse",
104
+ header: R("movethewheels.inventory.stock.warehouse", "Warehouse"),
105
+ accessorKey: "warehouseName",
106
+ sortable: !0
107
+ },
108
+ {
109
+ id: "onHand",
110
+ header: R("movethewheels.inventory.stock.onHand", "On hand"),
111
+ accessorKey: "onHand",
112
+ sortable: !0,
113
+ cell: (e) => /* @__PURE__ */ O("span", {
114
+ className: "font-medium",
115
+ children: e.onHand.toLocaleString()
116
+ })
117
+ },
118
+ {
119
+ id: "allocated",
120
+ header: R("movethewheels.inventory.stock.allocated", "Allocated"),
121
+ accessorKey: "allocated",
122
+ sortable: !0,
123
+ cell: (e) => e.allocated.toLocaleString()
124
+ },
125
+ {
126
+ id: "available",
127
+ header: R("movethewheels.inventory.stock.available", "Available"),
128
+ accessorKey: "available",
129
+ sortable: !0,
130
+ cell: (e) => /* @__PURE__ */ O("span", {
131
+ className: "font-medium",
132
+ children: e.available.toLocaleString()
133
+ })
134
+ },
135
+ {
136
+ id: "reorderPoint",
137
+ header: R("movethewheels.inventory.stock.reorderPoint", "Reorder point"),
138
+ accessorKey: "reorderLevel",
139
+ sortable: !0,
140
+ cell: (e) => e.reorderLevel > 0 ? e.reorderLevel.toLocaleString() : "—"
141
+ },
142
+ {
143
+ id: "state",
144
+ header: R("movethewheels.inventory.stock.status", "Status"),
145
+ cell: (e) => /* @__PURE__ */ O(te, {
146
+ status: e.stockState === "out_of_stock" ? R("movethewheels.inventory.stock.outOfStock", "Out of stock") : e.stockState === "low" ? R("movethewheels.inventory.stock.low", "Low") : R("movethewheels.inventory.stock.inStock", "In stock"),
147
+ customColors: P[e.stockState],
148
+ size: "sm"
149
+ })
150
+ }
151
+ ];
152
+ return /* @__PURE__ */ k(C, {
153
+ title: R("movethewheels.inventory.title", "Inventory"),
154
+ subtitle: R("movethewheels.inventory.subtitle", "Manage your products and warehouses"),
155
+ icon: /* @__PURE__ */ O(c, { size: 24 }),
156
+ headerActions: /* @__PURE__ */ O(A, {
31
157
  primary: {
32
- label: k("movethewheels.inventory.actions.addProduct", "Add Product"),
33
- icon: /* @__PURE__ */ S(i, { size: 16 }),
34
- onSelect: () => z("inventory/products/new")
158
+ label: R("movethewheels.inventory.actions.addProduct", "Add Product"),
159
+ icon: /* @__PURE__ */ O(l, { size: 16 }),
160
+ onSelect: () => X("inventory/products/new")
35
161
  },
36
162
  actions: [{
37
- label: k("movethewheels.inventory.actions.products", "Products"),
38
- onSelect: () => z("inventory/products")
163
+ label: R("movethewheels.inventory.actions.products", "Products"),
164
+ onSelect: () => X("inventory/products")
39
165
  }, {
40
- label: k("movethewheels.inventory.actions.warehouses", "Warehouses"),
41
- onSelect: () => z("inventory/warehouses")
166
+ label: R("movethewheels.inventory.actions.warehouses", "Warehouses"),
167
+ onSelect: () => X("inventory/warehouses")
42
168
  }]
43
169
  }),
44
170
  children: [
45
- /* @__PURE__ */ S(E, {
46
- icon: /* @__PURE__ */ S(r, { size: 18 }),
47
- children: k("movethewheels.inventory.purpose", "A real-time view of what you have and where. Track stock value and quantities across warehouses, catch low-stock items before they run out, and drill into products or warehouses to manage what you can promise on an order.")
171
+ /* @__PURE__ */ O(M, {
172
+ icon: /* @__PURE__ */ O(c, { size: 18 }),
173
+ children: R("movethewheels.inventory.purpose", "A real-time view of what you have and where. Track on-hand, allocated and free-to-promise quantities across warehouses, follow every stock movement, catch low-stock items before they run out, and drill into products or warehouses to manage what you can promise on an order.")
48
174
  }),
49
- I && !F ? /* @__PURE__ */ S(p, {
175
+ G && !W ? /* @__PURE__ */ O(v, {
50
176
  className: "border-status-error-border",
51
- children: /* @__PURE__ */ C(m, {
177
+ children: /* @__PURE__ */ k(y, {
52
178
  className: "p-6 text-center space-y-3",
53
179
  children: [
54
- /* @__PURE__ */ S("p", {
180
+ /* @__PURE__ */ O("p", {
55
181
  className: "text-status-error-text font-medium",
56
- children: k("movethewheels.inventory.error.title", "Couldn't load inventory")
182
+ children: R("movethewheels.inventory.error.title", "Couldn't load inventory")
57
183
  }),
58
- /* @__PURE__ */ S("p", {
184
+ /* @__PURE__ */ O("p", {
59
185
  className: "text-sm text-text-secondary",
60
- children: I.message
186
+ children: G.message
61
187
  }),
62
- /* @__PURE__ */ S(f, {
188
+ /* @__PURE__ */ O(_, {
63
189
  variant: "outline",
64
- onClick: L,
65
- children: k("movethewheels.inventory.error.retry", "Retry")
190
+ onClick: K,
191
+ children: R("movethewheels.inventory.error.retry", "Retry")
66
192
  })
67
193
  ]
68
194
  })
69
- }) : F ? /* @__PURE__ */ S(b, {
70
- columns: 4,
71
- children: Array.from({ length: 4 }).map((e, t) => /* @__PURE__ */ S(y, {}, t))
72
- }) : /* @__PURE__ */ C(b, {
73
- columns: 4,
195
+ }) : W ? /* @__PURE__ */ O(D, {
196
+ columns: 6,
197
+ children: Array.from({ length: 6 }).map((e, t) => /* @__PURE__ */ O(E, {}, t))
198
+ }) : /* @__PURE__ */ k(D, {
199
+ columns: 6,
74
200
  children: [
75
- /* @__PURE__ */ S(v, {
76
- label: k("movethewheels.inventory.metrics.totalProducts", "Total Products"),
77
- value: R.totalProducts,
78
- icon: /* @__PURE__ */ S(r, { size: 20 }),
201
+ /* @__PURE__ */ O(T, {
202
+ label: R("movethewheels.inventory.metrics.totalOnHand", "Total on-hand"),
203
+ value: q.totalOnHand.toLocaleString(),
204
+ icon: /* @__PURE__ */ O(r, { size: 20 }),
79
205
  accent: "brand",
80
- onClick: () => z("inventory/products")
206
+ subtitle: R("movethewheels.inventory.metrics.onHandHint", "Units in the network")
81
207
  }),
82
- /* @__PURE__ */ S(v, {
83
- label: k("movethewheels.inventory.metrics.totalItems", "Total Items"),
84
- value: R.totalItems.toLocaleString(),
85
- icon: /* @__PURE__ */ S(e, { size: 20 }),
86
- accent: "success"
208
+ /* @__PURE__ */ O(T, {
209
+ label: R("movethewheels.inventory.metrics.available", "Available"),
210
+ value: q.totalAvailable.toLocaleString(),
211
+ icon: /* @__PURE__ */ O(a, { size: 20 }),
212
+ accent: "success",
213
+ subtitle: R("movethewheels.inventory.metrics.availableHint", "Free to promise")
87
214
  }),
88
- /* @__PURE__ */ S(v, {
89
- label: k("movethewheels.inventory.metrics.inventoryValue", "Inventory Value"),
90
- value: x(R.totalValue),
91
- icon: /* @__PURE__ */ S(n, { size: 20 }),
92
- accent: "blue"
215
+ /* @__PURE__ */ O(T, {
216
+ label: R("movethewheels.inventory.metrics.allocated", "Allocated"),
217
+ value: q.totalAllocated.toLocaleString(),
218
+ icon: /* @__PURE__ */ O(s, { size: 20 }),
219
+ accent: "blue",
220
+ subtitle: R("movethewheels.inventory.metrics.allocatedHint", "Committed to orders")
93
221
  }),
94
- /* @__PURE__ */ S(v, {
95
- label: k("movethewheels.inventory.metrics.warehouses", "Warehouses"),
96
- value: R.totalWarehouses,
97
- icon: /* @__PURE__ */ S(o, { size: 20 }),
222
+ /* @__PURE__ */ O(T, {
223
+ label: R("movethewheels.inventory.metrics.lowStock", "Low-stock items"),
224
+ value: q.lowStockCount.toLocaleString(),
225
+ icon: /* @__PURE__ */ O(u, { size: 20 }),
226
+ accent: "warning",
227
+ subtitle: R("movethewheels.inventory.metrics.lowStockHint", "At or under reorder point")
228
+ }),
229
+ /* @__PURE__ */ O(T, {
230
+ label: R("movethewheels.inventory.metrics.totalProducts", "Catalog items"),
231
+ value: q.totalProducts.toLocaleString(),
232
+ icon: /* @__PURE__ */ O(c, { size: 20 }),
233
+ accent: "neutral",
234
+ onClick: () => X("inventory/products")
235
+ }),
236
+ /* @__PURE__ */ O(T, {
237
+ label: R("movethewheels.inventory.metrics.warehouses", "Warehouses"),
238
+ value: q.totalWarehouses.toLocaleString(),
239
+ icon: /* @__PURE__ */ O(d, { size: 20 }),
98
240
  accent: "neutral",
99
- onClick: () => z("inventory/warehouses")
241
+ onClick: () => X("inventory/warehouses")
100
242
  })
101
243
  ]
102
244
  }),
103
- V.length > 0 && /* @__PURE__ */ C(T, {
245
+ Q.length > 0 && /* @__PURE__ */ k(j, {
104
246
  className: "space-y-4",
105
- children: [/* @__PURE__ */ C("h2", {
247
+ children: [/* @__PURE__ */ k("h2", {
106
248
  className: "flex items-center gap-2 text-base font-semibold text-status-warning-text",
107
249
  children: [
108
- /* @__PURE__ */ S(a, { size: 18 }),
109
- k("movethewheels.inventory.lowStock.title", "Low Stock Alert"),
250
+ /* @__PURE__ */ O(u, { size: 18 }),
251
+ R("movethewheels.inventory.lowStock.title", "Low Stock Alert"),
110
252
  " (",
111
- V.length,
253
+ Q.length,
112
254
  " ",
113
- k("movethewheels.inventory.lowStock.items", "items"),
255
+ R("movethewheels.inventory.lowStock.items", "items"),
114
256
  ")"
115
257
  ]
116
- }), /* @__PURE__ */ S("div", { children: /* @__PURE__ */ S("div", {
258
+ }), /* @__PURE__ */ O("div", { children: /* @__PURE__ */ O("div", {
117
259
  className: "space-y-3",
118
- children: V.slice(0, 5).map((e) => {
119
- let t = N.find((t) => t.id === e.productId);
120
- return /* @__PURE__ */ C("div", {
260
+ children: Q.slice(0, 5).map((e) => {
261
+ let t = H.find((t) => t.id === e.productId);
262
+ return /* @__PURE__ */ k("div", {
121
263
  className: "flex items-center justify-between p-3 bg-status-warning-bg/10 rounded-lg",
122
- children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
264
+ children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
123
265
  className: "font-medium",
124
- children: t?.name || k("movethewheels.inventory.lowStock.unknownProduct", "Unknown Product")
125
- }), /* @__PURE__ */ C("p", {
266
+ children: t?.name || R("movethewheels.inventory.lowStock.unknownProduct", "Unknown Product")
267
+ }), /* @__PURE__ */ k("p", {
126
268
  className: "text-sm text-text-secondary",
127
269
  children: [
128
- k("movethewheels.inventory.lowStock.sku", "SKU:"),
270
+ R("movethewheels.inventory.lowStock.sku", "SKU:"),
129
271
  " ",
130
272
  t?.sku
131
273
  ]
132
- })] }), /* @__PURE__ */ C("div", {
274
+ })] }), /* @__PURE__ */ k("div", {
133
275
  className: "text-right",
134
- children: [/* @__PURE__ */ C("p", {
276
+ children: [/* @__PURE__ */ k("p", {
135
277
  className: "font-medium text-status-warning-text",
136
278
  children: [
137
279
  e.availableQuantity,
138
280
  " ",
139
- k("movethewheels.inventory.lowStock.left", "left")
281
+ R("movethewheels.inventory.lowStock.left", "left")
140
282
  ]
141
- }), /* @__PURE__ */ C("p", {
283
+ }), /* @__PURE__ */ k("p", {
142
284
  className: "text-sm text-text-secondary",
143
285
  children: [
144
- k("movethewheels.inventory.lowStock.reorderAt", "Reorder at:"),
286
+ R("movethewheels.inventory.lowStock.reorderAt", "Reorder at:"),
145
287
  " ",
146
288
  e.reorderLevel
147
289
  ]
@@ -151,54 +293,137 @@ function O() {
151
293
  })
152
294
  }) })]
153
295
  }),
154
- /* @__PURE__ */ C("div", {
296
+ /* @__PURE__ */ k("div", {
297
+ className: "grid grid-cols-1 xl:grid-cols-3 gap-6",
298
+ children: [/* @__PURE__ */ O("div", {
299
+ className: "xl:col-span-2",
300
+ children: /* @__PURE__ */ O(w, {
301
+ title: R("movethewheels.inventory.stock.title", "Stock position"),
302
+ children: /* @__PURE__ */ O(ne, {
303
+ columns: ce,
304
+ data: se,
305
+ isLoading: W,
306
+ error: G,
307
+ onRetry: K,
308
+ searchable: !0,
309
+ searchPlaceholder: R("movethewheels.inventory.stock.search", "Search product, SKU or warehouse..."),
310
+ searchFields: [
311
+ "productName",
312
+ "sku",
313
+ "warehouseName"
314
+ ],
315
+ onRowClick: (e) => X(`inventory/products/${e.productId}`),
316
+ getRowId: (e) => e.id,
317
+ emptyIllustration: "empty-data",
318
+ emptyTitle: R("movethewheels.inventory.stock.emptyTitle", "No stock recorded yet"),
319
+ emptyDescription: R("movethewheels.inventory.stock.emptyDescription", "Stock lines appear here once a product is received into a warehouse.")
320
+ })
321
+ })
322
+ }), /* @__PURE__ */ k(v, {
323
+ className: "h-fit",
324
+ children: [/* @__PURE__ */ O(b, { children: /* @__PURE__ */ k(x, {
325
+ className: "flex items-center gap-2",
326
+ children: [/* @__PURE__ */ O(o, { size: 18 }), R("movethewheels.inventory.transactions.title", "Recent transactions")]
327
+ }) }), /* @__PURE__ */ O(y, {
328
+ className: "p-0",
329
+ children: Y ? /* @__PURE__ */ O("p", {
330
+ className: "p-6 text-sm text-status-error-text",
331
+ children: Y.message
332
+ }) : oe ? /* @__PURE__ */ O("p", {
333
+ className: "p-6 text-sm text-text-secondary",
334
+ children: R("movethewheels.inventory.transactions.loading", "Loading movements…")
335
+ }) : J.length === 0 ? /* @__PURE__ */ O("p", {
336
+ className: "p-6 text-sm text-text-secondary",
337
+ children: R("movethewheels.inventory.transactions.empty", "No stock movements recorded yet. Receipts, issues and adjustments show up here as they happen.")
338
+ }) : /* @__PURE__ */ O("ul", {
339
+ className: "divide-y",
340
+ children: J.map((r) => {
341
+ let i = F[r.type], a = H.find((e) => e.id === r.productId)?.name ?? r.transactionNumber;
342
+ return /* @__PURE__ */ k("li", {
343
+ className: "flex items-start justify-between gap-3 p-4",
344
+ children: [/* @__PURE__ */ k("div", {
345
+ className: "min-w-0",
346
+ children: [
347
+ /* @__PURE__ */ k("p", {
348
+ className: "flex items-center gap-1.5 font-medium",
349
+ children: [i === "in" ? /* @__PURE__ */ O(e, {
350
+ size: 14,
351
+ className: "text-status-success-text"
352
+ }) : i === "out" ? /* @__PURE__ */ O(n, {
353
+ size: 14,
354
+ className: "text-status-warning-text"
355
+ }) : /* @__PURE__ */ O(t, {
356
+ size: 14,
357
+ className: "text-text-secondary"
358
+ }), I[r.type]]
359
+ }),
360
+ /* @__PURE__ */ O("p", {
361
+ className: "truncate text-sm text-text-secondary",
362
+ children: a
363
+ }),
364
+ /* @__PURE__ */ O("p", {
365
+ className: "text-xs text-text-secondary",
366
+ children: ie(r.createdAt, "short")
367
+ })
368
+ ]
369
+ }), /* @__PURE__ */ k("span", {
370
+ className: i === "in" ? "font-medium text-status-success-text" : i === "out" ? "font-medium text-status-warning-text" : "font-medium text-text-primary",
371
+ children: [i === "in" ? "+" : i === "out" ? "−" : "", Math.abs(r.quantity).toLocaleString()]
372
+ })]
373
+ }, r.id);
374
+ })
375
+ })
376
+ })]
377
+ })]
378
+ }),
379
+ /* @__PURE__ */ k("div", {
155
380
  className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
156
- children: [/* @__PURE__ */ S(_, {
157
- title: k("movethewheels.inventory.warehouses.title", "Warehouses"),
158
- actions: /* @__PURE__ */ C(f, {
381
+ children: [/* @__PURE__ */ O(w, {
382
+ title: R("movethewheels.inventory.warehouses.title", "Warehouses"),
383
+ actions: /* @__PURE__ */ k(_, {
159
384
  variant: "ghost",
160
385
  size: "sm",
161
- onClick: () => z("inventory/warehouses"),
386
+ onClick: () => X("inventory/warehouses"),
162
387
  children: [
163
- k("movethewheels.inventory.common.viewAll", "View all"),
388
+ R("movethewheels.inventory.common.viewAll", "View all"),
164
389
  " ",
165
- /* @__PURE__ */ S(t, { size: 16 })
390
+ /* @__PURE__ */ O(i, { size: 16 })
166
391
  ]
167
392
  }),
168
- children: /* @__PURE__ */ S(p, { children: /* @__PURE__ */ S(m, {
393
+ children: /* @__PURE__ */ O(v, { children: /* @__PURE__ */ O(y, {
169
394
  className: "p-0",
170
- children: /* @__PURE__ */ S("div", {
395
+ children: /* @__PURE__ */ O("div", {
171
396
  className: "divide-y",
172
- children: P.map((e) => /* @__PURE__ */ S("div", {
397
+ children: U.map((e) => /* @__PURE__ */ O("div", {
173
398
  role: "button",
174
399
  tabIndex: 0,
175
400
  "aria-label": `View warehouse ${e.name}`,
176
401
  className: "p-4 hover:bg-bg-sunken/50 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
177
- onClick: () => z(`inventory/warehouses/${e.id}`),
178
- onKeyDown: (t) => B(t, () => z(`inventory/warehouses/${e.id}`)),
179
- children: /* @__PURE__ */ C("div", {
402
+ onClick: () => X(`inventory/warehouses/${e.id}`),
403
+ onKeyDown: (t) => Z(t, () => X(`inventory/warehouses/${e.id}`)),
404
+ children: /* @__PURE__ */ k("div", {
180
405
  className: "flex items-center justify-between",
181
- children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
406
+ children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
182
407
  className: "font-medium",
183
408
  children: e.name
184
- }), /* @__PURE__ */ C("p", {
409
+ }), /* @__PURE__ */ k("p", {
185
410
  className: "text-sm text-text-secondary",
186
411
  children: [
187
412
  e.address.city,
188
413
  ", ",
189
414
  e.address.state
190
415
  ]
191
- })] }), /* @__PURE__ */ C("div", {
416
+ })] }), /* @__PURE__ */ k("div", {
192
417
  className: "text-right",
193
- children: [/* @__PURE__ */ S(d, {
418
+ children: [/* @__PURE__ */ O(g, {
194
419
  variant: e.isActive ? "default" : "secondary",
195
- children: e.isActive ? k("movethewheels.inventory.warehouses.active", "Active") : k("movethewheels.inventory.warehouses.inactive", "Inactive")
196
- }), /* @__PURE__ */ C("div", {
420
+ children: e.isActive ? R("movethewheels.inventory.warehouses.active", "Active") : R("movethewheels.inventory.warehouses.inactive", "Inactive")
421
+ }), /* @__PURE__ */ k("div", {
197
422
  className: "mt-2",
198
- children: [/* @__PURE__ */ S("p", {
423
+ children: [/* @__PURE__ */ O("p", {
199
424
  className: "text-xs text-text-secondary",
200
- children: k("movethewheels.inventory.warehouses.utilization", "Utilization")
201
- }), /* @__PURE__ */ S(h, {
425
+ children: R("movethewheels.inventory.warehouses.utilization", "Utilization")
426
+ }), /* @__PURE__ */ O(S, {
202
427
  value: e.capacity.usedSpace / e.capacity.totalSpace * 100,
203
428
  className: "w-24 h-2"
204
429
  })]
@@ -208,43 +433,43 @@ function O() {
208
433
  }, e.id))
209
434
  })
210
435
  }) })
211
- }), /* @__PURE__ */ S(_, {
212
- title: k("movethewheels.inventory.products.title", "Recent Products"),
213
- actions: /* @__PURE__ */ C(f, {
436
+ }), /* @__PURE__ */ O(w, {
437
+ title: R("movethewheels.inventory.products.title", "Recent Products"),
438
+ actions: /* @__PURE__ */ k(_, {
214
439
  variant: "ghost",
215
440
  size: "sm",
216
- onClick: () => z("inventory/products"),
441
+ onClick: () => X("inventory/products"),
217
442
  children: [
218
- k("movethewheels.inventory.common.viewAll", "View all"),
443
+ R("movethewheels.inventory.common.viewAll", "View all"),
219
444
  " ",
220
- /* @__PURE__ */ S(t, { size: 16 })
445
+ /* @__PURE__ */ O(i, { size: 16 })
221
446
  ]
222
447
  }),
223
- children: /* @__PURE__ */ S(p, { children: /* @__PURE__ */ S(m, {
448
+ children: /* @__PURE__ */ O(v, { children: /* @__PURE__ */ O(y, {
224
449
  className: "p-0",
225
- children: /* @__PURE__ */ S("div", {
450
+ children: /* @__PURE__ */ O("div", {
226
451
  className: "divide-y",
227
- children: N.slice(0, 5).map((e) => /* @__PURE__ */ S("div", {
452
+ children: H.slice(0, 5).map((e) => /* @__PURE__ */ O("div", {
228
453
  role: "button",
229
454
  tabIndex: 0,
230
455
  "aria-label": `View product ${e.name}`,
231
456
  className: "p-4 hover:bg-bg-sunken/50 cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-action-primary-bg",
232
- onClick: () => z(`inventory/products/${e.id}`),
233
- onKeyDown: (t) => B(t, () => z(`inventory/products/${e.id}`)),
234
- children: /* @__PURE__ */ C("div", {
457
+ onClick: () => X(`inventory/products/${e.id}`),
458
+ onKeyDown: (t) => Z(t, () => X(`inventory/products/${e.id}`)),
459
+ children: /* @__PURE__ */ k("div", {
235
460
  className: "flex items-center justify-between",
236
- children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
461
+ children: [/* @__PURE__ */ k("div", { children: [/* @__PURE__ */ O("p", {
237
462
  className: "font-medium",
238
463
  children: e.name
239
- }), /* @__PURE__ */ S("p", {
464
+ }), /* @__PURE__ */ O("p", {
240
465
  className: "text-sm text-text-secondary",
241
466
  children: e.sku
242
- })] }), /* @__PURE__ */ C("div", {
467
+ })] }), /* @__PURE__ */ k("div", {
243
468
  className: "text-right",
244
- children: [/* @__PURE__ */ S("p", {
469
+ children: [/* @__PURE__ */ O("p", {
245
470
  className: "font-medium",
246
- children: x(e.value)
247
- }), /* @__PURE__ */ S(d, {
471
+ children: re(e.value)
472
+ }), /* @__PURE__ */ O(g, {
248
473
  variant: "outline",
249
474
  children: e.category
250
475
  })]
@@ -259,4 +484,4 @@ function O() {
259
484
  });
260
485
  }
261
486
  //#endregion
262
- export { O as default };
487
+ export { L as default };