@burdenoff/fe-libs 2026.1117.2 → 2026.1117.3

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.
Files changed (28) hide show
  1. package/dist/shared/assistant/history/historyControls.d.ts +5 -0
  2. package/dist/shared/assistant/history/historyControls.js +9 -5
  3. package/dist/shared/assistant/home/AssistantHomeActions.d.ts +37 -0
  4. package/dist/shared/assistant/home/AssistantHomeActions.js +68 -0
  5. package/dist/shared/assistant/home/AssistantHomeComposer.d.ts +36 -0
  6. package/dist/shared/assistant/home/AssistantHomeComposer.js +85 -0
  7. package/dist/shared/assistant/home/AssistantHomeHistory.d.ts +106 -0
  8. package/dist/shared/assistant/home/AssistantHomeHistory.js +499 -0
  9. package/dist/shared/assistant/home/AssistantHomePage.d.ts +67 -0
  10. package/dist/shared/assistant/home/AssistantHomePage.js +78 -0
  11. package/dist/shared/assistant/home/AssistantHomeStart.d.ts +171 -0
  12. package/dist/shared/assistant/home/AssistantHomeStart.js +224 -0
  13. package/dist/shared/assistant/home/assistantHomeChat.d.ts +47 -0
  14. package/dist/shared/assistant/home/assistantHomeChat.js +49 -0
  15. package/dist/shared/assistant/home/assistantHomeHistoryRows.d.ts +93 -0
  16. package/dist/shared/assistant/home/assistantHomeHistoryRows.js +113 -0
  17. package/dist/shared/assistant/home/assistantHomeRoutes.d.ts +49 -0
  18. package/dist/shared/assistant/home/assistantHomeRoutes.js +48 -0
  19. package/dist/shared/assistant/home/assistantHomeTopBar.d.ts +4 -0
  20. package/dist/shared/assistant/home/assistantHomeTopBar.js +10 -0
  21. package/dist/shared/assistant/home/useAssistantHomeHistoryRows.d.ts +46 -0
  22. package/dist/shared/assistant/home/useAssistantHomeHistoryRows.js +120 -0
  23. package/dist/shared/assistant/home.d.ts +19 -0
  24. package/dist/shared/assistant/home.js +11 -0
  25. package/dist/shared/assistant/index.d.ts +10 -0
  26. package/dist/shared/assistant/ui/AssistantConversationList.js +44 -48
  27. package/dist/shared-assistant.js +222 -212
  28. package/package.json +1 -1
@@ -0,0 +1,499 @@
1
+ import { AlertDialog as e, AlertDialogAction as t, AlertDialogCancel as n, AlertDialogContent as r, AlertDialogDescription as i, AlertDialogFooter as a, AlertDialogHeader as o, AlertDialogTitle as s } from "../../../ui/alert-dialog.js";
2
+ import { Button as c, buttonVariants as l } from "../../../ui/button.js";
3
+ import { Dialog as u, DialogContent as d, DialogDescription as f, DialogFooter as p, DialogHeader as m, DialogTitle as h } from "../../../ui/dialog.js";
4
+ import { DropdownMenu as g, DropdownMenuContent as _, DropdownMenuItem as v, DropdownMenuSeparator as y, DropdownMenuTrigger as b } from "../../../ui/dropdown-menu.js";
5
+ import { Input as x } from "../../../ui/input.js";
6
+ import { clampToCodePoints as S } from "../history/historyControls.js";
7
+ import { assistantHomeHistoryTimeLabel as C, groupAssistantHomeHistoryRows as w, matchesAssistantHomeHistoryKind as T, matchesAssistantHomeHistoryQuery as ee } from "./assistantHomeHistoryRows.js";
8
+ import { useId as E, useMemo as D, useRef as O, useState as k } from "react";
9
+ import { Archive as A, ArchiveRestore as j, MessageSquare as M, Mic as N, MoreHorizontal as P, Pencil as te, Pin as F, PinOff as I, Search as L, Trash2 as R } from "lucide-react";
10
+ import { Fragment as z, jsx as B, jsxs as V } from "react/jsx-runtime";
11
+ import { useNavigate as H } from "react-router";
12
+ // src/shared/assistant/home/AssistantHomeHistory.tsx
13
+ var U = "inline-flex h-8 items-center rounded-pill border px-3 text-body-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-focus-ring", W = `${U} border-transparent bg-accent-soft text-text-primary`, G = `${U} border-border-subtle text-text-secondary hover:bg-bg-sunken hover:text-text-primary`, K = "inline-flex shrink-0 items-center gap-1 rounded-pill border border-border-subtle px-1.5 text-caption text-text-secondary";
14
+ function q(e, t) {
15
+ switch (t) {
16
+ case "today": return e.today;
17
+ case "yesterday": return e.yesterday;
18
+ case "week": return e.thisWeek;
19
+ default: return e.older;
20
+ }
21
+ }
22
+ function J(e, t) {
23
+ switch (t) {
24
+ case "archived": return e.emptyArchived;
25
+ case "pinned": return e.emptyPinned;
26
+ case "voice": return e.emptyVoice;
27
+ case "typed": return e.emptyTyped;
28
+ default: return null;
29
+ }
30
+ }
31
+ function Y(e, t, n) {
32
+ let r = [{
33
+ value: "all",
34
+ label: e.all
35
+ }, ...t.map((e) => ({
36
+ value: e.value,
37
+ label: e.filterLabel
38
+ }))];
39
+ return n ? [
40
+ ...r,
41
+ {
42
+ value: "pinned",
43
+ label: e.pinned
44
+ },
45
+ {
46
+ value: "voice",
47
+ label: e.voice
48
+ },
49
+ {
50
+ value: "typed",
51
+ label: e.typed
52
+ },
53
+ {
54
+ value: "archived",
55
+ label: e.archived
56
+ }
57
+ ] : r;
58
+ }
59
+ function X({ labels: e, kinds: t = [], locale: n, history: r, query: i, onQueryChange: a, filter: o, onFilterChange: s, onOpen: c, onStart: l, rowLink: u }) {
60
+ let [d, f] = k(null), [p, m] = k(null), h = e.untitled, g = O(null), _ = O(null), v = O(null), y = O(/* @__PURE__ */ new Map()), b = O(null), S = (e, t) => {
61
+ t ? y.current.set(e, t) : y.current.delete(e);
62
+ }, C = D(() => {
63
+ let e = r.rows.filter((e) => T(e, o) && (r.search.active || ee(e, i, h)));
64
+ return w(e, /* @__PURE__ */ new Date());
65
+ }, [
66
+ r.rows,
67
+ r.search.active,
68
+ o,
69
+ i,
70
+ h
71
+ ]), E = Y(e, t, r.controlsOn), A = i.trim() !== "" || o !== "all", j = (e) => C.flatMap((e) => e.rows).findIndex((t) => t.key === e);
72
+ return /* @__PURE__ */ V("div", {
73
+ ref: g,
74
+ className: "mx-auto flex w-full max-w-3xl flex-col gap-6 px-4 pb-6",
75
+ children: [
76
+ /* @__PURE__ */ B("h1", {
77
+ className: "text-2xl font-semibold tracking-tight text-text-primary",
78
+ children: e.title
79
+ }),
80
+ /* @__PURE__ */ V("div", {
81
+ className: "flex flex-col gap-3",
82
+ children: [/* @__PURE__ */ V("div", {
83
+ className: "relative",
84
+ children: [/* @__PURE__ */ B(L, {
85
+ className: "pointer-events-none absolute start-3 top-1/2 size-4 -translate-y-1/2 text-text-muted",
86
+ "aria-hidden": "true"
87
+ }), /* @__PURE__ */ B(x, {
88
+ type: "search",
89
+ value: i,
90
+ onChange: (e) => a(e.target.value),
91
+ onKeyDown: (e) => {
92
+ e.key === "Enter" && r.search.flush();
93
+ },
94
+ placeholder: e.search,
95
+ "aria-label": e.search,
96
+ className: "ps-9"
97
+ })]
98
+ }), /* @__PURE__ */ B("div", {
99
+ role: "group",
100
+ "aria-label": e.filters,
101
+ className: "flex flex-wrap gap-2",
102
+ children: E.map((e) => /* @__PURE__ */ B("button", {
103
+ type: "button",
104
+ "aria-pressed": o === e.value,
105
+ className: o === e.value ? W : G,
106
+ onClick: () => s(e.value),
107
+ children: e.label
108
+ }, e.value))
109
+ })]
110
+ }),
111
+ i.trim() !== "" && r.controlsOn ? /* @__PURE__ */ B(ie, {
112
+ labels: e,
113
+ search: r.search
114
+ }) : null,
115
+ r.pinLimit === null ? null : /* @__PURE__ */ B("p", {
116
+ role: "status",
117
+ className: "text-body-sm text-text-secondary",
118
+ children: e.pinLimit(r.pinLimit)
119
+ }),
120
+ C.length === 0 ? /* @__PURE__ */ B(Z, {
121
+ labels: e,
122
+ filter: o,
123
+ query: i,
124
+ filtered: A,
125
+ onStart: l
126
+ }) : C.map(({ group: i, rows: a }) => /* @__PURE__ */ B(ae, {
127
+ label: q(e, i),
128
+ group: i,
129
+ rows: a,
130
+ locale: n,
131
+ labels: e,
132
+ kinds: t,
133
+ rowLink: u,
134
+ onOpen: c,
135
+ onRename: (e) => {
136
+ b.current = e.key, f(e);
137
+ },
138
+ registerRow: S,
139
+ onTogglePin: (e) => {
140
+ v.current = {
141
+ key: e.key,
142
+ index: j(e.key)
143
+ }, r.setPinned(e.key, !e.pinned);
144
+ },
145
+ onToggleArchive: (e) => {
146
+ v.current = {
147
+ key: e.key,
148
+ index: j(e.key)
149
+ }, r.setArchived(e.key, !e.archived);
150
+ },
151
+ onMenuCloseAutoFocus: (e, t) => {
152
+ let n = v.current;
153
+ if (!n || n.key !== e || (v.current = null, y.current.has(e))) return;
154
+ let r = Q(g.current, {
155
+ index: n.index,
156
+ deleted: !0
157
+ });
158
+ r && (t.preventDefault(), r.focus());
159
+ },
160
+ onDelete: m
161
+ }, i)),
162
+ /* @__PURE__ */ B(ne, {
163
+ labels: e,
164
+ search: r.search,
165
+ older: r.older
166
+ }),
167
+ /* @__PURE__ */ B(ue, {
168
+ row: d,
169
+ labels: e,
170
+ onCancel: () => f(null),
171
+ onSave: (e) => {
172
+ d && r.rename(d.key, e), f(null);
173
+ },
174
+ onCloseAutoFocus: (e) => {
175
+ let t = b.current;
176
+ b.current = null;
177
+ let n = t === null ? void 0 : y.current.get(t), r = n ? n.querySelector(":scope > button[aria-haspopup]") : g.current?.querySelector("input[type=\"search\"]");
178
+ r instanceof HTMLElement && (e.preventDefault(), r.focus());
179
+ }
180
+ }),
181
+ /* @__PURE__ */ B(re, {
182
+ labels: e,
183
+ open: p !== null,
184
+ onCancel: () => {
185
+ p && _.current === null && (_.current = {
186
+ index: j(p.key),
187
+ deleted: !1
188
+ }), m(null);
189
+ },
190
+ onConfirm: () => {
191
+ p && (_.current = {
192
+ index: j(p.key),
193
+ deleted: !0
194
+ }, r.remove(p.key)), m(null);
195
+ },
196
+ onCloseAutoFocus: (e) => {
197
+ let t = Q(g.current, _.current);
198
+ _.current = null, t && (e.preventDefault(), t.focus());
199
+ }
200
+ })
201
+ ]
202
+ });
203
+ }
204
+ function Z({ labels: e, filter: t, query: n, filtered: r, onStart: i }) {
205
+ let a = (n.trim() === "" ? J(e, t) : null) ?? (r ? e.noMatches : e.empty);
206
+ return /* @__PURE__ */ V("div", {
207
+ className: "flex flex-col items-center gap-3 py-16 text-center",
208
+ children: [
209
+ /* @__PURE__ */ B(M, {
210
+ className: "size-6 text-text-muted",
211
+ "aria-hidden": "true"
212
+ }),
213
+ /* @__PURE__ */ B("p", {
214
+ className: "text-body-sm text-text-secondary",
215
+ children: a
216
+ }),
217
+ r ? null : /* @__PURE__ */ B(c, {
218
+ type: "button",
219
+ variant: "outline",
220
+ size: "sm",
221
+ onClick: i,
222
+ children: e.startChat
223
+ })
224
+ ]
225
+ });
226
+ }
227
+ function ne({ labels: e, search: t, older: n }) {
228
+ return /* @__PURE__ */ V(z, { children: [t.active && t.more ? /* @__PURE__ */ B(c, {
229
+ type: "button",
230
+ variant: "outline",
231
+ size: "sm",
232
+ className: "self-center",
233
+ disabled: t.loadingMore,
234
+ onClick: t.loadMore,
235
+ children: e.showMore
236
+ }) : null, n.available ? /* @__PURE__ */ B(c, {
237
+ type: "button",
238
+ variant: "outline",
239
+ size: "sm",
240
+ className: "self-center",
241
+ onClick: n.load,
242
+ children: e.showOlder
243
+ }) : null] });
244
+ }
245
+ function Q(e, t) {
246
+ if (!e || !t) return null;
247
+ let n = [...e.querySelectorAll("li")], r = n[Math.min(t.index, n.length - 1)], i = r ? t.deleted ? r.querySelector(":scope > button") : r.querySelector(":scope > button[aria-haspopup]") : null;
248
+ if (i instanceof HTMLElement) return i;
249
+ let a = e.querySelector("input[type=\"search\"]");
250
+ return a instanceof HTMLElement ? a : null;
251
+ }
252
+ function re({ labels: c, open: u, onCancel: d, onConfirm: f, onCloseAutoFocus: p }) {
253
+ return /* @__PURE__ */ B(e, {
254
+ open: u,
255
+ onOpenChange: (e) => {
256
+ e || d();
257
+ },
258
+ children: /* @__PURE__ */ V(r, {
259
+ onCloseAutoFocus: p,
260
+ children: [/* @__PURE__ */ V(o, { children: [/* @__PURE__ */ B(s, { children: c.deleteTitle }), /* @__PURE__ */ B(i, { children: c.deleteBody })] }), /* @__PURE__ */ V(a, { children: [/* @__PURE__ */ B(n, { children: c.cancel }), /* @__PURE__ */ B(t, {
261
+ className: l({ variant: "destructive" }),
262
+ onClick: f,
263
+ children: c.deleteConfirm
264
+ })] })]
265
+ })
266
+ });
267
+ }
268
+ function ie({ labels: e, search: t }) {
269
+ let n = t.tooShort ? e.searchTooShort : t.searching ? e.searching : t.fallback === "busy" ? e.searchBusy : t.fallback === "failed" ? e.searchFailed : null;
270
+ return n ? /* @__PURE__ */ B("p", {
271
+ role: "status",
272
+ className: "text-body-sm text-text-secondary",
273
+ children: n
274
+ }) : null;
275
+ }
276
+ function ae({ label: e, group: t, rows: n, locale: r, labels: i, kinds: a, rowLink: o, registerRow: s, onMenuCloseAutoFocus: c, onOpen: l, onRename: u, onTogglePin: d, onToggleArchive: f, onDelete: p }) {
277
+ let m = E();
278
+ return /* @__PURE__ */ V("section", {
279
+ "aria-labelledby": m,
280
+ className: "flex flex-col gap-1",
281
+ children: [/* @__PURE__ */ B("h2", {
282
+ id: m,
283
+ className: "px-1 pb-1 text-caption font-semibold uppercase tracking-wider text-text-muted",
284
+ children: e
285
+ }), /* @__PURE__ */ B("ul", {
286
+ className: "flex flex-col",
287
+ children: n.map((e) => /* @__PURE__ */ B(le, {
288
+ row: e,
289
+ time: C(e.updatedAt, t, r),
290
+ labels: i,
291
+ kind: a.find((t) => t.value === e.kind) ?? null,
292
+ link: o ? {
293
+ ...o,
294
+ path: o.pathOf(e)
295
+ } : null,
296
+ rowRef: (t) => s(e.key, t),
297
+ onMenuCloseAutoFocus: (t) => c(e.key, t),
298
+ onOpen: () => l(e.key),
299
+ onRename: () => u(e),
300
+ onTogglePin: () => d(e),
301
+ onToggleArchive: () => f(e),
302
+ onDelete: () => p(e)
303
+ }, e.key))
304
+ })]
305
+ });
306
+ }
307
+ function oe(e, t) {
308
+ let n = [];
309
+ return t.typedCount !== null && t.typedCount > 0 && n.push(e.messages(t.typedCount)), t.spokenCount !== null && t.spokenCount > 0 && n.push(e.spoken(t.spokenCount)), n.length > 0 ? n.join(" · ") : null;
310
+ }
311
+ function $(e, t, n) {
312
+ let r = [n, oe(e, t)].filter((e) => e !== null);
313
+ return r.length > 0 ? r.join(" · ") : null;
314
+ }
315
+ function se({ labels: e, row: t }) {
316
+ let n = t.channel === "VOICE" ? e.voice : t.channel === "MIXED" ? e.mixed : null;
317
+ return /* @__PURE__ */ V(z, { children: [
318
+ t.pinned ? /* @__PURE__ */ B(F, {
319
+ className: "size-3.5 shrink-0 text-accent-primary",
320
+ "aria-label": e.pinned
321
+ }) : null,
322
+ n ? /* @__PURE__ */ V("span", {
323
+ className: K,
324
+ children: [/* @__PURE__ */ B(N, {
325
+ className: "size-3",
326
+ "aria-hidden": "true"
327
+ }), n]
328
+ }) : null,
329
+ t.archived ? /* @__PURE__ */ V("span", {
330
+ className: K,
331
+ children: [/* @__PURE__ */ B(A, {
332
+ className: "size-3",
333
+ "aria-hidden": "true"
334
+ }), e.archived]
335
+ }) : null
336
+ ] });
337
+ }
338
+ function ce({ labels: e, row: t, title: n, link: r, onCloseAutoFocus: i, onRename: a, onTogglePin: o, onToggleArchive: s, onDelete: l }) {
339
+ let u = H(), d = r?.path ?? null, f = r?.icon ?? null;
340
+ return /* @__PURE__ */ V(g, { children: [/* @__PURE__ */ B(b, {
341
+ asChild: !0,
342
+ children: /* @__PURE__ */ B(c, {
343
+ type: "button",
344
+ variant: "ghost",
345
+ size: "icon-sm",
346
+ "aria-label": e.actionsFor(n),
347
+ className: "absolute end-2 z-10 opacity-0 group-focus-within:opacity-100 group-hover:opacity-100 focus-visible:opacity-100 data-[state=open]:opacity-100 [@media(pointer:coarse)]:relative [@media(pointer:coarse)]:end-auto [@media(pointer:coarse)]:opacity-100",
348
+ children: /* @__PURE__ */ B(P, {
349
+ className: "size-4",
350
+ "aria-hidden": "true"
351
+ })
352
+ })
353
+ }), /* @__PURE__ */ V(_, {
354
+ align: "end",
355
+ onCloseAutoFocus: i,
356
+ children: [
357
+ t.canRename === !1 ? null : /* @__PURE__ */ V(v, {
358
+ onSelect: a,
359
+ children: [/* @__PURE__ */ B(te, {
360
+ className: "size-4",
361
+ "aria-hidden": "true"
362
+ }), e.rename]
363
+ }),
364
+ t.canPin ? /* @__PURE__ */ V(v, {
365
+ onSelect: o,
366
+ children: [t.pinned ? /* @__PURE__ */ B(I, {
367
+ className: "size-4",
368
+ "aria-hidden": "true"
369
+ }) : /* @__PURE__ */ B(F, {
370
+ className: "size-4",
371
+ "aria-hidden": "true"
372
+ }), t.pinned ? e.unpin : e.pin]
373
+ }) : null,
374
+ t.canArchive ? /* @__PURE__ */ V(v, {
375
+ onSelect: s,
376
+ children: [t.archived ? /* @__PURE__ */ B(j, {
377
+ className: "size-4",
378
+ "aria-hidden": "true"
379
+ }) : /* @__PURE__ */ B(A, {
380
+ className: "size-4",
381
+ "aria-hidden": "true"
382
+ }), t.archived ? e.unarchive : e.archive]
383
+ }) : null,
384
+ d && r && f ? /* @__PURE__ */ V(v, {
385
+ onSelect: () => {
386
+ u(d);
387
+ },
388
+ children: [/* @__PURE__ */ B(f, {
389
+ className: "size-4",
390
+ "aria-hidden": "true"
391
+ }), r.label]
392
+ }) : null,
393
+ /* @__PURE__ */ B(y, {}),
394
+ /* @__PURE__ */ V(v, {
395
+ onSelect: l,
396
+ className: "text-status-error-text focus:text-status-error-text",
397
+ children: [/* @__PURE__ */ B(R, {
398
+ className: "size-4",
399
+ "aria-hidden": "true"
400
+ }), e.delete]
401
+ })
402
+ ]
403
+ })] });
404
+ }
405
+ function le({ row: e, time: t, labels: n, kind: r, link: i, rowRef: a, onMenuCloseAutoFocus: o, onOpen: s, onRename: c, onTogglePin: l, onToggleArchive: u, onDelete: d }) {
406
+ let f = e.title || n.untitled, p = $(n, e, r?.rowLabel ?? null), m = r?.icon ?? M;
407
+ return /* @__PURE__ */ V("li", {
408
+ ref: a,
409
+ className: "group relative flex items-center gap-3 rounded-card px-3 py-2.5 transition-colors hover:bg-bg-elevated focus-within:bg-bg-elevated",
410
+ children: [
411
+ /* @__PURE__ */ B("span", {
412
+ className: "flex size-8 shrink-0 items-center justify-center rounded-button border border-border-subtle text-text-secondary",
413
+ children: /* @__PURE__ */ B(m, {
414
+ className: "size-4",
415
+ "aria-hidden": "true"
416
+ })
417
+ }),
418
+ /* @__PURE__ */ V("button", {
419
+ type: "button",
420
+ onClick: s,
421
+ className: "flex min-w-0 flex-1 flex-col text-start after:absolute after:inset-0 after:rounded-card focus-visible:outline-none focus-visible:after:ring-2 focus-visible:after:ring-focus-ring",
422
+ children: [/* @__PURE__ */ V("span", {
423
+ className: "flex items-center gap-1.5",
424
+ children: [/* @__PURE__ */ B("span", {
425
+ className: "truncate text-body-sm font-medium text-text-primary",
426
+ children: f
427
+ }), /* @__PURE__ */ B(se, {
428
+ labels: n,
429
+ row: e
430
+ })]
431
+ }), p ? /* @__PURE__ */ B("span", {
432
+ className: "truncate text-body-sm text-text-muted",
433
+ children: p
434
+ }) : null]
435
+ }),
436
+ /* @__PURE__ */ B("span", {
437
+ className: "relative shrink-0 text-body-sm text-text-muted group-focus-within:invisible group-hover:invisible",
438
+ children: t
439
+ }),
440
+ /* @__PURE__ */ B(ce, {
441
+ labels: n,
442
+ row: e,
443
+ title: f,
444
+ link: i,
445
+ onCloseAutoFocus: o,
446
+ onRename: c,
447
+ onTogglePin: l,
448
+ onToggleArchive: u,
449
+ onDelete: d
450
+ })
451
+ ]
452
+ });
453
+ }
454
+ function ue({ row: e, labels: t, onCancel: n, onSave: r, onCloseAutoFocus: i }) {
455
+ return /* @__PURE__ */ B(u, {
456
+ open: e !== null,
457
+ onOpenChange: (e) => {
458
+ e || n();
459
+ },
460
+ children: /* @__PURE__ */ B(d, {
461
+ onCloseAutoFocus: i,
462
+ children: e ? /* @__PURE__ */ B(de, {
463
+ initial: e.title || t.untitled,
464
+ labels: t,
465
+ onCancel: n,
466
+ onSave: r
467
+ }, e.key) : null
468
+ })
469
+ });
470
+ }
471
+ function de({ initial: e, labels: t, onCancel: n, onSave: r }) {
472
+ let [i, a] = k(() => S(e, 80)), o = i.trim();
473
+ return /* @__PURE__ */ V("form", {
474
+ className: "flex flex-col gap-4",
475
+ onSubmit: (e) => {
476
+ e.preventDefault(), o && r(o);
477
+ },
478
+ children: [
479
+ /* @__PURE__ */ V(m, { children: [/* @__PURE__ */ B(h, { children: t.renameTitle }), /* @__PURE__ */ B(f, { children: t.renameBody })] }),
480
+ /* @__PURE__ */ B(x, {
481
+ value: i,
482
+ onChange: (e) => a(S(e.target.value, 80)),
483
+ "aria-label": t.renameField,
484
+ autoFocus: !0
485
+ }),
486
+ /* @__PURE__ */ V(p, { children: [/* @__PURE__ */ B(c, {
487
+ type: "button",
488
+ variant: "outline",
489
+ onClick: n,
490
+ children: t.cancel
491
+ }), /* @__PURE__ */ B(c, {
492
+ type: "submit",
493
+ disabled: !o,
494
+ children: t.save
495
+ })] })
496
+ ]
497
+ });
498
+ }
499
+ export { X as AssistantHomeHistory };
@@ -0,0 +1,67 @@
1
+ import { ReactNode } from 'react';
2
+ import { AssistantHomeActionsContent } from './AssistantHomeActions';
3
+ import { AssistantHomeStartContent } from './AssistantHomeStart';
4
+ /**
5
+ * The in-page chat fills the screen below the shell. The content area grows with its page, so a
6
+ * percentage height would only be the chat's own height. Desktop: the whole viewport (no top bar on
7
+ * this page). Phone: minus the phone shell's top bar and bottom tab bar (7rem together). The hero
8
+ * and History scroll as pages.
9
+ */
10
+ export declare const ASSISTANT_HOME_CHAT_FRAME = "flex h-[calc(100dvh-7rem)] min-h-0 flex-col bg-bg-canvas md:h-dvh";
11
+ /** The hero and History: a page that scrolls. */
12
+ export declare const ASSISTANT_HOME_PAGE_FRAME = "min-h-full bg-bg-canvas";
13
+ export interface AssistantHomePageProps {
14
+ /** The Chat tab where the assistant can be hosted: the host's `AssistantHomeInPageChat`. */
15
+ chat: ReactNode;
16
+ /** The Chat tab otherwise (or with `?prompt=`): the host's `AssistantHomeHeroChat`. */
17
+ hero: ReactNode;
18
+ /** The History tab: the host's `AssistantHomeHistory`. */
19
+ history: ReactNode;
20
+ /** History's top-right actions (New chat and the host's controls). */
21
+ actions: AssistantHomeActionsContent;
22
+ /**
23
+ * The page's rule for a new chat: the start page's fresh chat on arrival
24
+ * (`useAssistantHomeStartChat`) and the one New chat starts, in every view
25
+ * (`AssistantHomeNewChatContext`). Default `assistantHomeNewChat`. A product that starts new
26
+ * chats its own way (say, in a mode of its own) passes its rule.
27
+ */
28
+ newChat?: () => string;
29
+ /** The in-page chat's frame, for a phone shell whose bars are not 7rem together. */
30
+ chatFrameClassName?: string;
31
+ }
32
+ export declare function AssistantHomePage({ chat, hero, history, actions, newChat, chatFrameClassName, }: AssistantHomePageProps): import('react').JSX.Element;
33
+ export interface AssistantHomeChatViewProps {
34
+ /** The start content around the message box of a new chat. */
35
+ start: AssistantHomeStartContent;
36
+ /** The page's actions: the start page's first row, and a chat's page bar. */
37
+ actions: AssistantHomeActionsContent;
38
+ }
39
+ /**
40
+ * The Chat tab IN the page: the ONE assistant, hosted, with ONE message box.
41
+ *
42
+ * Not a second chat area: `AssistantPageHost` hands this element to the overlay, which renders its
43
+ * one panel here (the same instance the side panel shows, so nothing is re-sent and a turn in
44
+ * flight or a draft carries over), laid out as a chat page: its own slim bar, and the conversation,
45
+ * the message box and the footer in one centred column.
46
+ *
47
+ * A new chat shows the start content AROUND the assistant's message box (the greeting above; the
48
+ * suggestions, a phone's latest chats and the cards below), so the start page and the chat use the
49
+ * same box, as in a chat app. The first message replaces them with the conversation and the box
50
+ * moves to the bottom.
51
+ *
52
+ * Over a chat (and one still loading), the assistant's bar carries the page's History, New chat
53
+ * and the host's controls before its preview toggle and ⋯ (`actions`), and ⋯ also renames, pins
54
+ * and deletes the open chat (`manageChat`). A new chat has no bar: its hero's first row holds the
55
+ * host's controls.
56
+ */
57
+ export declare function AssistantHomeInPageChat({ start, actions }: AssistantHomeChatViewProps): import('react').JSX.Element;
58
+ export interface AssistantHomeHeroChatProps extends AssistantHomeChatViewProps {
59
+ /** The page's own message box (`AssistantHomeComposer`), between the greeting and the chips. */
60
+ composer: ReactNode;
61
+ }
62
+ /**
63
+ * The start page where the assistant cannot be hosted in it (or it starts with a prompt): the hero
64
+ * with its own message box, which the host hands to the assistant. Where it can,
65
+ * `AssistantHomeInPageChat` shows the same pieces around the assistant's own box.
66
+ */
67
+ export declare function AssistantHomeHeroChat({ start, actions, composer }: AssistantHomeHeroChatProps): import('react').JSX.Element;
@@ -0,0 +1,78 @@
1
+ import { AssistantPageHost as e } from "../ui/AssistantPageHost.js";
2
+ import { useAssistantPageSurface as t } from "../ui/assistantPageSurface.js";
3
+ import { AssistantHomeNewChatContext as n, assistantHomeNewChat as r, useAssistantHomeStartChat as i } from "./assistantHomeChat.js";
4
+ import { useAssistantHomeChatShown as a, useAssistantHomePrompt as o, useAssistantHomeTab as s } from "./assistantHomeRoutes.js";
5
+ import { AssistantHomeActions as c, AssistantHomeActionsBar as l } from "./AssistantHomeActions.js";
6
+ import { AssistantHomeGlow as u, AssistantHomeHero as d, AssistantHomeRecentChats as f, AssistantHomeSections as p, AssistantHomeSuggestions as m } from "./AssistantHomeStart.js";
7
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
8
+ // src/shared/assistant/home/AssistantHomePage.tsx
9
+ var v = "flex h-[calc(100dvh-7rem)] min-h-0 flex-col bg-bg-canvas md:h-dvh", y = "min-h-full bg-bg-canvas";
10
+ function b({ chat: e, hero: c, history: u, actions: d, newChat: f = r, chatFrameClassName: p = v }) {
11
+ let { tab: m } = s(), b = a(), { available: x } = t(), S = o(), C = m === "chat" && x && !(S && !b);
12
+ return i(C && !b, f), /* @__PURE__ */ g(n.Provider, {
13
+ value: f,
14
+ children: /* @__PURE__ */ g("div", {
15
+ className: C ? p : y,
16
+ "data-testid": "assistant-home",
17
+ children: m === "history" ? /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(l, {
18
+ newChat: !0,
19
+ ...d
20
+ }), u] }) : C ? e : c
21
+ })
22
+ });
23
+ }
24
+ function x({ start: t, actions: n }) {
25
+ return /* @__PURE__ */ g("div", {
26
+ className: "flex h-full min-h-0 w-full flex-col",
27
+ "data-testid": "assistant-home-chat",
28
+ children: /* @__PURE__ */ g(e, {
29
+ className: "min-h-0 flex-1",
30
+ start: {
31
+ above: /* @__PURE__ */ _("div", {
32
+ className: "relative isolate w-full",
33
+ children: [
34
+ /* @__PURE__ */ g(u, {}),
35
+ /* @__PURE__ */ g(l, { ...n }),
36
+ /* @__PURE__ */ g("div", {
37
+ className: "mx-auto flex w-full max-w-3xl flex-col items-center gap-6 px-4 pt-10 pb-6 md:pt-6",
38
+ children: /* @__PURE__ */ g(d, { ...t.hero })
39
+ })
40
+ ]
41
+ }),
42
+ below: /* @__PURE__ */ _("div", {
43
+ className: "w-full",
44
+ children: [/* @__PURE__ */ _("div", {
45
+ className: "mx-auto flex w-full max-w-3xl flex-col items-center gap-6 px-4 pt-6 pb-12",
46
+ children: [/* @__PURE__ */ g(m, { ...t.suggestions }), /* @__PURE__ */ g(f, { ...t.recentChats })]
47
+ }), /* @__PURE__ */ g(p, { ...t.sections })]
48
+ })
49
+ },
50
+ actions: /* @__PURE__ */ g(c, {
51
+ history: !0,
52
+ newChat: !0,
53
+ ...n
54
+ }),
55
+ manageChat: !0
56
+ })
57
+ });
58
+ }
59
+ function S({ start: e, actions: t, composer: n }) {
60
+ return /* @__PURE__ */ _("div", {
61
+ className: "relative isolate min-h-full",
62
+ children: [
63
+ /* @__PURE__ */ g(u, {}),
64
+ /* @__PURE__ */ g(l, { ...t }),
65
+ /* @__PURE__ */ _("div", {
66
+ className: "mx-auto flex w-full max-w-3xl flex-col items-center gap-6 px-4 pt-10 pb-12 md:pt-6",
67
+ children: [
68
+ /* @__PURE__ */ g(d, { ...e.hero }),
69
+ n,
70
+ /* @__PURE__ */ g(m, { ...e.suggestions }),
71
+ /* @__PURE__ */ g(f, { ...e.recentChats })
72
+ ]
73
+ }),
74
+ /* @__PURE__ */ g(p, { ...e.sections })
75
+ ]
76
+ });
77
+ }
78
+ export { v as ASSISTANT_HOME_CHAT_FRAME, y as ASSISTANT_HOME_PAGE_FRAME, S as AssistantHomeHeroChat, x as AssistantHomeInPageChat, b as AssistantHomePage };