@arbidocs/react 0.3.159 → 0.3.161
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/index.cjs +285 -120
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +60 -6
- package/dist/index.d.ts +60 -6
- package/dist/index.js +287 -122
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -1349,6 +1349,9 @@ var ChatBubble = React2.memo(function ChatBubble2({
|
|
|
1349
1349
|
deleted,
|
|
1350
1350
|
read,
|
|
1351
1351
|
onDelete,
|
|
1352
|
+
onCopyLink,
|
|
1353
|
+
id,
|
|
1354
|
+
highlighted,
|
|
1352
1355
|
isLastOfRun = true,
|
|
1353
1356
|
senderName,
|
|
1354
1357
|
classNames,
|
|
@@ -1358,11 +1361,12 @@ var ChatBubble = React2.memo(function ChatBubble2({
|
|
|
1358
1361
|
}) {
|
|
1359
1362
|
const [isHovered, setIsHovered] = React2.useState(false);
|
|
1360
1363
|
const [isFocused, setIsFocused] = React2.useState(false);
|
|
1361
|
-
const
|
|
1364
|
+
const showActions = isHovered || isFocused;
|
|
1362
1365
|
if (deleted) {
|
|
1363
1366
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1364
1367
|
"div",
|
|
1365
1368
|
{
|
|
1369
|
+
id,
|
|
1366
1370
|
"data-testid": testId,
|
|
1367
1371
|
className: `flex w-full ${isSent ? "justify-end" : "justify-start"} mb-2`,
|
|
1368
1372
|
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm text-muted-foreground italic px-3 py-1", children: "Message deleted" })
|
|
@@ -1375,9 +1379,25 @@ var ChatBubble = React2.memo(function ChatBubble2({
|
|
|
1375
1379
|
!isSent && isLastOfRun && "rounded-bl-sm"
|
|
1376
1380
|
);
|
|
1377
1381
|
const bubbleSurface = isSent ? chunkZBZKHBDS_cjs.cn("bg-ai-accent-soft text-foreground chat-bubble-sent", classNames?.ownBubble) : chunkZBZKHBDS_cjs.cn("border border-border bg-card text-card-foreground", classNames?.peerBubble);
|
|
1382
|
+
const highlightClass = highlighted && "ring-2 ring-blue-400 dark:ring-blue-600";
|
|
1383
|
+
const copyLinkButton = onCopyLink && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1384
|
+
"button",
|
|
1385
|
+
{
|
|
1386
|
+
onClick: onCopyLink,
|
|
1387
|
+
onFocus: () => setIsFocused(true),
|
|
1388
|
+
onBlur: () => setIsFocused(false),
|
|
1389
|
+
className: chunkZBZKHBDS_cjs.cn(
|
|
1390
|
+
"self-end p-1 transition-opacity focus:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded",
|
|
1391
|
+
showActions ? "opacity-100 text-foreground" : "opacity-0 text-muted-foreground"
|
|
1392
|
+
),
|
|
1393
|
+
"aria-label": "Copy link to this message",
|
|
1394
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Link, { className: "w-3.5 h-3.5" })
|
|
1395
|
+
}
|
|
1396
|
+
);
|
|
1378
1397
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1379
1398
|
"div",
|
|
1380
1399
|
{
|
|
1400
|
+
id,
|
|
1381
1401
|
"data-testid": testId,
|
|
1382
1402
|
className: chunkZBZKHBDS_cjs.cn(
|
|
1383
1403
|
"flex w-full items-end",
|
|
@@ -1387,51 +1407,68 @@ var ChatBubble = React2.memo(function ChatBubble2({
|
|
|
1387
1407
|
onMouseEnter: () => setIsHovered(true),
|
|
1388
1408
|
onMouseLeave: () => setIsHovered(false),
|
|
1389
1409
|
children: [
|
|
1390
|
-
isSent && onDelete && /* @__PURE__ */ jsxRuntime.
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
onFocus: () => setIsFocused(true),
|
|
1395
|
-
onBlur: () => setIsFocused(false),
|
|
1396
|
-
className: chunkZBZKHBDS_cjs.cn(
|
|
1397
|
-
"self-end p-1 mr-1 transition-opacity focus:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded",
|
|
1398
|
-
showDeleteButton ? "opacity-100 text-destructive" : "opacity-0 text-muted-foreground"
|
|
1399
|
-
),
|
|
1400
|
-
"aria-label": "Delete message",
|
|
1401
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "w-3.5 h-3.5" })
|
|
1402
|
-
}
|
|
1403
|
-
),
|
|
1404
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col max-w-[80%] md:max-w-[60%]", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: chunkZBZKHBDS_cjs.cn("px-3.5 py-2 break-words shadow-sm", bubbleRadius, bubbleSurface), children: [
|
|
1405
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm [&_.markdown-content]:space-y-1.5 [&_pre]:max-w-full [&_pre]:overflow-x-auto", children: renderMessage(message) }),
|
|
1406
|
-
isLastOfRun && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1407
|
-
"div",
|
|
1410
|
+
isSent && (copyLinkButton || onDelete) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5 mr-1", children: [
|
|
1411
|
+
copyLinkButton,
|
|
1412
|
+
onDelete && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1413
|
+
"button",
|
|
1408
1414
|
{
|
|
1415
|
+
onClick: onDelete,
|
|
1416
|
+
onFocus: () => setIsFocused(true),
|
|
1417
|
+
onBlur: () => setIsFocused(false),
|
|
1409
1418
|
className: chunkZBZKHBDS_cjs.cn(
|
|
1410
|
-
"
|
|
1411
|
-
|
|
1419
|
+
"self-end p-1 transition-opacity focus:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded",
|
|
1420
|
+
showActions ? "opacity-100 text-destructive" : "opacity-0 text-muted-foreground"
|
|
1412
1421
|
),
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] leading-none opacity-70", children: formatTimestamp(timestamp) }),
|
|
1416
|
-
isSent && (read ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCheck, { className: "w-3.5 h-3.5 flex-shrink-0 opacity-80" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "w-3.5 h-3.5 flex-shrink-0 opacity-60" }))
|
|
1417
|
-
]
|
|
1422
|
+
"aria-label": "Delete message",
|
|
1423
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "w-3.5 h-3.5" })
|
|
1418
1424
|
}
|
|
1419
1425
|
)
|
|
1420
|
-
] })
|
|
1421
|
-
|
|
1422
|
-
"
|
|
1426
|
+
] }),
|
|
1427
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex flex-col max-w-[80%] md:max-w-[60%]", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1428
|
+
"div",
|
|
1423
1429
|
{
|
|
1424
|
-
onClick: onDelete,
|
|
1425
|
-
onFocus: () => setIsFocused(true),
|
|
1426
|
-
onBlur: () => setIsFocused(false),
|
|
1427
1430
|
className: chunkZBZKHBDS_cjs.cn(
|
|
1428
|
-
"
|
|
1429
|
-
|
|
1431
|
+
"px-3.5 py-2 break-words shadow-sm transition-shadow",
|
|
1432
|
+
bubbleRadius,
|
|
1433
|
+
bubbleSurface,
|
|
1434
|
+
highlightClass
|
|
1430
1435
|
),
|
|
1431
|
-
|
|
1432
|
-
|
|
1436
|
+
children: [
|
|
1437
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-sm [&_.markdown-content]:space-y-1.5 [&_pre]:max-w-full [&_pre]:overflow-x-auto", children: renderMessage(message) }),
|
|
1438
|
+
isLastOfRun && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1439
|
+
"div",
|
|
1440
|
+
{
|
|
1441
|
+
className: chunkZBZKHBDS_cjs.cn(
|
|
1442
|
+
"flex items-center gap-1.5 mt-0.5",
|
|
1443
|
+
isSent ? "justify-end" : "justify-start"
|
|
1444
|
+
),
|
|
1445
|
+
children: [
|
|
1446
|
+
senderName && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] font-medium leading-none opacity-90", children: senderName }),
|
|
1447
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-[11px] leading-none opacity-70", children: formatTimestamp(timestamp) }),
|
|
1448
|
+
isSent && (read ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCheck, { className: "w-3.5 h-3.5 flex-shrink-0 opacity-80" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Check, { className: "w-3.5 h-3.5 flex-shrink-0 opacity-60" }))
|
|
1449
|
+
]
|
|
1450
|
+
}
|
|
1451
|
+
)
|
|
1452
|
+
]
|
|
1433
1453
|
}
|
|
1434
|
-
)
|
|
1454
|
+
) }),
|
|
1455
|
+
!isSent && (onDelete || copyLinkButton) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-0.5 ml-1", children: [
|
|
1456
|
+
onDelete && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1457
|
+
"button",
|
|
1458
|
+
{
|
|
1459
|
+
onClick: onDelete,
|
|
1460
|
+
onFocus: () => setIsFocused(true),
|
|
1461
|
+
onBlur: () => setIsFocused(false),
|
|
1462
|
+
className: chunkZBZKHBDS_cjs.cn(
|
|
1463
|
+
"self-end p-1 transition-opacity focus:outline-none focus-visible:ring-1 focus-visible:ring-ring rounded",
|
|
1464
|
+
showActions ? "opacity-100 text-destructive" : "opacity-0 text-muted-foreground"
|
|
1465
|
+
),
|
|
1466
|
+
"aria-label": "Delete message",
|
|
1467
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Trash2, { className: "w-3.5 h-3.5" })
|
|
1468
|
+
}
|
|
1469
|
+
),
|
|
1470
|
+
copyLinkButton
|
|
1471
|
+
] })
|
|
1435
1472
|
]
|
|
1436
1473
|
}
|
|
1437
1474
|
);
|
|
@@ -4362,7 +4399,7 @@ function ProjectEntity({
|
|
|
4362
4399
|
const variant = resolveVariant(relation, paid, hasCollaborators);
|
|
4363
4400
|
const { pill, icon: iconClass } = VARIANT_STYLES[variant];
|
|
4364
4401
|
const iconSizeClass = size === "base" ? "h-4 w-4" : "h-3.5 w-3.5";
|
|
4365
|
-
const iconNode = icon ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.
|
|
4402
|
+
const iconNode = icon ?? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.CreditCard, { className: chunkZBZKHBDS_cjs.cn(iconSizeClass, iconClass) });
|
|
4366
4403
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
4367
4404
|
EntityPill,
|
|
4368
4405
|
{
|
|
@@ -4504,18 +4541,22 @@ var UserEntity = React2.memo(function UserEntity2({
|
|
|
4504
4541
|
]
|
|
4505
4542
|
}
|
|
4506
4543
|
) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: chunkZBZKHBDS_cjs.cn("inline-block", variant === "pill" ? "" : className), children: avatarCore });
|
|
4507
|
-
const pillAvatar =
|
|
4508
|
-
|
|
4509
|
-
|
|
4510
|
-
|
|
4511
|
-
{
|
|
4512
|
-
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4544
|
+
const pillAvatar = (
|
|
4545
|
+
// shrink-0: when the pill is squeezed the NAME truncates away — the avatar
|
|
4546
|
+
// must never collapse under it and overflow onto neighbouring text.
|
|
4547
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: chunkZBZKHBDS_cjs.cn("relative inline-block shrink-0", sizeClasses[size]), children: [
|
|
4548
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkZBZKHBDS_cjs.cn("block transition-opacity", canMessage && "group-hover/pill:opacity-0"), children: avatarCore }),
|
|
4549
|
+
canMessage && /* @__PURE__ */ jsxRuntime.jsx(
|
|
4550
|
+
"span",
|
|
4551
|
+
{
|
|
4552
|
+
"aria-hidden": true,
|
|
4553
|
+
className: "absolute inset-0 flex items-center justify-center rounded-full bg-muted text-foreground opacity-0 transition-opacity group-hover/pill:opacity-100",
|
|
4554
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MessageCircleMore, { className: size === "xs" ? "h-3 w-3" : "h-4 w-4" })
|
|
4555
|
+
}
|
|
4556
|
+
),
|
|
4557
|
+
statusDot
|
|
4558
|
+
] })
|
|
4559
|
+
);
|
|
4519
4560
|
const resolvedTooltip = showTooltip ? tooltipContent : void 0;
|
|
4520
4561
|
if (variant === "pill") {
|
|
4521
4562
|
const row = /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
@@ -4788,7 +4829,9 @@ var ENTITY_MAPPINGS = {
|
|
|
4788
4829
|
PLURAL: "Contacts"
|
|
4789
4830
|
},
|
|
4790
4831
|
ICONS: {
|
|
4791
|
-
|
|
4832
|
+
// A starred person, not an address-book card: contacts here are the
|
|
4833
|
+
// people you talk to, and the star reads as "your people".
|
|
4834
|
+
DEFAULT: lucideReact.UserStar,
|
|
4792
4835
|
NEW: lucideReact.UserPlus
|
|
4793
4836
|
}
|
|
4794
4837
|
},
|
|
@@ -4807,7 +4850,7 @@ var ENTITY_MAPPINGS = {
|
|
|
4807
4850
|
PLURAL: "Projects"
|
|
4808
4851
|
},
|
|
4809
4852
|
ICONS: {
|
|
4810
|
-
DEFAULT: lucideReact.
|
|
4853
|
+
DEFAULT: lucideReact.CreditCard
|
|
4811
4854
|
}
|
|
4812
4855
|
},
|
|
4813
4856
|
SKILL: {
|
|
@@ -5181,7 +5224,13 @@ var useNotify = zustand.create((set) => ({
|
|
|
5181
5224
|
removeNotification: (id) => set((s) => ({ notifications: s.notifications.filter((n) => n.id !== id) })),
|
|
5182
5225
|
clearNotifications: () => set({ notifications: [] }),
|
|
5183
5226
|
seed: (items) => set({ notifications: items }),
|
|
5184
|
-
record: (note) => set((s) => ({ notifications: [note, ...s.notifications].slice(0, 50) }))
|
|
5227
|
+
record: (note) => set((s) => ({ notifications: [note, ...s.notifications].slice(0, 50) })),
|
|
5228
|
+
syncSource: (source, items) => set((s) => ({
|
|
5229
|
+
notifications: [
|
|
5230
|
+
...items.map((n) => ({ ...n, source })),
|
|
5231
|
+
...s.notifications.filter((n) => n.source !== source)
|
|
5232
|
+
].sort((a, b) => b.ts - a.ts).slice(0, 100)
|
|
5233
|
+
}))
|
|
5185
5234
|
}));
|
|
5186
5235
|
function make(variant) {
|
|
5187
5236
|
return (title, opts = {}) => {
|
|
@@ -5200,7 +5249,8 @@ function make(variant) {
|
|
|
5200
5249
|
variant,
|
|
5201
5250
|
ts: Date.now(),
|
|
5202
5251
|
read: false,
|
|
5203
|
-
href: opts.href
|
|
5252
|
+
href: opts.href,
|
|
5253
|
+
ambient: opts.ambient
|
|
5204
5254
|
});
|
|
5205
5255
|
}
|
|
5206
5256
|
return id;
|
|
@@ -5215,7 +5265,7 @@ var notify = {
|
|
|
5215
5265
|
function seedNotifications(items) {
|
|
5216
5266
|
useNotify.getState().seed(items);
|
|
5217
5267
|
}
|
|
5218
|
-
var selectUnread = (s) => s.notifications.filter((n) => !n.read).length;
|
|
5268
|
+
var selectUnread = (s) => s.notifications.filter((n) => !n.read && !n.ambient).length;
|
|
5219
5269
|
var DEFAULT_NOTIFY_TONE = {
|
|
5220
5270
|
success: "text-green-600",
|
|
5221
5271
|
error: "text-destructive",
|
|
@@ -5270,8 +5320,14 @@ var GLYPH = {
|
|
|
5270
5320
|
};
|
|
5271
5321
|
function NotificationBell({
|
|
5272
5322
|
onNavigate,
|
|
5323
|
+
onMarkRead,
|
|
5324
|
+
onMarkAllRead,
|
|
5325
|
+
muted = false,
|
|
5326
|
+
onToggleMute,
|
|
5273
5327
|
toneClassNames,
|
|
5274
5328
|
emptyText = "You're all caught up.",
|
|
5329
|
+
onViewAll,
|
|
5330
|
+
viewAllLabel = "View all",
|
|
5275
5331
|
testId = "notifications"
|
|
5276
5332
|
}) {
|
|
5277
5333
|
const notifications = useNotify((s) => s.notifications);
|
|
@@ -5279,6 +5335,9 @@ function NotificationBell({
|
|
|
5279
5335
|
const markAllRead = useNotify((s) => s.markAllRead);
|
|
5280
5336
|
const markRead = useNotify((s) => s.markRead);
|
|
5281
5337
|
const tone = (v) => toneClassNames?.[v] ?? DEFAULT_NOTIFY_TONE[v];
|
|
5338
|
+
const [showAll, setShowAll] = React2.useState(false);
|
|
5339
|
+
const hasAmbient = notifications.some((n) => n.ambient);
|
|
5340
|
+
const visible = showAll ? notifications : notifications.filter((n) => !n.ambient);
|
|
5282
5341
|
return /* @__PURE__ */ jsxRuntime.jsxs(chunkZBZKHBDS_cjs.DropdownMenu, { children: [
|
|
5283
5342
|
/* @__PURE__ */ jsxRuntime.jsx(chunkZBZKHBDS_cjs.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5284
5343
|
"button",
|
|
@@ -5291,7 +5350,7 @@ function NotificationBell({
|
|
|
5291
5350
|
unread > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5292
5351
|
"span",
|
|
5293
5352
|
{
|
|
5294
|
-
className: "absolute -right-0.5 -top-0.5 flex min-w-4 items-center justify-center rounded-full bg-
|
|
5353
|
+
className: "absolute -right-0.5 -top-0.5 flex min-w-4 items-center justify-center rounded-full bg-secondary px-1 text-[10px] font-semibold leading-4 text-secondary-foreground",
|
|
5295
5354
|
"data-testid": `${testId}-badge`,
|
|
5296
5355
|
children: unread > 9 ? "9+" : unread
|
|
5297
5356
|
}
|
|
@@ -5299,49 +5358,113 @@ function NotificationBell({
|
|
|
5299
5358
|
]
|
|
5300
5359
|
}
|
|
5301
5360
|
) }),
|
|
5302
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5303
|
-
|
|
5304
|
-
|
|
5305
|
-
|
|
5306
|
-
|
|
5307
|
-
|
|
5308
|
-
|
|
5309
|
-
|
|
5310
|
-
|
|
5311
|
-
|
|
5312
|
-
|
|
5313
|
-
|
|
5314
|
-
|
|
5315
|
-
|
|
5316
|
-
|
|
5317
|
-
|
|
5318
|
-
|
|
5319
|
-
|
|
5320
|
-
|
|
5321
|
-
|
|
5322
|
-
|
|
5323
|
-
|
|
5324
|
-
|
|
5325
|
-
|
|
5326
|
-
|
|
5327
|
-
|
|
5328
|
-
|
|
5329
|
-
|
|
5330
|
-
|
|
5331
|
-
|
|
5332
|
-
|
|
5333
|
-
|
|
5334
|
-
|
|
5335
|
-
|
|
5336
|
-
|
|
5337
|
-
|
|
5338
|
-
|
|
5339
|
-
|
|
5340
|
-
|
|
5341
|
-
|
|
5342
|
-
|
|
5343
|
-
|
|
5344
|
-
|
|
5361
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
5362
|
+
chunkZBZKHBDS_cjs.DropdownMenuContent,
|
|
5363
|
+
{
|
|
5364
|
+
align: "end",
|
|
5365
|
+
sideOffset: 8,
|
|
5366
|
+
collisionPadding: 12,
|
|
5367
|
+
className: "w-[360px] rounded-lg border-border/60 p-0 shadow-lg",
|
|
5368
|
+
"data-testid": `${testId}-panel`,
|
|
5369
|
+
children: [
|
|
5370
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center justify-between gap-3 border-b border-border px-3.5 py-2.5", children: [
|
|
5371
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-semibold text-foreground", children: "Notifications" }),
|
|
5372
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
5373
|
+
hasAmbient && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5374
|
+
"button",
|
|
5375
|
+
{
|
|
5376
|
+
onClick: () => setShowAll((v) => !v),
|
|
5377
|
+
"aria-pressed": showAll,
|
|
5378
|
+
className: chunkZBZKHBDS_cjs.cn(
|
|
5379
|
+
"text-xs font-medium transition-colors",
|
|
5380
|
+
showAll ? "text-primary" : "text-muted-foreground hover:text-foreground"
|
|
5381
|
+
),
|
|
5382
|
+
"data-testid": `${testId}-all-activity`,
|
|
5383
|
+
children: "All activity"
|
|
5384
|
+
}
|
|
5385
|
+
),
|
|
5386
|
+
unread > 0 && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5387
|
+
"button",
|
|
5388
|
+
{
|
|
5389
|
+
onClick: () => {
|
|
5390
|
+
markAllRead();
|
|
5391
|
+
onMarkAllRead?.();
|
|
5392
|
+
},
|
|
5393
|
+
className: "flex items-center gap-1 text-xs font-medium text-primary transition-colors hover:opacity-80",
|
|
5394
|
+
"data-testid": `${testId}-mark-all`,
|
|
5395
|
+
children: [
|
|
5396
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.CheckCheck, { className: "size-3.5" }),
|
|
5397
|
+
" Mark all read"
|
|
5398
|
+
]
|
|
5399
|
+
}
|
|
5400
|
+
),
|
|
5401
|
+
onToggleMute && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5402
|
+
"button",
|
|
5403
|
+
{
|
|
5404
|
+
onClick: onToggleMute,
|
|
5405
|
+
"aria-pressed": muted,
|
|
5406
|
+
title: muted ? "Unmute notifications" : "Mute notifications",
|
|
5407
|
+
"aria-label": muted ? "Unmute notifications" : "Mute notifications",
|
|
5408
|
+
className: chunkZBZKHBDS_cjs.cn(
|
|
5409
|
+
"flex size-6 items-center justify-center rounded-md transition-colors hover:bg-accent",
|
|
5410
|
+
muted ? "text-foreground" : "text-muted-foreground hover:text-foreground"
|
|
5411
|
+
),
|
|
5412
|
+
"data-testid": `${testId}-mute`,
|
|
5413
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.BellOff, { className: "size-3.5" })
|
|
5414
|
+
}
|
|
5415
|
+
)
|
|
5416
|
+
] })
|
|
5417
|
+
] }),
|
|
5418
|
+
muted && /* @__PURE__ */ jsxRuntime.jsx(
|
|
5419
|
+
"p",
|
|
5420
|
+
{
|
|
5421
|
+
className: "border-b border-border/60 bg-amber-500/10 px-3.5 py-1.5 text-[11px] text-muted-foreground",
|
|
5422
|
+
"data-testid": `${testId}-muted-note`,
|
|
5423
|
+
children: "Toasts are muted \u2014 everything still lands here."
|
|
5424
|
+
}
|
|
5425
|
+
),
|
|
5426
|
+
visible.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "px-3.5 py-10 text-center text-sm text-muted-foreground", children: emptyText }) : /* @__PURE__ */ jsxRuntime.jsx(chunkZBZKHBDS_cjs.ScrollArea, { className: "max-h-[380px]", children: /* @__PURE__ */ jsxRuntime.jsx("ul", { "data-testid": `${testId}-list`, children: visible.map((n) => {
|
|
5427
|
+
const Glyph = GLYPH[n.variant];
|
|
5428
|
+
return /* @__PURE__ */ jsxRuntime.jsx("li", { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
5429
|
+
"button",
|
|
5430
|
+
{
|
|
5431
|
+
onClick: () => {
|
|
5432
|
+
markRead(n.id);
|
|
5433
|
+
if (!n.read) onMarkRead?.(n.id);
|
|
5434
|
+
if (n.onSelect) n.onSelect();
|
|
5435
|
+
else if (n.href) onNavigate?.(n.href);
|
|
5436
|
+
},
|
|
5437
|
+
className: chunkZBZKHBDS_cjs.cn(
|
|
5438
|
+
"flex w-full items-start gap-3 border-b border-border/60 px-3.5 py-3 text-left transition-colors hover:bg-accent",
|
|
5439
|
+
!n.read && "bg-accent/40"
|
|
5440
|
+
),
|
|
5441
|
+
"data-testid": `${testId}-item`,
|
|
5442
|
+
children: [
|
|
5443
|
+
/* @__PURE__ */ jsxRuntime.jsx(Glyph, { className: chunkZBZKHBDS_cjs.cn("mt-0.5 size-4 shrink-0", tone(n.variant)) }),
|
|
5444
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
5445
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm font-medium leading-snug text-foreground", children: n.title }),
|
|
5446
|
+
n.description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-0.5 line-clamp-2 text-xs leading-relaxed text-muted-foreground", children: n.description }),
|
|
5447
|
+
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1 text-[11px] text-muted-foreground/80", children: formatRelativeTime(new Date(n.ts).toISOString()) })
|
|
5448
|
+
] }),
|
|
5449
|
+
!n.read && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "mt-1.5 size-2 shrink-0 rounded-full bg-primary" })
|
|
5450
|
+
]
|
|
5451
|
+
}
|
|
5452
|
+
) }, n.id);
|
|
5453
|
+
}) }) }),
|
|
5454
|
+
onViewAll && // A real menu item, not a bare button: selecting it must CLOSE the
|
|
5455
|
+
// dropdown on its way to the full surface.
|
|
5456
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5457
|
+
chunkZBZKHBDS_cjs.DropdownMenuItem,
|
|
5458
|
+
{
|
|
5459
|
+
onClick: onViewAll,
|
|
5460
|
+
className: "justify-center rounded-none border-t border-border px-3.5 py-2.5 text-xs font-medium text-primary focus:text-primary",
|
|
5461
|
+
"data-testid": `${testId}-view-all`,
|
|
5462
|
+
children: viewAllLabel
|
|
5463
|
+
}
|
|
5464
|
+
)
|
|
5465
|
+
]
|
|
5466
|
+
}
|
|
5467
|
+
)
|
|
5345
5468
|
] });
|
|
5346
5469
|
}
|
|
5347
5470
|
var DEFAULT_TOAST_OPTIONS = {
|
|
@@ -6304,8 +6427,14 @@ function nameInitials(name) {
|
|
|
6304
6427
|
if (!parts.length) return "?";
|
|
6305
6428
|
return parts.slice(0, 2).map((p) => p[0]?.toUpperCase() ?? "").join("");
|
|
6306
6429
|
}
|
|
6430
|
+
var STATUS_DOT = {
|
|
6431
|
+
online: "bg-emerald-500",
|
|
6432
|
+
busy: "bg-amber-500",
|
|
6433
|
+
offline: "bg-destructive"
|
|
6434
|
+
};
|
|
6307
6435
|
function UserMenu({
|
|
6308
6436
|
user,
|
|
6437
|
+
status,
|
|
6309
6438
|
items = [],
|
|
6310
6439
|
onLogout,
|
|
6311
6440
|
logoutLabel = "Sign out",
|
|
@@ -6324,13 +6453,26 @@ function UserMenu({
|
|
|
6324
6453
|
),
|
|
6325
6454
|
"data-testid": testId,
|
|
6326
6455
|
children: [
|
|
6327
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6328
|
-
|
|
6329
|
-
|
|
6330
|
-
|
|
6456
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "relative", children: [
|
|
6457
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZBZKHBDS_cjs.Avatar, { className: "size-8", children: [
|
|
6458
|
+
user.picture ? /* @__PURE__ */ jsxRuntime.jsx(chunkZBZKHBDS_cjs.AvatarImage, { src: user.picture, alt: user.name }) : null,
|
|
6459
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6460
|
+
chunkZBZKHBDS_cjs.AvatarFallback,
|
|
6461
|
+
{
|
|
6462
|
+
className: chunkZBZKHBDS_cjs.cn("bg-primary text-primary-foreground", classNames?.fallback),
|
|
6463
|
+
children: nameInitials(user.name)
|
|
6464
|
+
}
|
|
6465
|
+
)
|
|
6466
|
+
] }),
|
|
6467
|
+
status && /* @__PURE__ */ jsxRuntime.jsx(
|
|
6468
|
+
"span",
|
|
6331
6469
|
{
|
|
6332
|
-
className: chunkZBZKHBDS_cjs.cn(
|
|
6333
|
-
|
|
6470
|
+
className: chunkZBZKHBDS_cjs.cn(
|
|
6471
|
+
"absolute -bottom-0.5 -right-0.5 size-2.5 rounded-full border-2 border-background",
|
|
6472
|
+
STATUS_DOT[status.tone]
|
|
6473
|
+
),
|
|
6474
|
+
title: status.detail ? `${status.label} \xB7 ${status.detail}` : status.label,
|
|
6475
|
+
"data-testid": status.testId ? `${status.testId}-dot` : void 0
|
|
6334
6476
|
}
|
|
6335
6477
|
)
|
|
6336
6478
|
] }),
|
|
@@ -6338,21 +6480,44 @@ function UserMenu({
|
|
|
6338
6480
|
]
|
|
6339
6481
|
}
|
|
6340
6482
|
) }),
|
|
6341
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6342
|
-
|
|
6343
|
-
|
|
6344
|
-
|
|
6345
|
-
|
|
6346
|
-
|
|
6347
|
-
|
|
6348
|
-
|
|
6349
|
-
|
|
6350
|
-
|
|
6351
|
-
|
|
6352
|
-
|
|
6353
|
-
|
|
6354
|
-
|
|
6355
|
-
|
|
6483
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
6484
|
+
chunkZBZKHBDS_cjs.DropdownMenuContent,
|
|
6485
|
+
{
|
|
6486
|
+
align,
|
|
6487
|
+
sideOffset: 8,
|
|
6488
|
+
collisionPadding: 12,
|
|
6489
|
+
className: "w-56 rounded-lg border-border/60 shadow-lg",
|
|
6490
|
+
children: [
|
|
6491
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZBZKHBDS_cjs.DropdownMenuLabel, { children: [
|
|
6492
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-medium text-foreground", children: user.name }),
|
|
6493
|
+
user.email && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-normal text-muted-foreground", children: user.email }),
|
|
6494
|
+
status && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
6495
|
+
"div",
|
|
6496
|
+
{
|
|
6497
|
+
className: "mt-1 text-xs font-normal text-muted-foreground",
|
|
6498
|
+
"data-testid": status.testId,
|
|
6499
|
+
children: [
|
|
6500
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex items-center gap-1.5", children: [
|
|
6501
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: chunkZBZKHBDS_cjs.cn("size-2 shrink-0 rounded-full", STATUS_DOT[status.tone]) }),
|
|
6502
|
+
status.label
|
|
6503
|
+
] }),
|
|
6504
|
+
status.detail && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-0.5 truncate pl-3.5 text-[10px] leading-tight text-muted-foreground/70", children: status.detail })
|
|
6505
|
+
]
|
|
6506
|
+
}
|
|
6507
|
+
)
|
|
6508
|
+
] }),
|
|
6509
|
+
/* @__PURE__ */ jsxRuntime.jsx(chunkZBZKHBDS_cjs.DropdownMenuSeparator, {}),
|
|
6510
|
+
items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(chunkZBZKHBDS_cjs.DropdownMenuItem, { onClick: item.onSelect, "data-testid": item.testId, children: [
|
|
6511
|
+
item.icon && /* @__PURE__ */ jsxRuntime.jsx(item.icon, { className: "size-4" }),
|
|
6512
|
+
item.label
|
|
6513
|
+
] }, item.label)),
|
|
6514
|
+
/* @__PURE__ */ jsxRuntime.jsxs(chunkZBZKHBDS_cjs.DropdownMenuItem, { onClick: onLogout, "data-testid": logoutTestId ?? `${testId}-logout`, children: [
|
|
6515
|
+
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.LogOut, { className: "size-4" }),
|
|
6516
|
+
logoutLabel
|
|
6517
|
+
] })
|
|
6518
|
+
]
|
|
6519
|
+
}
|
|
6520
|
+
)
|
|
6356
6521
|
] });
|
|
6357
6522
|
}
|
|
6358
6523
|
var useArbiUiStore = zustand.create((set) => ({
|