@burdenoff/microfe-movethewheels 2026.925.1 → 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 (47) hide show
  1. package/dist/components/StatusBadge.js +31 -31
  2. package/dist/constants/index.js +19 -5
  3. package/dist/hooks/useCustomers.js +0 -3
  4. package/dist/hooks/useFleet.js +197 -175
  5. package/dist/hooks/useInventory.js +144 -145
  6. package/dist/hooks/useRoutes.js +5 -14
  7. package/dist/movethewheels/components/StatusBadge.d.ts +3 -1
  8. package/dist/movethewheels/constants/index.d.ts +2 -0
  9. package/dist/movethewheels/hooks/useFleet.d.ts +53 -1
  10. package/dist/movethewheels/hooks/useInventory.d.ts +10 -0
  11. package/dist/movethewheels/types/index.d.ts +29 -108
  12. package/dist/node_modules/lucide-react/dist/esm/icons/sticky-note.js +11 -0
  13. package/dist/node_modules/lucide-react/dist/esm/icons/user-x.js +30 -0
  14. package/dist/pages/CustomerDetailsPage.js +666 -344
  15. package/dist/pages/CustomersPage.js +71 -80
  16. package/dist/pages/DriverDetailsPage.js +702 -421
  17. package/dist/pages/DriversPage.js +106 -117
  18. package/dist/pages/FleetPage.js +5 -13
  19. package/dist/pages/InventoryPage.js +4 -4
  20. package/dist/pages/OrderDetailsPage.js +279 -274
  21. package/dist/pages/RouteDetailsPage.js +300 -263
  22. package/dist/pages/RoutesPage.js +130 -67
  23. package/dist/pages/VehicleDetailsPage.js +562 -287
  24. package/dist/pages/VehiclesPage.js +119 -70
  25. package/dist/pages/WarehouseDetailsPage.js +410 -370
  26. package/dist/pages/WarehousesPage.js +131 -82
  27. package/package.json +1 -1
  28. package/src/movethewheels/components/StatusBadge.tsx +16 -2
  29. package/src/movethewheels/constants/index.ts +21 -0
  30. package/src/movethewheels/hooks/useCustomers.ts +0 -3
  31. package/src/movethewheels/hooks/useFleet.ts +236 -62
  32. package/src/movethewheels/hooks/useInventory.ts +76 -32
  33. package/src/movethewheels/hooks/useRoutes.ts +17 -12
  34. package/src/movethewheels/pages/CustomerDetailsPage.tsx +376 -109
  35. package/src/movethewheels/pages/CustomersPage.tsx +6 -15
  36. package/src/movethewheels/pages/DriverDetailsPage.tsx +516 -156
  37. package/src/movethewheels/pages/DriversPage.tsx +28 -11
  38. package/src/movethewheels/pages/FleetPage.tsx +9 -11
  39. package/src/movethewheels/pages/InventoryPage.tsx +14 -5
  40. package/src/movethewheels/pages/OrderDetailsPage.tsx +12 -7
  41. package/src/movethewheels/pages/RouteDetailsPage.tsx +89 -41
  42. package/src/movethewheels/pages/RoutesPage.tsx +66 -2
  43. package/src/movethewheels/pages/VehicleDetailsPage.tsx +282 -20
  44. package/src/movethewheels/pages/VehiclesPage.tsx +68 -3
  45. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +213 -135
  46. package/src/movethewheels/pages/WarehousesPage.tsx +77 -16
  47. package/src/movethewheels/types/index.ts +30 -108
@@ -3,92 +3,91 @@ import { Download as t } from "../node_modules/lucide-react/dist/esm/icons/downl
3
3
  import { Plus as n } from "../node_modules/lucide-react/dist/esm/icons/plus.js";
4
4
  import { RefreshCw as r } from "../node_modules/lucide-react/dist/esm/icons/refresh-cw.js";
5
5
  import { Star as i } from "../node_modules/lucide-react/dist/esm/icons/star.js";
6
- import { UserCheck as a } from "../node_modules/lucide-react/dist/esm/icons/user-check.js";
7
- import { Users as o } from "../node_modules/lucide-react/dist/esm/icons/users.js";
8
- import { joinPath as s } from "../utils/navigation.js";
9
- import { useMoveTheWheels as c } from "../providers/MoveTheWheelsProvider.js";
10
- import { useCustomerStats as l, useCustomers as u } from "../hooks/useCustomers.js";
11
- import { Avatar as d, AvatarFallback as f, Badge as p, Button as m } from "../components/ui.js";
12
- import { PageLayout as h } from "../components/PageLayout.js";
13
- import { MetricCard as g, MetricGrid as _ } from "../components/MetricCard.js";
14
- import { TypeBadge as v } from "../components/StatusBadge.js";
15
- import { DataTable as y } from "../components/DataTable.js";
16
- import { formatDate as b } from "../utils/formatters.js";
17
- import { useDebouncedValue as x } from "../hooks/useDebouncedValue.js";
18
- import { useState as S } from "react";
19
- import { jsx as C, jsxs as w } from "react/jsx-runtime";
20
- import { CTAOverflowMenu as T, PagePurpose as E } from "@burdenoff/fe-libs/ui";
6
+ import { Users as a } from "../node_modules/lucide-react/dist/esm/icons/users.js";
7
+ import { joinPath as o } from "../utils/navigation.js";
8
+ import { useMoveTheWheels as s } from "../providers/MoveTheWheelsProvider.js";
9
+ import { useCustomerStats as c, useCustomers as l } from "../hooks/useCustomers.js";
10
+ import { Avatar as u, AvatarFallback as d, Button as f } from "../components/ui.js";
11
+ import { PageLayout as p } from "../components/PageLayout.js";
12
+ import { MetricCard as m, MetricGrid as h } from "../components/MetricCard.js";
13
+ import { TypeBadge as g } from "../components/StatusBadge.js";
14
+ import { DataTable as _ } from "../components/DataTable.js";
15
+ import { formatDate as v } from "../utils/formatters.js";
16
+ import { useDebouncedValue as y } from "../hooks/useDebouncedValue.js";
17
+ import { useState as b } from "react";
18
+ import { jsx as x, jsxs as S } from "react/jsx-runtime";
19
+ import { CTAOverflowMenu as C, PagePurpose as w } from "@burdenoff/fe-libs/ui";
21
20
  //#region src/movethewheels/pages/CustomersPage.tsx
22
- function D() {
23
- let { basePath: D, navigate: O } = c(), [k, A] = S(0), [j, M] = S(25), [N, P] = S(""), F = x(N), { customers: I, totalCustomers: L, hasMore: R, isLoading: z, error: B, refetch: V } = u({
24
- limit: j,
25
- offset: k * j,
26
- filters: { search: F }
27
- }), { stats: H } = l(), U = (e) => O?.(s(D, e));
28
- return /* @__PURE__ */ w(h, {
21
+ function T() {
22
+ let { basePath: T, navigate: E } = s(), [D, O] = b(0), [k, A] = b(25), [j, M] = b(""), N = y(j), { customers: P, totalCustomers: F, hasMore: I, isLoading: L, error: R, refetch: z } = l({
23
+ limit: k,
24
+ offset: D * k,
25
+ filters: { search: N }
26
+ }), { stats: B } = c(), V = (e) => E?.(o(T, e));
27
+ return /* @__PURE__ */ S(p, {
29
28
  title: "Customers",
30
- subtitle: `${H.total} customers`,
31
- icon: /* @__PURE__ */ C(o, { size: 24 }),
32
- headerActions: /* @__PURE__ */ C(T, {
29
+ subtitle: `${B.total} customers`,
30
+ icon: /* @__PURE__ */ x(a, { size: 24 }),
31
+ headerActions: /* @__PURE__ */ x(C, {
33
32
  primary: {
34
33
  label: "Add Customer",
35
- icon: /* @__PURE__ */ C(n, { size: 16 }),
36
- onSelect: () => U("customers/new")
34
+ icon: /* @__PURE__ */ x(n, { size: 16 }),
35
+ onSelect: () => V("customers/new")
37
36
  },
38
37
  actions: [{
39
38
  label: "Refresh",
40
- icon: /* @__PURE__ */ C(r, { size: 16 }),
41
- onSelect: () => V()
39
+ icon: /* @__PURE__ */ x(r, { size: 16 }),
40
+ onSelect: () => z()
42
41
  }, {
43
42
  label: "Export",
44
- icon: /* @__PURE__ */ C(t, { size: 16 }),
45
- onSelect: () => U("import-export")
43
+ icon: /* @__PURE__ */ x(t, { size: 16 }),
44
+ onSelect: () => V("import-export")
46
45
  }]
47
46
  }),
48
47
  children: [
49
- /* @__PURE__ */ C(E, {
50
- icon: /* @__PURE__ */ C(o, { size: 18 }),
48
+ /* @__PURE__ */ x(w, {
49
+ icon: /* @__PURE__ */ x(a, { size: 18 }),
51
50
  children: "The businesses and individuals you deliver for. Keep contact details, locations and satisfaction ratings here, and open a customer to see their order history before booking the next shipment."
52
51
  }),
53
- /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
52
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
54
53
  className: "mb-3 text-sm font-medium text-text-secondary",
55
54
  children: "Customer base at a glance"
56
- }), /* @__PURE__ */ w(_, {
55
+ }), /* @__PURE__ */ S(h, {
57
56
  columns: 3,
58
57
  children: [
59
- /* @__PURE__ */ C(g, {
58
+ /* @__PURE__ */ x(m, {
60
59
  label: "Total customers",
61
- value: H.total,
62
- icon: /* @__PURE__ */ C(o, { size: 20 }),
60
+ value: B.total,
61
+ icon: /* @__PURE__ */ x(a, { size: 20 }),
63
62
  accent: "brand"
64
63
  }),
65
- /* @__PURE__ */ C(g, {
66
- label: "Active",
67
- value: H.active,
68
- icon: /* @__PURE__ */ C(a, { size: 20 }),
64
+ /* @__PURE__ */ x(m, {
65
+ label: "Avg. rating",
66
+ value: B.avgRating > 0 ? B.avgRating.toFixed(1) : "—",
67
+ icon: /* @__PURE__ */ x(i, { size: 20 }),
69
68
  accent: "success",
70
- subtitle: "Currently transacting"
69
+ subtitle: "Across all customers"
71
70
  }),
72
- /* @__PURE__ */ C(g, {
71
+ /* @__PURE__ */ x(m, {
73
72
  label: "Business accounts",
74
- value: H.b2b,
75
- icon: /* @__PURE__ */ C(e, { size: 20 }),
73
+ value: B.b2b,
74
+ icon: /* @__PURE__ */ x(e, { size: 20 }),
76
75
  accent: "blue",
77
76
  subtitle: "B2B relationships"
78
77
  })
79
78
  ]
80
79
  })] }),
81
- /* @__PURE__ */ C(y, {
80
+ /* @__PURE__ */ x(_, {
82
81
  columns: [
83
82
  {
84
83
  id: "customer",
85
84
  header: "Customer",
86
- cell: (e) => /* @__PURE__ */ w("div", {
85
+ cell: (e) => /* @__PURE__ */ S("div", {
87
86
  className: "flex items-center gap-3",
88
- children: [/* @__PURE__ */ C(d, { children: /* @__PURE__ */ C(f, { children: e.name.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("p", {
87
+ children: [/* @__PURE__ */ x(u, { children: /* @__PURE__ */ x(d, { children: e.name.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
89
88
  className: "font-medium",
90
89
  children: e.name
91
- }), /* @__PURE__ */ C("p", {
90
+ }), /* @__PURE__ */ x("p", {
92
91
  className: "text-sm text-text-secondary",
93
92
  children: e.email
94
93
  })] })]
@@ -98,7 +97,7 @@ function D() {
98
97
  id: "type",
99
98
  header: "Type",
100
99
  accessorKey: "type",
101
- cell: (e) => /* @__PURE__ */ C(v, { type: e.type })
100
+ cell: (e) => /* @__PURE__ */ x(g, { type: e.type })
102
101
  },
103
102
  {
104
103
  id: "company",
@@ -119,20 +118,12 @@ function D() {
119
118
  {
120
119
  id: "rating",
121
120
  header: "Rating",
122
- cell: (e) => /* @__PURE__ */ w("div", {
121
+ cell: (e) => /* @__PURE__ */ S("div", {
123
122
  className: "flex items-center gap-1",
124
- children: [/* @__PURE__ */ C(i, {
123
+ children: [/* @__PURE__ */ x(i, {
125
124
  size: 14,
126
125
  className: "text-status-warning-text fill-current"
127
- }), /* @__PURE__ */ C("span", { children: e.rating.toFixed(1) })]
128
- })
129
- },
130
- {
131
- id: "status",
132
- header: "Status",
133
- cell: (e) => /* @__PURE__ */ C(p, {
134
- variant: e.isActive ? "default" : "secondary",
135
- children: e.isActive ? "Active" : "Inactive"
126
+ }), /* @__PURE__ */ x("span", { children: e.rating.toFixed(1) })]
136
127
  })
137
128
  },
138
129
  {
@@ -140,13 +131,13 @@ function D() {
140
131
  header: "Created",
141
132
  accessorKey: "createdAt",
142
133
  sortable: !0,
143
- cell: (e) => b(e.createdAt, "short")
134
+ cell: (e) => v(e.createdAt, "short")
144
135
  }
145
136
  ],
146
- data: I,
147
- isLoading: z,
148
- error: B,
149
- onRetry: V,
137
+ data: P,
138
+ isLoading: L,
139
+ error: R,
140
+ onRetry: z,
150
141
  searchable: !0,
151
142
  searchPlaceholder: "Search customers...",
152
143
  searchFields: [
@@ -154,26 +145,26 @@ function D() {
154
145
  "email",
155
146
  "company"
156
147
  ],
157
- searchQuery: N,
148
+ searchQuery: j,
158
149
  onSearchQueryChange: (e) => {
159
- P(e), A(0);
150
+ M(e), O(0);
160
151
  },
161
- onRowClick: (e) => U(`customers/${e.id}`),
152
+ onRowClick: (e) => V(`customers/${e.id}`),
162
153
  getRowId: (e) => e.id,
163
- pageIndex: k,
164
- pageSize: j,
165
- onPageChange: A,
154
+ pageIndex: D,
155
+ pageSize: k,
156
+ onPageChange: O,
166
157
  onPageSizeChange: (e) => {
167
- M(e), A(0);
158
+ A(e), O(0);
168
159
  },
169
- totalItems: L,
170
- hasNextPage: R,
160
+ totalItems: F,
161
+ hasNextPage: I,
171
162
  emptyIllustration: "empty-people",
172
163
  emptyTitle: "No customers yet",
173
164
  emptyDescription: "Add your first customer to start booking deliveries for them.",
174
- emptyAction: /* @__PURE__ */ w(m, {
175
- onClick: () => U("customers/new"),
176
- children: [/* @__PURE__ */ C(n, {
165
+ emptyAction: /* @__PURE__ */ S(f, {
166
+ onClick: () => V("customers/new"),
167
+ children: [/* @__PURE__ */ x(n, {
177
168
  size: 16,
178
169
  className: "mr-1.5"
179
170
  }), "Add Customer"]
@@ -183,4 +174,4 @@ function D() {
183
174
  });
184
175
  }
185
176
  //#endregion
186
- export { D as default };
177
+ export { T as default };