@burdenoff/microfe-movethewheels 2026.703.3 → 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 (125) 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-BKxMS1AV.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-CH9rjQC-.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-e0ze63iX.js → InventoryPage-DpiqVu1v.js} +8 -8
  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-Cn90P1Xx.js → OrdersListPage-CAMsuUck.js} +166 -89
  21. package/dist/{ProductDetailsPage-C9uOiYLp.js → ProductDetailsPage-wsxAQkA0.js} +12 -12
  22. package/dist/{ProductsPage-QJfHHpqB.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-ApKThYeG.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/MarketplacePage.tsx +265 -50
  71. package/src/movethewheels/pages/OrderDetailsPage.tsx +214 -10
  72. package/src/movethewheels/pages/OrdersListPage.tsx +76 -13
  73. package/src/movethewheels/pages/ProductsPage.tsx +27 -7
  74. package/src/movethewheels/pages/ReportsPage.tsx +65 -4
  75. package/src/movethewheels/pages/RouteDetailsPage.tsx +74 -13
  76. package/src/movethewheels/pages/RoutesPage.tsx +22 -6
  77. package/src/movethewheels/pages/SettingsPage.tsx +3 -19
  78. package/src/movethewheels/pages/VehicleDetailsPage.tsx +3 -33
  79. package/src/movethewheels/pages/VehiclesPage.tsx +26 -5
  80. package/src/movethewheels/pages/WarehousesPage.tsx +22 -17
  81. package/src/movethewheels/types/index.ts +8 -0
  82. package/src/movethewheels/utils/download.ts +62 -0
  83. package/dist/CreateOrderPage-C5iwnjp4.js +0 -479
  84. package/dist/CustomerDetailsPage-B6nwFyLO.js +0 -406
  85. package/dist/DataTable-DmciIKKM.js +0 -249
  86. package/dist/FinancePage-DEDykSOP.js +0 -158
  87. package/dist/MarketplacePage-CIQ97_zp.js +0 -247
  88. package/dist/OrderDetailsPage-DYiZ-9UK.js +0 -429
  89. package/dist/ReportsPage-Zp53q3_8.js +0 -284
  90. package/dist/RouteDetailsPage-DUStXSf9.js +0 -531
  91. /package/dist/{MetricCard-BY0QrMD4.js → MetricCard-CVBVpu7o.js} +0 -0
  92. /package/dist/{StatusBadge-BZurYHMy.js → StatusBadge-C87mDpDP.js} +0 -0
  93. /package/dist/{box-D9Pal4HM.js → box-Eu05PXDh.js} +0 -0
  94. /package/dist/{chart-column-BFIJysDR.js → chart-column-ouzgxIv_.js} +0 -0
  95. /package/dist/{chevron-right-EMIIyyJ1.js → chevron-right-eV4LjaSi.js} +0 -0
  96. /package/dist/{circle-alert-iY24lSlp.js → circle-alert-Bzh2DBSF.js} +0 -0
  97. /package/dist/{circle-check-big-w0TrLKMF.js → circle-check-big-CGMSpQmD.js} +0 -0
  98. /package/dist/{clock-DJZtdl8u.js → clock-Bl3ptexL.js} +0 -0
  99. /package/dist/{dollar-sign-CgKQRz_e.js → dollar-sign-CAVU95SO.js} +0 -0
  100. /package/dist/{download-DRXxoiQR.js → download-C5NbvVDc.js} +0 -0
  101. /package/dist/{file-text-DWWY6_f5.js → file-text-D-1uvLZG.js} +0 -0
  102. /package/dist/{filter-DloLC2eE.js → filter-DUfUg6BO.js} +0 -0
  103. /package/dist/{formatters-CF2S2l1m.js → formatters-BQr-aR5W.js} +0 -0
  104. /package/dist/{map-CkJaULb2.js → map-C-M-FQLR.js} +0 -0
  105. /package/dist/{map-pin-BGiCvyCs.js → map-pin-Dznl5l40.js} +0 -0
  106. /package/dist/{navigation-D36prnAn.js → navigation-BJSJl-VG.js} +0 -0
  107. /package/dist/{package-BChUzpJS.js → package-CcRttV2N.js} +0 -0
  108. /package/dist/{phone-Ac9s3mo_.js → phone-DVSZHt_j.js} +0 -0
  109. /package/dist/{plus-Z76q-FZm.js → plus-C_XZDwBz.js} +0 -0
  110. /package/dist/{refresh-cw-DKt6f5T6.js → refresh-cw-CfgN67l3.js} +0 -0
  111. /package/dist/{save-CojywNhG.js → save-DJE8Fpdv.js} +0 -0
  112. /package/dist/{search-CDGefqb3.js → search-D_VyGcZT.js} +0 -0
  113. /package/dist/{square-pen-CopE9GmB.js → square-pen-D-6JYrVQ.js} +0 -0
  114. /package/dist/{star-nHlLjDKR.js → star-BpRlUZuU.js} +0 -0
  115. /package/dist/{store-BR9Voi5E.js → store-B-8HMuyZ.js} +0 -0
  116. /package/dist/{trash-2-BKhar6Hs.js → trash-2-8vmv-XV_.js} +0 -0
  117. /package/dist/{trending-up-Dohgd4t_.js → trending-up-Dz6PqPRj.js} +0 -0
  118. /package/dist/{triangle-alert-i-XQL9Rd.js → triangle-alert-D7Y3J_4z.js} +0 -0
  119. /package/dist/{truck-C0v_hbLR.js → truck-D-y2IDzv.js} +0 -0
  120. /package/dist/{useAssistant-D4v3oxD3.js → useAssistant-DVW4QgQb.js} +0 -0
  121. /package/dist/{useImportExport-DHr-SWSw.js → useImportExport-DrPDHEDK.js} +0 -0
  122. /package/dist/{useSettings-CkDH_-gM.js → useSettings-BB8X2RLh.js} +0 -0
  123. /package/dist/{user-jyFU3lXk.js → user-DzfTn4dE.js} +0 -0
  124. /package/dist/{users-DZ-ilS6B.js → users-CCrq-w0C.js} +0 -0
  125. /package/dist/{warehouse-6m5kXMLu.js → warehouse-CaqfmMKh.js} +0 -0
@@ -1,83 +1,87 @@
1
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";
2
+ import { t as s } from "./DataTable-XvUcTjwi.js";
3
+ import { t as c } from "./download-C5NbvVDc.js";
4
+ import { t as l } from "./plus-C_XZDwBz.js";
5
+ import { t as u } from "./refresh-cw-CfgN67l3.js";
6
+ import { t as d } from "./star-BpRlUZuU.js";
7
+ import { t as f } from "./users-CCrq-w0C.js";
8
+ import { n as p, r as m } from "./useCustomers-BPW4__PR.js";
9
+ import { i as h } from "./StatusBadge-C87mDpDP.js";
10
+ import { r as g } from "./formatters-BQr-aR5W.js";
11
+ import { useState as _ } from "react";
12
+ import { jsx as v, jsxs as y } from "react/jsx-runtime";
13
+ import { CTAOverflowMenu as b, EmphasisPanel as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
13
14
  //#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, {
15
+ function C() {
16
+ let { basePath: C, navigate: w } = i(), [T, E] = _(0), [D, O] = _(25), { customers: k, hasMore: A, isLoading: j, refetch: M } = m({
17
+ limit: D,
18
+ offset: T * D
19
+ }), { stats: N } = p(), P = (t) => w?.(e(C, t));
20
+ return /* @__PURE__ */ y(t, {
17
21
  title: "Customers",
18
- subtitle: `${w} customers`,
19
- icon: /* @__PURE__ */ g(f, { size: 24 }),
20
- headerActions: /* @__PURE__ */ g(v, {
22
+ subtitle: `${N.total} customers`,
23
+ icon: /* @__PURE__ */ v(f, { size: 24 }),
24
+ headerActions: /* @__PURE__ */ v(b, {
21
25
  primary: {
22
26
  label: "Add Customer",
23
- icon: /* @__PURE__ */ g(l, { size: 16 }),
24
- onSelect: () => D("customers/new")
27
+ icon: /* @__PURE__ */ v(l, { size: 16 }),
28
+ onSelect: () => P("customers/new")
25
29
  },
26
30
  actions: [{
27
31
  label: "Refresh",
28
- icon: /* @__PURE__ */ g(u, { size: 16 }),
29
- onSelect: () => E()
32
+ icon: /* @__PURE__ */ v(u, { size: 16 }),
33
+ onSelect: () => M()
30
34
  }, {
31
35
  label: "Export",
32
- icon: /* @__PURE__ */ g(c, { size: 16 }),
33
- onSelect: () => D("import-export")
36
+ icon: /* @__PURE__ */ v(c, { size: 16 }),
37
+ onSelect: () => P("import-export")
34
38
  }]
35
39
  }),
36
40
  children: [
37
- /* @__PURE__ */ g(b, {
38
- icon: /* @__PURE__ */ g(f, { size: 18 }),
41
+ /* @__PURE__ */ v(S, {
42
+ icon: /* @__PURE__ */ v(f, { size: 18 }),
39
43
  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
44
  }),
41
- /* @__PURE__ */ _(y, { children: [/* @__PURE__ */ g("p", {
45
+ /* @__PURE__ */ y(x, { children: [/* @__PURE__ */ v("p", {
42
46
  className: "text-sm font-medium text-text-secondary",
43
47
  children: "Customer base at a glance"
44
- }), /* @__PURE__ */ _("div", {
48
+ }), /* @__PURE__ */ y("div", {
45
49
  className: "mt-3 grid grid-cols-3 gap-4",
46
50
  children: [
47
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
51
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
48
52
  className: "text-2xl font-bold text-text-primary tabular-nums",
49
- children: w
50
- }), /* @__PURE__ */ g("p", {
53
+ children: N.total
54
+ }), /* @__PURE__ */ v("p", {
51
55
  className: "text-xs text-text-secondary",
52
56
  children: "Total customers"
53
57
  })] }),
54
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
58
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
55
59
  className: "text-2xl font-bold text-text-primary tabular-nums",
56
- children: C.filter((e) => e.isActive).length
57
- }), /* @__PURE__ */ g("p", {
60
+ children: N.active
61
+ }), /* @__PURE__ */ v("p", {
58
62
  className: "text-xs text-text-secondary",
59
63
  children: "Active"
60
64
  })] }),
61
- /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
65
+ /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
62
66
  className: "text-2xl font-bold text-text-primary tabular-nums",
63
- children: C.filter((e) => e.type === "b2b").length
64
- }), /* @__PURE__ */ g("p", {
67
+ children: N.b2b
68
+ }), /* @__PURE__ */ v("p", {
65
69
  className: "text-xs text-text-secondary",
66
70
  children: "Business accounts"
67
71
  })] })
68
72
  ]
69
73
  })] }),
70
- /* @__PURE__ */ g(s, {
74
+ /* @__PURE__ */ v(s, {
71
75
  columns: [
72
76
  {
73
77
  id: "customer",
74
78
  header: "Customer",
75
- cell: (e) => /* @__PURE__ */ _("div", {
79
+ cell: (e) => /* @__PURE__ */ y("div", {
76
80
  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", {
81
+ children: [/* @__PURE__ */ v(r, { children: /* @__PURE__ */ v(a, { children: e.name.split(" ").map((e) => e[0]).join("") }) }), /* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
78
82
  className: "font-medium",
79
83
  children: e.name
80
- }), /* @__PURE__ */ g("p", {
84
+ }), /* @__PURE__ */ v("p", {
81
85
  className: "text-sm text-text-secondary",
82
86
  children: e.email
83
87
  })] })]
@@ -87,7 +91,7 @@ function x() {
87
91
  id: "type",
88
92
  header: "Type",
89
93
  accessorKey: "type",
90
- cell: (e) => /* @__PURE__ */ g(m, { type: e.type })
94
+ cell: (e) => /* @__PURE__ */ v(h, { type: e.type })
91
95
  },
92
96
  {
93
97
  id: "company",
@@ -108,18 +112,18 @@ function x() {
108
112
  {
109
113
  id: "rating",
110
114
  header: "Rating",
111
- cell: (e) => /* @__PURE__ */ _("div", {
115
+ cell: (e) => /* @__PURE__ */ y("div", {
112
116
  className: "flex items-center gap-1",
113
- children: [/* @__PURE__ */ g(d, {
117
+ children: [/* @__PURE__ */ v(d, {
114
118
  size: 14,
115
119
  className: "text-status-warning-text fill-current"
116
- }), /* @__PURE__ */ g("span", { children: e.rating.toFixed(1) })]
120
+ }), /* @__PURE__ */ v("span", { children: e.rating.toFixed(1) })]
117
121
  })
118
122
  },
119
123
  {
120
124
  id: "status",
121
125
  header: "Status",
122
- cell: (e) => /* @__PURE__ */ g(n, {
126
+ cell: (e) => /* @__PURE__ */ v(n, {
123
127
  variant: e.isActive ? "default" : "secondary",
124
128
  children: e.isActive ? "Active" : "Inactive"
125
129
  })
@@ -129,11 +133,11 @@ function x() {
129
133
  header: "Created",
130
134
  accessorKey: "createdAt",
131
135
  sortable: !0,
132
- cell: (e) => h(e.createdAt, "short")
136
+ cell: (e) => g(e.createdAt, "short")
133
137
  }
134
138
  ],
135
- data: C,
136
- isLoading: T,
139
+ data: k,
140
+ isLoading: j,
137
141
  searchable: !0,
138
142
  searchPlaceholder: "Search customers...",
139
143
  searchFields: [
@@ -141,14 +145,21 @@ function x() {
141
145
  "email",
142
146
  "company"
143
147
  ],
144
- onRowClick: (e) => D(`customers/${e.id}`),
148
+ onRowClick: (e) => P(`customers/${e.id}`),
145
149
  getRowId: (e) => e.id,
150
+ pageIndex: T,
151
+ pageSize: D,
152
+ onPageChange: E,
153
+ onPageSizeChange: (e) => {
154
+ O(e), E(0);
155
+ },
156
+ hasNextPage: A,
146
157
  emptyIllustration: "empty-people",
147
158
  emptyTitle: "No customers yet",
148
159
  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, {
160
+ emptyAction: /* @__PURE__ */ y(o, {
161
+ onClick: () => P("customers/new"),
162
+ children: [/* @__PURE__ */ v(l, {
152
163
  size: 16,
153
164
  className: "mr-1.5"
154
165
  }), "Add Customer"]
@@ -158,4 +169,4 @@ function x() {
158
169
  });
159
170
  }
160
171
  //#endregion
161
- export { x as default };
172
+ export { C as default };
@@ -1,20 +1,20 @@
1
1
  import { M as e, a as t, ct as n, d as r, f as i, g as a, h as o, i as s, l as c, ot as l, u } from "./PageLayout-D4LDHJJq.js";
2
- import { t as d } from "./chevron-right-EMIIyyJ1.js";
3
- import { t as f } from "./clock-DJZtdl8u.js";
4
- import { t as p } from "./dollar-sign-CgKQRz_e.js";
5
- import { t as m } from "./map-pin-BGiCvyCs.js";
6
- import { t as h } from "./package-BChUzpJS.js";
7
- import { t as g } from "./trending-up-Dohgd4t_.js";
8
- import { t as _ } from "./triangle-alert-i-XQL9Rd.js";
9
- import { t as v } from "./truck-C0v_hbLR.js";
10
- import { t as y } from "./users-DZ-ilS6B.js";
11
- import { n as b, r as x } from "./useOrders-Cfk1GLiq.js";
12
- import { i as S } from "./useFleet-DKqXZ16m.js";
13
- import { n as C } from "./useAnalytics-DS8n0xgg.js";
14
- import { r as w } from "./useTracking-B-va1kO3.js";
15
- import { r as T, t as E } from "./MetricCard-BY0QrMD4.js";
16
- import { r as D } from "./StatusBadge-BZurYHMy.js";
17
- import { n as O, r as k } from "./formatters-CF2S2l1m.js";
2
+ import { t as d } from "./chevron-right-eV4LjaSi.js";
3
+ import { t as f } from "./clock-Bl3ptexL.js";
4
+ import { t as p } from "./dollar-sign-CAVU95SO.js";
5
+ import { t as m } from "./map-pin-Dznl5l40.js";
6
+ import { t as h } from "./package-CcRttV2N.js";
7
+ import { t as g } from "./trending-up-Dz6PqPRj.js";
8
+ import { t as _ } from "./triangle-alert-D7Y3J_4z.js";
9
+ import { t as v } from "./truck-D-y2IDzv.js";
10
+ import { t as y } from "./users-CCrq-w0C.js";
11
+ import { n as b, r as x } from "./useOrders-B465S2nt.js";
12
+ import { i as S } from "./useFleet-ChBkxAd6.js";
13
+ import { n as C } from "./useAnalytics-D7HW2XRb.js";
14
+ import { r as w } from "./useTracking-RjGz9PZG.js";
15
+ import { r as T, t as E } from "./MetricCard-CVBVpu7o.js";
16
+ import { r as D } from "./StatusBadge-C87mDpDP.js";
17
+ import { n as O, r as k } from "./formatters-BQr-aR5W.js";
18
18
  import { jsx as A, jsxs as j } from "react/jsx-runtime";
19
19
  import { CTAOverflowMenu as M, EmphasisPanel as N, PagePurpose as P } from "@burdenoff/fe-libs/ui";
20
20
  import { useI18n as F } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
@@ -0,0 +1,340 @@
1
+ import { A as e, B as t, F as n, G as r, H as i, I as a, K as o, L as ee, P as te, R as ne, U as s, W as c, lt as l, q as u, rt as d, u as f } from "./PageLayout-D4LDHJJq.js";
2
+ import { n as re, t as ie } from "./arrow-up-xNF1zJUG.js";
3
+ import { t as p } from "./chevron-left-B2_r0Elx.js";
4
+ import { t as m } from "./chevron-right-eV4LjaSi.js";
5
+ import { t as ae } from "./search-D_VyGcZT.js";
6
+ import { useMemo as h, useState as g } from "react";
7
+ import { jsx as _, jsxs as v } from "react/jsx-runtime";
8
+ import { IllustratedEmptyState as y } from "@burdenoff/fe-libs/ui";
9
+ //#region node_modules/lucide-react/dist/esm/icons/arrow-up-down.js
10
+ var oe = l("ArrowUpDown", [
11
+ ["path", {
12
+ d: "m21 16-4 4-4-4",
13
+ key: "f6ql7i"
14
+ }],
15
+ ["path", {
16
+ d: "M17 20V4",
17
+ key: "1ejh1v"
18
+ }],
19
+ ["path", {
20
+ d: "m3 8 4-4 4 4",
21
+ key: "11wl7u"
22
+ }],
23
+ ["path", {
24
+ d: "M7 4v16",
25
+ key: "1glfcx"
26
+ }]
27
+ ]), b = l("ChevronsLeft", [["path", {
28
+ d: "m11 17-5-5 5-5",
29
+ key: "13zhaf"
30
+ }], ["path", {
31
+ d: "m18 17-5-5 5-5",
32
+ key: "h8a8et"
33
+ }]]), se = l("ChevronsRight", [["path", {
34
+ d: "m6 17 5-5-5-5",
35
+ key: "xnjwq"
36
+ }], ["path", {
37
+ d: "m13 17 5-5-5-5",
38
+ key: "17xmmf"
39
+ }]]);
40
+ //#endregion
41
+ //#region src/movethewheels/components/DataTable.tsx
42
+ function x({ columns: l, data: x, isLoading: ce = !1, searchable: S = !1, searchPlaceholder: le = "Search...", searchFields: C, pagination: w = !0, pageSize: T = 10, pageSizeOptions: ue = [
43
+ 10,
44
+ 25,
45
+ 50,
46
+ 100
47
+ ], onRowClick: E, rowClassName: D, emptyMessage: O = "No data found", emptyIllustration: k, emptyTitle: de, emptyDescription: fe, emptyAction: pe, className: A, getRowId: j, pageIndex: me, onPageChange: M, onPageSizeChange: he, totalItems: N, hasNextPage: ge }) {
48
+ let P = typeof M == "function", F = me ?? 0, [I, _e] = g(""), [L, R] = g(null), [z, B] = g(null), [V, H] = g(1), [U, ve] = g(T), W = P ? T : U, G = h(() => {
49
+ if (!I || !C || C.length === 0) return x;
50
+ let e = I.toLowerCase();
51
+ return x.filter((t) => C.some((n) => {
52
+ let r = t[n];
53
+ return r != null && String(r).toLowerCase().includes(e);
54
+ }));
55
+ }, [
56
+ x,
57
+ I,
58
+ C
59
+ ]), K = h(() => {
60
+ if (!L || !z) return G;
61
+ let e = l.find((e) => e.id === L);
62
+ return e?.accessorKey ? [...G].sort((t, n) => {
63
+ let r = t[e.accessorKey], i = n[e.accessorKey];
64
+ if (r == null) return 1;
65
+ if (i == null) return -1;
66
+ let a = 0;
67
+ return a = typeof r == "string" && typeof i == "string" ? r.localeCompare(i) : typeof r == "number" && typeof i == "number" ? r - i : r instanceof Date && i instanceof Date ? r.getTime() - i.getTime() : String(r).localeCompare(String(i)), z === "asc" ? a : -a;
68
+ }) : G;
69
+ }, [
70
+ G,
71
+ L,
72
+ z,
73
+ l
74
+ ]), q = h(() => {
75
+ if (!w || P) return K;
76
+ let e = (V - 1) * U;
77
+ return K.slice(e, e + U);
78
+ }, [
79
+ K,
80
+ V,
81
+ U,
82
+ w,
83
+ P
84
+ ]), J = Math.max(1, Math.ceil(K.length / U)), Y = typeof N == "number", X = Y ? Math.max(1, Math.ceil(N / W)) : void 0, ye = (e) => {
85
+ L === e ? z === "asc" ? B("desc") : z === "desc" && (R(null), B(null)) : (R(e), B("asc"));
86
+ }, be = (e) => L === e ? _(z === "asc" ? ie : re, { className: "w-4 h-4 text-primary" }) : /* @__PURE__ */ _(oe, { className: "w-4 h-4 text-text-secondary/50" }), Z = (e, t) => {
87
+ if (t.cell) return t.cell(e);
88
+ if (t.accessorKey) {
89
+ let n = e[t.accessorKey];
90
+ return n == null ? "-" : n instanceof Date ? n.toLocaleDateString() : String(n);
91
+ }
92
+ return "-";
93
+ };
94
+ if (ce) return /* @__PURE__ */ v("div", {
95
+ className: d("space-y-4", A),
96
+ children: [
97
+ S && /* @__PURE__ */ _("div", {
98
+ className: "flex items-center gap-4",
99
+ children: /* @__PURE__ */ _(t, { className: "h-10 w-64" })
100
+ }),
101
+ /* @__PURE__ */ _("div", {
102
+ className: "hidden md:block rounded-card border border-border-seam bg-bg-surface shadow-elevation-1",
103
+ children: /* @__PURE__ */ v(i, { children: [/* @__PURE__ */ _(o, { children: /* @__PURE__ */ _(u, { children: l.map((e) => /* @__PURE__ */ _(r, { children: /* @__PURE__ */ _(t, { className: "h-4 w-20 motion-safe:animate-vc-shimmer" }) }, e.id)) }) }), /* @__PURE__ */ _(s, { children: Array.from({ length: 5 }).map((e, n) => /* @__PURE__ */ _(u, { children: l.map((e) => /* @__PURE__ */ _(c, { children: /* @__PURE__ */ _(t, { className: "h-4 w-full max-w-[100px] motion-safe:animate-vc-shimmer" }) }, e.id)) }, n)) })] })
104
+ }),
105
+ /* @__PURE__ */ _("div", {
106
+ className: "md:hidden space-y-3",
107
+ children: Array.from({ length: 4 }).map((e, n) => /* @__PURE__ */ v("div", {
108
+ className: "rounded-card border border-border-seam bg-bg-surface p-4 shadow-elevation-1",
109
+ children: [/* @__PURE__ */ _(t, { className: "h-4 w-2/3 mb-2 motion-safe:animate-vc-shimmer" }), /* @__PURE__ */ _(t, { className: "h-4 w-1/2 motion-safe:animate-vc-shimmer" })]
110
+ }, n))
111
+ })
112
+ ]
113
+ });
114
+ let Q = q.length === 0, $ = () => k ? I ? /* @__PURE__ */ _(y, {
115
+ illustration: "empty-search",
116
+ title: "No matches",
117
+ description: `Nothing matches “${I}”. Try a different search.`
118
+ }) : /* @__PURE__ */ _(y, {
119
+ illustration: k,
120
+ title: de ?? O,
121
+ description: fe,
122
+ action: pe
123
+ }) : /* @__PURE__ */ _("p", {
124
+ className: "text-text-secondary",
125
+ children: O
126
+ }), xe = w && (P ? K.length > 0 || F > 0 : K.length > 0);
127
+ return /* @__PURE__ */ v("div", {
128
+ className: d("space-y-4", A),
129
+ children: [
130
+ S && /* @__PURE__ */ _("div", {
131
+ className: "flex items-center gap-4",
132
+ children: /* @__PURE__ */ v("div", {
133
+ className: "relative flex-1 max-w-sm",
134
+ children: [/* @__PURE__ */ _(ae, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-text-secondary" }), /* @__PURE__ */ _(e, {
135
+ placeholder: le,
136
+ value: I,
137
+ onChange: (e) => {
138
+ _e(e.target.value), H(1);
139
+ },
140
+ className: "pl-9"
141
+ })]
142
+ })
143
+ }),
144
+ /* @__PURE__ */ _("div", {
145
+ className: "hidden md:block overflow-x-auto rounded-card border border-border-seam bg-bg-surface shadow-elevation-1",
146
+ children: /* @__PURE__ */ v(i, { children: [/* @__PURE__ */ _(o, { children: /* @__PURE__ */ _(u, { children: l.map((e) => /* @__PURE__ */ _(r, {
147
+ className: d(e.sortable && "cursor-pointer select-none hover:bg-bg-sunken/50", e.headerClassName),
148
+ onClick: () => e.sortable && ye(e.id),
149
+ children: /* @__PURE__ */ v("div", {
150
+ className: "flex items-center gap-2",
151
+ children: [e.header, e.sortable && be(e.id)]
152
+ })
153
+ }, e.id)) }) }), /* @__PURE__ */ _(s, { children: Q ? /* @__PURE__ */ _(u, { children: /* @__PURE__ */ _(c, {
154
+ colSpan: l.length,
155
+ className: "py-8 text-center",
156
+ children: $()
157
+ }) }) : q.map((e, t) => {
158
+ let n = j ? j(e) : t, r = typeof D == "function" ? D(e) : D;
159
+ return /* @__PURE__ */ _(u, {
160
+ className: d(E && "cursor-pointer hover:bg-bg-sunken/50", r),
161
+ onClick: () => E?.(e),
162
+ children: l.map((t) => /* @__PURE__ */ _(c, {
163
+ className: t.className,
164
+ children: Z(e, t)
165
+ }, t.id))
166
+ }, n);
167
+ }) })] })
168
+ }),
169
+ /* @__PURE__ */ _("div", {
170
+ className: "md:hidden space-y-3",
171
+ children: Q ? /* @__PURE__ */ _("div", {
172
+ className: "rounded-card border border-border-seam bg-bg-surface p-6 text-center shadow-elevation-1",
173
+ children: $()
174
+ }) : q.map((e, t) => {
175
+ let n = j ? j(e) : t, r = typeof D == "function" ? D(e) : D;
176
+ return /* @__PURE__ */ _("div", {
177
+ role: E ? "button" : void 0,
178
+ tabIndex: E ? 0 : void 0,
179
+ className: d("rounded-card border border-border-seam bg-bg-surface p-4 shadow-elevation-1", E && "cursor-pointer hover:bg-bg-sunken/50", r),
180
+ onClick: () => E?.(e),
181
+ onKeyDown: (t) => {
182
+ E && (t.key === "Enter" || t.key === " ") && (t.preventDefault(), E(e));
183
+ },
184
+ children: /* @__PURE__ */ _("dl", {
185
+ className: "space-y-2",
186
+ children: l.map((t) => /* @__PURE__ */ v("div", {
187
+ className: "flex items-start justify-between gap-3",
188
+ children: [/* @__PURE__ */ _("dt", {
189
+ className: "text-xs font-medium text-text-secondary shrink-0",
190
+ children: t.header
191
+ }), /* @__PURE__ */ _("dd", {
192
+ className: "text-sm text-right min-w-0",
193
+ children: Z(e, t)
194
+ })]
195
+ }, t.id))
196
+ })
197
+ }, n);
198
+ })
199
+ }),
200
+ xe && /* @__PURE__ */ v("div", {
201
+ className: "flex flex-wrap items-center justify-between gap-3",
202
+ children: [/* @__PURE__ */ v("div", {
203
+ className: "flex flex-wrap items-center gap-2 text-sm text-text-secondary",
204
+ children: [
205
+ P ? /* @__PURE__ */ v("span", { children: [
206
+ "Showing ",
207
+ K.length === 0 ? 0 : F * W + 1,
208
+ " to",
209
+ " ",
210
+ F * W + K.length,
211
+ Y ? ` of ${N}` : ""
212
+ ] }) : /* @__PURE__ */ v("span", { children: [
213
+ "Showing ",
214
+ (V - 1) * U + 1,
215
+ " to",
216
+ " ",
217
+ Math.min(V * U, K.length),
218
+ " of ",
219
+ K.length
220
+ ] }),
221
+ /* @__PURE__ */ v(te, {
222
+ value: String(W),
223
+ onValueChange: (e) => {
224
+ let t = Number(e);
225
+ P ? he?.(t) : (ve(t), H(1));
226
+ },
227
+ children: [/* @__PURE__ */ _(ee, {
228
+ className: "w-[70px] h-8",
229
+ children: /* @__PURE__ */ _(ne, {})
230
+ }), /* @__PURE__ */ _(n, { children: ue.map((e) => /* @__PURE__ */ _(a, {
231
+ value: String(e),
232
+ children: e
233
+ }, e)) })]
234
+ }),
235
+ /* @__PURE__ */ _("span", { children: "per page" })
236
+ ]
237
+ }), P ? /* @__PURE__ */ v("div", {
238
+ className: "flex items-center gap-1",
239
+ children: [
240
+ /* @__PURE__ */ _(f, {
241
+ variant: "outline",
242
+ size: "icon",
243
+ className: "h-8 w-8",
244
+ "aria-label": "First page",
245
+ onClick: () => M?.(0),
246
+ disabled: F === 0,
247
+ children: /* @__PURE__ */ _(b, { className: "h-4 w-4" })
248
+ }),
249
+ /* @__PURE__ */ _(f, {
250
+ variant: "outline",
251
+ size: "icon",
252
+ className: "h-8 w-8",
253
+ "aria-label": "Previous page",
254
+ onClick: () => M?.(Math.max(0, F - 1)),
255
+ disabled: F === 0,
256
+ children: /* @__PURE__ */ _(p, { className: "h-4 w-4" })
257
+ }),
258
+ /* @__PURE__ */ v("span", {
259
+ className: "px-3 text-sm",
260
+ children: [
261
+ "Page ",
262
+ F + 1,
263
+ Y ? ` of ${X}` : ""
264
+ ]
265
+ }),
266
+ /* @__PURE__ */ _(f, {
267
+ variant: "outline",
268
+ size: "icon",
269
+ className: "h-8 w-8",
270
+ "aria-label": "Next page",
271
+ onClick: () => M?.(F + 1),
272
+ disabled: Y ? F + 1 >= (X ?? 1) : !ge,
273
+ children: /* @__PURE__ */ _(m, { className: "h-4 w-4" })
274
+ }),
275
+ Y && /* @__PURE__ */ _(f, {
276
+ variant: "outline",
277
+ size: "icon",
278
+ className: "h-8 w-8",
279
+ "aria-label": "Last page",
280
+ onClick: () => M?.((X ?? 1) - 1),
281
+ disabled: F + 1 >= (X ?? 1),
282
+ children: /* @__PURE__ */ _(se, { className: "h-4 w-4" })
283
+ })
284
+ ]
285
+ }) : /* @__PURE__ */ v("div", {
286
+ className: "flex items-center gap-1",
287
+ children: [
288
+ /* @__PURE__ */ _(f, {
289
+ variant: "outline",
290
+ size: "icon",
291
+ className: "h-8 w-8",
292
+ "aria-label": "First page",
293
+ onClick: () => H(1),
294
+ disabled: V === 1,
295
+ children: /* @__PURE__ */ _(b, { className: "h-4 w-4" })
296
+ }),
297
+ /* @__PURE__ */ _(f, {
298
+ variant: "outline",
299
+ size: "icon",
300
+ className: "h-8 w-8",
301
+ "aria-label": "Previous page",
302
+ onClick: () => H((e) => Math.max(1, e - 1)),
303
+ disabled: V === 1,
304
+ children: /* @__PURE__ */ _(p, { className: "h-4 w-4" })
305
+ }),
306
+ /* @__PURE__ */ v("span", {
307
+ className: "px-3 text-sm",
308
+ children: [
309
+ "Page ",
310
+ V,
311
+ " of ",
312
+ J
313
+ ]
314
+ }),
315
+ /* @__PURE__ */ _(f, {
316
+ variant: "outline",
317
+ size: "icon",
318
+ className: "h-8 w-8",
319
+ "aria-label": "Next page",
320
+ onClick: () => H((e) => Math.min(J, e + 1)),
321
+ disabled: V === J,
322
+ children: /* @__PURE__ */ _(m, { className: "h-4 w-4" })
323
+ }),
324
+ /* @__PURE__ */ _(f, {
325
+ variant: "outline",
326
+ size: "icon",
327
+ className: "h-8 w-8",
328
+ "aria-label": "Last page",
329
+ onClick: () => H(J),
330
+ disabled: V === J,
331
+ children: /* @__PURE__ */ _(se, { className: "h-4 w-4" })
332
+ })
333
+ ]
334
+ })]
335
+ })
336
+ ]
337
+ });
338
+ }
339
+ //#endregion
340
+ export { x as t };