@handled-ai/design-system 0.20.0 → 0.20.2
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/conversation-panel.d.ts +1 -1
- package/dist/components/conversation-panel.js +282 -15
- package/dist/components/conversation-panel.js.map +1 -1
- package/dist/components/owner-chips.d.ts +3 -4
- package/dist/components/owner-chips.js +77 -41
- package/dist/components/owner-chips.js.map +1 -1
- package/dist/components/score-why-chips.d.ts +1 -1
- package/dist/components/signal-priority-popover.d.ts +1 -1
- package/dist/components/timeline-activity.d.ts +4 -2
- package/dist/components/timeline-activity.js +366 -154
- package/dist/components/timeline-activity.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/prototype/index.d.ts +1 -1
- package/dist/prototype/prototype-accounts-view.d.ts +1 -1
- package/dist/prototype/prototype-admin-view.d.ts +1 -1
- package/dist/prototype/prototype-config.d.ts +1 -1
- package/dist/prototype/prototype-inbox-view.d.ts +9 -3
- package/dist/prototype/prototype-inbox-view.js +94 -47
- package/dist/prototype/prototype-inbox-view.js.map +1 -1
- package/dist/prototype/prototype-insights-view.d.ts +1 -1
- package/dist/prototype/prototype-shell.d.ts +1 -1
- package/dist/{signal-priority-popover-Cg9XPJsp.d.ts → signal-priority-popover-BJHd07dU.d.ts} +6 -0
- package/package.json +1 -1
- package/src/components/__tests__/conversation-panel.test.tsx +276 -0
- package/src/components/__tests__/owner-chips.test.tsx +137 -17
- package/src/components/__tests__/timeline-activity.test.tsx +92 -1
- package/src/components/conversation-panel.tsx +358 -21
- package/src/components/owner-chips.tsx +98 -63
- package/src/components/timeline-activity.tsx +452 -160
- package/src/prototype/__tests__/detail-view-case-panel-v2.test.tsx +181 -0
- package/src/prototype/__tests__/detail-view-timeline-system-events.test.tsx +16 -2
- package/src/prototype/prototype-config.ts +6 -0
- package/src/prototype/prototype-inbox-view.tsx +128 -51
|
@@ -51,12 +51,51 @@ const TONE_CLASSES = {
|
|
|
51
51
|
};
|
|
52
52
|
const NEUTRAL_DOT_CLASSES = "border-border/60 bg-background";
|
|
53
53
|
const NEUTRAL_ICON_CLASSES = "text-muted-foreground";
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
const TIMELINE_VARIANT_CLASSES = {
|
|
55
|
+
default: {
|
|
56
|
+
outerRowGap: "group relative flex gap-3.5",
|
|
57
|
+
connector: "absolute left-[9px] top-5 bottom-[-6px] w-px bg-border/60",
|
|
58
|
+
dotWrapperSize: "relative z-10 mt-1 flex h-5 w-5 shrink-0 items-center justify-center rounded-full bg-background",
|
|
59
|
+
dot: "flex h-4.5 w-4.5 items-center justify-center rounded-full border ring-4 ring-background",
|
|
60
|
+
contentPadding: "flex-1 pb-5 pt-0.5",
|
|
61
|
+
titleRowSpacing: "flex min-w-0 flex-col gap-1 sm:flex-row sm:items-start sm:justify-between",
|
|
62
|
+
title: "pr-4 text-[13px] leading-relaxed text-foreground",
|
|
63
|
+
time: "mt-0.5 shrink-0 whitespace-nowrap text-[11px] text-muted-foreground/70",
|
|
64
|
+
cardContainer: "overflow-hidden rounded-md border border-border/80 bg-muted/20",
|
|
65
|
+
cardHeader: "px-3 pt-2.5",
|
|
66
|
+
cardBody: "px-3 py-2.5 text-sm",
|
|
67
|
+
cardFooter: "px-3 pb-2.5",
|
|
68
|
+
collapsedPreview: "flex items-center justify-between gap-2 px-3 py-2.5 text-sm text-muted-foreground",
|
|
69
|
+
actionLinkRow: "flex items-center gap-3 px-3 pb-2.5",
|
|
70
|
+
actionLink: "inline-flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground",
|
|
71
|
+
nonInteractiveContent: "pr-2 text-sm leading-relaxed text-muted-foreground"
|
|
72
|
+
},
|
|
73
|
+
"case-panel": {
|
|
74
|
+
outerRowGap: "group relative flex gap-3",
|
|
75
|
+
connector: "absolute left-[7px] top-[18px] bottom-[-4px] w-px bg-border/60",
|
|
76
|
+
dotWrapperSize: "relative z-10 mt-1 flex h-4 w-4 shrink-0 items-center justify-center rounded-full bg-background",
|
|
77
|
+
dot: "flex h-3.5 w-3.5 items-center justify-center rounded-full border ring-[3px] ring-background",
|
|
78
|
+
contentPadding: "flex-1 pb-4 pt-0.5",
|
|
79
|
+
titleRowSpacing: "flex min-w-0 flex-col gap-0.5 sm:flex-row sm:items-start sm:justify-between",
|
|
80
|
+
title: "pr-3 text-[13px] leading-snug text-foreground",
|
|
81
|
+
time: "mt-0.5 shrink-0 whitespace-nowrap text-[11px] leading-snug text-muted-foreground/70",
|
|
82
|
+
cardContainer: "overflow-hidden rounded-lg border border-border/70 bg-card shadow-sm",
|
|
83
|
+
cardHeader: "border-b border-border/60 bg-background px-3 py-2",
|
|
84
|
+
cardBody: "px-3 py-2.5 text-sm",
|
|
85
|
+
cardFooter: "border-t border-border/60 bg-background/50 px-3 py-1.5",
|
|
86
|
+
collapsedPreview: "flex items-center justify-between gap-2 px-3 py-2 text-sm text-muted-foreground",
|
|
87
|
+
actionLinkRow: "flex items-center justify-end gap-2 px-3 py-1.5",
|
|
88
|
+
actionLink: "inline-flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground/70 transition-colors hover:text-foreground",
|
|
89
|
+
nonInteractiveContent: "pr-2 text-[13px] leading-snug text-muted-foreground"
|
|
90
|
+
}
|
|
91
|
+
};
|
|
92
|
+
function TimelineActivity({ events, className, variant = "default" }) {
|
|
93
|
+
return /* @__PURE__ */ jsx("div", { className: cn("space-y-0", className), "data-variant": variant, children: events.map((event, index) => /* @__PURE__ */ jsx(
|
|
56
94
|
TimelineItem,
|
|
57
95
|
{
|
|
58
96
|
event,
|
|
59
|
-
isLast: index === events.length - 1
|
|
97
|
+
isLast: index === events.length - 1,
|
|
98
|
+
variant
|
|
60
99
|
},
|
|
61
100
|
event.id
|
|
62
101
|
)) });
|
|
@@ -88,180 +127,353 @@ function ActorByline({ actor, time }) {
|
|
|
88
127
|
/* @__PURE__ */ jsx("span", { children: time })
|
|
89
128
|
] });
|
|
90
129
|
}
|
|
91
|
-
function TimelineItem({
|
|
92
|
-
|
|
130
|
+
function TimelineItem({
|
|
131
|
+
event,
|
|
132
|
+
isLast,
|
|
133
|
+
variant
|
|
134
|
+
}) {
|
|
135
|
+
var _a;
|
|
93
136
|
const [expanded, setExpanded] = React.useState((_a = event.defaultExpanded) != null ? _a : false);
|
|
94
137
|
const [showAllRecipients, setShowAllRecipients] = React.useState(false);
|
|
95
138
|
const hasContent = !!event.content;
|
|
96
139
|
const hasEmail = !!event.email;
|
|
140
|
+
const classes = TIMELINE_VARIANT_CLASSES[variant];
|
|
97
141
|
const toneStyle = event.tone ? TONE_CLASSES[event.tone] : null;
|
|
98
142
|
const dotClasses = toneStyle ? toneStyle.dot : NEUTRAL_DOT_CLASSES;
|
|
99
143
|
const iconClasses = toneStyle ? toneStyle.icon : NEUTRAL_ICON_CLASSES;
|
|
100
|
-
return /* @__PURE__ */ jsxs("div", { className:
|
|
101
|
-
!isLast && /* @__PURE__ */ jsx("div", { className:
|
|
102
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
103
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
104
|
-
/* @__PURE__ */ jsxs("div", { className:
|
|
105
|
-
/* @__PURE__ */ jsx("div", { className:
|
|
106
|
-
/* @__PURE__ */ jsx("span", { className:
|
|
144
|
+
return /* @__PURE__ */ jsxs("div", { className: classes.outerRowGap, children: [
|
|
145
|
+
!isLast && /* @__PURE__ */ jsx("div", { className: classes.connector }),
|
|
146
|
+
/* @__PURE__ */ jsx("div", { className: classes.dotWrapperSize, children: /* @__PURE__ */ jsx("div", { className: cn(classes.dot, dotClasses, iconClasses), "data-testid": "timeline-dot", children: event.icon }) }),
|
|
147
|
+
/* @__PURE__ */ jsxs("div", { className: classes.contentPadding, children: [
|
|
148
|
+
/* @__PURE__ */ jsxs("div", { className: classes.titleRowSpacing, children: [
|
|
149
|
+
/* @__PURE__ */ jsx("div", { className: classes.title, children: event.title }),
|
|
150
|
+
/* @__PURE__ */ jsx("span", { className: classes.time, children: event.time })
|
|
107
151
|
] }),
|
|
108
152
|
event.actor && /* @__PURE__ */ jsx(ActorByline, { actor: event.actor, time: event.time }),
|
|
109
|
-
(hasContent || hasEmail) && /* @__PURE__ */ jsx("div", { className: "mt-2", children: event.isInteractive ? hasEmail ? /* @__PURE__ */ jsx(
|
|
153
|
+
(hasContent || hasEmail) && /* @__PURE__ */ jsx("div", { className: "mt-2", children: event.isInteractive ? hasEmail ? /* @__PURE__ */ jsx(
|
|
154
|
+
EmailCard,
|
|
155
|
+
{
|
|
156
|
+
event,
|
|
157
|
+
expanded,
|
|
158
|
+
setExpanded,
|
|
159
|
+
showAllRecipients,
|
|
160
|
+
setShowAllRecipients,
|
|
161
|
+
variant,
|
|
162
|
+
classes
|
|
163
|
+
}
|
|
164
|
+
) : /* @__PURE__ */ jsx(
|
|
165
|
+
ContentCard,
|
|
166
|
+
{
|
|
167
|
+
event,
|
|
168
|
+
expanded,
|
|
169
|
+
setExpanded,
|
|
170
|
+
variant,
|
|
171
|
+
classes
|
|
172
|
+
}
|
|
173
|
+
) : /* @__PURE__ */ jsx("div", { className: classes.nonInteractiveContent, children: event.content }) })
|
|
174
|
+
] })
|
|
175
|
+
] });
|
|
176
|
+
}
|
|
177
|
+
function EmailMetadata({
|
|
178
|
+
email,
|
|
179
|
+
showAllRecipients,
|
|
180
|
+
setShowAllRecipients
|
|
181
|
+
}) {
|
|
182
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
183
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4", children: [
|
|
184
|
+
/* @__PURE__ */ jsxs("div", { className: "flex min-w-0 items-baseline gap-1.5", children: [
|
|
185
|
+
/* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground text-[13px] whitespace-nowrap", children: email.from }),
|
|
186
|
+
email.fromEmail && /* @__PURE__ */ jsx("span", { className: "text-muted-foreground/60 text-xs truncate", children: email.fromEmail })
|
|
187
|
+
] }),
|
|
188
|
+
email.date && /* @__PURE__ */ jsx("span", { className: "shrink-0 text-xs text-muted-foreground/50 whitespace-nowrap", children: email.date })
|
|
189
|
+
] }),
|
|
190
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-0.5 flex items-center gap-1 text-xs text-muted-foreground", children: [
|
|
191
|
+
/* @__PURE__ */ jsxs("span", { className: "truncate", children: [
|
|
192
|
+
"To ",
|
|
193
|
+
email.to,
|
|
194
|
+
!showAllRecipients && (email.cc || email.bcc) ? /* @__PURE__ */ jsx(Fragment, { children: ", ..." }) : null,
|
|
195
|
+
showAllRecipients && email.cc ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
196
|
+
", ",
|
|
197
|
+
email.cc
|
|
198
|
+
] }) : null,
|
|
199
|
+
showAllRecipients && email.bcc ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
200
|
+
" ",
|
|
201
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground/40", children: "bcc" }),
|
|
202
|
+
" ",
|
|
203
|
+
email.bcc
|
|
204
|
+
] }) : null
|
|
205
|
+
] }),
|
|
206
|
+
(email.cc || email.bcc) && /* @__PURE__ */ jsx(
|
|
207
|
+
"button",
|
|
208
|
+
{
|
|
209
|
+
type: "button",
|
|
210
|
+
onClick: (e) => {
|
|
211
|
+
e.stopPropagation();
|
|
212
|
+
setShowAllRecipients((prev) => !prev);
|
|
213
|
+
},
|
|
214
|
+
className: "shrink-0 text-muted-foreground/40 hover:text-muted-foreground transition-colors",
|
|
215
|
+
children: /* @__PURE__ */ jsx(ChevronDown, { className: cn("h-3 w-3 transition-transform", showAllRecipients && "rotate-180") })
|
|
216
|
+
}
|
|
217
|
+
)
|
|
218
|
+
] })
|
|
219
|
+
] });
|
|
220
|
+
}
|
|
221
|
+
function EmailBody({ email }) {
|
|
222
|
+
if (email.bodyHtml) {
|
|
223
|
+
return (
|
|
224
|
+
// Gmail reading-pane typography; quoted history
|
|
225
|
+
// (blockquote.gmail_quote) is de-emphasized with a left rule.
|
|
226
|
+
/* @__PURE__ */ jsx(
|
|
110
227
|
"div",
|
|
111
228
|
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
229
|
+
"data-slot": "timeline-email-html",
|
|
230
|
+
className: EMAIL_HTML_CLASS,
|
|
231
|
+
dangerouslySetInnerHTML: { __html: sanitizeHtml(email.bodyHtml) }
|
|
232
|
+
}
|
|
233
|
+
)
|
|
234
|
+
);
|
|
235
|
+
}
|
|
236
|
+
return /* @__PURE__ */ jsx("div", { className: "whitespace-pre-line text-sm leading-relaxed text-foreground/90", children: email.body });
|
|
237
|
+
}
|
|
238
|
+
function CollapsedEmailPreview({
|
|
239
|
+
email,
|
|
240
|
+
preview,
|
|
241
|
+
className,
|
|
242
|
+
actionClassName,
|
|
243
|
+
onClick
|
|
244
|
+
}) {
|
|
245
|
+
return /* @__PURE__ */ jsxs("div", { className, onClick, children: [
|
|
246
|
+
/* @__PURE__ */ jsxs("span", { className: "line-clamp-1 pr-3 text-[13px]", children: [
|
|
247
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: email == null ? void 0 : email.from }),
|
|
248
|
+
/* @__PURE__ */ jsx("span", { className: "mx-1.5 text-muted-foreground/40", children: "\xB7" }),
|
|
249
|
+
(email == null ? void 0 : email.subject) ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
250
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: email.subject }),
|
|
251
|
+
/* @__PURE__ */ jsx("span", { className: "mx-1.5 text-muted-foreground/40", children: "\xB7" })
|
|
252
|
+
] }) : null,
|
|
253
|
+
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: preview })
|
|
254
|
+
] }),
|
|
255
|
+
/* @__PURE__ */ jsxs("button", { type: "button", className: actionClassName, children: [
|
|
256
|
+
"Expand ",
|
|
257
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" })
|
|
258
|
+
] })
|
|
259
|
+
] });
|
|
260
|
+
}
|
|
261
|
+
function ShowLessButton({
|
|
262
|
+
className,
|
|
263
|
+
onClick,
|
|
264
|
+
type
|
|
265
|
+
}) {
|
|
266
|
+
return /* @__PURE__ */ jsxs("button", { type, onClick, className, children: [
|
|
267
|
+
"Show less ",
|
|
268
|
+
/* @__PURE__ */ jsx(ChevronUp, { className: "h-3 w-3" })
|
|
269
|
+
] });
|
|
270
|
+
}
|
|
271
|
+
function SourceAction({
|
|
272
|
+
source,
|
|
273
|
+
onSourceClick,
|
|
274
|
+
className
|
|
275
|
+
}) {
|
|
276
|
+
if (onSourceClick) {
|
|
277
|
+
return /* @__PURE__ */ jsxs(
|
|
278
|
+
"button",
|
|
279
|
+
{
|
|
280
|
+
type: "button",
|
|
281
|
+
onClick: (e) => {
|
|
282
|
+
e.stopPropagation();
|
|
283
|
+
onSourceClick();
|
|
284
|
+
},
|
|
285
|
+
className,
|
|
286
|
+
children: [
|
|
287
|
+
"Open in ",
|
|
288
|
+
source.label,
|
|
289
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3" })
|
|
290
|
+
]
|
|
291
|
+
}
|
|
292
|
+
);
|
|
293
|
+
}
|
|
294
|
+
return /* @__PURE__ */ jsxs(
|
|
295
|
+
"a",
|
|
296
|
+
{
|
|
297
|
+
href: source.url,
|
|
298
|
+
target: "_blank",
|
|
299
|
+
rel: "noreferrer noopener",
|
|
300
|
+
className,
|
|
301
|
+
children: [
|
|
302
|
+
"Open in ",
|
|
303
|
+
source.label,
|
|
304
|
+
/* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3" })
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
);
|
|
308
|
+
}
|
|
309
|
+
function EmailCard({
|
|
310
|
+
event,
|
|
311
|
+
expanded,
|
|
312
|
+
setExpanded,
|
|
313
|
+
showAllRecipients,
|
|
314
|
+
setShowAllRecipients,
|
|
315
|
+
variant,
|
|
316
|
+
classes
|
|
317
|
+
}) {
|
|
318
|
+
if (variant === "default") {
|
|
319
|
+
return /* @__PURE__ */ jsx("div", { className: classes.cardContainer, "data-variant": variant, children: /* @__PURE__ */ jsx(
|
|
320
|
+
"div",
|
|
321
|
+
{
|
|
322
|
+
className: cn(
|
|
323
|
+
"px-3 py-2.5 text-sm",
|
|
324
|
+
!expanded && "cursor-pointer hover:bg-muted/30 transition-colors"
|
|
325
|
+
),
|
|
326
|
+
onClick: () => !expanded && setExpanded(true),
|
|
327
|
+
children: expanded && event.email ? /* @__PURE__ */ jsxs("div", { className: "space-y-3", children: [
|
|
328
|
+
/* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
|
|
329
|
+
EmailMetadata,
|
|
330
|
+
{
|
|
331
|
+
email: event.email,
|
|
332
|
+
showAllRecipients,
|
|
333
|
+
setShowAllRecipients
|
|
334
|
+
}
|
|
335
|
+
) }),
|
|
336
|
+
/* @__PURE__ */ jsx(EmailBody, { email: event.email }),
|
|
337
|
+
/* @__PURE__ */ jsx(
|
|
338
|
+
ShowLessButton,
|
|
339
|
+
{
|
|
340
|
+
onClick: (e) => {
|
|
341
|
+
e.stopPropagation();
|
|
342
|
+
setExpanded(false);
|
|
343
|
+
},
|
|
344
|
+
className: "mt-2 flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground"
|
|
345
|
+
}
|
|
346
|
+
)
|
|
347
|
+
] }) : /* @__PURE__ */ jsx(
|
|
348
|
+
CollapsedEmailPreview,
|
|
349
|
+
{
|
|
350
|
+
email: event.email,
|
|
351
|
+
preview: event.preview,
|
|
352
|
+
className: "flex items-center justify-between gap-2 text-muted-foreground",
|
|
353
|
+
actionClassName: "flex shrink-0 items-center gap-1 text-[11px] font-semibold uppercase tracking-wider transition-colors hover:text-foreground"
|
|
354
|
+
}
|
|
355
|
+
)
|
|
356
|
+
}
|
|
357
|
+
) });
|
|
358
|
+
}
|
|
359
|
+
return /* @__PURE__ */ jsx("div", { className: classes.cardContainer, "data-variant": variant, children: expanded && event.email ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
360
|
+
/* @__PURE__ */ jsx("div", { className: classes.cardHeader, "data-slot": "timeline-card-header", children: /* @__PURE__ */ jsx(
|
|
361
|
+
EmailMetadata,
|
|
362
|
+
{
|
|
363
|
+
email: event.email,
|
|
364
|
+
showAllRecipients,
|
|
365
|
+
setShowAllRecipients
|
|
366
|
+
}
|
|
367
|
+
) }),
|
|
368
|
+
/* @__PURE__ */ jsx("div", { className: classes.cardBody, "data-slot": "timeline-card-body", children: /* @__PURE__ */ jsx(EmailBody, { email: event.email }) }),
|
|
369
|
+
/* @__PURE__ */ jsx("div", { className: cn(classes.cardFooter, classes.actionLinkRow), "data-slot": "timeline-card-footer", children: /* @__PURE__ */ jsx(
|
|
370
|
+
ShowLessButton,
|
|
371
|
+
{
|
|
372
|
+
type: "button",
|
|
373
|
+
onClick: (e) => {
|
|
374
|
+
e.stopPropagation();
|
|
375
|
+
setExpanded(false);
|
|
376
|
+
},
|
|
377
|
+
className: classes.actionLink
|
|
378
|
+
}
|
|
379
|
+
) })
|
|
380
|
+
] }) : /* @__PURE__ */ jsx(
|
|
381
|
+
CollapsedEmailPreview,
|
|
382
|
+
{
|
|
383
|
+
email: event.email,
|
|
384
|
+
preview: event.preview,
|
|
385
|
+
className: cn(classes.collapsedPreview, "cursor-pointer hover:bg-muted/30 transition-colors"),
|
|
386
|
+
actionClassName: cn(classes.actionLink, "shrink-0"),
|
|
387
|
+
onClick: () => setExpanded(true)
|
|
388
|
+
}
|
|
389
|
+
) });
|
|
390
|
+
}
|
|
391
|
+
function ContentCard({
|
|
392
|
+
event,
|
|
393
|
+
expanded,
|
|
394
|
+
setExpanded,
|
|
395
|
+
variant,
|
|
396
|
+
classes
|
|
397
|
+
}) {
|
|
398
|
+
var _a, _b;
|
|
399
|
+
if (variant === "default") {
|
|
400
|
+
return /* @__PURE__ */ jsx("div", { className: classes.cardContainer, "data-variant": variant, children: /* @__PURE__ */ jsx(
|
|
401
|
+
"div",
|
|
402
|
+
{
|
|
403
|
+
className: cn(
|
|
404
|
+
"px-3 py-2.5 text-sm",
|
|
405
|
+
!expanded && "cursor-pointer hover:bg-muted/30 transition-colors"
|
|
406
|
+
),
|
|
407
|
+
onClick: () => !expanded && setExpanded(true),
|
|
408
|
+
children: expanded ? /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
|
|
409
|
+
event.content,
|
|
410
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-center gap-3", children: [
|
|
411
|
+
event.source ? /* @__PURE__ */ jsx(
|
|
412
|
+
SourceAction,
|
|
413
|
+
{
|
|
414
|
+
source: event.source,
|
|
415
|
+
onSourceClick: event.onSourceClick,
|
|
416
|
+
className: "mr-auto inline-flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground"
|
|
417
|
+
}
|
|
418
|
+
) : null,
|
|
419
|
+
/* @__PURE__ */ jsx(
|
|
420
|
+
ShowLessButton,
|
|
170
421
|
{
|
|
171
422
|
onClick: (e) => {
|
|
172
423
|
e.stopPropagation();
|
|
173
424
|
setExpanded(false);
|
|
174
425
|
},
|
|
175
|
-
className: "
|
|
176
|
-
children: [
|
|
177
|
-
"Show less ",
|
|
178
|
-
/* @__PURE__ */ jsx(ChevronUp, { className: "h-3 w-3" })
|
|
179
|
-
]
|
|
426
|
+
className: "flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground"
|
|
180
427
|
}
|
|
181
428
|
)
|
|
182
|
-
] }) : /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 text-muted-foreground", children: [
|
|
183
|
-
/* @__PURE__ */ jsxs("span", { className: "line-clamp-1 pr-3 text-[13px]", children: [
|
|
184
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: (_b = event.email) == null ? void 0 : _b.from }),
|
|
185
|
-
/* @__PURE__ */ jsx("span", { className: "mx-1.5 text-muted-foreground/40", children: "\xB7" }),
|
|
186
|
-
((_c = event.email) == null ? void 0 : _c.subject) ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
187
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: event.email.subject }),
|
|
188
|
-
/* @__PURE__ */ jsx("span", { className: "mx-1.5 text-muted-foreground/40", children: "\xB7" })
|
|
189
|
-
] }) : null,
|
|
190
|
-
/* @__PURE__ */ jsx("span", { className: "text-muted-foreground", children: event.preview })
|
|
191
|
-
] }),
|
|
192
|
-
/* @__PURE__ */ jsxs("button", { className: "flex shrink-0 items-center gap-1 text-[11px] font-semibold uppercase tracking-wider transition-colors hover:text-foreground", children: [
|
|
193
|
-
"Expand ",
|
|
194
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" })
|
|
195
|
-
] })
|
|
196
429
|
] })
|
|
430
|
+
] }) : /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 text-muted-foreground", children: [
|
|
431
|
+
/* @__PURE__ */ jsx("span", { className: "line-clamp-1 pr-3", children: (_a = event.preview) != null ? _a : event.content }),
|
|
432
|
+
/* @__PURE__ */ jsxs("button", { className: "flex shrink-0 items-center gap-1 text-[11px] font-semibold uppercase tracking-wider transition-colors hover:text-foreground", children: [
|
|
433
|
+
"Expand ",
|
|
434
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" })
|
|
435
|
+
] })
|
|
436
|
+
] })
|
|
437
|
+
}
|
|
438
|
+
) });
|
|
439
|
+
}
|
|
440
|
+
return /* @__PURE__ */ jsx("div", { className: classes.cardContainer, "data-variant": variant, children: expanded ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
441
|
+
/* @__PURE__ */ jsx("div", { className: classes.cardBody, "data-slot": "timeline-card-body", children: event.content }),
|
|
442
|
+
/* @__PURE__ */ jsxs("div", { className: cn(classes.cardFooter, classes.actionLinkRow, event.source ? "justify-between" : "justify-end"), "data-slot": "timeline-card-footer", children: [
|
|
443
|
+
event.source ? /* @__PURE__ */ jsx(
|
|
444
|
+
SourceAction,
|
|
445
|
+
{
|
|
446
|
+
source: event.source,
|
|
447
|
+
onSourceClick: event.onSourceClick,
|
|
448
|
+
className: classes.actionLink
|
|
197
449
|
}
|
|
198
|
-
)
|
|
199
|
-
|
|
450
|
+
) : null,
|
|
451
|
+
/* @__PURE__ */ jsx(
|
|
452
|
+
ShowLessButton,
|
|
200
453
|
{
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
event.content,
|
|
208
|
-
/* @__PURE__ */ jsxs("div", { className: "mt-2 flex items-center gap-3", children: [
|
|
209
|
-
event.source ? event.onSourceClick ? /* @__PURE__ */ jsxs(
|
|
210
|
-
"button",
|
|
211
|
-
{
|
|
212
|
-
type: "button",
|
|
213
|
-
onClick: (e) => {
|
|
214
|
-
var _a2;
|
|
215
|
-
e.stopPropagation();
|
|
216
|
-
(_a2 = event.onSourceClick) == null ? void 0 : _a2.call(event);
|
|
217
|
-
},
|
|
218
|
-
className: "mr-auto inline-flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground",
|
|
219
|
-
children: [
|
|
220
|
-
"Open in ",
|
|
221
|
-
event.source.label,
|
|
222
|
-
/* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3" })
|
|
223
|
-
]
|
|
224
|
-
}
|
|
225
|
-
) : /* @__PURE__ */ jsxs(
|
|
226
|
-
"a",
|
|
227
|
-
{
|
|
228
|
-
href: event.source.url,
|
|
229
|
-
target: "_blank",
|
|
230
|
-
rel: "noreferrer noopener",
|
|
231
|
-
className: "mr-auto inline-flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground",
|
|
232
|
-
children: [
|
|
233
|
-
"Open in ",
|
|
234
|
-
event.source.label,
|
|
235
|
-
/* @__PURE__ */ jsx(ExternalLink, { className: "h-3 w-3" })
|
|
236
|
-
]
|
|
237
|
-
}
|
|
238
|
-
) : null,
|
|
239
|
-
/* @__PURE__ */ jsxs(
|
|
240
|
-
"button",
|
|
241
|
-
{
|
|
242
|
-
onClick: (e) => {
|
|
243
|
-
e.stopPropagation();
|
|
244
|
-
setExpanded(false);
|
|
245
|
-
},
|
|
246
|
-
className: "flex items-center gap-1.5 text-[11px] font-semibold uppercase tracking-wider text-muted-foreground transition-colors hover:text-foreground",
|
|
247
|
-
children: [
|
|
248
|
-
"Show less ",
|
|
249
|
-
/* @__PURE__ */ jsx(ChevronUp, { className: "h-3 w-3" })
|
|
250
|
-
]
|
|
251
|
-
}
|
|
252
|
-
)
|
|
253
|
-
] })
|
|
254
|
-
] }) : /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2 text-muted-foreground", children: [
|
|
255
|
-
/* @__PURE__ */ jsx("span", { className: "line-clamp-1 pr-3", children: (_d = event.preview) != null ? _d : event.content }),
|
|
256
|
-
/* @__PURE__ */ jsxs("button", { className: "flex shrink-0 items-center gap-1 text-[11px] font-semibold uppercase tracking-wider transition-colors hover:text-foreground", children: [
|
|
257
|
-
"Expand ",
|
|
258
|
-
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" })
|
|
259
|
-
] })
|
|
260
|
-
] })
|
|
454
|
+
type: "button",
|
|
455
|
+
onClick: (e) => {
|
|
456
|
+
e.stopPropagation();
|
|
457
|
+
setExpanded(false);
|
|
458
|
+
},
|
|
459
|
+
className: classes.actionLink
|
|
261
460
|
}
|
|
262
|
-
)
|
|
461
|
+
)
|
|
263
462
|
] })
|
|
264
|
-
] })
|
|
463
|
+
] }) : /* @__PURE__ */ jsxs(
|
|
464
|
+
"div",
|
|
465
|
+
{
|
|
466
|
+
className: cn(classes.collapsedPreview, "cursor-pointer hover:bg-muted/30 transition-colors"),
|
|
467
|
+
onClick: () => setExpanded(true),
|
|
468
|
+
children: [
|
|
469
|
+
/* @__PURE__ */ jsx("span", { className: "line-clamp-1 pr-3", children: (_b = event.preview) != null ? _b : event.content }),
|
|
470
|
+
/* @__PURE__ */ jsxs("button", { type: "button", className: cn(classes.actionLink, "shrink-0"), children: [
|
|
471
|
+
"Expand ",
|
|
472
|
+
/* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" })
|
|
473
|
+
] })
|
|
474
|
+
]
|
|
475
|
+
}
|
|
476
|
+
) });
|
|
265
477
|
}
|
|
266
478
|
export {
|
|
267
479
|
TONE_CLASSES,
|