@nivaro/react 0.3.111 → 0.3.112

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 (75) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +170 -2
  4. package/dist/index.js +745 -728
  5. package/dist/shared/components/CollectionBrowserView.js +3097 -2972
  6. package/dist/shared/components/CollectionImportBanner.js +135 -0
  7. package/dist/shared/components/ItemEditForm.js +2235 -2218
  8. package/dist/shared/components/JobsTray.js +54 -47
  9. package/dist/shared/components/ViewAsPersonButton.js +109 -0
  10. package/dist/shared/components/bulk/BulkFieldUpdate.js +228 -150
  11. package/dist/shared/components/bulk/BulkFieldUpdateButton.js +35 -41
  12. package/dist/shared/components/bulk/BulkLinksValue.js +91 -0
  13. package/dist/shared/components/bulk/bulk-field-options.js +20 -19
  14. package/dist/shared/components/bulk/bulk-update-preview.js +39 -0
  15. package/dist/shared/components/cbv/ColumnHeaderMenu.js +113 -0
  16. package/dist/shared/components/cbv/column-totals.js +66 -0
  17. package/dist/shared/components/collections-directory/CollectionHoverCard.js +108 -81
  18. package/dist/shared/components/collections-directory/CollectionRow.js +164 -148
  19. package/dist/shared/components/collections-directory/CollectionsDirectory.js +167 -166
  20. package/dist/shared/components/collections-directory/directory-data.js +70 -58
  21. package/dist/shared/components/imports/CollectionImportPanel.js +120 -118
  22. package/dist/shared/components/imports/DefinitionsPanel.js +24 -24
  23. package/dist/shared/components/imports/ImportDuplicatesNotice.js +65 -0
  24. package/dist/shared/components/item-edit/CatalogPickerField.js +631 -639
  25. package/dist/shared/components/item-edit/DuplicateNotice.js +168 -0
  26. package/dist/shared/components/item-edit/FieldRow.js +248 -246
  27. package/dist/shared/components/item-edit/InlineGridField.js +34 -33
  28. package/dist/shared/components/item-edit/InlineTableField.js +3064 -2882
  29. package/dist/shared/components/item-edit/MembershipSetField.js +165 -169
  30. package/dist/shared/components/item-edit/NestedRelationEditor.js +184 -189
  31. package/dist/shared/components/item-edit/PlanGrid.js +2 -1
  32. package/dist/shared/components/item-edit/QuickPickerDialog.js +35 -34
  33. package/dist/shared/components/item-edit/RecordLiveSync.js +32 -30
  34. package/dist/shared/components/item-edit/RelationCombobox.js +101 -100
  35. package/dist/shared/components/item-edit/RowHistorySheet.js +28 -27
  36. package/dist/shared/components/item-edit/SummaryPanel.js +133 -135
  37. package/dist/shared/components/item-edit/ViewAsRole.js +129 -52
  38. package/dist/shared/components/item-edit/grid-search.js +345 -0
  39. package/dist/shared/components/item-edit/render-stability.js +61 -54
  40. package/dist/shared/components/notifications/NotificationRulesEditor.js +25 -20
  41. package/dist/shared/components/ops-report/DigestSections.js +163 -144
  42. package/dist/shared/components/ops-report/drill.js +97 -97
  43. package/dist/shared/components/panels/AddendumLinesDiff.js +52 -51
  44. package/dist/shared/components/panels/AddendumPanel.js +92 -91
  45. package/dist/shared/components/panels/AsyncUserPicker.js +108 -0
  46. package/dist/shared/components/panels/CommentPanel.js +265 -252
  47. package/dist/shared/components/panels/OwnersSlot.js +47 -35
  48. package/dist/shared/components/panels/PipelineInsight.js +186 -0
  49. package/dist/shared/components/panels/PipelinePanel.js +1529 -1492
  50. package/dist/shared/components/panels/RecordIntegrityBanner.js +39 -38
  51. package/dist/shared/components/panels/RevisionsPanel.js +261 -260
  52. package/dist/shared/components/pipeline/FieldPicker.js +41 -40
  53. package/dist/shared/components/pipeline/OwnerMatrix.js +829 -700
  54. package/dist/shared/components/pipeline/OwnerRecordTrial.js +362 -0
  55. package/dist/shared/components/pipeline/PipelineEditorView.js +483 -467
  56. package/dist/shared/components/pipeline/PipelineStateOwners.js +65 -64
  57. package/dist/shared/components/pipeline/owner-matrix-draft.js +178 -0
  58. package/dist/shared/components/profile/MyDefaultsCard.js +36 -35
  59. package/dist/shared/components/profile/PersonHeader.js +29 -29
  60. package/dist/shared/components/profile/PersonProfile.js +30 -28
  61. package/dist/shared/components/profile/SlowScreensCard.js +286 -0
  62. package/dist/shared/components/queue/QueueWorklist.js +1090 -1071
  63. package/dist/shared/components/quick-filters/useQuickFilterEditing.js +45 -44
  64. package/dist/shared/components/support/TicketDetailSheet.js +25 -16
  65. package/dist/shared/components/support/TicketSlowScreens.js +32 -0
  66. package/dist/shared/lib/activity-sentence.js +224 -178
  67. package/dist/shared/lib/collection-import-banner.js +27 -0
  68. package/dist/shared/lib/crash-report.js +112 -0
  69. package/dist/shared/lib/export-runs.js +99 -0
  70. package/dist/shared/lib/jobs-tray.js +89 -67
  71. package/dist/shared/lib/list-link.js +76 -69
  72. package/dist/shared/lib/nav-trail.js +180 -76
  73. package/dist/shared/lib/query-keys.js +26 -0
  74. package/dist/shared/lib/view-as.js +16 -11
  75. package/package.json +1 -1
@@ -1,76 +1,88 @@
1
1
  import { jsxs as o, jsx as e } from "react/jsx-runtime";
2
- import { useQuery as u } from "@tanstack/react-query";
3
- import { Users as h, ChevronDown as w } from "lucide-react";
4
- import { useNivaroClient as b } from "../../context.js";
5
- import { get as N } from "../../lib/commands.js";
6
- import { useStartsOpen as y } from "../../lib/use-starts-open.js";
7
- import { UserAvatar as v } from "../UserAvatar.js";
8
- function d(n) {
9
- return [n.first_name, n.last_name].filter(Boolean).join(" ") || n.email;
2
+ import { useQuery as x } from "@tanstack/react-query";
3
+ import { Users as h, ChevronDown as b } from "lucide-react";
4
+ import { useNivaroClient as w } from "../../context.js";
5
+ import { get as y } from "../../lib/commands.js";
6
+ import { useStartsOpen as N } from "../../lib/use-starts-open.js";
7
+ import { UserAvatar as g } from "../UserAvatar.js";
8
+ import { ViewAsPersonButton as v } from "../ViewAsPersonButton.js";
9
+ function c(r) {
10
+ return [r.first_name, r.last_name].filter(Boolean).join(" ") || r.email;
10
11
  }
11
- function g(n) {
12
- return d(n).split(" ").map((p) => p[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
12
+ function _(r) {
13
+ return c(r).split(" ").map((p) => p[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
13
14
  }
14
- function U({
15
- collection: n,
16
- item: s,
15
+ function $({
16
+ collection: r,
17
+ item: a,
17
18
  title: p,
18
19
  defaultExpanded: m
19
20
  }) {
20
- const x = b(), [c, f] = y(m, !1), { data: r = [] } = u({
21
- queryKey: ["pipeline-instance-owners", n, s],
22
- queryFn: () => x.request(N(`/pipelines/instance/${n}/${s}/owners`)).then((t) => t.data ?? []),
23
- enabled: !!n && !!s && s !== "new"
21
+ const f = w(), [d, u] = N(m, !1), { data: l = [] } = x({
22
+ queryKey: ["pipeline-instance-owners", r, a],
23
+ queryFn: () => f.request(y(`/pipelines/instance/${r}/${a}/owners`)).then((t) => t.data ?? []),
24
+ enabled: !!r && !!a && a !== "new"
24
25
  });
25
- if (!s || s === "new") return null;
26
- const l = /* @__PURE__ */ new Map();
27
- for (const t of r) {
28
- const a = t.state ?? "__all__";
29
- l.has(a) || l.set(a, []), l.get(a).push(t);
26
+ if (!a || a === "new") return null;
27
+ const i = /* @__PURE__ */ new Map();
28
+ for (const t of l) {
29
+ const n = t.state ?? "__all__";
30
+ i.has(n) || i.set(n, []), i.get(n).push(t);
30
31
  }
31
32
  return /* @__PURE__ */ o("div", { className: "overflow-hidden rounded-xl border border-slate-200 bg-white", children: [
32
33
  /* @__PURE__ */ o(
33
34
  "button",
34
35
  {
35
36
  type: "button",
36
- onClick: () => f((t) => !t),
37
+ onClick: () => u((t) => !t),
37
38
  className: "flex w-full items-center gap-2 px-4 py-2.5",
38
39
  children: [
39
40
  /* @__PURE__ */ e(h, { className: "h-3.5 w-3.5 shrink-0 text-slate-400" }),
40
41
  /* @__PURE__ */ e("span", { className: "text-[12px] font-semibold text-slate-500", children: p || "Owners" }),
41
- !c && r.length > 0 && /* @__PURE__ */ e("span", { className: "ml-1 text-[11px] text-slate-400", children: r.length }),
42
+ !d && l.length > 0 && /* @__PURE__ */ e("span", { className: "ml-1 text-[11px] text-slate-400", children: l.length }),
42
43
  /* @__PURE__ */ e(
43
- w,
44
+ b,
44
45
  {
45
- className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${c ? " rotate-180" : ""}`
46
+ className: `ml-auto h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150${d ? " rotate-180" : ""}`
46
47
  }
47
48
  )
48
49
  ]
49
50
  }
50
51
  ),
51
- c && /* @__PURE__ */ e("div", { className: "border-t border-slate-100 px-4 py-3", children: r.length === 0 ? /* @__PURE__ */ e("p", { className: "py-1 text-[13px] text-slate-400", children: "No owners assigned" }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: [...l.entries()].map(([t, a]) => /* @__PURE__ */ o("div", { children: [
52
+ d && /* @__PURE__ */ e("div", { className: "border-t border-slate-100 px-4 py-3", children: l.length === 0 ? /* @__PURE__ */ e("p", { className: "py-1 text-[13px] text-slate-400", children: "No owners assigned" }) : /* @__PURE__ */ e("div", { className: "space-y-3", children: [...i.entries()].map(([t, n]) => /* @__PURE__ */ o("div", { children: [
52
53
  t !== "__all__" && /* @__PURE__ */ e("p", { className: "mb-1 text-[10px] font-semibold uppercase tracking-wide text-slate-400", children: t }),
53
- /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: a.map((i) => /* @__PURE__ */ o(
54
+ /* @__PURE__ */ e("div", { className: "flex flex-wrap gap-2", children: n.map((s) => /* @__PURE__ */ o(
54
55
  "div",
55
56
  {
56
- className: "flex items-center gap-1.5 rounded-full border border-slate-200 bg-slate-50 py-0.5 pl-0.5 pr-2.5",
57
+ className: "group flex items-center gap-1.5 rounded-full border border-slate-200 bg-slate-50 py-0.5 pl-0.5 pr-2.5 dark:border-border dark:bg-muted/40",
57
58
  children: [
58
59
  /* @__PURE__ */ e(
59
- v,
60
+ g,
60
61
  {
61
- userId: i.user,
62
+ userId: s.user,
62
63
  className: "h-6 w-6",
63
- fallback: /* @__PURE__ */ e("span", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: g(i) })
64
+ fallback: /* @__PURE__ */ e("span", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: _(s) })
64
65
  }
65
66
  ),
66
- /* @__PURE__ */ e("span", { className: "text-[12px] text-slate-700", children: d(i) })
67
+ /* @__PURE__ */ e("span", { className: "text-[12px] text-slate-700 dark:text-slate-200", children: c(s) }),
68
+ /* @__PURE__ */ e(
69
+ v,
70
+ {
71
+ person: {
72
+ id: String(s.user),
73
+ name: c(s),
74
+ firstName: s.first_name
75
+ },
76
+ className: "-mr-1.5 h-5 w-5 opacity-0 focus-visible:opacity-100 group-hover:opacity-100 data-[state=open]:opacity-100"
77
+ }
78
+ )
67
79
  ]
68
80
  },
69
- i.id
81
+ s.id
70
82
  )) })
71
83
  ] }, t)) }) })
72
84
  ] });
73
85
  }
74
86
  export {
75
- U as OwnersSlot
87
+ $ as OwnersSlot
76
88
  };
@@ -0,0 +1,186 @@
1
+ import { jsx as a, jsxs as r } from "react/jsx-runtime";
2
+ import { useQuery as u } from "@tanstack/react-query";
3
+ import { ChevronDown as m, Check as f, Hourglass as g } from "lucide-react";
4
+ import { useState as h } from "react";
5
+ import { useNivaroClient as p } from "../../context.js";
6
+ import { get as w } from "../../lib/commands.js";
7
+ import { formatDateTime as c, cn as $ } from "../../lib/utils.js";
8
+ function k(e) {
9
+ return e.names.length === 0 ? e.label : `${e.names.join(", ") + (e.more > 0 ? ` +${e.more}` : "")} (${e.label})`;
10
+ }
11
+ function x(e) {
12
+ const n = `${e.signed} of ${e.required} signed`;
13
+ return e.waiting.length === 0 ? n : `${n} — waiting on ${e.waiting.map(k).join(", ")}`;
14
+ }
15
+ function b(e) {
16
+ const n = e.name ?? "finished on its own";
17
+ return `${e.label} — ${n}${e.at ? `, ${c(e.at)}` : ""}`;
18
+ }
19
+ function _({ summary: e }) {
20
+ const [n, i] = h(!1), o = e.signers.length > 0 ? `Signed: ${e.signers.map(b).join(" · ")}` : "Nobody has signed yet", d = e.required > 0 ? e.signed / e.required * 100 : 0;
21
+ return /* @__PURE__ */ r("div", { "data-sign-off": e.kind, children: [
22
+ /* @__PURE__ */ r(
23
+ "button",
24
+ {
25
+ type: "button",
26
+ className: "group flex w-full items-center gap-2 rounded-md text-left text-[12px] text-slate-600 transition-colors hover:text-slate-800 dark:text-slate-300 dark:hover:text-slate-100",
27
+ onClick: () => i((t) => !t),
28
+ "aria-expanded": n,
29
+ "data-tip": o,
30
+ children: [
31
+ /* @__PURE__ */ a(
32
+ "span",
33
+ {
34
+ className: "relative h-1.5 w-10 shrink-0 overflow-hidden rounded-full bg-slate-200 dark:bg-white/10",
35
+ "aria-hidden": !0,
36
+ children: /* @__PURE__ */ a(
37
+ "span",
38
+ {
39
+ className: "absolute inset-y-0 left-0 rounded-full bg-emerald-500 dark:bg-emerald-400",
40
+ style: { width: `${d}%` }
41
+ }
42
+ )
43
+ }
44
+ ),
45
+ /* @__PURE__ */ r("span", { className: "min-w-0 flex-1 truncate", "data-sign-off-line": !0, children: [
46
+ e.title ? /* @__PURE__ */ r("span", { className: "font-medium text-slate-700 dark:text-slate-200", children: [
47
+ e.title,
48
+ ":",
49
+ " "
50
+ ] }) : null,
51
+ x(e)
52
+ ] }),
53
+ /* @__PURE__ */ a(
54
+ m,
55
+ {
56
+ className: $(
57
+ "h-3.5 w-3.5 shrink-0 text-slate-400 transition-transform duration-150",
58
+ n && "rotate-180"
59
+ )
60
+ }
61
+ )
62
+ ]
63
+ }
64
+ ),
65
+ n && /* @__PURE__ */ r("ul", { className: "mt-1.5 space-y-1 pl-12 text-[11.5px]", "data-sign-off-detail": !0, children: [
66
+ e.signers.map((t) => /* @__PURE__ */ r(
67
+ "li",
68
+ {
69
+ className: "flex items-baseline gap-1.5 text-slate-600 dark:text-slate-300",
70
+ children: [
71
+ /* @__PURE__ */ a(
72
+ f,
73
+ {
74
+ className: "h-3 w-3 shrink-0 translate-y-0.5 text-emerald-600 dark:text-emerald-400",
75
+ strokeWidth: 3
76
+ }
77
+ ),
78
+ /* @__PURE__ */ a("span", { className: "font-medium", children: t.label }),
79
+ /* @__PURE__ */ r("span", { className: "text-slate-500 dark:text-slate-400", children: [
80
+ t.name ?? "finished on its own",
81
+ t.at ? ` · ${c(t.at)}` : ""
82
+ ] })
83
+ ]
84
+ },
85
+ `s-${t.label}`
86
+ )),
87
+ e.waiting.map((t) => /* @__PURE__ */ r(
88
+ "li",
89
+ {
90
+ className: "flex items-baseline gap-1.5 text-slate-500 dark:text-slate-400",
91
+ children: [
92
+ /* @__PURE__ */ a(g, { className: "h-3 w-3 shrink-0 translate-y-0.5 text-amber-500" }),
93
+ /* @__PURE__ */ a("span", { className: "font-medium text-slate-600 dark:text-slate-300", children: t.label }),
94
+ /* @__PURE__ */ a("span", { children: t.names.length > 0 ? `waiting on ${t.names.join(", ")}${t.more > 0 ? ` +${t.more}` : ""}` : "waiting — nobody owns it yet" })
95
+ ]
96
+ },
97
+ `w-${t.label}`
98
+ ))
99
+ ] })
100
+ ] });
101
+ }
102
+ function M({ summaries: e }) {
103
+ const n = (e ?? []).filter((i) => i.required >= 2);
104
+ return n.length === 0 ? null : /* @__PURE__ */ a("div", { className: "space-y-1.5", "data-sign-offs": !0, children: n.map((i) => /* @__PURE__ */ a(
105
+ _,
106
+ {
107
+ summary: i
108
+ },
109
+ `${i.kind}:${i.title ?? ""}:${[...i.signers, ...i.waiting].map((o) => o.label).join("|")}`
110
+ )) });
111
+ }
112
+ function s(e) {
113
+ const n = Math.round(Math.max(0, e) / 6e4);
114
+ if (n < 1) return "under a minute";
115
+ if (n < 60) return `${n} min`;
116
+ const i = e / 36e5;
117
+ return i < 48 ? `${Math.round(i)} h` : `${Math.round(i / 24)} d`;
118
+ }
119
+ function F(e) {
120
+ const n = e.current ? " so far" : "";
121
+ return !e.owners_known && e.working_ms === 0 ? `waited ${s(e.waiting_ms)}${n} · nobody owns it` : e.current && !e.first_touch_at ? `waiting ${s(e.waiting_ms)} so far — nobody has touched it` : !e.current && e.working_ms < 6e4 ? `waited ${s(e.waiting_ms)}, then moved on at once` : e.working_ms < 6e4 ? `waited ${s(e.waiting_ms)}, picked up just now` : e.waiting_ms < 6e4 ? `worked ${s(e.working_ms)}${n}, picked up at once` : `waited ${s(e.waiting_ms)}, worked ${s(e.working_ms)}${n}`;
122
+ }
123
+ const N = {
124
+ edit: "an edit",
125
+ comment: "a comment",
126
+ task: "a task",
127
+ view: "opening the record",
128
+ move: "the move on"
129
+ };
130
+ function D(e) {
131
+ return !e.first_touch_at || !e.first_touch_kind ? null : `First touched by an owner with ${N[e.first_touch_kind]}, ${c(e.first_touch_at)}`;
132
+ }
133
+ function L(e, n, i, o = !0) {
134
+ const d = p(), { data: t } = u({
135
+ queryKey: ["pipeline-step-timing", e, n, i],
136
+ queryFn: () => d.request(
137
+ w(`/pipelines/instance/${e}/${n}/step-timing`)
138
+ ).then((l) => l.data ?? []),
139
+ enabled: o,
140
+ staleTime: 6e4
141
+ });
142
+ return t ? new Map(t.map((l) => [Number(l.history_id), l])) : null;
143
+ }
144
+ function y(e) {
145
+ const n = e ?? "#64748b";
146
+ return `repeating-linear-gradient(135deg, ${n}2e 0 4px, ${n}14 4px 8px)`;
147
+ }
148
+ function v(e) {
149
+ return e ? `${e}77` : "rgba(100,116,139,.45)";
150
+ }
151
+ function H() {
152
+ return /* @__PURE__ */ r("span", { className: "flex items-center gap-2", "data-step-timing-legend": !0, children: [
153
+ /* @__PURE__ */ r("span", { className: "flex items-center gap-1", children: [
154
+ /* @__PURE__ */ a(
155
+ "span",
156
+ {
157
+ className: "inline-block h-2 w-3 rounded-sm",
158
+ style: { background: y("#64748b") }
159
+ }
160
+ ),
161
+ "Waiting"
162
+ ] }),
163
+ /* @__PURE__ */ r("span", { className: "flex items-center gap-1", children: [
164
+ /* @__PURE__ */ a(
165
+ "span",
166
+ {
167
+ className: "inline-block h-2 w-3 rounded-sm",
168
+ style: { background: v("#64748b") }
169
+ }
170
+ ),
171
+ "Working"
172
+ ] })
173
+ ] });
174
+ }
175
+ export {
176
+ M as SignOffSummaryLines,
177
+ H as TimingLegend,
178
+ s as durWords,
179
+ D as firstTouchText,
180
+ x as signOffLine,
181
+ b as signerText,
182
+ F as timingWords,
183
+ L as useStepTiming,
184
+ y as waitingFill,
185
+ v as workingFill
186
+ };