@burdenoff/microfe-movethewheels 2026.703.4 → 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 (149) hide show
  1. package/dist/{AIAssistantPage-3YOnHO9Y.js → AIAssistantPage-D2gaEL1U.js} +16 -15
  2. package/dist/AnalyticsPage-DZMlEoBi.js +194 -0
  3. package/dist/{CreateOrderPage-DRAgGo9i.js → CreateOrderPage-CWHx8yys.js} +40 -40
  4. package/dist/{CustomerDetailsPage-BCeMmOFe.js → CustomerDetailsPage-nR4oZ_ju.js} +71 -71
  5. package/dist/CustomersPage-Bbvwvn8k.js +205 -0
  6. package/dist/DashboardPage-DrEhNf7N.js +542 -0
  7. package/dist/{DataTable-XvUcTjwi.js → DataTable-CqMUD4er.js} +31 -31
  8. package/dist/{DocumentsCard-U2lSe-cn.js → DocumentsCard-edDkgnJj.js} +25 -25
  9. package/dist/{DriverDetailsPage-BQrYd_Lp.js → DriverDetailsPage-whEMOWs9.js} +64 -64
  10. package/dist/DriversPage-CHF2ZEzd.js +221 -0
  11. package/dist/FinancePage-Dn9GrW-1.js +175 -0
  12. package/dist/{FleetPage-3ZHsB-TN.js → FleetPage-CrtGPy-p.js} +22 -22
  13. package/dist/{FormError-cuLV2jVD.js → FormError-BKcb_wT-.js} +1 -1
  14. package/dist/{ImportExportPage-C6f7DqhM.js → ImportExportPage-WYdwZomZ.js} +12 -12
  15. package/dist/InventoryPage-l5A1f753.js +259 -0
  16. package/dist/LiveTrackingPage-DhEaNKZ4.js +429 -0
  17. package/dist/{MarketplacePage-Bh_2ns4v.js → MarketplacePage-B9RYOb1Y.js} +116 -116
  18. package/dist/MetricCard-y3bWHKUQ.js +191 -0
  19. package/dist/{Notice-CSoDYKw9.js → Notice-DOO-tjpV.js} +2 -2
  20. package/dist/{OrderDetailsPage-zCj0lW0j.js → OrderDetailsPage-CwYHwk1K.js} +58 -58
  21. package/dist/OrdersListPage-DhZJoQeI.js +386 -0
  22. package/dist/{PageLayout-D4LDHJJq.js → PageLayout-BniRJaQ6.js} +1 -1
  23. package/dist/{ProductDetailsPage-wsxAQkA0.js → ProductDetailsPage-1Gm9JKy0.js} +55 -55
  24. package/dist/ProductsPage-C8sn-1tN.js +186 -0
  25. package/dist/ReportsPage-D1tb0dcz.js +377 -0
  26. package/dist/{RouteDetailsPage-DyMJE9AS.js → RouteDetailsPage-CkMyR9b_.js} +208 -181
  27. package/dist/{RoutesPage-Dtc669yc.js → RoutesPage-QkENzsE5.js} +12 -12
  28. package/dist/{SettingsPage-CpH9xhQg.js → SettingsPage-DV3_tU_X.js} +15 -15
  29. package/dist/Sparkline-K2RMJ58u.js +16729 -0
  30. package/dist/{StatusBadge-C87mDpDP.js → StatusBadge-BNHXYvZx.js} +7 -7
  31. package/dist/TrackingPage-BZrg4RCu.js +368 -0
  32. package/dist/{VehicleDetailsPage-DldYNsYV.js → VehicleDetailsPage-D-8XPZ2G.js} +53 -53
  33. package/dist/VehiclesPage-D5BELbtM.js +184 -0
  34. package/dist/{WarehouseDetailsPage-CMG7or6G.js → WarehouseDetailsPage-Cmg-8Frn.js} +64 -64
  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-Q3XQpTPR.js → arrow-right-CmKOmIkh.js} +1 -1
  38. package/dist/{arrow-up-xNF1zJUG.js → arrow-up-BJijRLAZ.js} +1 -1
  39. package/dist/{box-Eu05PXDh.js → box-BT3NsRQP.js} +1 -1
  40. package/dist/boxes-B_OGvQiW.js +54 -0
  41. package/dist/{chart-column-ouzgxIv_.js → chart-column-DQTTdUPk.js} +1 -1
  42. package/dist/charts-Tj_PPTfA.js +2018 -0
  43. package/dist/{chevron-left-B2_r0Elx.js → chevron-left-B1rZyWWb.js} +1 -1
  44. package/dist/{chevron-right-eV4LjaSi.js → chevron-right-BIcwUJZq.js} +1 -1
  45. package/dist/chunk-BdsCSvBP.js +20 -0
  46. package/dist/{circle-alert-Bzh2DBSF.js → circle-alert-CNkuDNc6.js} +1 -1
  47. package/dist/circle-check-Cs1OVjtV.js +13 -0
  48. package/dist/{circle-check-big-CGMSpQmD.js → circle-check-big-C-p4eNwn.js} +1 -1
  49. package/dist/{clock-Bl3ptexL.js → clock-dRGG4rkF.js} +1 -1
  50. package/dist/{dollar-sign-CAVU95SO.js → dollar-sign-B6RoYHHz.js} +1 -1
  51. package/dist/{download-C5NbvVDc.js → download-DP04iWTd.js} +1 -1
  52. package/dist/{file-text-D-1uvLZG.js → file-text-BuDx4hZp.js} +1 -1
  53. package/dist/{filter-DUfUg6BO.js → filter-BD483_8g.js} +1 -1
  54. package/dist/{fuel-B6_lnKDs.js → fuel-DLH1ag04.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-DNQn9fyY.js} +1 -1
  58. package/dist/{map-pin-Dznl5l40.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-BJSJl-VG.js → navigation-CgGUt2tR.js} +1 -1
  62. package/dist/{package-CcRttV2N.js → package-DmRF7iQD.js} +1 -1
  63. package/dist/{phone-DVSZHt_j.js → phone-Cl32EXKW.js} +1 -1
  64. package/dist/{plus-C_XZDwBz.js → plus-DlANgOFx.js} +1 -1
  65. package/dist/{refresh-cw-CfgN67l3.js → refresh-cw-rW59D4b7.js} +1 -1
  66. package/dist/route-CWjPrtAN.js +22 -0
  67. package/dist/{save-DJE8Fpdv.js → save-UDlog7hg.js} +1 -1
  68. package/dist/{search-D_VyGcZT.js → search-DNIG5Ck7.js} +1 -1
  69. package/dist/{square-pen-D-6JYrVQ.js → square-pen-BcfB3Grd.js} +1 -1
  70. package/dist/{star-BpRlUZuU.js → star-CVZHFwDx.js} +1 -1
  71. package/dist/{store-B-8HMuyZ.js → store-bwnmCK9f.js} +1 -1
  72. package/dist/{trash-2-8vmv-XV_.js → trash-2-B80G12d4.js} +1 -1
  73. package/dist/{trending-up-Dz6PqPRj.js → trending-up-CH4R4KOa.js} +1 -1
  74. package/dist/{triangle-alert-D7Y3J_4z.js → triangle-alert-CmS8AUU6.js} +1 -1
  75. package/dist/{truck-D-y2IDzv.js → truck-9rLDncav.js} +1 -1
  76. package/dist/{upload-CHZofOqb.js → upload-DanJY1Vo.js} +1 -1
  77. package/dist/{useAssistant-DVW4QgQb.js → useAssistant-CnEwkTLm.js} +11 -28
  78. package/dist/{useCustomers-BPW4__PR.js → useCustomers-ChJao1ET.js} +1 -1
  79. package/dist/{useFleet-ChBkxAd6.js → useFleet-g5Yri0G8.js} +1 -1
  80. package/dist/{useImportExport-DrPDHEDK.js → useImportExport-MYwIT3rE.js} +1 -1
  81. package/dist/{useInventory-CAAVMRp6.js → useInventory-BSOn-R1c.js} +1 -1
  82. package/dist/{useOrders-B465S2nt.js → useOrders-BSiqo61w.js} +1 -1
  83. package/dist/{useReports-jQ3GpNOm.js → useReports-fWESfsF9.js} +1 -1
  84. package/dist/{useRoutes-hS3d5-xr.js → useRoutes-zD8Yp323.js} +1 -1
  85. package/dist/{useSettings-BB8X2RLh.js → useSettings-B1lsWeZ1.js} +6 -6
  86. package/dist/{useTracking-RjGz9PZG.js → useTracking-BKG0I2ln.js} +3 -3
  87. package/dist/{user-DzfTn4dE.js → user-DU51el3m.js} +1 -1
  88. package/dist/{user-check-BEKRCi7v.js → user-check-IMhk-qkX.js} +1 -1
  89. package/dist/{users-CCrq-w0C.js → users-B8KhJBGg.js} +1 -1
  90. package/dist/{warehouse-CaqfmMKh.js → warehouse-CcMMioeY.js} +1 -1
  91. package/dist/{wrench-q_rgJfaP.js → wrench-Dg-sgH2e.js} +1 -1
  92. package/dist/{x-tMeDMcCw.js → x-C4ObLVEa.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/mapMarkers.ts +58 -0
  134. package/dist/AnalyticsPage-CMpI1070.js +0 -215
  135. package/dist/CustomersPage-CaNBMXmM.js +0 -172
  136. package/dist/DashboardPage-DIKlXde3.js +0 -387
  137. package/dist/DriversPage-PYmdFiby.js +0 -176
  138. package/dist/FinancePage-Cwh9Bw4M.js +0 -136
  139. package/dist/InventoryPage-DpiqVu1v.js +0 -253
  140. package/dist/LiveTrackingPage-FAzzlVnX.js +0 -379
  141. package/dist/MetricCard-CVBVpu7o.js +0 -146
  142. package/dist/OrdersListPage-CAMsuUck.js +0 -384
  143. package/dist/ProductsPage-DC5qDLfz.js +0 -180
  144. package/dist/ReportsPage-BwUJ37eO.js +0 -356
  145. package/dist/TrackingPage-DaNEFG_h.js +0 -325
  146. package/dist/VehiclesPage-BFw13iMt.js +0 -176
  147. package/dist/WarehousesPage-Wkytnt86.js +0 -173
  148. package/dist/useAnalytics-D7HW2XRb.js +0 -347
  149. /package/dist/{formatters-BQr-aR5W.js → formatters-FWJDwTFv.js} +0 -0
@@ -1,176 +0,0 @@
1
- import { M as e, ct as t, i as n, ot as r } from "./PageLayout-D4LDHJJq.js";
2
- import { t as i } from "./DataTable-XvUcTjwi.js";
3
- import { t as a } from "./download-C5NbvVDc.js";
4
- import { t as o } from "./plus-C_XZDwBz.js";
5
- import { t as s } from "./refresh-cw-CfgN67l3.js";
6
- import { t as c } from "./truck-D-y2IDzv.js";
7
- import { i as l, o as u } from "./useFleet-ChBkxAd6.js";
8
- import { a as d, r as f } from "./StatusBadge-C87mDpDP.js";
9
- import { useState as p } from "react";
10
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
11
- import { CTAOverflowMenu as g, EmphasisPanel as _, PagePurpose as v } from "@burdenoff/fe-libs/ui";
12
- //#region src/movethewheels/pages/VehiclesPage.tsx
13
- function y() {
14
- let { basePath: y, navigate: b } = r(), [x, S] = p(0), [C, w] = p(25), { vehicles: T, isLoading: E, refetch: D } = u({
15
- limit: C,
16
- offset: x * C
17
- }), { stats: O } = l(), k = O.totalVehicles, A = (e) => {
18
- b && b(t(y, e));
19
- };
20
- return /* @__PURE__ */ h(n, {
21
- title: "Vehicles",
22
- subtitle: `${k} vehicles in fleet`,
23
- icon: /* @__PURE__ */ m(c, { size: 24 }),
24
- headerActions: /* @__PURE__ */ m(g, {
25
- primary: {
26
- label: "Add Vehicle",
27
- icon: /* @__PURE__ */ m(o, { size: 16 }),
28
- onSelect: () => A("fleet/vehicles/new")
29
- },
30
- actions: [{
31
- label: "Refresh",
32
- icon: /* @__PURE__ */ m(s, { size: 16 }),
33
- onSelect: () => D()
34
- }, {
35
- label: "Export",
36
- icon: /* @__PURE__ */ m(a, { size: 16 }),
37
- onSelect: () => A("import-export")
38
- }]
39
- }),
40
- children: [
41
- /* @__PURE__ */ m(v, {
42
- icon: /* @__PURE__ */ m(c, { size: 18 }),
43
- children: "Every truck, van and bike in your fleet. Monitor capacity, fuel level, mileage and maintenance status here so you always know which vehicles are road-ready before dispatching an order."
44
- }),
45
- /* @__PURE__ */ h(_, { children: [/* @__PURE__ */ m("p", {
46
- className: "text-sm font-medium text-text-secondary",
47
- children: "Fleet at a glance"
48
- }), /* @__PURE__ */ h("div", {
49
- className: "mt-3 grid grid-cols-3 gap-4",
50
- children: [
51
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
52
- className: "text-2xl font-bold text-text-primary tabular-nums",
53
- children: k
54
- }), /* @__PURE__ */ m("p", {
55
- className: "text-xs text-text-secondary",
56
- children: "Total vehicles"
57
- })] }),
58
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
59
- className: "text-2xl font-bold text-text-primary tabular-nums",
60
- children: O.vehiclesByStatus.available
61
- }), /* @__PURE__ */ m("p", {
62
- className: "text-xs text-text-secondary",
63
- children: "Available now"
64
- })] }),
65
- /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
66
- className: "text-2xl font-bold text-text-primary tabular-nums",
67
- children: O.vehiclesByStatus.maintenance
68
- }), /* @__PURE__ */ m("p", {
69
- className: "text-xs text-text-secondary",
70
- children: "In maintenance"
71
- })] })
72
- ]
73
- })] }),
74
- /* @__PURE__ */ m(i, {
75
- columns: [
76
- {
77
- id: "vehicleNumber",
78
- header: "Vehicle #",
79
- accessorKey: "vehicleNumber",
80
- sortable: !0,
81
- cell: (e) => /* @__PURE__ */ m("span", {
82
- className: "font-medium",
83
- children: e.vehicleNumber
84
- })
85
- },
86
- {
87
- id: "type",
88
- header: "Type",
89
- accessorKey: "type",
90
- cell: (e) => /* @__PURE__ */ m(d, { type: e.type })
91
- },
92
- {
93
- id: "details",
94
- header: "Vehicle",
95
- cell: (e) => /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("p", {
96
- className: "font-medium",
97
- children: [
98
- e.make,
99
- " ",
100
- e.model
101
- ]
102
- }), /* @__PURE__ */ m("p", {
103
- className: "text-sm text-text-secondary",
104
- children: e.year
105
- })] })
106
- },
107
- {
108
- id: "status",
109
- header: "Status",
110
- accessorKey: "status",
111
- sortable: !0,
112
- cell: (e) => /* @__PURE__ */ m(f, {
113
- status: e.status,
114
- type: "vehicle"
115
- })
116
- },
117
- {
118
- id: "capacity",
119
- header: "Capacity",
120
- cell: (e) => /* @__PURE__ */ h("div", {
121
- className: "text-sm",
122
- children: [/* @__PURE__ */ h("p", { children: [e.capacity.weight, " kg"] }), /* @__PURE__ */ h("p", {
123
- className: "text-text-secondary",
124
- children: [e.capacity.volume, " m³"]
125
- })]
126
- })
127
- },
128
- {
129
- id: "fuel",
130
- header: "Fuel Level",
131
- cell: (t) => t.fuelLevel === void 0 ? "-" : /* @__PURE__ */ h("div", {
132
- className: "flex items-center gap-2",
133
- children: [/* @__PURE__ */ m(e, {
134
- value: t.fuelLevel,
135
- className: "w-16 h-2"
136
- }), /* @__PURE__ */ h("span", {
137
- className: "text-sm",
138
- children: [t.fuelLevel, "%"]
139
- })]
140
- })
141
- },
142
- {
143
- id: "mileage",
144
- header: "Mileage",
145
- accessorKey: "mileage",
146
- sortable: !0,
147
- cell: (e) => e.mileage ? `${e.mileage.toLocaleString()} mi` : "-"
148
- }
149
- ],
150
- data: T,
151
- isLoading: E,
152
- searchable: !0,
153
- searchPlaceholder: "Search vehicles...",
154
- searchFields: [
155
- "vehicleNumber",
156
- "make",
157
- "model"
158
- ],
159
- onRowClick: (e) => A(`fleet/vehicles/${e.id}`),
160
- getRowId: (e) => e.id,
161
- pageIndex: x,
162
- pageSize: C,
163
- onPageChange: S,
164
- onPageSizeChange: (e) => {
165
- w(e), S(0);
166
- },
167
- totalItems: k,
168
- emptyIllustration: "empty-data",
169
- emptyTitle: "No vehicles yet",
170
- emptyDescription: "Add vehicles to your fleet to start assigning them to deliveries."
171
- })
172
- ]
173
- });
174
- }
175
- //#endregion
176
- export { y as default };
@@ -1,173 +0,0 @@
1
- import { M as e, ct as t, i as n, l as r, ot as i } from "./PageLayout-D4LDHJJq.js";
2
- import { t as a } from "./DataTable-XvUcTjwi.js";
3
- import { t as o } from "./plus-C_XZDwBz.js";
4
- import { t as s } from "./refresh-cw-CfgN67l3.js";
5
- import { t as c } from "./warehouse-CaqfmMKh.js";
6
- import { c as l, s as u } from "./useInventory-CAAVMRp6.js";
7
- import { useState as d } from "react";
8
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
9
- import { CTAOverflowMenu as m, EmphasisPanel as h, PagePurpose as g } from "@burdenoff/fe-libs/ui";
10
- //#region src/movethewheels/pages/WarehousesPage.tsx
11
- function _() {
12
- let { basePath: _, navigate: v } = i(), [y, b] = d(0), [x, S] = d(25), { warehouses: C, hasMore: w, isLoading: T, refetch: E } = l({
13
- limit: x,
14
- offset: y * x
15
- }), { stats: D } = u(), O = (e) => v?.(t(_, e));
16
- return /* @__PURE__ */ p(n, {
17
- title: "Warehouses",
18
- subtitle: `${D.total} warehouses`,
19
- icon: /* @__PURE__ */ f(c, { size: 24 }),
20
- headerActions: /* @__PURE__ */ f(m, {
21
- primary: {
22
- label: "Add Warehouse",
23
- icon: /* @__PURE__ */ f(o, { size: 16 }),
24
- onSelect: () => O("inventory/warehouses/new")
25
- },
26
- actions: [{
27
- label: "Refresh",
28
- icon: /* @__PURE__ */ f(s, { size: 16 }),
29
- onSelect: () => E()
30
- }]
31
- }),
32
- children: [
33
- /* @__PURE__ */ f(g, {
34
- icon: /* @__PURE__ */ f(c, { size: 18 }),
35
- 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."
36
- }),
37
- /* @__PURE__ */ p(h, { children: [/* @__PURE__ */ f("p", {
38
- className: "text-sm font-medium text-text-secondary",
39
- children: "Network at a glance"
40
- }), /* @__PURE__ */ p("div", {
41
- className: "mt-3 grid grid-cols-3 gap-4",
42
- children: [
43
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
44
- className: "text-2xl font-bold text-text-primary tabular-nums",
45
- children: D.total
46
- }), /* @__PURE__ */ f("p", {
47
- className: "text-xs text-text-secondary",
48
- children: "Total sites"
49
- })] }),
50
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
51
- className: "text-2xl font-bold text-text-primary tabular-nums",
52
- children: D.active
53
- }), /* @__PURE__ */ f("p", {
54
- className: "text-xs text-text-secondary",
55
- children: "Active"
56
- })] }),
57
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
58
- className: "text-2xl font-bold text-text-primary tabular-nums",
59
- children: D.total > 0 ? `${Math.round(D.avgUtilization * 100)}%` : "—"
60
- }), /* @__PURE__ */ f("p", {
61
- className: "text-xs text-text-secondary",
62
- children: "Avg utilization"
63
- })] })
64
- ]
65
- })] }),
66
- /* @__PURE__ */ f(a, {
67
- columns: [
68
- {
69
- id: "name",
70
- header: "Warehouse",
71
- accessorKey: "name",
72
- sortable: !0,
73
- cell: (e) => /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
74
- className: "font-medium",
75
- children: e.name
76
- }), /* @__PURE__ */ f("p", {
77
- className: "text-sm text-text-secondary",
78
- children: e.code
79
- })] })
80
- },
81
- {
82
- id: "location",
83
- header: "Location",
84
- cell: (e) => /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("p", { children: [
85
- e.address.city,
86
- ", ",
87
- e.address.state
88
- ] }), /* @__PURE__ */ f("p", {
89
- className: "text-sm text-text-secondary",
90
- children: e.address.country
91
- })] })
92
- },
93
- {
94
- id: "type",
95
- header: "Type",
96
- accessorKey: "type",
97
- cell: (e) => /* @__PURE__ */ f(r, {
98
- variant: "outline",
99
- className: "capitalize",
100
- children: e.type.replace("_", " ")
101
- })
102
- },
103
- {
104
- id: "utilization",
105
- header: "Utilization",
106
- cell: (t) => {
107
- let n = t.capacity.usedSpace / t.capacity.totalSpace * 100;
108
- return /* @__PURE__ */ p("div", {
109
- className: "flex items-center gap-2",
110
- children: [/* @__PURE__ */ f(e, {
111
- value: n,
112
- className: "w-16 h-2"
113
- }), /* @__PURE__ */ p("span", {
114
- className: "text-sm",
115
- children: [n.toFixed(0), "%"]
116
- })]
117
- });
118
- }
119
- },
120
- {
121
- id: "capacity",
122
- header: "Capacity",
123
- cell: (e) => /* @__PURE__ */ p("div", {
124
- className: "text-sm",
125
- children: [/* @__PURE__ */ p("p", { children: [
126
- e.capacity.usedSpace.toLocaleString(),
127
- " / ",
128
- e.capacity.totalSpace.toLocaleString(),
129
- " ",
130
- "sq ft"
131
- ] }), /* @__PURE__ */ p("p", {
132
- className: "text-text-secondary",
133
- children: [
134
- e.capacity.usedPallets,
135
- " / ",
136
- e.capacity.totalPallets,
137
- " pallets"
138
- ]
139
- })]
140
- })
141
- },
142
- {
143
- id: "status",
144
- header: "Status",
145
- cell: (e) => /* @__PURE__ */ f(r, {
146
- variant: e.isActive ? "default" : "secondary",
147
- children: e.isActive ? "Active" : "Inactive"
148
- })
149
- }
150
- ],
151
- data: C,
152
- isLoading: T,
153
- searchable: !0,
154
- searchPlaceholder: "Search warehouses...",
155
- searchFields: ["name", "code"],
156
- onRowClick: (e) => O(`inventory/warehouses/${e.id}`),
157
- getRowId: (e) => e.id,
158
- pageIndex: y,
159
- pageSize: x,
160
- onPageChange: b,
161
- onPageSizeChange: (e) => {
162
- S(e), b(0);
163
- },
164
- hasNextPage: w,
165
- emptyIllustration: "empty-data",
166
- emptyTitle: "No warehouses yet",
167
- emptyDescription: "Add a warehouse to store inventory and fulfil orders from it."
168
- })
169
- ]
170
- });
171
- }
172
- //#endregion
173
- export { _ as default };
@@ -1,347 +0,0 @@
1
- import { it as e, ot as t } from "./PageLayout-D4LDHJJq.js";
2
- import { useCallback as n, useEffect as r, useMemo as i, useState as a } from "react";
3
- //#region src/movethewheels/hooks/useAnalytics.ts
4
- var o = "\n query GetMovethewheelsAnalytics {\n analytics {\n orderTrend {\n label\n value\n }\n deliveryTrend {\n label\n value\n }\n revenueTrend {\n label\n value\n }\n }\n dashboardMetrics {\n totalOrders\n activeDeliveries\n availableDrivers\n activeVehicles\n lowStockItems\n totalRevenue\n onTimeDeliveryRate\n customerSatisfaction\n }\n fleetStats {\n totalVehicles\n activeVehicles\n maintenanceVehicles\n avgDriverRating\n }\n }\n", s = "\n query GetDashboardMetrics {\n dashboardMetrics {\n totalOrders\n activeDeliveries\n availableDrivers\n activeVehicles\n lowStockItems\n totalRevenue\n onTimeDeliveryRate\n customerSatisfaction\n }\n orderStats {\n total\n pending\n inTransit\n delivered\n cancelled\n failed\n }\n fleetStats {\n totalVehicles\n activeVehicles\n maintenanceVehicles\n totalDrivers\n availableDrivers\n onDeliveryDrivers\n avgDriverRating\n }\n financeMetrics {\n revenue {\n totalRevenue\n averageOrderValue\n }\n }\n }\n", c = "\n query GetOrderAnalytics {\n orderStats {\n pending\n inTransit\n delivered\n cancelled\n failed\n }\n analytics {\n orderTrend {\n label\n value\n }\n }\n }\n";
5
- function l() {
6
- return {
7
- overview: {
8
- totalOrders: 0,
9
- totalRevenue: 0,
10
- activeVehicles: 0,
11
- onTimeDeliveryRate: 0,
12
- customerSatisfaction: 0
13
- },
14
- trends: {
15
- dailyOrders: [],
16
- revenue: []
17
- },
18
- fleet: {
19
- utilization: 0,
20
- totalVehicles: 0,
21
- activeVehicles: 0,
22
- maintenanceVehicles: 0,
23
- outOfServiceVehicles: 0,
24
- fuelEfficiency: 0
25
- },
26
- performance: {
27
- onTimePickup: 0,
28
- onTimeDelivery: 0,
29
- damagedItems: 0,
30
- customerComplaints: 0,
31
- driverRatings: 0
32
- }
33
- };
34
- }
35
- function u(s = {}) {
36
- let { apiGatewayUrl: c, authToken: u, workspaceToken: d, workspaceId: f, tenantId: p, currentUser: m } = t(), [h, g] = a(l()), [_, v] = a(!1), [y, b] = a(null), x = i(() => ({
37
- apiGatewayUrl: c,
38
- authToken: u,
39
- workspaceToken: d,
40
- workspaceId: f,
41
- tenantId: p,
42
- actorId: m?.id
43
- }), [
44
- c,
45
- u,
46
- d,
47
- f,
48
- p,
49
- m?.id
50
- ]), S = n(async () => {
51
- v(!0), b(null);
52
- try {
53
- let t = await e(x, o);
54
- g({
55
- overview: {
56
- totalOrders: t.dashboardMetrics.totalOrders,
57
- totalRevenue: t.dashboardMetrics.totalRevenue,
58
- activeVehicles: t.dashboardMetrics.activeVehicles,
59
- onTimeDeliveryRate: t.dashboardMetrics.onTimeDeliveryRate,
60
- customerSatisfaction: t.dashboardMetrics.customerSatisfaction
61
- },
62
- trends: {
63
- dailyOrders: t.analytics.orderTrend.map((e) => ({
64
- date: e.label,
65
- orders: Math.round(e.value)
66
- })),
67
- revenue: t.analytics.revenueTrend.map((e) => ({
68
- month: e.label,
69
- revenue: e.value
70
- }))
71
- },
72
- fleet: {
73
- utilization: t.fleetStats.totalVehicles > 0 ? t.fleetStats.activeVehicles / t.fleetStats.totalVehicles * 100 : 0,
74
- totalVehicles: t.fleetStats.totalVehicles,
75
- activeVehicles: t.fleetStats.activeVehicles,
76
- maintenanceVehicles: t.fleetStats.maintenanceVehicles,
77
- outOfServiceVehicles: Math.max(t.fleetStats.totalVehicles - t.fleetStats.activeVehicles - t.fleetStats.maintenanceVehicles, 0),
78
- fuelEfficiency: 0
79
- },
80
- performance: {
81
- onTimePickup: 0,
82
- onTimeDelivery: t.dashboardMetrics.onTimeDeliveryRate,
83
- damagedItems: 0,
84
- customerComplaints: 0,
85
- driverRatings: t.fleetStats.avgDriverRating
86
- }
87
- });
88
- } catch (e) {
89
- b(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load analytics"));
90
- } finally {
91
- v(!1);
92
- }
93
- }, [x]);
94
- return r(() => {
95
- S();
96
- }, [S]), {
97
- analytics: h,
98
- isLoading: _,
99
- error: y,
100
- refetch: n(() => {
101
- S();
102
- }, [S])
103
- };
104
- }
105
- function d() {
106
- let { apiGatewayUrl: n, authToken: o, workspaceToken: c, workspaceId: l, tenantId: u, currentUser: d } = t(), [f, p] = a({
107
- orders: {
108
- total: 0,
109
- pending: 0,
110
- inTransit: 0,
111
- delivered: 0,
112
- today: 0
113
- },
114
- fleet: {
115
- totalVehicles: 0,
116
- activeVehicles: 0,
117
- totalDrivers: 0,
118
- availableDrivers: 0
119
- },
120
- revenue: {
121
- total: 0,
122
- avgOrderValue: 0,
123
- currency: "USD"
124
- },
125
- performance: {
126
- onTimeDeliveryRate: 0,
127
- avgDriverRating: 0
128
- }
129
- }), [m, h] = a(!1), [g, _] = a(null), v = i(() => ({
130
- apiGatewayUrl: n,
131
- authToken: o,
132
- workspaceToken: c,
133
- workspaceId: l,
134
- tenantId: u,
135
- actorId: d?.id
136
- }), [
137
- n,
138
- o,
139
- c,
140
- l,
141
- u,
142
- d?.id
143
- ]);
144
- return r(() => {
145
- (async () => {
146
- h(!0), _(null);
147
- try {
148
- let t = await e(v, s);
149
- p({
150
- orders: {
151
- total: t.orderStats.total,
152
- pending: t.orderStats.pending,
153
- inTransit: t.orderStats.inTransit,
154
- delivered: t.orderStats.delivered,
155
- today: 0
156
- },
157
- fleet: {
158
- totalVehicles: t.fleetStats.totalVehicles,
159
- activeVehicles: t.fleetStats.activeVehicles,
160
- totalDrivers: t.fleetStats.totalDrivers,
161
- availableDrivers: t.fleetStats.availableDrivers
162
- },
163
- revenue: {
164
- total: t.financeMetrics.revenue.totalRevenue,
165
- avgOrderValue: t.financeMetrics.revenue.averageOrderValue,
166
- currency: "USD"
167
- },
168
- performance: {
169
- onTimeDeliveryRate: t.dashboardMetrics.onTimeDeliveryRate,
170
- avgDriverRating: t.fleetStats.avgDriverRating
171
- }
172
- });
173
- } catch (e) {
174
- _(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load dashboard metrics"));
175
- } finally {
176
- h(!1);
177
- }
178
- })();
179
- }, [v]), {
180
- metrics: f,
181
- isLoading: m,
182
- error: g
183
- };
184
- }
185
- function f(e = "monthly") {
186
- let { analytics: t, isLoading: n, error: r } = u();
187
- return {
188
- revenueData: i(() => e === "daily" ? t.trends.dailyOrders.map((e) => ({
189
- label: e.date,
190
- value: e.orders
191
- })) : t.trends.revenue.map((e) => ({
192
- label: e.month,
193
- value: e.revenue
194
- })), [
195
- t.trends.dailyOrders,
196
- t.trends.revenue,
197
- e
198
- ]),
199
- isLoading: n,
200
- error: r
201
- };
202
- }
203
- function p() {
204
- let { apiGatewayUrl: n, authToken: o, workspaceToken: s, workspaceId: l, tenantId: u, currentUser: d } = t(), [f, p] = a({
205
- byStatus: [],
206
- byType: [],
207
- byPriority: [],
208
- trends: []
209
- }), [m, h] = a(!1), [g, _] = a(null), v = i(() => ({
210
- apiGatewayUrl: n,
211
- authToken: o,
212
- workspaceToken: s,
213
- workspaceId: l,
214
- tenantId: u,
215
- actorId: d?.id
216
- }), [
217
- n,
218
- o,
219
- s,
220
- l,
221
- u,
222
- d?.id
223
- ]);
224
- return r(() => {
225
- (async () => {
226
- h(!0), _(null);
227
- try {
228
- let t = await e(v, c);
229
- p({
230
- byStatus: [
231
- {
232
- status: "pending",
233
- count: t.orderStats.pending
234
- },
235
- {
236
- status: "in_transit",
237
- count: t.orderStats.inTransit
238
- },
239
- {
240
- status: "delivered",
241
- count: t.orderStats.delivered
242
- },
243
- {
244
- status: "cancelled",
245
- count: t.orderStats.cancelled
246
- },
247
- {
248
- status: "failed",
249
- count: t.orderStats.failed
250
- }
251
- ],
252
- byType: [],
253
- byPriority: [],
254
- trends: t.analytics.orderTrend.map((e) => ({
255
- date: e.label,
256
- orders: Math.round(e.value)
257
- }))
258
- });
259
- } catch (e) {
260
- _(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load order analytics"));
261
- } finally {
262
- h(!1);
263
- }
264
- })();
265
- }, [v]), {
266
- orderData: f,
267
- isLoading: m,
268
- error: g
269
- };
270
- }
271
- function m() {
272
- let { analytics: e, isLoading: t, error: n } = u();
273
- return {
274
- fleetData: i(() => ({
275
- vehicleUtilization: e.fleet.utilization,
276
- avgFuelLevel: 0,
277
- vehiclesByType: [],
278
- driverPerformance: [],
279
- fleetStats: e.fleet
280
- }), [e.fleet]),
281
- isLoading: t,
282
- error: n
283
- };
284
- }
285
- var h = "\n query GetMovethewheelsFinanceMetrics {\n financeMetrics {\n revenue {\n totalRevenue\n deliveredRevenue\n averageOrderValue\n }\n fuelCost\n openInvoices\n }\n }\n";
286
- function g() {
287
- let { apiGatewayUrl: o, authToken: s, workspaceToken: c, workspaceId: l, tenantId: u, currentUser: d } = t(), [f, p] = a({
288
- totalRevenue: 0,
289
- deliveredRevenue: 0,
290
- averageOrderValue: 0,
291
- fuelCost: 0,
292
- openInvoices: 0
293
- }), [m, g] = a(!1), [_, v] = a(null), y = i(() => ({
294
- apiGatewayUrl: o,
295
- authToken: s,
296
- workspaceToken: c,
297
- workspaceId: l,
298
- tenantId: u,
299
- actorId: d?.id
300
- }), [
301
- o,
302
- s,
303
- c,
304
- l,
305
- u,
306
- d?.id
307
- ]), b = n(async () => {
308
- g(!0), v(null);
309
- try {
310
- let t = await e(y, h);
311
- p({
312
- totalRevenue: t.financeMetrics.revenue.totalRevenue,
313
- deliveredRevenue: t.financeMetrics.revenue.deliveredRevenue,
314
- averageOrderValue: t.financeMetrics.revenue.averageOrderValue,
315
- fuelCost: t.financeMetrics.fuelCost,
316
- openInvoices: t.financeMetrics.openInvoices
317
- });
318
- } catch (e) {
319
- v(e instanceof Error ? e : /* @__PURE__ */ Error("Failed to load finance metrics"));
320
- } finally {
321
- g(!1);
322
- }
323
- }, [y]);
324
- return r(() => {
325
- b();
326
- }, [b]), {
327
- metrics: f,
328
- isLoading: m,
329
- error: _,
330
- refetch: n(() => {
331
- b();
332
- }, [b])
333
- };
334
- }
335
- function _() {
336
- let { analytics: e, isLoading: t, error: n } = u();
337
- return {
338
- performanceData: i(() => ({
339
- ...e.performance,
340
- driverRatings: []
341
- }), [e.performance]),
342
- isLoading: t,
343
- error: n
344
- };
345
- }
346
- //#endregion
347
- export { p as a, m as i, d as n, _ as o, g as r, f as s, u as t };