@burdenoff/microfe-theglobalfuel 2026.704.1 → 2026.705.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 (133) hide show
  1. package/dist/node_modules/{.bun/clsx@2.1.1/node_modules/clsx → clsx}/dist/clsx.js +1 -1
  2. package/dist/node_modules/clsx/dist/clsx.js.map +1 -0
  3. package/dist/node_modules/{.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge → tailwind-merge}/dist/bundle-mjs.js +212 -170
  4. package/dist/node_modules/tailwind-merge/dist/bundle-mjs.js.map +1 -0
  5. package/dist/theglobalfuel/components/DataTable.js +37 -27
  6. package/dist/theglobalfuel/components/DataTable.js.map +1 -1
  7. package/dist/theglobalfuel/hooks/index.js +1 -0
  8. package/dist/theglobalfuel/hooks/useNotify.js +19 -0
  9. package/dist/theglobalfuel/hooks/useNotify.js.map +1 -0
  10. package/dist/theglobalfuel/hooks/useTheFiles.js +4 -1
  11. package/dist/theglobalfuel/hooks/useTheFiles.js.map +1 -1
  12. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js +59 -31
  13. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.js.map +1 -1
  14. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js +367 -321
  15. package/dist/theglobalfuel/pages/assets/AssetDetailPage.js.map +1 -1
  16. package/dist/theglobalfuel/pages/assets/AssetsPage.js +66 -54
  17. package/dist/theglobalfuel/pages/assets/AssetsPage.js.map +1 -1
  18. package/dist/theglobalfuel/pages/compliance/CompliancePage.js +346 -182
  19. package/dist/theglobalfuel/pages/compliance/CompliancePage.js.map +1 -1
  20. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js +418 -390
  21. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.js.map +1 -1
  22. package/dist/theglobalfuel/pages/contracts/ContractsPage.js +238 -230
  23. package/dist/theglobalfuel/pages/contracts/ContractsPage.js.map +1 -1
  24. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js +5 -3
  25. package/dist/theglobalfuel/pages/dashboard/DashboardPage.js.map +1 -1
  26. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js +201 -177
  27. package/dist/theglobalfuel/pages/emissions/EmissionsPage.js.map +1 -1
  28. package/dist/theglobalfuel/pages/inventory/InventoryPage.js +271 -238
  29. package/dist/theglobalfuel/pages/inventory/InventoryPage.js.map +1 -1
  30. package/dist/theglobalfuel/pages/production/ProductionPage.js +185 -177
  31. package/dist/theglobalfuel/pages/production/ProductionPage.js.map +1 -1
  32. package/dist/theglobalfuel/pages/reserves/ReservesPage.js +160 -138
  33. package/dist/theglobalfuel/pages/reserves/ReservesPage.js.map +1 -1
  34. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js +250 -198
  35. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.js.map +1 -1
  36. package/dist/theglobalfuel/utils/cn.js +2 -2
  37. package/dist/theglobalfuel/utils/formatters.js +6 -1
  38. package/dist/theglobalfuel/utils/formatters.js.map +1 -1
  39. package/dist/theglobalfuel/utils/transitions.js +70 -0
  40. package/dist/theglobalfuel/utils/transitions.js.map +1 -0
  41. package/package.json +1 -1
  42. package/dist/dev/main.d.ts +0 -2
  43. package/dist/dev/main.d.ts.map +0 -1
  44. package/dist/index.d.ts +0 -2
  45. package/dist/index.d.ts.map +0 -1
  46. package/dist/node_modules/.bun/clsx@2.1.1/node_modules/clsx/dist/clsx.js.map +0 -1
  47. package/dist/node_modules/.bun/tailwind-merge@3.5.0/node_modules/tailwind-merge/dist/bundle-mjs.js.map +0 -1
  48. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts +0 -5
  49. package/dist/theglobalfuel/TheGlobalFuelRoot.d.ts.map +0 -1
  50. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts +0 -4
  51. package/dist/theglobalfuel/TheGlobalFuelRoutes.d.ts.map +0 -1
  52. package/dist/theglobalfuel/components/DataTable.d.ts +0 -28
  53. package/dist/theglobalfuel/components/DataTable.d.ts.map +0 -1
  54. package/dist/theglobalfuel/components/EmptyState.d.ts +0 -18
  55. package/dist/theglobalfuel/components/EmptyState.d.ts.map +0 -1
  56. package/dist/theglobalfuel/components/EvidenceUpload.d.ts +0 -14
  57. package/dist/theglobalfuel/components/EvidenceUpload.d.ts.map +0 -1
  58. package/dist/theglobalfuel/components/FileLink.d.ts +0 -15
  59. package/dist/theglobalfuel/components/FileLink.d.ts.map +0 -1
  60. package/dist/theglobalfuel/components/FilterTabs.d.ts +0 -18
  61. package/dist/theglobalfuel/components/FilterTabs.d.ts.map +0 -1
  62. package/dist/theglobalfuel/components/MetricsCard.d.ts +0 -23
  63. package/dist/theglobalfuel/components/MetricsCard.d.ts.map +0 -1
  64. package/dist/theglobalfuel/components/MiniBar.d.ts +0 -16
  65. package/dist/theglobalfuel/components/MiniBar.d.ts.map +0 -1
  66. package/dist/theglobalfuel/components/PageLayout.d.ts +0 -16
  67. package/dist/theglobalfuel/components/PageLayout.d.ts.map +0 -1
  68. package/dist/theglobalfuel/components/Pagination.d.ts +0 -22
  69. package/dist/theglobalfuel/components/Pagination.d.ts.map +0 -1
  70. package/dist/theglobalfuel/components/StateViews.d.ts +0 -24
  71. package/dist/theglobalfuel/components/StateViews.d.ts.map +0 -1
  72. package/dist/theglobalfuel/components/StatusBadge.d.ts +0 -9
  73. package/dist/theglobalfuel/components/StatusBadge.d.ts.map +0 -1
  74. package/dist/theglobalfuel/components/Tabs.d.ts +0 -17
  75. package/dist/theglobalfuel/components/Tabs.d.ts.map +0 -1
  76. package/dist/theglobalfuel/components/TheDiscussion.d.ts +0 -18
  77. package/dist/theglobalfuel/components/TheDiscussion.d.ts.map +0 -1
  78. package/dist/theglobalfuel/components/TheTags.d.ts +0 -17
  79. package/dist/theglobalfuel/components/TheTags.d.ts.map +0 -1
  80. package/dist/theglobalfuel/components/index.d.ts +0 -19
  81. package/dist/theglobalfuel/components/index.d.ts.map +0 -1
  82. package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts +0 -16
  83. package/dist/theglobalfuel/context/TheGlobalFuelContext.d.ts.map +0 -1
  84. package/dist/theglobalfuel/context/index.d.ts +0 -6
  85. package/dist/theglobalfuel/context/index.d.ts.map +0 -1
  86. package/dist/theglobalfuel/hooks/index.d.ts +0 -10
  87. package/dist/theglobalfuel/hooks/index.d.ts.map +0 -1
  88. package/dist/theglobalfuel/hooks/useCursorPager.d.ts +0 -33
  89. package/dist/theglobalfuel/hooks/useCursorPager.d.ts.map +0 -1
  90. package/dist/theglobalfuel/hooks/useTheComments.d.ts +0 -36
  91. package/dist/theglobalfuel/hooks/useTheComments.d.ts.map +0 -1
  92. package/dist/theglobalfuel/hooks/useTheFiles.d.ts +0 -47
  93. package/dist/theglobalfuel/hooks/useTheFiles.d.ts.map +0 -1
  94. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts +0 -75
  95. package/dist/theglobalfuel/hooks/useTheGlobalFuelApi.d.ts.map +0 -1
  96. package/dist/theglobalfuel/hooks/useTheTags.d.ts +0 -44
  97. package/dist/theglobalfuel/hooks/useTheTags.d.ts.map +0 -1
  98. package/dist/theglobalfuel/index.d.ts +0 -9
  99. package/dist/theglobalfuel/index.d.ts.map +0 -1
  100. package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts +0 -13
  101. package/dist/theglobalfuel/pages/assets/AssetDetailPage.d.ts.map +0 -1
  102. package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts +0 -10
  103. package/dist/theglobalfuel/pages/assets/AssetsPage.d.ts.map +0 -1
  104. package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts +0 -11
  105. package/dist/theglobalfuel/pages/compliance/CompliancePage.d.ts.map +0 -1
  106. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts +0 -9
  107. package/dist/theglobalfuel/pages/contracts/ContractDetailPage.d.ts.map +0 -1
  108. package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts +0 -8
  109. package/dist/theglobalfuel/pages/contracts/ContractsPage.d.ts.map +0 -1
  110. package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts +0 -13
  111. package/dist/theglobalfuel/pages/dashboard/DashboardPage.d.ts.map +0 -1
  112. package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts +0 -12
  113. package/dist/theglobalfuel/pages/emissions/EmissionsPage.d.ts.map +0 -1
  114. package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts +0 -11
  115. package/dist/theglobalfuel/pages/inventory/InventoryPage.d.ts.map +0 -1
  116. package/dist/theglobalfuel/pages/production/ProductionPage.d.ts +0 -11
  117. package/dist/theglobalfuel/pages/production/ProductionPage.d.ts.map +0 -1
  118. package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts +0 -10
  119. package/dist/theglobalfuel/pages/reserves/ReservesPage.d.ts.map +0 -1
  120. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts +0 -10
  121. package/dist/theglobalfuel/pages/shipments/ShipmentsPage.d.ts.map +0 -1
  122. package/dist/theglobalfuel/types/index.d.ts +0 -376
  123. package/dist/theglobalfuel/types/index.d.ts.map +0 -1
  124. package/dist/theglobalfuel/utils/cn.d.ts +0 -4
  125. package/dist/theglobalfuel/utils/cn.d.ts.map +0 -1
  126. package/dist/theglobalfuel/utils/formatters.d.ts +0 -36
  127. package/dist/theglobalfuel/utils/formatters.d.ts.map +0 -1
  128. package/dist/theglobalfuel/utils/i18n.d.ts +0 -6
  129. package/dist/theglobalfuel/utils/i18n.d.ts.map +0 -1
  130. package/dist/theglobalfuel/utils/index.d.ts +0 -9
  131. package/dist/theglobalfuel/utils/index.d.ts.map +0 -1
  132. package/dist/theglobalfuel/utils/navigation.d.ts +0 -14
  133. package/dist/theglobalfuel/utils/navigation.d.ts.map +0 -1
@@ -1,21 +1,22 @@
1
1
  import { useTheGlobalFuel as e } from "../../context/TheGlobalFuelContext.js";
2
2
  import { PageLayout as t } from "../../components/PageLayout.js";
3
3
  import { MetricsCard as n } from "../../components/MetricsCard.js";
4
- import { formatDate as r, formatEnumLabel as i, formatNumber as a, formatRelativeTime as ee, formatVolume as o } from "../../utils/formatters.js";
5
- import { DataTable as s } from "../../components/DataTable.js";
6
- import { ErrorView as c, LoadingView as l } from "../../components/StateViews.js";
4
+ import { formatDate as r, formatEnumLabel as i, formatNumber as a, formatRelativeTime as ee, formatVolume as o, toBackendDate as s } from "../../utils/formatters.js";
5
+ import { DataTable as c } from "../../components/DataTable.js";
6
+ import { ErrorView as l, LoadingView as u } from "../../components/StateViews.js";
7
7
  import { EmptyState as te } from "../../components/EmptyState.js";
8
8
  import "../../context/index.js";
9
- import { useTheAssets as u, useTheProductionRecords as d, useTheRecordProduction as f } from "../../hooks/useTheGlobalFuelApi.js";
10
- import { useCursorPager as p } from "../../hooks/useCursorPager.js";
9
+ import { useTheAssets as ne, useTheProductionRecords as re, useTheRecordProduction as ie } from "../../hooks/useTheGlobalFuelApi.js";
10
+ import { useCursorPager as ae } from "../../hooks/useCursorPager.js";
11
+ import { useNotify as oe } from "../../hooks/useNotify.js";
11
12
  import "../../hooks/index.js";
12
- import { Pagination as m } from "../../components/Pagination.js";
13
- import { useMemo as h, useState as g } from "react";
14
- import { BarChart3 as ne, Clock as re, Droplets as _, Gauge as v, Plus as y } from "lucide-react";
15
- import { Fragment as ie, jsx as b, jsxs as x } from "react/jsx-runtime";
16
- import { Button as S, Input as C, Label as w, ResponsiveDialog as T, ResponsiveDialogContent as E, ResponsiveDialogDescription as D, ResponsiveDialogFooter as ae, ResponsiveDialogHeader as oe, ResponsiveDialogTitle as se, Select as O, SelectContent as k, SelectItem as A, SelectTrigger as j, SelectValue as M, Textarea as N } from "@burdenoff/fe-libs/ui";
13
+ import { Pagination as se } from "../../components/Pagination.js";
14
+ import { useMemo as d, useState as f } from "react";
15
+ import { BarChart3 as p, Clock as m, Droplets as h, Gauge as g, Plus as _ } from "lucide-react";
16
+ import { Fragment as v, jsx as y, jsxs as b } from "react/jsx-runtime";
17
+ import { Button as x, Input as S, Label as C, ResponsiveDialog as ce, ResponsiveDialogContent as le, ResponsiveDialogDescription as ue, ResponsiveDialogFooter as de, ResponsiveDialogHeader as fe, ResponsiveDialogTitle as pe, Select as w, SelectContent as T, SelectItem as E, SelectTrigger as D, SelectValue as O, Textarea as k } from "@burdenoff/fe-libs/ui";
17
18
  //#region src/theglobalfuel/pages/production/ProductionPage.tsx
18
- var P = [
19
+ var A = [
19
20
  "BARRELS",
20
21
  "CUBIC_METERS",
21
22
  "TONNES",
@@ -23,32 +24,32 @@ var P = [
23
24
  "MWH",
24
25
  "GJ",
25
26
  "MCF"
26
- ], F = 25, I = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), L = () => ({
27
+ ], j = 25, M = () => (/* @__PURE__ */ new Date()).toISOString().slice(0, 10), N = () => ({
27
28
  assetId: "",
28
- periodStart: I(),
29
- periodEnd: I(),
29
+ periodStart: M(),
30
+ periodEnd: M(),
30
31
  volume: "",
31
32
  unit: "BARRELS",
32
33
  grade: "",
33
34
  downtimeHours: "",
34
35
  notes: ""
35
36
  });
36
- function R() {
37
- let { navigateTo: I } = e(), [R, z] = g("ALL"), B = p(), [V, H] = g(!1), [U, W] = g(L), [G, K] = g(null), q = u({ pagination: { limit: 100 } }), ce = h(() => {
37
+ function P() {
38
+ let { navigateTo: M } = e(), P = oe(), [F, I] = f("ALL"), L = ae(), [R, z] = f(!1), [B, V] = f(N), [H, U] = f(null), W = ne({ pagination: { limit: 100 } }), G = d(() => {
38
39
  let e = {};
39
- for (let t of q.data?.items ?? []) e[t.id] = t.name;
40
+ for (let t of W.data?.items ?? []) e[t.id] = t.name;
40
41
  return e;
41
- }, [q.data]), { data: J, isLoading: le, isError: ue, refetch: de } = d({
42
- assetId: R === "ALL" ? void 0 : R,
42
+ }, [W.data]), { data: K, isLoading: me, isError: he, refetch: ge } = re({
43
+ assetId: F === "ALL" ? void 0 : F,
43
44
  pagination: {
44
- limit: F,
45
- cursor: B.cursor
45
+ limit: j,
46
+ cursor: L.cursor
46
47
  }
47
- }), Y = f(), X = h(() => J?.items ?? [], [J]), { volumeValue: fe, volumeFooter: pe, downtimeTotal: Z } = h(() => {
48
+ }), q = ie(), J = d(() => K?.items ?? [], [K]), { volumeValue: _e, volumeFooter: Y, downtimeTotal: X } = d(() => {
48
49
  let e = /* @__PURE__ */ new Map(), t = 0;
49
- for (let n of X) e.set(n.unit, (e.get(n.unit) ?? 0) + n.volume), t += n.downtimeHours;
50
+ for (let n of J) e.set(n.unit, (e.get(n.unit) ?? 0) + n.volume), t += n.downtimeHours;
50
51
  let n = [...e.entries()], r, i;
51
- return n.length === 0 ? r = "—" : n.length === 1 ? r = o(n[0][1], n[0][0]) : (r = "Mixed units", i = /* @__PURE__ */ b("p", {
52
+ return n.length === 0 ? r = "—" : n.length === 1 ? r = o(n[0][1], n[0][0]) : (r = "Mixed units", i = /* @__PURE__ */ y("p", {
52
53
  className: "text-xs tabular-nums text-text-tertiary",
53
54
  children: n.map(([e, t]) => o(t, e)).join(" · ")
54
55
  })), {
@@ -56,15 +57,15 @@ function R() {
56
57
  volumeFooter: i,
57
58
  downtimeTotal: t
58
59
  };
59
- }, [X]), me = [
60
+ }, [J]), ve = [
60
61
  {
61
62
  key: "asset",
62
63
  header: "Asset",
63
- render: (e) => /* @__PURE__ */ b("div", {
64
+ render: (e) => /* @__PURE__ */ y("div", {
64
65
  className: "min-w-0",
65
- children: /* @__PURE__ */ b("p", {
66
+ children: /* @__PURE__ */ y("p", {
66
67
  className: "truncate font-semibold text-text-primary",
67
- children: ce[e.assetId] ?? `${e.assetId.slice(0, 8)}…`
68
+ children: G[e.assetId] ?? `${e.assetId.slice(0, 8)}…`
68
69
  })
69
70
  })
70
71
  },
@@ -73,7 +74,7 @@ function R() {
73
74
  header: "Period",
74
75
  hideOnMobile: !0,
75
76
  sortValue: (e) => new Date(e.periodStart).getTime(),
76
- render: (e) => /* @__PURE__ */ x("span", {
77
+ render: (e) => /* @__PURE__ */ b("span", {
77
78
  className: "text-text-secondary",
78
79
  children: [
79
80
  r(e.periodStart),
@@ -87,7 +88,7 @@ function R() {
87
88
  header: "Volume",
88
89
  align: "right",
89
90
  sortValue: (e) => e.volume,
90
- render: (e) => /* @__PURE__ */ b("span", {
91
+ render: (e) => /* @__PURE__ */ y("span", {
91
92
  className: "tabular-nums font-medium text-text-primary",
92
93
  children: o(e.volume, e.unit)
93
94
  })
@@ -98,10 +99,10 @@ function R() {
98
99
  align: "right",
99
100
  hideOnMobile: !0,
100
101
  sortValue: (e) => e.grade ?? 0,
101
- render: (e) => e.grade == null ? /* @__PURE__ */ b("span", {
102
+ render: (e) => e.grade == null ? /* @__PURE__ */ y("span", {
102
103
  className: "text-text-tertiary",
103
104
  children: "—"
104
- }) : /* @__PURE__ */ b("span", {
105
+ }) : /* @__PURE__ */ y("span", {
105
106
  className: "tabular-nums text-text-secondary",
106
107
  children: a(e.grade)
107
108
  })
@@ -112,7 +113,7 @@ function R() {
112
113
  align: "right",
113
114
  hideOnMobile: !0,
114
115
  sortValue: (e) => e.downtimeHours,
115
- render: (e) => /* @__PURE__ */ x("span", {
116
+ render: (e) => /* @__PURE__ */ b("span", {
116
117
  className: "tabular-nums text-text-secondary",
117
118
  children: [a(e.downtimeHours), "h"]
118
119
  })
@@ -122,300 +123,307 @@ function R() {
122
123
  header: "Logged",
123
124
  align: "right",
124
125
  hideOnMobile: !0,
125
- render: (e) => /* @__PURE__ */ b("span", {
126
+ render: (e) => /* @__PURE__ */ y("span", {
126
127
  className: "text-text-tertiary",
127
128
  children: ee(e.createdAt)
128
129
  })
129
130
  }
130
- ], Q = () => {
131
- W(L()), K(null), H(!0);
132
- }, he = async () => {
133
- if (!U.assetId) {
134
- K("Select an asset.");
131
+ ], Z = () => {
132
+ V(N()), U(null), z(!0);
133
+ }, Q = () => {
134
+ z(!1), V(N()), U(null);
135
+ }, ye = async () => {
136
+ if (!B.assetId) {
137
+ U("Select an asset.");
135
138
  return;
136
139
  }
137
- if (!U.periodStart || !U.periodEnd) {
138
- K("Period start and end are required.");
140
+ let e = s(B.periodStart), t = s(B.periodEnd);
141
+ if (!e || !t) {
142
+ U("Period start and end are required.");
139
143
  return;
140
144
  }
141
- if (new Date(U.periodEnd).getTime() < new Date(U.periodStart).getTime()) {
142
- K("Period end must be on or after the period start.");
145
+ if (new Date(t).getTime() < new Date(e).getTime()) {
146
+ U("Period end must be on or after the period start.");
143
147
  return;
144
148
  }
145
- if (!U.volume) {
146
- K("Volume is required.");
149
+ let n = Number(B.volume);
150
+ if (!B.volume || Number.isNaN(n) || n <= 0) {
151
+ let e = "Volume must be greater than zero.";
152
+ U(e), P.error(e);
147
153
  return;
148
154
  }
149
- K(null);
155
+ U(null);
150
156
  try {
151
- await Y.mutateAsync({
152
- assetId: U.assetId,
153
- periodStart: new Date(U.periodStart).toISOString(),
154
- periodEnd: new Date(U.periodEnd).toISOString(),
155
- volume: Number(U.volume),
156
- unit: U.unit,
157
- grade: U.grade ? Number(U.grade) : null,
158
- downtimeHours: U.downtimeHours ? Number(U.downtimeHours) : null,
159
- notes: U.notes.trim() || null
160
- }), H(!1), W(L());
157
+ await q.mutateAsync({
158
+ assetId: B.assetId,
159
+ periodStart: e,
160
+ periodEnd: t,
161
+ volume: n,
162
+ unit: B.unit,
163
+ grade: B.grade ? Number(B.grade) : null,
164
+ downtimeHours: B.downtimeHours ? Number(B.downtimeHours) : null,
165
+ notes: B.notes.trim() || null
166
+ }), P.success("Production recorded"), Q();
161
167
  } catch (e) {
162
- K(e instanceof Error ? e.message : "Failed to record production.");
168
+ U(e instanceof Error ? e.message : "Failed to record production."), P.fromError(e);
163
169
  }
164
- }, $ = q.data?.items ?? [];
165
- return /* @__PURE__ */ x(t, {
170
+ }, $ = W.data?.items ?? [];
171
+ return /* @__PURE__ */ b(t, {
166
172
  title: "Production",
167
173
  description: "Captured production volumes across every field, well, mine & plant — with downtime and grade.",
168
- actions: /* @__PURE__ */ x(S, {
169
- onClick: Q,
170
- children: [/* @__PURE__ */ b(y, { className: "mr-1.5 h-4 w-4" }), " Record production"]
174
+ actions: /* @__PURE__ */ b(x, {
175
+ onClick: Z,
176
+ children: [/* @__PURE__ */ y(_, { className: "mr-1.5 h-4 w-4" }), " Record production"]
171
177
  }),
172
178
  children: [
173
- /* @__PURE__ */ x("div", {
179
+ /* @__PURE__ */ b("div", {
174
180
  className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
175
181
  children: [
176
- /* @__PURE__ */ b(n, {
177
- icon: /* @__PURE__ */ b(_, { className: "h-5 w-5" }),
178
- value: fe,
182
+ /* @__PURE__ */ y(n, {
183
+ icon: /* @__PURE__ */ y(h, { className: "h-5 w-5" }),
184
+ value: _e,
179
185
  label: "Volume on this page",
180
186
  featured: !0,
181
- footer: pe
187
+ footer: Y
182
188
  }),
183
- /* @__PURE__ */ b(n, {
184
- icon: /* @__PURE__ */ b(re, { className: "h-5 w-5" }),
185
- value: `${a(Z)}h`,
189
+ /* @__PURE__ */ y(n, {
190
+ icon: /* @__PURE__ */ y(m, { className: "h-5 w-5" }),
191
+ value: `${a(X)}h`,
186
192
  label: "Downtime on this page",
187
- accent: Z > 0 ? "warning" : void 0
193
+ accent: X > 0 ? "warning" : void 0
188
194
  }),
189
- /* @__PURE__ */ b(n, {
190
- icon: /* @__PURE__ */ b(ne, { className: "h-5 w-5" }),
191
- value: X.length,
195
+ /* @__PURE__ */ y(n, {
196
+ icon: /* @__PURE__ */ y(p, { className: "h-5 w-5" }),
197
+ value: J.length,
192
198
  label: "Records on this page"
193
199
  })
194
200
  ]
195
201
  }),
196
- /* @__PURE__ */ b("div", {
202
+ /* @__PURE__ */ y("div", {
197
203
  className: "mt-6 mb-5 flex flex-wrap items-center gap-3",
198
- children: /* @__PURE__ */ x(O, {
199
- value: R,
204
+ children: /* @__PURE__ */ b(w, {
205
+ value: F,
200
206
  onValueChange: (e) => {
201
- z(e), B.reset();
207
+ I(e), L.reset();
202
208
  },
203
- children: [/* @__PURE__ */ b(j, {
209
+ children: [/* @__PURE__ */ y(D, {
204
210
  className: "w-56",
205
- children: /* @__PURE__ */ b(M, { placeholder: "All assets" })
206
- }), /* @__PURE__ */ x(k, { children: [/* @__PURE__ */ b(A, {
211
+ "aria-label": "Filter by asset",
212
+ children: /* @__PURE__ */ y(O, { placeholder: "All assets" })
213
+ }), /* @__PURE__ */ b(T, { children: [/* @__PURE__ */ y(E, {
207
214
  value: "ALL",
208
215
  children: "All assets"
209
- }), $.map((e) => /* @__PURE__ */ b(A, {
216
+ }), $.map((e) => /* @__PURE__ */ y(E, {
210
217
  value: e.id,
211
218
  children: e.name
212
219
  }, e.id))] })]
213
220
  })
214
221
  }),
215
- le ? /* @__PURE__ */ b(l, { label: "Loading production records…" }) : ue ? /* @__PURE__ */ b(c, {
222
+ me ? /* @__PURE__ */ y(u, { label: "Loading production records…" }) : he ? /* @__PURE__ */ y(l, {
216
223
  message: "Couldn't load production records.",
217
- onRetry: () => de()
218
- }) : X.length === 0 ? /* @__PURE__ */ b(te, {
224
+ onRetry: () => ge()
225
+ }) : J.length === 0 ? /* @__PURE__ */ y(te, {
219
226
  illustration: "empty-data",
220
- icon: /* @__PURE__ */ b(v, { className: "h-10 w-10" }),
227
+ icon: /* @__PURE__ */ y(g, { className: "h-10 w-10" }),
221
228
  title: "No production recorded",
222
- description: R === "ALL" ? "Record a production period to start tracking output, grade and downtime." : "No production has been recorded for this asset yet.",
223
- action: /* @__PURE__ */ x(S, {
224
- onClick: Q,
225
- children: [/* @__PURE__ */ b(y, { className: "mr-1.5 h-4 w-4" }), " Record production"]
229
+ description: F === "ALL" ? "Record a production period to start tracking output, grade and downtime." : "No production has been recorded for this asset yet.",
230
+ action: /* @__PURE__ */ b(x, {
231
+ onClick: Z,
232
+ children: [/* @__PURE__ */ y(_, { className: "mr-1.5 h-4 w-4" }), " Record production"]
226
233
  })
227
- }) : /* @__PURE__ */ x(ie, { children: [/* @__PURE__ */ b(s, {
228
- columns: me,
229
- rows: X,
234
+ }) : /* @__PURE__ */ b(v, { children: [/* @__PURE__ */ y(c, {
235
+ columns: ve,
236
+ rows: J,
230
237
  rowKey: (e) => e.id,
231
- onRowClick: (e) => I(`assets/${e.assetId}`),
238
+ onRowClick: (e) => M(`assets/${e.assetId}`),
239
+ rowLabel: (e) => `Open ${G[e.assetId] ?? "asset"}`,
232
240
  defaultSort: {
233
241
  key: "period",
234
242
  dir: "desc"
235
243
  }
236
- }), /* @__PURE__ */ b(m, {
237
- page: B.page,
238
- pageSize: F,
239
- itemCount: X.length,
240
- hasMore: J?.pageInfo?.hasMore ?? !1,
241
- onPageChange: (e) => B.onPageChange(e, J?.pageInfo?.cursor)
244
+ }), /* @__PURE__ */ y(se, {
245
+ page: L.page,
246
+ pageSize: j,
247
+ itemCount: J.length,
248
+ hasMore: K?.pageInfo?.hasMore ?? !1,
249
+ onPageChange: (e) => L.onPageChange(e, K?.pageInfo?.cursor)
242
250
  })] }),
243
- /* @__PURE__ */ b(T, {
244
- open: V,
245
- onOpenChange: (e) => {
246
- H(e), e || (W(L()), K(null));
247
- },
248
- children: /* @__PURE__ */ x(E, { children: [
249
- /* @__PURE__ */ x(oe, { children: [/* @__PURE__ */ b(se, { children: "Record production" }), /* @__PURE__ */ b(D, { children: "Log the volume produced by an asset over a reporting period." })] }),
250
- /* @__PURE__ */ x("div", {
251
+ /* @__PURE__ */ y(ce, {
252
+ open: R,
253
+ onOpenChange: (e) => e ? z(!0) : Q(),
254
+ children: /* @__PURE__ */ b(le, { children: [/* @__PURE__ */ b(fe, { children: [/* @__PURE__ */ y(pe, { children: "Record production" }), /* @__PURE__ */ y(ue, { children: "Log the volume produced by an asset over a reporting period." })] }), /* @__PURE__ */ b("form", {
255
+ onSubmit: (e) => {
256
+ e.preventDefault(), ye();
257
+ },
258
+ children: [/* @__PURE__ */ b("div", {
251
259
  className: "grid gap-4 py-2",
252
260
  children: [
253
- /* @__PURE__ */ x("div", {
261
+ /* @__PURE__ */ b("div", {
254
262
  className: "grid gap-1.5",
255
- children: [/* @__PURE__ */ b(w, {
263
+ children: [/* @__PURE__ */ y(C, {
256
264
  htmlFor: "prAsset",
257
265
  children: "Asset *"
258
- }), /* @__PURE__ */ x(O, {
259
- value: U.assetId,
260
- onValueChange: (e) => W({
261
- ...U,
266
+ }), /* @__PURE__ */ b(w, {
267
+ value: B.assetId,
268
+ onValueChange: (e) => V({
269
+ ...B,
262
270
  assetId: e
263
271
  }),
264
- children: [/* @__PURE__ */ b(j, {
272
+ children: [/* @__PURE__ */ y(D, {
265
273
  id: "prAsset",
266
- children: /* @__PURE__ */ b(M, { placeholder: "Select an asset" })
267
- }), /* @__PURE__ */ b(k, { children: $.map((e) => /* @__PURE__ */ b(A, {
274
+ children: /* @__PURE__ */ y(O, { placeholder: "Select an asset" })
275
+ }), /* @__PURE__ */ y(T, { children: $.map((e) => /* @__PURE__ */ y(E, {
268
276
  value: e.id,
269
277
  children: e.name
270
278
  }, e.id)) })]
271
279
  })]
272
280
  }),
273
- /* @__PURE__ */ x("div", {
281
+ /* @__PURE__ */ b("div", {
274
282
  className: "grid gap-2 sm:grid-cols-2",
275
- children: [/* @__PURE__ */ x("div", {
283
+ children: [/* @__PURE__ */ b("div", {
276
284
  className: "grid gap-1.5",
277
- children: [/* @__PURE__ */ b(w, {
285
+ children: [/* @__PURE__ */ y(C, {
278
286
  htmlFor: "prStart",
279
287
  children: "Period start *"
280
- }), /* @__PURE__ */ b(C, {
288
+ }), /* @__PURE__ */ y(S, {
281
289
  id: "prStart",
282
290
  type: "date",
283
- value: U.periodStart,
284
- onChange: (e) => W({
285
- ...U,
291
+ value: B.periodStart,
292
+ onChange: (e) => V({
293
+ ...B,
286
294
  periodStart: e.target.value
287
295
  })
288
296
  })]
289
- }), /* @__PURE__ */ x("div", {
297
+ }), /* @__PURE__ */ b("div", {
290
298
  className: "grid gap-1.5",
291
- children: [/* @__PURE__ */ b(w, {
299
+ children: [/* @__PURE__ */ y(C, {
292
300
  htmlFor: "prEnd",
293
301
  children: "Period end *"
294
- }), /* @__PURE__ */ b(C, {
302
+ }), /* @__PURE__ */ y(S, {
295
303
  id: "prEnd",
296
304
  type: "date",
297
- value: U.periodEnd,
298
- onChange: (e) => W({
299
- ...U,
305
+ value: B.periodEnd,
306
+ onChange: (e) => V({
307
+ ...B,
300
308
  periodEnd: e.target.value
301
309
  })
302
310
  })]
303
311
  })]
304
312
  }),
305
- /* @__PURE__ */ x("div", {
313
+ /* @__PURE__ */ b("div", {
306
314
  className: "grid gap-2 sm:grid-cols-2",
307
- children: [/* @__PURE__ */ x("div", {
315
+ children: [/* @__PURE__ */ b("div", {
308
316
  className: "grid gap-1.5",
309
- children: [/* @__PURE__ */ b(w, {
317
+ children: [/* @__PURE__ */ y(C, {
310
318
  htmlFor: "prVolume",
311
319
  children: "Volume *"
312
- }), /* @__PURE__ */ b(C, {
320
+ }), /* @__PURE__ */ y(S, {
313
321
  id: "prVolume",
314
322
  type: "number",
315
323
  min: "0",
316
324
  step: "any",
317
- value: U.volume,
318
- onChange: (e) => W({
319
- ...U,
325
+ value: B.volume,
326
+ onChange: (e) => V({
327
+ ...B,
320
328
  volume: e.target.value
321
329
  }),
322
330
  placeholder: "12500"
323
331
  })]
324
- }), /* @__PURE__ */ x("div", {
332
+ }), /* @__PURE__ */ b("div", {
325
333
  className: "grid gap-1.5",
326
- children: [/* @__PURE__ */ b(w, {
334
+ children: [/* @__PURE__ */ y(C, {
327
335
  htmlFor: "prUnit",
328
336
  children: "Unit"
329
- }), /* @__PURE__ */ x(O, {
330
- value: U.unit,
331
- onValueChange: (e) => W({
332
- ...U,
337
+ }), /* @__PURE__ */ b(w, {
338
+ value: B.unit,
339
+ onValueChange: (e) => V({
340
+ ...B,
333
341
  unit: e
334
342
  }),
335
- children: [/* @__PURE__ */ b(j, {
343
+ children: [/* @__PURE__ */ y(D, {
336
344
  id: "prUnit",
337
- children: /* @__PURE__ */ b(M, {})
338
- }), /* @__PURE__ */ b(k, { children: P.map((e) => /* @__PURE__ */ b(A, {
345
+ children: /* @__PURE__ */ y(O, {})
346
+ }), /* @__PURE__ */ y(T, { children: A.map((e) => /* @__PURE__ */ y(E, {
339
347
  value: e,
340
348
  children: i(e)
341
349
  }, e)) })]
342
350
  })]
343
351
  })]
344
352
  }),
345
- /* @__PURE__ */ x("div", {
353
+ /* @__PURE__ */ b("div", {
346
354
  className: "grid gap-2 sm:grid-cols-2",
347
- children: [/* @__PURE__ */ x("div", {
355
+ children: [/* @__PURE__ */ b("div", {
348
356
  className: "grid gap-1.5",
349
- children: [/* @__PURE__ */ b(w, {
357
+ children: [/* @__PURE__ */ y(C, {
350
358
  htmlFor: "prGrade",
351
359
  children: "Grade"
352
- }), /* @__PURE__ */ b(C, {
360
+ }), /* @__PURE__ */ y(S, {
353
361
  id: "prGrade",
354
362
  type: "number",
355
363
  step: "any",
356
- value: U.grade,
357
- onChange: (e) => W({
358
- ...U,
364
+ value: B.grade,
365
+ onChange: (e) => V({
366
+ ...B,
359
367
  grade: e.target.value
360
368
  }),
361
369
  placeholder: "Quality / concentration"
362
370
  })]
363
- }), /* @__PURE__ */ x("div", {
371
+ }), /* @__PURE__ */ b("div", {
364
372
  className: "grid gap-1.5",
365
- children: [/* @__PURE__ */ b(w, {
373
+ children: [/* @__PURE__ */ y(C, {
366
374
  htmlFor: "prDowntime",
367
375
  children: "Downtime (hours)"
368
- }), /* @__PURE__ */ b(C, {
376
+ }), /* @__PURE__ */ y(S, {
369
377
  id: "prDowntime",
370
378
  type: "number",
371
379
  min: "0",
372
380
  step: "any",
373
- value: U.downtimeHours,
374
- onChange: (e) => W({
375
- ...U,
381
+ value: B.downtimeHours,
382
+ onChange: (e) => V({
383
+ ...B,
376
384
  downtimeHours: e.target.value
377
385
  }),
378
386
  placeholder: "0"
379
387
  })]
380
388
  })]
381
389
  }),
382
- /* @__PURE__ */ x("div", {
390
+ /* @__PURE__ */ b("div", {
383
391
  className: "grid gap-1.5",
384
- children: [/* @__PURE__ */ b(w, {
392
+ children: [/* @__PURE__ */ y(C, {
385
393
  htmlFor: "prNotes",
386
394
  children: "Notes"
387
- }), /* @__PURE__ */ b(N, {
395
+ }), /* @__PURE__ */ y(k, {
388
396
  id: "prNotes",
389
397
  rows: 2,
390
- value: U.notes,
391
- onChange: (e) => W({
392
- ...U,
398
+ value: B.notes,
399
+ onChange: (e) => V({
400
+ ...B,
393
401
  notes: e.target.value
394
402
  }),
395
403
  placeholder: "Optional context about this period."
396
404
  })]
397
405
  }),
398
- G && /* @__PURE__ */ b("p", {
406
+ H && /* @__PURE__ */ y("p", {
399
407
  className: "text-sm text-status-error-text",
400
- children: G
408
+ children: H
401
409
  })
402
410
  ]
403
- }),
404
- /* @__PURE__ */ x(ae, { children: [/* @__PURE__ */ b(S, {
411
+ }), /* @__PURE__ */ b(de, { children: [/* @__PURE__ */ y(x, {
412
+ type: "button",
405
413
  variant: "outline",
406
- onClick: () => H(!1),
414
+ onClick: Q,
407
415
  children: "Cancel"
408
- }), /* @__PURE__ */ b(S, {
409
- onClick: he,
410
- disabled: Y.isPending,
411
- children: Y.isPending ? "Recording…" : "Record production"
412
- })] })
413
- ] })
416
+ }), /* @__PURE__ */ y(x, {
417
+ type: "submit",
418
+ disabled: q.isPending,
419
+ children: q.isPending ? "Recording…" : "Record production"
420
+ })] })]
421
+ })] })
414
422
  })
415
423
  ]
416
424
  });
417
425
  }
418
426
  //#endregion
419
- export { R as ProductionPage };
427
+ export { P as ProductionPage };
420
428
 
421
429
  //# sourceMappingURL=ProductionPage.js.map