@burdenoff/microfe-movethewheels 2026.1017.12 → 2026.1017.13

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 (29) hide show
  1. package/dist/MoveTheWheelsRoot.js +7 -0
  2. package/dist/MoveTheWheelsRoutes.js +39 -35
  3. package/dist/components/pallet-preview/PalletPreviewResults.js +189 -0
  4. package/dist/generated/pallet-preview-operations.d.ts +273 -0
  5. package/dist/hooks/usePalletPreview.js +86 -0
  6. package/dist/movethewheels/components/pallet-preview/PalletPreviewResults.d.ts +6 -0
  7. package/dist/movethewheels/hooks/usePalletPreview.d.ts +98 -0
  8. package/dist/movethewheels/pages/PalletPreviewPage.d.ts +1 -0
  9. package/dist/movethewheels/utils/graphqlClient.d.ts +4 -0
  10. package/dist/movethewheels/utils/palletPreviewInput.d.ts +54 -0
  11. package/dist/movethewheels/utils/palletPreviewResponse.d.ts +7 -0
  12. package/dist/pages/PalletPreviewPage.js +501 -0
  13. package/dist/pages/WarehousesPage.js +83 -78
  14. package/dist/src/generated/pallet-preview-operations.js +594 -0
  15. package/dist/utils/graphqlClient.js +27 -19
  16. package/dist/utils/palletPreviewInput.js +138 -0
  17. package/dist/utils/palletPreviewResponse.js +191 -0
  18. package/package.json +5 -4
  19. package/src/generated/pallet-preview-operations.ts +204 -0
  20. package/src/movethewheels/MoveTheWheelsRoot.tsx +7 -0
  21. package/src/movethewheels/MoveTheWheelsRoutes.tsx +2 -0
  22. package/src/movethewheels/components/pallet-preview/PalletPreviewResults.tsx +220 -0
  23. package/src/movethewheels/hooks/usePalletPreview.ts +114 -0
  24. package/src/movethewheels/pages/PalletPreviewPage.tsx +588 -0
  25. package/src/movethewheels/pages/WarehousesPage.tsx +9 -1
  26. package/src/movethewheels/utils/graphqlClient.ts +19 -2
  27. package/src/movethewheels/utils/palletPreviewInput.ts +199 -0
  28. package/src/movethewheels/utils/palletPreviewResponse.ts +256 -0
  29. package/src/operations/pallet-preview/preview.graphql +26 -0
@@ -6,17 +6,19 @@ import { RefreshCw as i } from "../node_modules/lucide-react/dist/esm/icons/refr
6
6
  import { Warehouse as a } from "../node_modules/lucide-react/dist/esm/icons/warehouse.js";
7
7
  import { joinPath as o } from "../utils/navigation.js";
8
8
  import { useMoveTheWheels as s } from "../providers/MoveTheWheelsProvider.js";
9
- import { useWarehouseStats as c, useWarehouses as l } from "../hooks/useInventory.js";
10
- import { Badge as u, Button as d, Card as f, CardContent as p, Progress as m, Select as h, SelectContent as g, SelectItem as _, SelectTrigger as v, SelectValue as y } from "../components/ui.js";
11
- import { PageLayout as b } from "../components/PageLayout.js";
12
- import { MetricCard as x, MetricGrid as S } from "../components/MetricCard.js";
13
- import { DataTable as C } from "../components/DataTable.js";
14
- import { useDebouncedValue as w } from "../hooks/useDebouncedValue.js";
15
- import { useState as T } from "react";
16
- import { jsx as E, jsxs as D } from "react/jsx-runtime";
17
- import { CTAOverflowMenu as O, PagePurpose as k } from "@burdenoff/fe-libs/ui";
9
+ import { useTr as c } from "../shared/hooks/useTr.js";
10
+ import { useWarehouseStats as l, useWarehouses as u } from "../hooks/useInventory.js";
11
+ import "../hooks/index.js";
12
+ import { Badge as d, Button as f, Card as p, CardContent as m, Progress as h, Select as g, SelectContent as _, SelectItem as v, SelectTrigger as y, SelectValue as b } from "../components/ui.js";
13
+ import { PageLayout as x } from "../components/PageLayout.js";
14
+ import { MetricCard as S, MetricGrid as C } from "../components/MetricCard.js";
15
+ import { DataTable as w } from "../components/DataTable.js";
16
+ import { useDebouncedValue as T } from "../hooks/useDebouncedValue.js";
17
+ import { useState as E } from "react";
18
+ import { jsx as D, jsxs as O } from "react/jsx-runtime";
19
+ import { CTAOverflowMenu as k, PagePurpose as A } from "@burdenoff/fe-libs/ui";
18
20
  //#region src/movethewheels/pages/WarehousesPage.tsx
19
- var A = [
21
+ var j = [
20
22
  {
21
23
  value: "all",
22
24
  label: "All statuses"
@@ -30,111 +32,114 @@ var A = [
30
32
  label: "Inactive"
31
33
  }
32
34
  ];
33
- function j() {
34
- let { basePath: j, navigate: M } = s(), [N, P] = T(0), [F, I] = T(25), [L, R] = T(""), [z, B] = T("all"), V = w(L), { warehouses: H, totalWarehouses: U, hasMore: W, isLoading: G, error: K, refetch: q } = l({
35
- limit: F,
36
- offset: N * F,
37
- search: V,
38
- status: z === "all" ? void 0 : z
39
- }), J = z !== "all" || L.length > 0, { stats: Y } = c(), X = (e) => M?.(o(j, e));
40
- return /* @__PURE__ */ D(b, {
35
+ function M() {
36
+ let M = c(), { basePath: N, navigate: P } = s(), [F, I] = E(0), [L, R] = E(25), [z, B] = E(""), [V, H] = E("all"), U = T(z), { warehouses: W, totalWarehouses: G, hasMore: K, isLoading: q, error: J, refetch: Y } = u({
37
+ limit: L,
38
+ offset: F * L,
39
+ search: U,
40
+ status: V === "all" ? void 0 : V
41
+ }), X = V !== "all" || z.length > 0, { stats: Z } = l(), Q = (e) => P?.(o(N, e));
42
+ return /* @__PURE__ */ O(x, {
41
43
  title: "Warehouses",
42
- subtitle: `${Y.total} warehouses`,
43
- icon: /* @__PURE__ */ E(a, { size: 24 }),
44
- headerActions: /* @__PURE__ */ E(O, {
44
+ subtitle: `${Z.total} warehouses`,
45
+ icon: /* @__PURE__ */ D(a, { size: 24 }),
46
+ headerActions: /* @__PURE__ */ D(k, {
45
47
  primary: {
46
48
  label: "Add Warehouse",
47
- icon: /* @__PURE__ */ E(r, { size: 16 }),
48
- onSelect: () => X("inventory/warehouses/new")
49
+ icon: /* @__PURE__ */ D(r, { size: 16 }),
50
+ onSelect: () => Q("inventory/warehouses/new")
49
51
  },
50
52
  actions: [{
53
+ label: M("movethewheels.palletPreview.title", "Pallet preview"),
54
+ onSelect: () => Q("inventory/warehouses/pallet-preview")
55
+ }, {
51
56
  label: "Refresh",
52
- icon: /* @__PURE__ */ E(i, { size: 16 }),
53
- onSelect: () => q()
57
+ icon: /* @__PURE__ */ D(i, { size: 16 }),
58
+ onSelect: () => Y()
54
59
  }]
55
60
  }),
56
61
  children: [
57
- /* @__PURE__ */ E(k, {
58
- icon: /* @__PURE__ */ E(a, { size: 18 }),
62
+ /* @__PURE__ */ D(A, {
63
+ icon: /* @__PURE__ */ D(a, { size: 18 }),
59
64
  children: "Your storage and fulfilment sites. Watch space and pallet utilization across each warehouse to balance stock, spot capacity crunches, and decide where to fulfil an order from."
60
65
  }),
61
- /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("p", {
66
+ /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
62
67
  className: "mb-3 text-sm font-medium text-text-secondary",
63
68
  children: "Network at a glance"
64
- }), /* @__PURE__ */ D(S, {
69
+ }), /* @__PURE__ */ O(C, {
65
70
  columns: 3,
66
71
  children: [
67
- /* @__PURE__ */ E(x, {
72
+ /* @__PURE__ */ D(S, {
68
73
  label: "Total sites",
69
- value: Y.total,
70
- icon: /* @__PURE__ */ E(a, { size: 20 }),
74
+ value: Z.total,
75
+ icon: /* @__PURE__ */ D(a, { size: 20 }),
71
76
  accent: "brand"
72
77
  }),
73
- /* @__PURE__ */ E(x, {
78
+ /* @__PURE__ */ D(S, {
74
79
  label: "Active",
75
- value: Y.active,
76
- icon: /* @__PURE__ */ E(e, { size: 20 }),
80
+ value: Z.active,
81
+ icon: /* @__PURE__ */ D(e, { size: 20 }),
77
82
  accent: "success",
78
83
  subtitle: "Fulfilling orders"
79
84
  }),
80
- /* @__PURE__ */ E(x, {
85
+ /* @__PURE__ */ D(S, {
81
86
  label: "Avg utilization",
82
- value: Y.total > 0 ? `${Math.round(Y.avgUtilization * 100)}%` : "—",
83
- icon: /* @__PURE__ */ E(n, { size: 20 }),
87
+ value: Z.total > 0 ? `${Math.round(Z.avgUtilization * 100)}%` : "—",
88
+ icon: /* @__PURE__ */ D(n, { size: 20 }),
84
89
  accent: "blue"
85
90
  })
86
91
  ]
87
92
  })] }),
88
- /* @__PURE__ */ E(f, { children: /* @__PURE__ */ E(p, {
93
+ /* @__PURE__ */ D(p, { children: /* @__PURE__ */ D(m, {
89
94
  className: "p-4",
90
- children: /* @__PURE__ */ D("div", {
95
+ children: /* @__PURE__ */ O("div", {
91
96
  className: "flex flex-wrap items-center gap-4",
92
97
  children: [
93
- /* @__PURE__ */ D("div", {
98
+ /* @__PURE__ */ O("div", {
94
99
  className: "flex items-center gap-2",
95
- children: [/* @__PURE__ */ E(t, {
100
+ children: [/* @__PURE__ */ D(t, {
96
101
  size: 16,
97
102
  className: "text-text-secondary"
98
- }), /* @__PURE__ */ E("span", {
103
+ }), /* @__PURE__ */ D("span", {
99
104
  className: "text-sm font-medium",
100
105
  children: "Filters:"
101
106
  })]
102
107
  }),
103
- /* @__PURE__ */ D(h, {
104
- value: z,
108
+ /* @__PURE__ */ O(g, {
109
+ value: V,
105
110
  onValueChange: (e) => {
106
- B(e), P(0);
111
+ H(e), I(0);
107
112
  },
108
- children: [/* @__PURE__ */ E(v, {
113
+ children: [/* @__PURE__ */ D(y, {
109
114
  className: "w-[180px]",
110
- children: /* @__PURE__ */ E(y, { placeholder: "Status" })
111
- }), /* @__PURE__ */ E(g, { children: A.map((e) => /* @__PURE__ */ E(_, {
115
+ children: /* @__PURE__ */ D(b, { placeholder: "Status" })
116
+ }), /* @__PURE__ */ D(_, { children: j.map((e) => /* @__PURE__ */ D(v, {
112
117
  value: e.value,
113
118
  children: e.label
114
119
  }, e.value)) })]
115
120
  }),
116
- J && /* @__PURE__ */ E(d, {
121
+ X && /* @__PURE__ */ D(f, {
117
122
  variant: "ghost",
118
123
  size: "sm",
119
124
  onClick: () => {
120
- B("all"), R(""), P(0);
125
+ H("all"), B(""), I(0);
121
126
  },
122
127
  children: "Clear filters"
123
128
  })
124
129
  ]
125
130
  })
126
131
  }) }),
127
- /* @__PURE__ */ E(C, {
132
+ /* @__PURE__ */ D(w, {
128
133
  columns: [
129
134
  {
130
135
  id: "name",
131
136
  header: "Warehouse",
132
137
  accessorKey: "name",
133
138
  sortable: !0,
134
- cell: (e) => /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("p", {
139
+ cell: (e) => /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", {
135
140
  className: "font-medium",
136
141
  children: e.name
137
- }), /* @__PURE__ */ E("p", {
142
+ }), /* @__PURE__ */ D("p", {
138
143
  className: "text-sm text-text-secondary",
139
144
  children: e.code
140
145
  })] })
@@ -142,7 +147,7 @@ function j() {
142
147
  {
143
148
  id: "location",
144
149
  header: "Location",
145
- cell: (e) => /* @__PURE__ */ D("div", { children: [/* @__PURE__ */ E("p", { children: [e.address.city, e.address.state].filter(Boolean).join(", ") || "Not provided" }), /* @__PURE__ */ E("p", {
150
+ cell: (e) => /* @__PURE__ */ O("div", { children: [/* @__PURE__ */ D("p", { children: [e.address.city, e.address.state].filter(Boolean).join(", ") || "Not provided" }), /* @__PURE__ */ D("p", {
146
151
  className: "text-sm text-text-secondary",
147
152
  children: e.address.country || "Not provided"
148
153
  })] })
@@ -151,7 +156,7 @@ function j() {
151
156
  id: "type",
152
157
  header: "Type",
153
158
  accessorKey: "type",
154
- cell: (e) => /* @__PURE__ */ E(u, {
159
+ cell: (e) => /* @__PURE__ */ D(d, {
155
160
  variant: "outline",
156
161
  className: "capitalize",
157
162
  children: e.type.replace("_", " ")
@@ -162,15 +167,15 @@ function j() {
162
167
  header: "Utilization",
163
168
  cell: (e) => {
164
169
  let { totalSpace: t, usedSpace: n } = e.capacity, r = typeof t == "number" && t > 0 && typeof n == "number" ? n / t * 100 : void 0;
165
- return r === void 0 ? /* @__PURE__ */ E("span", {
170
+ return r === void 0 ? /* @__PURE__ */ D("span", {
166
171
  className: "text-sm text-text-secondary",
167
172
  children: "Not provided"
168
- }) : /* @__PURE__ */ D("div", {
173
+ }) : /* @__PURE__ */ O("div", {
169
174
  className: "flex items-center gap-2",
170
- children: [/* @__PURE__ */ E(m, {
175
+ children: [/* @__PURE__ */ D(h, {
171
176
  value: r,
172
177
  className: "w-16 h-2"
173
- }), /* @__PURE__ */ D("span", {
178
+ }), /* @__PURE__ */ O("span", {
174
179
  className: "text-sm",
175
180
  children: [r.toFixed(0), "%"]
176
181
  })]
@@ -182,7 +187,7 @@ function j() {
182
187
  header: "Capacity",
183
188
  cell: (e) => {
184
189
  let { totalSpace: t, usedSpace: n } = e.capacity;
185
- return typeof n == "number" && typeof t == "number" ? /* @__PURE__ */ D("p", {
190
+ return typeof n == "number" && typeof t == "number" ? /* @__PURE__ */ O("p", {
186
191
  className: "text-sm",
187
192
  children: [
188
193
  n.toLocaleString(),
@@ -190,7 +195,7 @@ function j() {
190
195
  t.toLocaleString(),
191
196
  " sq ft"
192
197
  ]
193
- }) : /* @__PURE__ */ E("span", {
198
+ }) : /* @__PURE__ */ D("span", {
194
199
  className: "text-sm text-text-secondary",
195
200
  children: "Not provided"
196
201
  });
@@ -201,37 +206,37 @@ function j() {
201
206
  header: "Status",
202
207
  cell: (e) => {
203
208
  let t = e.status?.toUpperCase() === "ACTIVE";
204
- return e.status ? /* @__PURE__ */ E(u, {
209
+ return e.status ? /* @__PURE__ */ D(d, {
205
210
  variant: t ? "default" : "secondary",
206
211
  children: t ? "Active" : "Inactive"
207
- }) : /* @__PURE__ */ E("span", {
212
+ }) : /* @__PURE__ */ D("span", {
208
213
  className: "text-sm text-text-secondary",
209
214
  children: "Not provided"
210
215
  });
211
216
  }
212
217
  }
213
218
  ],
214
- data: H,
215
- isLoading: G,
216
- error: K,
217
- onRetry: q,
219
+ data: W,
220
+ isLoading: q,
221
+ error: J,
222
+ onRetry: Y,
218
223
  searchable: !0,
219
224
  searchPlaceholder: "Search warehouses...",
220
225
  searchFields: ["name", "code"],
221
- searchQuery: L,
226
+ searchQuery: z,
222
227
  onSearchQueryChange: (e) => {
223
- R(e), P(0);
228
+ B(e), I(0);
224
229
  },
225
- onRowClick: (e) => X(`inventory/warehouses/${e.id}`),
230
+ onRowClick: (e) => Q(`inventory/warehouses/${e.id}`),
226
231
  getRowId: (e) => e.id,
227
- pageIndex: N,
228
- pageSize: F,
229
- onPageChange: P,
232
+ pageIndex: F,
233
+ pageSize: L,
234
+ onPageChange: I,
230
235
  onPageSizeChange: (e) => {
231
- I(e), P(0);
236
+ R(e), I(0);
232
237
  },
233
- totalItems: U,
234
- hasNextPage: W,
238
+ totalItems: G,
239
+ hasNextPage: K,
235
240
  emptyIllustration: "empty-data",
236
241
  emptyTitle: "No warehouses yet",
237
242
  emptyDescription: "Add a warehouse to store inventory and fulfil orders from it."
@@ -240,4 +245,4 @@ function j() {
240
245
  });
241
246
  }
242
247
  //#endregion
243
- export { j as default };
248
+ export { M as default };