@dialtribe/chat-client 0.3.0 → 0.4.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/index.mjs CHANGED
@@ -328,6 +328,19 @@ var InboxStore = class extends Store {
328
328
  this.patchRoom(roomId, (room) => ({ ...room, isMuted: muted }));
329
329
  await this.client.dm("chat-dm-mute", { roomId, muted });
330
330
  }
331
+ /**
332
+ * Archive or unarchive for the signed-in user only (optimistic). The room
333
+ * leaves the rail but stays in the inbox; new messages don't unarchive it.
334
+ */
335
+ async setArchived(roomId, archived) {
336
+ this.patchRoom(roomId, (room) => ({ ...room, isArchived: archived }));
337
+ try {
338
+ await this.client.dm("chat-dm-archive", { roomId, archived });
339
+ } catch (err) {
340
+ this.patchRoom(roomId, (room) => ({ ...room, isArchived: !archived }));
341
+ throw err;
342
+ }
343
+ }
331
344
  /** Mark a room read now (optimistic). */
332
345
  async markRead(roomId) {
333
346
  this.patchRoom(roomId, (room) => room.unreadCount === 0 ? room : { ...room, unreadCount: 0 });
@@ -795,6 +808,7 @@ function useChatRooms() {
795
808
  hideDM: inbox.hideDM.bind(inbox),
796
809
  addParticipant: inbox.addParticipant.bind(inbox),
797
810
  setMuted: inbox.setMuted.bind(inbox),
811
+ setArchived: inbox.setArchived.bind(inbox),
798
812
  markRead: inbox.markRead.bind(inbox),
799
813
  setVisible: inbox.setVisible.bind(inbox),
800
814
  refresh: inbox.refresh.bind(inbox)
@@ -1130,8 +1144,19 @@ var DEFAULT_LABELS = {
1130
1144
  reopen: "Reopen",
1131
1145
  closeConversation: "Close conversation",
1132
1146
  removeConversation: "Remove from inbox",
1133
- mute: "Mute",
1134
- unmute: "Unmute",
1147
+ mute: "Mute notifications",
1148
+ unmute: "Unmute notifications",
1149
+ archive: "Archive conversation",
1150
+ unarchive: "Unarchive conversation",
1151
+ archived: "Archived",
1152
+ moreOptions: "More options",
1153
+ muteConfirmTitle: (name) => `Mute notifications from ${name}?`,
1154
+ muteConfirmBody: "You won't get alerts or unread badges for this conversation. Messages still arrive.",
1155
+ muteConfirm: "Mute",
1156
+ archiveConfirmTitle: (name) => `Archive your conversation with ${name}?`,
1157
+ archiveConfirmBody: "It moves off your rail and into Archived in Messages. New messages still count toward your unread. Only you will see that it's archived.",
1158
+ archiveConfirm: "Archive",
1159
+ cancel: "Cancel",
1135
1160
  messagePlaceholder: "Message...",
1136
1161
  openMessages: "Open messages"
1137
1162
  };
@@ -1139,7 +1164,11 @@ function badgeText(count) {
1139
1164
  return count > 99 ? "99+" : String(count);
1140
1165
  }
1141
1166
  function MessagesInbox({ rooms, requests, labels, onOpenRoom, onRemoveRoom }) {
1142
- const conversations = rooms.filter((r) => r.myStatus === "accepted");
1167
+ const [showArchived, setShowArchived] = useState(false);
1168
+ const accepted = rooms.filter((r) => r.myStatus === "accepted");
1169
+ const conversations = accepted.filter((r) => !r.isArchived);
1170
+ const archived = accepted.filter((r) => r.isArchived);
1171
+ const archivedUnread = archived.reduce((sum, r) => sum + (r.isMuted ? 0 : r.unreadCount), 0);
1143
1172
  if (rooms.length === 0) return /* @__PURE__ */ jsx("div", { className: "dtc-empty", children: labels.noMessages });
1144
1173
  return /* @__PURE__ */ jsxs("div", { className: "dtc-inbox", children: [
1145
1174
  requests.length > 0 && /* @__PURE__ */ jsxs("section", { className: "dtc-inbox-section", children: [
@@ -1155,7 +1184,29 @@ function MessagesInbox({ rooms, requests, labels, onOpenRoom, onRemoveRoom }) {
1155
1184
  removeLabel: labels.removeConversation
1156
1185
  },
1157
1186
  room.roomId
1158
- )) })
1187
+ )) }),
1188
+ archived.length > 0 && /* @__PURE__ */ jsxs("section", { className: "dtc-inbox-section", children: [
1189
+ /* @__PURE__ */ jsxs(
1190
+ "button",
1191
+ {
1192
+ type: "button",
1193
+ className: "dtc-inbox-heading dtc-inbox-toggle",
1194
+ "aria-expanded": showArchived,
1195
+ onClick: () => setShowArchived((v) => !v),
1196
+ children: [
1197
+ /* @__PURE__ */ jsxs("span", { children: [
1198
+ labels.archived,
1199
+ " (",
1200
+ archived.length,
1201
+ ")"
1202
+ ] }),
1203
+ !showArchived && archivedUnread > 0 && /* @__PURE__ */ jsx("span", { className: "dtc-badge-count", children: badgeText(archivedUnread) }),
1204
+ /* @__PURE__ */ jsx("svg", { className: "dtc-inbox-toggle-icon", viewBox: "0 0 24 24", width: "14", height: "14", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M6 9l6 6 6-6" }) })
1205
+ ]
1206
+ }
1207
+ ),
1208
+ showArchived && archived.map((room) => /* @__PURE__ */ jsx(InboxRow, { room, onOpen: onOpenRoom }, room.roomId))
1209
+ ] })
1159
1210
  ] });
1160
1211
  }
1161
1212
  function InboxRow({
@@ -1188,7 +1239,78 @@ function InboxRow({
1188
1239
  )
1189
1240
  ] });
1190
1241
  }
1191
- function ConversationView({ roomId, labels, onBack }) {
1242
+ function ConversationMenu({ label, items }) {
1243
+ const [open, setOpen] = useState(false);
1244
+ const rootRef = useRef(null);
1245
+ const buttonRef = useRef(null);
1246
+ const menuRef = useRef(null);
1247
+ useEffect(() => {
1248
+ if (!open) return;
1249
+ menuRef.current?.querySelector("[role=menuitem]")?.focus();
1250
+ const onPointer = (e) => {
1251
+ if (rootRef.current && !rootRef.current.contains(e.target)) setOpen(false);
1252
+ };
1253
+ const onKey = (e) => {
1254
+ if (e.key !== "Escape") return;
1255
+ e.preventDefault();
1256
+ setOpen(false);
1257
+ buttonRef.current?.focus();
1258
+ };
1259
+ document.addEventListener("pointerdown", onPointer);
1260
+ window.addEventListener("keydown", onKey, true);
1261
+ return () => {
1262
+ document.removeEventListener("pointerdown", onPointer);
1263
+ window.removeEventListener("keydown", onKey, true);
1264
+ };
1265
+ }, [open]);
1266
+ const onMenuKey = (e) => {
1267
+ if (e.key !== "ArrowDown" && e.key !== "ArrowUp") return;
1268
+ e.preventDefault();
1269
+ const buttons = Array.from(menuRef.current?.querySelectorAll("[role=menuitem]") ?? []);
1270
+ const i = buttons.indexOf(document.activeElement);
1271
+ const next = e.key === "ArrowDown" ? (i + 1) % buttons.length : (i - 1 + buttons.length) % buttons.length;
1272
+ buttons[next]?.focus();
1273
+ };
1274
+ if (items.length === 0) return null;
1275
+ return /* @__PURE__ */ jsxs("div", { className: "dtc-menu-root", ref: rootRef, children: [
1276
+ /* @__PURE__ */ jsx(
1277
+ "button",
1278
+ {
1279
+ ref: buttonRef,
1280
+ type: "button",
1281
+ className: "dtc-icon-btn",
1282
+ "aria-label": label,
1283
+ title: label,
1284
+ "aria-haspopup": "menu",
1285
+ "aria-expanded": open,
1286
+ onClick: () => setOpen((v) => !v),
1287
+ children: /* @__PURE__ */ jsx(KebabIcon, {})
1288
+ }
1289
+ ),
1290
+ open && /* @__PURE__ */ jsx("div", { className: "dtc-menu", role: "menu", ref: menuRef, onKeyDown: onMenuKey, children: items.map((item) => /* @__PURE__ */ jsx(
1291
+ "button",
1292
+ {
1293
+ type: "button",
1294
+ role: "menuitem",
1295
+ className: "dtc-menu-item",
1296
+ onClick: () => {
1297
+ setOpen(false);
1298
+ item.onSelect();
1299
+ },
1300
+ children: item.label
1301
+ },
1302
+ item.id
1303
+ )) })
1304
+ ] });
1305
+ }
1306
+ function KebabIcon() {
1307
+ return /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 24 24", width: "18", height: "18", fill: "currentColor", "aria-hidden": "true", children: [
1308
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "5", r: "1.8" }),
1309
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "12", r: "1.8" }),
1310
+ /* @__PURE__ */ jsx("circle", { cx: "12", cy: "19", r: "1.8" })
1311
+ ] });
1312
+ }
1313
+ function ConversationView({ roomId, labels, onBack, onClose, confirm }) {
1192
1314
  const inbox = useChatRooms();
1193
1315
  const room = inbox.rooms.find((r) => r.roomId === roomId);
1194
1316
  const { setVisible } = inbox;
@@ -1196,16 +1318,49 @@ function ConversationView({ roomId, labels, onBack }) {
1196
1318
  const isRequest = room?.myStatus === "pending";
1197
1319
  const isClosed = room?.state === "closed";
1198
1320
  const waitingOnThem = !isRequest && !!room && room.participants.length > 0 && room.participants.every((p) => p.status === "pending");
1321
+ const menuItems = [];
1322
+ if (room && !isRequest) {
1323
+ menuItems.push({
1324
+ id: "mute",
1325
+ label: room.isMuted ? labels.unmute : labels.mute,
1326
+ onSelect: async () => {
1327
+ if (room.isMuted) return void inbox.setMuted(roomId, false).catch(() => {
1328
+ });
1329
+ const ok = await confirm({
1330
+ title: labels.muteConfirmTitle(room.name),
1331
+ body: labels.muteConfirmBody,
1332
+ confirmLabel: labels.muteConfirm,
1333
+ cancelLabel: labels.cancel
1334
+ });
1335
+ if (ok) void inbox.setMuted(roomId, true).catch(() => {
1336
+ });
1337
+ }
1338
+ });
1339
+ menuItems.push({
1340
+ id: "archive",
1341
+ label: room.isArchived ? labels.unarchive : labels.archive,
1342
+ onSelect: async () => {
1343
+ if (room.isArchived) return void inbox.setArchived(roomId, false).catch(() => {
1344
+ });
1345
+ const ok = await confirm({
1346
+ title: labels.archiveConfirmTitle(room.name),
1347
+ body: labels.archiveConfirmBody,
1348
+ confirmLabel: labels.archiveConfirm,
1349
+ cancelLabel: labels.cancel
1350
+ });
1351
+ if (ok) void inbox.setArchived(roomId, true).catch(() => {
1352
+ });
1353
+ }
1354
+ });
1355
+ }
1199
1356
  return /* @__PURE__ */ jsxs("div", { className: "dtc-conversation", children: [
1200
1357
  /* @__PURE__ */ jsxs("div", { className: "dtc-conversation-header", children: [
1201
1358
  /* @__PURE__ */ jsx("button", { type: "button", className: "dtc-icon-btn", onClick: onBack, "aria-label": labels.back, title: labels.back, children: /* @__PURE__ */ jsx(ChevronLeft, {}) }),
1202
1359
  room && /* @__PURE__ */ jsx(Avatar, { name: room.name, url: room.kind === "dm" ? room.participants[0]?.avatarUrl : null, size: 28 }),
1203
1360
  /* @__PURE__ */ jsx("span", { className: "dtc-conversation-title", children: room?.name ?? "" }),
1204
- room && !isRequest && /* @__PURE__ */ jsxs("span", { className: "dtc-conversation-actions", children: [
1205
- /* @__PURE__ */ jsx("button", { type: "button", className: "dtc-text-btn", onClick: () => void inbox.setMuted(roomId, !room.isMuted).catch(() => {
1206
- }), children: room.isMuted ? labels.unmute : labels.mute }),
1207
- !isClosed && /* @__PURE__ */ jsx("button", { type: "button", className: "dtc-text-btn", onClick: () => void inbox.closeDM(roomId).catch(() => {
1208
- }), children: labels.closeConversation })
1361
+ /* @__PURE__ */ jsxs("span", { className: "dtc-conversation-actions", children: [
1362
+ /* @__PURE__ */ jsx(ConversationMenu, { label: labels.moreOptions, items: menuItems }),
1363
+ /* @__PURE__ */ jsx("button", { type: "button", className: "dtc-icon-btn", onClick: onClose, "aria-label": labels.close, title: labels.close, children: /* @__PURE__ */ jsx(CloseIcon, {}) })
1209
1364
  ] })
1210
1365
  ] }),
1211
1366
  isRequest && room && /* @__PURE__ */ jsxs("div", { className: "dtc-request-banner", role: "region", "aria-label": labels.requests, children: [
@@ -1244,6 +1399,9 @@ function ConversationView({ roomId, labels, onBack }) {
1244
1399
  ) })
1245
1400
  ] });
1246
1401
  }
1402
+ function CloseIcon() {
1403
+ return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "18", height: "18", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M18 6L6 18M6 6l12 12" }) });
1404
+ }
1247
1405
  function ChevronLeft() {
1248
1406
  return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "18", height: "18", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M15 18l-6-6 6-6" }) });
1249
1407
  }
@@ -1261,7 +1419,8 @@ function DialtribeMessages({
1261
1419
  labels: labelOverrides,
1262
1420
  panelWidth = 380,
1263
1421
  railDmLimit = 5,
1264
- mobileBreakpoint = 768
1422
+ mobileBreakpoint = 768,
1423
+ confirm: hostConfirm
1265
1424
  }) {
1266
1425
  const labels = useMemo(() => ({ ...DEFAULT_LABELS, ...labelOverrides }), [labelOverrides]);
1267
1426
  const inbox = useChatRooms();
@@ -1270,7 +1429,21 @@ function DialtribeMessages({
1270
1429
  const { isOpen, view } = ui;
1271
1430
  const pendingCount = inbox.requests.length;
1272
1431
  const rollup = inbox.totalUnread + pendingCount;
1273
- const recentDms = inbox.rooms.filter((r) => r.myStatus === "accepted").slice(0, railDmLimit);
1432
+ const recentDms = inbox.rooms.filter((r) => r.myStatus === "accepted" && !r.isArchived).slice(0, railDmLimit);
1433
+ const [builtInConfirm, setBuiltInConfirm] = useState(null);
1434
+ const confirmOpen = useRef(false);
1435
+ const confirm = useMemo(
1436
+ () => async (options) => {
1437
+ confirmOpen.current = true;
1438
+ try {
1439
+ return hostConfirm ? await hostConfirm(options) : await new Promise((resolve) => setBuiltInConfirm({ options, resolve }));
1440
+ } finally {
1441
+ confirmOpen.current = false;
1442
+ setBuiltInConfirm(null);
1443
+ }
1444
+ },
1445
+ [hostConfirm]
1446
+ );
1274
1447
  const activeRoomId = isOpen && view.kind === "room" ? view.roomId : null;
1275
1448
  const activeContext = contexts.find((c) => c.roomId === activeRoomId);
1276
1449
  const activeItemId = isOpen && view.kind === "item" ? view.itemId : null;
@@ -1284,7 +1457,9 @@ function DialtribeMessages({
1284
1457
  useEdgeSwipe(isMobile, isOpen, ui.open, ui.close, side);
1285
1458
  useEffect(() => {
1286
1459
  if (!isOpen) return;
1287
- const onKey = (e) => e.key === "Escape" && ui.close();
1460
+ const onKey = (e) => {
1461
+ if (e.key === "Escape" && !e.defaultPrevented && !confirmOpen.current) ui.close();
1462
+ };
1288
1463
  window.addEventListener("keydown", onKey);
1289
1464
  return () => window.removeEventListener("keydown", onKey);
1290
1465
  }, [isOpen, ui]);
@@ -1322,30 +1497,49 @@ function DialtribeMessages({
1322
1497
  /* @__PURE__ */ jsx(ChatIcon, {}),
1323
1498
  rollup > 0 && /* @__PURE__ */ jsx("span", { className: "dtc-badge-count dtc-badge-float", children: badgeText(rollup) })
1324
1499
  ] }),
1325
- isOpen && /* @__PURE__ */ jsx("div", { className: "dtc-messages-panel", role: "dialog", "aria-label": activeItem?.label ?? labels.messages, children: activeItem ? /* @__PURE__ */ jsx("div", { className: "dtc-item-panel", children: typeof activeItem.panel === "function" ? activeItem.panel({ close: ui.close }) : activeItem.panel }) : view.kind !== "room" ? /* @__PURE__ */ jsxs(Fragment, { children: [
1326
- /* @__PURE__ */ jsxs("div", { className: "dtc-panel-header", children: [
1327
- /* @__PURE__ */ jsx("span", { className: "dtc-panel-title", children: labels.messages }),
1328
- /* @__PURE__ */ jsx("button", { type: "button", className: "dtc-icon-btn", onClick: ui.close, "aria-label": labels.close, title: labels.close, children: /* @__PURE__ */ jsx(CloseIcon, {}) })
1329
- ] }),
1330
- /* @__PURE__ */ jsx(
1331
- MessagesInbox,
1500
+ isOpen && /* @__PURE__ */ jsxs("div", { className: "dtc-messages-panel", role: "dialog", "aria-label": activeItem?.label ?? labels.messages, children: [
1501
+ activeItem ? /* @__PURE__ */ jsx("div", { className: "dtc-item-panel", children: typeof activeItem.panel === "function" ? activeItem.panel({ close: ui.close }) : activeItem.panel }) : view.kind !== "room" ? /* @__PURE__ */ jsxs(Fragment, { children: [
1502
+ /* @__PURE__ */ jsxs("div", { className: "dtc-panel-header", children: [
1503
+ /* @__PURE__ */ jsx("span", { className: "dtc-panel-title", children: labels.messages }),
1504
+ /* @__PURE__ */ jsx("button", { type: "button", className: "dtc-icon-btn", onClick: ui.close, "aria-label": labels.close, title: labels.close, children: /* @__PURE__ */ jsx(CloseIcon2, {}) })
1505
+ ] }),
1506
+ /* @__PURE__ */ jsx(
1507
+ MessagesInbox,
1508
+ {
1509
+ rooms: inbox.rooms,
1510
+ requests: inbox.requests,
1511
+ labels,
1512
+ onOpenRoom: ui.openRoom,
1513
+ onRemoveRoom: inboxRowClose ? (roomId) => void inbox.hideDM(roomId).catch(() => {
1514
+ }) : void 0
1515
+ }
1516
+ )
1517
+ ] }) : activeContext ? /* @__PURE__ */ jsxs("div", { className: "dtc-conversation", children: [
1518
+ /* @__PURE__ */ jsxs("div", { className: "dtc-conversation-header", children: [
1519
+ /* @__PURE__ */ jsx(Avatar, { name: activeContext.label, url: activeContext.avatarUrl, size: 28 }),
1520
+ /* @__PURE__ */ jsx("span", { className: "dtc-conversation-title", children: activeContext.label }),
1521
+ /* @__PURE__ */ jsx("button", { type: "button", className: "dtc-icon-btn", onClick: ui.close, "aria-label": labels.close, title: labels.close, children: /* @__PURE__ */ jsx(CloseIcon2, {}) })
1522
+ ] }),
1523
+ /* @__PURE__ */ jsx(ChatRoomProvider, { roomId: activeContext.roomId, children: /* @__PURE__ */ jsx(ChatPanel, { showHeader: false, emptyLabel: labels.noMessages, placeholder: labels.messagePlaceholder }) })
1524
+ ] }) : /* @__PURE__ */ jsx(
1525
+ ConversationView,
1332
1526
  {
1333
- rooms: inbox.rooms,
1334
- requests: inbox.requests,
1527
+ roomId: view.roomId,
1335
1528
  labels,
1336
- onOpenRoom: ui.openRoom,
1337
- onRemoveRoom: inboxRowClose ? (roomId) => void inbox.hideDM(roomId).catch(() => {
1338
- }) : void 0
1529
+ onBack: ui.openInbox,
1530
+ onClose: ui.close,
1531
+ confirm
1532
+ },
1533
+ view.roomId
1534
+ ),
1535
+ builtInConfirm && /* @__PURE__ */ jsx(
1536
+ ConfirmDialog,
1537
+ {
1538
+ options: builtInConfirm.options,
1539
+ onAnswer: builtInConfirm.resolve
1339
1540
  }
1340
1541
  )
1341
- ] }) : activeContext ? /* @__PURE__ */ jsxs("div", { className: "dtc-conversation", children: [
1342
- /* @__PURE__ */ jsxs("div", { className: "dtc-conversation-header", children: [
1343
- /* @__PURE__ */ jsx(Avatar, { name: activeContext.label, url: activeContext.avatarUrl, size: 28 }),
1344
- /* @__PURE__ */ jsx("span", { className: "dtc-conversation-title", children: activeContext.label }),
1345
- /* @__PURE__ */ jsx("button", { type: "button", className: "dtc-icon-btn", onClick: ui.close, "aria-label": labels.close, title: labels.close, children: /* @__PURE__ */ jsx(CloseIcon, {}) })
1346
- ] }),
1347
- /* @__PURE__ */ jsx(ChatRoomProvider, { roomId: activeContext.roomId, children: /* @__PURE__ */ jsx(ChatPanel, { showHeader: false, emptyLabel: labels.noMessages, placeholder: labels.messagePlaceholder }) })
1348
- ] }) : /* @__PURE__ */ jsx(ConversationView, { roomId: view.roomId, labels, onBack: ui.openInbox }, view.roomId) }),
1542
+ ] }),
1349
1543
  showRail && /* @__PURE__ */ jsxs("nav", { className: "dtc-rail", "aria-label": labels.messages, children: [
1350
1544
  /* @__PURE__ */ jsxs("div", { className: "dtc-rail-scroll", children: [
1351
1545
  topItems.map(renderItemButton),
@@ -1393,6 +1587,37 @@ function DialtribeMessages({
1393
1587
  }
1394
1588
  );
1395
1589
  }
1590
+ function ConfirmDialog({ options, onAnswer }) {
1591
+ const confirmRef = useRef(null);
1592
+ useEffect(() => {
1593
+ confirmRef.current?.focus();
1594
+ const onKey = (e) => {
1595
+ if (e.key !== "Escape") return;
1596
+ e.preventDefault();
1597
+ onAnswer(false);
1598
+ };
1599
+ window.addEventListener("keydown", onKey, true);
1600
+ return () => window.removeEventListener("keydown", onKey, true);
1601
+ }, [onAnswer]);
1602
+ return /* @__PURE__ */ jsx("div", { className: "dtc-confirm-backdrop", onClick: () => onAnswer(false), children: /* @__PURE__ */ jsxs(
1603
+ "div",
1604
+ {
1605
+ className: "dtc-confirm",
1606
+ role: "alertdialog",
1607
+ "aria-modal": "true",
1608
+ "aria-labelledby": "dtc-confirm-title",
1609
+ onClick: (e) => e.stopPropagation(),
1610
+ children: [
1611
+ /* @__PURE__ */ jsx("h3", { id: "dtc-confirm-title", className: "dtc-confirm-title", children: options.title }),
1612
+ options.body && /* @__PURE__ */ jsx("p", { className: "dtc-confirm-body", children: options.body }),
1613
+ /* @__PURE__ */ jsxs("div", { className: "dtc-confirm-actions", children: [
1614
+ /* @__PURE__ */ jsx("button", { type: "button", className: "dtc-btn", onClick: () => onAnswer(false), children: options.cancelLabel }),
1615
+ /* @__PURE__ */ jsx("button", { ref: confirmRef, type: "button", className: "dtc-btn dtc-btn-primary", onClick: () => onAnswer(true), children: options.confirmLabel })
1616
+ ] })
1617
+ ]
1618
+ }
1619
+ ) });
1620
+ }
1396
1621
  function RailButton({
1397
1622
  label,
1398
1623
  active,
@@ -1500,7 +1725,7 @@ function themeVars(theme) {
1500
1725
  function ChatIcon() {
1501
1726
  return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "20", height: "20", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) });
1502
1727
  }
1503
- function CloseIcon() {
1728
+ function CloseIcon2() {
1504
1729
  return /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "18", height: "18", fill: "none", stroke: "currentColor", strokeWidth: 2, strokeLinecap: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("path", { d: "M18 6L6 18M6 6l12 12" }) });
1505
1730
  }
1506
1731