@burdenoff/microfe-movethewheels 2026.703.2 → 2026.703.4

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 (126) hide show
  1. package/dist/{AIAssistantPage-C3cPsWt-.js → AIAssistantPage-3YOnHO9Y.js} +3 -3
  2. package/dist/{AnalyticsPage-Dz6g2MvK.js → AnalyticsPage-CMpI1070.js} +11 -11
  3. package/dist/CreateOrderPage-DRAgGo9i.js +490 -0
  4. package/dist/CustomerDetailsPage-BCeMmOFe.js +615 -0
  5. package/dist/{CustomersPage-2Y05LVyh.js → CustomersPage-CaNBMXmM.js} +64 -53
  6. package/dist/{DashboardPage-BVjQi0EB.js → DashboardPage-DIKlXde3.js} +16 -16
  7. package/dist/DataTable-XvUcTjwi.js +340 -0
  8. package/dist/DocumentsCard-U2lSe-cn.js +169 -0
  9. package/dist/{DriverDetailsPage-CN3WQ0B9.js → DriverDetailsPage-BQrYd_Lp.js} +178 -195
  10. package/dist/{DriversPage-B0Zpx8OQ.js → DriversPage-PYmdFiby.js} +65 -54
  11. package/dist/FinancePage-Cwh9Bw4M.js +136 -0
  12. package/dist/{FleetPage-DqkFi3s3.js → FleetPage-3ZHsB-TN.js} +23 -22
  13. package/dist/{FormError-BlOjnXOq.js → FormError-cuLV2jVD.js} +1 -1
  14. package/dist/{ImportExportPage-DKJRCezl.js → ImportExportPage-C6f7DqhM.js} +50 -70
  15. package/dist/{InventoryPage-DwfgCUQq.js → InventoryPage-DpiqVu1v.js} +9 -9
  16. package/dist/{LiveTrackingPage-DCX-K-LR.js → LiveTrackingPage-FAzzlVnX.js} +9 -9
  17. package/dist/MarketplacePage-Bh_2ns4v.js +426 -0
  18. package/dist/Notice-CSoDYKw9.js +46 -0
  19. package/dist/OrderDetailsPage-zCj0lW0j.js +584 -0
  20. package/dist/{OrdersListPage-BjDlCKJd.js → OrdersListPage-CAMsuUck.js} +166 -89
  21. package/dist/{ProductDetailsPage-C9uOiYLp.js → ProductDetailsPage-wsxAQkA0.js} +12 -12
  22. package/dist/{ProductsPage-C1G9h7Xd.js → ProductsPage-DC5qDLfz.js} +60 -49
  23. package/dist/ReportsPage-BwUJ37eO.js +356 -0
  24. package/dist/RouteDetailsPage-DyMJE9AS.js +583 -0
  25. package/dist/{RoutesPage-DMfoicM1.js → RoutesPage-Dtc669yc.js} +57 -46
  26. package/dist/{SettingsPage-Bn-v0mbQ.js → SettingsPage-CpH9xhQg.js} +5 -27
  27. package/dist/{TrackingPage-W-jtdM3Y.js → TrackingPage-DaNEFG_h.js} +10 -10
  28. package/dist/{VehicleDetailsPage-Bceo5oz3.js → VehicleDetailsPage-DldYNsYV.js} +125 -142
  29. package/dist/{VehiclesPage-VBtOep91.js → VehiclesPage-BFw13iMt.js} +61 -50
  30. package/dist/{WarehouseDetailsPage-L_6sWigM.js → WarehouseDetailsPage-CMG7or6G.js} +17 -17
  31. package/dist/{WarehousesPage-DCbXXXWE.js → WarehousesPage-Wkytnt86.js} +58 -47
  32. package/dist/arrow-right-Q3XQpTPR.js +11 -0
  33. package/dist/arrow-up-xNF1zJUG.js +17 -0
  34. package/dist/chevron-left-B2_r0Elx.js +8 -0
  35. package/dist/{wrench-CANXWxF-.js → fuel-B6_lnKDs.js} +2 -5
  36. package/dist/index.js +163 -174
  37. package/dist/upload-CHZofOqb.js +21 -0
  38. package/dist/{useAnalytics-DS8n0xgg.js → useAnalytics-D7HW2XRb.js} +52 -2
  39. package/dist/{useCustomers-BmTNGxiI.js → useCustomers-BPW4__PR.js} +29 -26
  40. package/dist/{useFleet-DKqXZ16m.js → useFleet-ChBkxAd6.js} +81 -69
  41. package/dist/{useInventory-DkyiVY_A.js → useInventory-CAAVMRp6.js} +83 -38
  42. package/dist/{useOrders-Cfk1GLiq.js → useOrders-B465S2nt.js} +58 -47
  43. package/dist/{useReports-CTqZr-AB.js → useReports-jQ3GpNOm.js} +40 -34
  44. package/dist/{useRoutes-BQWO607N.js → useRoutes-hS3d5-xr.js} +49 -41
  45. package/dist/{useTracking-B-va1kO3.js → useTracking-RjGz9PZG.js} +2 -2
  46. package/dist/user-check-BEKRCi7v.js +20 -0
  47. package/dist/wrench-q_rgJfaP.js +8 -0
  48. package/dist/x-tMeDMcCw.js +11 -0
  49. package/package.json +1 -1
  50. package/src/movethewheels/components/DataTable.tsx +252 -84
  51. package/src/movethewheels/components/DocumentsCard.tsx +102 -0
  52. package/src/movethewheels/components/Notice.tsx +61 -0
  53. package/src/movethewheels/components/index.ts +7 -0
  54. package/src/movethewheels/hooks/index.ts +9 -0
  55. package/src/movethewheels/hooks/useAnalytics.ts +95 -0
  56. package/src/movethewheels/hooks/useCustomers.ts +11 -4
  57. package/src/movethewheels/hooks/useEntityDocuments.ts +132 -0
  58. package/src/movethewheels/hooks/useFleet.ts +26 -7
  59. package/src/movethewheels/hooks/useInventory.ts +70 -7
  60. package/src/movethewheels/hooks/useOrders.ts +32 -2
  61. package/src/movethewheels/hooks/useReports.ts +14 -4
  62. package/src/movethewheels/hooks/useRoutes.ts +20 -3
  63. package/src/movethewheels/pages/AnalyticsPage.tsx +2 -2
  64. package/src/movethewheels/pages/CreateOrderPage.tsx +44 -16
  65. package/src/movethewheels/pages/CustomerDetailsPage.tsx +239 -33
  66. package/src/movethewheels/pages/CustomersPage.tsx +27 -11
  67. package/src/movethewheels/pages/DriverDetailsPage.tsx +16 -30
  68. package/src/movethewheels/pages/DriversPage.tsx +26 -9
  69. package/src/movethewheels/pages/FinancePage.tsx +67 -84
  70. package/src/movethewheels/pages/InventoryPage.tsx +1 -1
  71. package/src/movethewheels/pages/MarketplacePage.tsx +265 -50
  72. package/src/movethewheels/pages/OrderDetailsPage.tsx +214 -10
  73. package/src/movethewheels/pages/OrdersListPage.tsx +77 -14
  74. package/src/movethewheels/pages/ProductsPage.tsx +27 -7
  75. package/src/movethewheels/pages/ReportsPage.tsx +65 -4
  76. package/src/movethewheels/pages/RouteDetailsPage.tsx +74 -13
  77. package/src/movethewheels/pages/RoutesPage.tsx +22 -6
  78. package/src/movethewheels/pages/SettingsPage.tsx +3 -19
  79. package/src/movethewheels/pages/VehicleDetailsPage.tsx +3 -33
  80. package/src/movethewheels/pages/VehiclesPage.tsx +26 -5
  81. package/src/movethewheels/pages/WarehousesPage.tsx +22 -17
  82. package/src/movethewheels/types/index.ts +8 -0
  83. package/src/movethewheels/utils/download.ts +62 -0
  84. package/dist/CreateOrderPage-C5iwnjp4.js +0 -479
  85. package/dist/CustomerDetailsPage-B6nwFyLO.js +0 -406
  86. package/dist/DataTable-DmciIKKM.js +0 -249
  87. package/dist/FinancePage-DEDykSOP.js +0 -158
  88. package/dist/MarketplacePage-CIQ97_zp.js +0 -247
  89. package/dist/OrderDetailsPage-DYiZ-9UK.js +0 -429
  90. package/dist/ReportsPage-Zp53q3_8.js +0 -284
  91. package/dist/RouteDetailsPage-DUStXSf9.js +0 -531
  92. /package/dist/{MetricCard-BY0QrMD4.js → MetricCard-CVBVpu7o.js} +0 -0
  93. /package/dist/{StatusBadge-BZurYHMy.js → StatusBadge-C87mDpDP.js} +0 -0
  94. /package/dist/{box-D9Pal4HM.js → box-Eu05PXDh.js} +0 -0
  95. /package/dist/{chart-column-BFIJysDR.js → chart-column-ouzgxIv_.js} +0 -0
  96. /package/dist/{chevron-right-EMIIyyJ1.js → chevron-right-eV4LjaSi.js} +0 -0
  97. /package/dist/{circle-alert-iY24lSlp.js → circle-alert-Bzh2DBSF.js} +0 -0
  98. /package/dist/{circle-check-big-w0TrLKMF.js → circle-check-big-CGMSpQmD.js} +0 -0
  99. /package/dist/{clock-DJZtdl8u.js → clock-Bl3ptexL.js} +0 -0
  100. /package/dist/{dollar-sign-CgKQRz_e.js → dollar-sign-CAVU95SO.js} +0 -0
  101. /package/dist/{download-DRXxoiQR.js → download-C5NbvVDc.js} +0 -0
  102. /package/dist/{file-text-DWWY6_f5.js → file-text-D-1uvLZG.js} +0 -0
  103. /package/dist/{filter-DloLC2eE.js → filter-DUfUg6BO.js} +0 -0
  104. /package/dist/{formatters-CF2S2l1m.js → formatters-BQr-aR5W.js} +0 -0
  105. /package/dist/{map-CkJaULb2.js → map-C-M-FQLR.js} +0 -0
  106. /package/dist/{map-pin-BGiCvyCs.js → map-pin-Dznl5l40.js} +0 -0
  107. /package/dist/{navigation-D36prnAn.js → navigation-BJSJl-VG.js} +0 -0
  108. /package/dist/{package-BChUzpJS.js → package-CcRttV2N.js} +0 -0
  109. /package/dist/{phone-Ac9s3mo_.js → phone-DVSZHt_j.js} +0 -0
  110. /package/dist/{plus-Z76q-FZm.js → plus-C_XZDwBz.js} +0 -0
  111. /package/dist/{refresh-cw-DKt6f5T6.js → refresh-cw-CfgN67l3.js} +0 -0
  112. /package/dist/{save-CojywNhG.js → save-DJE8Fpdv.js} +0 -0
  113. /package/dist/{search-CDGefqb3.js → search-D_VyGcZT.js} +0 -0
  114. /package/dist/{square-pen-CopE9GmB.js → square-pen-D-6JYrVQ.js} +0 -0
  115. /package/dist/{star-nHlLjDKR.js → star-BpRlUZuU.js} +0 -0
  116. /package/dist/{store-BR9Voi5E.js → store-B-8HMuyZ.js} +0 -0
  117. /package/dist/{trash-2-BKhar6Hs.js → trash-2-8vmv-XV_.js} +0 -0
  118. /package/dist/{trending-up-Dohgd4t_.js → trending-up-Dz6PqPRj.js} +0 -0
  119. /package/dist/{triangle-alert-i-XQL9Rd.js → triangle-alert-D7Y3J_4z.js} +0 -0
  120. /package/dist/{truck-C0v_hbLR.js → truck-D-y2IDzv.js} +0 -0
  121. /package/dist/{useAssistant-D4v3oxD3.js → useAssistant-DVW4QgQb.js} +0 -0
  122. /package/dist/{useImportExport-DHr-SWSw.js → useImportExport-DrPDHEDK.js} +0 -0
  123. /package/dist/{useSettings-CkDH_-gM.js → useSettings-BB8X2RLh.js} +0 -0
  124. /package/dist/{user-jyFU3lXk.js → user-DzfTn4dE.js} +0 -0
  125. /package/dist/{users-DZ-ilS6B.js → users-CCrq-w0C.js} +0 -0
  126. /package/dist/{warehouse-6m5kXMLu.js → warehouse-CaqfmMKh.js} +0 -0
@@ -1,80 +1,84 @@
1
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-DmciIKKM.js";
3
- import { t as a } from "./download-DRXxoiQR.js";
4
- import { t as o } from "./plus-Z76q-FZm.js";
5
- import { t as s } from "./refresh-cw-DKt6f5T6.js";
6
- import { t as c } from "./truck-C0v_hbLR.js";
7
- import { o as l } from "./useFleet-DKqXZ16m.js";
8
- import { a as u, r as d } from "./StatusBadge-BZurYHMy.js";
9
- import { jsx as f, jsxs as p } from "react/jsx-runtime";
10
- import { CTAOverflowMenu as m, EmphasisPanel as h, PagePurpose as g } from "@burdenoff/fe-libs/ui";
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";
11
12
  //#region src/movethewheels/pages/VehiclesPage.tsx
12
- function _() {
13
- let { basePath: _, navigate: v } = r(), { vehicles: y, totalVehicles: b, isLoading: x, refetch: S } = l(), C = (e) => {
14
- v && v(t(_, e));
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));
15
19
  };
16
- return /* @__PURE__ */ p(n, {
20
+ return /* @__PURE__ */ h(n, {
17
21
  title: "Vehicles",
18
- subtitle: `${b} vehicles in fleet`,
19
- icon: /* @__PURE__ */ f(c, { size: 24 }),
20
- headerActions: /* @__PURE__ */ f(m, {
22
+ subtitle: `${k} vehicles in fleet`,
23
+ icon: /* @__PURE__ */ m(c, { size: 24 }),
24
+ headerActions: /* @__PURE__ */ m(g, {
21
25
  primary: {
22
26
  label: "Add Vehicle",
23
- icon: /* @__PURE__ */ f(o, { size: 16 }),
24
- onSelect: () => C("fleet/vehicles/new")
27
+ icon: /* @__PURE__ */ m(o, { size: 16 }),
28
+ onSelect: () => A("fleet/vehicles/new")
25
29
  },
26
30
  actions: [{
27
31
  label: "Refresh",
28
- icon: /* @__PURE__ */ f(s, { size: 16 }),
29
- onSelect: () => S()
32
+ icon: /* @__PURE__ */ m(s, { size: 16 }),
33
+ onSelect: () => D()
30
34
  }, {
31
35
  label: "Export",
32
- icon: /* @__PURE__ */ f(a, { size: 16 }),
33
- onSelect: () => {}
36
+ icon: /* @__PURE__ */ m(a, { size: 16 }),
37
+ onSelect: () => A("import-export")
34
38
  }]
35
39
  }),
36
40
  children: [
37
- /* @__PURE__ */ f(g, {
38
- icon: /* @__PURE__ */ f(c, { size: 18 }),
41
+ /* @__PURE__ */ m(v, {
42
+ icon: /* @__PURE__ */ m(c, { size: 18 }),
39
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."
40
44
  }),
41
- /* @__PURE__ */ p(h, { children: [/* @__PURE__ */ f("p", {
45
+ /* @__PURE__ */ h(_, { children: [/* @__PURE__ */ m("p", {
42
46
  className: "text-sm font-medium text-text-secondary",
43
47
  children: "Fleet at a glance"
44
- }), /* @__PURE__ */ p("div", {
48
+ }), /* @__PURE__ */ h("div", {
45
49
  className: "mt-3 grid grid-cols-3 gap-4",
46
50
  children: [
47
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
51
+ /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
48
52
  className: "text-2xl font-bold text-text-primary tabular-nums",
49
- children: b
50
- }), /* @__PURE__ */ f("p", {
53
+ children: k
54
+ }), /* @__PURE__ */ m("p", {
51
55
  className: "text-xs text-text-secondary",
52
56
  children: "Total vehicles"
53
57
  })] }),
54
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
58
+ /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
55
59
  className: "text-2xl font-bold text-text-primary tabular-nums",
56
- children: y.filter((e) => e.status === "available").length
57
- }), /* @__PURE__ */ f("p", {
60
+ children: O.vehiclesByStatus.available
61
+ }), /* @__PURE__ */ m("p", {
58
62
  className: "text-xs text-text-secondary",
59
63
  children: "Available now"
60
64
  })] }),
61
- /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
65
+ /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ m("p", {
62
66
  className: "text-2xl font-bold text-text-primary tabular-nums",
63
- children: y.filter((e) => e.status === "maintenance").length
64
- }), /* @__PURE__ */ f("p", {
67
+ children: O.vehiclesByStatus.maintenance
68
+ }), /* @__PURE__ */ m("p", {
65
69
  className: "text-xs text-text-secondary",
66
70
  children: "In maintenance"
67
71
  })] })
68
72
  ]
69
73
  })] }),
70
- /* @__PURE__ */ f(i, {
74
+ /* @__PURE__ */ m(i, {
71
75
  columns: [
72
76
  {
73
77
  id: "vehicleNumber",
74
78
  header: "Vehicle #",
75
79
  accessorKey: "vehicleNumber",
76
80
  sortable: !0,
77
- cell: (e) => /* @__PURE__ */ f("span", {
81
+ cell: (e) => /* @__PURE__ */ m("span", {
78
82
  className: "font-medium",
79
83
  children: e.vehicleNumber
80
84
  })
@@ -83,19 +87,19 @@ function _() {
83
87
  id: "type",
84
88
  header: "Type",
85
89
  accessorKey: "type",
86
- cell: (e) => /* @__PURE__ */ f(u, { type: e.type })
90
+ cell: (e) => /* @__PURE__ */ m(d, { type: e.type })
87
91
  },
88
92
  {
89
93
  id: "details",
90
94
  header: "Vehicle",
91
- cell: (e) => /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("p", {
95
+ cell: (e) => /* @__PURE__ */ h("div", { children: [/* @__PURE__ */ h("p", {
92
96
  className: "font-medium",
93
97
  children: [
94
98
  e.make,
95
99
  " ",
96
100
  e.model
97
101
  ]
98
- }), /* @__PURE__ */ f("p", {
102
+ }), /* @__PURE__ */ m("p", {
99
103
  className: "text-sm text-text-secondary",
100
104
  children: e.year
101
105
  })] })
@@ -105,7 +109,7 @@ function _() {
105
109
  header: "Status",
106
110
  accessorKey: "status",
107
111
  sortable: !0,
108
- cell: (e) => /* @__PURE__ */ f(d, {
112
+ cell: (e) => /* @__PURE__ */ m(f, {
109
113
  status: e.status,
110
114
  type: "vehicle"
111
115
  })
@@ -113,9 +117,9 @@ function _() {
113
117
  {
114
118
  id: "capacity",
115
119
  header: "Capacity",
116
- cell: (e) => /* @__PURE__ */ p("div", {
120
+ cell: (e) => /* @__PURE__ */ h("div", {
117
121
  className: "text-sm",
118
- children: [/* @__PURE__ */ p("p", { children: [e.capacity.weight, " kg"] }), /* @__PURE__ */ p("p", {
122
+ children: [/* @__PURE__ */ h("p", { children: [e.capacity.weight, " kg"] }), /* @__PURE__ */ h("p", {
119
123
  className: "text-text-secondary",
120
124
  children: [e.capacity.volume, " m³"]
121
125
  })]
@@ -124,12 +128,12 @@ function _() {
124
128
  {
125
129
  id: "fuel",
126
130
  header: "Fuel Level",
127
- cell: (t) => t.fuelLevel === void 0 ? "-" : /* @__PURE__ */ p("div", {
131
+ cell: (t) => t.fuelLevel === void 0 ? "-" : /* @__PURE__ */ h("div", {
128
132
  className: "flex items-center gap-2",
129
- children: [/* @__PURE__ */ f(e, {
133
+ children: [/* @__PURE__ */ m(e, {
130
134
  value: t.fuelLevel,
131
135
  className: "w-16 h-2"
132
- }), /* @__PURE__ */ p("span", {
136
+ }), /* @__PURE__ */ h("span", {
133
137
  className: "text-sm",
134
138
  children: [t.fuelLevel, "%"]
135
139
  })]
@@ -143,8 +147,8 @@ function _() {
143
147
  cell: (e) => e.mileage ? `${e.mileage.toLocaleString()} mi` : "-"
144
148
  }
145
149
  ],
146
- data: y,
147
- isLoading: x,
150
+ data: T,
151
+ isLoading: E,
148
152
  searchable: !0,
149
153
  searchPlaceholder: "Search vehicles...",
150
154
  searchFields: [
@@ -152,8 +156,15 @@ function _() {
152
156
  "make",
153
157
  "model"
154
158
  ],
155
- onRowClick: (e) => C(`fleet/vehicles/${e.id}`),
159
+ onRowClick: (e) => A(`fleet/vehicles/${e.id}`),
156
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,
157
168
  emptyIllustration: "empty-data",
158
169
  emptyTitle: "No vehicles yet",
159
170
  emptyDescription: "Add vehicles to your fleet to start assigning them to deliveries."
@@ -162,4 +173,4 @@ function _() {
162
173
  });
163
174
  }
164
175
  //#endregion
165
- export { _ as default };
176
+ export { y as default };
@@ -1,15 +1,15 @@
1
1
  import { A as e, F as t, I as n, L as r, M as i, P as a, R as o, ct as s, d as c, f as l, g as u, h as d, i as f, j as p, l as m, n as h, ot as g, r as _, u as v } from "./PageLayout-D4LDHJJq.js";
2
2
  import { t as y } from "./arrow-left-n48Y-Wis.js";
3
- import { t as b } from "./box-D9Pal4HM.js";
4
- import { t as x } from "./clock-DJZtdl8u.js";
5
- import { t as S } from "./map-pin-BGiCvyCs.js";
6
- import { t as C } from "./save-CojywNhG.js";
7
- import { t as w } from "./square-pen-CopE9GmB.js";
8
- import { t as T } from "./users-DZ-ilS6B.js";
9
- import { t as E } from "./warehouse-6m5kXMLu.js";
10
- import { a as D, t as O } from "./useInventory-DkyiVY_A.js";
11
- import { t as k } from "./formatters-CF2S2l1m.js";
12
- import { t as A } from "./FormError-BlOjnXOq.js";
3
+ import { t as b } from "./box-Eu05PXDh.js";
4
+ import { t as x } from "./clock-Bl3ptexL.js";
5
+ import { t as S } from "./map-pin-Dznl5l40.js";
6
+ import { t as C } from "./save-DJE8Fpdv.js";
7
+ import { t as w } from "./square-pen-D-6JYrVQ.js";
8
+ import { t as T } from "./users-CCrq-w0C.js";
9
+ import { t as E } from "./warehouse-CaqfmMKh.js";
10
+ import { o as D, t as O } from "./useInventory-CAAVMRp6.js";
11
+ import { t as k } from "./FormError-cuLV2jVD.js";
12
+ import { t as A } from "./formatters-BQr-aR5W.js";
13
13
  import { useState as j } from "react";
14
14
  import { useParams as M } from "react-router-dom";
15
15
  import { jsx as N, jsxs as P } from "react/jsx-runtime";
@@ -48,7 +48,7 @@ function z() {
48
48
  postalCode: "",
49
49
  country: "USA",
50
50
  totalCapacity: ""
51
- }), [x, w] = j(!1), [T, D] = j(null), k = () => m?.(s(i, "inventory/warehouses")), M = (e, t) => b((n) => ({
51
+ }), [x, w] = j(!1), [T, D] = j(null), A = () => m?.(s(i, "inventory/warehouses")), M = (e, t) => b((n) => ({
52
52
  ...n,
53
53
  [e]: t
54
54
  })), I = async (e) => {
@@ -88,7 +88,7 @@ function z() {
88
88
  className: "flex gap-2",
89
89
  children: [/* @__PURE__ */ P(v, {
90
90
  variant: "outline",
91
- onClick: k,
91
+ onClick: A,
92
92
  disabled: x,
93
93
  children: [/* @__PURE__ */ N(y, { size: 16 }), " Cancel"]
94
94
  }), /* @__PURE__ */ P(v, {
@@ -108,7 +108,7 @@ function z() {
108
108
  onSubmit: I,
109
109
  className: "max-w-2xl space-y-6",
110
110
  children: [
111
- /* @__PURE__ */ N(A, { message: T }),
111
+ /* @__PURE__ */ N(k, { message: T }),
112
112
  /* @__PURE__ */ P(F, { children: [/* @__PURE__ */ N("h2", {
113
113
  className: "text-base font-semibold text-text-primary mb-4",
114
114
  children: "Warehouse Details"
@@ -276,7 +276,7 @@ function B() {
276
276
  title: "Warehouse not found",
277
277
  onRetry: p
278
278
  });
279
- let A = r.capacity.usedSpace / r.capacity.totalSpace * 100;
279
+ let k = r.capacity.usedSpace / r.capacity.totalSpace * 100;
280
280
  return /* @__PURE__ */ P(f, {
281
281
  title: r.name,
282
282
  subtitle: `Code: ${r.code}`,
@@ -334,9 +334,9 @@ function B() {
334
334
  children: [/* @__PURE__ */ P("div", { children: [
335
335
  /* @__PURE__ */ P("div", {
336
336
  className: "flex justify-between text-sm mb-2",
337
- children: [/* @__PURE__ */ N("span", { children: "Space Utilization" }), /* @__PURE__ */ P("span", { children: [A.toFixed(0), "%"] })]
337
+ children: [/* @__PURE__ */ N("span", { children: "Space Utilization" }), /* @__PURE__ */ P("span", { children: [k.toFixed(0), "%"] })]
338
338
  }),
339
- /* @__PURE__ */ N(i, { value: A }),
339
+ /* @__PURE__ */ N(i, { value: k }),
340
340
  /* @__PURE__ */ P("p", {
341
341
  className: "text-sm text-text-secondary mt-1",
342
342
  children: [
@@ -421,7 +421,7 @@ function B() {
421
421
  children: [/* @__PURE__ */ N(S, { size: 18 }), " Location"]
422
422
  }) }), /* @__PURE__ */ N(l, { children: /* @__PURE__ */ N("p", {
423
423
  className: "text-sm",
424
- children: k(r.address)
424
+ children: A(r.address)
425
425
  }) })] }),
426
426
  /* @__PURE__ */ P(c, { children: [/* @__PURE__ */ N(d, { children: /* @__PURE__ */ N(u, { children: "Metrics" }) }), /* @__PURE__ */ P(l, {
427
427
  className: "space-y-3",
@@ -1,75 +1,79 @@
1
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-DmciIKKM.js";
3
- import { t as o } from "./plus-Z76q-FZm.js";
4
- import { t as s } from "./refresh-cw-DKt6f5T6.js";
5
- import { t as c } from "./warehouse-6m5kXMLu.js";
6
- import { o as l } from "./useInventory-DkyiVY_A.js";
7
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
8
- import { CTAOverflowMenu as f, EmphasisPanel as p, PagePurpose as m } from "@burdenoff/fe-libs/ui";
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";
9
10
  //#region src/movethewheels/pages/WarehousesPage.tsx
10
- function h() {
11
- let { basePath: h, navigate: g } = i(), { warehouses: _, totalWarehouses: v, isLoading: y, refetch: b } = l(), x = (e) => g?.(t(h, e));
12
- return /* @__PURE__ */ d(n, {
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, {
13
17
  title: "Warehouses",
14
- subtitle: `${v} warehouses`,
15
- icon: /* @__PURE__ */ u(c, { size: 24 }),
16
- headerActions: /* @__PURE__ */ u(f, {
18
+ subtitle: `${D.total} warehouses`,
19
+ icon: /* @__PURE__ */ f(c, { size: 24 }),
20
+ headerActions: /* @__PURE__ */ f(m, {
17
21
  primary: {
18
22
  label: "Add Warehouse",
19
- icon: /* @__PURE__ */ u(o, { size: 16 }),
20
- onSelect: () => x("inventory/warehouses/new")
23
+ icon: /* @__PURE__ */ f(o, { size: 16 }),
24
+ onSelect: () => O("inventory/warehouses/new")
21
25
  },
22
26
  actions: [{
23
27
  label: "Refresh",
24
- icon: /* @__PURE__ */ u(s, { size: 16 }),
25
- onSelect: () => b()
28
+ icon: /* @__PURE__ */ f(s, { size: 16 }),
29
+ onSelect: () => E()
26
30
  }]
27
31
  }),
28
32
  children: [
29
- /* @__PURE__ */ u(m, {
30
- icon: /* @__PURE__ */ u(c, { size: 18 }),
33
+ /* @__PURE__ */ f(g, {
34
+ icon: /* @__PURE__ */ f(c, { size: 18 }),
31
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."
32
36
  }),
33
- /* @__PURE__ */ d(p, { children: [/* @__PURE__ */ u("p", {
37
+ /* @__PURE__ */ p(h, { children: [/* @__PURE__ */ f("p", {
34
38
  className: "text-sm font-medium text-text-secondary",
35
39
  children: "Network at a glance"
36
- }), /* @__PURE__ */ d("div", {
40
+ }), /* @__PURE__ */ p("div", {
37
41
  className: "mt-3 grid grid-cols-3 gap-4",
38
42
  children: [
39
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("p", {
43
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
40
44
  className: "text-2xl font-bold text-text-primary tabular-nums",
41
- children: v
42
- }), /* @__PURE__ */ u("p", {
45
+ children: D.total
46
+ }), /* @__PURE__ */ f("p", {
43
47
  className: "text-xs text-text-secondary",
44
48
  children: "Total sites"
45
49
  })] }),
46
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("p", {
50
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
47
51
  className: "text-2xl font-bold text-text-primary tabular-nums",
48
- children: _.filter((e) => e.isActive).length
49
- }), /* @__PURE__ */ u("p", {
52
+ children: D.active
53
+ }), /* @__PURE__ */ f("p", {
50
54
  className: "text-xs text-text-secondary",
51
55
  children: "Active"
52
56
  })] }),
53
- /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("p", {
57
+ /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
54
58
  className: "text-2xl font-bold text-text-primary tabular-nums",
55
- children: _.length > 0 ? `${Math.round(_.reduce((e, t) => e + t.capacity.usedSpace / t.capacity.totalSpace, 0) / _.length * 100)}%` : "—"
56
- }), /* @__PURE__ */ u("p", {
59
+ children: D.total > 0 ? `${Math.round(D.avgUtilization * 100)}%` : "—"
60
+ }), /* @__PURE__ */ f("p", {
57
61
  className: "text-xs text-text-secondary",
58
62
  children: "Avg utilization"
59
63
  })] })
60
64
  ]
61
65
  })] }),
62
- /* @__PURE__ */ u(a, {
66
+ /* @__PURE__ */ f(a, {
63
67
  columns: [
64
68
  {
65
69
  id: "name",
66
70
  header: "Warehouse",
67
71
  accessorKey: "name",
68
72
  sortable: !0,
69
- cell: (e) => /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ u("p", {
73
+ cell: (e) => /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("p", {
70
74
  className: "font-medium",
71
75
  children: e.name
72
- }), /* @__PURE__ */ u("p", {
76
+ }), /* @__PURE__ */ f("p", {
73
77
  className: "text-sm text-text-secondary",
74
78
  children: e.code
75
79
  })] })
@@ -77,11 +81,11 @@ function h() {
77
81
  {
78
82
  id: "location",
79
83
  header: "Location",
80
- cell: (e) => /* @__PURE__ */ d("div", { children: [/* @__PURE__ */ d("p", { children: [
84
+ cell: (e) => /* @__PURE__ */ p("div", { children: [/* @__PURE__ */ p("p", { children: [
81
85
  e.address.city,
82
86
  ", ",
83
87
  e.address.state
84
- ] }), /* @__PURE__ */ u("p", {
88
+ ] }), /* @__PURE__ */ f("p", {
85
89
  className: "text-sm text-text-secondary",
86
90
  children: e.address.country
87
91
  })] })
@@ -90,7 +94,7 @@ function h() {
90
94
  id: "type",
91
95
  header: "Type",
92
96
  accessorKey: "type",
93
- cell: (e) => /* @__PURE__ */ u(r, {
97
+ cell: (e) => /* @__PURE__ */ f(r, {
94
98
  variant: "outline",
95
99
  className: "capitalize",
96
100
  children: e.type.replace("_", " ")
@@ -101,12 +105,12 @@ function h() {
101
105
  header: "Utilization",
102
106
  cell: (t) => {
103
107
  let n = t.capacity.usedSpace / t.capacity.totalSpace * 100;
104
- return /* @__PURE__ */ d("div", {
108
+ return /* @__PURE__ */ p("div", {
105
109
  className: "flex items-center gap-2",
106
- children: [/* @__PURE__ */ u(e, {
110
+ children: [/* @__PURE__ */ f(e, {
107
111
  value: n,
108
112
  className: "w-16 h-2"
109
- }), /* @__PURE__ */ d("span", {
113
+ }), /* @__PURE__ */ p("span", {
110
114
  className: "text-sm",
111
115
  children: [n.toFixed(0), "%"]
112
116
  })]
@@ -116,15 +120,15 @@ function h() {
116
120
  {
117
121
  id: "capacity",
118
122
  header: "Capacity",
119
- cell: (e) => /* @__PURE__ */ d("div", {
123
+ cell: (e) => /* @__PURE__ */ p("div", {
120
124
  className: "text-sm",
121
- children: [/* @__PURE__ */ d("p", { children: [
125
+ children: [/* @__PURE__ */ p("p", { children: [
122
126
  e.capacity.usedSpace.toLocaleString(),
123
127
  " / ",
124
128
  e.capacity.totalSpace.toLocaleString(),
125
129
  " ",
126
130
  "sq ft"
127
- ] }), /* @__PURE__ */ d("p", {
131
+ ] }), /* @__PURE__ */ p("p", {
128
132
  className: "text-text-secondary",
129
133
  children: [
130
134
  e.capacity.usedPallets,
@@ -138,19 +142,26 @@ function h() {
138
142
  {
139
143
  id: "status",
140
144
  header: "Status",
141
- cell: (e) => /* @__PURE__ */ u(r, {
145
+ cell: (e) => /* @__PURE__ */ f(r, {
142
146
  variant: e.isActive ? "default" : "secondary",
143
147
  children: e.isActive ? "Active" : "Inactive"
144
148
  })
145
149
  }
146
150
  ],
147
- data: _,
148
- isLoading: y,
151
+ data: C,
152
+ isLoading: T,
149
153
  searchable: !0,
150
154
  searchPlaceholder: "Search warehouses...",
151
155
  searchFields: ["name", "code"],
152
- onRowClick: (e) => x(`inventory/warehouses/${e.id}`),
156
+ onRowClick: (e) => O(`inventory/warehouses/${e.id}`),
153
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,
154
165
  emptyIllustration: "empty-data",
155
166
  emptyTitle: "No warehouses yet",
156
167
  emptyDescription: "Add a warehouse to store inventory and fulfil orders from it."
@@ -159,4 +170,4 @@ function h() {
159
170
  });
160
171
  }
161
172
  //#endregion
162
- export { h as default };
173
+ export { _ as default };
@@ -0,0 +1,11 @@
1
+ import { lt as e } from "./PageLayout-D4LDHJJq.js";
2
+ //#region node_modules/lucide-react/dist/esm/icons/arrow-right.js
3
+ var t = e("ArrowRight", [["path", {
4
+ d: "M5 12h14",
5
+ key: "1ays0h"
6
+ }], ["path", {
7
+ d: "m12 5 7 7-7 7",
8
+ key: "xquz4c"
9
+ }]]);
10
+ //#endregion
11
+ export { t };
@@ -0,0 +1,17 @@
1
+ import { lt as e } from "./PageLayout-D4LDHJJq.js";
2
+ //#region node_modules/lucide-react/dist/esm/icons/arrow-down.js
3
+ var t = e("ArrowDown", [["path", {
4
+ d: "M12 5v14",
5
+ key: "s699le"
6
+ }], ["path", {
7
+ d: "m19 12-7 7-7-7",
8
+ key: "1idqje"
9
+ }]]), n = e("ArrowUp", [["path", {
10
+ d: "m5 12 7-7 7 7",
11
+ key: "hav0vg"
12
+ }], ["path", {
13
+ d: "M12 19V5",
14
+ key: "x0mq9r"
15
+ }]]);
16
+ //#endregion
17
+ export { t as n, n as t };
@@ -0,0 +1,8 @@
1
+ import { lt as e } from "./PageLayout-D4LDHJJq.js";
2
+ //#region node_modules/lucide-react/dist/esm/icons/chevron-left.js
3
+ var t = e("ChevronLeft", [["path", {
4
+ d: "m15 18-6-6 6-6",
5
+ key: "1wnfg3"
6
+ }]]);
7
+ //#endregion
8
+ export { t };
@@ -23,9 +23,6 @@ var t = e("Fuel", [
23
23
  d: "M14 13h2a2 2 0 0 1 2 2v2a2 2 0 0 0 2 2a2 2 0 0 0 2-2V9.83a2 2 0 0 0-.59-1.42L18 5",
24
24
  key: "7cu91f"
25
25
  }]
26
- ]), n = e("Wrench", [["path", {
27
- d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",
28
- key: "cbrjhi"
29
- }]]);
26
+ ]);
30
27
  //#endregion
31
- export { t as n, n as t };
28
+ export { t };