@burdenoff/microfe-movethewheels 2026.805.1 → 2026.827.1
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.
- package/dist/components/CarbonFootprintPanel.js +108 -0
- package/dist/components/index.js +1 -0
- package/dist/generated/wspace-operations.d.ts +168 -912
- package/dist/generated/wspace-types.d.ts +78432 -35831
- package/dist/hooks/useAnalytics.js +45 -4
- package/dist/hooks/useFleet.js +142 -74
- package/dist/hooks/useInventory.js +163 -70
- package/dist/hooks/useOrders.js +2 -2
- package/dist/hooks/useTracking.js +5 -5
- package/dist/index.js +33 -32
- package/dist/movethewheels/components/CarbonFootprintPanel.d.ts +7 -0
- package/dist/movethewheels/components/index.d.ts +1 -0
- package/dist/movethewheels/hooks/index.d.ts +3 -3
- package/dist/movethewheels/hooks/useAnalytics.d.ts +22 -0
- package/dist/movethewheels/hooks/useFleet.d.ts +32 -1
- package/dist/movethewheels/hooks/useInventory.d.ts +67 -12
- package/dist/movethewheels/hooks/useOrders.d.ts +25 -2
- package/dist/movethewheels/types/index.d.ts +2 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-down-right.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-left-right.js +22 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/arrow-up-right.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/calendar-clock.js +32 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/history.js +18 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/leaf.js +11 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/lock.js +16 -0
- package/dist/node_modules/lucide-react/dist/esm/icons/user-round.js +13 -0
- package/dist/pages/AnalyticsPage.js +81 -79
- package/dist/pages/CreateOrderPage.js +246 -195
- package/dist/pages/DeliveryCapturePage.js +91 -78
- package/dist/pages/DriversPage.js +202 -108
- package/dist/pages/InventoryPage.js +356 -131
- package/dist/pages/ProductDetailsPage.js +212 -156
- package/dist/pages/VehicleDetailsPage.js +257 -193
- package/dist/utils/formatters.js +4 -1
- package/package.json +1 -1
- package/src/generated/wspace-operations.ts +134 -929
- package/src/generated/wspace-types.ts +91730 -40059
- package/src/movethewheels/components/CarbonFootprintPanel.tsx +133 -0
- package/src/movethewheels/components/UpcomingDemandPanel.tsx +20 -11
- package/src/movethewheels/components/index.ts +3 -0
- package/src/movethewheels/hooks/index.ts +11 -0
- package/src/movethewheels/hooks/useAnalytics.ts +86 -0
- package/src/movethewheels/hooks/useDemandForecast.ts +10 -4
- package/src/movethewheels/hooks/useFleet.ts +133 -3
- package/src/movethewheels/hooks/useInventory.ts +311 -53
- package/src/movethewheels/hooks/useOrders.ts +31 -7
- package/src/movethewheels/hooks/useTracking.ts +14 -14
- package/src/movethewheels/pages/AnalyticsPage.tsx +5 -5
- package/src/movethewheels/pages/CreateOrderPage.tsx +67 -10
- package/src/movethewheels/pages/DeliveryCapturePage.tsx +8 -0
- package/src/movethewheels/pages/DriversPage.tsx +181 -31
- package/src/movethewheels/pages/InventoryPage.tsx +299 -19
- package/src/movethewheels/pages/ProductDetailsPage.tsx +68 -3
- package/src/movethewheels/pages/VehicleDetailsPage.tsx +86 -27
- package/src/movethewheels/types/index.ts +2 -0
- package/src/operations/wspace/movethewheels/fragments/core.graphql +23 -53
- package/src/operations/wspace/movethewheels/fragments/core.withdrawn.graphql +59 -0
- package/src/operations/wspace/movethewheels/mutations/entities.graphql +5 -5
- package/src/operations/wspace/movethewheels/mutations/marketplace-reports.graphql +18 -78
- package/src/operations/wspace/movethewheels/mutations/marketplace-reports.withdrawn.graphql +93 -0
- package/src/operations/wspace/movethewheels/mutations/orders.graphql +7 -7
- package/src/operations/wspace/movethewheels/queries/dashboard.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/entities.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/logistics.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/marketplace-reports.withdrawn.graphql +58 -0
- package/src/operations/wspace/movethewheels/queries/orders.graphql +3 -3
- package/src/operations/wspace/movethewheels/queries/marketplace-reports.graphql +0 -40
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { Leaf as e } from "../node_modules/lucide-react/dist/esm/icons/leaf.js";
|
|
2
|
+
import { Truck as t } from "../node_modules/lucide-react/dist/esm/icons/truck.js";
|
|
3
|
+
import { useEmissionsSummary as n } from "../hooks/useAnalytics.js";
|
|
4
|
+
import { Card as r, CardContent as i, CardHeader as a, CardTitle as o } from "./ui.js";
|
|
5
|
+
import { MetricCard as s, MetricGrid as c } from "./MetricCard.js";
|
|
6
|
+
import { jsx as l, jsxs as u } from "react/jsx-runtime";
|
|
7
|
+
//#region src/movethewheels/components/CarbonFootprintPanel.tsx
|
|
8
|
+
function d(e) {
|
|
9
|
+
return e >= 1e3 ? `${(e / 1e3).toFixed(2)} t` : `${e.toFixed(1)} kg`;
|
|
10
|
+
}
|
|
11
|
+
function f(e) {
|
|
12
|
+
return e >= 1e3 ? `${(e / 1e3).toFixed(1)}k km` : `${e.toFixed(1)} km`;
|
|
13
|
+
}
|
|
14
|
+
function p() {
|
|
15
|
+
let { summary: p, isLoading: m, error: h } = n();
|
|
16
|
+
if (h) return /* @__PURE__ */ l(r, {
|
|
17
|
+
className: "border-status-error-border",
|
|
18
|
+
children: /* @__PURE__ */ l(i, {
|
|
19
|
+
className: "p-6 text-center",
|
|
20
|
+
children: /* @__PURE__ */ l("p", {
|
|
21
|
+
className: "text-sm text-status-error-text",
|
|
22
|
+
children: "Couldn't load emissions data"
|
|
23
|
+
})
|
|
24
|
+
})
|
|
25
|
+
});
|
|
26
|
+
if (m) return /* @__PURE__ */ u(r, { children: [/* @__PURE__ */ l(a, { children: /* @__PURE__ */ u(o, {
|
|
27
|
+
className: "flex items-center gap-2",
|
|
28
|
+
children: [/* @__PURE__ */ l(e, {
|
|
29
|
+
size: 18,
|
|
30
|
+
className: "text-status-success-text"
|
|
31
|
+
}), "Carbon footprint"]
|
|
32
|
+
}) }), /* @__PURE__ */ l(i, { children: /* @__PURE__ */ l(c, {
|
|
33
|
+
columns: 3,
|
|
34
|
+
children: Array.from({ length: 3 }).map((e, t) => /* @__PURE__ */ l("div", { className: "h-24 rounded-xl bg-bg-sunken motion-safe:animate-pulse" }, t))
|
|
35
|
+
}) })] });
|
|
36
|
+
let g = p.totalDistanceKm > 0;
|
|
37
|
+
return /* @__PURE__ */ u(r, { children: [/* @__PURE__ */ l(a, { children: /* @__PURE__ */ u(o, {
|
|
38
|
+
className: "flex items-center gap-2",
|
|
39
|
+
children: [/* @__PURE__ */ l(e, {
|
|
40
|
+
size: 18,
|
|
41
|
+
className: "text-status-success-text"
|
|
42
|
+
}), "Carbon footprint"]
|
|
43
|
+
}) }), /* @__PURE__ */ u(i, {
|
|
44
|
+
className: "space-y-6",
|
|
45
|
+
children: [
|
|
46
|
+
/* @__PURE__ */ u(c, {
|
|
47
|
+
columns: 3,
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ l(s, {
|
|
50
|
+
label: "Total CO2e",
|
|
51
|
+
value: d(p.totalCo2eKg),
|
|
52
|
+
icon: /* @__PURE__ */ l(e, { size: 20 }),
|
|
53
|
+
accent: "success"
|
|
54
|
+
}),
|
|
55
|
+
/* @__PURE__ */ l(s, {
|
|
56
|
+
label: "Total distance",
|
|
57
|
+
value: f(p.totalDistanceKm),
|
|
58
|
+
icon: /* @__PURE__ */ l(t, { size: 20 }),
|
|
59
|
+
accent: "blue"
|
|
60
|
+
}),
|
|
61
|
+
/* @__PURE__ */ l(s, {
|
|
62
|
+
label: "Avg intensity",
|
|
63
|
+
value: `${(p.averageCo2eKgPerKm * 1e3).toFixed(1)} g/km`,
|
|
64
|
+
icon: /* @__PURE__ */ l(e, { size: 20 }),
|
|
65
|
+
accent: "warning"
|
|
66
|
+
})
|
|
67
|
+
]
|
|
68
|
+
}),
|
|
69
|
+
g && p.byVehicle.length > 0 && /* @__PURE__ */ u("div", {
|
|
70
|
+
className: "space-y-3",
|
|
71
|
+
children: [/* @__PURE__ */ l("h4", {
|
|
72
|
+
className: "text-sm font-medium text-text-secondary",
|
|
73
|
+
children: "By vehicle"
|
|
74
|
+
}), /* @__PURE__ */ l("div", {
|
|
75
|
+
className: "space-y-2",
|
|
76
|
+
children: p.byVehicle.filter((e) => e.totalDistanceKm > 0 || e.co2eKg > 0).slice(0, 5).map((e) => /* @__PURE__ */ u("div", {
|
|
77
|
+
className: "flex items-center justify-between rounded-lg bg-bg-sunken px-3 py-2",
|
|
78
|
+
children: [/* @__PURE__ */ u("div", {
|
|
79
|
+
className: "flex items-center gap-2",
|
|
80
|
+
children: [/* @__PURE__ */ l(t, {
|
|
81
|
+
size: 16,
|
|
82
|
+
className: "text-text-secondary"
|
|
83
|
+
}), /* @__PURE__ */ l("span", {
|
|
84
|
+
className: "text-sm font-medium text-text-primary",
|
|
85
|
+
children: e.vehicleNumber ?? "Unassigned"
|
|
86
|
+
})]
|
|
87
|
+
}), /* @__PURE__ */ u("div", {
|
|
88
|
+
className: "text-right",
|
|
89
|
+
children: [/* @__PURE__ */ l("p", {
|
|
90
|
+
className: "text-sm font-medium text-text-primary",
|
|
91
|
+
children: d(e.co2eKg)
|
|
92
|
+
}), /* @__PURE__ */ l("p", {
|
|
93
|
+
className: "text-xs text-text-secondary",
|
|
94
|
+
children: f(e.totalDistanceKm)
|
|
95
|
+
})]
|
|
96
|
+
})]
|
|
97
|
+
}, e.vehicleId ?? "unassigned"))
|
|
98
|
+
})]
|
|
99
|
+
}),
|
|
100
|
+
!g && /* @__PURE__ */ l("p", {
|
|
101
|
+
className: "text-sm text-text-secondary",
|
|
102
|
+
children: "No route distance recorded yet. Assign vehicles and distances to routes to see emissions estimates."
|
|
103
|
+
})
|
|
104
|
+
]
|
|
105
|
+
})] });
|
|
106
|
+
}
|
|
107
|
+
//#endregion
|
|
108
|
+
export { p as CarbonFootprintPanel };
|
package/dist/components/index.js
CHANGED