@nivaro/react 0.2.56 → 0.3.0
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.
- package/dist/components/slots/TasksSlot.js +31 -29
- package/dist/full.css +1 -1
- package/dist/hooks/useSessionRecorder.js +1 -1
- package/dist/index.d.ts +73 -1
- package/dist/index.js +515 -505
- package/dist/shared/components/ItemEditForm.js +666 -658
- package/dist/shared/components/MyWorkView.js +47 -37
- package/dist/shared/components/ProfileView.js +163 -144
- package/dist/shared/components/ai/AiPlanCard.js +427 -0
- package/dist/shared/components/ai/AiPlanChanges.js +117 -0
- package/dist/shared/components/ai/TaskDo.js +1022 -0
- package/dist/shared/components/chat/ChatAnalyticsView.js +19 -17
- package/dist/shared/components/chat/ChatPanel.js +1356 -1317
- package/dist/shared/components/chat/HuddleAnalyticsTab.js +198 -0
- package/dist/shared/components/chat/RoomHeaderMenu.js +78 -65
- package/dist/shared/components/chat/chat-core.js +273 -264
- package/dist/shared/components/chat/huddle/HuddleAudioUi.js +397 -0
- package/dist/shared/components/chat/huddle/HuddleCallBar.js +296 -0
- package/dist/shared/components/chat/huddle/HuddleCallLayer.js +180 -0
- package/dist/shared/components/chat/huddle/HuddleCamera.js +124 -0
- package/dist/shared/components/chat/huddle/HuddleCollab.js +320 -0
- package/dist/shared/components/chat/huddle/HuddleControls.js +82 -121
- package/dist/shared/components/chat/huddle/HuddleDraw.js +231 -0
- package/dist/shared/components/chat/huddle/HuddleLiveBadge.js +52 -0
- package/dist/shared/components/chat/huddle/HuddlePeoplePicker.js +143 -0
- package/dist/shared/components/chat/huddle/HuddleScheduleCard.js +190 -0
- package/dist/shared/components/chat/huddle/HuddleScheduleForm.js +188 -0
- package/dist/shared/components/chat/huddle/HuddleStage.js +184 -89
- package/dist/shared/components/chat/huddle/HuddleStageTools.js +197 -0
- package/dist/shared/components/chat/huddle/huddle-audio-logic.js +156 -0
- package/dist/shared/components/chat/huddle/huddle-audio.js +69 -0
- package/dist/shared/components/chat/huddle/huddle-calls.js +129 -0
- package/dist/shared/components/chat/huddle/huddle-camera.js +143 -0
- package/dist/shared/components/chat/huddle/huddle-collab-store.js +391 -0
- package/dist/shared/components/chat/huddle/huddle-device-prefs.js +55 -0
- package/dist/shared/components/chat/huddle/huddle-devices.js +99 -0
- package/dist/shared/components/chat/huddle/huddle-draw.js +226 -0
- package/dist/shared/components/chat/huddle/huddle-follow-bus.js +96 -0
- package/dist/shared/components/chat/huddle/huddle-hold.js +62 -0
- package/dist/shared/components/chat/huddle/huddle-link-quality.js +159 -0
- package/dist/shared/components/chat/huddle/huddle-live.js +82 -0
- package/dist/shared/components/chat/huddle/huddle-pip.js +343 -0
- package/dist/shared/components/chat/huddle/huddle-quality.js +22 -0
- package/dist/shared/components/chat/huddle/huddle-reactions.js +71 -0
- package/dist/shared/components/chat/huddle/huddle-ring-refused.js +34 -0
- package/dist/shared/components/chat/huddle/huddle-schedule.js +102 -0
- package/dist/shared/components/chat/huddle/huddle-sfu.js +176 -0
- package/dist/shared/components/chat/huddle/huddle-shortcuts.js +91 -0
- package/dist/shared/components/chat/huddle/huddle-speaking.js +100 -0
- package/dist/shared/components/chat/huddle/huddle-store.js +431 -157
- package/dist/shared/components/chat/huddle/useHuddle.js +46 -38
- package/dist/shared/components/chat/huddle/useHuddleAudio.js +35 -0
- package/dist/shared/components/item-edit/GroupSection.js +1 -0
- package/dist/shared/components/item-edit/RecordChatActions.js +68 -59
- package/dist/shared/components/item-edit/UserChip.js +145 -142
- package/dist/shared/components/panels/TaskPanel.js +51 -49
- package/dist/shared/components/support/TicketDetailSheet.js +57 -42
- package/dist/shared/lib/notification-sound.js +25 -16
- package/package.json +2 -1
|
@@ -1,109 +1,111 @@
|
|
|
1
1
|
import { jsx as a, jsxs as r } from "react/jsx-runtime";
|
|
2
2
|
import { useQuery as _ } from "@tanstack/react-query";
|
|
3
|
-
import { UserCheck as R, Mail as E, Phone as U, Building2 as q, User as
|
|
4
|
-
import
|
|
3
|
+
import { UserCheck as R, Mail as E, Phone as U, Building2 as q, User as B, Clock as D, MessageCircle as S, ExternalLink as z } from "lucide-react";
|
|
4
|
+
import L, { useState as $, useRef as N, useEffect as F } from "react";
|
|
5
5
|
import { createPortal as K } from "react-dom";
|
|
6
|
-
import { useOptionalNivaroClient as
|
|
7
|
-
import { get as
|
|
8
|
-
import { userCardQuery as
|
|
6
|
+
import { useOptionalNivaroClient as P, useNavigation as W, useItemEditAuth as H } from "../../context.js";
|
|
7
|
+
import { get as M, post as Q } from "../../lib/commands.js";
|
|
8
|
+
import { userCardQuery as Z } from "../../lib/user-cards.js";
|
|
9
9
|
import { cn as J } from "../../lib/utils.js";
|
|
10
10
|
import { canOpenDm as V, openDmWith as G } from "../chat/chat-core.js";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
11
|
+
import { HuddlePresenceLine as X } from "../chat/huddle/HuddleLiveBadge.js";
|
|
12
|
+
import { useHuddleLive as Y } from "../chat/huddle/huddle-live.js";
|
|
13
|
+
import { MailSuppressedPill as I } from "../profile/MailSuppressedPill.js";
|
|
14
|
+
import { useCardPresence as A } from "../profile/usePersonPresence.js";
|
|
13
15
|
import { UserAvatar as C } from "../UserAvatar.js";
|
|
14
|
-
import { Popover as
|
|
15
|
-
function
|
|
16
|
-
const
|
|
17
|
-
|
|
16
|
+
import { Popover as ee, PopoverTrigger as te, PopoverContent as ae } from "../ui/popover.js";
|
|
17
|
+
function O(e, l, s) {
|
|
18
|
+
const c = N(l);
|
|
19
|
+
c.current = l;
|
|
18
20
|
const d = N(s);
|
|
19
21
|
d.current = s, F(() => {
|
|
20
22
|
if (!e) return;
|
|
21
|
-
const
|
|
22
|
-
const
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
return document.addEventListener("pointerdown",
|
|
26
|
-
document.removeEventListener("pointerdown",
|
|
23
|
+
const m = (n) => {
|
|
24
|
+
const f = n.target;
|
|
25
|
+
f && c.current(f) || d.current();
|
|
26
|
+
}, p = () => d.current();
|
|
27
|
+
return document.addEventListener("pointerdown", m, !0), window.addEventListener("blur", p), () => {
|
|
28
|
+
document.removeEventListener("pointerdown", m, !0), window.removeEventListener("blur", p);
|
|
27
29
|
};
|
|
28
30
|
}, [e]);
|
|
29
31
|
}
|
|
30
|
-
function
|
|
32
|
+
function ne({
|
|
31
33
|
users: e,
|
|
32
34
|
showSingleName: l = !0
|
|
33
35
|
}) {
|
|
34
|
-
const s = N(null),
|
|
36
|
+
const s = N(null), c = N(null), d = N(null), [m, p] = $(null), [n, f] = $({ x: 0, y: 0 }), b = () => {
|
|
35
37
|
d.current && clearTimeout(d.current), d.current = null;
|
|
36
|
-
},
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
const
|
|
40
|
-
|
|
38
|
+
}, o = (t) => {
|
|
39
|
+
var x;
|
|
40
|
+
b();
|
|
41
|
+
const i = (x = s.current) == null ? void 0 : x.getBoundingClientRect();
|
|
42
|
+
i && f({ x: i.left, y: i.bottom + 6 }), p((h) => h === "pin" ? "pin" : t);
|
|
41
43
|
}, w = () => {
|
|
42
|
-
|
|
44
|
+
b(), d.current = setTimeout(() => p((t) => t === "pin" ? t : null), 160);
|
|
43
45
|
};
|
|
44
|
-
|
|
46
|
+
L.useLayoutEffect(() => {
|
|
45
47
|
var y;
|
|
46
|
-
if (!
|
|
47
|
-
const t =
|
|
48
|
+
if (!m) return;
|
|
49
|
+
const t = c.current;
|
|
48
50
|
if (!t) return;
|
|
49
|
-
const
|
|
50
|
-
let { x
|
|
51
|
-
if (
|
|
51
|
+
const i = t.getBoundingClientRect();
|
|
52
|
+
let { x, y: h } = n;
|
|
53
|
+
if (i.right > window.innerWidth - 8 && (x = Math.max(8, window.innerWidth - i.width - 8)), i.bottom > window.innerHeight - 8) {
|
|
52
54
|
const j = (y = s.current) == null ? void 0 : y.getBoundingClientRect();
|
|
53
|
-
h = Math.max(8, ((j == null ? void 0 : j.top) ?? h) -
|
|
55
|
+
h = Math.max(8, ((j == null ? void 0 : j.top) ?? h) - i.height - 6);
|
|
54
56
|
}
|
|
55
|
-
(
|
|
56
|
-
}, [
|
|
57
|
-
!!
|
|
57
|
+
(x !== n.x || h !== n.y) && f({ x, y: h });
|
|
58
|
+
}, [m, n]), O(
|
|
59
|
+
!!m,
|
|
58
60
|
(t) => {
|
|
59
|
-
var
|
|
61
|
+
var i, x, h;
|
|
60
62
|
return (
|
|
61
63
|
// Clicks inside the user-card popover (portaled by Radix) keep the
|
|
62
64
|
// roster mounted — closing would unmount the card mid-click.
|
|
63
|
-
!!((
|
|
65
|
+
!!((i = t.closest) != null && i.call(t, "[data-radix-popper-content-wrapper]")) || !!((x = c.current) != null && x.contains(t)) || !!((h = s.current) != null && h.contains(t))
|
|
64
66
|
);
|
|
65
67
|
},
|
|
66
|
-
() =>
|
|
68
|
+
() => p(null)
|
|
67
69
|
);
|
|
68
|
-
const
|
|
70
|
+
const u = (t) => t.split(" ").map((i) => i[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
69
71
|
if (e.length === 0)
|
|
70
72
|
return /* @__PURE__ */ a("span", { className: "text-[11px] text-slate-400", "data-roster-empty": !0, children: "—" });
|
|
71
|
-
const
|
|
73
|
+
const v = e.slice(0, 4), g = e.length - v.length, k = "flex h-6 w-6 items-center justify-center rounded-full border-2 border-white bg-[#c7f0fb] text-[10px] font-bold leading-none text-[#04516b] dark:border-slate-900 dark:bg-[#0c3b4a] dark:text-[#7dd8f2]";
|
|
72
74
|
return /* @__PURE__ */ r(
|
|
73
75
|
"span",
|
|
74
76
|
{
|
|
75
77
|
ref: s,
|
|
76
|
-
onMouseEnter: () =>
|
|
78
|
+
onMouseEnter: () => o("hover"),
|
|
77
79
|
onMouseLeave: w,
|
|
78
80
|
onClick: (t) => {
|
|
79
|
-
t.stopPropagation(),
|
|
81
|
+
t.stopPropagation(), o("pin");
|
|
80
82
|
},
|
|
81
83
|
className: "inline-flex cursor-pointer items-center",
|
|
82
84
|
children: [
|
|
83
|
-
/* @__PURE__ */ a("span", { className: "flex -space-x-2", children:
|
|
85
|
+
/* @__PURE__ */ a("span", { className: "flex -space-x-2", children: v.map((t) => /* @__PURE__ */ a(
|
|
84
86
|
C,
|
|
85
87
|
{
|
|
86
88
|
userId: t.id,
|
|
87
89
|
className: "h-6 w-6 border-2 border-white dark:border-slate-900",
|
|
88
|
-
fallback: /* @__PURE__ */ a("span", { "data-copy-skip": !0, "aria-hidden": "true", className:
|
|
90
|
+
fallback: /* @__PURE__ */ a("span", { "data-copy-skip": !0, "aria-hidden": "true", className: k, children: u(t.name) })
|
|
89
91
|
},
|
|
90
92
|
t.id
|
|
91
93
|
)) }),
|
|
92
|
-
|
|
94
|
+
g > 0 && /* @__PURE__ */ r("span", { className: "ml-1 rounded-full bg-slate-200 px-1.5 py-0.5 text-[10.5px] font-bold leading-none text-slate-600 dark:bg-slate-700 dark:text-slate-300", children: [
|
|
93
95
|
"+",
|
|
94
|
-
|
|
96
|
+
g
|
|
95
97
|
] }),
|
|
96
98
|
l && e.length === 1 && /* @__PURE__ */ a("span", { className: "ml-1.5 max-w-[130px] truncate text-[12px] font-medium text-slate-700 dark:text-slate-200", children: e[0].name }),
|
|
97
|
-
|
|
99
|
+
m && K(
|
|
98
100
|
/* @__PURE__ */ r(
|
|
99
101
|
"div",
|
|
100
102
|
{
|
|
101
|
-
ref:
|
|
102
|
-
style:
|
|
103
|
-
onMouseEnter:
|
|
103
|
+
ref: c,
|
|
104
|
+
style: re(s.current, n),
|
|
105
|
+
onMouseEnter: b,
|
|
104
106
|
onMouseLeave: w,
|
|
105
107
|
onMouseDown: (t) => {
|
|
106
|
-
t.stopPropagation(),
|
|
108
|
+
t.stopPropagation(), p("pin");
|
|
107
109
|
},
|
|
108
110
|
onClick: (t) => t.stopPropagation(),
|
|
109
111
|
className: "w-max min-w-[190px] max-w-[300px] rounded-lg border border-slate-200 bg-white py-1.5 shadow-xl dark:border-slate-600 dark:bg-slate-800",
|
|
@@ -113,53 +115,53 @@ function te({
|
|
|
113
115
|
" user",
|
|
114
116
|
e.length === 1 ? "" : "s"
|
|
115
117
|
] }),
|
|
116
|
-
e.map((t) => /* @__PURE__ */ a("div", { className: "px-2 py-0.5", children: /* @__PURE__ */ a(
|
|
118
|
+
e.map((t) => /* @__PURE__ */ a("div", { className: "px-2 py-0.5", children: /* @__PURE__ */ a(se, { userId: t.id, size: "compact" }) }, t.id))
|
|
117
119
|
]
|
|
118
120
|
}
|
|
119
121
|
),
|
|
120
|
-
|
|
122
|
+
T(s.current)
|
|
121
123
|
)
|
|
122
124
|
]
|
|
123
125
|
}
|
|
124
126
|
);
|
|
125
127
|
}
|
|
126
|
-
function
|
|
128
|
+
function T(e) {
|
|
127
129
|
return (e == null ? void 0 : e.closest('[role="dialog"]')) ?? document.body;
|
|
128
130
|
}
|
|
129
|
-
function
|
|
130
|
-
const s =
|
|
131
|
+
function re(e, l) {
|
|
132
|
+
const s = T(e);
|
|
131
133
|
if (s === document.body) return { position: "fixed", left: l.x, top: l.y, zIndex: 50 };
|
|
132
|
-
const
|
|
133
|
-
return { position: "absolute", left: l.x -
|
|
134
|
+
const c = s.getBoundingClientRect();
|
|
135
|
+
return { position: "absolute", left: l.x - c.left, top: l.y - c.top, zIndex: 120 };
|
|
134
136
|
}
|
|
135
|
-
function
|
|
137
|
+
function Ne({
|
|
136
138
|
collection: e,
|
|
137
139
|
itemId: l
|
|
138
140
|
}) {
|
|
139
|
-
const s =
|
|
141
|
+
const s = P(), { data: c = [], isLoading: d } = _({
|
|
140
142
|
queryKey: ["pipeline-owners-resolved", e, l],
|
|
141
143
|
queryFn: () => s.request(
|
|
142
|
-
|
|
143
|
-
).then((
|
|
144
|
-
var
|
|
145
|
-
return ((
|
|
144
|
+
Q(`/pipelines/instance/${e}/owners/batch`, { ids: [l] })
|
|
145
|
+
).then((m) => {
|
|
146
|
+
var p;
|
|
147
|
+
return ((p = m.data) == null ? void 0 : p[l]) ?? [];
|
|
146
148
|
}),
|
|
147
149
|
enabled: !!s && !!e && !!l && l !== "new",
|
|
148
150
|
staleTime: 3e4
|
|
149
151
|
});
|
|
150
|
-
return d ? /* @__PURE__ */ a("span", { className: "animate-pulse h-3 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" }) : /* @__PURE__ */ a(
|
|
152
|
+
return d ? /* @__PURE__ */ a("span", { className: "animate-pulse h-3 w-20 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" }) : /* @__PURE__ */ a(ne, { users: c });
|
|
151
153
|
}
|
|
152
|
-
function
|
|
154
|
+
function Ce({
|
|
153
155
|
collection: e,
|
|
154
156
|
itemId: l,
|
|
155
157
|
label: s
|
|
156
158
|
}) {
|
|
157
|
-
const
|
|
159
|
+
const c = P(), { data: d = [] } = _({
|
|
158
160
|
queryKey: ["pipeline-instance-owners", e, l],
|
|
159
|
-
queryFn: () =>
|
|
160
|
-
enabled: !!
|
|
161
|
+
queryFn: () => c.request(M(`/pipelines/instance/${e}/${l}/owners`)).then((n) => n.data ?? []),
|
|
162
|
+
enabled: !!c && !!e && !!l && l !== "new",
|
|
161
163
|
staleTime: 3e4
|
|
162
|
-
}),
|
|
164
|
+
}), m = (n) => [n.first_name, n.last_name].filter(Boolean).join(" ") || n.email, p = (n) => m(n).split(" ").map((f) => f[0]).filter(Boolean).slice(0, 2).join("").toUpperCase();
|
|
163
165
|
return /* @__PURE__ */ r("div", { children: [
|
|
164
166
|
/* @__PURE__ */ a("p", { className: "text-[11px] font-medium text-slate-400 mb-1.5", children: s }),
|
|
165
167
|
d.length === 0 ? /* @__PURE__ */ a("p", { className: "text-[13px] text-slate-400", children: "—" }) : /* @__PURE__ */ a("div", { className: "flex flex-wrap gap-2", children: d.map((n) => /* @__PURE__ */ r(
|
|
@@ -172,54 +174,54 @@ function we({
|
|
|
172
174
|
{
|
|
173
175
|
userId: n.id,
|
|
174
176
|
className: "h-6 w-6",
|
|
175
|
-
fallback: /* @__PURE__ */ a("span", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy dark:text-nvr-cyan", children:
|
|
177
|
+
fallback: /* @__PURE__ */ a("span", { className: "flex h-6 w-6 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy dark:text-nvr-cyan", children: p(n) })
|
|
176
178
|
}
|
|
177
179
|
),
|
|
178
|
-
/* @__PURE__ */ a("span", { className: "text-[12px] text-slate-700", children:
|
|
180
|
+
/* @__PURE__ */ a("span", { className: "text-[12px] text-slate-700", children: m(n) })
|
|
179
181
|
]
|
|
180
182
|
},
|
|
181
183
|
n.id
|
|
182
184
|
)) })
|
|
183
185
|
] });
|
|
184
186
|
}
|
|
185
|
-
function
|
|
187
|
+
function le({
|
|
186
188
|
user: e,
|
|
187
189
|
userId: l,
|
|
188
190
|
initials: s,
|
|
189
|
-
navigate:
|
|
191
|
+
navigate: c,
|
|
190
192
|
profileUrl: d,
|
|
191
|
-
online:
|
|
192
|
-
cardId:
|
|
193
|
+
online: m,
|
|
194
|
+
cardId: p,
|
|
193
195
|
onAction: n,
|
|
194
|
-
open:
|
|
196
|
+
open: f = !1
|
|
195
197
|
}) {
|
|
196
|
-
var
|
|
197
|
-
const { isAdmin:
|
|
198
|
-
const
|
|
199
|
-
if (!
|
|
198
|
+
var k;
|
|
199
|
+
const { isAdmin: b } = H(), o = A(l, f), w = Y().roomOf(l), u = ((k = e == null ? void 0 : e.manager_name) == null ? void 0 : k.trim()) || null, v = (() => {
|
|
200
|
+
const t = e == null ? void 0 : e.timezone;
|
|
201
|
+
if (!t) return null;
|
|
200
202
|
try {
|
|
201
|
-
const
|
|
202
|
-
return
|
|
203
|
+
const i = Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
204
|
+
return t === i ? null : new Intl.DateTimeFormat(void 0, {
|
|
203
205
|
hour: "numeric",
|
|
204
206
|
minute: "2-digit",
|
|
205
|
-
timeZone:
|
|
207
|
+
timeZone: t
|
|
206
208
|
}).format(/* @__PURE__ */ new Date());
|
|
207
209
|
} catch {
|
|
208
210
|
return null;
|
|
209
211
|
}
|
|
210
|
-
})(),
|
|
211
|
-
const
|
|
212
|
-
if (
|
|
213
|
-
if (
|
|
214
|
-
const
|
|
215
|
-
return
|
|
212
|
+
})(), g = e != null && e.last_access ? (() => {
|
|
213
|
+
const t = Date.now() - new Date(e.last_access).getTime(), i = Math.floor(t / 6e4);
|
|
214
|
+
if (i < 2) return "Just now";
|
|
215
|
+
if (i < 60) return `${i}m ago`;
|
|
216
|
+
const x = Math.floor(i / 60);
|
|
217
|
+
return x < 24 ? `${x}h ago` : `${Math.floor(x / 24)}d ago`;
|
|
216
218
|
})() : null;
|
|
217
219
|
return /* @__PURE__ */ r(
|
|
218
|
-
|
|
220
|
+
ae,
|
|
219
221
|
{
|
|
220
222
|
align: "start",
|
|
221
223
|
className: "w-72 p-0 overflow-hidden",
|
|
222
|
-
"data-nvr-user-card":
|
|
224
|
+
"data-nvr-user-card": p ?? "",
|
|
223
225
|
children: [
|
|
224
226
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-3 p-4 bg-gradient-to-br from-nvr-cyan/8 to-nvr-cyan/4 dark:from-nvr-cyan/10 dark:to-transparent border-b border-slate-100 dark:border-border", children: [
|
|
225
227
|
/* @__PURE__ */ a(
|
|
@@ -232,15 +234,15 @@ function ne({
|
|
|
232
234
|
),
|
|
233
235
|
/* @__PURE__ */ r("div", { className: "min-w-0 flex-1", children: [
|
|
234
236
|
/* @__PURE__ */ r("div", { className: "flex items-center gap-1.5", children: [
|
|
235
|
-
(
|
|
237
|
+
(m || o.word) && /* @__PURE__ */ a(
|
|
236
238
|
"span",
|
|
237
239
|
{
|
|
238
|
-
"data-card-presence":
|
|
240
|
+
"data-card-presence": o.word ?? "online",
|
|
239
241
|
className: J(
|
|
240
242
|
"h-2 w-2 shrink-0 rounded-full ring-2 ring-white dark:ring-card",
|
|
241
|
-
|
|
243
|
+
o.word === "away" ? "bg-white ring-amber-400 dark:bg-card" : o.word === "idle" ? "bg-amber-400" : "bg-emerald-400"
|
|
242
244
|
),
|
|
243
|
-
title:
|
|
245
|
+
title: o.word === "away" ? "Away" : o.word === "idle" ? "Idle" : "Online"
|
|
244
246
|
}
|
|
245
247
|
),
|
|
246
248
|
/* @__PURE__ */ a("p", { className: "text-[13px] font-semibold text-slate-800 dark:text-slate-100 truncate", children: e ? [e.first_name, e.last_name].filter(Boolean).join(" ") || e.email : l }),
|
|
@@ -253,31 +255,32 @@ function ne({
|
|
|
253
255
|
)
|
|
254
256
|
] }),
|
|
255
257
|
((e == null ? void 0 : e.title) || (e == null ? void 0 : e.department)) && /* @__PURE__ */ a("p", { className: "text-[11px] text-slate-500 dark:text-slate-400 truncate mt-0.5", children: [e.title, e.department].filter(Boolean).join(" · ") }),
|
|
256
|
-
|
|
258
|
+
o.word && /* @__PURE__ */ r(
|
|
257
259
|
"p",
|
|
258
260
|
{
|
|
259
261
|
className: "mt-0.5 truncate text-[11px] text-slate-500 dark:text-slate-400",
|
|
260
262
|
"data-card-presence-line": !0,
|
|
261
263
|
children: [
|
|
262
|
-
|
|
263
|
-
|
|
264
|
+
o.word === "away" ? "Away" : o.word === "idle" ? `Idle${o.minutes ? ` · ${o.minutes}m` : ""}` : "Online now",
|
|
265
|
+
o.page ? ` · on ${o.page}` : ""
|
|
264
266
|
]
|
|
265
267
|
}
|
|
266
268
|
),
|
|
267
|
-
|
|
269
|
+
/* @__PURE__ */ a(X, { label: (w == null ? void 0 : w.label) ?? null, className: "mt-0.5" }),
|
|
270
|
+
v && /* @__PURE__ */ r("p", { className: "mt-0.5 text-[11px] text-slate-500 dark:text-slate-400", children: [
|
|
268
271
|
"Local time: ",
|
|
269
|
-
|
|
272
|
+
v
|
|
270
273
|
] }),
|
|
271
274
|
(e == null ? void 0 : e.is_out_of_office) && /* @__PURE__ */ r("span", { className: "mt-1 inline-flex items-center gap-1 rounded-full bg-amber-100 dark:bg-amber-900/30 px-1.5 py-px text-[10px] font-medium text-amber-700 dark:text-amber-400", children: [
|
|
272
275
|
/* @__PURE__ */ a(R, { className: "h-2.5 w-2.5" }),
|
|
273
276
|
" Out of office"
|
|
274
277
|
] }),
|
|
275
278
|
/* @__PURE__ */ a(
|
|
276
|
-
|
|
279
|
+
I,
|
|
277
280
|
{
|
|
278
281
|
email: e == null ? void 0 : e.email,
|
|
279
|
-
enabled:
|
|
280
|
-
canClear:
|
|
282
|
+
enabled: f,
|
|
283
|
+
canClear: b,
|
|
281
284
|
className: "mt-1"
|
|
282
285
|
}
|
|
283
286
|
)
|
|
@@ -307,24 +310,24 @@ function ne({
|
|
|
307
310
|
}
|
|
308
311
|
)
|
|
309
312
|
] }),
|
|
310
|
-
((e == null ? void 0 : e.role_name) ||
|
|
313
|
+
((e == null ? void 0 : e.role_name) || u || g) && /* @__PURE__ */ r("div", { className: "px-4 py-3 space-y-1.5 border-b border-slate-100 dark:border-border", children: [
|
|
311
314
|
(e == null ? void 0 : e.role_name) && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[11px] text-slate-500 dark:text-slate-400", children: [
|
|
312
315
|
/* @__PURE__ */ a(q, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
313
316
|
/* @__PURE__ */ a("span", { children: e.role_name })
|
|
314
317
|
] }),
|
|
315
|
-
|
|
316
|
-
/* @__PURE__ */ a(
|
|
318
|
+
u && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[11px] text-slate-500 dark:text-slate-400", children: [
|
|
319
|
+
/* @__PURE__ */ a(B, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
317
320
|
/* @__PURE__ */ r("span", { children: [
|
|
318
321
|
"Reports to",
|
|
319
322
|
" ",
|
|
320
|
-
/* @__PURE__ */ a("span", { className: "font-medium text-slate-600 dark:text-slate-300", children:
|
|
323
|
+
/* @__PURE__ */ a("span", { className: "font-medium text-slate-600 dark:text-slate-300", children: u })
|
|
321
324
|
] })
|
|
322
325
|
] }),
|
|
323
|
-
|
|
326
|
+
g && /* @__PURE__ */ r("div", { className: "flex items-center gap-2 text-[11px] text-slate-400", children: [
|
|
324
327
|
/* @__PURE__ */ a(D, { className: "h-3.5 w-3.5 shrink-0" }),
|
|
325
328
|
/* @__PURE__ */ r("span", { children: [
|
|
326
329
|
"Last seen ",
|
|
327
|
-
|
|
330
|
+
g
|
|
328
331
|
] })
|
|
329
332
|
] })
|
|
330
333
|
] }),
|
|
@@ -334,11 +337,11 @@ function ne({
|
|
|
334
337
|
{
|
|
335
338
|
type: "button",
|
|
336
339
|
onClick: () => {
|
|
337
|
-
n == null || n(),
|
|
340
|
+
n == null || n(), c(d);
|
|
338
341
|
},
|
|
339
342
|
className: "flex flex-1 items-center justify-center gap-1.5 rounded-md px-3 py-1.5 text-[11px] font-medium text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-accent transition-colors",
|
|
340
343
|
children: [
|
|
341
|
-
/* @__PURE__ */ a(
|
|
344
|
+
/* @__PURE__ */ a(B, { className: "h-3.5 w-3.5" }),
|
|
342
345
|
" View profile"
|
|
343
346
|
]
|
|
344
347
|
}
|
|
@@ -379,37 +382,37 @@ function ne({
|
|
|
379
382
|
}
|
|
380
383
|
);
|
|
381
384
|
}
|
|
382
|
-
function
|
|
385
|
+
function se({
|
|
383
386
|
userId: e,
|
|
384
387
|
size: l = "default",
|
|
385
388
|
children: s
|
|
386
389
|
}) {
|
|
387
|
-
const
|
|
388
|
-
|
|
390
|
+
const c = P(), { navigate: d, userUrl: m } = W(), p = m ? m(e) : `/users/${e}`, [n, f] = $(!1), b = L.useId();
|
|
391
|
+
O(
|
|
389
392
|
n,
|
|
390
393
|
(t) => {
|
|
391
|
-
var
|
|
392
|
-
return !!((
|
|
394
|
+
var i, x, h, y;
|
|
395
|
+
return !!((i = t.closest) != null && i.call(t, `[data-nvr-user-card="${CSS.escape(b)}"]`)) || !!((x = t.closest) != null && x.call(t, `[data-nvr-user-chip="${CSS.escape(b)}"]`)) || // Anything else floating above the card (a tooltip, a nested menu).
|
|
393
396
|
!!((h = t.closest) != null && h.call(t, "[data-radix-popper-content-wrapper]")) && !((y = t.closest) != null && y.call(t, "[data-nvr-user-card]"));
|
|
394
397
|
},
|
|
395
|
-
() =>
|
|
398
|
+
() => f(!1)
|
|
396
399
|
);
|
|
397
|
-
const { data:
|
|
398
|
-
...
|
|
399
|
-
enabled: !!
|
|
400
|
+
const { data: o, isLoading: w } = _({
|
|
401
|
+
...Z(c, e),
|
|
402
|
+
enabled: !!c && !!e,
|
|
400
403
|
staleTime: 12e4
|
|
401
|
-
}), { data:
|
|
404
|
+
}), { data: u } = _({
|
|
402
405
|
queryKey: ["user-presence", e],
|
|
403
|
-
queryFn: () =>
|
|
404
|
-
enabled: !!
|
|
406
|
+
queryFn: () => c.request(M(`/presence/users/${e}`)).then((t) => t),
|
|
407
|
+
enabled: !!c && !!e && n,
|
|
405
408
|
staleTime: 15e3,
|
|
406
409
|
refetchInterval: n ? 2e4 : !1
|
|
407
|
-
}),
|
|
410
|
+
}), v = o ? [o.first_name, o.last_name].filter(Boolean).join(" ") || o.email : e, g = v.split(" ").map((t) => t[0]).filter(Boolean).slice(0, 2).join("").toUpperCase(), k = (u == null ? void 0 : u.online) ?? !1;
|
|
408
411
|
return w && !s ? l === "compact" ? /* @__PURE__ */ a("span", { className: "animate-pulse inline-block h-3.5 w-16 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }) : /* @__PURE__ */ r("span", { className: "inline-flex items-center gap-1.5 rounded-full border border-slate-200 bg-slate-50 py-0.5 pl-0.5 pr-2.5", children: [
|
|
409
412
|
/* @__PURE__ */ a("span", { className: "flex h-6 w-6 shrink-0 rounded-full animate-pulse bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))]" }),
|
|
410
413
|
/* @__PURE__ */ a("span", { className: "animate-pulse h-2.5 w-16 rounded bg-slate-200 dark:bg-[hsl(var(--nvr-skeleton))] inline-block" })
|
|
411
|
-
] }) : /* @__PURE__ */ r(
|
|
412
|
-
/* @__PURE__ */ a(
|
|
414
|
+
] }) : /* @__PURE__ */ r(ee, { open: n, onOpenChange: f, children: [
|
|
415
|
+
/* @__PURE__ */ a(te, { asChild: !0, "data-nvr-user-chip": b, children: s || (l === "compact" ? /* @__PURE__ */ r("span", { className: "inline-flex cursor-pointer items-center gap-1 rounded-full bg-slate-100 dark:bg-slate-800 py-px pl-px pr-1.5 hover:bg-slate-200 dark:hover:bg-slate-700 transition-colors", children: [
|
|
413
416
|
/* @__PURE__ */ a(
|
|
414
417
|
C,
|
|
415
418
|
{
|
|
@@ -421,12 +424,12 @@ function re({
|
|
|
421
424
|
"data-copy-skip": !0,
|
|
422
425
|
"aria-hidden": "true",
|
|
423
426
|
className: "flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-nvr-cyan/20 text-[9px] font-bold text-nvr-navy dark:text-nvr-cyan",
|
|
424
|
-
children:
|
|
427
|
+
children: g
|
|
425
428
|
}
|
|
426
429
|
)
|
|
427
430
|
}
|
|
428
431
|
),
|
|
429
|
-
/* @__PURE__ */ a("span", { className: "text-[11px] font-medium text-slate-600 dark:text-slate-300", children:
|
|
432
|
+
/* @__PURE__ */ a("span", { className: "text-[11px] font-medium text-slate-600 dark:text-slate-300", children: v })
|
|
430
433
|
] }) : /* @__PURE__ */ r("div", { className: "inline-flex cursor-pointer items-center gap-1.5 rounded-full border border-slate-200 bg-slate-50 py-0.5 pl-0.5 pr-2.5 hover:bg-slate-100 dark:border-border dark:bg-card dark:hover:bg-accent transition-colors", children: [
|
|
431
434
|
/* @__PURE__ */ a(
|
|
432
435
|
C,
|
|
@@ -439,32 +442,32 @@ function re({
|
|
|
439
442
|
"data-copy-skip": !0,
|
|
440
443
|
"aria-hidden": "true",
|
|
441
444
|
className: "flex h-6 w-6 items-center justify-center rounded-full bg-nvr-cyan/15 text-[10px] font-semibold text-nvr-navy dark:text-nvr-cyan",
|
|
442
|
-
children:
|
|
445
|
+
children: g
|
|
443
446
|
}
|
|
444
447
|
)
|
|
445
448
|
}
|
|
446
449
|
),
|
|
447
|
-
/* @__PURE__ */ a("span", { className: "text-[12px] text-slate-700 dark:text-slate-300", children:
|
|
450
|
+
/* @__PURE__ */ a("span", { className: "text-[12px] text-slate-700 dark:text-slate-300", children: v })
|
|
448
451
|
] })) }),
|
|
449
452
|
/* @__PURE__ */ a(
|
|
450
|
-
|
|
453
|
+
le,
|
|
451
454
|
{
|
|
452
|
-
user:
|
|
455
|
+
user: o,
|
|
453
456
|
userId: e,
|
|
454
|
-
initials:
|
|
457
|
+
initials: g,
|
|
455
458
|
navigate: d,
|
|
456
|
-
profileUrl:
|
|
457
|
-
online:
|
|
458
|
-
cardId:
|
|
459
|
-
onAction: () =>
|
|
459
|
+
profileUrl: p,
|
|
460
|
+
online: k,
|
|
461
|
+
cardId: b,
|
|
462
|
+
onAction: () => f(!1),
|
|
460
463
|
open: n
|
|
461
464
|
}
|
|
462
465
|
)
|
|
463
466
|
] });
|
|
464
467
|
}
|
|
465
468
|
export {
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
469
|
+
Ce as OwnersInline,
|
|
470
|
+
Ne as OwnersInlineCompact,
|
|
471
|
+
se as UserChip,
|
|
472
|
+
ne as UserRosterCluster
|
|
470
473
|
};
|