@burdenoff/microfe-movethewheels 2026.703.4 → 2026.703.6

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 (150) hide show
  1. package/dist/{AIAssistantPage-3YOnHO9Y.js → AIAssistantPage-BmILdHgO.js} +16 -15
  2. package/dist/AnalyticsPage-BSlsiSDE.js +194 -0
  3. package/dist/{CreateOrderPage-DRAgGo9i.js → CreateOrderPage-DaCgVaO3.js} +40 -40
  4. package/dist/{CustomerDetailsPage-BCeMmOFe.js → CustomerDetailsPage-DErpbafW.js} +71 -71
  5. package/dist/CustomersPage-C1lRU6xs.js +205 -0
  6. package/dist/DashboardPage-Q5-5EKAU.js +542 -0
  7. package/dist/{DataTable-XvUcTjwi.js → DataTable-KjzbwnRL.js} +31 -31
  8. package/dist/{DocumentsCard-U2lSe-cn.js → DocumentsCard-T9y6cv4-.js} +25 -25
  9. package/dist/{DriverDetailsPage-BQrYd_Lp.js → DriverDetailsPage-DnHGkDC7.js} +64 -64
  10. package/dist/DriversPage-C0ujWVOn.js +221 -0
  11. package/dist/FinancePage-CA2XEgsQ.js +175 -0
  12. package/dist/{FleetPage-3ZHsB-TN.js → FleetPage-DrvXW7wK.js} +22 -22
  13. package/dist/{FormError-cuLV2jVD.js → FormError-CRsMP7TQ.js} +1 -1
  14. package/dist/{ImportExportPage-C6f7DqhM.js → ImportExportPage-Cac9HjFx.js} +12 -12
  15. package/dist/InventoryPage-Ezf4gqKI.js +259 -0
  16. package/dist/LiveTrackingPage-CzbVwDqK.js +429 -0
  17. package/dist/{MarketplacePage-Bh_2ns4v.js → MarketplacePage-BHDmSQmo.js} +116 -116
  18. package/dist/MetricCard-DQlDNqmK.js +191 -0
  19. package/dist/{Notice-CSoDYKw9.js → Notice-GmA7JDR3.js} +2 -2
  20. package/dist/{OrderDetailsPage-zCj0lW0j.js → OrderDetailsPage-CR0Wc1aN.js} +58 -58
  21. package/dist/OrdersListPage-C8Bu6wXM.js +386 -0
  22. package/dist/{PageLayout-D4LDHJJq.js → PageLayout-DX1Ou6V6.js} +164 -134
  23. package/dist/{ProductDetailsPage-wsxAQkA0.js → ProductDetailsPage-B_ns2MOe.js} +55 -55
  24. package/dist/ProductsPage-c92BsEoA.js +186 -0
  25. package/dist/ReportsPage-CPLXtLT2.js +377 -0
  26. package/dist/{RouteDetailsPage-DyMJE9AS.js → RouteDetailsPage-DOfcRiFv.js} +208 -181
  27. package/dist/{RoutesPage-Dtc669yc.js → RoutesPage-BZGublby.js} +12 -12
  28. package/dist/{SettingsPage-CpH9xhQg.js → SettingsPage-5cweX_xh.js} +15 -15
  29. package/dist/Sparkline-zSXvG6vA.js +16729 -0
  30. package/dist/{StatusBadge-C87mDpDP.js → StatusBadge-oZjownr1.js} +7 -7
  31. package/dist/TrackingPage-Ln9qVflK.js +368 -0
  32. package/dist/{VehicleDetailsPage-DldYNsYV.js → VehicleDetailsPage-CrkzE0dN.js} +53 -53
  33. package/dist/VehiclesPage-CTQWH7af.js +184 -0
  34. package/dist/{WarehouseDetailsPage-CMG7or6G.js → WarehouseDetailsPage-CwDLaG65.js} +64 -64
  35. package/dist/WarehousesPage-KW02DvZg.js +182 -0
  36. package/dist/{arrow-left-n48Y-Wis.js → arrow-left-DJDw_Yqv.js} +1 -1
  37. package/dist/{arrow-right-Q3XQpTPR.js → arrow-right-Cb2fLTPJ.js} +1 -1
  38. package/dist/{arrow-up-xNF1zJUG.js → arrow-up-PxaOIyiT.js} +1 -1
  39. package/dist/{box-Eu05PXDh.js → box-hSJVtvGf.js} +1 -1
  40. package/dist/boxes-DDnxEkT5.js +54 -0
  41. package/dist/{chart-column-ouzgxIv_.js → chart-column-xXgAZvRl.js} +1 -1
  42. package/dist/charts-CfCwQg6o.js +2018 -0
  43. package/dist/{chevron-left-B2_r0Elx.js → chevron-left-dhEGJYdh.js} +1 -1
  44. package/dist/{chevron-right-eV4LjaSi.js → chevron-right-Cud2NDvm.js} +1 -1
  45. package/dist/chunk-BdsCSvBP.js +20 -0
  46. package/dist/{circle-alert-Bzh2DBSF.js → circle-alert-Rx0p3D5w.js} +1 -1
  47. package/dist/circle-check-BCxRFdFo.js +13 -0
  48. package/dist/{circle-check-big-CGMSpQmD.js → circle-check-big-BcIJ8xjx.js} +1 -1
  49. package/dist/{clock-Bl3ptexL.js → clock-B2_YxJgB.js} +1 -1
  50. package/dist/{dollar-sign-CAVU95SO.js → dollar-sign-CQmAICv4.js} +1 -1
  51. package/dist/{download-C5NbvVDc.js → download-CG4Tponq.js} +1 -1
  52. package/dist/{file-text-D-1uvLZG.js → file-text-CzH-zMub.js} +1 -1
  53. package/dist/{filter-DUfUg6BO.js → filter-C0u2Lwfn.js} +1 -1
  54. package/dist/{fuel-B6_lnKDs.js → fuel-C2KELcM-.js} +1 -1
  55. package/dist/index.css +2 -0
  56. package/dist/index.js +214 -225
  57. package/dist/{map-C-M-FQLR.js → map-FuPu5aTw.js} +1 -1
  58. package/dist/{map-pin-Dznl5l40.js → map-pin-czpLv9uy.js} +1 -1
  59. package/dist/mapMarkers-NCV9MRKR.js +28 -0
  60. package/dist/maps-D9m7PKrs.js +5070 -0
  61. package/dist/{navigation-BJSJl-VG.js → navigation-D5_pdCSS.js} +1 -1
  62. package/dist/{package-CcRttV2N.js → package-B0sdi6lU.js} +1 -1
  63. package/dist/{phone-DVSZHt_j.js → phone-V2nuzPu9.js} +1 -1
  64. package/dist/{plus-C_XZDwBz.js → plus-BqQxkfoU.js} +1 -1
  65. package/dist/{refresh-cw-CfgN67l3.js → refresh-cw-CEOAPEcV.js} +1 -1
  66. package/dist/route-CZWcW-Dw.js +22 -0
  67. package/dist/{save-DJE8Fpdv.js → save-DDFvrxWl.js} +1 -1
  68. package/dist/{search-D_VyGcZT.js → search-D7Ya6jxj.js} +1 -1
  69. package/dist/{square-pen-D-6JYrVQ.js → square-pen-DoZZS4Lw.js} +1 -1
  70. package/dist/{star-BpRlUZuU.js → star-B7PgVu5j.js} +1 -1
  71. package/dist/{store-B-8HMuyZ.js → store-YVzcIG4A.js} +1 -1
  72. package/dist/{trash-2-8vmv-XV_.js → trash-2-BegnBzwI.js} +1 -1
  73. package/dist/{trending-up-Dz6PqPRj.js → trending-up-DBd3XNdb.js} +1 -1
  74. package/dist/{triangle-alert-D7Y3J_4z.js → triangle-alert-Bxk3Kgs6.js} +1 -1
  75. package/dist/{truck-D-y2IDzv.js → truck-Clrn0oHp.js} +1 -1
  76. package/dist/{upload-CHZofOqb.js → upload-Df5JmMwH.js} +1 -1
  77. package/dist/{useAssistant-DVW4QgQb.js → useAssistant-Cb8nnIVC.js} +11 -28
  78. package/dist/{useCustomers-BPW4__PR.js → useCustomers-Dq2IR2HQ.js} +1 -1
  79. package/dist/{useFleet-ChBkxAd6.js → useFleet-CapnWBcA.js} +1 -1
  80. package/dist/{useImportExport-DrPDHEDK.js → useImportExport-BoGzrlJy.js} +1 -1
  81. package/dist/{useInventory-CAAVMRp6.js → useInventory-Ci6M2d9f.js} +1 -1
  82. package/dist/{useOrders-B465S2nt.js → useOrders-BuQU1OHX.js} +1 -1
  83. package/dist/{useReports-jQ3GpNOm.js → useReports-DIx8W7CO.js} +1 -1
  84. package/dist/{useRoutes-hS3d5-xr.js → useRoutes-D7EvI_pm.js} +1 -1
  85. package/dist/{useSettings-BB8X2RLh.js → useSettings-BhX251UQ.js} +6 -6
  86. package/dist/{useTracking-RjGz9PZG.js → useTracking-C40jmZ6W.js} +3 -3
  87. package/dist/{user-DzfTn4dE.js → user-BlcJrbtE.js} +1 -1
  88. package/dist/{user-check-BEKRCi7v.js → user-check-DtnQmimP.js} +1 -1
  89. package/dist/{users-CCrq-w0C.js → users-Cvwko-Dx.js} +1 -1
  90. package/dist/{warehouse-CaqfmMKh.js → warehouse-LWLVTk6G.js} +1 -1
  91. package/dist/{wrench-q_rgJfaP.js → wrench-Cme0RbyR.js} +1 -1
  92. package/dist/{x-tMeDMcCw.js → x-D8C9Pg5V.js} +1 -1
  93. package/package.json +5 -1
  94. package/src/movethewheels/components/GlassPanel.tsx +71 -0
  95. package/src/movethewheels/components/MetricCard.tsx +171 -73
  96. package/src/movethewheels/components/StatusBadge.tsx +7 -6
  97. package/src/movethewheels/components/charts/ChartShell.tsx +78 -0
  98. package/src/movethewheels/components/charts/Sparkline.tsx +85 -0
  99. package/src/movethewheels/components/charts/StatusDonut.tsx +115 -0
  100. package/src/movethewheels/components/charts/TrendChart.tsx +179 -0
  101. package/src/movethewheels/components/charts/VolumeBar.tsx +97 -0
  102. package/src/movethewheels/components/charts/chartTokens.ts +43 -0
  103. package/src/movethewheels/components/charts/index.ts +9 -0
  104. package/src/movethewheels/components/index.ts +44 -1
  105. package/src/movethewheels/components/maps/LogisticsMap.tsx +94 -0
  106. package/src/movethewheels/components/maps/MapCanvas.tsx +118 -0
  107. package/src/movethewheels/components/maps/RouteMap.tsx +71 -0
  108. package/src/movethewheels/components/maps/TrackingMap.tsx +102 -0
  109. package/src/movethewheels/components/maps/index.ts +16 -0
  110. package/src/movethewheels/components/maps/leaflet-setup.ts +124 -0
  111. package/src/movethewheels/components/maps/map-markers.css +121 -0
  112. package/src/movethewheels/hooks/useAnalytics.ts +14 -4
  113. package/src/movethewheels/pages/AnalyticsPage.tsx +93 -73
  114. package/src/movethewheels/pages/CreateOrderPage.tsx +4 -4
  115. package/src/movethewheels/pages/CustomersPage.tsx +29 -20
  116. package/src/movethewheels/pages/DashboardPage.tsx +238 -12
  117. package/src/movethewheels/pages/DriverDetailsPage.tsx +1 -1
  118. package/src/movethewheels/pages/DriversPage.tsx +35 -24
  119. package/src/movethewheels/pages/FinancePage.tsx +68 -30
  120. package/src/movethewheels/pages/InventoryPage.tsx +15 -3
  121. package/src/movethewheels/pages/LiveTrackingPage.tsx +124 -16
  122. package/src/movethewheels/pages/OrdersListPage.tsx +46 -38
  123. package/src/movethewheels/pages/ProductsPage.tsx +28 -24
  124. package/src/movethewheels/pages/ReportsPage.tsx +23 -0
  125. package/src/movethewheels/pages/RouteDetailsPage.tsx +46 -7
  126. package/src/movethewheels/pages/SettingsPage.tsx +2 -2
  127. package/src/movethewheels/pages/TrackingPage.tsx +76 -6
  128. package/src/movethewheels/pages/VehicleDetailsPage.tsx +1 -1
  129. package/src/movethewheels/pages/VehiclesPage.tsx +34 -24
  130. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +1 -1
  131. package/src/movethewheels/pages/WarehousesPage.tsx +28 -22
  132. package/src/movethewheels/types/index.ts +1 -1
  133. package/src/movethewheels/utils/graphqlClient.ts +81 -31
  134. package/src/movethewheels/utils/mapMarkers.ts +58 -0
  135. package/dist/AnalyticsPage-CMpI1070.js +0 -215
  136. package/dist/CustomersPage-CaNBMXmM.js +0 -172
  137. package/dist/DashboardPage-DIKlXde3.js +0 -387
  138. package/dist/DriversPage-PYmdFiby.js +0 -176
  139. package/dist/FinancePage-Cwh9Bw4M.js +0 -136
  140. package/dist/InventoryPage-DpiqVu1v.js +0 -253
  141. package/dist/LiveTrackingPage-FAzzlVnX.js +0 -379
  142. package/dist/MetricCard-CVBVpu7o.js +0 -146
  143. package/dist/OrdersListPage-CAMsuUck.js +0 -384
  144. package/dist/ProductsPage-DC5qDLfz.js +0 -180
  145. package/dist/ReportsPage-BwUJ37eO.js +0 -356
  146. package/dist/TrackingPage-DaNEFG_h.js +0 -325
  147. package/dist/VehiclesPage-BFw13iMt.js +0 -176
  148. package/dist/WarehousesPage-Wkytnt86.js +0 -173
  149. package/dist/useAnalytics-D7HW2XRb.js +0 -347
  150. /package/dist/{formatters-BQr-aR5W.js → formatters-FWJDwTFv.js} +0 -0
@@ -1,26 +1,26 @@
1
- import { A as e, F as t, I as n, L as r, P as i, R as a, ct as o, d as s, f as c, g as l, h as u, i as d, j as f, l as p, lt as m, n as h, ot as g, r as _, u as v } from "./PageLayout-D4LDHJJq.js";
2
- import { t as y } from "./arrow-left-n48Y-Wis.js";
3
- import { t as b } from "./file-text-D-1uvLZG.js";
4
- import { n as x, t as S } from "./Notice-CSoDYKw9.js";
5
- import { n as ee, t as te } from "./phone-DVSZHt_j.js";
6
- import { t as ne } from "./map-pin-Dznl5l40.js";
7
- import { t as C } from "./package-CcRttV2N.js";
8
- import { t as w } from "./save-DJE8Fpdv.js";
9
- import { t as T } from "./square-pen-D-6JYrVQ.js";
10
- import { t as re } from "./star-BpRlUZuU.js";
11
- import { t as E } from "./users-CCrq-w0C.js";
12
- import { t as ie } from "./x-tMeDMcCw.js";
13
- import { r as ae } from "./useOrders-B465S2nt.js";
14
- import { r as D, t as O } from "./useCustomers-BPW4__PR.js";
15
- import { i as k, r as oe } from "./StatusBadge-C87mDpDP.js";
16
- import { t as A } from "./FormError-cuLV2jVD.js";
17
- import { n as se, r as j, t as ce } from "./formatters-BQr-aR5W.js";
1
+ import { A as e, F as t, I as n, L as r, P as i, R as a, d as o, f as s, g as c, h as l, i as u, j as d, l as f, lt as p, n as m, r as h, st as g, u as _, ut as v } from "./PageLayout-DX1Ou6V6.js";
2
+ import { t as y } from "./arrow-left-DJDw_Yqv.js";
3
+ import { t as b } from "./file-text-CzH-zMub.js";
4
+ import { n as x, t as S } from "./Notice-GmA7JDR3.js";
5
+ import { n as ee, t as te } from "./phone-V2nuzPu9.js";
6
+ import { t as ne } from "./map-pin-czpLv9uy.js";
7
+ import { t as C } from "./package-B0sdi6lU.js";
8
+ import { t as w } from "./save-DDFvrxWl.js";
9
+ import { t as T } from "./square-pen-DoZZS4Lw.js";
10
+ import { t as re } from "./star-B7PgVu5j.js";
11
+ import { t as E } from "./users-Cvwko-Dx.js";
12
+ import { t as ie } from "./x-D8C9Pg5V.js";
13
+ import { r as ae } from "./useOrders-BuQU1OHX.js";
14
+ import { r as D, t as O } from "./useCustomers-Dq2IR2HQ.js";
15
+ import { i as k, r as oe } from "./StatusBadge-oZjownr1.js";
16
+ import { t as A } from "./FormError-CRsMP7TQ.js";
17
+ import { n as se, r as j, t as ce } from "./formatters-FWJDwTFv.js";
18
18
  import { useEffect as le, useState as M } from "react";
19
19
  import { useParams as ue } from "react-router-dom";
20
20
  import { Fragment as de, jsx as N, jsxs as P } from "react/jsx-runtime";
21
21
  import { EmphasisPanel as F, NextSteps as I, PagePurpose as L } from "@burdenoff/fe-libs/ui";
22
22
  //#region node_modules/lucide-react/dist/esm/icons/building.js
23
- var R = m("Building", [
23
+ var R = v("Building", [
24
24
  ["rect", {
25
25
  width: "16",
26
26
  height: "20",
@@ -84,43 +84,43 @@ function z(e) {
84
84
  }
85
85
  }
86
86
  function B() {
87
- let { basePath: s, navigate: c } = g(), { createCustomer: l } = D(), [u, p] = M({
87
+ let { basePath: o, navigate: s } = g(), { createCustomer: c } = D(), [l, f] = M({
88
88
  name: "",
89
89
  type: "b2c",
90
90
  email: "",
91
91
  phone: "",
92
92
  company: ""
93
- }), [m, h] = M(!1), [_, b] = M(null), x = () => c?.(o(s, "customers")), S = async (e) => {
94
- if (e.preventDefault(), !u.name.trim()) {
93
+ }), [m, h] = M(!1), [v, b] = M(null), x = () => s?.(p(o, "customers")), S = async (e) => {
94
+ if (e.preventDefault(), !l.name.trim()) {
95
95
  b("Customer name is required.");
96
96
  return;
97
97
  }
98
98
  h(!0), b(null);
99
99
  try {
100
- let e = await l({
101
- name: u.name.trim(),
102
- type: u.type,
103
- email: u.email.trim() || void 0,
104
- phone: u.phone.trim() || void 0,
105
- company: u.company.trim() || void 0
100
+ let e = await c({
101
+ name: l.name.trim(),
102
+ type: l.type,
103
+ email: l.email.trim() || void 0,
104
+ phone: l.phone.trim() || void 0,
105
+ company: l.company.trim() || void 0
106
106
  });
107
- c?.(o(s, `customers/${e.id}`));
107
+ s?.(p(o, `customers/${e.id}`));
108
108
  } catch (e) {
109
109
  console.error("Failed to create customer:", e), b(e instanceof Error ? e.message : "Failed to create customer. Please try again."), h(!1);
110
110
  }
111
111
  };
112
- return /* @__PURE__ */ P(d, {
112
+ return /* @__PURE__ */ P(u, {
113
113
  title: "New Customer",
114
114
  subtitle: "Add a new customer to your account",
115
115
  icon: /* @__PURE__ */ N(E, { size: 24 }),
116
116
  headerActions: /* @__PURE__ */ P("div", {
117
117
  className: "flex gap-2",
118
- children: [/* @__PURE__ */ P(v, {
118
+ children: [/* @__PURE__ */ P(_, {
119
119
  variant: "outline",
120
120
  onClick: x,
121
121
  disabled: m,
122
122
  children: [/* @__PURE__ */ N(y, { size: 16 }), " Cancel"]
123
- }), /* @__PURE__ */ P(v, {
123
+ }), /* @__PURE__ */ P(_, {
124
124
  onClick: S,
125
125
  disabled: m,
126
126
  children: [
@@ -136,7 +136,7 @@ function B() {
136
136
  }), /* @__PURE__ */ P("form", {
137
137
  onSubmit: S,
138
138
  className: "max-w-2xl space-y-6",
139
- children: [/* @__PURE__ */ N(A, { message: _ }), /* @__PURE__ */ P(F, { children: [/* @__PURE__ */ N("h2", {
139
+ children: [/* @__PURE__ */ N(A, { message: v }), /* @__PURE__ */ P(F, { children: [/* @__PURE__ */ N("h2", {
140
140
  className: "text-base font-semibold text-text-primary mb-4",
141
141
  children: "Customer Details"
142
142
  }), /* @__PURE__ */ P("div", {
@@ -146,7 +146,7 @@ function B() {
146
146
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
147
147
  children: [/* @__PURE__ */ P("div", {
148
148
  className: "space-y-2",
149
- children: [/* @__PURE__ */ P(f, {
149
+ children: [/* @__PURE__ */ P(d, {
150
150
  htmlFor: "name",
151
151
  children: ["Name ", /* @__PURE__ */ N("span", {
152
152
  className: "text-status-error-text",
@@ -154,8 +154,8 @@ function B() {
154
154
  })]
155
155
  }), /* @__PURE__ */ N(e, {
156
156
  id: "name",
157
- value: u.name,
158
- onChange: (e) => p((t) => ({
157
+ value: l.name,
158
+ onChange: (e) => f((t) => ({
159
159
  ...t,
160
160
  name: e.target.value
161
161
  })),
@@ -164,12 +164,12 @@ function B() {
164
164
  })]
165
165
  }), /* @__PURE__ */ P("div", {
166
166
  className: "space-y-2",
167
- children: [/* @__PURE__ */ N(f, {
167
+ children: [/* @__PURE__ */ N(d, {
168
168
  htmlFor: "type",
169
169
  children: "Customer Type"
170
170
  }), /* @__PURE__ */ P(i, {
171
- value: u.type,
172
- onValueChange: (e) => p((t) => ({
171
+ value: l.type,
172
+ onValueChange: (e) => f((t) => ({
173
173
  ...t,
174
174
  type: e
175
175
  })),
@@ -190,14 +190,14 @@ function B() {
190
190
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
191
191
  children: [/* @__PURE__ */ P("div", {
192
192
  className: "space-y-2",
193
- children: [/* @__PURE__ */ N(f, {
193
+ children: [/* @__PURE__ */ N(d, {
194
194
  htmlFor: "email",
195
195
  children: "Email"
196
196
  }), /* @__PURE__ */ N(e, {
197
197
  id: "email",
198
198
  type: "email",
199
- value: u.email,
200
- onChange: (e) => p((t) => ({
199
+ value: l.email,
200
+ onChange: (e) => f((t) => ({
201
201
  ...t,
202
202
  email: e.target.value
203
203
  })),
@@ -205,13 +205,13 @@ function B() {
205
205
  })]
206
206
  }), /* @__PURE__ */ P("div", {
207
207
  className: "space-y-2",
208
- children: [/* @__PURE__ */ N(f, {
208
+ children: [/* @__PURE__ */ N(d, {
209
209
  htmlFor: "phone",
210
210
  children: "Phone"
211
211
  }), /* @__PURE__ */ N(e, {
212
212
  id: "phone",
213
- value: u.phone,
214
- onChange: (e) => p((t) => ({
213
+ value: l.phone,
214
+ onChange: (e) => f((t) => ({
215
215
  ...t,
216
216
  phone: e.target.value
217
217
  })),
@@ -221,13 +221,13 @@ function B() {
221
221
  }),
222
222
  /* @__PURE__ */ P("div", {
223
223
  className: "space-y-2",
224
- children: [/* @__PURE__ */ N(f, {
224
+ children: [/* @__PURE__ */ N(d, {
225
225
  htmlFor: "company",
226
226
  children: "Company"
227
227
  }), /* @__PURE__ */ N(e, {
228
228
  id: "company",
229
- value: u.company,
230
- onChange: (e) => p((t) => ({
229
+ value: l.company,
230
+ onChange: (e) => f((t) => ({
231
231
  ...t,
232
232
  company: e.target.value
233
233
  })),
@@ -240,7 +240,7 @@ function B() {
240
240
  });
241
241
  }
242
242
  function V() {
243
- let { customerId: t } = ue(), { basePath: n, navigate: r } = g(), { customer: i, isLoading: a, error: m, refetch: V } = O(t), { updateCustomer: fe } = D(), { orders: H, isLoading: pe } = ae({ filters: { customerId: t } }), { message: U, notify: me } = x(), [W, G] = M(!1), [K, q] = M(!1), [J, Y] = M(null), [X, Z] = M({
243
+ let { customerId: t } = ue(), { basePath: n, navigate: r } = g(), { customer: i, isLoading: a, error: v, refetch: V } = O(t), { updateCustomer: fe } = D(), { orders: H, isLoading: pe } = ae({ filters: { customerId: t } }), { message: U, notify: me } = x(), [W, G] = M(!1), [K, q] = M(!1), [J, Y] = M(null), [X, Z] = M({
244
244
  name: "",
245
245
  email: "",
246
246
  phone: "",
@@ -254,23 +254,23 @@ function V() {
254
254
  company: i.company ?? ""
255
255
  });
256
256
  }, [i]);
257
- let he = () => r?.(o(n, "customers")), Q = (e) => r?.(o(n, e)), $ = () => {
257
+ let he = () => r?.(p(n, "customers")), Q = (e) => r?.(p(n, e)), $ = () => {
258
258
  Y(null), G(!0);
259
259
  };
260
- return t ? a ? /* @__PURE__ */ N(_, { message: "Loading customer details..." }) : m || !i ? /* @__PURE__ */ N(h, {
260
+ return t ? a ? /* @__PURE__ */ N(h, { message: "Loading customer details..." }) : v || !i ? /* @__PURE__ */ N(m, {
261
261
  title: "Customer not found",
262
262
  onRetry: V
263
- }) : /* @__PURE__ */ P(d, {
263
+ }) : /* @__PURE__ */ P(u, {
264
264
  title: i.name,
265
265
  subtitle: i.company || i.email,
266
266
  icon: /* @__PURE__ */ N(E, { size: 24 }),
267
267
  headerActions: /* @__PURE__ */ P("div", {
268
268
  className: "flex gap-2",
269
- children: [/* @__PURE__ */ P(v, {
269
+ children: [/* @__PURE__ */ P(_, {
270
270
  variant: "outline",
271
271
  onClick: he,
272
272
  children: [/* @__PURE__ */ N(y, { size: 16 }), " Back"]
273
- }), W ? /* @__PURE__ */ P(de, { children: [/* @__PURE__ */ P(v, {
273
+ }), W ? /* @__PURE__ */ P(de, { children: [/* @__PURE__ */ P(_, {
274
274
  variant: "outline",
275
275
  onClick: () => {
276
276
  Y(null), G(!1), i && Z({
@@ -282,7 +282,7 @@ function V() {
282
282
  },
283
283
  disabled: K,
284
284
  children: [/* @__PURE__ */ N(ie, { size: 16 }), " Cancel"]
285
- }), /* @__PURE__ */ P(v, {
285
+ }), /* @__PURE__ */ P(_, {
286
286
  onClick: async () => {
287
287
  if (t) {
288
288
  if (!X.name.trim()) {
@@ -310,7 +310,7 @@ function V() {
310
310
  " ",
311
311
  K ? "Saving…" : "Save"
312
312
  ]
313
- })] }) : /* @__PURE__ */ P(v, {
313
+ })] }) : /* @__PURE__ */ P(_, {
314
314
  onClick: $,
315
315
  children: [/* @__PURE__ */ N(T, { size: 16 }), " Edit"]
316
316
  })]
@@ -319,7 +319,7 @@ function V() {
319
319
  className: "flex items-center gap-4",
320
320
  children: [
321
321
  /* @__PURE__ */ N(k, { type: i.type }),
322
- /* @__PURE__ */ N(p, {
322
+ /* @__PURE__ */ N(f, {
323
323
  variant: i.isActive ? "default" : "secondary",
324
324
  children: i.isActive ? "Active" : "Inactive"
325
325
  }),
@@ -375,7 +375,7 @@ function V() {
375
375
  children: [
376
376
  /* @__PURE__ */ P("div", {
377
377
  className: "space-y-2",
378
- children: [/* @__PURE__ */ P(f, {
378
+ children: [/* @__PURE__ */ P(d, {
379
379
  htmlFor: "edit-name",
380
380
  children: ["Name ", /* @__PURE__ */ N("span", {
381
381
  className: "text-status-error-text",
@@ -392,7 +392,7 @@ function V() {
392
392
  }),
393
393
  /* @__PURE__ */ P("div", {
394
394
  className: "space-y-2",
395
- children: [/* @__PURE__ */ N(f, {
395
+ children: [/* @__PURE__ */ N(d, {
396
396
  htmlFor: "edit-company",
397
397
  children: "Company"
398
398
  }), /* @__PURE__ */ N(e, {
@@ -407,7 +407,7 @@ function V() {
407
407
  }),
408
408
  /* @__PURE__ */ P("div", {
409
409
  className: "space-y-2",
410
- children: [/* @__PURE__ */ N(f, {
410
+ children: [/* @__PURE__ */ N(d, {
411
411
  htmlFor: "edit-email",
412
412
  children: "Email"
413
413
  }), /* @__PURE__ */ N(e, {
@@ -422,7 +422,7 @@ function V() {
422
422
  }),
423
423
  /* @__PURE__ */ P("div", {
424
424
  className: "space-y-2",
425
- children: [/* @__PURE__ */ N(f, {
425
+ children: [/* @__PURE__ */ N(d, {
426
426
  htmlFor: "edit-phone",
427
427
  children: "Phone"
428
428
  }), /* @__PURE__ */ N(e, {
@@ -494,26 +494,26 @@ function V() {
494
494
  })()]
495
495
  })]
496
496
  })] }),
497
- /* @__PURE__ */ P(s, { children: [/* @__PURE__ */ N(u, { children: /* @__PURE__ */ P(l, {
497
+ /* @__PURE__ */ P(o, { children: [/* @__PURE__ */ N(l, { children: /* @__PURE__ */ P(c, {
498
498
  className: "flex items-center gap-2",
499
499
  children: [/* @__PURE__ */ N(ne, { size: 18 }), " Address"]
500
- }) }), /* @__PURE__ */ N(c, { children: /* @__PURE__ */ N("p", { children: ce(i.address) }) })] }),
501
- i.notes && /* @__PURE__ */ P(s, { children: [/* @__PURE__ */ N(u, { children: /* @__PURE__ */ P(l, {
500
+ }) }), /* @__PURE__ */ N(s, { children: /* @__PURE__ */ N("p", { children: ce(i.address) }) })] }),
501
+ i.notes && /* @__PURE__ */ P(o, { children: [/* @__PURE__ */ N(l, { children: /* @__PURE__ */ P(c, {
502
502
  className: "flex items-center gap-2",
503
503
  children: [/* @__PURE__ */ N(b, { size: 18 }), " Notes"]
504
- }) }), /* @__PURE__ */ N(c, { children: /* @__PURE__ */ N("p", { children: i.notes }) })] }),
505
- /* @__PURE__ */ P(s, { children: [/* @__PURE__ */ P(u, {
504
+ }) }), /* @__PURE__ */ N(s, { children: /* @__PURE__ */ N("p", { children: i.notes }) })] }),
505
+ /* @__PURE__ */ P(o, { children: [/* @__PURE__ */ P(l, {
506
506
  className: "flex flex-row items-center justify-between",
507
- children: [/* @__PURE__ */ P(l, {
507
+ children: [/* @__PURE__ */ P(c, {
508
508
  className: "flex items-center gap-2",
509
509
  children: [/* @__PURE__ */ N(C, { size: 18 }), " Orders"]
510
- }), /* @__PURE__ */ P(v, {
510
+ }), /* @__PURE__ */ P(_, {
511
511
  variant: "outline",
512
512
  size: "sm",
513
513
  onClick: () => Q("orders/new"),
514
514
  children: [/* @__PURE__ */ N(b, { size: 14 }), " New order"]
515
515
  })]
516
- }), /* @__PURE__ */ N(c, { children: pe ? /* @__PURE__ */ N("p", {
516
+ }), /* @__PURE__ */ N(s, { children: pe ? /* @__PURE__ */ N("p", {
517
517
  className: "text-text-secondary text-center py-4",
518
518
  children: "Loading orders…"
519
519
  }) : H.length > 0 ? /* @__PURE__ */ N("div", {
@@ -564,7 +564,7 @@ function V() {
564
564
  ]
565
565
  }), /* @__PURE__ */ P("div", {
566
566
  className: "space-y-6",
567
- children: [/* @__PURE__ */ P(s, { children: [/* @__PURE__ */ N(u, { children: /* @__PURE__ */ N(l, { children: "Business Details" }) }), /* @__PURE__ */ P(c, {
567
+ children: [/* @__PURE__ */ P(o, { children: [/* @__PURE__ */ N(l, { children: /* @__PURE__ */ N(c, { children: "Business Details" }) }), /* @__PURE__ */ P(s, {
568
568
  className: "space-y-3",
569
569
  children: [
570
570
  i.businessLicense && /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
@@ -591,12 +591,12 @@ function V() {
591
591
  /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
592
592
  className: "text-sm text-text-secondary",
593
593
  children: "Marketing Opt-in"
594
- }), /* @__PURE__ */ N(p, {
594
+ }), /* @__PURE__ */ N(f, {
595
595
  variant: i.marketingOptIn ? "default" : "secondary",
596
596
  children: i.marketingOptIn ? "Yes" : "No"
597
597
  })] })
598
598
  ]
599
- })] }), /* @__PURE__ */ P(s, { children: [/* @__PURE__ */ N(u, { children: /* @__PURE__ */ N(l, { children: "Account Info" }) }), /* @__PURE__ */ P(c, {
599
+ })] }), /* @__PURE__ */ P(o, { children: [/* @__PURE__ */ N(l, { children: /* @__PURE__ */ N(c, { children: "Account Info" }) }), /* @__PURE__ */ P(s, {
600
600
  className: "space-y-3",
601
601
  children: [/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("p", {
602
602
  className: "text-sm text-text-secondary",
@@ -0,0 +1,205 @@
1
+ import { i as e, l as t, lt as n, o as r, s as i, st as a, u as o, ut as s } from "./PageLayout-DX1Ou6V6.js";
2
+ import { t as c } from "./DataTable-KjzbwnRL.js";
3
+ import { t as l } from "./download-CG4Tponq.js";
4
+ import { t as u } from "./plus-BqQxkfoU.js";
5
+ import { t as d } from "./refresh-cw-CEOAPEcV.js";
6
+ import { t as f } from "./star-B7PgVu5j.js";
7
+ import { t as p } from "./user-check-DtnQmimP.js";
8
+ import { t as m } from "./users-Cvwko-Dx.js";
9
+ import { n as h, r as g } from "./useCustomers-Dq2IR2HQ.js";
10
+ import { r as _, t as v } from "./MetricCard-DQlDNqmK.js";
11
+ import { i as y } from "./StatusBadge-oZjownr1.js";
12
+ import { r as b } from "./formatters-FWJDwTFv.js";
13
+ import { useState as x } from "react";
14
+ import { jsx as S, jsxs as C } from "react/jsx-runtime";
15
+ import { CTAOverflowMenu as w, PagePurpose as T } from "@burdenoff/fe-libs/ui";
16
+ //#region node_modules/lucide-react/dist/esm/icons/building-2.js
17
+ var E = s("Building2", [
18
+ ["path", {
19
+ d: "M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",
20
+ key: "1b4qmf"
21
+ }],
22
+ ["path", {
23
+ d: "M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",
24
+ key: "i71pzd"
25
+ }],
26
+ ["path", {
27
+ d: "M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",
28
+ key: "10jefs"
29
+ }],
30
+ ["path", {
31
+ d: "M10 6h4",
32
+ key: "1itunk"
33
+ }],
34
+ ["path", {
35
+ d: "M10 10h4",
36
+ key: "tcdvrf"
37
+ }],
38
+ ["path", {
39
+ d: "M10 14h4",
40
+ key: "kelpxr"
41
+ }],
42
+ ["path", {
43
+ d: "M10 18h4",
44
+ key: "1ulq68"
45
+ }]
46
+ ]);
47
+ //#endregion
48
+ //#region src/movethewheels/pages/CustomersPage.tsx
49
+ function D() {
50
+ let { basePath: s, navigate: D } = a(), [O, k] = x(0), [A, j] = x(25), { customers: M, hasMore: N, isLoading: P, refetch: F } = g({
51
+ limit: A,
52
+ offset: O * A
53
+ }), { stats: I } = h(), L = (e) => D?.(n(s, e));
54
+ return /* @__PURE__ */ C(e, {
55
+ title: "Customers",
56
+ subtitle: `${I.total} customers`,
57
+ icon: /* @__PURE__ */ S(m, { size: 24 }),
58
+ headerActions: /* @__PURE__ */ S(w, {
59
+ primary: {
60
+ label: "Add Customer",
61
+ icon: /* @__PURE__ */ S(u, { size: 16 }),
62
+ onSelect: () => L("customers/new")
63
+ },
64
+ actions: [{
65
+ label: "Refresh",
66
+ icon: /* @__PURE__ */ S(d, { size: 16 }),
67
+ onSelect: () => F()
68
+ }, {
69
+ label: "Export",
70
+ icon: /* @__PURE__ */ S(l, { size: 16 }),
71
+ onSelect: () => L("import-export")
72
+ }]
73
+ }),
74
+ children: [
75
+ /* @__PURE__ */ S(T, {
76
+ icon: /* @__PURE__ */ S(m, { size: 18 }),
77
+ 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."
78
+ }),
79
+ /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
80
+ className: "mb-3 text-sm font-medium text-text-secondary",
81
+ children: "Customer base at a glance"
82
+ }), /* @__PURE__ */ C(_, {
83
+ columns: 3,
84
+ children: [
85
+ /* @__PURE__ */ S(v, {
86
+ label: "Total customers",
87
+ value: I.total,
88
+ icon: /* @__PURE__ */ S(m, { size: 20 }),
89
+ accent: "brand"
90
+ }),
91
+ /* @__PURE__ */ S(v, {
92
+ label: "Active",
93
+ value: I.active,
94
+ icon: /* @__PURE__ */ S(p, { size: 20 }),
95
+ accent: "success",
96
+ subtitle: "Currently transacting"
97
+ }),
98
+ /* @__PURE__ */ S(v, {
99
+ label: "Business accounts",
100
+ value: I.b2b,
101
+ icon: /* @__PURE__ */ S(E, { size: 20 }),
102
+ accent: "blue",
103
+ subtitle: "B2B relationships"
104
+ })
105
+ ]
106
+ })] }),
107
+ /* @__PURE__ */ S(c, {
108
+ columns: [
109
+ {
110
+ id: "customer",
111
+ header: "Customer",
112
+ cell: (e) => /* @__PURE__ */ C("div", {
113
+ className: "flex items-center gap-3",
114
+ children: [/* @__PURE__ */ S(r, { children: /* @__PURE__ */ S(i, { children: e.name.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
115
+ className: "font-medium",
116
+ children: e.name
117
+ }), /* @__PURE__ */ S("p", {
118
+ className: "text-sm text-text-secondary",
119
+ children: e.email
120
+ })] })]
121
+ })
122
+ },
123
+ {
124
+ id: "type",
125
+ header: "Type",
126
+ accessorKey: "type",
127
+ cell: (e) => /* @__PURE__ */ S(y, { type: e.type })
128
+ },
129
+ {
130
+ id: "company",
131
+ header: "Company",
132
+ accessorKey: "company",
133
+ cell: (e) => e.company || "-"
134
+ },
135
+ {
136
+ id: "phone",
137
+ header: "Phone",
138
+ accessorKey: "phone"
139
+ },
140
+ {
141
+ id: "location",
142
+ header: "Location",
143
+ cell: (e) => `${e.address.city}, ${e.address.state}`
144
+ },
145
+ {
146
+ id: "rating",
147
+ header: "Rating",
148
+ cell: (e) => /* @__PURE__ */ C("div", {
149
+ className: "flex items-center gap-1",
150
+ children: [/* @__PURE__ */ S(f, {
151
+ size: 14,
152
+ className: "text-status-warning-text fill-current"
153
+ }), /* @__PURE__ */ S("span", { children: e.rating.toFixed(1) })]
154
+ })
155
+ },
156
+ {
157
+ id: "status",
158
+ header: "Status",
159
+ cell: (e) => /* @__PURE__ */ S(t, {
160
+ variant: e.isActive ? "default" : "secondary",
161
+ children: e.isActive ? "Active" : "Inactive"
162
+ })
163
+ },
164
+ {
165
+ id: "created",
166
+ header: "Created",
167
+ accessorKey: "createdAt",
168
+ sortable: !0,
169
+ cell: (e) => b(e.createdAt, "short")
170
+ }
171
+ ],
172
+ data: M,
173
+ isLoading: P,
174
+ searchable: !0,
175
+ searchPlaceholder: "Search customers...",
176
+ searchFields: [
177
+ "name",
178
+ "email",
179
+ "company"
180
+ ],
181
+ onRowClick: (e) => L(`customers/${e.id}`),
182
+ getRowId: (e) => e.id,
183
+ pageIndex: O,
184
+ pageSize: A,
185
+ onPageChange: k,
186
+ onPageSizeChange: (e) => {
187
+ j(e), k(0);
188
+ },
189
+ hasNextPage: N,
190
+ emptyIllustration: "empty-people",
191
+ emptyTitle: "No customers yet",
192
+ emptyDescription: "Add your first customer to start booking deliveries for them.",
193
+ emptyAction: /* @__PURE__ */ C(o, {
194
+ onClick: () => L("customers/new"),
195
+ children: [/* @__PURE__ */ S(u, {
196
+ size: 16,
197
+ className: "mr-1.5"
198
+ }), "Add Customer"]
199
+ })
200
+ })
201
+ ]
202
+ });
203
+ }
204
+ //#endregion
205
+ export { D as default };