@burdenoff/fe-libs 2026.1114.2 → 2026.1114.4

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.
@@ -7,120 +7,114 @@ import { clearReplyRequests as a } from "../../speech/replySpeechRequests.js";
7
7
  import { AvatarCompactAskBox as o } from "./AvatarCompactAskBox.js";
8
8
  import { AvatarTabLastExchange as s } from "./AvatarTabLastExchange.js";
9
9
  import { useAvatarTabExchange as c } from "./avatarTabExchange.js";
10
- import { PAGE_VIEW_GUTTER as l } from "../assistantPageLayout.js";
11
- import { useEffect as u, useLayoutEffect as d, useRef as f, useState as p } from "react";
12
- import { jsx as m, jsxs as h } from "react/jsx-runtime";
10
+ import { useEffect as l, useLayoutEffect as u, useRef as d, useState as f } from "react";
11
+ import { jsx as p, jsxs as m } from "react/jsx-runtime";
13
12
  // src/shared/assistant/ui/avatar/AssistantCompactAvatar.tsx
14
- var g = /* @__PURE__ */ new WeakMap();
15
- function _() {
13
+ var h = /* @__PURE__ */ new WeakMap();
14
+ function g() {
16
15
  if (typeof document > "u") return !1;
17
16
  let e = document.activeElement;
18
17
  return e === null || e === document.body || !e.isConnected || e.hasAttribute("data-assistant-panel");
19
18
  }
20
- var v = ({ state: e, restored: t }) => {
19
+ var _ = ({ state: e, restored: t }) => {
21
20
  let n = i(), r = e === "thinking" ? n.askThinking : e === "not-spoken" ? n.askNotSpoken : e === "cut" ? n.askCut : e === "not-heard" ? n.askNotHeard : e === "failed" ? t ? n.askFailed : n.askFailedInChat : "";
22
- return /* @__PURE__ */ m("p", {
21
+ return /* @__PURE__ */ p("p", {
23
22
  className: "sr-only",
24
23
  "aria-live": "polite",
25
24
  "aria-atomic": "true",
26
25
  "data-testid": "assistant-avatar-tab-ask-live",
27
26
  children: r
28
27
  });
29
- }, y = ({ tab: i, CompactView: y, ids: b, compact: x, shown: S, voice: C, mute: w, ask: T, footer: E, switchInBar: D = !1 }) => {
30
- let O = f(null), k = f(null), A = e(), j = x.surface === "window", M = n(b);
31
- d(() => (g.set(i, (g.get(i) ?? 0) + 1), i.setOpen(!0, { compact: !0 }), () => {
32
- g.set(i, (g.get(i) ?? 1) - 1), queueMicrotask(() => {
33
- (g.get(i) ?? 0) > 0 || (i.setOpen(!1), a());
28
+ }, v = ({ tab: i, CompactView: v, ids: y, compact: b, shown: x, voice: S, mute: C, ask: w, footer: T }) => {
29
+ let E = d(null), D = d(null), O = e(), k = b.surface === "window", A = n(y);
30
+ u(() => (h.set(i, (h.get(i) ?? 0) + 1), i.setOpen(!0, { compact: !0 }), () => {
31
+ h.set(i, (h.get(i) ?? 1) - 1), queueMicrotask(() => {
32
+ (h.get(i) ?? 0) > 0 || (i.setOpen(!1), a());
34
33
  });
35
34
  }), [i]);
36
- let N = f(null), P = x.focusRequest ?? 0, F = f(P);
35
+ let j = d(null), M = b.focusRequest ?? 0, N = d(M);
36
+ l(() => {
37
+ N.current !== M && (N.current = M, (E.current ?? j.current ?? document.getElementById(A.avatarTab))?.focus({ preventScroll: !0 }));
38
+ }, [M, A.avatarTab]);
39
+ let P = d(S.live);
40
+ l(() => {
41
+ let e = P.current;
42
+ P.current = S.live, e && !S.live && g() && (D.current ?? E.current)?.focus();
43
+ }, [S.live]);
44
+ let F = c(w?.last ?? null, w?.navigatingReplyId ?? null), I = S.live ? void 0 : w, [L, R] = f(null), z = F?.state === "failed" ? F.exchange.replyId : null, B = F?.question ?? "", V = w?.draft;
37
45
  u(() => {
38
- F.current !== P && (F.current = P, (O.current ?? N.current ?? document.getElementById(D ? b.avatarTab : M.avatarTab))?.focus({ preventScroll: !0 }));
39
- }, [
40
- P,
41
- M.avatarTab,
42
- b.avatarTab,
43
- D
44
- ]);
45
- let I = f(C.live);
46
- u(() => {
47
- let e = I.current;
48
- I.current = C.live, e && !C.live && _() && (k.current ?? O.current)?.focus();
49
- }, [C.live]);
50
- let L = c(T?.last ?? null, T?.navigatingReplyId ?? null), R = C.live ? void 0 : T, [z, B] = p(null), V = L?.state === "failed" ? L.exchange.replyId : null, H = L?.question ?? "", U = T?.draft;
51
- d(() => {
52
- if (V === null || U === void 0 || z?.replyId === V) return;
53
- let e = U.get().trim() === "";
54
- e && U.set(H), B({
55
- replyId: V,
46
+ if (z === null || V === void 0 || L?.replyId === z) return;
47
+ let e = V.get().trim() === "";
48
+ e && V.set(B), R({
49
+ replyId: z,
56
50
  restored: e
57
51
  });
58
52
  }, [
53
+ z,
54
+ B,
59
55
  V,
60
- H,
61
- U,
62
- z
56
+ L
63
57
  ]);
64
- let W = z === null || z.replyId !== V || z.restored, [G, K] = p(null), q = G ?? !j, J = {
65
- ...w ? { mute: w } : {},
66
- ...R ? { transcript: {
67
- open: q,
68
- toggle: () => K(!q)
58
+ let H = L === null || L.replyId !== z || L.restored, [U, W] = f(null), G = U ?? !k, K = {
59
+ ...C ? { mute: C } : {},
60
+ ...I ? { transcript: {
61
+ open: G,
62
+ toggle: () => W(!G)
69
63
  } } : {}
70
64
  };
71
- return /* @__PURE__ */ h("div", {
72
- className: `absolute inset-0 z-[5] flex flex-col ${j ? "bg-bg-elevated" : "bg-bg-surface"}${D ? ` ${l}` : ""}`,
65
+ return /* @__PURE__ */ m("div", {
66
+ className: `absolute inset-0 z-[5] flex flex-col ${k ? "bg-bg-elevated" : "bg-bg-surface"}`,
73
67
  "data-testid": "assistant-avatar-tab",
74
68
  "data-presentation": "compact",
75
- "data-surface": x.surface,
69
+ "data-surface": b.surface,
76
70
  children: [
77
- /* @__PURE__ */ h("div", {
71
+ /* @__PURE__ */ m("div", {
78
72
  role: "tabpanel",
79
- id: b.avatarPanel,
80
- "aria-labelledby": D ? b.avatarTab : M.avatarTab,
73
+ id: y.avatarPanel,
74
+ "aria-labelledby": A.avatarTab,
81
75
  className: "flex min-h-0 flex-1 flex-col",
82
76
  "data-testid": "assistant-avatar-tab-column",
83
- children: [/* @__PURE__ */ m(y, {
84
- shown: S,
85
- voice: C,
86
- leaveHintId: b.leaveHint,
87
- surface: x.surface,
88
- onOpenSettings: x.openSettings,
89
- navigate: A,
90
- controls: J,
91
- switchRef: N
92
- }), R && q ? /* @__PURE__ */ m("div", {
77
+ children: [/* @__PURE__ */ p(v, {
78
+ shown: x,
79
+ voice: S,
80
+ leaveHintId: y.leaveHint,
81
+ surface: b.surface,
82
+ onOpenSettings: b.openSettings,
83
+ navigate: O,
84
+ controls: K,
85
+ switchRef: j
86
+ }), I && G ? /* @__PURE__ */ p("div", {
93
87
  className: "max-h-[40%] shrink-0 overflow-y-auto px-4 pb-1",
94
- children: /* @__PURE__ */ m(s, {
95
- view: L,
88
+ children: /* @__PURE__ */ p(s, {
89
+ view: F,
96
90
  invite: !1,
97
- restored: W,
98
- focusAfterStop: O
99
- }, L?.exchange.replyId ?? "none")
91
+ restored: H,
92
+ focusAfterStop: E
93
+ }, F?.exchange.replyId ?? "none")
100
94
  }) : null]
101
95
  }),
102
- /* @__PURE__ */ m(r, {
103
- voiceLive: C.live,
104
- children: D ? null : /* @__PURE__ */ m(t, {
105
- selected: x.view,
106
- onSelect: x.selectView,
107
- ids: b,
96
+ /* @__PURE__ */ p(r, {
97
+ voiceLive: S.live,
98
+ children: /* @__PURE__ */ p(t, {
99
+ selected: b.view,
100
+ onSelect: b.selectView,
101
+ ids: y,
108
102
  instance: "avatar"
109
103
  })
110
104
  }),
111
- R ? /* @__PURE__ */ m(o, {
112
- ask: R,
113
- inputRef: O,
114
- voice: C,
115
- waveRef: k,
116
- windowSurface: j
105
+ I ? /* @__PURE__ */ p(o, {
106
+ ask: I,
107
+ inputRef: E,
108
+ voice: S,
109
+ waveRef: D,
110
+ windowSurface: k
117
111
  }) : null,
118
- E,
119
- T ? /* @__PURE__ */ m(v, {
120
- state: L?.state ?? null,
121
- restored: W
112
+ T,
113
+ w ? /* @__PURE__ */ p(_, {
114
+ state: F?.state ?? null,
115
+ restored: H
122
116
  }) : null
123
117
  ]
124
118
  });
125
119
  };
126
- export { y as AssistantCompactAvatar };
120
+ export { v as AssistantCompactAvatar };
@@ -4,8 +4,6 @@ export interface AssistantPageBarProps {
4
4
  menuViewId?: string;
5
5
  onOpenMenu: () => void;
6
6
  menuButtonRef?: Ref<HTMLButtonElement>;
7
- /** The Chat | Avatar switch, or nothing where the avatar is not offered. */
8
- viewSwitch?: ReactNode;
9
7
  conversationMenu: ReactNode;
10
8
  onTogglePreview?: () => void;
11
9
  previewOpen?: boolean;
@@ -4,8 +4,8 @@ import { hasAssistantPreviewSurface as n } from "../../preview/types.js";
4
4
  import { Eye as r, Menu as i } from "lucide-react";
5
5
  import { jsx as a, jsxs as o } from "react/jsx-runtime";
6
6
  // src/shared/assistant/ui/compact/AssistantPageBar.tsx
7
- var s = "flex size-10 shrink-0 items-center justify-center rounded-button transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", c = "text-text-secondary hover:bg-bg-sunken hover:text-text-primary", l = "bg-action-primary-bg/15 text-action-primary-bg", u = ({ menuOpen: u, menuViewId: d, onOpenMenu: f, menuButtonRef: p, viewSwitch: m, conversationMenu: h, onTogglePreview: g, previewOpen: _ }) => {
8
- let v = e(), y = t();
7
+ var s = "flex size-10 shrink-0 items-center justify-center rounded-button transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", c = "text-text-secondary hover:bg-bg-sunken hover:text-text-primary", l = "bg-action-primary-bg/15 text-action-primary-bg", u = ({ menuOpen: u, menuViewId: d, onOpenMenu: f, menuButtonRef: p, conversationMenu: m, onTogglePreview: h, previewOpen: g }) => {
8
+ let _ = e(), v = t();
9
9
  return /* @__PURE__ */ o("div", {
10
10
  className: "flex min-h-14 shrink-0 items-center gap-1 px-2 py-2 sm:px-3",
11
11
  "data-testid": "assistant-page-bar",
@@ -16,7 +16,7 @@ var s = "flex size-10 shrink-0 items-center justify-center rounded-button transi
16
16
  type: "button",
17
17
  onClick: f,
18
18
  className: `${s} ${c}`,
19
- "aria-label": v("header.menu", "Assistant menu"),
19
+ "aria-label": _("header.menu", "Assistant menu"),
20
20
  "aria-expanded": u,
21
21
  "aria-controls": u ? d : void 0,
22
22
  "data-testid": "assistant-menu",
@@ -25,21 +25,20 @@ var s = "flex size-10 shrink-0 items-center justify-center rounded-button transi
25
25
  "aria-hidden": "true"
26
26
  })
27
27
  }),
28
- m ?? null,
29
28
  /* @__PURE__ */ a("span", { className: "flex-1" }),
30
- n(y) && g ? /* @__PURE__ */ a("button", {
29
+ n(v) && h ? /* @__PURE__ */ a("button", {
31
30
  type: "button",
32
- onClick: g,
33
- className: `${s} ${_ ? l : c}`,
34
- "aria-label": y.label ?? v("header.preview", "Preview"),
35
- "aria-pressed": !!_,
31
+ onClick: h,
32
+ className: `${s} ${g ? l : c}`,
33
+ "aria-label": v.label ?? _("header.preview", "Preview"),
34
+ "aria-pressed": !!g,
36
35
  "data-testid": "assistant-toggle-preview",
37
36
  children: /* @__PURE__ */ a(r, {
38
37
  className: "size-5",
39
38
  "aria-hidden": "true"
40
39
  })
41
40
  }) : null,
42
- h
41
+ m
43
42
  ]
44
43
  });
45
44
  };
@@ -14,10 +14,5 @@ export interface AssistantViewSwitchProps {
14
14
  readonly ids: LiveAvatarTabIds;
15
15
  /** Where this instance sits: the composer (`chat`), or inside the Avatar view (`avatar`, ids with a suffix). */
16
16
  readonly instance: 'chat' | 'avatar';
17
- /**
18
- * BOFF-13461: `bar` is the page's bar (`AssistantPageBar`), where it is the one instance (`chat` ids) and needs no row of its own.
19
- * Absent or `row`: the centred row above the composer, as before.
20
- */
21
- readonly placement?: 'row' | 'bar';
22
17
  }
23
18
  export declare const AssistantViewSwitch: FC<AssistantViewSwitchProps>;
@@ -11,17 +11,17 @@ function s(e) {
11
11
  avatarTab: `${e.avatarTab}${o}`
12
12
  };
13
13
  }
14
- var c = ["chat", "avatar"], l = "inline-flex h-11 min-w-24 items-center justify-center rounded-full px-5 text-base font-semibold transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] sm:h-10 sm:min-w-[5.75rem] sm:text-[15px]", u = ({ selected: o, onSelect: u, ids: d, instance: f, placement: p = "row" }) => {
15
- let m = e(), h = n(r()), g = i({}), _ = f === "avatar" ? s(d) : d, v = o === "avatar" && h, y = (e, n) => {
14
+ var c = ["chat", "avatar"], l = "inline-flex h-11 min-w-24 items-center justify-center rounded-full px-5 text-base font-semibold transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] sm:h-10 sm:min-w-[5.75rem] sm:text-[15px]", u = ({ selected: o, onSelect: u, ids: d, instance: f }) => {
15
+ let p = e(), m = n(r()), h = i({}), g = f === "avatar" ? s(d) : d, _ = o === "avatar" && m, v = (e, n) => {
16
16
  let r = getComputedStyle(e.currentTarget).direction === "rtl", i = t(e.key, c, n, r), a = c.find((e) => e === i);
17
- a !== void 0 && (e.preventDefault(), g.current[a]?.focus());
17
+ a !== void 0 && (e.preventDefault(), h.current[a]?.focus());
18
18
  };
19
19
  return /* @__PURE__ */ a("div", {
20
- className: p === "bar" ? "flex shrink-0" : "flex shrink-0 justify-center px-3 pb-2.5 pt-1",
20
+ className: "flex shrink-0 justify-center px-3 pb-2.5 pt-1",
21
21
  "data-testid": `assistant-view-switch-row-${f}`,
22
22
  children: /* @__PURE__ */ a("div", {
23
23
  role: "tablist",
24
- "aria-label": m.tabsLabel,
24
+ "aria-label": p.tabsLabel,
25
25
  className: "inline-flex gap-0.5 rounded-full border border-action-primary-bg/45 bg-[var(--color-accent-soft)] p-1",
26
26
  "data-testid": "assistant-view-switch",
27
27
  "data-instance": f,
@@ -29,23 +29,23 @@ var c = ["chat", "avatar"], l = "inline-flex h-11 min-w-24 items-center justify-
29
29
  let t = e === o, n = e === "chat";
30
30
  return /* @__PURE__ */ a("button", {
31
31
  ref: (t) => {
32
- g.current[e] = t;
32
+ h.current[e] = t;
33
33
  },
34
34
  type: "button",
35
35
  role: "tab",
36
- id: n ? _.chatTab : _.avatarTab,
36
+ id: n ? g.chatTab : g.avatarTab,
37
37
  "aria-selected": t,
38
38
  "aria-controls": n ? d.chatPanel : d.avatarPanel,
39
- "aria-describedby": n && v ? d.leaveHint : void 0,
40
- title: n && v ? m.tabLeaveHint : void 0,
39
+ "aria-describedby": n && _ ? d.leaveHint : void 0,
40
+ title: n && _ ? p.tabLeaveHint : void 0,
41
41
  tabIndex: t ? 0 : -1,
42
42
  onClick: () => {
43
43
  t || u(e);
44
44
  },
45
- onKeyDown: (t) => y(t, e),
45
+ onKeyDown: (t) => v(t, e),
46
46
  className: `${l} ${t ? "bg-bg-sunken text-text-primary shadow-sm" : "text-text-secondary hover:text-text-primary"}`,
47
47
  "data-testid": n ? "assistant-view-chat" : "assistant-view-avatar",
48
- children: n ? m.tabChat : m.tabAvatar
48
+ children: n ? p.tabChat : p.tabAvatar
49
49
  }, e);
50
50
  })
51
51
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@burdenoff/fe-libs",
3
- "version": "2026.1114.2",
3
+ "version": "2026.1114.4",
4
4
  "description": "Burdenoff frontend primitives and domain libraries",
5
5
  "repository": {
6
6
  "type": "git",
@@ -386,7 +386,7 @@
386
386
  },
387
387
  "dependencies": {
388
388
  "@burdenoff/toolchain": "2026.1107.14",
389
- "@hookform/resolvers": "^5.2.2",
389
+ "@hookform/resolvers": "^6.0.1",
390
390
  "@openuidev/react-lang": "1.0.1",
391
391
  "@radix-ui/react-accordion": "^1.2.12",
392
392
  "@radix-ui/react-alert-dialog": "^1.1.15",
@@ -420,7 +420,7 @@
420
420
  "sonner": "^2.0.7",
421
421
  "tailwind-merge": "^3.4.0",
422
422
  "unified": "^11.0.0",
423
- "web-vitals": "^4.2.4",
423
+ "web-vitals": "^6.2.3",
424
424
  "zod": "4.6.7"
425
425
  },
426
426
  "devDependencies": {
@@ -456,7 +456,7 @@
456
456
  "autoprefixer": "^10.6.2",
457
457
  "eslint": "^9.39.5",
458
458
  "fflate": "^0.8.3",
459
- "framer-motion": "^12.43.0",
459
+ "framer-motion": "^14.7.1",
460
460
  "happy-dom": "21.0.4",
461
461
  "lefthook": "^2.2.2",
462
462
  "livekit-client": "2.23.0",
@@ -481,7 +481,7 @@
481
481
  "react-dom": "^19.0.0",
482
482
  "react-router": "^8.3.0",
483
483
  "zustand": "^5.0.5",
484
- "framer-motion": "^12.0.0",
484
+ "framer-motion": "^14.7.1",
485
485
  "@capacitor/app": "^8.1.0",
486
486
  "@capacitor/action-sheet": "^8.1.1",
487
487
  "@capacitor/browser": "^8.0.3",