@burdenoff/fe-libs 2026.714.1 → 2026.714.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.
@@ -29,6 +29,12 @@ export interface AssistantWidgetProps {
29
29
  showSessionPanel?: boolean;
30
30
  /** Route in-app links from assistant replies without a full page reload. */
31
31
  onNavigate?: (href: string) => void;
32
+ /**
33
+ * Pixels of chrome to sit BELOW in `sidebar` layout — i.e. the app header's
34
+ * height. The panel is docked to the viewport, so without this it happily
35
+ * covers the top nav. Defaults to 0 (full height) for hosts with no header.
36
+ */
37
+ topOffsetPx?: number;
32
38
  }
33
39
  /** External toggle hook so command palettes / plugins can open the widget. */
34
40
  export declare const ASSISTANT_WIDGET_TOGGLE_EVENT = "bf:toggle-assistant-widget";
@@ -1 +1 @@
1
- {"version":3,"file":"AssistantWidget.d.ts","sourceRoot":"","sources":["../../../../src/shared/components/assistantWidget/AssistantWidget.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAML,KAAK,EAAE,EAER,MAAM,OAAO,CAAC;AAef,OAAO,KAAK,EAA2B,kBAAkB,EAA0B,MAAM,SAAS,CAAC;AAEnG,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,SAAS,EAAE,kBAAkB,CAAC;IAC9B,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4EAA4E;IAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CACrC;AAED,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AAyB1E,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAgiBpD,CAAC"}
1
+ {"version":3,"file":"AssistantWidget.d.ts","sourceRoot":"","sources":["../../../../src/shared/components/assistantWidget/AssistantWidget.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAML,KAAK,EAAE,EAER,MAAM,OAAO,CAAC;AAiBf,OAAO,KAAK,EAA2B,kBAAkB,EAA0B,MAAM,SAAS,CAAC;AAEnG,MAAM,WAAW,oBAAoB;IACnC,oDAAoD;IACpD,SAAS,EAAE,kBAAkB,CAAC;IAC9B,2BAA2B;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,yBAAyB;IACzB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,kEAAkE;IAClE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,uCAAuC;IACvC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,UAAU,GAAG,SAAS,CAAC;IAChC;;;;OAIG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,4EAA4E;IAC5E,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IACpC;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,8EAA8E;AAC9E,eAAO,MAAM,6BAA6B,+BAA+B,CAAC;AA6C1E,eAAO,MAAM,eAAe,EAAE,EAAE,CAAC,oBAAoB,CAukBpD,CAAC"}
@@ -2,127 +2,145 @@ import { cn as e } from "../../utils/cn.js";
2
2
  import { useVoiceInput as t } from "./useVoiceInput.js";
3
3
  import { MessageContent as n } from "./MessageContent.js";
4
4
  import { useCallback as r, useEffect as i, useMemo as a, useRef as o, useState as s } from "react";
5
- import { History as ee, Loader2 as c, MessageCircle as l, Mic as te, Plus as ne, Send as re, Sparkles as u, Trash2 as ie, X as d } from "lucide-react";
6
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
5
+ import { History as ee, Loader2 as c, MessageCircle as l, Mic as te, PanelLeftClose as ne, PanelLeftOpen as re, Plus as ie, Send as ae, Sparkles as u, Trash2 as oe, X as d } from "lucide-react";
6
+ import { Fragment as se, jsx as f, jsxs as p } from "react/jsx-runtime";
7
7
  //#region src/shared/components/assistantWidget/AssistantWidget.tsx
8
- var h = "bf:toggle-assistant-widget", g = "bf:assistant-widget:isOpen";
8
+ var m = "bf:toggle-assistant-widget", h = "bf:assistant-widget:isOpen", g = "bf:assistant-widget:railOpen";
9
+ function ce() {
10
+ if (typeof window > "u") return !0;
11
+ try {
12
+ return window.sessionStorage.getItem(g) !== "0";
13
+ } catch {
14
+ return !0;
15
+ }
16
+ }
17
+ function le(e) {
18
+ if (!(typeof window > "u")) try {
19
+ window.sessionStorage.setItem(g, e ? "1" : "0");
20
+ } catch {}
21
+ }
9
22
  function _() {
10
23
  if (typeof window > "u") return !1;
11
24
  try {
12
- return window.sessionStorage.getItem(g) === "1";
25
+ return window.sessionStorage.getItem(h) === "1";
13
26
  } catch {
14
27
  return !1;
15
28
  }
16
29
  }
17
30
  function v(e) {
18
31
  if (!(typeof window > "u")) try {
19
- window.sessionStorage.setItem(g, e ? "1" : "0");
32
+ window.sessionStorage.setItem(h, e ? "1" : "0");
20
33
  } catch {}
21
34
  }
22
35
  function y() {
23
36
  return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
24
37
  }
25
- var b = ({ transport: g, title: b = "AI Assistant", subtitle: x = "Ask me to do things on this screen — I can run them for you.", placeholder: S = "Ask anything, or describe what to create…", launcherClassName: C, voiceLang: w = "en-US", layout: T = "floating", showSessionPanel: ae = !1, onNavigate: oe }) => {
26
- let [E, D] = s(() => _()), [O, k] = s([]), [A, j] = s(""), [M, N] = s(!1), [P, F] = s(!1), [I, L] = s([]), [R, z] = s(!1), [B, V] = s(!1), H = o(null), U = o(null), W = o(null), G = o(!1), K = T === "sidebar", se = ae && !!g.newSession, q = t(w), J = r(() => {
27
- v(!0), D(!0), g.prewarm?.("full");
28
- }, [g]), Y = r(() => {
29
- v(!1), D(!1), g.suspend?.();
30
- }, [g]), X = r(() => {
31
- D((e) => {
38
+ var b = ({ transport: h, title: g = "AI Assistant", subtitle: b = "Ask me to do things on this screen — I can run them for you.", placeholder: x = "Ask anything, or describe what to create…", launcherClassName: S, voiceLang: ue = "en-US", layout: C = "floating", showSessionPanel: de = !1, onNavigate: fe, topOffsetPx: w = 0 }) => {
39
+ let [T, E] = s(() => _()), [D, O] = s([]), [k, A] = s(""), [j, M] = s(!1), [pe, N] = s(!1), [P, F] = s([]), [I, L] = s(!1), [R, z] = s(!1), [B, me] = s(() => ce()), V = o(null), H = o(null), U = o(null), W = o(!1), G = C === "sidebar", K = de && !!h.newSession, he = r(() => {
40
+ me((e) => {
32
41
  let t = !e;
33
- return v(t), t ? g.prewarm?.("full") : g.suspend?.(), t;
42
+ return le(t), t;
34
43
  });
35
- }, [g]);
44
+ }, []), q = t(ue), J = r(() => {
45
+ v(!0), E(!0), h.prewarm?.("full");
46
+ }, [h]), Y = r(() => {
47
+ v(!1), E(!1), h.suspend?.();
48
+ }, [h]), X = r(() => {
49
+ E((e) => {
50
+ let t = !e;
51
+ return v(t), t ? h.prewarm?.("full") : h.suspend?.(), t;
52
+ });
53
+ }, [h]);
36
54
  i(() => {
37
55
  let e = (e) => {
38
56
  let t = e.detail;
39
57
  t?.open === !0 ? J() : t?.open === !1 ? Y() : X();
40
58
  };
41
- return window.addEventListener(h, e), () => window.removeEventListener(h, e);
59
+ return window.addEventListener(m, e), () => window.removeEventListener(m, e);
42
60
  }, [
43
61
  J,
44
62
  Y,
45
63
  X
46
64
  ]), i(() => {
47
- q.isListening && q.transcript && j(q.transcript);
65
+ q.isListening && q.transcript && A(q.transcript);
48
66
  }, [q.transcript, q.isListening]), i(() => {
49
- if (!E || G.current) return;
50
- let e = g.loadHistory;
67
+ if (!T || W.current) return;
68
+ let e = h.loadHistory;
51
69
  if (!e) {
52
- G.current = !0;
70
+ W.current = !0;
53
71
  return;
54
72
  }
55
- G.current = !0;
73
+ W.current = !0;
56
74
  let t = !1;
57
- return F(!0), (async () => {
75
+ return N(!0), (async () => {
58
76
  try {
59
77
  let n = await e();
60
- !t && n.length > 0 && k((e) => e.length === 0 ? n : e);
78
+ !t && n.length > 0 && O((e) => e.length === 0 ? n : e);
61
79
  } catch {} finally {
62
- t || F(!1);
80
+ t || N(!1);
63
81
  }
64
82
  })(), () => {
65
83
  t = !0;
66
84
  };
67
- }, [E, g]), i(() => {
68
- E && U.current && (U.current.scrollTop = U.current.scrollHeight);
69
- }, [O, E]);
85
+ }, [T, h]), i(() => {
86
+ T && H.current && (H.current.scrollTop = H.current.scrollHeight);
87
+ }, [D, T]);
70
88
  let Z = r((e, t) => {
71
- k((n) => n.map((n) => n.id === e ? {
89
+ O((n) => n.map((n) => n.id === e ? {
72
90
  ...n,
73
91
  ...t
74
92
  } : n));
75
93
  }, []), Q = r(async () => {
76
- if (g.listSessions) {
77
- V(!0);
94
+ if (h.listSessions) {
95
+ z(!0);
78
96
  try {
79
- L(await g.listSessions());
97
+ F(await h.listSessions());
80
98
  } catch {
81
- L([]);
99
+ F([]);
82
100
  } finally {
83
- V(!1);
101
+ z(!1);
84
102
  }
85
103
  }
86
- }, [g]), ce = r(async () => {
87
- !g.newSession || M || (k([]), j(""), z(!1), await g.newSession());
88
- }, [g, M]), le = r(async (e, t) => {
89
- if (!(!g.deleteSession || M)) {
90
- L((t) => t.filter((t) => t.id !== e)), t && (k([]), j(""));
104
+ }, [h]), ge = r(async () => {
105
+ !h.newSession || j || (O([]), A(""), L(!1), await h.newSession());
106
+ }, [h, j]), _e = r(async (e, t) => {
107
+ if (!(!h.deleteSession || j)) {
108
+ F((t) => t.filter((t) => t.id !== e)), t && (O([]), A(""));
91
109
  try {
92
- await g.deleteSession(e);
110
+ await h.deleteSession(e);
93
111
  } finally {
94
112
  Q();
95
113
  }
96
114
  }
97
115
  }, [
98
- g,
99
- M,
116
+ h,
117
+ j,
100
118
  Q
101
- ]), ue = r(() => {
102
- z((e) => (e || Q(), !e));
103
- }, [Q]), de = r(async (e) => {
104
- if (!(!g.selectSession || M)) {
105
- F(!0);
119
+ ]), ve = r(() => {
120
+ L((e) => (e || Q(), !e));
121
+ }, [Q]), ye = r(async (e) => {
122
+ if (!(!h.selectSession || j)) {
123
+ N(!0);
106
124
  try {
107
- k(await g.selectSession(e)), z(!1), Q();
125
+ O(await h.selectSession(e)), L(!1), Q();
108
126
  } catch {} finally {
109
- F(!1);
127
+ N(!1);
110
128
  }
111
129
  }
112
130
  }, [
113
- g,
114
- M,
131
+ h,
132
+ j,
115
133
  Q
116
134
  ]), $ = r(async () => {
117
- let e = A.trim();
118
- if (!e || M) return;
119
- q.isListening && q.stop(), q.reset(), j(""), H.current && (H.current.style.height = "auto");
135
+ let e = k.trim();
136
+ if (!e || j) return;
137
+ q.isListening && q.stop(), q.reset(), A(""), V.current && (V.current.style.height = "auto");
120
138
  let t = {
121
139
  id: y(),
122
140
  role: "user",
123
141
  content: e
124
142
  }, n = y();
125
- k((e) => [
143
+ O((e) => [
126
144
  ...e,
127
145
  t,
128
146
  {
@@ -131,11 +149,11 @@ var b = ({ transport: g, title: b = "AI Assistant", subtitle: x = "Ask me to do
131
149
  content: "",
132
150
  pending: !0
133
151
  }
134
- ]), N(!0);
152
+ ]), M(!0);
135
153
  let r = new AbortController();
136
- W.current = r;
154
+ U.current = r;
137
155
  try {
138
- let { text: t } = await g.sendPrompt({
156
+ let { text: t } = await h.sendPrompt({
139
157
  prompt: e,
140
158
  signal: r.signal,
141
159
  onProgress: (e) => Z(n, { content: e })
@@ -151,188 +169,201 @@ var b = ({ transport: g, title: b = "AI Assistant", subtitle: x = "Ask me to do
151
169
  error: !0
152
170
  });
153
171
  } finally {
154
- N(!1), W.current = null, R && Q();
172
+ M(!1), U.current = null, I && Q();
155
173
  }
156
174
  }, [
157
- A,
158
- M,
175
+ k,
176
+ j,
159
177
  Z,
160
- g,
178
+ h,
161
179
  q,
162
- R,
180
+ I,
163
181
  Q
164
- ]), fe = r((e) => {
182
+ ]), be = r((e) => {
165
183
  e.key === "Enter" && !e.shiftKey && (e.preventDefault(), $());
166
- }, [$]), pe = r(() => {
167
- let e = H.current;
184
+ }, [$]), xe = r(() => {
185
+ let e = V.current;
168
186
  e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 120)}px`);
169
- }, []), me = r(() => {
187
+ }, []), Se = r(() => {
170
188
  q.isListening ? q.stop() : q.start();
171
189
  }, [q]);
172
- return /* @__PURE__ */ m(f, { children: [a(() => /* @__PURE__ */ p("button", {
190
+ return /* @__PURE__ */ p(se, { children: [a(() => /* @__PURE__ */ f("button", {
173
191
  type: "button",
174
192
  onClick: X,
175
- onMouseEnter: () => !E && g.prewarm?.("probe"),
176
- onFocus: () => !E && g.prewarm?.("probe"),
177
- "aria-label": E ? "Close AI assistant" : "Open AI assistant",
178
- "aria-expanded": E,
193
+ onMouseEnter: () => !T && h.prewarm?.("probe"),
194
+ onFocus: () => !T && h.prewarm?.("probe"),
195
+ "aria-label": T ? "Close AI assistant" : "Open AI assistant",
196
+ "aria-expanded": T,
179
197
  "data-testid": "assistant-widget-launcher",
180
- className: e("fixed bottom-6 right-6 z-[100] inline-flex size-14 items-center justify-center rounded-full", "bg-action-primary-bg text-action-primary-text shadow-xl transition-transform duration-200", "hover:scale-105 hover:bg-action-primary-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer", C),
181
- children: p(E ? d : u, { className: "size-6" })
198
+ className: e("fixed bottom-6 right-6 z-[100] inline-flex size-14 items-center justify-center rounded-full", "bg-action-primary-bg text-action-primary-text shadow-xl transition-transform duration-200", "hover:scale-105 hover:bg-action-primary-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer", S),
199
+ children: f(T ? d : u, { className: "size-6" })
182
200
  }), [
183
- E,
201
+ T,
184
202
  X,
185
- C,
186
- g
187
- ]), E ? /* @__PURE__ */ m("div", {
203
+ S,
204
+ h
205
+ ]), T ? /* @__PURE__ */ p("div", {
188
206
  role: "dialog",
189
- "aria-label": b,
207
+ "aria-label": g,
190
208
  "data-testid": "assistant-widget-window",
191
- "data-layout": T,
192
- className: e("fixed z-[100] flex overflow-hidden border-border-default bg-bg-surface shadow-2xl", K ? "inset-y-0 right-0 h-screen w-full border-l sm:w-[480px] lg:w-[560px] animate-in slide-in-from-right duration-200" : "flex-col rounded-xl border bottom-24 right-6 h-[560px] max-h-[calc(100vh-7rem)] w-[calc(100vw-3rem)] sm:w-[400px] animate-in slide-in-from-bottom-2 fade-in duration-200"),
193
- children: [K && se ? /* @__PURE__ */ m("aside", {
209
+ "data-layout": C,
210
+ style: G ? {
211
+ top: w,
212
+ height: `calc(100vh - ${String(w)}px)`
213
+ } : void 0,
214
+ className: e("fixed z-[100] flex overflow-hidden border-border-default bg-bg-surface shadow-2xl", G ? "bottom-0 right-0 w-full border-l sm:w-[480px] lg:w-[560px] animate-in slide-in-from-right duration-200" : "flex-col rounded-xl border bottom-24 right-6 h-[560px] max-h-[calc(100vh-7rem)] w-[calc(100vw-3rem)] sm:w-[400px] animate-in slide-in-from-bottom-2 fade-in duration-200"),
215
+ children: [G && K && B ? /* @__PURE__ */ p("aside", {
194
216
  "data-testid": "assistant-session-panel",
195
217
  className: "flex w-[168px] shrink-0 flex-col gap-1 border-r border-border-subtle bg-bg-sunken p-2",
196
218
  children: [
197
- /* @__PURE__ */ m("button", {
219
+ /* @__PURE__ */ p("button", {
198
220
  type: "button",
199
- onClick: () => void ce(),
200
- disabled: M,
221
+ onClick: () => void ge(),
222
+ disabled: j,
201
223
  "data-testid": "assistant-new-chat",
202
224
  className: "flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-primary transition-colors hover:bg-bg-surface disabled:opacity-50 cursor-pointer",
203
- children: [/* @__PURE__ */ p(ne, { className: "size-4 shrink-0" }), "New chat"]
225
+ children: [/* @__PURE__ */ f(ie, { className: "size-4 shrink-0" }), "New chat"]
204
226
  }),
205
- /* @__PURE__ */ m("button", {
227
+ /* @__PURE__ */ p("button", {
206
228
  type: "button",
207
- onClick: ue,
208
- "aria-expanded": R,
229
+ onClick: ve,
230
+ "aria-expanded": I,
209
231
  "data-testid": "assistant-history-toggle",
210
232
  className: "flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-primary transition-colors hover:bg-bg-surface cursor-pointer",
211
- children: [/* @__PURE__ */ p(ee, { className: "size-4 shrink-0" }), "History"]
233
+ children: [/* @__PURE__ */ f(ee, { className: "size-4 shrink-0" }), "History"]
212
234
  }),
213
- R ? /* @__PURE__ */ p("div", {
235
+ I ? /* @__PURE__ */ f("div", {
214
236
  "data-testid": "assistant-history-list",
215
237
  className: "mt-1 flex-1 space-y-0.5 overflow-y-auto border-t border-border-subtle pt-2",
216
- children: B && I.length === 0 ? /* @__PURE__ */ m("p", {
238
+ children: R && P.length === 0 ? /* @__PURE__ */ p("p", {
217
239
  className: "flex items-center gap-1.5 px-2 py-1 text-[11px] text-text-muted",
218
- children: [/* @__PURE__ */ p(c, { className: "size-3 animate-spin" }), "Loading…"]
219
- }) : I.length === 0 ? /* @__PURE__ */ p("p", {
240
+ children: [/* @__PURE__ */ f(c, { className: "size-3 animate-spin" }), "Loading…"]
241
+ }) : P.length === 0 ? /* @__PURE__ */ f("p", {
220
242
  className: "px-2 py-1 text-[11px] leading-relaxed text-text-muted",
221
243
  children: "No past chats yet."
222
- }) : I.map((t) => /* @__PURE__ */ m("div", {
244
+ }) : P.map((t) => /* @__PURE__ */ p("div", {
223
245
  "data-testid": "assistant-history-row",
224
246
  className: e("group flex items-center gap-1 rounded pr-1 transition-colors", t.active ? "bg-bg-surface" : "hover:bg-bg-surface"),
225
- children: [/* @__PURE__ */ p("button", {
247
+ children: [/* @__PURE__ */ f("button", {
226
248
  type: "button",
227
- onClick: () => void de(t.id),
249
+ onClick: () => void ye(t.id),
228
250
  title: t.title,
229
251
  "data-testid": "assistant-history-item",
230
252
  className: e("min-w-0 flex-1 truncate rounded px-2 py-1.5 text-left text-[11px] leading-relaxed cursor-pointer", t.active ? "font-medium text-text-primary" : "text-text-secondary group-hover:text-text-primary"),
231
253
  children: t.title
232
- }), g.deleteSession ? /* @__PURE__ */ p("button", {
254
+ }), h.deleteSession ? /* @__PURE__ */ f("button", {
233
255
  type: "button",
234
- onClick: () => void le(t.id, !!t.active),
235
- disabled: M,
256
+ onClick: () => void _e(t.id, !!t.active),
257
+ disabled: j,
236
258
  "aria-label": `Delete chat: ${t.title}`,
237
259
  title: "Delete this chat",
238
260
  "data-testid": "assistant-delete-chat",
239
261
  className: "inline-flex size-6 shrink-0 items-center justify-center rounded text-text-muted opacity-0 transition-opacity hover:text-status-error-bg focus-visible:opacity-100 group-hover:opacity-100 disabled:opacity-30 cursor-pointer",
240
- children: /* @__PURE__ */ p(ie, { className: "size-3.5" })
262
+ children: /* @__PURE__ */ f(oe, { className: "size-3.5" })
241
263
  }) : null]
242
264
  }, t.id))
243
265
  }) : null
244
266
  ]
245
- }) : null, /* @__PURE__ */ m("div", {
267
+ }) : null, /* @__PURE__ */ p("div", {
246
268
  className: "flex min-w-0 flex-1 flex-col",
247
269
  children: [
248
- /* @__PURE__ */ m("div", {
270
+ /* @__PURE__ */ p("div", {
249
271
  className: "flex items-center justify-between gap-2 border-b border-border-subtle bg-bg-surface px-4 py-3",
250
- children: [/* @__PURE__ */ m("div", {
272
+ children: [/* @__PURE__ */ p("div", {
251
273
  className: "flex min-w-0 items-center gap-2",
252
- children: [/* @__PURE__ */ p("span", {
274
+ children: [G && K ? /* @__PURE__ */ f("button", {
275
+ type: "button",
276
+ onClick: he,
277
+ "aria-label": B ? "Hide conversations" : "Show conversations",
278
+ "aria-pressed": B,
279
+ title: B ? "Hide conversations" : "Show conversations",
280
+ "data-testid": "assistant-rail-toggle",
281
+ className: "inline-flex size-8 shrink-0 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
282
+ children: f(B ? ne : re, { className: "size-4" })
283
+ }) : /* @__PURE__ */ f("span", {
253
284
  className: "inline-flex size-7 shrink-0 items-center justify-center rounded-full bg-action-primary-bg/10 text-action-primary-bg",
254
- children: /* @__PURE__ */ p(u, { className: "size-4" })
255
- }), /* @__PURE__ */ p("h2", {
285
+ children: /* @__PURE__ */ f(u, { className: "size-4" })
286
+ }), /* @__PURE__ */ f("h2", {
256
287
  className: "truncate text-sm font-semibold text-text-primary",
257
- children: b
288
+ children: g
258
289
  })]
259
- }), /* @__PURE__ */ p("button", {
290
+ }), /* @__PURE__ */ f("button", {
260
291
  type: "button",
261
292
  onClick: Y,
262
293
  "aria-label": "Close AI assistant",
263
294
  "data-testid": "assistant-widget-close",
264
295
  className: "inline-flex size-8 shrink-0 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
265
- children: /* @__PURE__ */ p(d, { className: "size-4" })
296
+ children: /* @__PURE__ */ f(d, { className: "size-4" })
266
297
  })]
267
298
  }),
268
- /* @__PURE__ */ p("div", {
269
- ref: U,
299
+ /* @__PURE__ */ f("div", {
300
+ ref: H,
270
301
  className: "flex-1 space-y-3 overflow-y-auto px-4 py-4",
271
302
  "data-testid": "assistant-widget-messages",
272
- children: O.length === 0 && P ? /* @__PURE__ */ m("div", {
303
+ children: D.length === 0 && pe ? /* @__PURE__ */ p("div", {
273
304
  "data-testid": "assistant-widget-restoring",
274
305
  className: "flex h-full flex-col items-center justify-center gap-3 text-center",
275
- children: [/* @__PURE__ */ p(c, { className: "size-5 animate-spin text-text-secondary" }), /* @__PURE__ */ p("p", {
306
+ children: [/* @__PURE__ */ f(c, { className: "size-5 animate-spin text-text-secondary" }), /* @__PURE__ */ f("p", {
276
307
  className: "text-xs leading-relaxed text-text-secondary",
277
308
  children: "Restoring your conversation…"
278
309
  })]
279
- }) : O.length === 0 ? /* @__PURE__ */ m("div", {
310
+ }) : D.length === 0 ? /* @__PURE__ */ p("div", {
280
311
  className: "flex h-full flex-col items-center justify-center gap-3 text-center",
281
- children: [/* @__PURE__ */ p("span", {
312
+ children: [/* @__PURE__ */ f("span", {
282
313
  className: "inline-flex size-12 items-center justify-center rounded-full bg-bg-sunken text-action-primary-bg",
283
- children: /* @__PURE__ */ p(l, { className: "size-6" })
284
- }), /* @__PURE__ */ p("p", {
314
+ children: /* @__PURE__ */ f(l, { className: "size-6" })
315
+ }), /* @__PURE__ */ f("p", {
285
316
  className: "max-w-[16rem] text-xs leading-relaxed text-text-secondary",
286
- children: x
317
+ children: b
287
318
  })]
288
- }) : O.map((t) => /* @__PURE__ */ p("div", {
319
+ }) : D.map((t) => /* @__PURE__ */ f("div", {
289
320
  className: e("flex", t.role === "user" ? "justify-end" : "justify-start"),
290
- children: /* @__PURE__ */ m("div", {
321
+ children: /* @__PURE__ */ p("div", {
291
322
  "data-testid": `assistant-widget-message-${t.role}`,
292
- className: e("whitespace-pre-wrap break-words rounded-lg px-3 py-2 text-xs leading-relaxed", K ? "max-w-[92%]" : "max-w-[85%]", t.role === "user" ? "bg-action-primary-bg text-action-primary-text" : t.error ? "bg-status-error-bg/10 text-status-error-bg" : "bg-bg-sunken text-text-primary"),
293
- children: [t.content ? /* @__PURE__ */ p(n, {
323
+ className: e("whitespace-pre-wrap break-words rounded-lg px-3 py-2 text-xs leading-relaxed", G ? "max-w-[92%]" : "max-w-[85%]", t.role === "user" ? "bg-action-primary-bg text-action-primary-text" : t.error ? "bg-status-error-bg/10 text-status-error-bg" : "bg-bg-sunken text-text-primary"),
324
+ children: [t.content ? /* @__PURE__ */ f(n, {
294
325
  content: t.content,
295
- onNavigate: oe
296
- }) : null, t.pending ? /* @__PURE__ */ m("span", {
326
+ onNavigate: fe
327
+ }) : null, t.pending ? /* @__PURE__ */ p("span", {
297
328
  "data-testid": "assistant-widget-working",
298
329
  className: e("inline-flex items-center gap-1 text-text-secondary", t.content ? "mt-1" : ""),
299
- children: [/* @__PURE__ */ p(c, { className: "size-3 animate-spin" }), t.content ? null : /* @__PURE__ */ p("span", { children: "Working on it…" })]
330
+ children: [/* @__PURE__ */ f(c, { className: "size-3 animate-spin" }), t.content ? null : /* @__PURE__ */ f("span", { children: "Working on it…" })]
300
331
  }) : null]
301
332
  })
302
333
  }, t.id))
303
334
  }),
304
- /* @__PURE__ */ m("div", {
335
+ /* @__PURE__ */ p("div", {
305
336
  className: "flex items-end gap-2 border-t border-border-default bg-bg-surface px-3 py-2.5",
306
337
  children: [
307
- q.isSupported ? /* @__PURE__ */ p("button", {
338
+ q.isSupported ? /* @__PURE__ */ f("button", {
308
339
  type: "button",
309
- onClick: me,
340
+ onClick: Se,
310
341
  "aria-label": q.isListening ? "Stop voice input" : "Start voice input",
311
342
  "aria-pressed": q.isListening,
312
343
  "data-testid": "assistant-widget-mic",
313
344
  className: e("flex size-9 shrink-0 items-center justify-center rounded-lg transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer", q.isListening ? "animate-pulse bg-status-error-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:text-text-primary"),
314
- children: /* @__PURE__ */ p(te, { className: "size-4" })
345
+ children: /* @__PURE__ */ f(te, { className: "size-4" })
315
346
  }) : null,
316
- /* @__PURE__ */ p("textarea", {
317
- ref: H,
318
- value: A,
319
- onChange: (e) => j(e.target.value),
320
- onKeyDown: fe,
321
- onInput: pe,
347
+ /* @__PURE__ */ f("textarea", {
348
+ ref: V,
349
+ value: k,
350
+ onChange: (e) => A(e.target.value),
351
+ onKeyDown: be,
352
+ onInput: xe,
322
353
  rows: 1,
323
- placeholder: S,
354
+ placeholder: x,
324
355
  "aria-label": "Message the assistant",
325
356
  "data-testid": "assistant-widget-input",
326
357
  className: "flex-1 resize-none rounded-lg border border-border-default bg-bg-sunken px-3 py-2 text-xs leading-relaxed text-text-primary placeholder:text-text-muted focus:border-action-primary-bg focus:outline-none"
327
358
  }),
328
- /* @__PURE__ */ p("button", {
359
+ /* @__PURE__ */ f("button", {
329
360
  type: "button",
330
361
  onClick: () => void $(),
331
- disabled: M || A.trim().length === 0,
362
+ disabled: j || k.trim().length === 0,
332
363
  "aria-label": "Send message",
333
364
  "data-testid": "assistant-widget-send",
334
365
  className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:opacity-50 cursor-pointer",
335
- children: M ? /* @__PURE__ */ p(c, { className: "size-4 animate-spin" }) : /* @__PURE__ */ p(re, { className: "size-4" })
366
+ children: j ? /* @__PURE__ */ f(c, { className: "size-4 animate-spin" }) : /* @__PURE__ */ f(ae, { className: "size-4" })
336
367
  })
337
368
  ]
338
369
  })
@@ -341,4 +372,4 @@ var b = ({ transport: g, title: b = "AI Assistant", subtitle: x = "Ask me to do
341
372
  }) : null] });
342
373
  };
343
374
  //#endregion
344
- export { h as ASSISTANT_WIDGET_TOGGLE_EVENT, b as AssistantWidget };
375
+ export { m as ASSISTANT_WIDGET_TOGGLE_EVENT, b as AssistantWidget };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.714.1",
3
+ "version": "2026.714.2",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "type": "module",
6
6
  "imports": {