@nivaro/react 0.3.116 → 0.3.118

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 (142) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +140 -14
  4. package/dist/index.js +488 -485
  5. package/dist/shared/components/ActivityEntry.js +130 -125
  6. package/dist/shared/components/AgentPresenceChip.js +36 -26
  7. package/dist/shared/components/CellCopyLayer.js +50 -45
  8. package/dist/shared/components/CollectionBrowserView.js +3855 -3785
  9. package/dist/shared/components/FilePreviewLightbox.js +96 -58
  10. package/dist/shared/components/InStep.js +18 -17
  11. package/dist/shared/components/ItemEditForm.js +4220 -4175
  12. package/dist/shared/components/JobsTray.js +8 -8
  13. package/dist/shared/components/LiveNewMatchesPill.js +21 -14
  14. package/dist/shared/components/LiveOffNote.js +3 -2
  15. package/dist/shared/components/LiveRowMark.js +53 -23
  16. package/dist/shared/components/LiveTraceView.js +162 -123
  17. package/dist/shared/components/MyWorkView.js +320 -299
  18. package/dist/shared/components/NotificationBell.js +14 -14
  19. package/dist/shared/components/OverflowRail.js +1 -1
  20. package/dist/shared/components/PageRenderer.js +120 -116
  21. package/dist/shared/components/ProfileView.js +203 -202
  22. package/dist/shared/components/RealtimeStatusBanner.js +31 -29
  23. package/dist/shared/components/RecordDrilldownSheet.js +7 -7
  24. package/dist/shared/components/RecordHoverCard.js +102 -84
  25. package/dist/shared/components/RecordReadView.js +146 -146
  26. package/dist/shared/components/ReportView.js +1086 -1091
  27. package/dist/shared/components/ScreenRefreshButton.js +34 -32
  28. package/dist/shared/components/TipLayer.js +65 -58
  29. package/dist/shared/components/WidgetImageMenu.js +83 -43
  30. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  31. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  32. package/dist/shared/components/cbv/column-totals.js +62 -57
  33. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  34. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  35. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  36. package/dist/shared/components/charts/category-axis.js +93 -0
  37. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  38. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  39. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  40. package/dist/shared/components/collections-directory/page-model.js +72 -67
  41. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  42. package/dist/shared/components/integrations/SendStatus.js +65 -59
  43. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  44. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  45. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  46. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +131 -92
  47. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  48. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  49. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  50. package/dist/shared/components/item-edit/FieldComments.js +54 -53
  51. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  52. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  53. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  54. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  55. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  56. package/dist/shared/components/item-edit/HeaderTools.js +94 -85
  57. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  58. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  59. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  60. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  61. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  62. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  63. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  64. package/dist/shared/components/item-edit/RecordHelpChip.js +21 -22
  65. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  66. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  67. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  68. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  69. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  70. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  71. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  72. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  73. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  74. package/dist/shared/components/item-edit/UserChip.js +1 -1
  75. package/dist/shared/components/item-edit/file-live.js +69 -54
  76. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  77. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  78. package/dist/shared/components/item-edit/removed-line.js +31 -25
  79. package/dist/shared/components/layout-editor/pickers/field-picker.js +112 -104
  80. package/dist/shared/components/list/ListViewers.js +46 -35
  81. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  82. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  83. package/dist/shared/components/panels/AlertBanners.js +82 -72
  84. package/dist/shared/components/panels/BranchLanes.js +22 -22
  85. package/dist/shared/components/panels/CommentImages.js +123 -102
  86. package/dist/shared/components/panels/CommentPanel.js +186 -185
  87. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  88. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  89. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  90. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  91. package/dist/shared/components/pipeline/BindingStartStateSettings.js +163 -0
  92. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  93. package/dist/shared/components/pipeline/PipelineEditorView.js +320 -299
  94. package/dist/shared/components/profile/AgentNameField.js +107 -81
  95. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  96. package/dist/shared/components/profile/PersonAccess.js +599 -495
  97. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  98. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  99. package/dist/shared/components/profile/primitives.js +1 -1
  100. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  101. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  102. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  103. package/dist/shared/components/support/AssignRules.js +1733 -0
  104. package/dist/shared/components/support/PersonPick.js +88 -0
  105. package/dist/shared/components/support/RequestList.js +790 -0
  106. package/dist/shared/components/support/ScreenShare.js +158 -152
  107. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  108. package/dist/shared/components/support/SupportView.js +140 -246
  109. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  110. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  111. package/dist/shared/components/support/assign-rules-text.js +171 -0
  112. package/dist/shared/components/support/support-list.js +125 -0
  113. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  114. package/dist/shared/components/ui/checkbox.js +6 -6
  115. package/dist/shared/components/ui/select.js +43 -39
  116. package/dist/shared/components/ui/sheet.js +9 -9
  117. package/dist/shared/components/ui/switch.js +12 -11
  118. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  119. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  120. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  121. package/dist/shared/lib/activity-sentence.js +103 -91
  122. package/dist/shared/lib/agent-presence.js +27 -21
  123. package/dist/shared/lib/approval-progress.js +2 -2
  124. package/dist/shared/lib/copy-rules.js +31 -24
  125. package/dist/shared/lib/derived-causes.js +113 -78
  126. package/dist/shared/lib/grid-cursors.js +26 -26
  127. package/dist/shared/lib/label-flash.js +27 -0
  128. package/dist/shared/lib/list-return.js +137 -125
  129. package/dist/shared/lib/live-deltas.js +40 -34
  130. package/dist/shared/lib/live-groups.js +56 -52
  131. package/dist/shared/lib/live-preference.js +64 -59
  132. package/dist/shared/lib/live-screen.js +223 -192
  133. package/dist/shared/lib/partner-failure.js +11 -11
  134. package/dist/shared/lib/rollup-recalc.js +68 -64
  135. package/dist/shared/lib/screen-refresh.js +74 -68
  136. package/dist/shared/lib/screen-share.js +108 -104
  137. package/dist/shared/lib/send-status.js +77 -61
  138. package/dist/shared/lib/text-diff-window.js +29 -0
  139. package/dist/shared/lib/use-query-entry.js +17 -0
  140. package/dist/shared/lib/watch-list.js +210 -209
  141. package/dist/shared/lib/widget-image-render.js +72 -49
  142. package/package.json +1 -1
@@ -1,25 +1,25 @@
1
- import { jsxs as a, jsx as e, Fragment as R } from "react/jsx-runtime";
2
- import { useQuery as D, useQueryClient as E, useMutation as K } from "@tanstack/react-query";
3
- import { ChevronRight as Q, GitPullRequestArrow as T, Loader2 as y, Check as W, AlertTriangle as $, ArrowRight as j } from "lucide-react";
1
+ import { jsxs as r, jsx as e, Fragment as C } from "react/jsx-runtime";
2
+ import { useQuery as D, useQueryClient as W, useMutation as E } from "@tanstack/react-query";
3
+ import { ChevronRight as K, GitPullRequestArrow as Q, Loader2 as v, Check as T, ArrowRight as $, AlertTriangle as j } from "lucide-react";
4
4
  import { useState as f } from "react";
5
5
  import { toast as w } from "sonner";
6
- import { useNivaroClient as C } from "../../context.js";
6
+ import { useNivaroClient as P } from "../../context.js";
7
7
  import { get as F, post as L } from "../../lib/commands.js";
8
- import { describeError as O } from "../../lib/error-message.js";
9
- import { toastError as M } from "../../lib/error-toast.js";
8
+ import { describeError as M } from "../../lib/error-message.js";
9
+ import { toastError as O } from "../../lib/error-toast.js";
10
10
  import { noteOwnWrite as U } from "../../lib/own-writes.js";
11
11
  import { invalidateRecordRow as B } from "../../lib/record-loader.js";
12
- import { cn as N, formatRelative as P } from "../../lib/utils.js";
13
- import { ProposalValue as v } from "./ProposalValue.js";
14
- import { proposalsQueryKey as q } from "./types.js";
15
- function G(t, r, o) {
16
- const i = C();
12
+ import { cn as N, formatRelative as q } from "../../lib/utils.js";
13
+ import { ProposalValue as k } from "./ProposalValue.js";
14
+ import { proposalsQueryKey as S } from "./types.js";
15
+ function G(a, d, c) {
16
+ const i = P();
17
17
  return D({
18
- queryKey: q(t, r ?? ""),
18
+ queryKey: S(a, d ?? ""),
19
19
  queryFn: () => i.request(
20
- F(`/change-proposals/record/${t}/${encodeURIComponent(String(r))}`)
21
- ).then((n) => n.data).catch(() => null),
22
- enabled: o && !!r,
20
+ F(`/change-proposals/record/${a}/${encodeURIComponent(String(d))}`)
21
+ ).then((l) => l.data).catch(() => null),
22
+ enabled: c && !!d,
23
23
  staleTime: 15e3
24
24
  });
25
25
  }
@@ -31,124 +31,139 @@ const _ = {
31
31
  declined: { text: "Declined", cls: "bg-rose-500/10 text-rose-700 dark:text-rose-300" },
32
32
  withdrawn: { text: "Withdrawn", cls: "bg-slate-500/10 text-slate-600 dark:text-slate-400" }
33
33
  };
34
- function S({ p: t }) {
35
- return /* @__PURE__ */ a("div", { className: "overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
36
- /* @__PURE__ */ a("table", { className: "w-full table-fixed text-[12.5px]", children: [
37
- /* @__PURE__ */ e("thead", { className: "bg-slate-50 text-left text-[11px] font-medium uppercase tracking-wide text-slate-500 dark:bg-muted/40 dark:text-muted-foreground", children: /* @__PURE__ */ a("tr", { children: [
34
+ function A({ p: a }) {
35
+ const d = a.status === "pending" || a.status === "accepting", c = d ? "Now" : "Before", i = (t) => {
36
+ const o = t.stale && "now" in t ? t.now : t.from;
37
+ return /* @__PURE__ */ r(C, { children: [
38
+ /* @__PURE__ */ e(
39
+ "span",
40
+ {
41
+ className: N(!d && "line-through decoration-slate-300 dark:decoration-slate-600"),
42
+ children: /* @__PURE__ */ e(k, { value: o, kind: t.kind, relation: t.relation, choices: t.choices })
43
+ }
44
+ ),
45
+ t.stale && /* @__PURE__ */ r("span", { className: "mt-0.5 block text-[11px] text-amber-700 dark:text-amber-400", children: [
46
+ "Was",
47
+ " ",
48
+ /* @__PURE__ */ e(k, { value: t.from, kind: t.kind, relation: t.relation, choices: t.choices }),
49
+ " ",
50
+ "when proposed"
51
+ ] })
52
+ ] });
53
+ }, l = (t) => t.stale && /* @__PURE__ */ r(
54
+ "span",
55
+ {
56
+ className: "mt-0.5 flex items-center gap-1 text-[11px] font-normal text-amber-700 dark:text-amber-400",
57
+ "data-tip": "Someone changed this field after the proposal was made",
58
+ children: [
59
+ /* @__PURE__ */ e(j, { className: "h-3 w-3", "aria-hidden": !0 }),
60
+ " Changed since"
61
+ ]
62
+ }
63
+ ), m = (t) => /* @__PURE__ */ e(k, { value: t.to, kind: t.kind, relation: t.relation, choices: t.choices });
64
+ return /* @__PURE__ */ r("div", { className: "overflow-hidden rounded-md border border-slate-200 dark:border-border", children: [
65
+ /* @__PURE__ */ r("table", { className: "hidden w-full table-fixed text-[12.5px] sm:table", children: [
66
+ /* @__PURE__ */ e("thead", { className: "bg-slate-50 text-left text-[11px] font-medium uppercase tracking-wide text-slate-500 dark:bg-muted/40 dark:text-muted-foreground", children: /* @__PURE__ */ r("tr", { children: [
38
67
  /* @__PURE__ */ e("th", { className: "w-[30%] px-3 py-1.5 font-medium", children: "Field" }),
39
- /* @__PURE__ */ e("th", { className: "w-[30%] px-3 py-1.5 font-medium", children: "Before" }),
68
+ /* @__PURE__ */ e("th", { className: "w-[30%] px-3 py-1.5 font-medium", children: c }),
40
69
  /* @__PURE__ */ e("th", { className: "w-5", "aria-hidden": !0 }),
41
70
  /* @__PURE__ */ e("th", { className: "px-3 py-1.5 font-medium", children: "Proposed" })
42
71
  ] }) }),
43
- /* @__PURE__ */ e("tbody", { className: "divide-y divide-slate-100 dark:divide-border", children: t.changes.map((r) => /* @__PURE__ */ a("tr", { "data-proposal-change": r.field, className: "align-top", children: [
44
- /* @__PURE__ */ a("td", { className: "px-3 py-2 font-medium text-slate-700 dark:text-slate-200", children: [
45
- /* @__PURE__ */ e("span", { className: "break-words", children: r.label }),
46
- r.stale && /* @__PURE__ */ a(
47
- "span",
48
- {
49
- className: "mt-0.5 flex items-center gap-1 text-[11px] font-normal text-amber-700 dark:text-amber-400",
50
- "data-tip": "Someone changed this field after the proposal was made",
51
- children: [
52
- /* @__PURE__ */ e($, { className: "h-3 w-3" }),
53
- " Changed since"
54
- ]
55
- }
56
- )
72
+ /* @__PURE__ */ e("tbody", { className: "divide-y divide-slate-100 dark:divide-border", children: a.changes.map((t) => /* @__PURE__ */ r("tr", { "data-proposal-change": t.field, className: "align-top", children: [
73
+ /* @__PURE__ */ r("td", { className: "px-3 py-2 font-medium text-slate-700 dark:text-slate-200", children: [
74
+ /* @__PURE__ */ e("span", { className: "break-words", children: t.label }),
75
+ l(t)
57
76
  ] }),
58
- /* @__PURE__ */ e("td", { className: "px-3 py-2 text-slate-500 line-through decoration-slate-300 dark:text-slate-400 dark:decoration-slate-600", children: /* @__PURE__ */ e(
59
- v,
60
- {
61
- value: r.from,
62
- kind: r.kind,
63
- relation: r.relation,
64
- choices: r.choices
65
- }
66
- ) }),
67
- /* @__PURE__ */ e("td", { className: "py-2 text-slate-400", "aria-hidden": !0, children: /* @__PURE__ */ e(j, { className: "mt-0.5 h-3.5 w-3.5" }) }),
68
- /* @__PURE__ */ e("td", { className: "px-3 py-2 font-medium text-slate-900 dark:text-slate-50", children: /* @__PURE__ */ e(
69
- v,
70
- {
71
- value: r.to,
72
- kind: r.kind,
73
- relation: r.relation,
74
- choices: r.choices
75
- }
76
- ) })
77
- ] }, r.field)) })
77
+ /* @__PURE__ */ e("td", { className: "px-3 py-2 text-slate-600 dark:text-slate-400", children: i(t) }),
78
+ /* @__PURE__ */ e("td", { className: "py-2 text-slate-400", "aria-hidden": !0, children: /* @__PURE__ */ e($, { className: "mt-0.5 h-3.5 w-3.5" }) }),
79
+ /* @__PURE__ */ e("td", { className: "px-3 py-2 font-medium text-slate-900 dark:text-slate-50", children: m(t) })
80
+ ] }, t.field)) })
78
81
  ] }),
79
- t.hidden_fields > 0 && /* @__PURE__ */ a("p", { className: "border-t border-slate-100 px-3 py-1.5 text-[11.5px] text-slate-500 dark:border-border dark:text-muted-foreground", children: [
80
- t.hidden_fields === 1 ? "One more field" : `${t.hidden_fields} more fields`,
82
+ /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 text-[12.5px] sm:hidden dark:divide-border", children: a.changes.map((t) => /* @__PURE__ */ r("li", { "data-proposal-change-stacked": t.field, className: "px-3 py-2.5", children: [
83
+ /* @__PURE__ */ r("p", { className: "font-medium text-slate-800 dark:text-slate-100", children: [
84
+ /* @__PURE__ */ e("span", { className: "break-words", children: t.label }),
85
+ l(t)
86
+ ] }),
87
+ /* @__PURE__ */ r("dl", { className: "mt-1.5 grid grid-cols-[auto_minmax(0,1fr)] gap-x-3 gap-y-1", children: [
88
+ /* @__PURE__ */ e("dt", { className: "text-[11px] font-medium uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: c }),
89
+ /* @__PURE__ */ e("dd", { className: "min-w-0 text-slate-600 dark:text-slate-400", children: i(t) }),
90
+ /* @__PURE__ */ e("dt", { className: "text-[11px] font-medium uppercase tracking-wide text-slate-500 dark:text-muted-foreground", children: "Proposed" }),
91
+ /* @__PURE__ */ e("dd", { className: "min-w-0 font-medium text-slate-900 dark:text-slate-50", children: m(t) })
92
+ ] })
93
+ ] }, t.field)) }),
94
+ a.hidden_fields > 0 && /* @__PURE__ */ r("p", { className: "border-t border-slate-100 px-3 py-1.5 text-[11.5px] text-slate-500 dark:border-border dark:text-muted-foreground", children: [
95
+ a.hidden_fields === 1 ? "One more field" : `${a.hidden_fields} more fields`,
81
96
  " you can’t see."
82
97
  ] })
83
98
  ] });
84
99
  }
85
- function V({
86
- p: t,
87
- collection: r,
88
- item: o
100
+ function H({
101
+ p: a,
102
+ collection: d,
103
+ item: c
89
104
  }) {
90
- const i = C(), n = E(), [u, m] = f(!1), [l, s] = f(""), [p, b] = f(null), k = () => {
91
- n.invalidateQueries({ queryKey: q(r, o) }), n.invalidateQueries({ queryKey: ["my-work"] });
92
- }, x = K({
93
- onMutate: (d) => {
94
- d.kind === "accept" && U(
95
- r,
96
- o,
105
+ const i = P(), l = W(), [m, t] = f(!1), [o, s] = f(""), [h, b] = f(null), y = () => {
106
+ l.invalidateQueries({ queryKey: S(d, c) }), l.invalidateQueries({ queryKey: ["my-work"] });
107
+ }, u = E({
108
+ onMutate: (n) => {
109
+ n.kind === "accept" && U(
110
+ d,
111
+ c,
97
112
  void 0,
98
- t.changes.map((h) => h.field)
113
+ a.changes.map((x) => x.field)
99
114
  );
100
115
  },
101
- mutationFn: (d) => i.request(
102
- L(`/change-proposals/${t.id}/${d.kind}`, d.kind === "decline" ? { note: d.note } : {})
116
+ mutationFn: (n) => i.request(
117
+ L(`/change-proposals/${a.id}/${n.kind}`, n.kind === "decline" ? { note: n.note } : {})
103
118
  ),
104
- onSuccess: (d, h) => {
105
- k(), h.kind === "accept" ? (n.invalidateQueries({ queryKey: ["item", r] }), n.invalidateQueries({ queryKey: ["comments-related", r] }), B(n, r, o), w.success("Accepted — the new values are on the record.")) : h.kind === "decline" ? w.success("Declined — the proposer has been told.") : w.success("Proposal withdrawn.");
119
+ onSuccess: (n, x) => {
120
+ y(), x.kind === "accept" ? (l.invalidateQueries({ queryKey: ["item", d] }), l.invalidateQueries({ queryKey: ["comments-related", d] }), B(l, d, c), w.success("Accepted — the new values are on the record.")) : x.kind === "decline" ? w.success("Declined — the proposer has been told.") : w.success("Proposal withdrawn.");
106
121
  },
107
- onError: (d, h) => {
108
- const A = O(d, "Could not do that");
109
- h.kind === "decline" ? b(A.title) : M(d, "Could not do that"), k();
122
+ onError: (n, x) => {
123
+ const R = M(n, "Could not do that");
124
+ x.kind === "decline" ? b(R.title) : O(n, "Could not do that"), y();
110
125
  }
111
- }), c = x.isPending, g = t.changes.some((d) => d.stale);
112
- return /* @__PURE__ */ a(
126
+ }), p = u.isPending, g = a.changes.some((n) => n.stale);
127
+ return /* @__PURE__ */ r(
113
128
  "div",
114
129
  {
115
- "data-change-proposal": t.id,
130
+ "data-change-proposal": a.id,
116
131
  className: "rounded-lg border border-nvr-cyan/30 bg-white p-4 shadow-sm dark:border-nvr-cyan/25 dark:bg-card",
117
132
  children: [
118
- /* @__PURE__ */ a("div", { className: "mb-2 flex flex-wrap items-start justify-between gap-x-3 gap-y-1", children: [
119
- /* @__PURE__ */ a("div", { className: "flex min-w-0 items-center gap-2", children: [
120
- /* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/10 text-[#0e7490] dark:text-[#67e8f9]", children: /* @__PURE__ */ e(T, { className: "h-3.5 w-3.5" }) }),
121
- /* @__PURE__ */ a("div", { className: "min-w-0", children: [
133
+ /* @__PURE__ */ r("div", { className: "mb-2 flex flex-wrap items-start justify-between gap-x-3 gap-y-1", children: [
134
+ /* @__PURE__ */ r("div", { className: "flex min-w-0 items-center gap-2", children: [
135
+ /* @__PURE__ */ e("span", { className: "flex h-6 w-6 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/10 text-[#0e7490] dark:text-[#67e8f9]", children: /* @__PURE__ */ e(Q, { className: "h-3.5 w-3.5" }) }),
136
+ /* @__PURE__ */ r("div", { className: "min-w-0", children: [
122
137
  /* @__PURE__ */ e("p", { className: "text-[13px] font-semibold text-slate-900 dark:text-slate-50", children: "Proposed change" }),
123
- /* @__PURE__ */ a("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
124
- t.created_by_name ?? "Someone",
138
+ /* @__PURE__ */ r("p", { className: "text-[11.5px] text-slate-500 dark:text-muted-foreground", children: [
139
+ a.created_by_name ?? "Someone",
125
140
  " · ",
126
- P(t.created_at)
141
+ q(a.created_at)
127
142
  ] })
128
143
  ] })
129
144
  ] }),
130
145
  /* @__PURE__ */ e("span", { className: "rounded-full bg-amber-400/15 px-2 py-0.5 text-[11px] font-medium text-amber-800 dark:text-amber-300", children: "Waiting for a decision" })
131
146
  ] }),
132
- /* @__PURE__ */ a("p", { className: "mb-3 max-w-[75ch] text-[12.5px] leading-relaxed text-slate-700 dark:text-slate-300", children: [
147
+ /* @__PURE__ */ r("p", { className: "mb-3 max-w-[75ch] text-[12.5px] leading-relaxed text-slate-700 dark:text-slate-300", children: [
133
148
  /* @__PURE__ */ e("span", { className: "mr-1.5 font-medium text-slate-500 dark:text-slate-400", children: "Why:" }),
134
- t.reason
149
+ a.reason
135
150
  ] }),
136
- /* @__PURE__ */ e(S, { p: t }),
137
- (t.can_decide || t.can_withdraw) && /* @__PURE__ */ e("div", { className: "mt-3 space-y-2", children: u ? /* @__PURE__ */ a(
151
+ /* @__PURE__ */ e(A, { p: a }),
152
+ (a.can_decide || a.can_withdraw) && /* @__PURE__ */ e("div", { className: "mt-3 space-y-2", children: m ? /* @__PURE__ */ r(
138
153
  "form",
139
154
  {
140
155
  className: "space-y-2",
141
- onSubmit: (d) => {
142
- d.preventDefault(), !(l.trim().length < 3 || c) && (b(null), x.mutate({ kind: "decline", note: l.trim() }));
156
+ onSubmit: (n) => {
157
+ n.preventDefault(), !(o.trim().length < 3 || p) && (b(null), u.mutate({ kind: "decline", note: o.trim() }));
143
158
  },
144
159
  children: [
145
- /* @__PURE__ */ a("label", { className: "block", children: [
160
+ /* @__PURE__ */ r("label", { className: "block", children: [
146
161
  /* @__PURE__ */ e("span", { className: "mb-1 block text-[12px] font-medium text-slate-700 dark:text-slate-200", children: "Why are you declining it? The proposer sees this." }),
147
162
  /* @__PURE__ */ e(
148
163
  "textarea",
149
164
  {
150
- value: l,
151
- onChange: (d) => s(d.target.value),
165
+ value: o,
166
+ onChange: (n) => s(n.target.value),
152
167
  rows: 2,
153
168
  maxLength: 2e3,
154
169
  "data-proposal-decline-note": !0,
@@ -156,17 +171,17 @@ function V({
156
171
  }
157
172
  )
158
173
  ] }),
159
- p && /* @__PURE__ */ e("p", { role: "alert", className: "text-[12px] text-rose-700 dark:text-rose-300", children: p }),
160
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
161
- /* @__PURE__ */ a(
174
+ h && /* @__PURE__ */ e("p", { role: "alert", className: "text-[12px] text-rose-700 dark:text-rose-300", children: h }),
175
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
176
+ /* @__PURE__ */ r(
162
177
  "button",
163
178
  {
164
179
  type: "submit",
165
- disabled: l.trim().length < 3 || c,
180
+ disabled: o.trim().length < 3 || p,
166
181
  "data-proposal-decline-confirm": !0,
167
182
  className: "inline-flex h-8 items-center gap-1.5 rounded-md bg-rose-600 px-3 text-[12.5px] font-semibold text-white shadow-sm transition-opacity hover:bg-rose-700 disabled:opacity-50",
168
183
  children: [
169
- c && /* @__PURE__ */ e(y, { className: "h-3.5 w-3.5 animate-spin" }),
184
+ p && /* @__PURE__ */ e(v, { className: "h-3.5 w-3.5 animate-spin" }),
170
185
  "Decline proposal"
171
186
  ]
172
187
  }
@@ -176,7 +191,7 @@ function V({
176
191
  {
177
192
  type: "button",
178
193
  onClick: () => {
179
- m(!1), b(null);
194
+ t(!1), b(null);
180
195
  },
181
196
  className: "h-8 rounded-md px-3 text-[12.5px] font-medium text-slate-600 hover:bg-muted dark:text-slate-300",
182
197
  children: "Keep it"
@@ -185,19 +200,19 @@ function V({
185
200
  ] })
186
201
  ]
187
202
  }
188
- ) : /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2", children: [
189
- t.can_decide && /* @__PURE__ */ a(R, { children: [
190
- /* @__PURE__ */ a(
203
+ ) : /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2", children: [
204
+ a.can_decide && /* @__PURE__ */ r(C, { children: [
205
+ /* @__PURE__ */ r(
191
206
  "button",
192
207
  {
193
208
  type: "button",
194
- disabled: c || g,
209
+ disabled: p || g,
195
210
  "data-tip": g ? "A field changed since this was proposed — decline it and ask for a new one" : void 0,
196
- onClick: () => x.mutate({ kind: "accept" }),
211
+ onClick: () => u.mutate({ kind: "accept" }),
197
212
  "data-proposal-accept": !0,
198
213
  className: "inline-flex h-8 items-center gap-1.5 rounded-md bg-nvr-cyan px-3 text-[12.5px] font-semibold text-white shadow-sm transition-opacity disabled:opacity-50",
199
214
  children: [
200
- c ? /* @__PURE__ */ e(y, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(W, { className: "h-3.5 w-3.5" }),
215
+ p ? /* @__PURE__ */ e(v, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ e(T, { className: "h-3.5 w-3.5" }),
201
216
  "Accept and apply"
202
217
  ]
203
218
  }
@@ -206,27 +221,27 @@ function V({
206
221
  "button",
207
222
  {
208
223
  type: "button",
209
- disabled: c,
210
- onClick: () => m(!0),
224
+ disabled: p,
225
+ onClick: () => t(!0),
211
226
  "data-proposal-decline": !0,
212
227
  className: "inline-flex h-8 items-center rounded-md border border-input bg-background px-3 text-[12.5px] font-medium text-slate-700 shadow-sm transition-colors hover:bg-muted disabled:opacity-50 dark:text-slate-200",
213
228
  children: "Decline"
214
229
  }
215
230
  )
216
231
  ] }),
217
- t.can_withdraw && /* @__PURE__ */ e(
232
+ a.can_withdraw && /* @__PURE__ */ e(
218
233
  "button",
219
234
  {
220
235
  type: "button",
221
- disabled: c,
222
- onClick: () => x.mutate({ kind: "withdraw" }),
236
+ disabled: p,
237
+ onClick: () => u.mutate({ kind: "withdraw" }),
223
238
  "data-proposal-withdraw": !0,
224
239
  className: "inline-flex h-8 items-center rounded-md border border-input bg-background px-3 text-[12.5px] font-medium text-slate-700 shadow-sm transition-colors hover:bg-muted disabled:opacity-50 dark:text-slate-200",
225
240
  children: "Withdraw"
226
241
  }
227
242
  )
228
243
  ] }) }),
229
- t.can_decide && g && !u && /* @__PURE__ */ e(
244
+ a.can_decide && g && !m && /* @__PURE__ */ e(
230
245
  "p",
231
246
  {
232
247
  className: "mt-2 text-[11.5px] text-amber-700 dark:text-amber-400",
@@ -234,79 +249,79 @@ function V({
234
249
  children: "A field changed after this was proposed, so it can’t be applied as it stands. Decline it and ask for a new proposal."
235
250
  }
236
251
  ),
237
- !t.can_decide && !t.can_withdraw && t.decide_reason && /* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: t.decide_reason }),
238
- t.can_withdraw && t.decide_reason && /* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "The owners of this step will accept or decline it — you’ll get a notification." })
252
+ !a.can_decide && !a.can_withdraw && a.decide_reason && /* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: a.decide_reason }),
253
+ a.can_withdraw && a.decide_reason && /* @__PURE__ */ e("p", { className: "mt-2 text-[11.5px] text-slate-500 dark:text-muted-foreground", children: "The owners of this step will accept or decline it — you’ll get a notification." })
239
254
  ]
240
255
  }
241
256
  );
242
257
  }
243
- function ie({
244
- collection: t,
245
- itemId: r,
246
- enabled: o
258
+ function le({
259
+ collection: a,
260
+ itemId: d,
261
+ enabled: c
247
262
  }) {
248
- const { data: i } = G(t, r, o), [n, u] = f(!1);
249
- if (!(i != null && i.enabled) || !r) return null;
250
- const m = i.proposals.filter((s) => s.status === "pending" || s.status === "accepting"), l = i.proposals.filter((s) => !m.includes(s));
251
- return m.length === 0 && l.length === 0 ? null : /* @__PURE__ */ a(
263
+ const { data: i } = G(a, d, c), [l, m] = f(!1);
264
+ if (!(i != null && i.enabled) || !d) return null;
265
+ const t = i.proposals.filter((s) => s.status === "pending" || s.status === "accepting"), o = i.proposals.filter((s) => !t.includes(s));
266
+ return t.length === 0 && o.length === 0 ? null : /* @__PURE__ */ r(
252
267
  "section",
253
268
  {
254
269
  className: "nvr-expand-in space-y-2",
255
270
  "data-change-proposals": !0,
256
271
  "aria-label": "Proposed changes",
257
272
  children: [
258
- m.map((s) => /* @__PURE__ */ e(V, { p: s, collection: t, item: r }, s.id)),
259
- l.length > 0 && /* @__PURE__ */ a("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
260
- /* @__PURE__ */ a(
273
+ t.map((s) => /* @__PURE__ */ e(H, { p: s, collection: a, item: d }, s.id)),
274
+ o.length > 0 && /* @__PURE__ */ r("div", { className: "rounded-lg border border-slate-200 bg-white dark:border-border dark:bg-card", children: [
275
+ /* @__PURE__ */ r(
261
276
  "button",
262
277
  {
263
278
  type: "button",
264
- onClick: () => u((s) => !s),
265
- "aria-expanded": n,
279
+ onClick: () => m((s) => !s),
280
+ "aria-expanded": l,
266
281
  className: "flex w-full items-center gap-1.5 px-4 py-2 text-left text-[12.5px] font-medium text-slate-600 hover:bg-muted dark:text-slate-300",
267
282
  children: [
268
283
  /* @__PURE__ */ e(
269
- Q,
284
+ K,
270
285
  {
271
- className: N("h-3.5 w-3.5 transition-transform", n && "rotate-90")
286
+ className: N("h-3.5 w-3.5 transition-transform", l && "rotate-90")
272
287
  }
273
288
  ),
274
289
  "Earlier proposals (",
275
- l.length,
290
+ o.length,
276
291
  ")"
277
292
  ]
278
293
  }
279
294
  ),
280
- n && /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 border-t border-slate-100 dark:divide-border dark:border-border", children: l.map((s) => {
281
- const p = _[s.status] ?? _.withdrawn;
282
- return /* @__PURE__ */ a("li", { className: "space-y-2 px-4 py-3", "data-change-proposal": s.id, children: [
283
- /* @__PURE__ */ a("div", { className: "flex flex-wrap items-center gap-2 text-[12px]", children: [
295
+ l && /* @__PURE__ */ e("ul", { className: "divide-y divide-slate-100 border-t border-slate-100 dark:divide-border dark:border-border", children: o.map((s) => {
296
+ const h = _[s.status] ?? _.withdrawn;
297
+ return /* @__PURE__ */ r("li", { className: "space-y-2 px-4 py-3", "data-change-proposal": s.id, children: [
298
+ /* @__PURE__ */ r("div", { className: "flex flex-wrap items-center gap-2 text-[12px]", children: [
284
299
  /* @__PURE__ */ e(
285
300
  "span",
286
301
  {
287
- className: N("rounded-full px-2 py-0.5 text-[11px] font-medium", p.cls),
288
- children: p.text
302
+ className: N("rounded-full px-2 py-0.5 text-[11px] font-medium", h.cls),
303
+ children: h.text
289
304
  }
290
305
  ),
291
- /* @__PURE__ */ a("span", { className: "text-slate-600 dark:text-slate-300", children: [
306
+ /* @__PURE__ */ r("span", { className: "text-slate-600 dark:text-slate-300", children: [
292
307
  s.created_by_name ?? "Someone",
293
308
  " proposed · ",
294
- P(s.created_at)
309
+ q(s.created_at)
295
310
  ] }),
296
- s.decided_by_name && s.status !== "withdrawn" && /* @__PURE__ */ a("span", { className: "text-slate-500 dark:text-muted-foreground", children: [
311
+ s.decided_by_name && s.status !== "withdrawn" && /* @__PURE__ */ r("span", { className: "text-slate-500 dark:text-muted-foreground", children: [
297
312
  "· ",
298
- p.text.toLowerCase(),
313
+ h.text.toLowerCase(),
299
314
  " by ",
300
315
  s.decided_by_name
301
316
  ] })
302
317
  ] }),
303
318
  /* @__PURE__ */ e("p", { className: "text-[12px] text-slate-600 dark:text-slate-400", children: s.reason }),
304
- s.decision_note && /* @__PURE__ */ a("p", { className: "text-[12px] text-slate-600 dark:text-slate-400", children: [
319
+ s.decision_note && /* @__PURE__ */ r("p", { className: "text-[12px] text-slate-600 dark:text-slate-400", children: [
305
320
  /* @__PURE__ */ e("span", { className: "font-medium", children: "Note:" }),
306
321
  " ",
307
322
  s.decision_note
308
323
  ] }),
309
- /* @__PURE__ */ e(S, { p: s })
324
+ /* @__PURE__ */ e(A, { p: s })
310
325
  ] }, s.id);
311
326
  }) })
312
327
  ] })
@@ -315,6 +330,6 @@ function ie({
315
330
  );
316
331
  }
317
332
  export {
318
- ie as ChangeProposalsPanel,
333
+ le as ChangeProposalsPanel,
319
334
  G as useRecordProposals
320
335
  };
@@ -1,16 +1,16 @@
1
- import { jsxs as n, Fragment as m, jsx as s } from "react/jsx-runtime";
1
+ import { jsxs as n, Fragment as u, jsx as s } from "react/jsx-runtime";
2
2
  import { GitPullRequestArrow as c } from "lucide-react";
3
- import { useState as l } from "react";
4
- import { useRecordProposals as u } from "./ChangeProposalsPanel.js";
5
- import { ProposeChangeDialog as h } from "./ProposeChangeDialog.js";
6
- function v({
3
+ import { useState as m } from "react";
4
+ import { useRecordProposals as d } from "./ChangeProposalsPanel.js";
5
+ import { ProposeChangeDialog as l } from "./ProposeChangeDialog.js";
6
+ function w({
7
7
  collection: o,
8
8
  itemId: t,
9
9
  enabled: a,
10
10
  recordLabel: p
11
11
  }) {
12
- const { data: e } = u(o, t, a), [i, r] = l(!1);
13
- return !(e != null && e.enabled) || !e.can_propose || !t ? null : /* @__PURE__ */ n(m, { children: [
12
+ const { data: e } = d(o, t, a), [i, r] = m(!1);
13
+ return !(e != null && e.enabled) || !e.can_propose || !t ? null : /* @__PURE__ */ n(u, { children: [
14
14
  /* @__PURE__ */ n(
15
15
  "button",
16
16
  {
@@ -18,15 +18,21 @@ function v({
18
18
  "data-tip": "Suggest new values — the owners of this step accept or decline them",
19
19
  "data-propose-change-button": !0,
20
20
  onClick: () => r(!0),
21
- className: "inline-flex h-9 shrink-0 items-center gap-1.5 rounded-md border border-nvr-cyan/50 bg-nvr-cyan/10 px-3 text-sm font-medium text-[#0e7490] shadow-sm transition-colors hover:bg-nvr-cyan/20 dark:text-[#67e8f9]",
21
+ className: "inline-flex h-9 shrink-0 items-center gap-1.5 rounded-md border border-input bg-background px-3 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground",
22
22
  children: [
23
- /* @__PURE__ */ s(c, { className: "h-3.5 w-3.5" }),
23
+ /* @__PURE__ */ s(
24
+ c,
25
+ {
26
+ className: "h-3.5 w-3.5 text-[#0e7490] dark:text-[#67e8f9]",
27
+ "aria-hidden": !0
28
+ }
29
+ ),
24
30
  "Propose change"
25
31
  ]
26
32
  }
27
33
  ),
28
34
  /* @__PURE__ */ s(
29
- h,
35
+ l,
30
36
  {
31
37
  open: i,
32
38
  onOpenChange: r,
@@ -40,5 +46,5 @@ function v({
40
46
  ] });
41
47
  }
42
48
  export {
43
- v as ProposeChangeButton
49
+ w as ProposeChangeButton
44
50
  };