@burdenoff/microfe-movethewheels 2026.626.2 → 2026.703.2

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 (135) hide show
  1. package/dist/{AIAssistantPage-AvsMbunM.js → AIAssistantPage-C3cPsWt-.js} +100 -73
  2. package/dist/AnalyticsPage-Dz6g2MvK.js +215 -0
  3. package/dist/{CreateOrderPage-CjlnEtk3.js → CreateOrderPage-C5iwnjp4.js} +36 -67
  4. package/dist/CustomerDetailsPage-B6nwFyLO.js +406 -0
  5. package/dist/{CustomersPage-CGGfD4ki.js → CustomersPage-2Y05LVyh.js} +26 -28
  6. package/dist/{DashboardPage-D2HRqwg9.js → DashboardPage-BVjQi0EB.js} +85 -83
  7. package/dist/{DataTable-CD9ZhpLB.js → DataTable-DmciIKKM.js} +3 -3
  8. package/dist/DriverDetailsPage-CN3WQ0B9.js +507 -0
  9. package/dist/{DriversPage-DKiynISH.js → DriversPage-B0Zpx8OQ.js} +25 -27
  10. package/dist/{FinancePage-Vg8WPs38.js → FinancePage-DEDykSOP.js} +9 -9
  11. package/dist/FleetPage-DqkFi3s3.js +365 -0
  12. package/dist/FormError-BlOjnXOq.js +15 -0
  13. package/dist/ImportExportPage-DKJRCezl.js +290 -0
  14. package/dist/InventoryPage-DwfgCUQq.js +253 -0
  15. package/dist/{LiveTrackingPage-DQ1q4Id3.js → LiveTrackingPage-DCX-K-LR.js} +60 -56
  16. package/dist/MarketplacePage-CIQ97_zp.js +247 -0
  17. package/dist/{MetricCard-B7yMyvMX.js → MetricCard-BY0QrMD4.js} +1 -1
  18. package/dist/{OrderDetailsPage-CFASgsYX.js → OrderDetailsPage-DYiZ-9UK.js} +83 -85
  19. package/dist/{OrdersListPage-BHeT8S5o.js → OrdersListPage-BjDlCKJd.js} +31 -33
  20. package/dist/{PageLayout-D3N8MCTm.js → PageLayout-D4LDHJJq.js} +483 -422
  21. package/dist/ProductDetailsPage-C9uOiYLp.js +350 -0
  22. package/dist/{ProductsPage--xEpbQ8A.js → ProductsPage-C1G9h7Xd.js} +22 -24
  23. package/dist/ReportsPage-Zp53q3_8.js +284 -0
  24. package/dist/RouteDetailsPage-DUStXSf9.js +531 -0
  25. package/dist/RoutesPage-DMfoicM1.js +144 -0
  26. package/dist/SettingsPage-Bn-v0mbQ.js +421 -0
  27. package/dist/StatusBadge-BZurYHMy.js +152 -0
  28. package/dist/{TrackingPage-CcRc_dva.js → TrackingPage-W-jtdM3Y.js} +59 -61
  29. package/dist/VehicleDetailsPage-Bceo5oz3.js +410 -0
  30. package/dist/{VehiclesPage-UlxPWP9K.js → VehiclesPage-VBtOep91.js} +20 -22
  31. package/dist/WarehouseDetailsPage-L_6sWigM.js +493 -0
  32. package/dist/{WarehousesPage-CuTO-OPp.js → WarehousesPage-DCbXXXWE.js} +16 -18
  33. package/dist/{arrow-left-CBpZKkpq.js → arrow-left-n48Y-Wis.js} +1 -1
  34. package/dist/{box-CAaiElsb.js → box-D9Pal4HM.js} +1 -1
  35. package/dist/{chart-column-D1Ym15-S.js → chart-column-BFIJysDR.js} +1 -1
  36. package/dist/{chevron-right-BIFGi0UA.js → chevron-right-EMIIyyJ1.js} +1 -1
  37. package/dist/{circle-alert-DjmNo5_L.js → circle-alert-iY24lSlp.js} +1 -1
  38. package/dist/{circle-check-big-CjuPVo3_.js → circle-check-big-w0TrLKMF.js} +1 -1
  39. package/dist/{clock-BjkdnddD.js → clock-DJZtdl8u.js} +1 -1
  40. package/dist/{dollar-sign-IB4O0wuQ.js → dollar-sign-CgKQRz_e.js} +1 -1
  41. package/dist/{download-Dpa9vqoG.js → download-DRXxoiQR.js} +1 -1
  42. package/dist/{file-text-C8Uioy11.js → file-text-DWWY6_f5.js} +1 -1
  43. package/dist/{filter-Da5OZaHI.js → filter-DloLC2eE.js} +1 -1
  44. package/dist/index.js +186 -162
  45. package/dist/{map-_Per4sT9.js → map-CkJaULb2.js} +1 -1
  46. package/dist/{map-pin-BSaf5IDL.js → map-pin-BGiCvyCs.js} +1 -1
  47. package/dist/{navigation-DaTbrhw2.js → navigation-D36prnAn.js} +1 -1
  48. package/dist/{package-BE7U0wQE.js → package-BChUzpJS.js} +1 -1
  49. package/dist/{phone-DV4StZiA.js → phone-Ac9s3mo_.js} +1 -1
  50. package/dist/{plus-Dl1rLeJR.js → plus-Z76q-FZm.js} +1 -1
  51. package/dist/{refresh-cw-CWfERAit.js → refresh-cw-DKt6f5T6.js} +1 -1
  52. package/dist/{save-XH8vydOn.js → save-CojywNhG.js} +1 -1
  53. package/dist/{search-OxoIiL_C.js → search-CDGefqb3.js} +1 -1
  54. package/dist/{square-pen-hLIbFQFV.js → square-pen-CopE9GmB.js} +1 -1
  55. package/dist/{star-YsVV3MNQ.js → star-nHlLjDKR.js} +1 -1
  56. package/dist/{store-RCBl7HB-.js → store-BR9Voi5E.js} +1 -1
  57. package/dist/trash-2-BKhar6Hs.js +32 -0
  58. package/dist/{trending-up-C-85AwGT.js → trending-up-Dohgd4t_.js} +1 -1
  59. package/dist/{triangle-alert-BOhfGgmh.js → triangle-alert-i-XQL9Rd.js} +1 -1
  60. package/dist/{truck-CtDjNFbi.js → truck-C0v_hbLR.js} +1 -1
  61. package/dist/{useAnalytics-ph7eTIK6.js → useAnalytics-DS8n0xgg.js} +40 -40
  62. package/dist/useAssistant-D4v3oxD3.js +84 -0
  63. package/dist/{useCustomers-bS3a4ytk.js → useCustomers-BmTNGxiI.js} +24 -24
  64. package/dist/{useFleet-BdETplNE.js → useFleet-DKqXZ16m.js} +133 -109
  65. package/dist/useImportExport-DHr-SWSw.js +55 -0
  66. package/dist/{useInventory-Dwn18FPz.js → useInventory-DkyiVY_A.js} +95 -75
  67. package/dist/{useOrders-D_3_hGMp.js → useOrders-Cfk1GLiq.js} +42 -42
  68. package/dist/useReports-CTqZr-AB.js +78 -0
  69. package/dist/{useRoutes-v4aBaS-E.js → useRoutes-BQWO607N.js} +31 -31
  70. package/dist/useSettings-CkDH_-gM.js +81 -0
  71. package/dist/{useTracking-De2KIUNu.js → useTracking-B-va1kO3.js} +22 -22
  72. package/dist/{user-Dz5TJZFs.js → user-jyFU3lXk.js} +1 -1
  73. package/dist/{users-g2N0eL-Z.js → users-DZ-ilS6B.js} +1 -1
  74. package/dist/{warehouse-D3WWDeTX.js → warehouse-6m5kXMLu.js} +1 -1
  75. package/dist/{wrench-CmxY1n4I.js → wrench-CANXWxF-.js} +1 -1
  76. package/package.json +1 -1
  77. package/src/movethewheels/MoveTheWheelsRoutes.tsx +31 -3
  78. package/src/movethewheels/components/FormError.tsx +25 -0
  79. package/src/movethewheels/components/StatusBadge.tsx +18 -37
  80. package/src/movethewheels/constants/index.ts +67 -26
  81. package/src/movethewheels/hooks/index.ts +12 -0
  82. package/src/movethewheels/hooks/useAnalytics.ts +20 -6
  83. package/src/movethewheels/hooks/useAssistant.ts +74 -0
  84. package/src/movethewheels/hooks/useFleet.ts +170 -59
  85. package/src/movethewheels/hooks/useImportExport.ts +101 -0
  86. package/src/movethewheels/hooks/useInventory.ts +107 -0
  87. package/src/movethewheels/hooks/useReports.ts +158 -0
  88. package/src/movethewheels/hooks/useSettings.ts +120 -0
  89. package/src/movethewheels/pages/AIAssistantPage.tsx +53 -15
  90. package/src/movethewheels/pages/AnalyticsPage.tsx +67 -64
  91. package/src/movethewheels/pages/CustomerDetailsPage.tsx +154 -21
  92. package/src/movethewheels/pages/CustomersPage.tsx +1 -1
  93. package/src/movethewheels/pages/DashboardPage.tsx +42 -22
  94. package/src/movethewheels/pages/DriverDetailsPage.tsx +160 -3
  95. package/src/movethewheels/pages/DriversPage.tsx +6 -2
  96. package/src/movethewheels/pages/FleetPage.tsx +96 -38
  97. package/src/movethewheels/pages/ImportExportPage.tsx +174 -68
  98. package/src/movethewheels/pages/InventoryPage.tsx +66 -28
  99. package/src/movethewheels/pages/LiveTrackingPage.tsx +12 -3
  100. package/src/movethewheels/pages/MarketplacePage.tsx +87 -45
  101. package/src/movethewheels/pages/OrderDetailsPage.tsx +2 -2
  102. package/src/movethewheels/pages/ProductDetailsPage.tsx +146 -3
  103. package/src/movethewheels/pages/ProductsPage.tsx +5 -1
  104. package/src/movethewheels/pages/ReportsPage.tsx +194 -90
  105. package/src/movethewheels/pages/RouteDetailsPage.tsx +290 -36
  106. package/src/movethewheels/pages/RoutesPage.tsx +4 -9
  107. package/src/movethewheels/pages/SettingsPage.tsx +234 -56
  108. package/src/movethewheels/pages/TrackingPage.tsx +6 -6
  109. package/src/movethewheels/pages/VehicleDetailsPage.tsx +158 -2
  110. package/src/movethewheels/pages/VehiclesPage.tsx +5 -1
  111. package/src/movethewheels/pages/WarehouseDetailsPage.tsx +224 -2
  112. package/src/movethewheels/pages/WarehousesPage.tsx +5 -1
  113. package/src/movethewheels/providers/MoveTheWheelsProvider.tsx +7 -6
  114. package/src/movethewheels/store/movethewheelsStore.ts +1 -1
  115. package/dist/AnalyticsPage-CCLfHgQZ.js +0 -212
  116. package/dist/CustomerDetailsPage-I6cdDHUi.js +0 -265
  117. package/dist/DriverDetailsPage-rg_pGNuP.js +0 -330
  118. package/dist/FleetPage-DddXt8r8.js +0 -332
  119. package/dist/ImportExportPage-BW6qO3kc.js +0 -248
  120. package/dist/InventoryPage-rMGuaJN-.js +0 -222
  121. package/dist/MarketplacePage-DKrXAv62.js +0 -219
  122. package/dist/ProductDetailsPage-CFGcbaHo.js +0 -195
  123. package/dist/ReportsPage-Bb7_90rK.js +0 -235
  124. package/dist/RouteDetailsPage-CVtDVb1N.js +0 -282
  125. package/dist/RoutesPage-s57PtgcQ.js +0 -163
  126. package/dist/SettingsPage-BYNCBOpN.js +0 -298
  127. package/dist/StatusBadge-CijYQXtb.js +0 -209
  128. package/dist/VehicleDetailsPage-3YDMPsPs.js +0 -220
  129. package/dist/WarehouseDetailsPage-Db7KeN-d.js +0 -238
  130. package/dist/graphqlClient-CdJyR_ed.js +0 -55
  131. package/dist/navigation-BgnOfsVd.js +0 -6
  132. package/dist/route-Dp9JiN_E.js +0 -51
  133. package/dist/settings-3Rw5NwFF.js +0 -28
  134. package/src/movethewheels/constants/mockData.ts +0 -1342
  135. /package/dist/{formatters-_vJlC-47.js → formatters-CF2S2l1m.js} +0 -0
@@ -1,12 +1,12 @@
1
- import { A as e, N as t, d as n, f as r, g as i, h as a, i as o, it as s, l as c, u as l } from "./PageLayout-D3N8MCTm.js";
2
- import { n as u, t as d } from "./route-Dp9JiN_E.js";
3
- import { t as f } from "./circle-alert-DjmNo5_L.js";
4
- import { t as p } from "./trending-up-C-85AwGT.js";
5
- import { useState as m } from "react";
6
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
7
- import { GlassCard as _, PagePurpose as v } from "@burdenoff/fe-libs/ui";
1
+ import { A as e, N as t, d as n, f as r, g as i, h as a, i as o, l as s, lt as c, u as l } from "./PageLayout-D4LDHJJq.js";
2
+ import { n as u, r as d, t as f } from "./useAssistant-D4v3oxD3.js";
3
+ import { t as p } from "./circle-alert-iY24lSlp.js";
4
+ import { t as m } from "./trending-up-Dohgd4t_.js";
5
+ import { useState as h } from "react";
6
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
7
+ import { GlassCard as v, PagePurpose as y } from "@burdenoff/fe-libs/ui";
8
8
  //#region node_modules/lucide-react/dist/esm/icons/lightbulb.js
9
- var y = s("Lightbulb", [
9
+ var b = c("Lightbulb", [
10
10
  ["path", {
11
11
  d: "M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",
12
12
  key: "1gvzjb"
@@ -19,13 +19,13 @@ var y = s("Lightbulb", [
19
19
  d: "M10 22h4",
20
20
  key: "ceow96"
21
21
  }]
22
- ]), b = s("Send", [["path", {
22
+ ]), x = c("Send", [["path", {
23
23
  d: "M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",
24
24
  key: "1ffxy3"
25
25
  }], ["path", {
26
26
  d: "m21.854 2.147-10.94 10.939",
27
27
  key: "12cjpa"
28
- }]]), x = s("Sparkles", [
28
+ }]]), S = c("Sparkles", [
29
29
  ["path", {
30
30
  d: "M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",
31
31
  key: "4pj2yx"
@@ -49,128 +49,155 @@ var y = s("Lightbulb", [
49
49
  ]);
50
50
  //#endregion
51
51
  //#region src/movethewheels/pages/AIAssistantPage.tsx
52
- function S() {
53
- let [s, S] = m(""), [C, w] = m([{
52
+ function C() {
53
+ let { ask: c, isLoading: C } = f(), [w, T] = h(""), [E, D] = h([{
54
54
  role: "assistant",
55
- content: "Hello! I'm your logistics AI assistant. I can help you with route optimization, demand forecasting, fleet management insights, and more. How can I help you today?"
56
- }]), T = [
55
+ content: "Hello! I'm your logistics assistant. Ask me about your orders, deliveries, fleet or inventory and I'll answer from your live operational data."
56
+ }]), O = [
57
57
  {
58
- icon: d,
58
+ icon: u,
59
59
  text: "Optimize today's delivery routes",
60
60
  category: "Route Planning"
61
61
  },
62
62
  {
63
- icon: p,
63
+ icon: m,
64
64
  text: "Show demand forecast for next week",
65
65
  category: "Analytics"
66
66
  },
67
67
  {
68
- icon: f,
68
+ icon: p,
69
69
  text: "Identify potential delivery delays",
70
70
  category: "Alerts"
71
71
  },
72
72
  {
73
- icon: y,
73
+ icon: b,
74
74
  text: "Suggest fleet efficiency improvements",
75
75
  category: "Insights"
76
76
  }
77
- ], E = [
77
+ ], k = [
78
78
  "Route Optimization - Find the most efficient delivery routes",
79
79
  "Demand Forecasting - Predict order volumes and trends",
80
80
  "Fleet Analysis - Insights on vehicle and driver performance",
81
81
  "Cost Optimization - Identify ways to reduce operational costs",
82
82
  "Natural Language Queries - Ask questions in plain English"
83
- ], D = () => {
84
- s.trim() && (w([
85
- ...C,
86
- {
83
+ ], A = async (e) => {
84
+ let t = e.trim();
85
+ if (!(!t || C)) {
86
+ T(""), D((e) => [...e, {
87
87
  role: "user",
88
- content: s
89
- },
90
- {
91
- role: "assistant",
92
- content: `I understand you're asking about "${s}". Let me analyze that for you...\n\nBased on your current data, here are my findings:\n\n1. Your fleet utilization is currently at 78%, which is within the optimal range.\n2. There are 5 pending orders that could benefit from route consolidation.\n3. Estimated fuel savings from optimization: $120/day.\n\nWould you like me to generate a detailed report or take any action?`
88
+ content: t
89
+ }]);
90
+ try {
91
+ let e = await c(t);
92
+ D((t) => [...t, {
93
+ role: "assistant",
94
+ content: e.answer
95
+ }]);
96
+ } catch (e) {
97
+ D((t) => [...t, {
98
+ role: "assistant",
99
+ content: e instanceof Error ? `Sorry, I couldn't answer that: ${e.message}` : "Sorry, I couldn't reach the assistant. Please try again.",
100
+ isError: !0
101
+ }]);
93
102
  }
94
- ]), S(""));
103
+ }
104
+ }, j = () => {
105
+ A(w);
95
106
  };
96
- return /* @__PURE__ */ g(o, {
107
+ return /* @__PURE__ */ _(o, {
97
108
  title: "AI Assistant",
98
109
  subtitle: "Intelligent logistics support",
99
- icon: /* @__PURE__ */ h(u, { size: 24 }),
100
- children: [/* @__PURE__ */ h(v, {
101
- icon: /* @__PURE__ */ h(u, { size: 18 }),
110
+ icon: /* @__PURE__ */ g(d, { size: 24 }),
111
+ children: [/* @__PURE__ */ g(y, {
112
+ icon: /* @__PURE__ */ g(d, { size: 18 }),
102
113
  children: "Ask plain-English questions about your operation and get answers backed by your own data. Use it to optimize routes, forecast demand, spot likely delays, and run what-if scenarios (e.g. “what if I add two vehicles?”) — like having a logistics analyst on call."
103
- }), /* @__PURE__ */ g("div", {
114
+ }), /* @__PURE__ */ _("div", {
104
115
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
105
- children: [/* @__PURE__ */ h("div", {
116
+ children: [/* @__PURE__ */ g("div", {
106
117
  className: "lg:col-span-2 space-y-4",
107
- children: /* @__PURE__ */ g(_, {
118
+ children: /* @__PURE__ */ _(v, {
108
119
  treatment: "glass",
109
120
  glow: !0,
110
121
  className: "h-[600px] flex flex-col",
111
122
  children: [
112
- /* @__PURE__ */ h(a, {
123
+ /* @__PURE__ */ g(a, {
113
124
  className: "border-b border-border-seam",
114
- children: /* @__PURE__ */ g(i, {
125
+ children: /* @__PURE__ */ _(i, {
115
126
  className: "flex items-center gap-2",
116
- children: [/* @__PURE__ */ h(x, {
127
+ children: [/* @__PURE__ */ g(S, {
117
128
  size: 18,
118
129
  className: "text-primary"
119
130
  }), " Chat with AI"]
120
131
  })
121
132
  }),
122
- /* @__PURE__ */ h(t, {
133
+ /* @__PURE__ */ g(t, {
123
134
  className: "flex-1 p-4",
124
- children: /* @__PURE__ */ h("div", {
135
+ children: /* @__PURE__ */ _("div", {
125
136
  className: "space-y-4",
126
- children: C.map((e, t) => /* @__PURE__ */ h("div", {
137
+ children: [E.map((e, t) => /* @__PURE__ */ g("div", {
127
138
  className: `flex ${e.role === "user" ? "justify-end" : "justify-start"}`,
128
- children: /* @__PURE__ */ h("div", {
129
- className: `max-w-[80%] p-3 rounded-lg ${e.role === "user" ? "bg-action-primary-bg text-action-primary-text" : "bg-bg-sunken"}`,
130
- children: /* @__PURE__ */ h("p", {
139
+ children: /* @__PURE__ */ g("div", {
140
+ className: `max-w-[80%] p-3 rounded-lg ${e.role === "user" ? "bg-action-primary-bg text-action-primary-text" : e.isError ? "bg-status-error-bg-subtle text-status-error-text" : "bg-bg-sunken"}`,
141
+ children: /* @__PURE__ */ g("p", {
131
142
  className: "whitespace-pre-line text-sm",
132
143
  children: e.content
133
144
  })
134
145
  })
135
- }, t))
146
+ }, t)), C && /* @__PURE__ */ g("div", {
147
+ className: "flex justify-start",
148
+ "aria-live": "polite",
149
+ children: /* @__PURE__ */ _("div", {
150
+ className: "max-w-[80%] p-3 rounded-lg bg-bg-sunken flex items-center gap-2",
151
+ children: [/* @__PURE__ */ g(S, {
152
+ size: 14,
153
+ className: "text-primary motion-safe:animate-pulse"
154
+ }), /* @__PURE__ */ g("span", {
155
+ className: "text-sm text-text-secondary",
156
+ children: "Analyzing your data…"
157
+ })]
158
+ })
159
+ })]
136
160
  })
137
161
  }),
138
- /* @__PURE__ */ h("div", {
162
+ /* @__PURE__ */ g("div", {
139
163
  className: "p-4 border-t",
140
- children: /* @__PURE__ */ g("div", {
164
+ children: /* @__PURE__ */ _("div", {
141
165
  className: "flex gap-2",
142
- children: [/* @__PURE__ */ h(e, {
143
- value: s,
144
- onChange: (e) => S(e.target.value),
166
+ children: [/* @__PURE__ */ g(e, {
167
+ value: w,
168
+ onChange: (e) => T(e.target.value),
145
169
  placeholder: "Ask me anything about your logistics operations...",
146
- onKeyPress: (e) => e.key === "Enter" && D()
147
- }), /* @__PURE__ */ h(l, {
148
- onClick: D,
149
- children: /* @__PURE__ */ h(b, { size: 16 })
170
+ disabled: C,
171
+ onKeyPress: (e) => e.key === "Enter" && j()
172
+ }), /* @__PURE__ */ g(l, {
173
+ onClick: j,
174
+ disabled: C || !w.trim(),
175
+ children: /* @__PURE__ */ g(x, { size: 16 })
150
176
  })]
151
177
  })
152
178
  })
153
179
  ]
154
180
  })
155
- }), /* @__PURE__ */ g("div", {
181
+ }), /* @__PURE__ */ _("div", {
156
182
  className: "space-y-6",
157
183
  children: [
158
- /* @__PURE__ */ g(n, { children: [/* @__PURE__ */ h(a, { children: /* @__PURE__ */ h(i, { children: "Quick Actions" }) }), /* @__PURE__ */ h(r, {
184
+ /* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(a, { children: /* @__PURE__ */ g(i, { children: "Quick Actions" }) }), /* @__PURE__ */ g(r, {
159
185
  className: "space-y-2",
160
- children: T.map((e, t) => /* @__PURE__ */ g(l, {
186
+ children: O.map((e, t) => /* @__PURE__ */ _(l, {
161
187
  variant: "outline",
162
188
  className: "w-full justify-start text-left h-auto py-3",
163
- onClick: () => S(e.text),
189
+ disabled: C,
190
+ onClick: () => void A(e.text),
164
191
  children: [
165
- /* @__PURE__ */ h(e.icon, {
192
+ /* @__PURE__ */ g(e.icon, {
166
193
  size: 16,
167
194
  className: "mr-2 flex-shrink-0"
168
195
  }),
169
- /* @__PURE__ */ h("span", {
196
+ /* @__PURE__ */ g("span", {
170
197
  className: "flex-1",
171
198
  children: e.text
172
199
  }),
173
- /* @__PURE__ */ h(c, {
200
+ /* @__PURE__ */ g(s, {
174
201
  variant: "secondary",
175
202
  className: "text-xs",
176
203
  children: e.category
@@ -178,29 +205,29 @@ function S() {
178
205
  ]
179
206
  }, t))
180
207
  })] }),
181
- /* @__PURE__ */ g(n, { children: [/* @__PURE__ */ h(a, { children: /* @__PURE__ */ h(i, { children: "Capabilities" }) }), /* @__PURE__ */ h(r, { children: /* @__PURE__ */ h("ul", {
208
+ /* @__PURE__ */ _(n, { children: [/* @__PURE__ */ g(a, { children: /* @__PURE__ */ g(i, { children: "Capabilities" }) }), /* @__PURE__ */ g(r, { children: /* @__PURE__ */ g("ul", {
182
209
  className: "space-y-2 text-sm",
183
- children: E.map((e, t) => /* @__PURE__ */ g("li", {
210
+ children: k.map((e, t) => /* @__PURE__ */ _("li", {
184
211
  className: "flex items-start gap-2",
185
- children: [/* @__PURE__ */ h(x, {
212
+ children: [/* @__PURE__ */ g(S, {
186
213
  size: 14,
187
214
  className: "text-primary mt-0.5 flex-shrink-0"
188
- }), /* @__PURE__ */ h("span", { children: e })]
215
+ }), /* @__PURE__ */ g("span", { children: e })]
189
216
  }, t))
190
217
  }) })] }),
191
- /* @__PURE__ */ h(n, {
218
+ /* @__PURE__ */ g(n, {
192
219
  className: "bg-action-primary-bg/5 border-primary/20",
193
- children: /* @__PURE__ */ h(r, {
220
+ children: /* @__PURE__ */ g(r, {
194
221
  className: "p-4",
195
- children: /* @__PURE__ */ g("div", {
222
+ children: /* @__PURE__ */ _("div", {
196
223
  className: "flex items-start gap-3",
197
- children: [/* @__PURE__ */ h(y, {
224
+ children: [/* @__PURE__ */ g(b, {
198
225
  size: 20,
199
226
  className: "text-primary flex-shrink-0"
200
- }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("p", {
227
+ }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
201
228
  className: "font-medium text-sm",
202
229
  children: "Pro Tip"
203
- }), /* @__PURE__ */ h("p", {
230
+ }), /* @__PURE__ */ g("p", {
204
231
  className: "text-xs text-text-secondary",
205
232
  children: "You can ask complex questions like \"What would happen if I added 2 more vehicles to my fleet?\" for scenario analysis."
206
233
  })] })]
@@ -213,4 +240,4 @@ function S() {
213
240
  });
214
241
  }
215
242
  //#endregion
216
- export { S as default };
243
+ export { C as default };
@@ -0,0 +1,215 @@
1
+ import { M as e, d as t, f as n, g as r, h as i, i as a, u as o } from "./PageLayout-D4LDHJJq.js";
2
+ import { t as s } from "./chart-column-BFIJysDR.js";
3
+ import { t as c } from "./dollar-sign-CgKQRz_e.js";
4
+ import { t as l } from "./package-BChUzpJS.js";
5
+ import { t as u } from "./trending-up-Dohgd4t_.js";
6
+ import { t as d } from "./truck-C0v_hbLR.js";
7
+ import { t as f } from "./users-DZ-ilS6B.js";
8
+ import { i as p, r as m, t as h } from "./useAnalytics-DS8n0xgg.js";
9
+ import { n as g, r as _, t as v } from "./MetricCard-BY0QrMD4.js";
10
+ import { n as y } from "./formatters-CF2S2l1m.js";
11
+ import { jsx as b, jsxs as x } from "react/jsx-runtime";
12
+ import { EmphasisPanel as S, PagePurpose as C } from "@burdenoff/fe-libs/ui";
13
+ //#region src/movethewheels/pages/AnalyticsPage.tsx
14
+ function w() {
15
+ let { analytics: w, isLoading: T, error: E, refetch: D } = h(), { orderData: O } = p(), { fleetData: k } = m();
16
+ return /* @__PURE__ */ x(a, {
17
+ title: "Analytics",
18
+ subtitle: "Business performance and insights",
19
+ icon: /* @__PURE__ */ b(s, { size: 24 }),
20
+ children: [
21
+ /* @__PURE__ */ b(C, {
22
+ icon: /* @__PURE__ */ b(s, { size: 18 }),
23
+ children: "See how the operation is really performing. Track order volume, revenue, on-time rate and customer satisfaction over time so you can spot trends, find bottlenecks, and decide where to invest — whether that's more vehicles, better routes, or new customers."
24
+ }),
25
+ E && !T ? /* @__PURE__ */ b(t, {
26
+ className: "border-status-error-border",
27
+ children: /* @__PURE__ */ x(n, {
28
+ className: "p-6 text-center space-y-3",
29
+ children: [
30
+ /* @__PURE__ */ b("p", {
31
+ className: "text-status-error-text font-medium",
32
+ children: "Couldn't load analytics"
33
+ }),
34
+ /* @__PURE__ */ b("p", {
35
+ className: "text-sm text-text-secondary",
36
+ children: E.message
37
+ }),
38
+ /* @__PURE__ */ b(o, {
39
+ variant: "outline",
40
+ onClick: D,
41
+ children: "Retry"
42
+ })
43
+ ]
44
+ })
45
+ }) : T ? /* @__PURE__ */ b(_, {
46
+ columns: 5,
47
+ children: Array.from({ length: 5 }).map((e, t) => /* @__PURE__ */ b(g, {}, t))
48
+ }) : /* @__PURE__ */ x(_, {
49
+ columns: 5,
50
+ children: [
51
+ /* @__PURE__ */ b(v, {
52
+ label: "Total Orders",
53
+ value: w.overview.totalOrders.toLocaleString(),
54
+ icon: /* @__PURE__ */ b(l, { size: 20 })
55
+ }),
56
+ /* @__PURE__ */ b(v, {
57
+ treatment: "glass",
58
+ glow: !0,
59
+ label: "Revenue",
60
+ value: y(w.overview.totalRevenue),
61
+ icon: /* @__PURE__ */ b(c, { size: 20 })
62
+ }),
63
+ /* @__PURE__ */ b(v, {
64
+ label: "Active Vehicles",
65
+ value: w.overview.activeVehicles,
66
+ icon: /* @__PURE__ */ b(d, { size: 20 })
67
+ }),
68
+ /* @__PURE__ */ b(v, {
69
+ label: "On-Time Rate",
70
+ value: `${w.overview.onTimeDeliveryRate.toFixed(1)}%`,
71
+ icon: /* @__PURE__ */ b(u, { size: 20 }),
72
+ changeType: w.overview.onTimeDeliveryRate >= 90 ? "positive" : "neutral"
73
+ }),
74
+ /* @__PURE__ */ b(v, {
75
+ label: "Satisfaction",
76
+ value: w.overview.customerSatisfaction.toFixed(1),
77
+ icon: /* @__PURE__ */ b(f, { size: 20 }),
78
+ subtitle: "out of 5"
79
+ })
80
+ ]
81
+ }),
82
+ /* @__PURE__ */ x("div", {
83
+ className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
84
+ children: [/* @__PURE__ */ x(t, { children: [/* @__PURE__ */ b(i, { children: /* @__PURE__ */ b(r, { children: "Order Trends" }) }), /* @__PURE__ */ x(n, { children: [/* @__PURE__ */ b("div", {
85
+ className: "h-64 flex items-center justify-center bg-bg-sunken/50 rounded-lg",
86
+ children: /* @__PURE__ */ x("div", {
87
+ className: "text-center text-text-secondary",
88
+ children: [
89
+ /* @__PURE__ */ b(s, {
90
+ size: 48,
91
+ className: "mx-auto mb-2 opacity-50"
92
+ }),
93
+ /* @__PURE__ */ b("p", { children: "Order trend chart" }),
94
+ /* @__PURE__ */ b("p", {
95
+ className: "text-xs",
96
+ children: "(Chart library integration needed)"
97
+ })
98
+ ]
99
+ })
100
+ }), /* @__PURE__ */ b("div", {
101
+ className: "mt-4 grid grid-cols-4 gap-2",
102
+ children: O.trends.slice(-4).map((e) => /* @__PURE__ */ x("div", {
103
+ className: "text-center p-2 bg-bg-sunken/50 rounded",
104
+ children: [/* @__PURE__ */ b("p", {
105
+ className: "text-xs text-text-secondary",
106
+ children: e.date.split("-").slice(1).join("/")
107
+ }), /* @__PURE__ */ b("p", {
108
+ className: "font-medium",
109
+ children: e.orders
110
+ })]
111
+ }, e.date))
112
+ })] })] }), /* @__PURE__ */ x(t, { children: [/* @__PURE__ */ b(i, { children: /* @__PURE__ */ b(r, { children: "Revenue Trends" }) }), /* @__PURE__ */ x(n, { children: [/* @__PURE__ */ b("div", {
113
+ className: "h-64 flex items-center justify-center bg-bg-sunken/50 rounded-lg",
114
+ children: /* @__PURE__ */ x("div", {
115
+ className: "text-center text-text-secondary",
116
+ children: [/* @__PURE__ */ b(u, {
117
+ size: 48,
118
+ className: "mx-auto mb-2 opacity-50"
119
+ }), /* @__PURE__ */ b("p", { children: "Revenue trend chart" })]
120
+ })
121
+ }), /* @__PURE__ */ b("div", {
122
+ className: "mt-4 grid grid-cols-5 gap-2",
123
+ children: w.trends.revenue.map((e) => /* @__PURE__ */ x("div", {
124
+ className: "text-center p-2 bg-bg-sunken/50 rounded",
125
+ children: [/* @__PURE__ */ b("p", {
126
+ className: "text-xs text-text-secondary",
127
+ children: e.month
128
+ }), /* @__PURE__ */ x("p", {
129
+ className: "font-medium text-sm",
130
+ children: [y(e.revenue / 1e3), "k"]
131
+ })]
132
+ }, e.month))
133
+ })] })] })]
134
+ }),
135
+ /* @__PURE__ */ x("div", {
136
+ className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
137
+ children: [
138
+ /* @__PURE__ */ x(t, { children: [/* @__PURE__ */ b(i, { children: /* @__PURE__ */ b(r, { children: "Orders by Status" }) }), /* @__PURE__ */ b(n, {
139
+ className: "space-y-3",
140
+ children: O.byStatus.filter((e) => e.count > 0).map(({ status: t, count: n }) => /* @__PURE__ */ x("div", {
141
+ className: "flex items-center justify-between",
142
+ children: [/* @__PURE__ */ b("span", {
143
+ className: "text-sm capitalize",
144
+ children: t.replace("_", " ")
145
+ }), /* @__PURE__ */ x("div", {
146
+ className: "flex items-center gap-2",
147
+ children: [/* @__PURE__ */ b(e, {
148
+ value: n / w.overview.totalOrders * 100,
149
+ className: "w-20 h-2"
150
+ }), /* @__PURE__ */ b("span", {
151
+ className: "font-medium w-8 text-right",
152
+ children: n
153
+ })]
154
+ })]
155
+ }, t))
156
+ })] }),
157
+ /* @__PURE__ */ x(t, { children: [/* @__PURE__ */ b(i, { children: /* @__PURE__ */ b(r, { children: "Fleet Performance" }) }), /* @__PURE__ */ x(n, {
158
+ className: "space-y-4",
159
+ children: [/* @__PURE__ */ x("div", { children: [/* @__PURE__ */ x("div", {
160
+ className: "flex justify-between text-sm mb-1",
161
+ children: [/* @__PURE__ */ b("span", { children: "Vehicle Utilization" }), /* @__PURE__ */ x("span", { children: [k.vehicleUtilization.toFixed(0), "%"] })]
162
+ }), /* @__PURE__ */ b(e, { value: k.vehicleUtilization })] }), k.vehiclesByType.length > 0 && /* @__PURE__ */ x("div", {
163
+ className: "pt-2",
164
+ children: [/* @__PURE__ */ b("p", {
165
+ className: "text-sm text-text-secondary mb-2",
166
+ children: "Vehicles by Type"
167
+ }), k.vehiclesByType.map(({ type: e, count: t }) => /* @__PURE__ */ x("div", {
168
+ className: "flex justify-between text-sm py-1",
169
+ children: [/* @__PURE__ */ b("span", {
170
+ className: "capitalize",
171
+ children: e
172
+ }), /* @__PURE__ */ b("span", {
173
+ className: "font-medium",
174
+ children: t
175
+ })]
176
+ }, e))]
177
+ })]
178
+ })] }),
179
+ /* @__PURE__ */ x(S, {
180
+ className: "space-y-4",
181
+ children: [
182
+ /* @__PURE__ */ b("h2", {
183
+ className: "text-base font-semibold text-text-primary",
184
+ children: "Performance Metrics"
185
+ }),
186
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
187
+ className: "text-sm text-text-secondary",
188
+ children: "On-Time Delivery"
189
+ }), /* @__PURE__ */ x("p", {
190
+ className: "text-2xl font-bold",
191
+ children: [w.performance.onTimeDelivery.toFixed(1), "%"]
192
+ })] }),
193
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
194
+ className: "text-sm text-text-secondary",
195
+ children: "Customer Satisfaction"
196
+ }), /* @__PURE__ */ x("p", {
197
+ className: "text-2xl font-bold",
198
+ children: [w.overview.customerSatisfaction.toFixed(1), "/5"]
199
+ })] }),
200
+ /* @__PURE__ */ x("div", { children: [/* @__PURE__ */ b("p", {
201
+ className: "text-sm text-text-secondary",
202
+ children: "Driver Ratings"
203
+ }), /* @__PURE__ */ x("p", {
204
+ className: "text-2xl font-bold",
205
+ children: [w.performance.driverRatings.toFixed(1), "/5"]
206
+ })] })
207
+ ]
208
+ })
209
+ ]
210
+ })
211
+ ]
212
+ });
213
+ }
214
+ //#endregion
215
+ export { w as default };