@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,60 +1,62 @@
1
- import { jsxs as l, jsx as u } from "react/jsx-runtime";
2
- import { Unplug as p, RefreshCw as g } from "lucide-react";
3
- import { useState as c, useRef as f, useEffect as b } from "react";
4
- import { useRealtimeStatus as x } from "../lib/realtime.js";
5
- const k = 3e3, R = 6e3;
6
- function N() {
7
- const e = x(), [r, d] = c(!1), [o, n] = c(null), s = f(!1), i = (e == null ? void 0 : e.repair) === "silent", t = (e == null ? void 0 : e.state) === "reconnecting" && !i, m = f(i);
8
- return m.current = i, b(() => {
1
+ import { jsxs as i, jsx as u } from "react/jsx-runtime";
2
+ import { Unplug as x, RefreshCw as k } from "lucide-react";
3
+ import { useState as f, useRef as p, useEffect as b } from "react";
4
+ import { useRealtimeStatus as h } from "../lib/realtime.js";
5
+ const R = 3e3, S = 6e3;
6
+ function E() {
7
+ const e = h(), [r, o] = f(!1), [l, a] = f(null), s = p(!1), d = (e == null ? void 0 : e.repair) === "silent", t = (e == null ? void 0 : e.state) === "reconnecting" && !d, m = p(d);
8
+ if (m.current = d, b(() => {
9
9
  if (!t) return;
10
- const a = setTimeout(() => {
11
- s.current = !0, d(!0);
12
- }, k);
13
- return () => clearTimeout(a);
10
+ const n = setTimeout(() => {
11
+ s.current = !0, o(!0);
12
+ }, R);
13
+ return () => clearTimeout(n);
14
14
  }, [t]), b(() => {
15
15
  if (t) {
16
- n(null);
16
+ a(null);
17
17
  return;
18
18
  }
19
- const a = (e == null ? void 0 : e.refreshed) ?? null;
20
- if (m.current || !s.current && !a) return;
21
- s.current = !1, d(!1), n(a ?? "Live updates resumed.");
22
- const h = setTimeout(() => n(null), R);
23
- return () => clearTimeout(h);
24
- }, [t, e == null ? void 0 : e.refreshed]), typeof navigator < "u" && navigator.onLine === !1 ? null : r && t ? /* @__PURE__ */ l(
19
+ const n = (e == null ? void 0 : e.refreshed) ?? null;
20
+ if (m.current || !s.current && !n) return;
21
+ s.current = !1, o(!1), a(n ?? "Live updates resumed.");
22
+ const g = setTimeout(() => a(null), S);
23
+ return () => clearTimeout(g);
24
+ }, [t, e == null ? void 0 : e.refreshed]), typeof navigator < "u" && navigator.onLine === !1) return null;
25
+ const c = typeof document < "u" && !!document.querySelector("[data-environment-edge]");
26
+ return r && t ? /* @__PURE__ */ i(
25
27
  "div",
26
28
  {
27
29
  role: "status",
28
30
  "data-realtime-banner": "paused",
29
- className: "flex items-center justify-center gap-2 border-b border-amber-200 bg-amber-50 px-4 py-1.5 text-[12px] text-amber-900 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200",
31
+ className: `flex items-center justify-center gap-2 border-b border-amber-200 bg-amber-50 px-4 pb-1.5 text-[12px] text-amber-900 dark:border-amber-500/30 dark:bg-amber-500/10 dark:text-amber-200 ${c ? "pt-[26px]" : "pt-1.5"}`,
30
32
  children: [
31
- /* @__PURE__ */ u(p, { className: "h-3.5 w-3.5" }),
33
+ /* @__PURE__ */ u(x, { className: "h-3.5 w-3.5 shrink-0" }),
32
34
  "Live updates paused, reconnecting. Lists may be out of date until then."
33
35
  ]
34
36
  }
35
- ) : o ? /* @__PURE__ */ l(
37
+ ) : l ? /* @__PURE__ */ i(
36
38
  "div",
37
39
  {
38
40
  role: "status",
39
41
  "data-realtime-banner": "resumed",
40
- className: "flex items-center justify-center gap-2 border-b border-emerald-200 bg-emerald-50 px-4 py-1.5 text-[12px] text-emerald-900 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-200",
42
+ className: `flex items-center justify-center gap-2 border-b border-emerald-200 bg-emerald-50 px-4 pb-1.5 text-[12px] text-emerald-900 dark:border-emerald-500/30 dark:bg-emerald-500/10 dark:text-emerald-200 ${c ? "pt-[26px]" : "pt-1.5"}`,
41
43
  children: [
42
- /* @__PURE__ */ u(g, { className: "h-3.5 w-3.5" }),
43
- o
44
+ /* @__PURE__ */ u(k, { className: "h-3.5 w-3.5 shrink-0" }),
45
+ l
44
46
  ]
45
47
  }
46
48
  ) : null;
47
49
  }
48
50
  function L({ className: e }) {
49
- const r = x();
50
- return (r == null ? void 0 : r.state) !== "reconnecting" || r.repair === "silent" ? null : /* @__PURE__ */ l(
51
+ const r = h();
52
+ return (r == null ? void 0 : r.state) !== "reconnecting" || r.repair === "silent" ? null : /* @__PURE__ */ i(
51
53
  "span",
52
54
  {
53
55
  "data-realtime-stale": !0,
54
56
  "data-tip": "Live updates are paused while the connection comes back. Refresh to see the latest.",
55
57
  className: `inline-flex h-6 shrink-0 items-center gap-1 rounded-full border border-amber-300 bg-amber-50 px-2 text-[11px] font-medium text-amber-800 dark:border-amber-500/40 dark:bg-amber-500/10 dark:text-amber-200 ${e ?? ""}`,
56
58
  children: [
57
- /* @__PURE__ */ u(p, { className: "h-3 w-3" }),
59
+ /* @__PURE__ */ u(x, { className: "h-3 w-3" }),
58
60
  "May be stale"
59
61
  ]
60
62
  }
@@ -62,5 +64,5 @@ function L({ className: e }) {
62
64
  }
63
65
  export {
64
66
  L as RealtimeStaleMark,
65
- N as RealtimeStatusBanner
67
+ E as RealtimeStatusBanner
66
68
  };
@@ -22,7 +22,7 @@ function Se({
22
22
  collection: a,
23
23
  itemId: E,
24
24
  layoutId: Q,
25
- rootLayoutSlug: k,
25
+ rootLayoutSlug: w,
26
26
  width: p,
27
27
  title: _,
28
28
  stack: x,
@@ -30,7 +30,7 @@ function Se({
30
30
  onPop: h,
31
31
  onClose: B,
32
32
  design: l,
33
- onOpenRecord: w,
33
+ onOpenRecord: k,
34
34
  headerExtra: g
35
35
  }) {
36
36
  var K;
@@ -46,7 +46,7 @@ function Se({
46
46
  }, [s, h]), { viewers: i } = ne(
47
47
  l ? null : e.collection,
48
48
  l ? null : e.itemId
49
- ), v = ee(() => l ? null : { open: N }, [l, N]), T = re(), d = l ? null : T[e.collection] ?? null, m = !l && c.length === 1 && !!k, { data: U, isLoading: G } = X({
49
+ ), v = ee(() => l ? null : { open: N }, [l, N]), T = re(), d = l ? null : T[e.collection] ?? null, m = !l && c.length === 1 && !!w, { data: U, isLoading: G } = X({
50
50
  queryKey: ["drilldown-layout", e.collection, e.layoutId ?? null],
51
51
  enabled: !m && !l,
52
52
  queryFn: () => V.request(
@@ -58,7 +58,7 @@ function Se({
58
58
  }), o = l ? {
59
59
  ...l.layout,
60
60
  layout: l.layout.layout ?? { id: 0, name: "", slug: null }
61
- } : U, C = m ? k ?? void 0 : (o == null ? void 0 : o.layout.slug) ?? void 0, D = (K = o == null ? void 0 : o.layout) == null ? void 0 : K.sheet_width, $ = /* @__PURE__ */ n(j, { children: [
61
+ } : U, C = m ? w ?? void 0 : (o == null ? void 0 : o.layout.slug) ?? void 0, D = (K = o == null ? void 0 : o.layout) == null ? void 0 : K.sheet_width, $ = /* @__PURE__ */ n(j, { children: [
62
62
  /* @__PURE__ */ n("span", { className: "flex min-w-0 items-center gap-1.5", children: [
63
63
  c.length > 1 && /* @__PURE__ */ t(
64
64
  "button",
@@ -98,9 +98,9 @@ function Se({
98
98
  if (r.metaKey || r.ctrlKey || r.shiftKey || r.altKey || r.button !== 0) return;
99
99
  r.preventDefault();
100
100
  const f = { collection: e.collection, itemId: String(e.itemId) };
101
- w ? w(f) : z(f);
101
+ k ? k(f) : z(f);
102
102
  },
103
- className: "flex shrink-0 items-center gap-1 text-[11px] font-normal text-nvr-navy hover:underline dark:text-nvr-cyan",
103
+ className: "flex shrink-0 items-center gap-1 rounded text-[11px] font-medium text-slate-600 underline-offset-2 hover:text-slate-900 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-nvr-cyan/60 dark:text-slate-300 dark:hover:text-white",
104
104
  children: [
105
105
  "Open record ",
106
106
  /* @__PURE__ */ t(L, { className: "h-3 w-3" })
@@ -156,7 +156,7 @@ function Se({
156
156
  ) }) : /* @__PURE__ */ t(se, { open: !0, onOpenChange: (r) => !r && B(), children: /* @__PURE__ */ n(
157
157
  de,
158
158
  {
159
- className: "flex flex-col gap-0 overflow-hidden p-0",
159
+ className: "flex flex-col gap-0 overflow-hidden p-0 max-sm:!w-screen max-sm:!max-w-none",
160
160
  style: {
161
161
  width: (d == null ? void 0 : d.width) ?? e.width ?? D ?? p ?? 640,
162
162
  maxWidth: "96vw"
@@ -1,24 +1,28 @@
1
- import { jsx as r, Fragment as b, jsxs as o } from "react/jsx-runtime";
2
- import { useQueryClient as g, useQuery as y } from "@tanstack/react-query";
3
- import { useEffect as w } from "react";
4
- import { useNivaroClient as N } from "../context.js";
5
- import { get as k } from "../lib/commands.js";
6
- import { useLiveRecord as C } from "../lib/live.js";
7
- import { formatRelative as S } from "../lib/utils.js";
8
- import { useHoverIntent as P } from "./collections-directory/CollectionHoverCard.js";
9
- import { Popover as T, PopoverAnchor as _, PopoverContent as E } from "./ui/popover.js";
10
- import { Skeleton as p } from "./ui/skeleton.js";
11
- const D = 15e3, A = /^(nivaro_|directus_)/i, x = (e, n) => ["record-card", e, n];
12
- function L(e, n) {
13
- return !!e && !A.test(e) && n != null && n !== "" && typeof n != "object";
1
+ import { jsx as a, Fragment as k, jsxs as i } from "react/jsx-runtime";
2
+ import { useQueryClient as w, useQuery as C } from "@tanstack/react-query";
3
+ import { useEffect as y } from "react";
4
+ import { useNivaroClient as E } from "../context.js";
5
+ import { get as S } from "../lib/commands.js";
6
+ import { useLiveRecord as P } from "../lib/live.js";
7
+ import { formatRelative as _ } from "../lib/utils.js";
8
+ import { RECORD_CARD_OPEN_EVENT as T } from "./CellCopyLayer.js";
9
+ import { useHoverIntent as D } from "./collections-directory/CollectionHoverCard.js";
10
+ import { Popover as R, PopoverAnchor as A, PopoverContent as O } from "./ui/popover.js";
11
+ import { Skeleton as f } from "./ui/skeleton.js";
12
+ const L = 15e3, q = /^(nivaro_|directus_)/i, x = (e, o) => ["record-card", e, o];
13
+ function F(e, o) {
14
+ return !!e && !q.test(e) && o != null && o !== "" && typeof o != "object";
14
15
  }
15
- function h(e) {
16
+ function v(e) {
16
17
  return e.inactive === "suspended" ? `${e.name} (suspended)` : e.name;
17
18
  }
18
- function R(e) {
19
+ function $(e) {
19
20
  return e.money ? e.value.toLocaleString("en-US", { style: "currency", currency: "USD" }) : e.value.toLocaleString("en-US", { maximumFractionDigits: 2 });
20
21
  }
21
- const q = {
22
+ function b(e) {
23
+ return !e.state && !e.sla && e.owners.length === 0 && e.amounts.length === 0;
24
+ }
25
+ const U = {
22
26
  warning: {
23
27
  text: "Due soon",
24
28
  cls: "bg-amber-100 text-amber-800 dark:bg-amber-500/15 dark:text-amber-300"
@@ -28,38 +32,43 @@ const q = {
28
32
  cls: "bg-red-100 text-red-700 dark:bg-red-500/15 dark:text-red-300"
29
33
  }
30
34
  };
31
- function F({
35
+ function j({
32
36
  collection: e,
33
- id: n,
37
+ id: o,
34
38
  onGone: c
35
39
  }) {
36
- const d = N(), m = g(), { data: t, isPending: u, isError: i } = y({
37
- queryKey: x(e, n),
38
- queryFn: () => d.request(
39
- k(`/records/${e}/${encodeURIComponent(n)}/card`)
40
- ).then((l) => l.data),
41
- staleTime: D,
40
+ const u = E(), m = w(), { data: t, isPending: p, isError: l } = C({
41
+ queryKey: x(e, o),
42
+ queryFn: () => u.request(
43
+ S(`/records/${e}/${encodeURIComponent(o)}/card`)
44
+ ).then((s) => s.data),
45
+ staleTime: L,
42
46
  gcTime: 6e4,
43
47
  retry: !1
44
48
  });
45
- if (C(e, n, () => {
46
- m.invalidateQueries({ queryKey: x(e, n) });
47
- }), w(() => {
48
- i && c();
49
- }, [i, c]), u)
50
- return /* @__PURE__ */ o("div", { className: "space-y-2", "aria-busy": !0, children: [
51
- /* @__PURE__ */ r(p, { className: "h-4 w-40" }),
52
- /* @__PURE__ */ r(p, { className: "h-3 w-24" }),
53
- /* @__PURE__ */ r(p, { className: "h-3 w-32" })
54
- ] });
55
- if (i || !t) return null;
56
- const a = t.sla ? q[t.sla] : null;
57
- return /* @__PURE__ */ o("div", { className: "min-w-0", "data-record-card": !0, children: [
58
- /* @__PURE__ */ r("p", { className: "text-[10.5px] font-medium uppercase tracking-wide text-slate-400 dark:text-slate-500", children: t.collection_label }),
59
- /* @__PURE__ */ r("p", { className: "mt-0.5 line-clamp-2 text-[13px] font-semibold leading-snug text-slate-800 dark:text-slate-100", children: t.title }),
60
- (t.state || a) && /* @__PURE__ */ o("div", { className: "mt-2 flex flex-wrap items-center gap-1.5", children: [
61
- t.state && /* @__PURE__ */ o("span", { className: "inline-flex max-w-full items-center gap-1.5 rounded-full bg-slate-100 px-2 py-0.5 text-[11px] font-medium text-slate-700 dark:bg-white/10 dark:text-slate-200", children: [
62
- /* @__PURE__ */ r(
49
+ P(e, o, () => {
50
+ m.invalidateQueries({ queryKey: x(e, o) });
51
+ });
52
+ const n = !!t && b(t);
53
+ if (y(() => {
54
+ (l || n) && c();
55
+ }, [l, n, c]), p)
56
+ return (
57
+ // In dark the popover and the skeleton token are the same grey: lift the bars a step.
58
+ /* @__PURE__ */ i("div", { className: "space-y-2 dark:[&>div]:bg-white/[0.09]", "aria-busy": !0, children: [
59
+ /* @__PURE__ */ a(f, { className: "h-4 w-40" }),
60
+ /* @__PURE__ */ a(f, { className: "h-3 w-24" }),
61
+ /* @__PURE__ */ a(f, { className: "h-3 w-32" })
62
+ ] })
63
+ );
64
+ if (l || !t || n) return null;
65
+ const d = t.sla ? U[t.sla] : null;
66
+ return /* @__PURE__ */ i("div", { className: "min-w-0", "data-record-card": !0, children: [
67
+ /* @__PURE__ */ a("p", { className: "text-[10.5px] font-medium uppercase tracking-wide text-slate-400 dark:text-slate-500", children: t.collection_label }),
68
+ /* @__PURE__ */ a("p", { className: "mt-0.5 line-clamp-2 text-[13px] font-semibold leading-snug text-slate-800 dark:text-slate-100", children: t.title }),
69
+ (t.state || d) && /* @__PURE__ */ i("div", { className: "mt-2 flex flex-wrap items-center gap-1.5", children: [
70
+ t.state && /* @__PURE__ */ i("span", { className: "inline-flex max-w-full items-center gap-1.5 rounded-full bg-slate-100 px-2 py-0.5 text-[11px] font-medium text-slate-700 dark:bg-white/10 dark:text-slate-200", children: [
71
+ /* @__PURE__ */ a(
63
72
  "span",
64
73
  {
65
74
  "aria-hidden": !0,
@@ -67,81 +76,90 @@ function F({
67
76
  style: t.state.color ? { backgroundColor: t.state.color } : void 0
68
77
  }
69
78
  ),
70
- /* @__PURE__ */ r("span", { className: "truncate", children: t.state.label })
79
+ /* @__PURE__ */ a("span", { className: "truncate", children: t.state.label })
71
80
  ] }),
72
- a && /* @__PURE__ */ r("span", { className: `rounded-full px-2 py-0.5 text-[11px] font-medium ${a.cls}`, children: a.text })
81
+ d && /* @__PURE__ */ a("span", { className: `rounded-full px-2 py-0.5 text-[11px] font-medium ${d.cls}`, children: d.text })
73
82
  ] }),
74
- t.owners.length > 0 && /* @__PURE__ */ o("p", { className: "mt-2 truncate text-[11.5px] text-slate-600 dark:text-slate-300", children: [
75
- /* @__PURE__ */ r("span", { className: "text-slate-400 dark:text-slate-500", children: "With " }),
76
- t.owners.length <= 2 ? t.owners.map(h).join(" and ") : `${h(t.owners[0])} and ${t.owners.length - 1} others`
83
+ t.owners.length > 0 && /* @__PURE__ */ i("p", { className: "mt-2 truncate text-[11.5px] text-slate-600 dark:text-slate-300", children: [
84
+ /* @__PURE__ */ a("span", { className: "text-slate-400 dark:text-slate-500", children: "With " }),
85
+ t.owners.length <= 2 ? t.owners.map(v).join(" and ") : `${v(t.owners[0])} and ${t.owners.length - 1} others`
77
86
  ] }),
78
- t.amounts.length > 0 && /* @__PURE__ */ r("dl", { className: "mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-[11.5px]", children: t.amounts.map((l) => /* @__PURE__ */ o("div", { className: "contents", children: [
79
- /* @__PURE__ */ r("dt", { className: "truncate text-slate-500 dark:text-slate-400", children: l.label }),
80
- /* @__PURE__ */ r("dd", { className: "text-right font-medium tabular-nums text-slate-800 dark:text-slate-100", children: R(l) })
81
- ] }, l.field)) }),
82
- t.updated_at && /* @__PURE__ */ o("p", { className: "mt-2 text-[10.5px] text-slate-400 dark:text-slate-500", children: [
87
+ t.amounts.length > 0 && /* @__PURE__ */ a("dl", { className: "mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-0.5 text-[11.5px]", children: t.amounts.map((s) => /* @__PURE__ */ i("div", { className: "contents", children: [
88
+ /* @__PURE__ */ a("dt", { className: "truncate text-slate-500 dark:text-slate-400", children: s.label }),
89
+ /* @__PURE__ */ a("dd", { className: "text-right font-medium tabular-nums text-slate-800 dark:text-slate-100", children: $(s) })
90
+ ] }, s.field)) }),
91
+ t.updated_at && /* @__PURE__ */ i("p", { className: "mt-2 text-[10.5px] text-slate-400 dark:text-slate-500", children: [
83
92
  "Updated ",
84
- S(t.updated_at)
93
+ _(t.updated_at)
85
94
  ] })
86
95
  ] });
87
96
  }
88
- function W({
97
+ function G({
89
98
  collection: e,
90
- id: n,
99
+ id: o,
91
100
  children: c,
92
- disabled: d,
101
+ disabled: u,
93
102
  side: m = "bottom",
94
103
  block: t = !1,
95
- delayMs: u = 500
104
+ delayMs: p = 500
96
105
  }) {
97
- const i = !d && L(e, n), a = P(i, u), l = g(), f = () => {
98
- var s;
99
- ((s = l.getQueryState(x(String(e), String(n)))) == null ? void 0 : s.status) !== "error" && a.show();
106
+ const l = !u && F(e, o), n = D(l, p), d = w();
107
+ y(() => {
108
+ !n.open || typeof window > "u" || window.dispatchEvent(new CustomEvent(T));
109
+ }, [n.open]);
110
+ const s = () => {
111
+ const r = d.getQueryState(x(String(e), String(o)));
112
+ (r == null ? void 0 : r.status) !== "error" && (r != null && r.data && b(r.data) || n.show());
100
113
  };
101
- if (!i) return /* @__PURE__ */ r(b, { children: c });
102
- const v = String(n);
103
- return /* @__PURE__ */ o(T, { open: a.open, onOpenChange: (s) => !s && a.close(), children: [
104
- /* @__PURE__ */ r(_, { asChild: !0, children: /* @__PURE__ */ r(
114
+ if (!l) return /* @__PURE__ */ a(k, { children: c });
115
+ const N = String(o);
116
+ return /* @__PURE__ */ i(R, { open: n.open, onOpenChange: (r) => !r && n.close(), children: [
117
+ /* @__PURE__ */ a(A, { asChild: !0, children: /* @__PURE__ */ a(
105
118
  "span",
106
119
  {
107
120
  className: t ? "block" : "inline",
108
121
  "data-record-card-anchor": !0,
109
- onPointerEnter: (s) => {
110
- s.pointerType === "mouse" && f();
122
+ onPointerEnter: (r) => {
123
+ r.pointerType === "mouse" && s();
124
+ },
125
+ onPointerLeave: (r) => {
126
+ r.pointerType === "mouse" && n.hide();
111
127
  },
112
- onPointerLeave: (s) => {
113
- s.pointerType === "mouse" && a.hide();
128
+ onPointerOver: (r) => {
129
+ var h, g;
130
+ r.pointerType === "mouse" && ((g = (h = r.target).closest) != null && g.call(h, "[data-no-hovercard]") ? n.close() : n.open || s());
114
131
  },
115
- onPointerDown: a.close,
116
- onFocus: f,
117
- onBlur: a.hide,
132
+ onPointerDown: n.close,
133
+ onFocus: s,
134
+ onBlur: n.hide,
118
135
  children: c
119
136
  }
120
137
  ) }),
121
- a.open && /* @__PURE__ */ r(
122
- E,
138
+ n.open && /* @__PURE__ */ a(
139
+ O,
123
140
  {
124
141
  side: m,
125
142
  align: "start",
126
143
  sideOffset: 6,
127
144
  collisionPadding: 12,
128
145
  avoidCollisions: !0,
129
- onOpenAutoFocus: (s) => s.preventDefault(),
130
- onCloseAutoFocus: (s) => s.preventDefault(),
131
- onPointerEnter: a.cancel,
132
- onPointerLeave: a.hide,
133
- onClick: (s) => s.stopPropagation(),
146
+ onOpenAutoFocus: (r) => r.preventDefault(),
147
+ onCloseAutoFocus: (r) => r.preventDefault(),
148
+ onPointerEnter: n.cancel,
149
+ onPointerLeave: n.hide,
150
+ onClick: (r) => r.stopPropagation(),
134
151
  className: "w-[280px] max-w-[calc(100vw-24px)] p-3 motion-reduce:animate-none",
135
- children: /* @__PURE__ */ r(F, { collection: e, id: v, onGone: a.close })
152
+ children: /* @__PURE__ */ a(j, { collection: e, id: N, onGone: n.close })
136
153
  }
137
154
  )
138
155
  ] });
139
156
  }
140
157
  export {
141
- D as RECORD_CARD_STALE_MS,
142
- W as RecordHoverCard,
143
- R as cardAmountText,
144
- L as hoverCardEligible,
145
- h as ownerText,
158
+ L as RECORD_CARD_STALE_MS,
159
+ G as RecordHoverCard,
160
+ b as cardAddsNothing,
161
+ $ as cardAmountText,
162
+ F as hoverCardEligible,
163
+ v as ownerText,
146
164
  x as recordCardKey
147
165
  };