@burdenoff/fe-libs 2026.1115.11 → 2026.1115.13

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 (27) hide show
  1. package/dist/shared/assistant/index.d.ts +1 -0
  2. package/dist/shared/assistant/ui/AssistantAvatar.js +18 -14
  3. package/dist/shared/assistant/ui/AssistantChatArea.js +1 -0
  4. package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +5 -0
  5. package/dist/shared/assistant/ui/AssistantMessageItem.js +57 -56
  6. package/dist/shared/assistant/ui/AssistantMessageList.js +57 -44
  7. package/dist/shared/assistant/ui/AssistantTurnActivity.d.ts +2 -0
  8. package/dist/shared/assistant/ui/AssistantTurnActivity.js +20 -17
  9. package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +5 -0
  10. package/dist/shared/assistant/ui/composer/AssistantComposer.js +348 -343
  11. package/dist/shared/assistant/ui/composer/AssistantDictation.js +57 -56
  12. package/dist/shared/assistant/ui/composer/pageBoxClass.d.ts +13 -0
  13. package/dist/shared/assistant/ui/composer/pageBoxClass.js +5 -0
  14. package/dist/shared/assistant/ui/voice/AssistantPageVoiceBar.js +41 -35
  15. package/dist/shared/assistant/ui/voice/AssistantVoiceSessionButton.js +13 -12
  16. package/dist/shared/assistant/ui/voice/LiveWaveform.js +28 -27
  17. package/dist/shared/providers/shell/ProfileI18nBridge.js +40 -45
  18. package/dist/shared/providers/shell/exportedDictionary.d.ts +35 -0
  19. package/dist/shared/providers/shell/exportedDictionary.js +68 -0
  20. package/dist/shared/utils/backendErrors.js +2 -1
  21. package/dist/shared-assistant.js +254 -253
  22. package/package.json +1 -1
  23. package/src/shared/styles/app-shell.css +5 -0
  24. package/src/shared/tokens/build/semantic.css +12 -0
  25. package/src/shared/tokens/build/tailwind.preset.js +5 -0
  26. package/src/shared/tokens/build/themes.css +14 -0
  27. package/src/shared/tokens/tokens.css +268 -0
@@ -1,121 +1,122 @@
1
1
  import { useAssistantTr as e } from "../../i18n.js";
2
2
  import { usePrefersReducedMotion as t } from "../usePrefersReducedMotion.js";
3
- import { focusWasDropped as n } from "../../../hooks/useReturnFocus.js";
4
- import { formatClock as r } from "../voice/formatClock.js";
5
- import { LiveWaveform as i } from "../voice/LiveWaveform.js";
6
- import { useEffect as a, useRef as o } from "react";
7
- import { Check as s, Loader2 as c, X as l } from "lucide-react";
8
- import { jsx as u, jsxs as d } from "react/jsx-runtime";
3
+ import { useAssistantPageLayout as n } from "../assistantPageLayout.js";
4
+ import { focusWasDropped as r } from "../../../hooks/useReturnFocus.js";
5
+ import { formatClock as i } from "../voice/formatClock.js";
6
+ import { LiveWaveform as a } from "../voice/LiveWaveform.js";
7
+ import { useEffect as o, useRef as s } from "react";
8
+ import { Check as c, Loader2 as l, X as u } from "lucide-react";
9
+ import { jsx as d, jsxs as f } from "react/jsx-runtime";
9
10
  // src/shared/assistant/ui/composer/AssistantDictation.tsx
10
- var f = ({ phase: t, before: n, take: r, interim: i, after: a }) => {
11
+ var p = ({ phase: t, before: n, take: r, interim: i, after: a }) => {
11
12
  let o = e(), s = r || i;
12
- return /* @__PURE__ */ d("div", {
13
+ return /* @__PURE__ */ f("div", {
13
14
  className: `min-h-10 whitespace-pre-wrap break-words px-4 pb-1 pt-3 text-base leading-6 ${t === "transcribing" ? "text-text-muted" : "text-text-primary"}`,
14
15
  "data-testid": "assistant-dictation-text",
15
16
  "data-phase": t,
16
17
  children: [
17
- n ? /* @__PURE__ */ d("span", { children: [n.replace(/\s+$/, ""), " "] }) : null,
18
- r ? /* @__PURE__ */ u("span", {
18
+ n ? /* @__PURE__ */ f("span", { children: [n.replace(/\s+$/, ""), " "] }) : null,
19
+ r ? /* @__PURE__ */ d("span", {
19
20
  "data-testid": "assistant-dictation-take",
20
21
  children: r
21
22
  }) : null,
22
- i ? /* @__PURE__ */ d("span", {
23
+ i ? /* @__PURE__ */ f("span", {
23
24
  className: "text-text-muted",
24
25
  "data-testid": "assistant-dictation-interim",
25
26
  children: [r ? " " : "", i]
26
27
  }) : null,
27
- !s && t !== "transcribing" ? /* @__PURE__ */ u("span", {
28
+ !s && t !== "transcribing" ? /* @__PURE__ */ d("span", {
28
29
  className: "text-text-muted",
29
30
  "data-testid": "assistant-dictation-prompt",
30
31
  children: t === "starting" ? o("voice.starting", "Starting the microphone…") : o("dictation.startSpeaking", "Listening. Start speaking.")
31
32
  }) : null,
32
- a ? /* @__PURE__ */ d("span", { children: [" ", a.replace(/^\s+/, "")] }) : null
33
+ a ? /* @__PURE__ */ f("span", { children: [" ", a.replace(/^\s+/, "")] }) : null
33
34
  ]
34
35
  });
35
- }, p = ({ phase: n, seconds: r, level: i, onCancel: a, onFinish: o, focusRing: s }) => {
36
- let l = e(), f = t();
37
- return n === "transcribing" ? /* @__PURE__ */ d("div", {
36
+ }, m = ({ phase: r, seconds: i, level: a, onCancel: o, onFinish: s, focusRing: c }) => {
37
+ let u = e(), p = t(), m = n();
38
+ return r === "transcribing" ? /* @__PURE__ */ f("div", {
38
39
  role: "status",
39
40
  className: "flex h-11 items-center gap-2.5 px-3 pb-1.5 text-sm text-text-secondary sm:h-10",
40
41
  "data-testid": "assistant-composer-controls",
41
42
  "data-dictating": "transcribing",
42
- children: [/* @__PURE__ */ u(c, {
43
- className: `size-4 text-status-warning-bg${f ? "" : " motion-safe:animate-spin"}`,
43
+ children: [/* @__PURE__ */ d(l, {
44
+ className: `size-4 text-status-warning-bg${m ? " boff-text-listening" : ""}${p ? "" : " motion-safe:animate-spin"}`,
44
45
  "aria-hidden": "true"
45
- }), /* @__PURE__ */ u("span", { children: l("dictation.transcribing", "Turning speech into text") })]
46
- }) : /* @__PURE__ */ u(m, {
47
- listening: n === "listening",
48
- seconds: r,
49
- level: i,
50
- onCancel: a,
51
- onFinish: o,
52
- focusRing: s
46
+ }), /* @__PURE__ */ d("span", { children: u("dictation.transcribing", "Turning speech into text") })]
47
+ }) : /* @__PURE__ */ d(h, {
48
+ listening: r === "listening",
49
+ seconds: i,
50
+ level: a,
51
+ onCancel: o,
52
+ onFinish: s,
53
+ focusRing: c
53
54
  });
54
- }, m = ({ listening: t, seconds: c, level: f, onCancel: p, onFinish: m, focusRing: h }) => {
55
- let g = e(), _ = o(null);
56
- return a(() => {
57
- typeof document < "u" && n(document) && _.current?.focus();
58
- }, []), /* @__PURE__ */ d("div", {
55
+ }, h = ({ listening: t, seconds: l, level: p, onCancel: m, onFinish: h, focusRing: g }) => {
56
+ let _ = e(), v = n(), y = s(null);
57
+ return o(() => {
58
+ typeof document < "u" && r(document) && y.current?.focus();
59
+ }, []), /* @__PURE__ */ f("div", {
59
60
  className: "flex flex-nowrap items-center gap-2 px-1.5 pb-1.5 pt-1",
60
61
  "data-testid": "assistant-composer-controls",
61
62
  "data-dictating": "true",
62
63
  children: [
63
- /* @__PURE__ */ u("span", {
64
+ /* @__PURE__ */ d("span", {
64
65
  "aria-hidden": "true",
65
- className: `ms-2.5 size-2.5 shrink-0 rounded-full ${t ? "bg-status-warning-bg" : "bg-text-muted"}`,
66
+ className: `ms-2.5 size-2.5 shrink-0 rounded-full ${t ? `bg-status-warning-bg${v ? " boff-bg-listening" : ""}` : "bg-text-muted"}`,
66
67
  "data-testid": "assistant-dictation-dot"
67
68
  }),
68
- t ? /* @__PURE__ */ u(i, {
69
- source: f,
69
+ t ? /* @__PURE__ */ d(a, {
70
+ source: p,
70
71
  tone: "listening",
71
72
  className: "h-8 min-w-0 flex-1",
72
73
  testId: "assistant-dictation-waveform"
73
- }) : /* @__PURE__ */ u("span", { className: "min-w-0 flex-1" }),
74
- /* @__PURE__ */ u("span", {
74
+ }) : /* @__PURE__ */ d("span", { className: "min-w-0 flex-1" }),
75
+ /* @__PURE__ */ d("span", {
75
76
  className: "shrink-0 text-xs tabular-nums text-text-secondary",
76
77
  "aria-hidden": "true",
77
78
  "data-testid": "assistant-dictation-time",
78
- children: r(c)
79
+ children: i(l)
79
80
  }),
80
- /* @__PURE__ */ u("button", {
81
- ref: _,
81
+ /* @__PURE__ */ d("button", {
82
+ ref: y,
82
83
  type: "button",
83
- onClick: p,
84
- className: `flex size-11 shrink-0 items-center justify-center rounded-full border border-border-default text-text-primary transition-colors hover:bg-bg-sunken sm:size-10 ${h}`,
85
- "aria-label": g("composer.dictationCancel", "Cancel dictation"),
86
- title: g("composer.dictationCancel", "Cancel dictation"),
84
+ onClick: m,
85
+ className: `flex size-11 shrink-0 items-center justify-center rounded-full border border-border-default text-text-primary transition-colors hover:bg-bg-sunken sm:size-10 ${g}`,
86
+ "aria-label": _("composer.dictationCancel", "Cancel dictation"),
87
+ title: _("composer.dictationCancel", "Cancel dictation"),
87
88
  "data-testid": "assistant-voice-cancel",
88
- children: /* @__PURE__ */ u(l, {
89
+ children: /* @__PURE__ */ d(u, {
89
90
  className: "size-5",
90
91
  "aria-hidden": "true"
91
92
  })
92
93
  }),
93
- /* @__PURE__ */ u("button", {
94
+ /* @__PURE__ */ d("button", {
94
95
  type: "button",
95
- onClick: m,
96
+ onClick: h,
96
97
  disabled: !t,
97
- className: `flex size-11 shrink-0 items-center justify-center rounded-full border border-status-warning-bg bg-status-warning-bg-subtle text-status-warning-text transition-colors hover:bg-status-warning-bg/20 disabled:cursor-default disabled:opacity-50 sm:size-10 ${h}`,
98
- "aria-label": g("composer.dictationDone", "Finish dictation"),
99
- title: g("composer.dictationDone", "Finish dictation"),
98
+ className: `flex size-11 shrink-0 items-center justify-center rounded-full border border-status-warning-bg bg-status-warning-bg-subtle text-status-warning-text${v ? " boff-finish-listening" : ""} transition-colors hover:bg-status-warning-bg/20 disabled:cursor-default disabled:opacity-50 sm:size-10 ${g}`,
99
+ "aria-label": _("composer.dictationDone", "Finish dictation"),
100
+ title: _("composer.dictationDone", "Finish dictation"),
100
101
  "aria-pressed": "true",
101
102
  "data-testid": "assistant-voice",
102
103
  "data-state": t ? "listening" : "starting",
103
- children: /* @__PURE__ */ u(s, {
104
+ children: /* @__PURE__ */ d(c, {
104
105
  className: "size-5",
105
106
  "aria-hidden": "true"
106
107
  })
107
108
  })
108
109
  ]
109
110
  });
110
- }, h = ({ message: t, onTryAgain: n }) => {
111
+ }, g = ({ message: t, onTryAgain: n }) => {
111
112
  let r = e();
112
- return /* @__PURE__ */ d("div", {
113
+ return /* @__PURE__ */ f("div", {
113
114
  className: "flex items-center justify-between gap-3 px-1 text-start",
114
115
  "data-testid": "assistant-mic-blocked",
115
- children: [/* @__PURE__ */ u("p", {
116
+ children: [/* @__PURE__ */ d("p", {
116
117
  className: "text-status-warning-text",
117
118
  children: t
118
- }), /* @__PURE__ */ u("button", {
119
+ }), /* @__PURE__ */ d("button", {
119
120
  type: "button",
120
121
  onClick: n,
121
122
  className: "h-11 shrink-0 rounded-full border border-border-default px-3 text-sm font-medium sm:h-9 text-text-primary transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]",
@@ -124,4 +125,4 @@ var f = ({ phase: t, before: n, take: r, interim: i, after: a }) => {
124
125
  })]
125
126
  });
126
127
  };
127
- export { p as DictationControls, f as DictationLiveText, h as MicBlockedNotice };
128
+ export { m as DictationControls, p as DictationLiveText, g as MicBlockedNotice };
@@ -0,0 +1,13 @@
1
+ /**
2
+ * ★ BOFF-14753: the page's box (the /assistant page only; the panel keeps its look).
3
+ * Depth and a soft accent glow that brightens while typing (M2); orange while the
4
+ * microphone hears (the voice colour rule); nothing while read-only (either way) or a file is
5
+ * dragged over (those keep their own border); and the start page's rise (M1).
6
+ * The classes live in fe-libs `tokens.css`, unlayered, so they win over the
7
+ * composer's Tailwind utilities without `!important`.
8
+ */
9
+ export declare function pageBoxClass(pageLayout: boolean, state: {
10
+ hearing: boolean;
11
+ quiet: boolean;
12
+ entrance: boolean;
13
+ }): string;
@@ -0,0 +1,5 @@
1
+ // src/shared/assistant/ui/composer/pageBoxClass.ts
2
+ function e(e, t) {
3
+ return e ? [t.hearing ? "boff-hearing-box" : t.quiet ? "" : "boff-glow-box", t.entrance ? "boff-rise boff-delay-3" : ""].filter(Boolean).join(" ") : "";
4
+ }
5
+ export { e as pageBoxClass };
@@ -15,18 +15,24 @@ function _(e, t) {
15
15
  return e === "mic-error" ? "error" : t ? "off" : e === "listening" || e === "endpoint-grace" || e === "interrupting" ? "hearing" : e === "speaking" ? "talking" : "waiting";
16
16
  }
17
17
  var v = {
18
- hearing: "border-status-warning-bg ring-1 ring-status-warning-bg",
19
- talking: "border-status-info-bg ring-1 ring-status-info-bg",
20
- waiting: "border-border-default",
18
+ hearing: "boff-dock boff-dock--listening",
19
+ talking: "boff-dock boff-dock--speaking",
20
+ waiting: "boff-dock boff-dock--thinking",
21
21
  off: "border-border-default",
22
22
  error: "border-status-error-bg"
23
23
  }, y = {
24
- hearing: "bg-status-warning-bg-subtle text-status-warning-bg",
25
- talking: "bg-status-info-bg-subtle text-status-info-bg",
26
- waiting: "bg-bg-sunken text-text-secondary",
24
+ hearing: "boff-orb boff-orb--listening boff-ripple",
25
+ talking: "boff-orb boff-orb--speaking boff-ripple boff-ripple--fill",
26
+ waiting: "boff-orb boff-orb--thinking",
27
27
  off: "bg-bg-sunken text-text-muted",
28
28
  error: "bg-status-error-bg-subtle text-status-error-text"
29
- }, b = ({ level: e }) => {
29
+ }, b = {
30
+ hearing: "boff-text-listening",
31
+ talking: "boff-text-speaking",
32
+ waiting: "boff-text-thinking",
33
+ off: "",
34
+ error: ""
35
+ }, x = ({ level: e }) => {
30
36
  let t = r(), n = u([]);
31
37
  return l(() => {
32
38
  if (t) return;
@@ -53,22 +59,22 @@ var v = {
53
59
  className: "h-full w-[3px] origin-center scale-y-[0.35] rounded-full bg-current transition-transform duration-75"
54
60
  }, e))
55
61
  });
56
- }, x = ({ tone: e, level: t }) => {
62
+ }, S = ({ tone: e, level: t }) => {
57
63
  let n = r();
58
64
  return /* @__PURE__ */ h("span", {
59
65
  "aria-hidden": "true",
60
66
  className: `flex size-11 shrink-0 items-center justify-center rounded-full ${y[e]}`,
61
67
  "data-testid": "assistant-voice-circle",
62
68
  "data-tone": e,
63
- children: e === "hearing" || e === "talking" ? /* @__PURE__ */ h(b, { level: t }) : e === "off" || e === "error" ? /* @__PURE__ */ h(p, { className: "size-5" }) : /* @__PURE__ */ h(f, { className: `size-5${n ? "" : " motion-safe:animate-spin"}` })
69
+ children: e === "hearing" || e === "talking" ? /* @__PURE__ */ h(x, { level: t }) : e === "off" || e === "error" ? /* @__PURE__ */ h(p, { className: "size-5" }) : /* @__PURE__ */ h(f, { className: `size-5${n ? "" : " motion-safe:animate-spin"}` })
64
70
  });
65
71
  };
66
- function S(e, t) {
72
+ function C(e, t) {
67
73
  if (t.heard) return t.heard;
68
74
  let n = e("voiceDock.listeningCaption", "Go ahead, I am listening.");
69
75
  return t.stage === "listening" && t.stageText === e("voiceSession.listening", "Listening…") ? n : t.stageText || n;
70
76
  }
71
- function C(e, t) {
77
+ function w(e, t) {
72
78
  let { stage: n } = t;
73
79
  return n === "mic-error" ? {
74
80
  title: e("voiceDock.problem", "Microphone problem"),
@@ -87,20 +93,20 @@ function C(e, t) {
87
93
  caption: t.bargeIn ? e("voiceDock.speakingCaption", "Speak or tap Interrupt to cut in.") : e("voiceDock.speakingCaptionTap", "Tap Interrupt to cut in.")
88
94
  } : {
89
95
  title: e("voiceDock.listening", "Listening"),
90
- caption: S(e, t)
96
+ caption: C(e, t)
91
97
  };
92
98
  }
93
- function w(t) {
94
- return C(e(), t);
99
+ function T(t) {
100
+ return w(e(), t);
95
101
  }
96
- function T() {
102
+ function E() {
97
103
  let [e, t] = d(0);
98
104
  return l(() => {
99
105
  let e = Date.now(), n = setInterval(() => t(Math.floor((Date.now() - e) / 1e3)), 1e3);
100
106
  return () => clearInterval(n);
101
107
  }, []), e;
102
108
  }
103
- function E(e) {
109
+ function D(e) {
104
110
  let t = u(null);
105
111
  l(() => {
106
112
  if (typeof document < "u") return t.current = document.title, () => {
@@ -110,7 +116,7 @@ function E(e) {
110
116
  typeof document < "u" && t.current !== null && (document.title = `${e} · ${t.current}`);
111
117
  }, [e]);
112
118
  }
113
- var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r }) => /* @__PURE__ */ g(m, { children: [
119
+ var O = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r }) => /* @__PURE__ */ g(m, { children: [
114
120
  /* @__PURE__ */ g("div", {
115
121
  className: "flex flex-col items-center gap-1 px-1 text-center text-xs empty:hidden [&:not(:empty)]:pb-1.5",
116
122
  "data-testid": "assistant-voice-page-notices",
@@ -150,7 +156,7 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
150
156
  "data-testid": "assistant-voice-started-cue-announced",
151
157
  children: r
152
158
  })
153
- ] }), O = "flex h-11 shrink-0 items-center justify-center gap-1.5 rounded-full border px-4 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:cursor-default disabled:opacity-50 sm:h-10", k = `${O} border-border-default bg-bg-elevated text-text-primary hover:bg-bg-sunken`, A = (t) => {
159
+ ] }), k = "flex h-11 shrink-0 items-center justify-center gap-1.5 rounded-full border px-4 text-sm font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)] disabled:cursor-default disabled:opacity-50 sm:h-10", A = `${k} border-border-default bg-bg-elevated text-text-primary hover:bg-bg-sunken`, j = (t) => {
154
160
  let n = e(), { muted: r, stage: a, hold: o, onAttachFiles: s, endRef: c, onEnd: d, onInterrupt: f, onToggleMute: p } = t, m = a === "speaking" && !r, _ = u(null), v = u(!1);
155
161
  return l(() => {
156
162
  !m && v.current && (v.current = !1, _.current?.focus());
@@ -164,7 +170,7 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
164
170
  onClick: p,
165
171
  disabled: t.muteDisabled,
166
172
  "aria-pressed": r,
167
- className: k,
173
+ className: A,
168
174
  "data-testid": "assistant-voice-mute",
169
175
  children: r ? n("window.unmute", "Unmute") : n("window.mute", "Mute")
170
176
  }),
@@ -179,14 +185,14 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
179
185
  onBlur: () => {
180
186
  v.current = !1;
181
187
  },
182
- className: k,
188
+ className: A,
183
189
  "data-testid": "assistant-voice-interrupt",
184
190
  children: n("voiceDock.interrupt", "Interrupt")
185
191
  }) : null,
186
192
  o ? /* @__PURE__ */ h("button", {
187
193
  type: "button",
188
194
  onClick: o.onPress,
189
- className: o.holding ? `${O} border-transparent bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover` : k,
195
+ className: o.holding ? `${k} border-transparent bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg-hover` : A,
190
196
  title: o.holding ? n("voiceSession.imDoneHint", "Send what you said now") : n("voiceSession.letMeFinishHint", "Pause sending until you tap “I’m done”"),
191
197
  "data-testid": "assistant-voice-hold",
192
198
  "data-holding": o.holding ? "true" : "false",
@@ -205,17 +211,17 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
205
211
  ref: c,
206
212
  type: "button",
207
213
  onClick: d,
208
- className: `${O} basis-full border-transparent bg-text-primary text-bg-elevated hover:opacity-90 sm:basis-auto`,
214
+ className: `${k} basis-full border-transparent bg-text-primary text-bg-elevated hover:opacity-90 sm:basis-auto`,
209
215
  title: n("voiceSession.end", "End the voice conversation"),
210
216
  "data-testid": "assistant-voice-end",
211
217
  children: n("voiceDock.end", "End voice chat")
212
218
  })
213
219
  ]
214
220
  });
215
- }, j = (r) => {
216
- let i = e(), { rootRef: l, stage: u, muted: d, attachments: f, preparingAttachments: p, attachmentsLocked: m } = r, y = _(u, d), b = w(r), S = T();
217
- E(b.title);
218
- let C = f.length > 0 || p > 0;
221
+ }, M = (r) => {
222
+ let i = e(), { rootRef: l, stage: u, muted: d, attachments: f, preparingAttachments: p, attachmentsLocked: m } = r, y = _(u, d), x = T(r), C = E();
223
+ D(x.title);
224
+ let w = f.length > 0 || p > 0;
219
225
  return /* @__PURE__ */ g("div", {
220
226
  ref: l,
221
227
  role: "region",
@@ -225,14 +231,14 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
225
231
  "data-presentation": "page",
226
232
  [n]: "",
227
233
  children: [
228
- /* @__PURE__ */ h(D, { ...r }),
234
+ /* @__PURE__ */ h(O, { ...r }),
229
235
  /* @__PURE__ */ g("div", {
230
236
  className: `flex flex-col gap-1 rounded-3xl border bg-bg-elevated transition-colors ${v[y]}`,
231
237
  "data-testid": "assistant-voice-page-bar",
232
238
  "data-state": u,
233
239
  "data-tone": y,
234
240
  children: [
235
- C ? /* @__PURE__ */ h("div", {
241
+ w ? /* @__PURE__ */ h("div", {
236
242
  className: "px-3 pt-3",
237
243
  "data-testid": "assistant-voice-attachments",
238
244
  children: /* @__PURE__ */ h(a, {
@@ -246,27 +252,27 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
246
252
  /* @__PURE__ */ g("div", {
247
253
  className: "flex items-center gap-3 px-3 pt-3",
248
254
  children: [
249
- /* @__PURE__ */ h(x, {
255
+ /* @__PURE__ */ h(S, {
250
256
  tone: y,
251
257
  level: r.level
252
258
  }),
253
259
  /* @__PURE__ */ g("div", {
254
260
  className: "min-w-0 flex-1",
255
261
  children: [/* @__PURE__ */ h("p", {
256
- className: "text-base font-semibold text-text-primary",
262
+ className: `text-base font-semibold text-text-primary ${b[y]}`,
257
263
  "data-testid": "assistant-voice-title",
258
- children: b.title
264
+ children: x.title
259
265
  }), /* @__PURE__ */ h("p", {
260
266
  className: `line-clamp-2 text-sm ${r.heard ? "text-text-primary" : "text-text-secondary"}`,
261
267
  "data-testid": r.heard ? "assistant-voice-heard" : "assistant-voice-caption-line",
262
- children: b.caption
268
+ children: x.caption
263
269
  })]
264
270
  }),
265
271
  /* @__PURE__ */ h("span", {
266
272
  className: "shrink-0 self-start text-xs tabular-nums text-text-secondary",
267
273
  "aria-hidden": "true",
268
274
  "data-testid": "assistant-voice-time",
269
- children: o(S)
275
+ children: o(C)
270
276
  })
271
277
  ]
272
278
  }),
@@ -276,7 +282,7 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
276
282
  rotating: r.rotateStatus,
277
283
  className: "sr-only"
278
284
  }),
279
- /* @__PURE__ */ h(A, { ...r })
285
+ /* @__PURE__ */ h(j, { ...r })
280
286
  ]
281
287
  }),
282
288
  r.privacyNotice ? /* @__PURE__ */ h(s, {
@@ -287,4 +293,4 @@ var D = ({ notice: e, announcedNotice: t, attachmentNotice: n, startedCue: r })
287
293
  ]
288
294
  });
289
295
  };
290
- export { j as AssistantPageVoiceBar };
296
+ export { M as AssistantPageVoiceBar };
@@ -1,18 +1,19 @@
1
1
  import { useAssistantTr as e } from "../../i18n.js";
2
- import { AudioLines as t } from "lucide-react";
3
- import { jsx as n } from "react/jsx-runtime";
2
+ import { useAssistantPageLayout as t } from "../assistantPageLayout.js";
3
+ import { AudioLines as n } from "lucide-react";
4
+ import { jsx as r } from "react/jsx-runtime";
4
5
  // src/shared/assistant/ui/voice/AssistantVoiceSessionButton.tsx
5
- var r = ({ onStart: r, disabled: i = !1, compact: a = !1, invisible: o = !1 }) => {
6
- let s = e();
7
- return /* @__PURE__ */ n("button", {
6
+ var i = ({ onStart: i, disabled: a = !1, compact: o = !1, invisible: s = !1 }) => {
7
+ let c = e(), l = t();
8
+ return /* @__PURE__ */ r("button", {
8
9
  type: "button",
9
- onClick: r,
10
- disabled: i,
11
- className: a ? `flex size-11 shrink-0 items-center justify-center rounded-full 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-[var(--color-focus-ring)] disabled:cursor-not-allowed disabled:opacity-50 sm:size-10${o ? " invisible" : ""}` : "flex size-9 flex-shrink-0 items-center justify-center rounded-full bg-bg-elevated text-text-secondary shadow-sm transition-all hover:scale-105 hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:scale-100",
12
- "aria-label": s("voiceSession.start", "Start a voice conversation"),
13
- title: s("voiceSession.start", "Start a voice conversation"),
10
+ onClick: i,
11
+ disabled: a,
12
+ className: o ? `flex size-11 shrink-0 items-center justify-center rounded-full 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-[var(--color-focus-ring)] disabled:cursor-not-allowed disabled:opacity-50 sm:size-10${l ? " boff-voice-start" : ""}${s ? " invisible" : ""}` : "flex size-9 flex-shrink-0 items-center justify-center rounded-full bg-bg-elevated text-text-secondary shadow-sm transition-all hover:scale-105 hover:bg-bg-raised hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:scale-100",
13
+ "aria-label": c("voiceSession.start", "Start a voice conversation"),
14
+ title: c("voiceSession.start", "Start a voice conversation"),
14
15
  "data-testid": "assistant-voice-session-start",
15
- children: /* @__PURE__ */ n(t, { className: a ? "size-5" : "size-4" })
16
+ children: /* @__PURE__ */ r(n, { className: o ? "size-5" : "size-4" })
16
17
  });
17
18
  };
18
- export { r as AssistantVoiceSessionButton };
19
+ export { i as AssistantVoiceSessionButton };
@@ -1,52 +1,53 @@
1
1
  import { pushLevel as e } from "../../voice/liveLevel.js";
2
2
  import { usePrefersReducedMotion as t } from "../usePrefersReducedMotion.js";
3
- import { useEffect as n, useRef as r } from "react";
4
- import { jsx as i } from "react/jsx-runtime";
3
+ import { useAssistantPageLayout as n } from "../assistantPageLayout.js";
4
+ import { useEffect as r, useRef as i } from "react";
5
+ import { jsx as a } from "react/jsx-runtime";
5
6
  // src/shared/assistant/ui/voice/LiveWaveform.tsx
6
- var a = 3, o = 2, s = 2, c = ({ source: c, tone: l, className: u = "", testId: d }) => {
7
- let f = t(), p = r(null), m = r(null);
8
- return n(() => {
9
- let t = p.current, n = m.current;
7
+ var o = 3, s = 2, c = 2, l = ({ source: l, tone: u, className: d = "", testId: f }) => {
8
+ let p = t(), m = n(), h = i(null), g = i(null);
9
+ return r(() => {
10
+ let t = h.current, n = g.current;
10
11
  if (!t || !n) return;
11
12
  let r = typeof n.getContext == "function" ? n.getContext("2d") : null;
12
13
  if (!r) return;
13
- let i = 0, l = 0, u = 0, d = [], h = "", g = () => {
14
- if (i === 0 || l === 0) return;
14
+ let i = 0, a = 0, u = 0, d = [], f = "", m = () => {
15
+ if (i === 0 || a === 0) return;
15
16
  let e = typeof window > "u" ? 1 : window.devicePixelRatio || 1;
16
- r.setTransform(e, 0, 0, e, 0, 0), r.clearRect(0, 0, i, l), r.fillStyle = h;
17
- let t = u * 5 - o, n = i - t;
17
+ r.setTransform(e, 0, 0, e, 0, 0), r.clearRect(0, 0, i, a), r.fillStyle = f;
18
+ let t = u * 5 - s, n = i - t;
18
19
  for (let e = 0; e < u; e += 1) {
19
- let t = f ? 0 : d[e] ?? 0, i = Math.max(s, t * l), o = n + e * 5, c = (l - i) / 2, u = Math.min(a / 2, i / 2);
20
- typeof r.roundRect == "function" ? (r.beginPath(), r.roundRect(o, c, a, i, u), r.fill()) : r.fillRect(o, c, a, i);
20
+ let t = p ? 0 : d[e] ?? 0, i = Math.max(c, t * a), s = n + e * 5, l = (a - i) / 2, u = Math.min(o / 2, i / 2);
21
+ typeof r.roundRect == "function" ? (r.beginPath(), r.roundRect(s, l, o, i, u), r.fill()) : r.fillRect(s, l, o, i);
21
22
  }
22
23
  }, _ = () => {
23
24
  let e = t.getBoundingClientRect(), r = typeof window > "u" ? 1 : window.devicePixelRatio || 1;
24
- for (i = Math.max(0, Math.floor(e.width)), l = Math.max(0, Math.floor(e.height)), n.width = Math.round(i * r), n.height = Math.round(l * r), n.style.width = `${i}px`, n.style.height = `${l}px`, u = Math.max(0, Math.floor((i + o) / 5)), d = d.length > u ? d.slice(d.length - u) : d; d.length < u;) d.unshift(0);
25
- h = typeof getComputedStyle == "function" ? getComputedStyle(n).color : "", g();
25
+ for (i = Math.max(0, Math.floor(e.width)), a = Math.max(0, Math.floor(e.height)), n.width = Math.round(i * r), n.height = Math.round(a * r), n.style.width = `${i}px`, n.style.height = `${a}px`, u = Math.max(0, Math.floor((i + s) / 5)), d = d.length > u ? d.slice(d.length - u) : d; d.length < u;) d.unshift(0);
26
+ f = typeof getComputedStyle == "function" ? getComputedStyle(n).color : "", m();
26
27
  };
27
28
  _();
28
29
  let v = typeof ResizeObserver > "u" ? null : new ResizeObserver(_);
29
30
  v?.observe(t);
30
- let y = c.subscribe((t) => {
31
- f || (d = e(d, t, u), g());
31
+ let y = l.subscribe((t) => {
32
+ p || (d = e(d, t, u), m());
32
33
  });
33
34
  return () => {
34
35
  y(), v?.disconnect();
35
36
  };
36
37
  }, [
37
- c,
38
38
  l,
39
- f
40
- ]), /* @__PURE__ */ i("div", {
41
- ref: p,
42
- className: `relative min-w-0 overflow-hidden ${u}`,
39
+ u,
40
+ p
41
+ ]), /* @__PURE__ */ a("div", {
42
+ ref: h,
43
+ className: `relative min-w-0 overflow-hidden ${d}`,
43
44
  "aria-hidden": "true",
44
- "data-testid": d,
45
- "data-tone": l,
46
- children: /* @__PURE__ */ i("canvas", {
47
- ref: m,
48
- className: `absolute inset-0 ${l === "speaking" ? "text-status-info-bg" : "text-status-warning-bg"}`
45
+ "data-testid": f,
46
+ "data-tone": u,
47
+ children: /* @__PURE__ */ a("canvas", {
48
+ ref: g,
49
+ className: `absolute inset-0 ${u === "speaking" ? "text-status-info-bg" : "text-status-warning-bg"}${m ? u === "speaking" ? " boff-text-speaking" : " boff-text-listening" : ""}`
49
50
  })
50
51
  });
51
52
  };
52
- export { c as LiveWaveform };
53
+ export { l as LiveWaveform };