@nivaro/react 0.3.117 → 0.3.119

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 (138) hide show
  1. package/dist/full.css +1 -1
  2. package/dist/hooks/useSessionRecorder.js +1 -1
  3. package/dist/index.d.ts +136 -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 +3757 -3695
  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 +4451 -4385
  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/ScreenRefreshButton.js +34 -32
  27. package/dist/shared/components/TipLayer.js +65 -58
  28. package/dist/shared/components/WidgetImageMenu.js +83 -43
  29. package/dist/shared/components/activity/RecordActivityStream.js +175 -173
  30. package/dist/shared/components/bulk/BulkSelectionNotices.js +142 -119
  31. package/dist/shared/components/change-proposals/ChangeProposalsPanel.js +158 -143
  32. package/dist/shared/components/change-proposals/ProposeChangeButton.js +17 -11
  33. package/dist/shared/components/change-proposals/ProposeChangeDialog.js +201 -173
  34. package/dist/shared/components/chat/ChatAnalyticsView.js +27 -27
  35. package/dist/shared/components/chat/HuddleAnalyticsTab.js +17 -17
  36. package/dist/shared/components/collections-directory/CollectionsToolbar.js +39 -41
  37. package/dist/shared/components/collections-directory/page-model.js +72 -67
  38. package/dist/shared/components/integrations/RecordIntegrationPreview.js +48 -56
  39. package/dist/shared/components/integrations/SendStatus.js +65 -59
  40. package/dist/shared/components/integrations/console/ReadyToSendView.js +275 -209
  41. package/dist/shared/components/integrations/console/SignalCard.js +237 -230
  42. package/dist/shared/components/item-edit/CatalogPickerField.js +227 -205
  43. package/dist/shared/components/item-edit/ChangedAfterApprovalBadge.js +135 -94
  44. package/dist/shared/components/item-edit/CloneDialog.js +191 -161
  45. package/dist/shared/components/item-edit/DerivedCauseNote.js +44 -30
  46. package/dist/shared/components/item-edit/DraftRecoveryBanner.js +153 -134
  47. package/dist/shared/components/item-edit/FieldComments.js +88 -85
  48. package/dist/shared/components/item-edit/FieldPointer.js +82 -67
  49. package/dist/shared/components/item-edit/FieldRow.js +106 -100
  50. package/dist/shared/components/item-edit/FieldSourceBadge.js +58 -56
  51. package/dist/shared/components/item-edit/FilePickerField.js +452 -387
  52. package/dist/shared/components/item-edit/HeaderSummaryChip.js +78 -56
  53. package/dist/shared/components/item-edit/HeaderTools.js +245 -141
  54. package/dist/shared/components/item-edit/InlineTableField.js +1242 -1218
  55. package/dist/shared/components/item-edit/ListNeighborNav.js +47 -50
  56. package/dist/shared/components/item-edit/LiveTraceSheet.js +15 -10
  57. package/dist/shared/components/item-edit/MembershipSetField.js +285 -254
  58. package/dist/shared/components/item-edit/OutboxReviewTray.js +155 -144
  59. package/dist/shared/components/item-edit/QueueReturnChip.js +15 -36
  60. package/dist/shared/components/item-edit/RecalcValue.js +57 -32
  61. package/dist/shared/components/item-edit/RecordHelpChip.js +15 -16
  62. package/dist/shared/components/item-edit/RecordLiveSync.js +283 -231
  63. package/dist/shared/components/item-edit/RelationCombobox.js +439 -393
  64. package/dist/shared/components/item-edit/RemoteChangeUi.js +292 -224
  65. package/dist/shared/components/item-edit/RemoteUploads.js +26 -20
  66. package/dist/shared/components/item-edit/RemovedLineNote.js +77 -67
  67. package/dist/shared/components/item-edit/RichTextEditorImpl.js +184 -179
  68. package/dist/shared/components/item-edit/ScheduledChangeChip.js +168 -134
  69. package/dist/shared/components/item-edit/SectionPresence.js +18 -10
  70. package/dist/shared/components/item-edit/SplitLinesButton.js +163 -139
  71. package/dist/shared/components/item-edit/UserChip.js +1 -1
  72. package/dist/shared/components/item-edit/addendum-view.js +6 -0
  73. package/dist/shared/components/item-edit/file-live.js +69 -54
  74. package/dist/shared/components/item-edit/layout-switch.js +98 -89
  75. package/dist/shared/components/item-edit/partner-needs.js +12 -12
  76. package/dist/shared/components/item-edit/removed-line.js +31 -25
  77. package/dist/shared/components/layout-editor/pickers/field-picker.js +151 -130
  78. package/dist/shared/components/list/ListViewers.js +46 -35
  79. package/dist/shared/components/notifications/NotificationCenterView.js +479 -437
  80. package/dist/shared/components/panels/AccessDeniedPanel.js +176 -101
  81. package/dist/shared/components/panels/AlertBanners.js +82 -72
  82. package/dist/shared/components/panels/BranchLanes.js +22 -22
  83. package/dist/shared/components/panels/CommentImages.js +123 -102
  84. package/dist/shared/components/panels/CommentPanel.js +186 -185
  85. package/dist/shared/components/panels/ExternalRequestsChip.js +111 -119
  86. package/dist/shared/components/panels/OwnerOpenedLine.js +31 -24
  87. package/dist/shared/components/panels/PipelinePanel.js +2037 -1885
  88. package/dist/shared/components/panels/ResubmissionDiff.js +163 -142
  89. package/dist/shared/components/pipeline/OwnerMatrixSheet.js +400 -288
  90. package/dist/shared/components/pipeline/PipelineEditorView.js +7 -2
  91. package/dist/shared/components/profile/AgentNameField.js +107 -81
  92. package/dist/shared/components/profile/AgentsPanel.js +184 -184
  93. package/dist/shared/components/profile/PersonAccess.js +599 -495
  94. package/dist/shared/components/profile/SignInTroubleshooter.js +160 -127
  95. package/dist/shared/components/profile/SignedInDevices.js +17 -17
  96. package/dist/shared/components/profile/primitives.js +1 -1
  97. package/dist/shared/components/queue/OwnerAvatars.js +91 -54
  98. package/dist/shared/components/queue/QueueTeamStrip.js +56 -46
  99. package/dist/shared/components/queue/QueueWorklist.js +1002 -983
  100. package/dist/shared/components/support/AssignRules.js +1733 -0
  101. package/dist/shared/components/support/PersonPick.js +88 -0
  102. package/dist/shared/components/support/RequestList.js +790 -0
  103. package/dist/shared/components/support/ScreenShare.js +158 -152
  104. package/dist/shared/components/support/SupportRequestDialog.js +50 -48
  105. package/dist/shared/components/support/SupportView.js +140 -246
  106. package/dist/shared/components/support/TicketDetailSheet.js +82 -75
  107. package/dist/shared/components/support/TicketSlowScreens.js +9 -9
  108. package/dist/shared/components/support/assign-rules-text.js +171 -0
  109. package/dist/shared/components/support/support-list.js +125 -0
  110. package/dist/shared/components/ui/SimpleSelect.js +28 -20
  111. package/dist/shared/components/ui/checkbox.js +6 -6
  112. package/dist/shared/components/ui/select.js +43 -39
  113. package/dist/shared/components/ui/sheet.js +9 -9
  114. package/dist/shared/components/ui/switch.js +12 -11
  115. package/dist/shared/components/watch-list/WatchDock.js +532 -459
  116. package/dist/shared/components/watch-list/WatchExtras.js +332 -286
  117. package/dist/shared/components/watch-list/WatchRows.js +164 -140
  118. package/dist/shared/lib/activity-sentence.js +103 -91
  119. package/dist/shared/lib/agent-presence.js +27 -21
  120. package/dist/shared/lib/approval-progress.js +2 -2
  121. package/dist/shared/lib/copy-rules.js +31 -24
  122. package/dist/shared/lib/derived-causes.js +113 -78
  123. package/dist/shared/lib/grid-cursors.js +26 -26
  124. package/dist/shared/lib/label-flash.js +27 -0
  125. package/dist/shared/lib/list-return.js +137 -125
  126. package/dist/shared/lib/live-deltas.js +40 -34
  127. package/dist/shared/lib/live-groups.js +56 -52
  128. package/dist/shared/lib/live-preference.js +64 -59
  129. package/dist/shared/lib/live-screen.js +223 -192
  130. package/dist/shared/lib/partner-failure.js +11 -11
  131. package/dist/shared/lib/rollup-recalc.js +68 -64
  132. package/dist/shared/lib/screen-refresh.js +74 -68
  133. package/dist/shared/lib/screen-share.js +108 -104
  134. package/dist/shared/lib/send-status.js +77 -61
  135. package/dist/shared/lib/text-diff-window.js +29 -0
  136. package/dist/shared/lib/watch-list.js +210 -209
  137. package/dist/shared/lib/widget-image-render.js +72 -49
  138. package/package.json +1 -1
@@ -1,233 +1,250 @@
1
- import { jsx as t, jsxs as l } from "react/jsx-runtime";
2
- import { useQueryClient as L, useMutation as Q } from "@tanstack/react-query";
3
- import { X as V, ArrowRight as Y, Plus as E, Loader2 as _ } from "lucide-react";
4
- import { useState as m, useRef as A, useMemo as F } from "react";
5
- import { toast as H } from "sonner";
6
- import { useNivaroClient as K } from "../../context.js";
7
- import { post as G } from "../../lib/commands.js";
8
- import { describeError as U } from "../../lib/error-message.js";
9
- import { cn as g } from "../../lib/utils.js";
10
- import { RelationPicker as W } from "../layout-editor/pickers/relation-picker.js";
11
- import { Command as X, CommandInput as z, CommandList as B, CommandEmpty as J, CommandGroup as Z, CommandItem as ee } from "../ui/command.js";
12
- import { Dialog as te, DialogContent as re, DialogHeader as ae, DialogTitle as ne, DialogDescription as le } from "../ui/dialog.js";
13
- import { Popover as oe, PopoverTrigger as se, PopoverContent as ie } from "../ui/popover.js";
14
- import { SimpleSelect as de } from "../ui/SimpleSelect.js";
15
- import { ProposalValue as ce } from "./ProposalValue.js";
16
- import { proposalsQueryKey as ue } from "./types.js";
17
- const u = "h-9 w-full min-w-0 rounded-md border border-input bg-background px-2.5 text-[13px] text-foreground shadow-sm outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-nvr-cyan focus-visible:ring-2 focus-visible:ring-nvr-cyan/25";
18
- function me({
19
- field: o,
20
- value: r,
1
+ import { jsx as a, jsxs as s } from "react/jsx-runtime";
2
+ import { useQueryClient as Q, useMutation as V } from "@tanstack/react-query";
3
+ import { X as Y, ArrowRight as _, Plus as E, Loader2 as F } from "lucide-react";
4
+ import { useState as m, useRef as H, useMemo as K } from "react";
5
+ import { toast as G } from "sonner";
6
+ import { useNivaroClient as U } from "../../context.js";
7
+ import { post as W } from "../../lib/commands.js";
8
+ import { describeError as X } from "../../lib/error-message.js";
9
+ import { cn as b } from "../../lib/utils.js";
10
+ import { RelationPicker as z } from "../layout-editor/pickers/relation-picker.js";
11
+ import { Command as B, CommandInput as J, CommandList as Z, CommandEmpty as ee, CommandGroup as te, CommandItem as re } from "../ui/command.js";
12
+ import { Dialog as ae, DialogContent as ne, DialogHeader as le, DialogTitle as oe, DialogDescription as se } from "../ui/dialog.js";
13
+ import { Input as I } from "../ui/input.js";
14
+ import { Popover as ie, PopoverTrigger as de, PopoverContent as ce } from "../ui/popover.js";
15
+ import { SimpleSelect as ue } from "../ui/SimpleSelect.js";
16
+ import { ProposalValue as me } from "./ProposalValue.js";
17
+ import { proposalsQueryKey as pe } from "./types.js";
18
+ const x = "h-9 w-full min-w-0 rounded-md border border-input bg-background px-2.5 text-[13px] text-foreground shadow-sm outline-none transition-colors placeholder:text-muted-foreground focus-visible:border-nvr-cyan focus-visible:ring-2 focus-visible:ring-nvr-cyan/25";
19
+ function he({
20
+ field: l,
21
+ value: t,
21
22
  onChange: n
22
23
  }) {
23
- const s = `New ${o.label}`;
24
- switch (o.kind) {
24
+ const o = `New ${l.label}`;
25
+ switch (l.kind) {
25
26
  case "relation":
26
- return o.relation ? /* @__PURE__ */ t(
27
- W,
27
+ return l.relation ? /* @__PURE__ */ a(
28
+ z,
28
29
  {
29
- relatedCollection: o.relation,
30
- value: r ?? null,
31
- onChange: (a) => n(a ?? null),
30
+ relatedCollection: l.relation,
31
+ value: t ?? null,
32
+ onChange: (r) => n(r ?? null),
32
33
  placeholder: "Pick a record…"
33
34
  }
34
35
  ) : null;
35
36
  case "boolean":
36
- return /* @__PURE__ */ t(
37
+ return /* @__PURE__ */ a(
37
38
  "fieldset",
38
39
  {
39
- "aria-label": s,
40
+ "aria-label": o,
40
41
  className: "m-0 inline-flex h-9 min-w-0 items-center rounded-md border border-input bg-background p-0.5 text-[12.5px] font-medium",
41
42
  children: [
42
43
  { v: !0, t: "Yes" },
43
44
  { v: !1, t: "No" }
44
- ].map((a) => /* @__PURE__ */ t(
45
+ ].map((r) => /* @__PURE__ */ a(
45
46
  "button",
46
47
  {
47
48
  type: "button",
48
- "aria-pressed": r === a.v,
49
- onClick: () => n(a.v),
50
- className: g(
49
+ "aria-pressed": t === r.v,
50
+ onClick: () => n(r.v),
51
+ className: b(
51
52
  "inline-flex h-full items-center rounded px-3 transition-colors",
52
- r === a.v ? "bg-nvr-cyan text-white" : "text-slate-600 hover:bg-muted dark:text-slate-300"
53
+ t === r.v ? "bg-nvr-cyan text-white" : "text-slate-600 hover:bg-muted dark:text-slate-300"
53
54
  ),
54
- children: a.t
55
+ children: r.t
55
56
  },
56
- a.t
57
+ r.t
57
58
  ))
58
59
  }
59
60
  );
60
61
  case "choice":
61
- return /* @__PURE__ */ t(
62
- de,
62
+ return /* @__PURE__ */ a(
63
+ ue,
63
64
  {
64
- ariaLabel: s,
65
- value: r == null ? "" : String(r),
66
- onChange: (a) => n(a === "" ? null : a),
65
+ ariaLabel: o,
66
+ value: t == null ? "" : String(t),
67
+ onChange: (r) => n(r === "" ? null : r),
67
68
  options: [
68
69
  { value: "", label: "No value" },
69
- ...(o.choices ?? []).map((a) => ({ value: String(a.value), label: a.text }))
70
+ ...(l.choices ?? []).map((r) => ({ value: String(r.value), label: r.text }))
70
71
  ],
71
72
  className: "w-full"
72
73
  }
73
74
  );
74
75
  case "textarea":
75
- return /* @__PURE__ */ t(
76
+ return /* @__PURE__ */ a(
76
77
  "textarea",
77
78
  {
78
- "aria-label": s,
79
- value: r == null ? "" : String(r),
80
- onChange: (a) => n(a.target.value),
79
+ "aria-label": o,
80
+ value: t == null ? "" : String(t),
81
+ onChange: (r) => n(r.target.value),
81
82
  rows: 3,
82
- className: g(u, "h-auto py-2 leading-snug")
83
+ className: b(x, "h-auto py-2 leading-snug")
83
84
  }
84
85
  );
85
86
  case "date":
86
- return /* @__PURE__ */ t(
87
- "input",
87
+ return /* @__PURE__ */ a(
88
+ I,
88
89
  {
89
90
  type: "date",
90
- "aria-label": s,
91
- value: r == null ? "" : String(r).slice(0, 10),
92
- onChange: (a) => n(a.target.value),
93
- className: u
91
+ "aria-label": o,
92
+ value: t == null ? "" : String(t).slice(0, 10),
93
+ onChange: (r) => n(r.target.value)
94
94
  }
95
95
  );
96
96
  case "datetime":
97
- return /* @__PURE__ */ t(
98
- "input",
97
+ return /* @__PURE__ */ a(
98
+ I,
99
99
  {
100
100
  type: "datetime-local",
101
- "aria-label": s,
102
- value: r == null ? "" : String(r).slice(0, 16),
103
- onChange: (a) => n(a.target.value),
104
- className: u
101
+ "aria-label": o,
102
+ value: t == null ? "" : String(t).slice(0, 16),
103
+ onChange: (r) => n(r.target.value)
105
104
  }
106
105
  );
107
106
  case "number":
108
- return /* @__PURE__ */ t(
107
+ return /* @__PURE__ */ a(
109
108
  "input",
110
109
  {
111
110
  inputMode: "decimal",
112
- "aria-label": s,
113
- value: r == null ? "" : String(r),
114
- onChange: (a) => n(a.target.value),
115
- className: g(u, "tabular-nums")
111
+ "aria-label": o,
112
+ value: t == null ? "" : String(t),
113
+ onChange: (r) => n(r.target.value),
114
+ className: b(x, "tabular-nums")
116
115
  }
117
116
  );
118
117
  default:
119
- return /* @__PURE__ */ t(
118
+ return /* @__PURE__ */ a(
120
119
  "input",
121
120
  {
122
- "aria-label": s,
123
- value: r == null ? "" : String(r),
124
- onChange: (a) => n(a.target.value),
125
- className: u
121
+ "aria-label": o,
122
+ value: t == null ? "" : String(t),
123
+ onChange: (r) => n(r.target.value),
124
+ className: x
126
125
  }
127
126
  );
128
127
  }
129
128
  }
130
- function pe(o) {
131
- const r = o.current;
132
- if (r == null) return o.kind === "boolean" ? null : "";
133
- if (o.kind === "date") return String(r).slice(0, 10);
134
- if (o.kind === "datetime") {
135
- const n = new Date(String(r));
129
+ function ge(l) {
130
+ const t = l.current;
131
+ if (t == null) return l.kind === "boolean" ? null : "";
132
+ if (l.kind === "date") return String(t).slice(0, 10);
133
+ if (l.kind === "datetime") {
134
+ const n = new Date(String(t));
136
135
  if (Number.isNaN(n.getTime())) return "";
137
- const s = (a) => String(a).padStart(2, "0");
138
- return `${n.getFullYear()}-${s(n.getMonth() + 1)}-${s(n.getDate())}T${s(n.getHours())}:${s(n.getMinutes())}`;
136
+ const o = (r) => String(r).padStart(2, "0");
137
+ return `${n.getFullYear()}-${o(n.getMonth() + 1)}-${o(n.getDate())}T${o(n.getHours())}:${o(n.getMinutes())}`;
138
+ }
139
+ return t;
140
+ }
141
+ function be(l, t) {
142
+ const n = l.current, o = (r) => r == null || r === "";
143
+ if (o(t) || o(n)) return o(t) && o(n);
144
+ if (l.kind === "date") return String(t).slice(0, 10) === String(n).slice(0, 10);
145
+ if (l.kind === "datetime") {
146
+ const r = new Date(String(t)).getTime(), c = new Date(String(n)).getTime();
147
+ return !Number.isNaN(r) && Math.floor(r / 6e4) === Math.floor(c / 6e4);
148
+ }
149
+ if (l.kind === "number") return Number(t) === Number(n);
150
+ if (l.kind === "boolean") {
151
+ const r = (c) => c === !0 || c === 1 || c === "1" || c === "true";
152
+ return r(t) === r(n);
139
153
  }
140
- return r;
154
+ return String(t).trim() === String(n).trim();
141
155
  }
142
- function he(o, r) {
143
- if (r == null || r === "") return null;
144
- if ((o == null ? void 0 : o.kind) === "datetime") {
145
- const n = new Date(String(r));
146
- return Number.isNaN(n.getTime()) ? r : n.toISOString();
156
+ function xe(l, t) {
157
+ if (t == null || t === "") return null;
158
+ if ((l == null ? void 0 : l.kind) === "datetime") {
159
+ const n = new Date(String(t));
160
+ return Number.isNaN(n.getTime()) ? t : n.toISOString();
147
161
  }
148
- return r;
162
+ return t;
149
163
  }
150
- function Ee({
151
- open: o,
152
- onOpenChange: r,
164
+ function Oe({
165
+ open: l,
166
+ onOpenChange: t,
153
167
  collection: n,
154
- item: s,
155
- recordLabel: a,
156
- step: S,
157
- fields: x
168
+ item: o,
169
+ recordLabel: r,
170
+ step: c,
171
+ fields: f
158
172
  }) {
159
- const M = K(), j = L(), [c, b] = m([]), [C, p] = m({}), [f, P] = m(""), [I, $] = m(!1), [D, N] = m(null), h = A(!1), v = F(() => new Map(x.map((e) => [e.field, e])), [x]), R = x.filter((e) => !c.includes(e.field)), y = () => {
160
- b([]), p({}), P(""), N(null), h.current = !1;
161
- }, O = (e) => {
162
- const i = v.get(e);
163
- i && (b((d) => d.includes(e) ? d : [...d, e]), p((d) => e in d ? d : { ...d, [e]: pe(i) }), $(!1));
164
- }, q = (e) => {
165
- b((i) => i.filter((d) => d !== e)), p((i) => {
166
- const { [e]: d, ...w } = i;
167
- return w;
173
+ const j = U(), O = Q(), [u, N] = m([]), [k, p] = m({}), [v, D] = m(""), [q, $] = m(!1), [T, w] = m(null), h = H(!1), g = K(() => new Map(f.map((e) => [e.field, e])), [f]), M = f.filter((e) => !u.includes(e.field)), y = () => {
174
+ N([]), p({}), D(""), w(null), h.current = !1;
175
+ }, A = (e) => {
176
+ const i = g.get(e);
177
+ i && (N((d) => d.includes(e) ? d : [...d, e]), p((d) => e in d ? d : { ...d, [e]: ge(i) }), $(!1));
178
+ }, L = (e) => {
179
+ N((i) => i.filter((d) => d !== e)), p((i) => {
180
+ const { [e]: d, ...P } = i;
181
+ return P;
168
182
  });
169
- }, k = Q({
170
- mutationFn: () => M.request(
171
- G(`/change-proposals/record/${n}/${encodeURIComponent(s)}`, {
172
- values: Object.fromEntries(c.map((e) => [e, he(v.get(e), C[e])])),
173
- reason: f.trim()
183
+ }, S = u.filter((e) => {
184
+ const i = g.get(e);
185
+ return !!i && !be(i, k[e]);
186
+ }), C = V({
187
+ mutationFn: () => j.request(
188
+ W(`/change-proposals/record/${n}/${encodeURIComponent(o)}`, {
189
+ values: Object.fromEntries(S.map((e) => [e, xe(g.get(e), k[e])])),
190
+ reason: v.trim()
174
191
  })
175
192
  ),
176
193
  onSuccess: () => {
177
- j.invalidateQueries({ queryKey: ue(n, s) }), H.success("Proposal sent — the step’s owners will review it."), y(), r(!1);
194
+ O.invalidateQueries({ queryKey: pe(n, o) }), G.success("Proposal sent — the step’s owners will review it."), y(), t(!1);
178
195
  },
179
196
  onError: (e) => {
180
- h.current = !1, N(U(e, "Could not send the proposal").title);
197
+ h.current = !1, w(X(e, "Could not send the proposal").title);
181
198
  }
182
- }), T = c.length > 0 && f.trim().length >= 3 && !k.isPending;
183
- return /* @__PURE__ */ t(
184
- te,
199
+ }), R = S.length > 0 && v.trim().length >= 3 && !C.isPending;
200
+ return /* @__PURE__ */ a(
201
+ ae,
185
202
  {
186
- open: o,
203
+ open: l,
187
204
  onOpenChange: (e) => {
188
- e || y(), r(e);
205
+ e || y(), t(e);
189
206
  },
190
- children: /* @__PURE__ */ l(re, { className: "max-w-2xl dark:bg-card", "data-propose-change": !0, children: [
191
- /* @__PURE__ */ l(ae, { className: "px-6 pt-5", children: [
192
- /* @__PURE__ */ l(ne, { className: "text-[15px] font-semibold text-slate-900 dark:text-slate-100", children: [
207
+ children: /* @__PURE__ */ s(ne, { className: "max-w-2xl dark:bg-card", "data-propose-change": !0, children: [
208
+ /* @__PURE__ */ s(le, { className: "px-6 pt-5", children: [
209
+ /* @__PURE__ */ s(oe, { className: "text-[15px] font-semibold text-slate-900 dark:text-slate-100", children: [
193
210
  "Propose a change",
194
- a ? ` · ${a}` : ""
211
+ r ? ` · ${r}` : ""
195
212
  ] }),
196
- /* @__PURE__ */ l(le, { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: [
197
- S ? `This record is at ${S}, so you can’t edit it directly. ` : "You can’t edit this record directly. ",
213
+ /* @__PURE__ */ s(se, { className: "text-[12.5px] text-slate-500 dark:text-muted-foreground", children: [
214
+ c ? `This record is at ${c}, so you can’t edit it directly. ` : "You can’t edit this record directly. ",
198
215
  "Enter the new values and say why — the owners of the step accept or decline them."
199
216
  ] })
200
217
  ] }),
201
- /* @__PURE__ */ l(
218
+ /* @__PURE__ */ s(
202
219
  "form",
203
220
  {
204
221
  className: "space-y-4 px-6 pb-5 pt-2",
205
222
  onSubmit: (e) => {
206
- e.preventDefault(), !(!T || h.current) && (h.current = !0, N(null), k.mutate());
223
+ e.preventDefault(), !(!R || h.current) && (h.current = !0, w(null), C.mutate());
207
224
  },
208
225
  children: [
209
- /* @__PURE__ */ l("div", { className: "space-y-2", "data-proposal-fields": !0, children: [
210
- c.length > 0 && /* @__PURE__ */ t("ul", { className: "divide-y divide-slate-100 rounded-md border border-slate-200 dark:divide-border dark:border-border", children: c.map((e) => {
211
- const i = v.get(e);
212
- return i ? /* @__PURE__ */ l("li", { "data-proposal-field": e, className: "px-3 py-2.5", children: [
213
- /* @__PURE__ */ l("div", { className: "mb-1.5 flex items-center justify-between gap-2", children: [
214
- /* @__PURE__ */ t("span", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: i.label }),
215
- /* @__PURE__ */ t(
226
+ /* @__PURE__ */ s("div", { className: "space-y-2", "data-proposal-fields": !0, children: [
227
+ u.length > 0 && /* @__PURE__ */ a("ul", { className: "divide-y divide-slate-100 rounded-md border border-slate-200 dark:divide-border dark:border-border", children: u.map((e) => {
228
+ const i = g.get(e);
229
+ return i ? /* @__PURE__ */ s("li", { "data-proposal-field": e, className: "px-3 py-2.5", children: [
230
+ /* @__PURE__ */ s("div", { className: "mb-1.5 flex items-center justify-between gap-2", children: [
231
+ /* @__PURE__ */ a("span", { className: "text-[12.5px] font-semibold text-slate-800 dark:text-slate-100", children: i.label }),
232
+ /* @__PURE__ */ a(
216
233
  "button",
217
234
  {
218
235
  type: "button",
219
236
  "aria-label": `Remove ${i.label}`,
220
- onClick: () => q(e),
237
+ onClick: () => L(e),
221
238
  className: "rounded p-1 text-slate-400 transition-colors hover:bg-muted hover:text-slate-700 dark:hover:text-slate-200",
222
- children: /* @__PURE__ */ t(V, { className: "h-3.5 w-3.5" })
239
+ children: /* @__PURE__ */ a(Y, { className: "h-3.5 w-3.5" })
223
240
  }
224
241
  )
225
242
  ] }),
226
- /* @__PURE__ */ l("div", { className: "grid grid-cols-1 items-center gap-2 sm:grid-cols-[minmax(0,1fr)_auto_minmax(0,1.4fr)]", children: [
227
- /* @__PURE__ */ l("div", { className: "min-w-0 text-[12.5px] text-slate-500 dark:text-slate-400", children: [
228
- /* @__PURE__ */ t("span", { className: "mr-1.5 text-slate-400 dark:text-slate-500", children: "Now" }),
229
- /* @__PURE__ */ t(
230
- ce,
243
+ /* @__PURE__ */ s("div", { className: "grid grid-cols-1 items-center gap-2 sm:grid-cols-[minmax(0,1fr)_auto_minmax(0,1.4fr)]", children: [
244
+ /* @__PURE__ */ s("div", { className: "min-w-0 text-[12.5px] text-slate-500 dark:text-slate-400", children: [
245
+ /* @__PURE__ */ a("span", { className: "mr-1.5 text-slate-400 dark:text-slate-500", children: "Now" }),
246
+ /* @__PURE__ */ a(
247
+ me,
231
248
  {
232
249
  value: i.current,
233
250
  kind: i.kind,
@@ -236,60 +253,70 @@ function Ee({
236
253
  }
237
254
  )
238
255
  ] }),
239
- /* @__PURE__ */ t(
240
- Y,
256
+ /* @__PURE__ */ a(
257
+ _,
241
258
  {
242
259
  "aria-hidden": !0,
243
260
  className: "hidden h-3.5 w-3.5 text-slate-400 sm:block"
244
261
  }
245
262
  ),
246
- /* @__PURE__ */ t("div", { className: "min-w-0", children: /* @__PURE__ */ t(
247
- me,
248
- {
249
- field: i,
250
- value: C[e],
251
- onChange: (d) => p((w) => ({ ...w, [e]: d }))
252
- }
253
- ) })
263
+ /* @__PURE__ */ s("div", { className: "min-w-0", children: [
264
+ /* @__PURE__ */ a(
265
+ he,
266
+ {
267
+ field: i,
268
+ value: k[e],
269
+ onChange: (d) => p((P) => ({ ...P, [e]: d }))
270
+ }
271
+ ),
272
+ !S.includes(e) && /* @__PURE__ */ a(
273
+ "p",
274
+ {
275
+ className: "mt-1 text-[11.5px] text-slate-500 dark:text-slate-400",
276
+ "data-proposal-same": !0,
277
+ children: "Same as now — not part of the proposal"
278
+ }
279
+ )
280
+ ] })
254
281
  ] })
255
282
  ] }, e) : null;
256
283
  }) }),
257
- R.length > 0 && /* @__PURE__ */ l(oe, { open: I, onOpenChange: $, children: [
258
- /* @__PURE__ */ t(se, { asChild: !0, children: c.length === 0 ? /* @__PURE__ */ l(
284
+ M.length > 0 && /* @__PURE__ */ s(ie, { open: q, onOpenChange: $, children: [
285
+ /* @__PURE__ */ a(de, { asChild: !0, children: u.length === 0 ? /* @__PURE__ */ s(
259
286
  "button",
260
287
  {
261
288
  type: "button",
262
289
  "data-proposal-add-field": !0,
263
290
  className: "flex w-full flex-col items-center gap-1 rounded-md border border-dashed border-slate-300 px-3 py-5 text-center transition-colors hover:border-nvr-cyan/60 hover:bg-nvr-cyan/5 dark:border-border",
264
291
  children: [
265
- /* @__PURE__ */ l("span", { className: "inline-flex items-center gap-1.5 text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
266
- /* @__PURE__ */ t(E, { className: "h-3.5 w-3.5" }),
292
+ /* @__PURE__ */ s("span", { className: "inline-flex items-center gap-1.5 text-[13px] font-medium text-slate-800 dark:text-slate-100", children: [
293
+ /* @__PURE__ */ a(E, { className: "h-3.5 w-3.5" }),
267
294
  "Pick a field to change"
268
295
  ] }),
269
- /* @__PURE__ */ t("span", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: "Only the fields you could edit if the record were open are offered." })
296
+ /* @__PURE__ */ a("span", { className: "text-[12px] text-slate-500 dark:text-slate-400", children: "Only the fields you could edit if the record were open are offered." })
270
297
  ]
271
298
  }
272
- ) : /* @__PURE__ */ l(
299
+ ) : /* @__PURE__ */ s(
273
300
  "button",
274
301
  {
275
302
  type: "button",
276
303
  "data-proposal-add-field": !0,
277
304
  className: "inline-flex h-8 items-center gap-1.5 rounded-md px-2 text-[12.5px] font-medium text-[#0e7490] transition-colors hover:bg-nvr-cyan/10 dark:text-[#67e8f9]",
278
305
  children: [
279
- /* @__PURE__ */ t(E, { className: "h-3.5 w-3.5" }),
306
+ /* @__PURE__ */ a(E, { className: "h-3.5 w-3.5" }),
280
307
  "Add another field"
281
308
  ]
282
309
  }
283
310
  ) }),
284
- /* @__PURE__ */ t(ie, { className: "w-72 p-0", align: "start", children: /* @__PURE__ */ l(X, { children: [
285
- /* @__PURE__ */ t(z, { placeholder: "Search fields…" }),
286
- /* @__PURE__ */ l(B, { children: [
287
- /* @__PURE__ */ t(J, { children: "No field matches." }),
288
- /* @__PURE__ */ t(Z, { children: R.map((e) => /* @__PURE__ */ t(
289
- ee,
311
+ /* @__PURE__ */ a(ce, { className: "w-72 p-0", align: "start", children: /* @__PURE__ */ s(B, { children: [
312
+ /* @__PURE__ */ a(J, { placeholder: "Search fields…" }),
313
+ /* @__PURE__ */ s(Z, { children: [
314
+ /* @__PURE__ */ a(ee, { children: "No field matches." }),
315
+ /* @__PURE__ */ a(te, { children: M.map((e) => /* @__PURE__ */ a(
316
+ re,
290
317
  {
291
318
  value: `${e.label} ${e.field}`,
292
- onSelect: () => O(e.field),
319
+ onSelect: () => A(e.field),
293
320
  children: e.label
294
321
  },
295
322
  e.field
@@ -298,50 +325,50 @@ function Ee({
298
325
  ] }) })
299
326
  ] })
300
327
  ] }),
301
- /* @__PURE__ */ l("label", { className: "block", children: [
302
- /* @__PURE__ */ t("span", { className: "mb-1 block text-[12px] font-medium text-slate-700 dark:text-slate-200", children: "Why is the change needed?" }),
303
- /* @__PURE__ */ t(
328
+ /* @__PURE__ */ s("label", { className: "block", children: [
329
+ /* @__PURE__ */ a("span", { className: "mb-1 block text-[12px] font-medium text-slate-700 dark:text-slate-200", children: "Why is the change needed?" }),
330
+ /* @__PURE__ */ a(
304
331
  "textarea",
305
332
  {
306
- value: f,
307
- onChange: (e) => P(e.target.value),
333
+ value: v,
334
+ onChange: (e) => D(e.target.value),
308
335
  rows: 3,
309
336
  maxLength: 2e3,
310
337
  "data-proposal-reason": !0,
311
338
  placeholder: "e.g. The vendor sent a revised quote on Nov 12.",
312
- className: g(u, "h-auto py-2 leading-snug")
339
+ className: b(x, "h-auto py-2 leading-snug")
313
340
  }
314
341
  )
315
342
  ] }),
316
- D && /* @__PURE__ */ t(
343
+ T && /* @__PURE__ */ a(
317
344
  "p",
318
345
  {
319
346
  role: "alert",
320
347
  className: "rounded-md border border-red-200 bg-red-50 px-3 py-2 text-[12.5px] text-red-700 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300",
321
- children: D
348
+ children: T
322
349
  }
323
350
  ),
324
- /* @__PURE__ */ l("div", { className: "flex items-center justify-end gap-2 pt-1", children: [
325
- /* @__PURE__ */ t(
351
+ /* @__PURE__ */ s("div", { className: "flex items-center justify-end gap-2 pt-1", children: [
352
+ /* @__PURE__ */ a(
326
353
  "button",
327
354
  {
328
355
  type: "button",
329
356
  onClick: () => {
330
- y(), r(!1);
357
+ y(), t(!1);
331
358
  },
332
359
  className: "h-9 rounded-md px-3 text-[13px] font-medium text-slate-600 transition-colors hover:bg-muted dark:text-slate-300",
333
360
  children: "Cancel"
334
361
  }
335
362
  ),
336
- /* @__PURE__ */ l(
363
+ /* @__PURE__ */ s(
337
364
  "button",
338
365
  {
339
366
  type: "submit",
340
- disabled: !T,
367
+ disabled: !R,
341
368
  "data-proposal-send": !0,
342
369
  className: "inline-flex h-9 items-center gap-1.5 rounded-md bg-nvr-cyan px-4 text-[13px] font-semibold text-white shadow-sm transition-opacity disabled:opacity-50",
343
370
  children: [
344
- k.isPending && /* @__PURE__ */ t(_, { className: "h-3.5 w-3.5 animate-spin" }),
371
+ C.isPending && /* @__PURE__ */ a(F, { className: "h-3.5 w-3.5 animate-spin" }),
345
372
  "Send proposal"
346
373
  ]
347
374
  }
@@ -355,5 +382,6 @@ function Ee({
355
382
  );
356
383
  }
357
384
  export {
358
- Ee as ProposeChangeDialog
385
+ Oe as ProposeChangeDialog,
386
+ be as sameAsNow
359
387
  };