@nivaro/react 0.3.52 → 0.3.53

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 (34) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +47 -3
  4. package/dist/shared/components/ItemEditForm.js +3851 -3821
  5. package/dist/shared/components/NotificationBell.js +163 -150
  6. package/dist/shared/components/PageRenderer.js +600 -549
  7. package/dist/shared/components/ProfileView.js +36 -34
  8. package/dist/shared/components/QueryStatStrip.js +96 -89
  9. package/dist/shared/components/QueryTable.js +214 -215
  10. package/dist/shared/components/ReportView.js +548 -529
  11. package/dist/shared/components/alerts/AlertManagerView.js +346 -320
  12. package/dist/shared/components/item-edit/CatalogPickerField.js +1300 -1219
  13. package/dist/shared/components/item-edit/FieldAffordances.js +145 -136
  14. package/dist/shared/components/item-edit/FieldRenderer.js +366 -326
  15. package/dist/shared/components/item-edit/InlineTableField.js +3047 -2932
  16. package/dist/shared/components/item-edit/NestedRelationEditor.js +149 -143
  17. package/dist/shared/components/item-edit/PlanGrid.js +718 -705
  18. package/dist/shared/components/item-edit/SummaryPanel.js +351 -337
  19. package/dist/shared/components/item-edit/line-qty.js +115 -53
  20. package/dist/shared/components/item-edit/save-refusal.js +18 -18
  21. package/dist/shared/components/item-edit/usePersonalDefaults.js +210 -207
  22. package/dist/shared/components/panels/CommentPanel.js +204 -197
  23. package/dist/shared/components/panels/ItemLockBanner.js +318 -291
  24. package/dist/shared/components/panels/PipelinePanel.js +1388 -1218
  25. package/dist/shared/components/panels/RecordIntegrityBanner.js +201 -172
  26. package/dist/shared/components/panels/RevisionsPanel.js +101 -106
  27. package/dist/shared/components/panels/TransitionRequirementsDialog.js +564 -534
  28. package/dist/shared/components/panels/requirement-side-effects.js +46 -29
  29. package/dist/shared/components/queue/QueueItemSheet.js +219 -146
  30. package/dist/shared/components/queue/QueueWorklist.js +738 -730
  31. package/dist/shared/components/widgets/ReviewListWidget.js +236 -201
  32. package/dist/shared/lib/activity-sentence.js +236 -227
  33. package/dist/shared/lib/record-ref.js +43 -34
  34. package/package.json +1 -1
@@ -1,40 +1,57 @@
1
- const o = (n) => n == null || n === "";
2
- function c(n, e) {
3
- if (n === e || o(n) && o(e)) return !0;
4
- if (o(n) || o(e)) return !1;
5
- if (typeof n != "object" && typeof e != "object") {
6
- const r = Number(n), t = Number(e);
7
- return !Number.isNaN(r) && !Number.isNaN(t) ? r === t : String(n) === String(e);
1
+ const o = (e) => e == null || e === "";
2
+ function u(e, t) {
3
+ if (e === t || o(e) && o(t)) return !0;
4
+ if (o(e) || o(t)) return !1;
5
+ if (typeof e != "object" && typeof t != "object") {
6
+ const i = Number(e), r = Number(t);
7
+ return !Number.isNaN(i) && !Number.isNaN(r) ? i === r : String(e) === String(t);
8
8
  }
9
- return JSON.stringify(n) === JSON.stringify(e);
9
+ return JSON.stringify(e) === JSON.stringify(t);
10
10
  }
11
- function l(n, e) {
12
- if (!n || n.ok === !1 || !Array.isArray(n.changes)) return [];
11
+ const d = /* @__PURE__ */ new Set([
12
+ "changed",
13
+ "created",
14
+ "modified",
15
+ "date_created",
16
+ "date_updated",
17
+ "date_modified",
18
+ "created_at",
19
+ "updated_at",
20
+ "modified_at",
21
+ "user_created",
22
+ "user_updated",
23
+ "created_by",
24
+ "updated_by",
25
+ "modified_by"
26
+ ]);
27
+ function s(e, t, i) {
28
+ if (!e || e.ok === !1 || !Array.isArray(e.changes)) return [];
13
29
  const r = [];
14
- for (const t of n.changes)
15
- !t || typeof t.field != "string" || t.field in e || t.field.startsWith("_") || o(t.from) || c(t.from, t.to) || r.push({ field: t.field, from: t.from, to: t.to });
30
+ for (const n of e.changes)
31
+ !n || typeof n.field != "string" || n.field in t || n.field.startsWith("_") || d.has(n.field.toLowerCase()) || i && !i(n.field) || o(n.from) || u(n.from, n.to) || r.push({ field: n.field, from: n.from, to: n.to });
16
32
  return r;
17
33
  }
18
- function a(n) {
19
- const e = {};
20
- for (const r of n) e[r.field] = r.from;
21
- return e;
34
+ function l(e) {
35
+ const t = {};
36
+ for (const i of e) t[i.field] = i.from;
37
+ return t;
22
38
  }
23
- const s = 5;
24
- async function m(n, e = s) {
25
- const r = new Array(n.length);
26
- let t = 0;
27
- const f = async () => {
28
- for (; t < n.length; ) {
29
- const i = t++;
30
- r[i] = await n[i]();
39
+ const a = 5;
40
+ async function m(e, t = a) {
41
+ const i = new Array(e.length);
42
+ let r = 0;
43
+ const n = async () => {
44
+ for (; r < e.length; ) {
45
+ const f = r++;
46
+ i[f] = await e[f]();
31
47
  }
32
- }, u = Math.max(1, Math.min(e, n.length));
33
- return await Promise.all(Array.from({ length: u }, f)), r;
48
+ }, c = Math.max(1, Math.min(t, e.length));
49
+ return await Promise.all(Array.from({ length: c }, n)), i;
34
50
  }
35
51
  export {
36
- s as ROW_WRITE_CONCURRENCY,
37
- a as keepValuesPatch,
38
- l as overwrittenBySideEffect,
52
+ d as AUDIT_FIELDS,
53
+ a as ROW_WRITE_CONCURRENCY,
54
+ l as keepValuesPatch,
55
+ s as overwrittenBySideEffect,
39
56
  m as runPooled
40
57
  };
@@ -1,195 +1,263 @@
1
- import { jsxs as a, jsx as r, Fragment as U } from "react/jsx-runtime";
2
- import { useQueryClient as W, useQuery as T, useMutation as A } from "@tanstack/react-query";
3
- import { ExternalLink as z, ArrowRight as M } from "lucide-react";
4
- import { useState as j } from "react";
5
- import { toast as k } from "sonner";
6
- import { useNivaroClient as G, useItemNavigation as J } from "../../context.js";
7
- import { get as E, post as Q } from "../../lib/commands.js";
8
- import { formatMultiValue as X } from "../../lib/format-value.js";
9
- import { useLiveRecord as Y, batchTouches as K, LIVE_ASPECTS as P } from "../../lib/live.js";
10
- import { userErrorMessage as Z } from "../../lib/safe-error.js";
11
- import { cn as L, formatRelative as ee, humanHours as te } from "../../lib/utils.js";
12
- import { transitionRequirementsFromError as re } from "../panels/PipelinePanel.js";
13
- import { TransitionRequirementsDialog as ae } from "../panels/TransitionRequirementsDialog.js";
14
- import { Badge as ne } from "../ui/badge.js";
15
- import { Sheet as oe, SheetContent as se, SheetHeader as de, SheetTitle as ie } from "../ui/sheet.js";
16
- import { OwnerAvatars as le } from "./OwnerAvatars.js";
17
- function ce(e) {
18
- return te(e);
1
+ import { jsxs as n, jsx as r, Fragment as ee } from "react/jsx-runtime";
2
+ import { useQueryClient as te, useQuery as Q, useMutation as $ } from "@tanstack/react-query";
3
+ import { ExternalLink as re, ArrowRight as O } from "lucide-react";
4
+ import { useState as q, useEffect as ae } from "react";
5
+ import { toast as C } from "sonner";
6
+ import { useNivaroClient as ne, useItemNavigation as oe } from "../../context.js";
7
+ import { get as B, post as D } from "../../lib/commands.js";
8
+ import { formatMultiValue as de } from "../../lib/format-value.js";
9
+ import { useLiveRecord as se, batchTouches as F, LIVE_ASPECTS as H } from "../../lib/live.js";
10
+ import { userErrorMessage as ie } from "../../lib/safe-error.js";
11
+ import { cn as V, formatRelative as le, humanHours as ce } from "../../lib/utils.js";
12
+ import { transitionRequirementsFromError as me } from "../panels/PipelinePanel.js";
13
+ import { TransitionRequirementsDialog as ue } from "../panels/TransitionRequirementsDialog.js";
14
+ import { Badge as pe } from "../ui/badge.js";
15
+ import { Sheet as be, SheetContent as xe, SheetHeader as he, SheetTitle as fe } from "../ui/sheet.js";
16
+ import { OwnerAvatars as ge } from "./OwnerAvatars.js";
17
+ import { useTransitionNote as ye, needsTransitionNote as ve } from "./transition-note.js";
18
+ function ke(t) {
19
+ return (t ?? []).filter((l) => l.in_row_menu !== !1);
19
20
  }
20
- function me(e) {
21
- return e.split(".").map((m) => m.replace(/_/g, " ").replace(/\b\w/g, (h) => h.toUpperCase())).join(" → ");
21
+ function Ne(t) {
22
+ return ce(t);
22
23
  }
23
- function c({ label: e, children: m }) {
24
- return /* @__PURE__ */ a("div", { className: "bg-white px-3 py-2.5 dark:bg-card", children: [
25
- /* @__PURE__ */ r("p", { className: "mb-0.5 text-[10px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: e }),
26
- /* @__PURE__ */ r("div", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: m })
24
+ function we(t) {
25
+ return t.split(".").map((l) => l.replace(/_/g, " ").replace(/\b\w/g, (g) => g.toUpperCase())).join(" → ");
26
+ }
27
+ function b({ label: t, children: l }) {
28
+ return /* @__PURE__ */ n("div", { className: "bg-white px-3 py-2.5 dark:bg-card", children: [
29
+ /* @__PURE__ */ r("p", { className: "mb-0.5 text-[10px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: t }),
30
+ /* @__PURE__ */ r("div", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: l })
27
31
  ] });
28
32
  }
29
- function Ie({
30
- item: e,
31
- onOpenChange: m,
32
- onClaim: h,
33
- onRelease: $,
34
- workNextActive: O,
35
- onNext: N,
36
- refetchItems: w,
37
- stateLabels: g,
38
- collectionLabel: q,
39
- claimsEnabled: B = !0,
40
- columnFormats: u,
41
- width: D,
42
- itemLayout: F
33
+ function De({
34
+ item: t,
35
+ onOpenChange: l,
36
+ onClaim: g,
37
+ onRelease: L,
38
+ workNextActive: U,
39
+ onNext: S,
40
+ refetchItems: I,
41
+ stateLabels: y,
42
+ collectionLabel: T,
43
+ claimsEnabled: W = !0,
44
+ columnFormats: x,
45
+ width: z,
46
+ itemLayout: G
43
47
  }) {
44
- var I;
45
- const p = W(), x = G(), { open: H } = J(), [f, _] = j(""), [d, y] = j(null), o = e == null ? void 0 : e.collection, s = e == null ? void 0 : e.item_id, { data: i } = T({
46
- queryKey: ["queue-sheet-instance", o, s],
47
- queryFn: () => x.request(E(`/pipelines/instance/${o}/${s}`)).then((t) => t.data),
48
- enabled: !!o && !!s
49
- }), { data: l } = T({
50
- queryKey: ["queue-sheet-comments", o, s],
51
- queryFn: () => x.request(E("/comments", { collection: o, item: s })).then((t) => ({ data: (t.data ?? []).filter((n) => !n.deleted) })).catch(() => ({ data: [] })),
52
- enabled: !!o && !!s
53
- }), b = A({
54
- mutationFn: (t) => x.request(
55
- Q(`/pipelines/instance/${o}/${s}/transition`, {
56
- transition_id: t
48
+ var j;
49
+ const h = te(), f = ne(), { open: J } = oe(), [v, M] = q(""), [c, k] = q(null), [N, m] = q(null), P = ye(), o = t == null ? void 0 : t.collection, d = t == null ? void 0 : t.item_id;
50
+ ae(() => m(null), [o, d]);
51
+ const { data: u } = Q({
52
+ queryKey: ["queue-sheet-instance", o, d],
53
+ queryFn: () => f.request(B(`/pipelines/instance/${o}/${d}`)).then((e) => e.data),
54
+ enabled: !!o && !!d
55
+ }), { data: p } = Q({
56
+ queryKey: ["queue-sheet-comments", o, d],
57
+ queryFn: () => f.request(B("/comments", { collection: o, item: d })).then((e) => ({ data: (e.data ?? []).filter((a) => !a.deleted) })).catch(() => ({ data: [] })),
58
+ enabled: !!o && !!d
59
+ }), s = $({
60
+ mutationFn: ({ transitionId: e, comment: a }) => f.request(
61
+ D(`/pipelines/instance/${o}/${d}/transition`, {
62
+ transition_id: e,
63
+ ...a ? { comment: a } : {}
57
64
  })
58
65
  ),
59
66
  onSuccess: () => {
60
- y(null), p.invalidateQueries({ queryKey: ["queue-sheet-instance", o, s] }), w(), k.success("Transitioned");
67
+ k(null), m(null), h.invalidateQueries({ queryKey: ["queue-sheet-instance", o, d] }), I(), C.success("Transitioned");
61
68
  },
62
- onError: (t, n) => {
63
- const R = re(t);
64
- if (R) {
65
- y((v) => ({
66
- payload: R,
67
- transitionId: n,
68
- revision: ((v == null ? void 0 : v.revision) ?? 0) + 1
69
+ onError: (e, { transitionId: a, comment: Z }) => {
70
+ m(null);
71
+ const K = me(e);
72
+ if (K) {
73
+ k((_) => ({
74
+ payload: K,
75
+ transitionId: a,
76
+ comment: Z,
77
+ revision: ((_ == null ? void 0 : _.revision) ?? 0) + 1
69
78
  }));
70
79
  return;
71
80
  }
72
- k.error(Z(t, "Transition failed"));
81
+ C.error(ie(e, "Transition failed"));
73
82
  }
74
- }), C = A({
75
- mutationFn: (t) => x.request(Q("/comments", { collection: o, item: s, text: t })),
83
+ }), R = $({
84
+ mutationFn: (e) => f.request(D("/comments", { collection: o, item: d, text: e })),
76
85
  onSuccess: () => {
77
- _(""), p.invalidateQueries({ queryKey: ["queue-sheet-comments", o, s] });
86
+ M(""), h.invalidateQueries({ queryKey: ["queue-sheet-comments", o, d] });
78
87
  },
79
- onError: () => k.error("Failed to post comment")
88
+ onError: () => C.error("Failed to post comment")
80
89
  });
81
- Y(o, s, (t) => {
82
- K(t, P.state) && (p.invalidateQueries({ queryKey: ["queue-sheet-instance", o, s] }), t.own || w()), K(t, P.comments) && p.invalidateQueries({ queryKey: ["queue-sheet-comments", o, s] });
90
+ se(o, d, (e) => {
91
+ F(e, H.state) && (h.invalidateQueries({ queryKey: ["queue-sheet-instance", o, d] }), e.own || I()), F(e, H.comments) && h.invalidateQueries({ queryKey: ["queue-sheet-comments", o, d] });
83
92
  });
84
- const S = (i == null ? void 0 : i.available_transitions) ?? [], V = new Map(((i == null ? void 0 : i.states) ?? []).map((t) => [t.id, t]));
85
- return /* @__PURE__ */ a(oe, { open: !!e, onOpenChange: m, children: [
93
+ const w = ke(u == null ? void 0 : u.available_transitions), i = N && w.some((e) => e.id === N.id) ? N : null, A = new Map(((u == null ? void 0 : u.states) ?? []).map((e) => [e.id, e])), E = (e) => {
94
+ const a = A.get(e.to_state);
95
+ return e.label || (a == null ? void 0 : a.label) || (a == null ? void 0 : a.key) || "Move";
96
+ }, X = (e) => {
97
+ const a = A.get(e.to_state);
98
+ return (a == null ? void 0 : a.label) || (a == null ? void 0 : a.key) || e.label || "the next step";
99
+ }, Y = async (e) => {
100
+ if (!s.isPending) {
101
+ if (ve(e)) {
102
+ m(null);
103
+ const a = await P.ask(E(e));
104
+ if (!a) return;
105
+ s.mutate({ transitionId: e.id, comment: a });
106
+ return;
107
+ }
108
+ m(e);
109
+ }
110
+ };
111
+ return /* @__PURE__ */ n(be, { open: !!t, onOpenChange: l, children: [
86
112
  /* @__PURE__ */ r(
87
- se,
113
+ xe,
88
114
  {
89
115
  side: "right",
90
116
  className: "flex max-w-full flex-col gap-0 p-0",
91
- style: { width: D ?? 480, maxWidth: "96vw" },
92
- children: e && /* @__PURE__ */ a(U, { children: [
93
- /* @__PURE__ */ r(de, { className: "shrink-0 border-b border-slate-200 px-5 py-4 dark:border-border", children: /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-3 pr-6", children: [
94
- /* @__PURE__ */ a("div", { className: "min-w-0", children: [
95
- /* @__PURE__ */ r(ie, { className: "truncate text-[15px] font-semibold", children: e.label }),
96
- /* @__PURE__ */ a("div", { className: "mt-1.5 flex items-center gap-2", children: [
97
- /* @__PURE__ */ r(ne, { variant: "outline", children: q ? q(e.collection) : e.collection }),
98
- e.state && /* @__PURE__ */ r(
117
+ style: { width: z ?? 480, maxWidth: "96vw" },
118
+ children: t && /* @__PURE__ */ n(ee, { children: [
119
+ /* @__PURE__ */ r(he, { className: "shrink-0 border-b border-slate-200 px-5 py-4 dark:border-border", children: /* @__PURE__ */ n("div", { className: "flex items-start justify-between gap-3 pr-6", children: [
120
+ /* @__PURE__ */ n("div", { className: "min-w-0", children: [
121
+ /* @__PURE__ */ r(fe, { className: "truncate text-[15px] font-semibold", children: t.label }),
122
+ /* @__PURE__ */ n("div", { className: "mt-1.5 flex items-center gap-2", children: [
123
+ /* @__PURE__ */ r(pe, { variant: "outline", children: T ? T(t.collection) : t.collection }),
124
+ t.state && /* @__PURE__ */ r(
99
125
  "span",
100
126
  {
101
127
  className: "rounded px-1.5 py-0.5 text-[11px] font-medium",
102
128
  style: {
103
- backgroundColor: e.state_color ? `${e.state_color}1a` : void 0,
104
- color: e.state_color ?? void 0
129
+ backgroundColor: t.state_color ? `${t.state_color}1a` : void 0,
130
+ color: t.state_color ?? void 0
105
131
  },
106
- children: (g == null ? void 0 : g[e.state]) ?? e.state
132
+ children: (y == null ? void 0 : y[t.state]) ?? t.state
107
133
  }
108
134
  )
109
135
  ] })
110
136
  ] }),
111
- /* @__PURE__ */ a(
137
+ /* @__PURE__ */ n(
112
138
  "button",
113
139
  {
114
140
  type: "button",
115
- onClick: () => H({
116
- collection: e.collection,
117
- itemId: e.item_id,
118
- layoutSlug: F ?? null
141
+ onClick: () => J({
142
+ collection: t.collection,
143
+ itemId: t.item_id,
144
+ layoutSlug: G ?? null
119
145
  }),
120
146
  className: "flex shrink-0 items-center gap-1 text-[12px] font-medium text-nvr-navy hover:underline dark:text-nvr-cyan",
121
147
  children: [
122
148
  "Open ",
123
- /* @__PURE__ */ r(z, { className: "h-3 w-3" })
149
+ /* @__PURE__ */ r(re, { className: "h-3 w-3" })
124
150
  ]
125
151
  }
126
152
  )
127
153
  ] }) }),
128
- /* @__PURE__ */ a("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
129
- /* @__PURE__ */ a("div", { className: "mb-4 grid grid-cols-2 gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: [
130
- /* @__PURE__ */ r(c, { label: "Owners", children: /* @__PURE__ */ r(le, { owners: e.owners, max: 6 }) }),
131
- /* @__PURE__ */ r(c, { label: "Claimed by", children: ((I = e.claimed_by) == null ? void 0 : I.name) ?? "—" }),
132
- /* @__PURE__ */ r(c, { label: "SLA", children: e.sla_status ? /* @__PURE__ */ r(
154
+ /* @__PURE__ */ n("div", { className: "flex-1 overflow-y-auto px-5 py-4", children: [
155
+ /* @__PURE__ */ n("div", { className: "mb-4 grid grid-cols-2 gap-px overflow-hidden rounded-lg border border-slate-200 bg-slate-200 dark:border-border dark:bg-border", children: [
156
+ /* @__PURE__ */ r(b, { label: "Owners", children: /* @__PURE__ */ r(ge, { owners: t.owners, max: 6 }) }),
157
+ /* @__PURE__ */ r(b, { label: "Claimed by", children: ((j = t.claimed_by) == null ? void 0 : j.name) ?? "—" }),
158
+ /* @__PURE__ */ r(b, { label: "SLA", children: t.sla_status ? /* @__PURE__ */ r(
133
159
  "span",
134
160
  {
135
- className: L(
161
+ className: V(
136
162
  "rounded px-1.5 py-0.5 text-[11px] font-medium",
137
- e.sla_status === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : e.sla_status === "warning" ? "bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400" : "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400"
163
+ t.sla_status === "breached" ? "bg-red-50 text-red-600 dark:bg-red-500/10 dark:text-red-400" : t.sla_status === "warning" ? "bg-amber-50 text-amber-600 dark:bg-amber-500/10 dark:text-amber-400" : "bg-emerald-50 text-emerald-600 dark:bg-emerald-500/10 dark:text-emerald-400"
138
164
  ),
139
- children: e.sla_status
165
+ children: t.sla_status
140
166
  }
141
167
  ) : "—" }),
142
- /* @__PURE__ */ r(c, { label: "Aging", children: ce(e.aging_hours) }),
143
- e.at_risk && /* @__PURE__ */ r(c, { label: "Risk", children: /* @__PURE__ */ r("span", { className: "text-red-500", children: "⚑ At risk" }) }),
144
- Object.entries(e.extra ?? {}).map(([t, n]) => /* @__PURE__ */ r(c, { label: me(t), children: n == null || n === "" ? "—" : u != null && u[t] ? X(String(n), u[t]) : String(n) }, t))
168
+ /* @__PURE__ */ r(b, { label: "Aging", children: Ne(t.aging_hours) }),
169
+ t.at_risk && /* @__PURE__ */ r(b, { label: "Risk", children: /* @__PURE__ */ r("span", { className: "text-red-500", children: "⚑ At risk" }) }),
170
+ Object.entries(t.extra ?? {}).map(([e, a]) => /* @__PURE__ */ r(b, { label: we(e), children: a == null || a === "" ? "—" : x != null && x[e] ? de(String(a), x[e]) : String(a) }, e))
145
171
  ] }),
146
- S.length > 0 && /* @__PURE__ */ a("div", { className: "mb-4", children: [
172
+ w.length > 0 && /* @__PURE__ */ n("div", { className: "mb-4", children: [
147
173
  /* @__PURE__ */ r("p", { className: "mb-1.5 text-[11px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: "Transitions" }),
148
- /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1.5", children: S.map((t) => {
149
- const n = V.get(t.to_state);
150
- return /* @__PURE__ */ a(
151
- "button",
152
- {
153
- type: "button",
154
- disabled: b.isPending,
155
- onClick: () => b.mutate(t.id),
156
- className: "flex items-center gap-1 rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[12px] font-medium text-slate-700 hover:border-nvr-cyan hover:text-nvr-navy disabled:opacity-50 dark:border-border dark:bg-card dark:text-slate-200 dark:hover:text-nvr-cyan",
157
- children: [
158
- t.label || (n == null ? void 0 : n.label) || (n == null ? void 0 : n.key) || "Move",
159
- /* @__PURE__ */ r(M, { className: "h-3 w-3 text-slate-400" })
160
- ]
161
- },
162
- t.id
163
- );
164
- }) })
174
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap gap-1.5", children: w.map((e) => /* @__PURE__ */ n(
175
+ "button",
176
+ {
177
+ type: "button",
178
+ disabled: s.isPending,
179
+ "aria-pressed": (i == null ? void 0 : i.id) === e.id,
180
+ onClick: () => void Y(e),
181
+ className: V(
182
+ "flex items-center gap-1 rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[12px] font-medium text-slate-700 hover:border-nvr-cyan hover:text-nvr-navy disabled:opacity-50 dark:border-border dark:bg-card dark:text-slate-200 dark:hover:text-nvr-cyan",
183
+ (i == null ? void 0 : i.id) === e.id && "border-nvr-cyan"
184
+ ),
185
+ children: [
186
+ E(e),
187
+ /* @__PURE__ */ r(O, { className: "h-3 w-3 text-slate-400" })
188
+ ]
189
+ },
190
+ e.id
191
+ )) }),
192
+ i && /* @__PURE__ */ n(
193
+ "div",
194
+ {
195
+ role: "alertdialog",
196
+ "aria-label": "Confirm move",
197
+ "data-peek-confirm": !0,
198
+ className: "mt-2 rounded-md border border-amber-200 bg-amber-50 px-3 py-2.5 dark:border-amber-500/30 dark:bg-amber-500/10",
199
+ children: [
200
+ /* @__PURE__ */ n("p", { className: "text-[12.5px] text-slate-700 dark:text-slate-200", children: [
201
+ "Move ",
202
+ /* @__PURE__ */ r("span", { className: "font-semibold", children: t.label }),
203
+ " to",
204
+ " ",
205
+ /* @__PURE__ */ r("span", { className: "font-semibold", children: X(i) }),
206
+ "?"
207
+ ] }),
208
+ /* @__PURE__ */ n("div", { className: "mt-2 flex gap-2", children: [
209
+ /* @__PURE__ */ r(
210
+ "button",
211
+ {
212
+ type: "button",
213
+ disabled: s.isPending,
214
+ onClick: () => s.mutate({ transitionId: i.id }),
215
+ className: "h-7 rounded-md bg-nvr-cyan px-3 text-[12px] font-semibold text-white disabled:opacity-50",
216
+ children: s.isPending ? "Moving…" : "Confirm"
217
+ }
218
+ ),
219
+ /* @__PURE__ */ r(
220
+ "button",
221
+ {
222
+ type: "button",
223
+ disabled: s.isPending,
224
+ onClick: () => m(null),
225
+ className: "h-7 rounded-md border border-slate-200 bg-white px-3 text-[12px] text-slate-600 hover:bg-muted disabled:opacity-50 dark:border-border dark:bg-card dark:text-slate-300",
226
+ children: "Keep"
227
+ }
228
+ )
229
+ ] })
230
+ ]
231
+ }
232
+ )
165
233
  ] }),
166
- (B || e.claimed_by) && /* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(
234
+ (W || t.claimed_by) && /* @__PURE__ */ r("div", { className: "mb-4", children: /* @__PURE__ */ r(
167
235
  "button",
168
236
  {
169
237
  type: "button",
170
- onClick: () => e.claimed_by ? $(e) : h(e),
238
+ onClick: () => t.claimed_by ? L(t) : g(t),
171
239
  className: "rounded-md bg-nvr-cyan px-3 py-1.5 text-[12px] font-medium text-white hover:bg-nvr-cyan/90",
172
- children: e.claimed_by ? "Release claim" : "Claim this item"
240
+ children: t.claimed_by ? "Release claim" : "Claim this item"
173
241
  }
174
242
  ) }),
175
- /* @__PURE__ */ a("div", { children: [
243
+ /* @__PURE__ */ n("div", { children: [
176
244
  /* @__PURE__ */ r("p", { className: "mb-1.5 text-[11px] font-medium uppercase tracking-wide text-slate-400 dark:text-muted-foreground", children: "Comments" }),
177
- /* @__PURE__ */ a("div", { className: "space-y-2.5", children: [
178
- ((l == null ? void 0 : l.data) ?? []).map((t) => /* @__PURE__ */ a("div", { className: "rounded-md bg-slate-50 px-3 py-2 dark:bg-muted/40", children: [
179
- /* @__PURE__ */ a("p", { className: "text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: [
180
- [t.first_name, t.last_name].filter(Boolean).join(" ") || t.email || "—",
181
- /* @__PURE__ */ r("span", { className: "ml-1.5 font-normal text-slate-400", children: ee(t.created_at) })
245
+ /* @__PURE__ */ n("div", { className: "space-y-2.5", children: [
246
+ ((p == null ? void 0 : p.data) ?? []).map((e) => /* @__PURE__ */ n("div", { className: "rounded-md bg-slate-50 px-3 py-2 dark:bg-muted/40", children: [
247
+ /* @__PURE__ */ n("p", { className: "text-[11px] font-medium text-slate-500 dark:text-muted-foreground", children: [
248
+ [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email || "—",
249
+ /* @__PURE__ */ r("span", { className: "ml-1.5 font-normal text-slate-400", children: le(e.created_at) })
182
250
  ] }),
183
- /* @__PURE__ */ r("p", { className: "mt-0.5 whitespace-pre-wrap text-[12px] text-slate-700 dark:text-slate-200", children: t.text })
184
- ] }, t.id)),
185
- ((l == null ? void 0 : l.data) ?? []).length === 0 && /* @__PURE__ */ r("p", { className: "text-[12px] text-slate-400", children: "No comments yet." })
251
+ /* @__PURE__ */ r("p", { className: "mt-0.5 whitespace-pre-wrap text-[12px] text-slate-700 dark:text-slate-200", children: e.text })
252
+ ] }, e.id)),
253
+ ((p == null ? void 0 : p.data) ?? []).length === 0 && /* @__PURE__ */ r("p", { className: "text-[12px] text-slate-400", children: "No comments yet." })
186
254
  ] }),
187
- /* @__PURE__ */ a("div", { className: "mt-2.5", children: [
255
+ /* @__PURE__ */ n("div", { className: "mt-2.5", children: [
188
256
  /* @__PURE__ */ r(
189
257
  "textarea",
190
258
  {
191
- value: f,
192
- onChange: (t) => _(t.target.value),
259
+ value: v,
260
+ onChange: (e) => M(e.target.value),
193
261
  placeholder: "Add a comment…",
194
262
  rows: 2,
195
263
  className: "w-full rounded-md border border-slate-200 bg-white px-2.5 py-1.5 text-[12px] focus:border-nvr-cyan focus:outline-none dark:border-border dark:bg-card"
@@ -199,8 +267,8 @@ function Ie({
199
267
  "button",
200
268
  {
201
269
  type: "button",
202
- disabled: !f.trim() || C.isPending,
203
- onClick: () => C.mutate(f.trim()),
270
+ disabled: !v.trim() || R.isPending,
271
+ onClick: () => R.mutate(v.trim()),
204
272
  className: "mt-1 rounded-md border border-slate-200 px-2.5 py-1 text-[12px] font-medium text-slate-600 hover:text-slate-800 disabled:opacity-50 dark:border-border dark:text-slate-300",
205
273
  children: "Post"
206
274
  }
@@ -208,35 +276,40 @@ function Ie({
208
276
  ] })
209
277
  ] })
210
278
  ] }),
211
- O && N && /* @__PURE__ */ r("div", { className: "shrink-0 border-t border-slate-200 px-5 py-3 dark:border-border", children: /* @__PURE__ */ a(
279
+ U && S && /* @__PURE__ */ r("div", { className: "shrink-0 border-t border-slate-200 px-5 py-3 dark:border-border", children: /* @__PURE__ */ n(
212
280
  "button",
213
281
  {
214
282
  type: "button",
215
- onClick: N,
283
+ onClick: S,
216
284
  className: "flex w-full items-center justify-center gap-1.5 rounded-md bg-nvr-cyan px-3 py-2 text-[13px] font-semibold text-white hover:bg-nvr-cyan/90",
217
285
  children: [
218
286
  "Next ",
219
- /* @__PURE__ */ r(M, { className: "h-3.5 w-3.5" })
287
+ /* @__PURE__ */ r(O, { className: "h-3.5 w-3.5" })
220
288
  ]
221
289
  }
222
290
  ) })
223
291
  ] })
224
292
  }
225
293
  ),
226
- d && /* @__PURE__ */ r(
227
- ae,
294
+ c && /* @__PURE__ */ r(
295
+ ue,
228
296
  {
229
- payload: d.payload,
230
- transitionId: d.transitionId,
231
- isRetry: d.revision > 1,
232
- onSubmitted: () => b.mutate(d.transitionId),
233
- executing: b.isPending,
234
- onClose: () => y(null)
297
+ payload: c.payload,
298
+ transitionId: c.transitionId,
299
+ isRetry: c.revision > 1,
300
+ onSubmitted: () => s.mutate({
301
+ transitionId: c.transitionId,
302
+ comment: c.comment
303
+ }),
304
+ executing: s.isPending,
305
+ onClose: () => k(null)
235
306
  },
236
- d.revision
237
- )
307
+ c.revision
308
+ ),
309
+ P.dialog
238
310
  ] });
239
311
  }
240
312
  export {
241
- Ie as QueueItemSheet
313
+ De as QueueItemSheet,
314
+ ke as peekTransitions
242
315
  };