@burdenoff/microfe-movethewheels 2026.703.3 → 2026.703.5

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 (173) hide show
  1. package/dist/{AIAssistantPage-C3cPsWt-.js → AIAssistantPage-D2gaEL1U.js} +16 -15
  2. package/dist/AnalyticsPage-DZMlEoBi.js +194 -0
  3. package/dist/CreateOrderPage-CWHx8yys.js +490 -0
  4. package/dist/CustomerDetailsPage-nR4oZ_ju.js +615 -0
  5. package/dist/CustomersPage-Bbvwvn8k.js +205 -0
  6. package/dist/DashboardPage-DrEhNf7N.js +542 -0
  7. package/dist/DataTable-CqMUD4er.js +340 -0
  8. package/dist/DocumentsCard-edDkgnJj.js +169 -0
  9. package/dist/DriverDetailsPage-whEMOWs9.js +490 -0
  10. package/dist/DriversPage-CHF2ZEzd.js +221 -0
  11. package/dist/FinancePage-Dn9GrW-1.js +175 -0
  12. package/dist/{FleetPage-DqkFi3s3.js → FleetPage-CrtGPy-p.js} +36 -35
  13. package/dist/{FormError-BlOjnXOq.js → FormError-BKcb_wT-.js} +1 -1
  14. package/dist/{ImportExportPage-DKJRCezl.js → ImportExportPage-WYdwZomZ.js} +52 -72
  15. package/dist/InventoryPage-l5A1f753.js +259 -0
  16. package/dist/LiveTrackingPage-DhEaNKZ4.js +429 -0
  17. package/dist/MarketplacePage-B9RYOb1Y.js +426 -0
  18. package/dist/MetricCard-y3bWHKUQ.js +191 -0
  19. package/dist/Notice-DOO-tjpV.js +46 -0
  20. package/dist/OrderDetailsPage-CwYHwk1K.js +584 -0
  21. package/dist/OrdersListPage-DhZJoQeI.js +386 -0
  22. package/dist/{PageLayout-D4LDHJJq.js → PageLayout-BniRJaQ6.js} +1 -1
  23. package/dist/{ProductDetailsPage-C9uOiYLp.js → ProductDetailsPage-1Gm9JKy0.js} +56 -56
  24. package/dist/ProductsPage-C8sn-1tN.js +186 -0
  25. package/dist/ReportsPage-D1tb0dcz.js +377 -0
  26. package/dist/RouteDetailsPage-CkMyR9b_.js +610 -0
  27. package/dist/{RoutesPage-DMfoicM1.js → RoutesPage-QkENzsE5.js} +58 -47
  28. package/dist/{SettingsPage-Bn-v0mbQ.js → SettingsPage-DV3_tU_X.js} +16 -38
  29. package/dist/Sparkline-K2RMJ58u.js +16729 -0
  30. package/dist/{StatusBadge-BZurYHMy.js → StatusBadge-BNHXYvZx.js} +7 -7
  31. package/dist/TrackingPage-BZrg4RCu.js +368 -0
  32. package/dist/VehicleDetailsPage-D-8XPZ2G.js +393 -0
  33. package/dist/VehiclesPage-D5BELbtM.js +184 -0
  34. package/dist/{WarehouseDetailsPage-L_6sWigM.js → WarehouseDetailsPage-Cmg-8Frn.js} +70 -70
  35. package/dist/WarehousesPage-C1Y1M867.js +182 -0
  36. package/dist/{arrow-left-n48Y-Wis.js → arrow-left-ClW4Isj7.js} +1 -1
  37. package/dist/arrow-right-CmKOmIkh.js +11 -0
  38. package/dist/arrow-up-BJijRLAZ.js +17 -0
  39. package/dist/{box-D9Pal4HM.js → box-BT3NsRQP.js} +1 -1
  40. package/dist/boxes-B_OGvQiW.js +54 -0
  41. package/dist/{chart-column-BFIJysDR.js → chart-column-DQTTdUPk.js} +1 -1
  42. package/dist/charts-Tj_PPTfA.js +2018 -0
  43. package/dist/chevron-left-B1rZyWWb.js +8 -0
  44. package/dist/{chevron-right-EMIIyyJ1.js → chevron-right-BIcwUJZq.js} +1 -1
  45. package/dist/chunk-BdsCSvBP.js +20 -0
  46. package/dist/{circle-alert-iY24lSlp.js → circle-alert-CNkuDNc6.js} +1 -1
  47. package/dist/circle-check-Cs1OVjtV.js +13 -0
  48. package/dist/{circle-check-big-w0TrLKMF.js → circle-check-big-C-p4eNwn.js} +1 -1
  49. package/dist/{clock-DJZtdl8u.js → clock-dRGG4rkF.js} +1 -1
  50. package/dist/{dollar-sign-CgKQRz_e.js → dollar-sign-B6RoYHHz.js} +1 -1
  51. package/dist/{download-DRXxoiQR.js → download-DP04iWTd.js} +1 -1
  52. package/dist/{file-text-DWWY6_f5.js → file-text-BuDx4hZp.js} +1 -1
  53. package/dist/{filter-DloLC2eE.js → filter-BD483_8g.js} +1 -1
  54. package/dist/{wrench-CANXWxF-.js → fuel-DLH1ag04.js} +3 -6
  55. package/dist/index.css +2 -0
  56. package/dist/index.js +150 -172
  57. package/dist/{map-CkJaULb2.js → map-DNQn9fyY.js} +1 -1
  58. package/dist/{map-pin-BGiCvyCs.js → map-pin-CqN1bbT1.js} +1 -1
  59. package/dist/mapMarkers-NCV9MRKR.js +28 -0
  60. package/dist/maps-yzLqiK_C.js +5070 -0
  61. package/dist/{navigation-D36prnAn.js → navigation-CgGUt2tR.js} +1 -1
  62. package/dist/{package-BChUzpJS.js → package-DmRF7iQD.js} +1 -1
  63. package/dist/{phone-Ac9s3mo_.js → phone-Cl32EXKW.js} +1 -1
  64. package/dist/{plus-Z76q-FZm.js → plus-DlANgOFx.js} +1 -1
  65. package/dist/{refresh-cw-DKt6f5T6.js → refresh-cw-rW59D4b7.js} +1 -1
  66. package/dist/route-CWjPrtAN.js +22 -0
  67. package/dist/{save-CojywNhG.js → save-UDlog7hg.js} +1 -1
  68. package/dist/{search-CDGefqb3.js → search-DNIG5Ck7.js} +1 -1
  69. package/dist/{square-pen-CopE9GmB.js → square-pen-BcfB3Grd.js} +1 -1
  70. package/dist/{star-nHlLjDKR.js → star-CVZHFwDx.js} +1 -1
  71. package/dist/{store-BR9Voi5E.js → store-bwnmCK9f.js} +1 -1
  72. package/dist/{trash-2-BKhar6Hs.js → trash-2-B80G12d4.js} +1 -1
  73. package/dist/{trending-up-Dohgd4t_.js → trending-up-CH4R4KOa.js} +1 -1
  74. package/dist/{triangle-alert-i-XQL9Rd.js → triangle-alert-CmS8AUU6.js} +1 -1
  75. package/dist/{truck-C0v_hbLR.js → truck-9rLDncav.js} +1 -1
  76. package/dist/upload-DanJY1Vo.js +21 -0
  77. package/dist/{useAssistant-D4v3oxD3.js → useAssistant-CnEwkTLm.js} +11 -28
  78. package/dist/{useCustomers-BmTNGxiI.js → useCustomers-ChJao1ET.js} +30 -27
  79. package/dist/{useFleet-DKqXZ16m.js → useFleet-g5Yri0G8.js} +82 -70
  80. package/dist/{useImportExport-DHr-SWSw.js → useImportExport-MYwIT3rE.js} +1 -1
  81. package/dist/{useInventory-DkyiVY_A.js → useInventory-BSOn-R1c.js} +84 -39
  82. package/dist/{useOrders-Cfk1GLiq.js → useOrders-BSiqo61w.js} +59 -48
  83. package/dist/{useReports-CTqZr-AB.js → useReports-fWESfsF9.js} +41 -35
  84. package/dist/{useRoutes-BQWO607N.js → useRoutes-zD8Yp323.js} +50 -42
  85. package/dist/{useSettings-CkDH_-gM.js → useSettings-B1lsWeZ1.js} +6 -6
  86. package/dist/{useTracking-B-va1kO3.js → useTracking-BKG0I2ln.js} +3 -3
  87. package/dist/{user-jyFU3lXk.js → user-DU51el3m.js} +1 -1
  88. package/dist/user-check-IMhk-qkX.js +20 -0
  89. package/dist/{users-DZ-ilS6B.js → users-B8KhJBGg.js} +1 -1
  90. package/dist/{warehouse-6m5kXMLu.js → warehouse-CcMMioeY.js} +1 -1
  91. package/dist/wrench-Dg-sgH2e.js +8 -0
  92. package/dist/x-C4ObLVEa.js +11 -0
  93. package/package.json +5 -1
  94. package/src/movethewheels/components/DataTable.tsx +252 -84
  95. package/src/movethewheels/components/DocumentsCard.tsx +102 -0
  96. package/src/movethewheels/components/GlassPanel.tsx +71 -0
  97. package/src/movethewheels/components/MetricCard.tsx +171 -73
  98. package/src/movethewheels/components/Notice.tsx +61 -0
  99. package/src/movethewheels/components/StatusBadge.tsx +7 -6
  100. package/src/movethewheels/components/charts/ChartShell.tsx +78 -0
  101. package/src/movethewheels/components/charts/Sparkline.tsx +85 -0
  102. package/src/movethewheels/components/charts/StatusDonut.tsx +115 -0
  103. package/src/movethewheels/components/charts/TrendChart.tsx +179 -0
  104. package/src/movethewheels/components/charts/VolumeBar.tsx +97 -0
  105. package/src/movethewheels/components/charts/chartTokens.ts +43 -0
  106. package/src/movethewheels/components/charts/index.ts +9 -0
  107. package/src/movethewheels/components/index.ts +51 -1
  108. package/src/movethewheels/components/maps/LogisticsMap.tsx +94 -0
  109. package/src/movethewheels/components/maps/MapCanvas.tsx +118 -0
  110. package/src/movethewheels/components/maps/RouteMap.tsx +71 -0
  111. package/src/movethewheels/components/maps/TrackingMap.tsx +102 -0
  112. package/src/movethewheels/components/maps/index.ts +16 -0
  113. package/src/movethewheels/components/maps/leaflet-setup.ts +124 -0
  114. package/src/movethewheels/components/maps/map-markers.css +121 -0
  115. package/src/movethewheels/hooks/index.ts +9 -0
  116. package/src/movethewheels/hooks/useAnalytics.ts +109 -4
  117. package/src/movethewheels/hooks/useCustomers.ts +11 -4
  118. package/src/movethewheels/hooks/useEntityDocuments.ts +132 -0
  119. package/src/movethewheels/hooks/useFleet.ts +26 -7
  120. package/src/movethewheels/hooks/useInventory.ts +70 -7
  121. package/src/movethewheels/hooks/useOrders.ts +32 -2
  122. package/src/movethewheels/hooks/useReports.ts +14 -4
  123. package/src/movethewheels/hooks/useRoutes.ts +20 -3
  124. package/src/movethewheels/pages/AnalyticsPage.tsx +93 -73
  125. package/src/movethewheels/pages/CreateOrderPage.tsx +48 -20
  126. package/src/movethewheels/pages/CustomerDetailsPage.tsx +239 -33
  127. package/src/movethewheels/pages/CustomersPage.tsx +53 -28
  128. package/src/movethewheels/pages/DashboardPage.tsx +238 -12
  129. package/src/movethewheels/pages/DriverDetailsPage.tsx +17 -31
  130. package/src/movethewheels/pages/DriversPage.tsx +59 -31
  131. package/src/movethewheels/pages/FinancePage.tsx +103 -82
  132. package/src/movethewheels/pages/InventoryPage.tsx +15 -3
  133. package/src/movethewheels/pages/LiveTrackingPage.tsx +124 -16
  134. package/src/movethewheels/pages/MarketplacePage.tsx +265 -50
  135. package/src/movethewheels/pages/OrderDetailsPage.tsx +214 -10
  136. package/src/movethewheels/pages/OrdersListPage.tsx +118 -47
  137. package/src/movethewheels/pages/ProductsPage.tsx +52 -28
  138. package/src/movethewheels/pages/ReportsPage.tsx +88 -4
  139. package/src/movethewheels/pages/RouteDetailsPage.tsx +119 -19
  140. package/src/movethewheels/pages/RoutesPage.tsx +22 -6
  141. package/src/movethewheels/pages/SettingsPage.tsx +5 -21
  142. package/src/movethewheels/pages/TrackingPage.tsx +76 -6
  143. package/src/movethewheels/pages/VehicleDetailsPage.tsx +4 -34
  144. package/src/movethewheels/pages/VehiclesPage.tsx +58 -27
  145. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +1 -1
  146. package/src/movethewheels/pages/WarehousesPage.tsx +47 -36
  147. package/src/movethewheels/types/index.ts +9 -1
  148. package/src/movethewheels/utils/download.ts +62 -0
  149. package/src/movethewheels/utils/mapMarkers.ts +58 -0
  150. package/dist/AnalyticsPage-Dz6g2MvK.js +0 -215
  151. package/dist/CreateOrderPage-C5iwnjp4.js +0 -479
  152. package/dist/CustomerDetailsPage-B6nwFyLO.js +0 -406
  153. package/dist/CustomersPage-BKxMS1AV.js +0 -161
  154. package/dist/DashboardPage-BVjQi0EB.js +0 -387
  155. package/dist/DataTable-DmciIKKM.js +0 -249
  156. package/dist/DriverDetailsPage-CN3WQ0B9.js +0 -507
  157. package/dist/DriversPage-CH9rjQC-.js +0 -165
  158. package/dist/FinancePage-DEDykSOP.js +0 -158
  159. package/dist/InventoryPage-e0ze63iX.js +0 -253
  160. package/dist/LiveTrackingPage-DCX-K-LR.js +0 -379
  161. package/dist/MarketplacePage-CIQ97_zp.js +0 -247
  162. package/dist/MetricCard-BY0QrMD4.js +0 -146
  163. package/dist/OrderDetailsPage-DYiZ-9UK.js +0 -429
  164. package/dist/OrdersListPage-Cn90P1Xx.js +0 -307
  165. package/dist/ProductsPage-QJfHHpqB.js +0 -169
  166. package/dist/ReportsPage-Zp53q3_8.js +0 -284
  167. package/dist/RouteDetailsPage-DUStXSf9.js +0 -531
  168. package/dist/TrackingPage-W-jtdM3Y.js +0 -325
  169. package/dist/VehicleDetailsPage-Bceo5oz3.js +0 -410
  170. package/dist/VehiclesPage-ApKThYeG.js +0 -165
  171. package/dist/WarehousesPage-DCbXXXWE.js +0 -162
  172. package/dist/useAnalytics-DS8n0xgg.js +0 -297
  173. /package/dist/{formatters-CF2S2l1m.js → formatters-FWJDwTFv.js} +0 -0
@@ -1,406 +0,0 @@
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-DWWY6_f5.js";
4
- import { n as x, t as S } from "./phone-Ac9s3mo_.js";
5
- import { t as C } from "./map-pin-BGiCvyCs.js";
6
- import { t as w } from "./save-CojywNhG.js";
7
- import { t as T } from "./square-pen-CopE9GmB.js";
8
- import { t as E } from "./star-nHlLjDKR.js";
9
- import { t as D } from "./users-DZ-ilS6B.js";
10
- import { r as O, t as k } from "./useCustomers-BmTNGxiI.js";
11
- import { i as A } from "./StatusBadge-BZurYHMy.js";
12
- import { r as j, t as M } from "./formatters-CF2S2l1m.js";
13
- import { t as N } from "./FormError-BlOjnXOq.js";
14
- import { useState as P } from "react";
15
- import { useParams as F } from "react-router-dom";
16
- import { jsx as I, jsxs as L } from "react/jsx-runtime";
17
- import { EmphasisPanel as R, NextSteps as z, PagePurpose as B } from "@burdenoff/fe-libs/ui";
18
- //#region node_modules/lucide-react/dist/esm/icons/building.js
19
- var V = m("Building", [
20
- ["rect", {
21
- width: "16",
22
- height: "20",
23
- x: "4",
24
- y: "2",
25
- rx: "2",
26
- ry: "2",
27
- key: "76otgf"
28
- }],
29
- ["path", {
30
- d: "M9 22v-4h6v4",
31
- key: "r93iot"
32
- }],
33
- ["path", {
34
- d: "M8 6h.01",
35
- key: "1dz90k"
36
- }],
37
- ["path", {
38
- d: "M16 6h.01",
39
- key: "1x0f13"
40
- }],
41
- ["path", {
42
- d: "M12 6h.01",
43
- key: "1vi96p"
44
- }],
45
- ["path", {
46
- d: "M12 10h.01",
47
- key: "1nrarc"
48
- }],
49
- ["path", {
50
- d: "M12 14h.01",
51
- key: "1etili"
52
- }],
53
- ["path", {
54
- d: "M16 10h.01",
55
- key: "1m94wz"
56
- }],
57
- ["path", {
58
- d: "M16 14h.01",
59
- key: "1gbofw"
60
- }],
61
- ["path", {
62
- d: "M8 10h.01",
63
- key: "19clt8"
64
- }],
65
- ["path", {
66
- d: "M8 14h.01",
67
- key: "6423bh"
68
- }]
69
- ]);
70
- //#endregion
71
- //#region src/movethewheels/pages/CustomerDetailsPage.tsx
72
- function H() {
73
- let { basePath: s, navigate: c } = g(), { createCustomer: l } = O(), [u, p] = P({
74
- name: "",
75
- type: "b2c",
76
- email: "",
77
- phone: "",
78
- company: ""
79
- }), [m, h] = P(!1), [_, b] = P(null), x = () => c?.(o(s, "customers")), S = async (e) => {
80
- if (e.preventDefault(), !u.name.trim()) {
81
- b("Customer name is required.");
82
- return;
83
- }
84
- h(!0), b(null);
85
- try {
86
- let e = await l({
87
- name: u.name.trim(),
88
- type: u.type,
89
- email: u.email.trim() || void 0,
90
- phone: u.phone.trim() || void 0,
91
- company: u.company.trim() || void 0
92
- });
93
- c?.(o(s, `customers/${e.id}`));
94
- } catch (e) {
95
- console.error("Failed to create customer:", e), b(e instanceof Error ? e.message : "Failed to create customer. Please try again."), h(!1);
96
- }
97
- };
98
- return /* @__PURE__ */ L(d, {
99
- title: "New Customer",
100
- subtitle: "Add a new customer to your account",
101
- icon: /* @__PURE__ */ I(D, { size: 24 }),
102
- headerActions: /* @__PURE__ */ L("div", {
103
- className: "flex gap-2",
104
- children: [/* @__PURE__ */ L(v, {
105
- variant: "outline",
106
- onClick: x,
107
- disabled: m,
108
- children: [/* @__PURE__ */ I(y, { size: 16 }), " Cancel"]
109
- }), /* @__PURE__ */ L(v, {
110
- onClick: S,
111
- disabled: m,
112
- children: [
113
- /* @__PURE__ */ I(w, { size: 16 }),
114
- " ",
115
- m ? "Saving..." : "Create Customer"
116
- ]
117
- })]
118
- }),
119
- children: [/* @__PURE__ */ I(B, {
120
- icon: /* @__PURE__ */ I(D, { size: 18 }),
121
- children: "Add a customer once and their contact details auto-fill every future order you book for them. Only a name is required — add email, phone and company to make deliveries easier to arrange."
122
- }), /* @__PURE__ */ L("form", {
123
- onSubmit: S,
124
- className: "max-w-2xl space-y-6",
125
- children: [/* @__PURE__ */ I(N, { message: _ }), /* @__PURE__ */ L(R, { children: [/* @__PURE__ */ I("h2", {
126
- className: "text-base font-semibold text-text-primary mb-4",
127
- children: "Customer Details"
128
- }), /* @__PURE__ */ L("div", {
129
- className: "space-y-4",
130
- children: [
131
- /* @__PURE__ */ L("div", {
132
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
133
- children: [/* @__PURE__ */ L("div", {
134
- className: "space-y-2",
135
- children: [/* @__PURE__ */ L(f, {
136
- htmlFor: "name",
137
- children: ["Name ", /* @__PURE__ */ I("span", {
138
- className: "text-status-error-text",
139
- children: "*"
140
- })]
141
- }), /* @__PURE__ */ I(e, {
142
- id: "name",
143
- value: u.name,
144
- onChange: (e) => p((t) => ({
145
- ...t,
146
- name: e.target.value
147
- })),
148
- placeholder: "Acme Corp or Jane Doe",
149
- required: !0
150
- })]
151
- }), /* @__PURE__ */ L("div", {
152
- className: "space-y-2",
153
- children: [/* @__PURE__ */ I(f, {
154
- htmlFor: "type",
155
- children: "Customer Type"
156
- }), /* @__PURE__ */ L(i, {
157
- value: u.type,
158
- onValueChange: (e) => p((t) => ({
159
- ...t,
160
- type: e
161
- })),
162
- children: [/* @__PURE__ */ I(r, {
163
- id: "type",
164
- children: /* @__PURE__ */ I(a, {})
165
- }), /* @__PURE__ */ L(t, { children: [/* @__PURE__ */ I(n, {
166
- value: "b2c",
167
- children: "B2C (Individual)"
168
- }), /* @__PURE__ */ I(n, {
169
- value: "b2b",
170
- children: "B2B (Business)"
171
- })] })]
172
- })]
173
- })]
174
- }),
175
- /* @__PURE__ */ L("div", {
176
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
177
- children: [/* @__PURE__ */ L("div", {
178
- className: "space-y-2",
179
- children: [/* @__PURE__ */ I(f, {
180
- htmlFor: "email",
181
- children: "Email"
182
- }), /* @__PURE__ */ I(e, {
183
- id: "email",
184
- type: "email",
185
- value: u.email,
186
- onChange: (e) => p((t) => ({
187
- ...t,
188
- email: e.target.value
189
- })),
190
- placeholder: "customer@example.com"
191
- })]
192
- }), /* @__PURE__ */ L("div", {
193
- className: "space-y-2",
194
- children: [/* @__PURE__ */ I(f, {
195
- htmlFor: "phone",
196
- children: "Phone"
197
- }), /* @__PURE__ */ I(e, {
198
- id: "phone",
199
- value: u.phone,
200
- onChange: (e) => p((t) => ({
201
- ...t,
202
- phone: e.target.value
203
- })),
204
- placeholder: "+1-555-0100"
205
- })]
206
- })]
207
- }),
208
- /* @__PURE__ */ L("div", {
209
- className: "space-y-2",
210
- children: [/* @__PURE__ */ I(f, {
211
- htmlFor: "company",
212
- children: "Company"
213
- }), /* @__PURE__ */ I(e, {
214
- id: "company",
215
- value: u.company,
216
- onChange: (e) => p((t) => ({
217
- ...t,
218
- company: e.target.value
219
- })),
220
- placeholder: "Company name (for B2B accounts)"
221
- })]
222
- })
223
- ]
224
- })] })]
225
- })]
226
- });
227
- }
228
- function U() {
229
- let { customerId: e } = F(), { basePath: t, navigate: n } = g(), { customer: r, isLoading: i, error: a, refetch: f } = k(e), m = () => n?.(o(t, "customers")), w = (e) => n?.(o(t, e));
230
- return e ? i ? /* @__PURE__ */ I(_, { message: "Loading customer details..." }) : a || !r ? /* @__PURE__ */ I(h, {
231
- title: "Customer not found",
232
- onRetry: f
233
- }) : /* @__PURE__ */ L(d, {
234
- title: r.name,
235
- subtitle: r.company || r.email,
236
- icon: /* @__PURE__ */ I(D, { size: 24 }),
237
- headerActions: /* @__PURE__ */ L("div", {
238
- className: "flex gap-2",
239
- children: [/* @__PURE__ */ L(v, {
240
- variant: "outline",
241
- onClick: m,
242
- children: [/* @__PURE__ */ I(y, { size: 16 }), " Back"]
243
- }), /* @__PURE__ */ L(v, { children: [/* @__PURE__ */ I(T, { size: 16 }), " Edit"] })]
244
- }),
245
- headerContent: /* @__PURE__ */ L("div", {
246
- className: "flex items-center gap-4",
247
- children: [
248
- /* @__PURE__ */ I(A, { type: r.type }),
249
- /* @__PURE__ */ I(p, {
250
- variant: r.isActive ? "default" : "secondary",
251
- children: r.isActive ? "Active" : "Inactive"
252
- }),
253
- /* @__PURE__ */ L("div", {
254
- className: "flex items-center gap-1",
255
- children: [/* @__PURE__ */ I(E, {
256
- size: 16,
257
- className: "text-status-warning-text fill-current"
258
- }), /* @__PURE__ */ I("span", {
259
- className: "font-medium",
260
- children: r.rating.toFixed(1)
261
- })]
262
- })
263
- ]
264
- }),
265
- children: [
266
- /* @__PURE__ */ I(B, {
267
- icon: /* @__PURE__ */ I(D, { size: 18 }),
268
- children: "Everything you know about this customer — how to reach them, where they are, and their account standing. Use it to confirm contact details before a delivery, check their rating, or book their next order."
269
- }),
270
- /* @__PURE__ */ I(z, {
271
- storageKey: "movethewheels-customer-details",
272
- steps: [{
273
- id: "new-order",
274
- label: "Book a delivery for this customer",
275
- description: "Start a new order pre-filled for this account.",
276
- icon: /* @__PURE__ */ I(b, { size: 16 }),
277
- onClick: () => w("orders/new")
278
- }, {
279
- id: "edit",
280
- label: "Update contact details",
281
- description: "Keep email, phone and address current.",
282
- icon: /* @__PURE__ */ I(T, { size: 16 }),
283
- onClick: () => {}
284
- }]
285
- }),
286
- /* @__PURE__ */ L("div", {
287
- className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
288
- children: [/* @__PURE__ */ L("div", {
289
- className: "lg:col-span-2 space-y-6",
290
- children: [
291
- /* @__PURE__ */ L(R, { children: [/* @__PURE__ */ I("h2", {
292
- className: "text-base font-semibold text-text-primary mb-4",
293
- children: "Contact Information"
294
- }), /* @__PURE__ */ L("div", {
295
- className: "grid grid-cols-1 md:grid-cols-2 gap-6",
296
- children: [/* @__PURE__ */ L("div", {
297
- className: "space-y-4",
298
- children: [/* @__PURE__ */ L("div", {
299
- className: "flex items-center gap-3",
300
- children: [/* @__PURE__ */ I(x, {
301
- size: 18,
302
- className: "text-text-secondary"
303
- }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
304
- className: "text-sm text-text-secondary",
305
- children: "Email"
306
- }), /* @__PURE__ */ I("p", {
307
- className: "font-medium",
308
- children: r.email
309
- })] })]
310
- }), /* @__PURE__ */ L("div", {
311
- className: "flex items-center gap-3",
312
- children: [/* @__PURE__ */ I(S, {
313
- size: 18,
314
- className: "text-text-secondary"
315
- }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
316
- className: "text-sm text-text-secondary",
317
- children: "Phone"
318
- }), /* @__PURE__ */ I("p", {
319
- className: "font-medium",
320
- children: r.phone
321
- })] })]
322
- })]
323
- }), /* @__PURE__ */ L("div", {
324
- className: "space-y-4",
325
- children: [r.company && /* @__PURE__ */ L("div", {
326
- className: "flex items-center gap-3",
327
- children: [/* @__PURE__ */ I(V, {
328
- size: 18,
329
- className: "text-text-secondary"
330
- }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
331
- className: "text-sm text-text-secondary",
332
- children: "Company"
333
- }), /* @__PURE__ */ I("p", {
334
- className: "font-medium",
335
- children: r.company
336
- })] })]
337
- }), r.website && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
338
- className: "text-sm text-text-secondary",
339
- children: "Website"
340
- }), /* @__PURE__ */ I("a", {
341
- href: r.website,
342
- className: "text-primary hover:underline",
343
- children: r.website
344
- })] })]
345
- })]
346
- })] }),
347
- /* @__PURE__ */ L(s, { children: [/* @__PURE__ */ I(u, { children: /* @__PURE__ */ L(l, {
348
- className: "flex items-center gap-2",
349
- children: [/* @__PURE__ */ I(C, { size: 18 }), " Address"]
350
- }) }), /* @__PURE__ */ I(c, { children: /* @__PURE__ */ I("p", { children: M(r.address) }) })] }),
351
- r.notes && /* @__PURE__ */ L(s, { children: [/* @__PURE__ */ I(u, { children: /* @__PURE__ */ L(l, {
352
- className: "flex items-center gap-2",
353
- children: [/* @__PURE__ */ I(b, { size: 18 }), " Notes"]
354
- }) }), /* @__PURE__ */ I(c, { children: /* @__PURE__ */ I("p", { children: r.notes }) })] })
355
- ]
356
- }), /* @__PURE__ */ L("div", {
357
- className: "space-y-6",
358
- children: [/* @__PURE__ */ L(s, { children: [/* @__PURE__ */ I(u, { children: /* @__PURE__ */ I(l, { children: "Business Details" }) }), /* @__PURE__ */ L(c, {
359
- className: "space-y-3",
360
- children: [
361
- r.businessLicense && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
362
- className: "text-sm text-text-secondary",
363
- children: "Business License"
364
- }), /* @__PURE__ */ I("p", {
365
- className: "font-mono",
366
- children: r.businessLicense
367
- })] }),
368
- r.taxId && /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
369
- className: "text-sm text-text-secondary",
370
- children: "Tax ID"
371
- }), /* @__PURE__ */ I("p", {
372
- className: "font-mono",
373
- children: r.taxId
374
- })] }),
375
- /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
376
- className: "text-sm text-text-secondary",
377
- children: "Preferred Contact"
378
- }), /* @__PURE__ */ I("p", {
379
- className: "capitalize",
380
- children: r.preferredContactMethod
381
- })] }),
382
- /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
383
- className: "text-sm text-text-secondary",
384
- children: "Marketing Opt-in"
385
- }), /* @__PURE__ */ I(p, {
386
- variant: r.marketingOptIn ? "default" : "secondary",
387
- children: r.marketingOptIn ? "Yes" : "No"
388
- })] })
389
- ]
390
- })] }), /* @__PURE__ */ L(s, { children: [/* @__PURE__ */ I(u, { children: /* @__PURE__ */ I(l, { children: "Account Info" }) }), /* @__PURE__ */ L(c, {
391
- className: "space-y-3",
392
- children: [/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
393
- className: "text-sm text-text-secondary",
394
- children: "Created"
395
- }), /* @__PURE__ */ I("p", { children: j(r.createdAt, "full") })] }), /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("p", {
396
- className: "text-sm text-text-secondary",
397
- children: "Last Updated"
398
- }), /* @__PURE__ */ I("p", { children: j(r.updatedAt, "relative") })] })]
399
- })] })]
400
- })]
401
- })
402
- ]
403
- }) : /* @__PURE__ */ I(H, {});
404
- }
405
- //#endregion
406
- export { U as default };
@@ -1,161 +0,0 @@
1
- import { ct as e, i as t, l as n, o as r, ot as i, s as a, u as o } from "./PageLayout-D4LDHJJq.js";
2
- import { t as s } from "./DataTable-DmciIKKM.js";
3
- import { t as c } from "./download-DRXxoiQR.js";
4
- import { t as l } from "./plus-Z76q-FZm.js";
5
- import { t as u } from "./refresh-cw-DKt6f5T6.js";
6
- import { t as d } from "./star-nHlLjDKR.js";
7
- import { t as f } from "./users-DZ-ilS6B.js";
8
- import { r as p } from "./useCustomers-BmTNGxiI.js";
9
- import { i as m } from "./StatusBadge-BZurYHMy.js";
10
- import { r as h } from "./formatters-CF2S2l1m.js";
11
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
12
- import { CTAOverflowMenu as v, EmphasisPanel as y, PagePurpose as b } from "@burdenoff/fe-libs/ui";
13
- //#region src/movethewheels/pages/CustomersPage.tsx
14
- function x() {
15
- let { basePath: x, navigate: S } = i(), { customers: C, totalCustomers: w, isLoading: T, refetch: E } = p({ limit: 100 }), D = (t) => S?.(e(x, t));
16
- return /* @__PURE__ */ _(t, {
17
- title: "Customers",
18
- subtitle: `${w} customers`,
19
- icon: /* @__PURE__ */ g(f, { size: 24 }),
20
- headerActions: /* @__PURE__ */ g(v, {
21
- primary: {
22
- label: "Add Customer",
23
- icon: /* @__PURE__ */ g(l, { size: 16 }),
24
- onSelect: () => D("customers/new")
25
- },
26
- actions: [{
27
- label: "Refresh",
28
- icon: /* @__PURE__ */ g(u, { size: 16 }),
29
- onSelect: () => E()
30
- }, {
31
- label: "Export",
32
- icon: /* @__PURE__ */ g(c, { size: 16 }),
33
- onSelect: () => D("import-export")
34
- }]
35
- }),
36
- children: [
37
- /* @__PURE__ */ g(b, {
38
- icon: /* @__PURE__ */ g(f, { size: 18 }),
39
- 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."
40
- }),
41
- /* @__PURE__ */ _(y, { children: [/* @__PURE__ */ g("p", {
42
- className: "text-sm font-medium text-text-secondary",
43
- children: "Customer base at a glance"
44
- }), /* @__PURE__ */ _("div", {
45
- className: "mt-3 grid grid-cols-3 gap-4",
46
- children: [
47
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
48
- className: "text-2xl font-bold text-text-primary tabular-nums",
49
- children: w
50
- }), /* @__PURE__ */ g("p", {
51
- className: "text-xs text-text-secondary",
52
- children: "Total customers"
53
- })] }),
54
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
55
- className: "text-2xl font-bold text-text-primary tabular-nums",
56
- children: C.filter((e) => e.isActive).length
57
- }), /* @__PURE__ */ g("p", {
58
- className: "text-xs text-text-secondary",
59
- children: "Active"
60
- })] }),
61
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
62
- className: "text-2xl font-bold text-text-primary tabular-nums",
63
- children: C.filter((e) => e.type === "b2b").length
64
- }), /* @__PURE__ */ g("p", {
65
- className: "text-xs text-text-secondary",
66
- children: "Business accounts"
67
- })] })
68
- ]
69
- })] }),
70
- /* @__PURE__ */ g(s, {
71
- columns: [
72
- {
73
- id: "customer",
74
- header: "Customer",
75
- cell: (e) => /* @__PURE__ */ _("div", {
76
- className: "flex items-center gap-3",
77
- children: [/* @__PURE__ */ g(r, { children: /* @__PURE__ */ g(a, { children: e.name.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
78
- className: "font-medium",
79
- children: e.name
80
- }), /* @__PURE__ */ g("p", {
81
- className: "text-sm text-text-secondary",
82
- children: e.email
83
- })] })]
84
- })
85
- },
86
- {
87
- id: "type",
88
- header: "Type",
89
- accessorKey: "type",
90
- cell: (e) => /* @__PURE__ */ g(m, { type: e.type })
91
- },
92
- {
93
- id: "company",
94
- header: "Company",
95
- accessorKey: "company",
96
- cell: (e) => e.company || "-"
97
- },
98
- {
99
- id: "phone",
100
- header: "Phone",
101
- accessorKey: "phone"
102
- },
103
- {
104
- id: "location",
105
- header: "Location",
106
- cell: (e) => `${e.address.city}, ${e.address.state}`
107
- },
108
- {
109
- id: "rating",
110
- header: "Rating",
111
- cell: (e) => /* @__PURE__ */ _("div", {
112
- className: "flex items-center gap-1",
113
- children: [/* @__PURE__ */ g(d, {
114
- size: 14,
115
- className: "text-status-warning-text fill-current"
116
- }), /* @__PURE__ */ g("span", { children: e.rating.toFixed(1) })]
117
- })
118
- },
119
- {
120
- id: "status",
121
- header: "Status",
122
- cell: (e) => /* @__PURE__ */ g(n, {
123
- variant: e.isActive ? "default" : "secondary",
124
- children: e.isActive ? "Active" : "Inactive"
125
- })
126
- },
127
- {
128
- id: "created",
129
- header: "Created",
130
- accessorKey: "createdAt",
131
- sortable: !0,
132
- cell: (e) => h(e.createdAt, "short")
133
- }
134
- ],
135
- data: C,
136
- isLoading: T,
137
- searchable: !0,
138
- searchPlaceholder: "Search customers...",
139
- searchFields: [
140
- "name",
141
- "email",
142
- "company"
143
- ],
144
- onRowClick: (e) => D(`customers/${e.id}`),
145
- getRowId: (e) => e.id,
146
- emptyIllustration: "empty-people",
147
- emptyTitle: "No customers yet",
148
- emptyDescription: "Add your first customer to start booking deliveries for them.",
149
- emptyAction: /* @__PURE__ */ _(o, {
150
- onClick: () => D("customers/new"),
151
- children: [/* @__PURE__ */ g(l, {
152
- size: 16,
153
- className: "mr-1.5"
154
- }), "Add Customer"]
155
- })
156
- })
157
- ]
158
- });
159
- }
160
- //#endregion
161
- export { x as default };