@sesionario/blocks 1.40.0 → 1.41.0-rc.1

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.d.cts CHANGED
@@ -1264,8 +1264,10 @@ type ChatMessageListProps = {
1264
1264
  currentUserId: string | null;
1265
1265
  emptyTitle?: string;
1266
1266
  emptyDescription?: string;
1267
+ /** Tighter empty state for the support dock. */
1268
+ compactEmpty?: boolean;
1267
1269
  };
1268
- declare function ChatMessageList({ messages, currentUserId, emptyTitle, emptyDescription, }: ChatMessageListProps): React.JSX.Element;
1270
+ declare function ChatMessageList({ messages, currentUserId, emptyTitle, emptyDescription, compactEmpty, }: ChatMessageListProps): React.JSX.Element;
1269
1271
 
1270
1272
  type MessageComposerProps = Omit<React.ComponentProps<"textarea">, "children" | "onSubmit"> & EmojiFieldSharedProps & {
1271
1273
  /** Label for the submit button (e.g. "Enviar"). */
@@ -1343,6 +1345,8 @@ type SupportMessengerItem = {
1343
1345
  key: string;
1344
1346
  title: string;
1345
1347
  subtitle?: string;
1348
+ /** Short name shown above the title (support desk persona). */
1349
+ eyebrow?: string;
1346
1350
  avatarUrl?: string | null;
1347
1351
  unreadCount?: number;
1348
1352
  conversationId?: string | null;
@@ -1369,6 +1373,8 @@ type OpenThreadRequest = {
1369
1373
  key: string;
1370
1374
  title: string;
1371
1375
  subtitle?: string;
1376
+ eyebrow?: string;
1377
+ avatarUrl?: string | null;
1372
1378
  conversationId?: string | null;
1373
1379
  open?: FindOrCreateConversationInput;
1374
1380
  };
package/dist/index.d.ts CHANGED
@@ -1264,8 +1264,10 @@ type ChatMessageListProps = {
1264
1264
  currentUserId: string | null;
1265
1265
  emptyTitle?: string;
1266
1266
  emptyDescription?: string;
1267
+ /** Tighter empty state for the support dock. */
1268
+ compactEmpty?: boolean;
1267
1269
  };
1268
- declare function ChatMessageList({ messages, currentUserId, emptyTitle, emptyDescription, }: ChatMessageListProps): React.JSX.Element;
1270
+ declare function ChatMessageList({ messages, currentUserId, emptyTitle, emptyDescription, compactEmpty, }: ChatMessageListProps): React.JSX.Element;
1269
1271
 
1270
1272
  type MessageComposerProps = Omit<React.ComponentProps<"textarea">, "children" | "onSubmit"> & EmojiFieldSharedProps & {
1271
1273
  /** Label for the submit button (e.g. "Enviar"). */
@@ -1343,6 +1345,8 @@ type SupportMessengerItem = {
1343
1345
  key: string;
1344
1346
  title: string;
1345
1347
  subtitle?: string;
1348
+ /** Short name shown above the title (support desk persona). */
1349
+ eyebrow?: string;
1346
1350
  avatarUrl?: string | null;
1347
1351
  unreadCount?: number;
1348
1352
  conversationId?: string | null;
@@ -1369,6 +1373,8 @@ type OpenThreadRequest = {
1369
1373
  key: string;
1370
1374
  title: string;
1371
1375
  subtitle?: string;
1376
+ eyebrow?: string;
1377
+ avatarUrl?: string | null;
1372
1378
  conversationId?: string | null;
1373
1379
  open?: FindOrCreateConversationInput;
1374
1380
  };
package/dist/index.js CHANGED
@@ -7197,14 +7197,26 @@ function ChatMessageList({
7197
7197
  messages,
7198
7198
  currentUserId,
7199
7199
  emptyTitle = "Sin mensajes",
7200
- emptyDescription = "Escribe para iniciar la conversaci\xF3n."
7200
+ emptyDescription = "Escribe para iniciar la conversaci\xF3n.",
7201
+ compactEmpty = false
7201
7202
  }) {
7202
7203
  if (messages.length === 0) {
7203
- return /* @__PURE__ */ jsxs("div", { className: "flex h-full flex-col items-center justify-center gap-2 p-6 text-center", children: [
7204
- /* @__PURE__ */ jsx(MessageCircleDashedIcon, { className: "size-8 text-muted-foreground" }),
7205
- /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: emptyTitle }),
7206
- /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: emptyDescription })
7207
- ] });
7204
+ return /* @__PURE__ */ jsxs(
7205
+ "div",
7206
+ {
7207
+ className: compactEmpty ? "flex h-full flex-col items-center justify-center gap-1 px-4 py-3 text-center" : "flex h-full flex-col items-center justify-center gap-2 p-6 text-center",
7208
+ children: [
7209
+ /* @__PURE__ */ jsx(
7210
+ MessageCircleDashedIcon,
7211
+ {
7212
+ className: compactEmpty ? "size-5 text-muted-foreground" : "size-8 text-muted-foreground"
7213
+ }
7214
+ ),
7215
+ /* @__PURE__ */ jsx("p", { className: "text-sm font-medium", children: emptyTitle }),
7216
+ /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: emptyDescription })
7217
+ ]
7218
+ }
7219
+ );
7208
7220
  }
7209
7221
  return /* @__PURE__ */ jsx(MessageScrollerProvider, { autoScroll: true, children: /* @__PURE__ */ jsxs(MessageScroller, { children: [
7210
7222
  /* @__PURE__ */ jsx(MessageScrollerViewport, { children: /* @__PURE__ */ jsx(MessageScrollerContent, { className: "gap-4 p-4", children: messages.map((m) => {
@@ -7547,7 +7559,7 @@ function ThreadPanel({
7547
7559
  className
7548
7560
  ),
7549
7561
  children: [
7550
- /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1 border-b px-2 py-2", children: [
7562
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 border-b bg-primary/10 px-2 py-2", children: [
7551
7563
  showBack && onBack ? /* @__PURE__ */ jsx(
7552
7564
  Button,
7553
7565
  {
@@ -7559,7 +7571,24 @@ function ThreadPanel({
7559
7571
  children: /* @__PURE__ */ jsx(ChevronLeft, { className: "size-4" })
7560
7572
  }
7561
7573
  ) : null,
7574
+ /* @__PURE__ */ jsx(
7575
+ "span",
7576
+ {
7577
+ className: "flex size-8 shrink-0 items-center justify-center overflow-hidden rounded-full bg-primary text-[11px] font-semibold text-primary-foreground",
7578
+ style: thread.avatarUrl ? void 0 : avatarFallbackStyle(thread.title),
7579
+ children: /* @__PURE__ */ jsx(
7580
+ SafeImage,
7581
+ {
7582
+ src: thread.avatarUrl,
7583
+ alt: "",
7584
+ className: "size-full object-cover",
7585
+ fallback: getInitials(thread.eyebrow ?? thread.title)
7586
+ }
7587
+ )
7588
+ }
7589
+ ),
7562
7590
  /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1 px-1", children: [
7591
+ thread.eyebrow ? /* @__PURE__ */ jsx("p", { className: "truncate text-[11px] font-semibold tracking-wide text-primary", children: thread.eyebrow }) : null,
7563
7592
  /* @__PURE__ */ jsx("p", { className: "truncate text-sm font-semibold", children: thread.title }),
7564
7593
  thread.subtitle ? /* @__PURE__ */ jsx("p", { className: "truncate text-xs text-muted-foreground", children: thread.subtitle }) : null
7565
7594
  ] }),
@@ -7580,7 +7609,8 @@ function ThreadPanel({
7580
7609
  {
7581
7610
  messages,
7582
7611
  currentUserId,
7583
- emptyDescription: labels.emptyThread
7612
+ emptyDescription: labels.emptyThread,
7613
+ compactEmpty: true
7584
7614
  }
7585
7615
  ) }),
7586
7616
  /* @__PURE__ */ jsx("div", { className: "border-t p-3", children: /* @__PURE__ */ jsx(
@@ -7631,7 +7661,7 @@ function ListPanel({
7631
7661
  className
7632
7662
  ),
7633
7663
  children: [
7634
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-b px-3 py-2", children: [
7664
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between border-b bg-primary/10 px-3 py-2", children: [
7635
7665
  /* @__PURE__ */ jsx("p", { className: "text-sm font-semibold", children: labels.listTitle }),
7636
7666
  /* @__PURE__ */ jsx(
7637
7667
  Button,
@@ -7668,7 +7698,7 @@ function ListPanel({
7668
7698
  }
7669
7699
  )
7670
7700
  ] }) }) : null,
7671
- /* @__PURE__ */ jsx("ul", { className: "min-h-0 flex-1 overflow-y-auto p-1", children: filtered.length === 0 ? /* @__PURE__ */ jsx("li", { className: "px-3 py-8 text-center text-sm text-muted-foreground", children: labels.emptyList }) : filtered.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
7701
+ /* @__PURE__ */ jsx("ul", { className: "min-h-0 flex-1 overflow-y-auto p-1", children: filtered.length === 0 ? /* @__PURE__ */ jsx("li", { className: "px-3 py-4 text-center text-xs text-muted-foreground", children: labels.emptyList }) : filtered.map((item) => /* @__PURE__ */ jsx("li", { children: /* @__PURE__ */ jsxs(
7672
7702
  "button",
7673
7703
  {
7674
7704
  type: "button",
@@ -7692,6 +7722,7 @@ function ListPanel({
7692
7722
  }
7693
7723
  ),
7694
7724
  /* @__PURE__ */ jsxs("span", { className: "min-w-0 flex-1", children: [
7725
+ item.eyebrow ? /* @__PURE__ */ jsx("span", { className: "block truncate text-[11px] font-semibold tracking-wide text-primary", children: item.eyebrow }) : null,
7695
7726
  /* @__PURE__ */ jsx("span", { className: "block truncate text-sm font-medium", children: item.title }),
7696
7727
  item.subtitle ? /* @__PURE__ */ jsx("span", { className: "block truncate text-xs text-muted-foreground", children: item.subtitle }) : null
7697
7728
  ] }),
@@ -7817,6 +7848,8 @@ function SupportMessengerProvider({
7817
7848
  key: item.key,
7818
7849
  title: item.title,
7819
7850
  subtitle: item.subtitle,
7851
+ eyebrow: item.eyebrow,
7852
+ avatarUrl: item.avatarUrl,
7820
7853
  conversationId: item.conversationId,
7821
7854
  open: item.open
7822
7855
  });