@burdenoff/microfe-movethewheels 2026.925.2 → 2026.925.3

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 (38) hide show
  1. package/dist/components/StatusBadge.js +30 -30
  2. package/dist/constants/index.js +12 -5
  3. package/dist/hooks/useCustomers.js +0 -3
  4. package/dist/hooks/useFleet.js +144 -131
  5. package/dist/hooks/useInventory.js +144 -145
  6. package/dist/hooks/useRoutes.js +5 -14
  7. package/dist/movethewheels/constants/index.d.ts +1 -0
  8. package/dist/movethewheels/hooks/useFleet.d.ts +13 -1
  9. package/dist/movethewheels/hooks/useInventory.d.ts +10 -0
  10. package/dist/movethewheels/types/index.d.ts +13 -70
  11. package/dist/pages/CustomerDetailsPage.js +666 -344
  12. package/dist/pages/CustomersPage.js +71 -80
  13. package/dist/pages/FleetPage.js +1 -3
  14. package/dist/pages/InventoryPage.js +4 -4
  15. package/dist/pages/RouteDetailsPage.js +273 -248
  16. package/dist/pages/RoutesPage.js +130 -67
  17. package/dist/pages/VehicleDetailsPage.js +506 -391
  18. package/dist/pages/VehiclesPage.js +119 -70
  19. package/dist/pages/WarehouseDetailsPage.js +410 -370
  20. package/dist/pages/WarehousesPage.js +131 -82
  21. package/package.json +1 -1
  22. package/src/movethewheels/components/StatusBadge.tsx +8 -3
  23. package/src/movethewheels/constants/index.ts +9 -0
  24. package/src/movethewheels/hooks/useCustomers.ts +0 -3
  25. package/src/movethewheels/hooks/useFleet.ts +74 -19
  26. package/src/movethewheels/hooks/useInventory.ts +76 -32
  27. package/src/movethewheels/hooks/useRoutes.ts +17 -12
  28. package/src/movethewheels/pages/CustomerDetailsPage.tsx +376 -109
  29. package/src/movethewheels/pages/CustomersPage.tsx +6 -15
  30. package/src/movethewheels/pages/FleetPage.tsx +2 -1
  31. package/src/movethewheels/pages/InventoryPage.tsx +14 -5
  32. package/src/movethewheels/pages/RouteDetailsPage.tsx +74 -34
  33. package/src/movethewheels/pages/RoutesPage.tsx +66 -2
  34. package/src/movethewheels/pages/VehicleDetailsPage.tsx +151 -11
  35. package/src/movethewheels/pages/VehiclesPage.tsx +68 -3
  36. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +213 -135
  37. package/src/movethewheels/pages/WarehousesPage.tsx +77 -16
  38. package/src/movethewheels/types/index.ts +14 -70
@@ -1,84 +1,147 @@
1
- import { Navigation as e } from "../node_modules/lucide-react/dist/esm/icons/navigation.js";
2
- import { Plus as t } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
3
- import { RefreshCw as n } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
4
- import { joinPath as r } from "../utils/navigation.js";
5
- import { useMoveTheWheels as i } from "../providers/MoveTheWheelsProvider.js";
6
- import { useRouteStats as a, useRoutes as o } from "../hooks/useRoutes.js";
7
- import { Badge as s, Button as c } from "../components/ui.js";
8
- import { PageLayout as l } from "../components/PageLayout.js";
9
- import { ROUTE_STATUS_COLORS as u } from "../constants/index.js";
10
- import { StatusBadge as d } from "../components/StatusBadge.js";
11
- import { DataTable as f } from "../components/DataTable.js";
12
- import { formatDate as p } from "../utils/formatters.js";
13
- import { useDebouncedValue as m } from "../hooks/useDebouncedValue.js";
14
- import { useState as h } from "react";
15
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
16
- import { CTAOverflowMenu as v, EmphasisPanel as y, PagePurpose as b } from "@burdenoff/fe-libs/ui";
1
+ import { Filter as e } from "../node_modules/lucide-react/dist/esm/icons/filter.js";
2
+ import { Navigation as t } from "../node_modules/lucide-react/dist/esm/icons/navigation.js";
3
+ import { Plus as n } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
4
+ import { RefreshCw as r } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
5
+ import { joinPath as i } from "../utils/navigation.js";
6
+ import { useMoveTheWheels as a } from "../providers/MoveTheWheelsProvider.js";
7
+ import { useRouteStats as o, useRoutes as s } from "../hooks/useRoutes.js";
8
+ import { Badge as c, Button as l, Card as u, CardContent as d, Select as f, SelectContent as p, SelectItem as m, SelectTrigger as h, SelectValue as g } from "../components/ui.js";
9
+ import { PageLayout as _ } from "../components/PageLayout.js";
10
+ import { ROUTE_STATUS_COLORS as v } from "../constants/index.js";
11
+ import { StatusBadge as y } from "../components/StatusBadge.js";
12
+ import { DataTable as b } from "../components/DataTable.js";
13
+ import { formatDate as x } from "../utils/formatters.js";
14
+ import { useDebouncedValue as S } from "../hooks/useDebouncedValue.js";
15
+ import { useState as C } from "react";
16
+ import { jsx as w, jsxs as T } from "react/jsx-runtime";
17
+ import { CTAOverflowMenu as E, EmphasisPanel as D, PagePurpose as O } from "@burdenoff/fe-libs/ui";
17
18
  //#region src/movethewheels/pages/RoutesPage.tsx
18
- function x() {
19
- let { basePath: x, navigate: S } = i(), [C, w] = h(0), [T, E] = h(25), [D, O] = h(""), k = m(D), { routes: A, totalRoutes: j, hasMore: M, isLoading: N, error: P, refetch: F } = o({
20
- limit: T,
21
- offset: C * T,
22
- search: k || void 0
23
- }), { stats: I } = a(), L = (e) => S?.(r(x, e));
24
- return /* @__PURE__ */ _(l, {
19
+ var k = [
20
+ {
21
+ value: "all",
22
+ label: "All statuses"
23
+ },
24
+ {
25
+ value: "planned",
26
+ label: "Planned"
27
+ },
28
+ {
29
+ value: "in_progress",
30
+ label: "In Progress"
31
+ },
32
+ {
33
+ value: "completed",
34
+ label: "Completed"
35
+ },
36
+ {
37
+ value: "cancelled",
38
+ label: "Cancelled"
39
+ }
40
+ ];
41
+ function A() {
42
+ let { basePath: A, navigate: j } = a(), [M, N] = C(0), [P, F] = C(25), [I, L] = C(""), [R, z] = C("all"), B = S(I), { routes: V, totalRoutes: H, hasMore: U, isLoading: W, error: G, refetch: K } = s({
43
+ limit: P,
44
+ offset: M * P,
45
+ search: B || void 0,
46
+ status: R === "all" ? void 0 : R
47
+ }), q = R !== "all" || I.length > 0, { stats: J } = o(), Y = (e) => j?.(i(A, e));
48
+ return /* @__PURE__ */ T(_, {
25
49
  title: "Routes",
26
- subtitle: `${I.totalRoutes} routes`,
27
- icon: /* @__PURE__ */ g(e, { size: 24 }),
28
- headerActions: /* @__PURE__ */ g(v, {
50
+ subtitle: `${J.totalRoutes} routes`,
51
+ icon: /* @__PURE__ */ w(t, { size: 24 }),
52
+ headerActions: /* @__PURE__ */ w(E, {
29
53
  primary: {
30
54
  label: "Create Route",
31
- icon: /* @__PURE__ */ g(t, { size: 16 }),
32
- onSelect: () => L("routes/new")
55
+ icon: /* @__PURE__ */ w(n, { size: 16 }),
56
+ onSelect: () => Y("routes/new")
33
57
  },
34
58
  actions: [{
35
59
  label: "Refresh",
36
- icon: /* @__PURE__ */ g(n, { size: 16 }),
37
- onSelect: () => F()
60
+ icon: /* @__PURE__ */ w(r, { size: 16 }),
61
+ onSelect: () => K()
38
62
  }]
39
63
  }),
40
64
  children: [
41
- /* @__PURE__ */ g(b, {
42
- icon: /* @__PURE__ */ g(e, { size: 18 }),
65
+ /* @__PURE__ */ w(O, {
66
+ icon: /* @__PURE__ */ w(t, { size: 18 }),
43
67
  children: "Routes group multiple delivery stops into an optimized driving plan. Build a route to batch nearby drop-offs, cut distance and fuel, and give drivers a single ordered itinerary — then open one to review stops, distance and optimization status."
44
68
  }),
45
- /* @__PURE__ */ _(y, { children: [/* @__PURE__ */ g("p", {
69
+ /* @__PURE__ */ T(D, { children: [/* @__PURE__ */ w("p", {
46
70
  className: "text-sm font-medium text-text-secondary",
47
71
  children: "Routes at a glance"
48
- }), /* @__PURE__ */ _("div", {
72
+ }), /* @__PURE__ */ T("div", {
49
73
  className: "mt-3 grid grid-cols-3 gap-4",
50
74
  children: [
51
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
75
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
52
76
  className: "text-2xl font-bold text-text-primary tabular-nums",
53
- children: I.totalRoutes
54
- }), /* @__PURE__ */ g("p", {
77
+ children: J.totalRoutes
78
+ }), /* @__PURE__ */ w("p", {
55
79
  className: "text-xs text-text-secondary",
56
80
  children: "Total routes"
57
81
  })] }),
58
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
82
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
59
83
  className: "text-2xl font-bold text-text-primary tabular-nums",
60
- children: I.inProgressRoutes
61
- }), /* @__PURE__ */ g("p", {
84
+ children: J.inProgressRoutes
85
+ }), /* @__PURE__ */ w("p", {
62
86
  className: "text-xs text-text-secondary",
63
87
  children: "In progress"
64
88
  })] }),
65
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
89
+ /* @__PURE__ */ T("div", { children: [/* @__PURE__ */ w("p", {
66
90
  className: "text-2xl font-bold text-text-primary tabular-nums",
67
- children: I.optimizedRoutes
68
- }), /* @__PURE__ */ g("p", {
91
+ children: J.optimizedRoutes
92
+ }), /* @__PURE__ */ w("p", {
69
93
  className: "text-xs text-text-secondary",
70
94
  children: "Optimized"
71
95
  })] })
72
96
  ]
73
97
  })] }),
74
- /* @__PURE__ */ g(f, {
98
+ /* @__PURE__ */ w(u, { children: /* @__PURE__ */ w(d, {
99
+ className: "p-4",
100
+ children: /* @__PURE__ */ T("div", {
101
+ className: "flex flex-wrap items-center gap-4",
102
+ children: [
103
+ /* @__PURE__ */ T("div", {
104
+ className: "flex items-center gap-2",
105
+ children: [/* @__PURE__ */ w(e, {
106
+ size: 16,
107
+ className: "text-text-secondary"
108
+ }), /* @__PURE__ */ w("span", {
109
+ className: "text-sm font-medium",
110
+ children: "Filters:"
111
+ })]
112
+ }),
113
+ /* @__PURE__ */ T(f, {
114
+ value: R,
115
+ onValueChange: (e) => {
116
+ z(e), N(0);
117
+ },
118
+ children: [/* @__PURE__ */ w(h, {
119
+ className: "w-[180px]",
120
+ children: /* @__PURE__ */ w(g, { placeholder: "Status" })
121
+ }), /* @__PURE__ */ w(p, { children: k.map((e) => /* @__PURE__ */ w(m, {
122
+ value: e.value,
123
+ children: e.label
124
+ }, e.value)) })]
125
+ }),
126
+ q && /* @__PURE__ */ w(l, {
127
+ variant: "ghost",
128
+ size: "sm",
129
+ onClick: () => {
130
+ z("all"), L(""), N(0);
131
+ },
132
+ children: "Clear filters"
133
+ })
134
+ ]
135
+ })
136
+ }) }),
137
+ /* @__PURE__ */ w(b, {
75
138
  columns: [
76
139
  {
77
140
  id: "name",
78
141
  header: "Route Name",
79
142
  accessorKey: "name",
80
143
  sortable: !0,
81
- cell: (e) => /* @__PURE__ */ g("span", {
144
+ cell: (e) => /* @__PURE__ */ w("span", {
82
145
  className: "font-medium",
83
146
  children: e.name
84
147
  })
@@ -88,15 +151,15 @@ function x() {
88
151
  header: "Status",
89
152
  accessorKey: "status",
90
153
  sortable: !0,
91
- cell: (e) => /* @__PURE__ */ g(d, {
154
+ cell: (e) => /* @__PURE__ */ w(y, {
92
155
  status: e.status,
93
- customColors: u[e.status]
156
+ customColors: v[e.status]
94
157
  })
95
158
  },
96
159
  {
97
160
  id: "stops",
98
161
  header: "Stops",
99
- cell: (e) => /* @__PURE__ */ _(s, {
162
+ cell: (e) => /* @__PURE__ */ T(c, {
100
163
  variant: "secondary",
101
164
  children: [e.stops.length, " stops"]
102
165
  })
@@ -116,7 +179,7 @@ function x() {
116
179
  {
117
180
  id: "optimized",
118
181
  header: "Optimized",
119
- cell: (e) => /* @__PURE__ */ g(s, {
182
+ cell: (e) => /* @__PURE__ */ w(c, {
120
183
  variant: e.optimized ? "default" : "outline",
121
184
  children: e.optimized ? "Yes" : "No"
122
185
  })
@@ -126,36 +189,36 @@ function x() {
126
189
  header: "Created",
127
190
  accessorKey: "createdAt",
128
191
  sortable: !0,
129
- cell: (e) => p(e.createdAt, "short")
192
+ cell: (e) => x(e.createdAt, "short")
130
193
  }
131
194
  ],
132
- data: A,
133
- isLoading: N,
134
- error: P,
135
- onRetry: F,
195
+ data: V,
196
+ isLoading: W,
197
+ error: G,
198
+ onRetry: K,
136
199
  searchable: !0,
137
200
  searchPlaceholder: "Search routes...",
138
201
  searchFields: ["name"],
139
- searchQuery: D,
202
+ searchQuery: I,
140
203
  onSearchQueryChange: (e) => {
141
- O(e), w(0);
204
+ L(e), N(0);
142
205
  },
143
- onRowClick: (e) => L(`routes/${e.id}`),
206
+ onRowClick: (e) => Y(`routes/${e.id}`),
144
207
  getRowId: (e) => e.id,
145
- pageIndex: C,
146
- pageSize: T,
147
- onPageChange: w,
208
+ pageIndex: M,
209
+ pageSize: P,
210
+ onPageChange: N,
148
211
  onPageSizeChange: (e) => {
149
- E(e), w(0);
212
+ F(e), N(0);
150
213
  },
151
- totalItems: j,
152
- hasNextPage: M,
214
+ totalItems: H,
215
+ hasNextPage: U,
153
216
  emptyIllustration: "empty-data",
154
217
  emptyTitle: "No routes yet",
155
218
  emptyDescription: "Create a route to batch deliveries into an optimized driving plan.",
156
- emptyAction: /* @__PURE__ */ _(c, {
157
- onClick: () => L("routes/new"),
158
- children: [/* @__PURE__ */ g(t, {
219
+ emptyAction: /* @__PURE__ */ T(l, {
220
+ onClick: () => Y("routes/new"),
221
+ children: [/* @__PURE__ */ w(n, {
159
222
  size: 16,
160
223
  className: "mr-1.5"
161
224
  }), "Create Route"]
@@ -165,4 +228,4 @@ function x() {
165
228
  });
166
229
  }
167
230
  //#endregion
168
- export { x as default };
231
+ export { A as default };